jonnybarnes.uk/public/assets/js/newnote.js

29 lines
482 KiB
JavaScript
Raw Normal View History

!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],n=e[1].split(" ")[1];return{latitude:n,longitude:r}}e.a=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?t:Array.from(t)}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=t.dataset.latitude,o=t.dataset.longitude,l=t.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=n){var p=!0,f=!1,d=void 0;try{for(var m,y=n[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var v=m.value,g=r.i(s.a)(v.location).longitude,_=r.i(s.a)(v.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[g,_]},properties:{title:v.name,icon:"circle",uri:v.slug}})}}catch(t){f=!0,d=t}finally{try{!p&&y.return&&y.return()}finally{if(f)throw d}}}if(null!=e){e.coords.longitude,e.coords.latitude}var map=new a.a.Map({container:t,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==e&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),t.appendChild(h(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),null!=e&&map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var x=new a.a.LngLatBounds,b=!0,w=!1,E=void 0;try{for(var T,S=c.features[Symbol.iterator]();!(b=(T=S.next()).done);b=!0){var z=T.value;x.extend(z.geometry.coordinates)}}catch(t){w=!0,E=t}finally{try{!b&&S.return&&S.return()}finally{if(w)throw E}}map.fitBounds(x,{padding:65})}return map}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i,a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var l=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},c=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(l(e))),t.appendChild(n),t.appendChild(i)},h=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),c(map,t,"streets",!0),c(map,t,"satellite-streets"),t}},function(t,e,r){(function(t){var n;!function(){"use strict";function i(){var t={parent:document.body,version:"1.0.12",defaultOkLabel:"Ok",okLabel:"Ok",defaultCancelLabel:"Cancel",cancelLabel:"Cancel",defaultMaxLogItems:2,maxLogItems:2,promptValue:"",promptPlaceholder:"",closeLogOnClick:!1,closeLogOnClickDefault:!1,delay:5e3,defaultDelay:5e3,logContainerClass:"alertify-logs",logContainerDefaultClass:"alertify-logs",dialogs:{buttons:{holder:"<nav>{{buttons}}</nav>",ok:"<button clas
Updating codebase to use es6/7 Squashed commit of the following: commit 07b27d00f135a521143154a2e77abdc1680b7d5b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 14:59:35 2017 +0000 Fix styleci.io issue commit 9e67f0a96484f8047f22d13abb4cd41c2e44b95d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 08:28:22 2017 +0000 Remove some unused dependencies commit 3c65070f3ff2aec10d821ae9f12821bc08e37d0a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 18:00:10 2017 +0000 Compressed webpack/babel output commit 694c43d1a9a6c8cb84d4cc789a6643b8d2863cec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:59:27 2017 +0000 Let’s compress the es5 output commit debffc0e41760fcc87e6d3768163e6ed8ea5d98c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:45:05 2017 +0000 webpack/babel generated es5 assets commit 1e978d6c5795f230ab320f94ad2fb98871bb6fa5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:36:52 2017 +0000 Allow content of micropub form page to be persisted commit 44fb8026962ef574700f07ef93d18bdb38cdedb2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:35:58 2017 +0000 Name the micropub form commit 732abaf561bf9d6392fe506d30d320e9c17b8226 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:34:39 2017 +0000 Add webStorage dependency commit a4520085dfc673c5c3d940150358b8ecc3cdf022 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 16 12:32:33 2017 +0000 No need for a form id on the micropub form untill form autosave is added commit a182be46a616d8e4085be5e24cbd3623f13cc28d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Jan 14 20:37:31 2017 +0000 Polyfill fetch and promise only in older browsers using unpkg.com commit fdc044150dc8e2b755f93119b196ba0455bbbb83 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:46:05 2017 +0000 Generated js from webpack/babel commit d24e6aa9fff38823a0c667e6f9e43dcb2ca179c4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:45:32 2017 +0000 Lots of es6 to generate and add map, particularly the new note form commit e7004a9fe475e07d43de905fb00d51c659878474 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:44:54 2017 +0000 Don’t link to commons.js, it aint being made at the moment commit d4a2e4e143b644287f9da109eb2850c2361b2f20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:43:27 2017 +0000 Temporarily don’t optimize JS commit 05623de122da7d88642af60f85e5320a3ff651fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:24:15 2017 +0000 Add places to geojson data commit 3eb1a4f29bb4263b9998a6f3f53abb7d1eeff520 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:22:53 2017 +0000 Use alertify.js to give relevant feedback to user commit 6f123fa178d6cd19528130ebd78157c37eaab1a1 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:21:24 2017 +0000 Add alertify.css back commit 89fca3b3aeb23ef97fb767514e0502298d1b83fd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:19:56 2017 +0000 Webpack’d javascript commit 94ab60f34079238ed6228bf6e789f14d7a09823b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:10:17 2017 +0000 Webpack’d javascript commit 1ca3a55a27c20ea08633b589023fe5ad1acb2b68 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:09:06 2017 +0000 Define const functions in order of usage commit dc5535b32a357611860e0e98fcdc7d9c12c5d383 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:55 2017 +0000 Link to correct js files with defer option commit 42f0e5b85825943ed148736e8e0fe22f5654ae90 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:18 2017 +0000 New webpacked es6 code commit 300443bb0ce7b65bda1cf550fe5c7173a89edaf3 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:49:44 2017 +0000 Moving towards consolidated es6 map code commit b1001760e03dd358f896feb90dd3acc0bc6728fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:44:40 2017 +0000 Don’t mangle the fetch function commit 289e59025634b6d2569b73ae87e3ea4942034e33 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:43:47 2017 +0000 Updated yarn/npm dependencies commit 3439b008e6bd96d8c45591c2a945c4ac246440ec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:58:50 2016 +0000 Link to the correct assets on the new note page commit 81dc83e362266028f8336ae5a27e92c8c8a2b6dc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:57:46 2016 +0000 Add a map to the new note page commit 5101ecd3dd60cd78e9a4bce81a5e60a2f575bc57 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:56:54 2016 +0000 Bundle common JS between entry points commit 1f916adcfd1b07df388417b6bd800e109cec543c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:55:31 2016 +0000 Add geojson to individual notes commit 7a6ae8ca49b4ca49413ddb977f7b534f62b41c20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:53:30 2016 +0000 Link to self-hosted mapbox-gl.css commit 8be006ec2b738cbcebd06283e18c292b3efd7d16 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:52:41 2016 +0000 Use self-hosted mapbox-gl css, and a better default geojson title value commit 5ec480842a2194a071b6a23ae181a8de5b8d47cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:46 2016 +0000 Access geojson data to markup map correctly commit f2f1d7563f7b0cb7cc62658cc2817e56d2b47c31 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:07 2016 +0000 Generate geojson data for places commit 9f8c9ba02f7ac37b4ab81aad2fb0cd2c077c45cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 23 11:55:10 2016 +0000 Use geojson to add a default you location point commit 3da499d3ea6a214f8008d1b98f9b0c2f31ecba0c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:29:18 2016 +0000 Some code cleaning commit 39376097eda82491df272cc214d70ff3095d4873 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:21:29 2016 +0000 Use satellite streets view commit f3db8f43fc403bc180e24d63e21c8311441cb2b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 16:46:03 2016 +0000 Semi working map state, still need to add own css, and add marker commit 5f398a642b9db67f4b0733988c20138b37d2141d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:17:04 2016 +0000 Reference new maps.js with bundled mapbox commit bad97649a623c5552e6b607a1975aa2de8131191 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:16:25 2016 +0000 Add mapbox-gl again commit 47484962e7620aa7a9a5153cfc03e2ba4030dd5c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 21 00:03:23 2016 +0000 Early working version of maps.js commit e53e0f39952a65996c09b06fd35918ffabed0de2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 17:14:17 2016 +0000 Setup webpack commit f930a1e2bd7d18809bd40d0cc22f9c3af75f1984 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 15:00:42 2016 +0000 Add webpack v2 commit b16e8d62db071155a8b5fb216d3d60ebf6fa9468 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:47 2016 +0000 Define default settings for babel commit 97c13cb753e08d25aa48ecff579efa05173a2c81 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:31 2016 +0000 Add babeljs commit dd9efc3b056cf96323d7f11acff0fb1ab137caef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:49:23 2016 +0000 Remove old javascript commit ab99c251ad5847b48d347e2c9426077b3ba8e0f5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 16 13:26:10 2016 +0000 update readme to reflect changes to how syndication targets need to be set
2017-01-26 15:21:21 +00:00
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).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}},a.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):g.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),h=0;h<u;++h)if(l[h]!==c[h]){o=l[h],s=c[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},a.prototype.indexOf=function(t,e,r){return x(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return x(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(thi
var q=V[N];A(q,new h(q[0].x,q[0].y,0))}else if("Point"===t.type)for(var Z=0,G=t.geometry;Z<G.length;Z+=1)for(var X=G[Z],W=0,H=X;W<H.length;W+=1){var Y=H[W];A([Y],new h(Y.x,Y.y,0))}},D.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],o=i.length-1;o>=0;o--)if(r.dist(i[o])<e)return!0}else n[t]=[];return n[t].push(r),!1},D.prototype.place=function(t,e){var r=this;this.createArrays();var n=this.layers[0].layout,i=t.maxScale,o="map"===n["text-rotation-alignment"]&&"line"===n["symbol-placement"],a="map"===n["icon-rotation-alignment"]&&"line"===n["symbol-placement"],s=n["text-allow-overlap"]||n["icon-allow-overlap"]||n["text-ignore-placement"]||n["icon-ignore-placement"];if(s){var u=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),l=t.angle,c=Math.sin(l),h=Math.cos(l);this.sortedSymbolInstances=u.sort(function(t,e){var r=c*t.anchorPointX+h*t.anchorPointY|0,n=c*e.anchorPointX+h*e.anchorPointY|0;return r-n||e.index-t.index})}for(var p=this.symbolInstancesStartIndex;p<this.symbolInstancesEndIndex;p++){var f=r.sortedSymbolInstances?r.sortedSymbolInstances[p-r.symbolInstancesStartIndex]:r.symbolInstancesArray.get(p),d={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},m={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},y=!(f.textBoxStartIndex===f.textBoxEndIndex),v=!(f.iconBoxStartIndex===f.iconBoxEndIndex),g=n["text-optional"]||!y,_=n["icon-optional"]||!v,x=y?t.placeCollisionFeature(d,n["text-allow-overlap"],n["symbol-avoid-edges"]):t.minScale,b=v?t.placeCollisionFeature(m,n["icon-allow-overlap"],n["symbol-avoid-edges"]):t.minScale;g||_?!_&&x?x=Math.max(b,x):!g&&b&&(b=Math.max(b,x)):b=x=Math.max(b,x),y&&(t.insertCollisionFeature(d,x,n["text-ignore-placement"]),x<=i&&r.addSymbols(r.arrays.glyph,f.glyphQuadStartIndex,f.glyphQuadEndIndex,x,n["text-keep-upright"],o,t.angle,f.writingModes)),v&&(t.insertCollisionFeature(m,b,n["icon-ignore-placement"]),b<=i&&r.addSymbols(r.arrays.icon,f.iconQuadStartIndex,f.iconQuadEndIndex,b,n["icon-keep-upright"],a,t.angle))}e&&this.addToDebugBuffers(t)},D.prototype.addSymbols=function(t,e,r,i,o,a,s,u){for(var l=this,c=t.elementArray,h=t.layoutVertexArray,p=this.zoom,f=Math.max(Math.log(i)/Math.LN2+p,0),d=e;d<r;d++){var m=l.symbolQuadsArray.get(d).SymbolQuad,y=(m.anchorAngle+s+Math.PI)%(2*Math.PI);if(u&P.vertical){if(a&&m.writingMode===P.vertical){if(o&&a&&y<=5*Math.PI/4||y>7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(p+Math.log(m.minScale)/Math.LN2,f),T=Math.min(p+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(h,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(h,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(h,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(h,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},D.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;l<this.symbolInstancesEndIndex;l++){var c=e.symbolInstancesArray.get(l);c.textCollisionFeature={boxStartIndex:c.textBoxStartIndex,boxEndIndex:c.textBoxEndIndex},c.iconCollisionFeature={boxStartIndex:c.iconBoxStartIndex,boxEndIndex:c.iconBoxEndIndex};for(var h=0;h<2;h++){var p=c[0===h?"textCollisionFeature":"iconCollisionFeature"];if(p)for(var f=p.boxStartIndex;f<p.boxEndIndex;f++){var d=e.collisionBoxArray.get(f),m=d.anchorPoint,y=new o(d.x1,d.y1*u)._rotate(s),v=new o(d.x2,d.y1*u)._rotate(s),g=new o(d.x1,d.y2*u)._rotate(s),_=new o(d.x2,d.y2*u)._rotate(s),x=Math.max(0,Math.min(25,e.zoom+Math.log(d.maxScale)/Math.LN2)),b=Math.max(0,Math.min(25,e.zoom+Math.log(d.placementScale)/Math.LN2)),w=r.prepareSegment(4),E=w.vertexLength;i(n,m,y,x,b),i(n,m,v,x,b),i(n,m,_,x,b),i(n,m,g,x,b),a.emplaceBack(E,E+1),a.emplaceBa
C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1
r.isOpaquePass||e.reverse()),r.renderLayer(r,t,o,e),r.currentLayer+=r.isOpaquePass?-1:1}},v.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},v.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||n.length)&&(this.id=r.id,y[r.type](t,e,r,n))},v.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},v.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var o=Math.sin(-this.transform.angle),a=Math.cos(-this.transform.angle);r=[r[0]*a-r[1]*o,r[0]*o+r[1]*a]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return i.translate(l,t,s),l},v.prototype.saveTileTexture=function(t){var e=this.reusableTextures.tiles[t.size];e?e.push(t):this.reusableTextures.tiles[t.size]=[t]},v.prototype.saveViewportTexture=function(t){this.reusableTextures.viewport=t},v.prototype.getTileTexture=function(t){var e=this.reusableTextures.tiles[t];return e&&e.length>0?e.pop():null},v.prototype.getViewportTexture=function(t,e){var r=this.reusableTextures.viewport;if(r)return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport=null))},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);var r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},h=0;h<l;h++){var p=r.getActiveAttrib(i,h);c[p.name]=r.getAttribLocation(i,p.name)}for(var f=r.getProgramParameter(i,r.ACTIVE_UNIFORMS),d=0;d<f;d++){var y=r.getActiveUniform(i,d);c[y.name]=r.getUniformLocation(i,y.name)}return c},v.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=this.createProgram(t,e)),this.cache[r]},v.prototype.useProgram=function(t,e){var r=this.gl,n=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.currentProgram!==n&&(r.useProgram(n.program),this.currentProgram=n),n},e.exports=v},{"../data/buffer":8,"../data/extent":11,"../data/pos_array":14,"../data/program_configuration":15,"../data/raster_bounds_array":16,"../source/pixels_to_tile_units":46,"../source/source_cache":51,"../util/browser":110,"../util/util":129,"./draw_background":25,"./draw_circle":26,"./draw_debug":28,"./draw_fill":29,"./draw_fill_extrusion":30,"./draw_line":31,"./draw_raster":32,"./draw_symbol":33,"./frame_history":34,"./shaders":38,"./vertex_array_object":39,"@mapbox/gl-matrix":133}],37:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units");r.prepare=function(t,e,r){var n=e.gl,i=e.spriteAtlas.getPosition(t.from,!0),o=e.spriteAtlas.getPosition(t.to,!0);i&&o&&(n.uniform1i(r.u_image,0),n.uniform2fv(r.u_pattern_tl_a,i.tl),n.uniform2fv(r.u_pattern_br_a,i.br),n.uniform2fv(r.u_pattern_tl_b,o.tl),n.uniform2fv(r.u_pattern_br_b,o.br),n.uniform1f(r.u_mix,t.t),n.uniform2fv(r.u_pattern_size_a,i.size),n.uniform2fv(r.u_pattern_size_b,o.size),n.uniform1f(r.u_scale_a,t.fromScale),n.uniform1f(r.u_scale_b,t.toScale),n.a
vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSou
n._cache.get(t.id)}},e.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r,i=5;this._cache.setMaxSize(Math.floor(n*i))},e.prototype.update=function(t){var r=this;if(this._sourceLoaded){var n,i,a,s;this.updateCacheSize(t);var u=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),c=Math.max(u-e.maxOverzooming,this._source.minzoom),h=Math.max(u+e.maxUnderzooming,this._source.minzoom),f={};this._coveredTiles={};var d;for(d=this.used?this._source.coord?[this._source.coord]:t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}):[],n=0;n<d.length;n++)i=d[n],a=r.addTile(i),f[i.id]=!0,a.hasData()||r.findLoadedChildren(i,h,f)||(s=r.findLoadedParent(i,c,f),s&&r.addTile(s.coord));var m={};if(o(this._source.type))for(var y=Object.keys(f),v=0;v<y.length;v++){var g=y[v];i=l.fromID(g),a=r._tiles[g],a&&("undefined"==typeof a.fadeEndTime||a.fadeEndTime>=Date.now())&&(r.findLoadedChildren(i,h,f)&&(f[g]=!0),s=r.findLoadedParent(i,c,m),s&&r.addTile(s.coord))}var _;for(_ in m)f[_]||(r._coveredTiles[_]=!0);for(_ in m)f[_]=!0;var x=p.keysDifference(this._tiles,f);for(n=0;n<x.length;n++)r.removeTile(+x[n]);this.transform=t}},e.prototype.addTile=function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped();if(e=this._tiles[r.id],e||(e=this._cache.get(r.id),e&&(e.redoPlacement(this._source),this._cacheTimers[r.id]&&(clearTimeout(this._cacheTimers[r.id]),this._cacheTimers[r.id]=void 0,this._setTileReloadTimer(r.id,e)))),!e){var n=t.z,i=n>this._source.maxzoom?Math.pow(2,n-this._source.maxzoom):1;e=new s(r,this._source.tileSize*i,this._source.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e,t.id))}return e.uses++,this._tiles[t.id]=e,this._source.fire("dataloading",{tile:e,coord:e.coord,dataType:"tile"}),e},e.prototype._setTileReloadTimer=function(t,e){var r=this,n=e.getExpiry();n&&(this._timers[t]=setTimeout(function(){r.reloadTile(t,"expired"),r._timers[t]=void 0},n-(new Date).getTime()))},e.prototype._setCacheInvalidationTimer=function(t,e){var r=this,n=e.getExpiry();n&&(this._cacheTimers[t]=setTimeout(function(){r._cache.remove(t),r._cacheTimers[t]=void 0},n-(new Date).getTime()))},e.prototype.removeTile=function(t){var e=this._tiles[t];if(e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),this._timers[t]=void 0),this._source.fire("data",{tile:e,coord:e.coord,dataType:"tile"}),!(e.uses>0)))if(e.hasData()){var r=e.coord.wrapped().id;this._cache.add(r,e),this._setCacheInvalidationTimer(r,e)}else e.aborted=!0,this.abortTile(e),this.unloadTile(e)},e.prototype.clearTiles=function(){var t=this;for(var e in this._tiles)t.removeTile(e);this._cache.reset()},e.prototype.tilesIn=function(t){for(var e=this,r={},i=this.getIds(),o=1/0,a=1/0,s=-(1/0),u=-(1/0),c=t[0].zoom,p=0;p<t.length;p++){var d=t[p];o=Math.min(o,d.column),a=Math.min(a,d.row),s=Math.max(s,d.column),u=Math.max(u,d.row)}for(var m=0;m<i.length;m++){var y=e._tiles[i[m]],v=l.fromID(i[m]),g=[n(v,y.sourceMaxZoom,new h(o,a,c)),n(v,y.sourceMaxZoom,new h(s,u,c))];if(g[0].x<f&&g[0].y<f&&g[1].x>=0&&g[1].y>=0){for(var _=[],x=0;x<t.length;x++)_.push(n(v,y.sourceMaxZoom,t[x]));var b=r[y.coord.id];void 0===b&&(b=r[y.coord.id]={tile:y,coord:v,queryGeometry:[],scale:Math.pow(2,e.transform.zoom-y.coord.z)}),b.queryGeometry.push(_)}}var w=[];for(var E in r)w.push(r[E]);return w},e.prototype.redoPlacement=function(){for(var t=this,e=this.getIds(),r=0;r<e.length;r++){var n=t.getTileByID(e[r]);n.redoPlacement(t._source)}},e.prototype.getVisibleCoordinates=function(){for(var t=this,e=this.getRenderableIds().map(l.fromID),r=0,n=e;r<n.length;r+=1){var i=n[r];i.posMatrix=t.transform.calculatePosMatrix(i,t._source.maxzoom)}return e},e}(u);d.maxOverzooming=10,d.maxUnderzooming=3,e.exports=d},{"../data/extent":11,"../geo/coordinate":18,"../util/evented":118,"../util/lru_cache":124,"../util/util":129,"./source":50,"./tile":52,"./tile_coord":53}],52:[function(t,e,r){"use str
this._updatedAllPaintProps=!1},e.prototype.setState=function(t){var e=this;if(this._checkLoaded(),y.emitErrors(this,y(t)))return!1;t=c.extend({},t),t.layers=E(t.layers);var r=T(this.serialize(),t).filter(function(t){return!(t.command in A)});if(0===r.length)return!1;var n=r.filter(function(t){return!(t.command in z)});if(n.length>0)throw new Error("Unimplemented: "+n.map(function(t){return t.command}).join(", ")+".");return r.forEach(function(t){"setTransition"!==t.command&&e[t.command].apply(e,t.args)}),this.stylesheet=t,!0},e.prototype.addSource=function(t,e,r){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");var n=["vector","raster","geojson","video","image","canvas"],i=n.indexOf(e.type)>=0;if(!i||!this._validate(y.source,"sources."+t,e,null,r)){var o=this.sourceCaches[t]=new _(t,e,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},e.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");var e=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],e.setEventedParent(null),e.clearTiles(),e.onRemove&&e.onRemove(this.map),this._changed=!0},e.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},e.prototype.addLayer=function(t,e,r){this._checkLoaded();var n=t.id;if("object"==typeof t.source&&(this.addSource(n,t.source),t=c.extend(t,{source:n})),!this._validate(y.layer,"layers."+n,t,{arrayIndex:-1},r)){var o=i.create(t);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});var a=e?this._order.indexOf(e):this._order.length;if(this._order.splice(a,0,n),this._layers[n]=o,this._removedLayers[n]&&o.source){var s=this._removedLayers[n];delete this._removedLayers[n],this._updatedSources[o.source]=s.type!==o.type?"clear":"reload"}this._updateLayer(o),"symbol"===o.type&&(this._updatedSymbolOrder=!0),this.updateClasses(n)}},e.prototype.moveLayer=function(t,e){this._checkLoaded(),this._changed=!0;var r=this._layers[t];if(!r)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")});var n=this._order.indexOf(t);this._order.splice(n,1);var i=e?this._order.indexOf(e):this._order.length;this._order.splice(i,0,t),"symbol"===r.type&&(this._updatedSymbolOrder=!0,r.source&&!this._updatedSources[r.source]&&(this._updatedSources[r.source]="reload"))},e.prototype.removeLayer=function(t){this._checkLoaded();var e=this._layers[t];if(!e)return void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")});e.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),"symbol"===e.type&&(this._updatedSymbolOrder=!0),this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t]},e.prototype.getLayer=function(t){return this._layers[t]},e.prototype.setLayerZoomRange=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);return n?void(n.minzoom===e&&n.maxzoom===r||(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")})},e.prototype.setFilter=function(t,e){this._checkLoaded();var r=this.getLayer(t);return r?void(null!==e&&void 0!==e&&this._validate(y.filter,"layers."+r.id+".filter",e)||c.deepEqual(r.filter,e)||(r.filter=c.clone(e),this._updateLayer(r))):void this.fire("error",{error:new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")})},e.prototype.getFilter=function(t){return c.clone(this.getLayer(t).filter)},e.prototype.setLayoutProperty=function(t,e,r){this._checkLoaded();var n=this.getLayer(t);return n?v
this.width=a,this.height=a,this.bin=new n(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)};u.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},u.prototype.getRects=function(){var t,e,r,n=this,i={};for(var o in this.ids)t=o.split("#"),e=t[0],r=t[1],i[e]||(i[e]={}),i[e][r]=n.index[o];return i},u.prototype.addGlyph=function(t,e,r,n){var o=this;if(!r)return null;var a=e+"#"+r.id;if(this.index[a])return this.ids[a].indexOf(t)<0&&this.ids[a].push(t),this.index[a];if(!r.bitmap)return null;var s=r.width+2*n,u=r.height+2*n,l=1,c=s+2*l,h=u+2*l;c+=4-c%4,h+=4-h%4;var p=this.bin.packOne(c,h);if(p||(this.resize(),p=this.bin.packOne(c,h)),!p)return i.warnOnce("glyph bitmap overflow"),null;this.index[a]=p,this.ids[a]=[t];for(var f=this.data,d=r.bitmap,m=0;m<u;m++)for(var y=o.width*(p.y+m+l)+p.x+l,v=s*m,g=0;g<s;g++)f[y+g]=d[v+g];return this.dirty=!0,p},u.prototype.resize=function(){var t=this,e=this.width,r=this.height;if(!(e>=s||r>=s)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=o,this.height*=o,this.bin.resize(this.width,this.height);for(var n=new ArrayBuffer(this.width*this.height),i=0;i<r;i++){var a=new Uint8Array(t.data.buffer,r*i,e),u=new Uint8Array(n,r*i*o,e);u.set(a)}this.data=new Uint8Array(n)}},u.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},u.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)},e.exports=u},{"../util/util":129,"shelf-pack":200}],83:[function(t,e,r){"use strict";function n(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var i=t("../util/mapbox").normalizeGlyphsURL,o=t("../util/ajax"),a=t("../util/verticalize_punctuation"),s=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),l=t("pbf"),c=function(t,e,r){var n=1;this.advance=t.advance,this.left=t.left-r-n,this.top=t.top+r+n,this.rect=e},h=function(t){this.url=t&&i(t),this.atlases={},this.stacks={},this.loading={}};h.prototype.getSimpleGlyphs=function(t,e,r,n){var i=this;void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var o={},s=this.stacks[t],l=this.atlases[t],h=3,p={},f=0,d=function(e){var n=Math.floor(e/256);if(s[n]){var i=s[n].glyphs[e],a=l.addGlyph(r,t,i,h);i&&(o[e]=new c(i,a,h))}else void 0===p[n]&&(p[n]=[],f++),p[n].push(e)},m=0;m<e.length;m++){var y=e[m],v=String.fromCharCode(y);d(y),a.lookup[v]&&d(a.lookup[v].charCodeAt(0))}f||n(void 0,o,t);var g=function(e,a,s){if(!e)for(var u=i.stacks[t][a]=s.stacks[0],d=0;d<p[a].length;d++){var m=p[a][d],y=u.glyphs[m],v=l.addGlyph(r,t,y,h);y&&(o[m]=new c(y,v,h))}f--,f||n(void 0,o,t)};for(var _ in p)i.loadRange(t,_,g)},h.prototype.loadRange=function(t,e,r){if(256*e>65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var i=this.loading[t];if(i[e])i[e].push(r);else{i[e]=[r];var a=256*e+"-"+(256*e+255),u=n(t,a,this.url);o.getArrayBuffer(u,function(t,r){for(var n=!t&&new s(new l(r.data)),o=0;o<i[e].length;o++)i[e][o](t,e,n);delete i[e]})}},h.prototype.getGlyphAtlas=function(t){return this.atlases[t]},e.exports=h},{"../symbol/glyph_atlas":82,"../util/ajax":109,"../util/glyphs":120,"../util/mapbox":125,"../util/verticalize_punctuation":131,pbf:196}],84:[function(t,e,r){"use strict";e.exports=function(t){function e(e){s.push(t[e]),u++}function r(t,e,r){var n=a[t];return delete a[t],a[e]=n,s[n].geometry[0].pop(),s[n].geometry[0]=s[
i.enableDrag(),this._map.getCanvasContainer().dispatchEvent(n(t)),t.stopPropagation())},u.prototype._createButton=function(t,e,r){var n=i.create("button",t,this._container);return n.type="button",n.setAttribute("aria-label",e),n.addEventListener("click",function(){r()}),n},e.exports=u},{"../../util/dom":117,"../../util/util":129,"../../util/window":112}],96:[function(t,e,r){"use strict";function n(t,e,r){var n=r&&r.maxWidth||100,a=t._container.clientHeight/2,s=o(t.unproject([0,a]),t.unproject([n,a]));if(r&&"imperial"===r.unit){var u=3.2808*s;if(u>5280){var l=u/5280;i(e,n,l,"mi")}else i(e,n,u,"ft")}else i(e,n,s,"m")}function i(t,e,r,n){var i=a(r),o=i/r;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*o+"px",t.innerHTML=i+n}function o(t,e){var r=6371e3,n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos((e.lng-t.lng)*n),s=r*Math.acos(Math.min(a,1));return s}function a(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),r=t/e;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1,e*r}var s=t("../../util/dom"),u=t("../../util/util"),l=function(t){this.options=t,u.bindAll(["_onMove"],this)};l.prototype.getDefaultPosition=function(){return"bottom-left"},l.prototype._onMove=function(){n(this._map,this._container,this.options)},l.prototype.onAdd=function(t){return this._map=t,this._container=s.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},l.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map.off("move",this._onMove),this._map=void 0},e.exports=l},{"../../util/dom":117,"../../util/util":129}],97:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../geo/lng_lat_bounds"),o=t("../../util/util"),a=t("../../util/window"),s=function(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};s.prototype.isEnabled=function(){return!!this._enabled},s.prototype.isActive=function(){return!!this._active},s.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},s.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},s.prototype._onMouseDown=function(t){t.shiftKey&&0===t.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=n.mousePos(this._el,t),this._active=!0)},s.prototype._onMouseMove=function(t){var e=this._startPos,r=n.mousePos(this._el,t);this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(e.x,r.x),o=Math.max(e.x,r.x),a=Math.min(e.y,r.y),s=Math.max(e.y,r.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"},s.prototype._onMouseUp=function(t){if(0===t.button){var e=this._startPos,r=n.mousePos(this._el,t),o=(new i).extend(this._map.unproject(e)).extend(this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(o,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:o})}},s.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},s.prototype._finish=function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),n.enableDrag()},s.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},e.exports=s},{"../../geo/lng_lat_bounds":20,"../../util/dom":117,"../../util/util":129,"../../util/window
"../geo/lng_lat_bounds":20,"../geo/transform":21,"../render/painter":36,"../style/animation_loop":59,"../style/style":63,"../util/browser":110,"../util/dom":117,"../util/util":129,"../util/window":112,"./bind_handlers":91,"./camera":92,"./control/attribution_control":93,"./hash":104,"mapbox-gl-supported":193,"point-geometry":197}],106:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("../geo/lng_lat"),o=t("point-geometry"),a=function(t,e){this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this),this._onMapClick=this._onMapClick.bind(this),t||(t=n.create("div")),t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};a.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},a.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map=null),n.remove(this._element),this._popup&&this._popup.remove(),this},a.prototype.getLngLat=function(){return this._lngLat},a.prototype.setLngLat=function(t){return this._lngLat=i.convert(t),this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},a.prototype.getElement=function(){return this._element},a.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&(this._popup=t,this._popup.setLngLat(this._lngLat)),this},a.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},a.prototype.getPopup=function(){return this._popup},a.prototype.togglePopup=function(){var t=this._popup;t&&(t.isOpen()?t.remove():t.addTo(this._map))},a.prototype._update=function(t){if(this._map){var e=this._map.project(this._lngLat)._add(this._offset);t&&"moveend"!==t.type||(e=e.round()),n.setTransform(this._element,"translate("+e.x+"px, "+e.y+"px)")}},e.exports=a},{"../geo/lng_lat":19,"../util/dom":117,"point-geometry":197}],107:[function(t,e,r){"use strict";function n(t){if(t){if("number"==typeof t){var e=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new l(0,t),"top-left":new l(e,e),"top-right":new l(-e,e),bottom:new l(0,-t),"bottom-left":new l(e,-e),"bottom-right":new l(-e,-e),left:new l(t,0),right:new l(-t,0)}}if(i(t)){var r=l.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:l.convert(t.top||[0,0]),"top-left":l.convert(t["top-left"]||[0,0]),"top-right":l.convert(t["top-right"]||[0,0]),bottom:l.convert(t.bottom||[0,0]),"bottom-left":l.convert(t["bottom-left"]||[0,0]),"bottom-right":l.convert(t["bottom-right"]||[0,0]),left:l.convert(t.left||[0,0]),right:l.convert(t.right||[0,0])}}return n(new l(0,0))}function i(t){return t instanceof l||Array.isArray(t)}var o=t("../util/util"),a=t("../util/evented"),s=t("../util/dom"),u=t("../geo/lng_lat"),l=t("point-geometry"),c=t("../util/window"),h={closeButton:!0,closeOnClick:!0},p=function(t){function e(e){t.call(this),this.options=o.extend(Object.create(h),e),o.bindAll(["_update","_onClickClose"],this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addTo=function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},e.prototype.isOpen=function(){return!!this._map},e.prototype.remove=function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},e.prototype.getLngLat=function(){return this._lngLat},e.prototype.setLngLat=function(t){return this._lngLat=u.convert(t),this._update(),this},e.prototype.setText=function(t){return this.setDOMConte
if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0===--n&&r(o,i)})})},r.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t,e,r,n){for(var i=arguments,o=1;o<arguments.length;o++){var a=i[o];for(var s in a)t[s]=a[s]}return t},r.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r};var o=1;r.uniqueId=function(){return o++},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-(1/0),o=-(1/0),a=0;a<t.length;a++)e=Math.min(e,t[a].column),r=Math.min(r,t[a].row),n=Math.max(n,t[a].column),o=Math.max(o,t[a].row);var s=n-e,u=o-r,l=Math.max(s,u);return new i((e+n)/2,(r+o)/2,0).zoomTo(Math.floor(-Math.log(l)/Math.LN2))},r.endsWith=function(t,e){return t.indexOf(e,t.length-e.length)!==-1},r.mapObject=function(t,e,r){var n=this,i={};for(var o in t)i[o]=e.call(r||n,t[o],o,t);return i},r.filterObject=function(t,e,r){var n=this,i={};for(var o in t)e.call(r||n,t[o],o,t)&&(i[o]=t[o]);return i},r.deepEqual=function(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!r.deepEqual(t[n],e[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;var i=Object.keys(t);if(i.length!==Object.keys(e).length)return!1;for(var o in t)if(!r.deepEqual(t[o],e[o]))return!1;return!0}return t===e},r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t&&t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1};var a={};r.warnOnce=function(t){a[t]||("undefined"!=typeof console&&console.warn(t),a[t]=!0)},r.isCounterClockwise=function(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)},r.calculateSignedArea=function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r=t[a],n+=(r.x-e.x)*(e.y+r.y);return n},r.isClosedPolygon=function(t){if(t.length<4)return!1;var e=t[0],n=t[t.length-1];return!(Math.abs(e.x-n.x)>0||Math.abs(e.y-n.y)>0)&&Math.abs(r.calculateSignedArea(t))>.01},r.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,[e*Math.cos(r)*Math.sin(n),e*Math.sin(r)*Math.sin(n),e*Math.cos(n)]},r.parseCacheControl=function(t){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,function(t,e,n,i){var o=n||i;return r[e]=!o||o.toLowerCase(),""}),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}},{"../geo/coordinate":18,"@mapbox/unitbezier":134,"point-geometry":197}],130:[function(t,e,r){"use strict";var n=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},i={geometry:{}};i.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},i.geometry.set=function(t){this._geometry=t},n.prototype.toJSON=function(){var t=this,e={geometry:this.geometry};for(var r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=t[r]);return e},Object.defineProperties(n.prototype,i),e.exports=n},{}],131:[function(t,e,r){"use strict";var n=t("./script_detection");e.exports=function(t){for(var r="",i=0;i<t.length;i++){var o=t.charCodeAt(i+1)||null,a=t.charCodeAt(i-1)||null,s
if(a>1&&console.timeEnd("drilling down"),null!==m){var y=1<<t-m;u=o(m,Math.floor(e/y),Math.floor(r/y))}return this.tiles[u]?h.tile(this.tiles[u],i):null}},{"./clip":141,"./convert":142,"./tile":146,"./transform":147,"./wrap":148}],145:[function(t,e,r){"use strict";function n(t,e){var r,n,o,a,s=e*e,u=t.length,l=0,c=u-1,h=[];for(t[l][2]=1,t[c][2]=1;c;){for(n=0,r=l+1;r<c;r++)o=i(t[r],t[l],t[c]),o>n&&(a=r,n=o);n>s?(t[a][2]=n,h.push(l),h.push(a),l=a):(c=h.pop(),l=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],o=r[0],a=r[1],s=t[0],u=t[1],l=o-n,c=a-i;if(0!==l||0!==c){var h=((s-n)*l+(u-i)*c)/(l*l+c*c);h>1?(n=o,i=a):h>0&&(n+=l*h,i+=c*h)}return l=s-n,c=u-i,l*l+c*c}e.exports=n},{}],146:[function(t,e,r){"use strict";function n(t,e,r,n,o,a){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},u=0;u<t.length;u++){s.numFeatures++,i(s,t[u],o,a);var l=t[u].min,c=t[u].max;l[0]<s.min[0]&&(s.min[0]=l[0]),l[1]<s.min[1]&&(s.min[1]=l[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,a,s,u,l=e.geometry,c=e.type,h=[],p=r*r;if(1===c)for(i=0;i<l.length;i++)h.push(l[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<l.length;i++)if(s=l[i],n||!(2===c&&s.dist<r||3===c&&s.area<p)){var f=[];for(a=0;a<s.length;a++)u=s[a],(n||u[2]>p)&&(f.push(u),t.numSimplified++),t.numPoints++;3===c&&o(f,s.outer),h.push(f)}else t.numPoints+=s.length;if(h.length){var d={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(d.id=e.id),t.features.push(d)}}function o(t,e){var r=a(t);r<0===e&&t.reverse()}function a(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r=t[a],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],147:[function(t,e,r){"use strict";function n(t,e){if(t.transformed)return t;var r,n,o,a=t.z2,s=t.x,u=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],c=l.geometry,h=l.type;if(1===h)for(n=0;n<c.length;n++)c[n]=i(c[n],e,a,s,u);else for(n=0;n<c.length;n++){var p=c[n];for(o=0;o<p.length;o++)p[o]=i(p[o],e,a,s,u)}}return t.transformed=!0,t}function i(t,e,r,n,i){var o=Math.round(e*(t[0]*r-n)),a=Math.round(e*(t[1]*r-i));return[o,a]}r.tile=n,r.point=i},{}],148:[function(t,e,r){"use strict";function n(t,e,r){var n=t,o=a(t,1,-1-e,e,0,r,-1,2),s=a(t,1,1-e,2+e,0,r,-1,2);return(o||s)&&(n=a(t,1,-e,1+e,0,r,-1,2)||[],o&&(n=i(o,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],u=a.type;if(1===u)i=o(a.geometry,e);else{i=[];for(var l=0;l<a.geometry.length;l++)i.push(o(a.geometry[l],e))}r.push(s(a.tags,u,i,a.id))}return r}function o(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var a=t("./clip"),s=t("./feature");e.exports=n},{"./clip":141,"./feature":143}],149:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],r=o[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var s=o[i+a],u=o[i+a+1];n.push(s===u?null:o.subarray(s,u))}var l=o[i+n.length],c=o[i+n.length+1];this.keys=o.subarray(l,c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p}e.exports=n;var i=3;n.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},n.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},n.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},n.prototype.query=function(t,e,r,n){var i=this.min,o=this.max;if(t<=i&&e<=i&&o<=r&&o<=n)return Array.prototype.slice.call(this.keys);var a=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,a,s),a},n.prototype._queryCell=function(t,e,r,n,i,o,a){var s=this.cells[i];if(null!==s)for(var u=this.keys,l=
"categorical"===m&&r in y?[new n(t.key,t.value,"stop domain values must be unique")]:(y[r]=!0,[])):[new n(t.key,t.value,"integer expected, found %s",r)]}var h,p,f,d=t.valueSpec,m=l(t.value.type),y={},v="categorical"!==m&&void 0===t.value.property,g=!v,_="array"===i(t.value.stops)&&"array"===i(t.value.stops[0])&&"object"===i(t.value.stops[0][0]),x=a({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return"identity"===m||t.value.stops||x.push(new n(t.key,t.value,'missing required property "stops"')),"exponential"===m&&"piecewise-constant"===t.valueSpec.function&&x.push(new n(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(g&&!t.valueSpec["property-function"]?x.push(new n(t.key,t.value,"property functions not supported")):v&&!t.valueSpec["zoom-function"]&&x.push(new n(t.key,t.value,"zoom functions not supported"))),"categorical"!==m&&!_||void 0!==t.value.property||x.push(new n(t.key,t.value,'"property" property is required')),x}},{"../error/validation_error":167,"../util/get_type":170,"../util/unbundle_jsonlint":172,"./validate":173,"./validate_array":174,"./validate_number":185,"./validate_object":186}],181:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,o=i(t);return o.length?o:(e.indexOf("{fontstack}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new n(r,e,'"glyphs" url must include a "{range}" token')),o)}},{"../error/validation_error":167,"./validate_string":189}],182:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),o=t("./validate_object"),a=t("./validate_filter"),s=t("./validate_paint_property"),u=t("./validate_layout_property"),l=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,p=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var f=i(r.type),d=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var y=h.layers[m];i(y.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,y.id.__line__))}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new n(c,r[t],'"%s" is prohibited for ref layers',t))});var v;h.layers.forEach(function(t){t.id==d&&(v=t)}),v?v.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):f=i(v.type):e.push(new n(c,r.ref,'ref layer "%s" not found',d))}else if("background"!==f)if(r.source){var g=h.sources&&h.sources[r.source];g?"vector"==g.type&&"raster"==f?e.push(new n(c,r.source,'layer "%s" requires a raster source',r.id)):"raster"==g.type&&"raster"!=f?e.push(new n(c,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=g.type||r["source-layer"]||e.push(new n(c,r,'layer "%s" must specify a "source-layer"',r.id)):e.push(new n(c,r.source,'source "%s" not found',r.source))}else e.push(new n(c,r,'missing required property "source"'));return e=e.concat(o({key:c,value:r,valueSpec:p.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},filter:a,layout:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return u(l({layerType:f},t))}}})},paint:function(t){return o({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(l({layerType:f},t))}}})}}}))}},{"../error/validation_error":167,"../util/extend":169,"../util/unbundle_jsonlint":172,"./validate_filter":179,"./validate_layout_property":183,"./validate_object":186,"./validate_paint_property":187}],183:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o["layout_"+t.layerType];if(!u)return[];if(t.valueSpec||u[s]){var l=[];return"symbol"===t.layerType&&("icon-image"===s&&r&&!r.sprite?l.push(new i
if(e=t.charCodeAt(o),e>55295&&e<57344){if(!r){e>56319||o+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var o,a,s,u=t("ieee754");o={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return u.read(this,t,!0,23,4)},readDoubleLE:function(t){return u.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return u.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return u.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var o=e;o<r;o++){var a=this[o];a<=127?(n+=decodeURIComponent(i)+String.fromCharCode(a),i=""):i+="%"+a.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===a?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},o.writeInt32LE=o.writeUInt32LE,n.byteLength=function(t){return a=t,s=i(t),s.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:150}],196:[function(t,e,n){(function(r){"use strict";function n(t){this.buf=y.isBuffer(t)?t:new y(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}function o(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function a(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var y=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var v=4294967296,g=1/v,_=Math.pow(2,63);n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*v;return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*v;return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<1
}function i(t,e,r){3===t&&e.layers.push(p(r,r.readVarint()+r.pos))}function o(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,d,t.layers[r])}function a(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function u(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function l(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type="Unknown"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function p(t,e){return t.readFields(f,{features:[],keys:[],values:[]},e)}function f(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(l(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(a(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function d(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,h,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,u,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:o};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:a,write:u},m.feature={read:l,write:h},m.layer={read:p,write:d}},{}],213:[function(t,e,r){var n=arguments[3],i=arguments[4],o=arguments[5],a=JSON.stringify;e.exports=function(t,e){function r(t){y[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];y[n]||r(n)}}for(var s,u=Object.keys(o),l=0,c=u.length;l<c;l++){var h=u[l],p=o[h].exports;if(p===t||p&&p.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var f={},l=0,c=u.length;l<c;l++){var h=u[l];f[h]=h}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),f]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[d]=[Function(["require"],"var f = require("+a(s)+");(f.default ? f.default : f)(self);"),m];var y={};r(d);var v="("+n+")({"+Object.keys(y).map(function(t){return a(t)+":["+i[t][0]+","+a(i[t][1])+"]"}).join(",")+"},{},["+a(d)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,_=new Blob([v],{type:"text/javascript"});if(e&&e.bare)return _;var x=g.createObjectURL(_),b=new Worker(x);return b.objectURL=x,b}},{}],214:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],215:[function(e,r,n){!function(e,i){"object"==typeof n&&"undefined"!=typeof r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,o,a){a=a||{};var s=t+"?"+["bbox="+r(n,i,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&");return s}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),o=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+o[0]+","+o[1]}function n(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}t.getURL=e,
Updating codebase to use es6/7 Squashed commit of the following: commit 07b27d00f135a521143154a2e77abdc1680b7d5b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 14:59:35 2017 +0000 Fix styleci.io issue commit 9e67f0a96484f8047f22d13abb4cd41c2e44b95d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 08:28:22 2017 +0000 Remove some unused dependencies commit 3c65070f3ff2aec10d821ae9f12821bc08e37d0a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 18:00:10 2017 +0000 Compressed webpack/babel output commit 694c43d1a9a6c8cb84d4cc789a6643b8d2863cec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:59:27 2017 +0000 Let’s compress the es5 output commit debffc0e41760fcc87e6d3768163e6ed8ea5d98c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:45:05 2017 +0000 webpack/babel generated es5 assets commit 1e978d6c5795f230ab320f94ad2fb98871bb6fa5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:36:52 2017 +0000 Allow content of micropub form page to be persisted commit 44fb8026962ef574700f07ef93d18bdb38cdedb2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:35:58 2017 +0000 Name the micropub form commit 732abaf561bf9d6392fe506d30d320e9c17b8226 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:34:39 2017 +0000 Add webStorage dependency commit a4520085dfc673c5c3d940150358b8ecc3cdf022 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 16 12:32:33 2017 +0000 No need for a form id on the micropub form untill form autosave is added commit a182be46a616d8e4085be5e24cbd3623f13cc28d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Jan 14 20:37:31 2017 +0000 Polyfill fetch and promise only in older browsers using unpkg.com commit fdc044150dc8e2b755f93119b196ba0455bbbb83 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:46:05 2017 +0000 Generated js from webpack/babel commit d24e6aa9fff38823a0c667e6f9e43dcb2ca179c4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:45:32 2017 +0000 Lots of es6 to generate and add map, particularly the new note form commit e7004a9fe475e07d43de905fb00d51c659878474 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:44:54 2017 +0000 Don’t link to commons.js, it aint being made at the moment commit d4a2e4e143b644287f9da109eb2850c2361b2f20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:43:27 2017 +0000 Temporarily don’t optimize JS commit 05623de122da7d88642af60f85e5320a3ff651fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:24:15 2017 +0000 Add places to geojson data commit 3eb1a4f29bb4263b9998a6f3f53abb7d1eeff520 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:22:53 2017 +0000 Use alertify.js to give relevant feedback to user commit 6f123fa178d6cd19528130ebd78157c37eaab1a1 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:21:24 2017 +0000 Add alertify.css back commit 89fca3b3aeb23ef97fb767514e0502298d1b83fd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:19:56 2017 +0000 Webpack’d javascript commit 94ab60f34079238ed6228bf6e789f14d7a09823b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:10:17 2017 +0000 Webpack’d javascript commit 1ca3a55a27c20ea08633b589023fe5ad1acb2b68 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:09:06 2017 +0000 Define const functions in order of usage commit dc5535b32a357611860e0e98fcdc7d9c12c5d383 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:55 2017 +0000 Link to correct js files with defer option commit 42f0e5b85825943ed148736e8e0fe22f5654ae90 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:18 2017 +0000 New webpacked es6 code commit 300443bb0ce7b65bda1cf550fe5c7173a89edaf3 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:49:44 2017 +0000 Moving towards consolidated es6 map code commit b1001760e03dd358f896feb90dd3acc0bc6728fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:44:40 2017 +0000 Don’t mangle the fetch function commit 289e59025634b6d2569b73ae87e3ea4942034e33 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:43:47 2017 +0000 Updated yarn/npm dependencies commit 3439b008e6bd96d8c45591c2a945c4ac246440ec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:58:50 2016 +0000 Link to the correct assets on the new note page commit 81dc83e362266028f8336ae5a27e92c8c8a2b6dc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:57:46 2016 +0000 Add a map to the new note page commit 5101ecd3dd60cd78e9a4bce81a5e60a2f575bc57 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:56:54 2016 +0000 Bundle common JS between entry points commit 1f916adcfd1b07df388417b6bd800e109cec543c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:55:31 2016 +0000 Add geojson to individual notes commit 7a6ae8ca49b4ca49413ddb977f7b534f62b41c20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:53:30 2016 +0000 Link to self-hosted mapbox-gl.css commit 8be006ec2b738cbcebd06283e18c292b3efd7d16 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:52:41 2016 +0000 Use self-hosted mapbox-gl css, and a better default geojson title value commit 5ec480842a2194a071b6a23ae181a8de5b8d47cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:46 2016 +0000 Access geojson data to markup map correctly commit f2f1d7563f7b0cb7cc62658cc2817e56d2b47c31 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:07 2016 +0000 Generate geojson data for places commit 9f8c9ba02f7ac37b4ab81aad2fb0cd2c077c45cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 23 11:55:10 2016 +0000 Use geojson to add a default you location point commit 3da499d3ea6a214f8008d1b98f9b0c2f31ecba0c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:29:18 2016 +0000 Some code cleaning commit 39376097eda82491df272cc214d70ff3095d4873 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:21:29 2016 +0000 Use satellite streets view commit f3db8f43fc403bc180e24d63e21c8311441cb2b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 16:46:03 2016 +0000 Semi working map state, still need to add own css, and add marker commit 5f398a642b9db67f4b0733988c20138b37d2141d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:17:04 2016 +0000 Reference new maps.js with bundled mapbox commit bad97649a623c5552e6b607a1975aa2de8131191 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:16:25 2016 +0000 Add mapbox-gl again commit 47484962e7620aa7a9a5153cfc03e2ba4030dd5c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 21 00:03:23 2016 +0000 Early working version of maps.js commit e53e0f39952a65996c09b06fd35918ffabed0de2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 17:14:17 2016 +0000 Setup webpack commit f930a1e2bd7d18809bd40d0cc22f9c3af75f1984 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 15:00:42 2016 +0000 Add webpack v2 commit b16e8d62db071155a8b5fb216d3d60ebf6fa9468 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:47 2016 +0000 Define default settings for babel commit 97c13cb753e08d25aa48ecff579efa05173a2c81 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:31 2016 +0000 Add babeljs commit dd9efc3b056cf96323d7f11acff0fb1ab137caef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:49:23 2016 +0000 Remove old javascript commit ab99c251ad5847b48d347e2c9426077b3ba8e0f5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 16 13:26:10 2016 +0000 update readme to reflect changes to how syndication targets need to be set
2017-01-26 15:21:21 +00:00
* webStorage - A minimal Javascript wrapper to work with localStorage and sessionStorage
*
2017-01-26 19:51:45 +00:00
* @version v1.2.3
Updating codebase to use es6/7 Squashed commit of the following: commit 07b27d00f135a521143154a2e77abdc1680b7d5b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 14:59:35 2017 +0000 Fix styleci.io issue commit 9e67f0a96484f8047f22d13abb4cd41c2e44b95d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 08:28:22 2017 +0000 Remove some unused dependencies commit 3c65070f3ff2aec10d821ae9f12821bc08e37d0a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 18:00:10 2017 +0000 Compressed webpack/babel output commit 694c43d1a9a6c8cb84d4cc789a6643b8d2863cec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:59:27 2017 +0000 Let’s compress the es5 output commit debffc0e41760fcc87e6d3768163e6ed8ea5d98c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:45:05 2017 +0000 webpack/babel generated es5 assets commit 1e978d6c5795f230ab320f94ad2fb98871bb6fa5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:36:52 2017 +0000 Allow content of micropub form page to be persisted commit 44fb8026962ef574700f07ef93d18bdb38cdedb2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:35:58 2017 +0000 Name the micropub form commit 732abaf561bf9d6392fe506d30d320e9c17b8226 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:34:39 2017 +0000 Add webStorage dependency commit a4520085dfc673c5c3d940150358b8ecc3cdf022 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 16 12:32:33 2017 +0000 No need for a form id on the micropub form untill form autosave is added commit a182be46a616d8e4085be5e24cbd3623f13cc28d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Jan 14 20:37:31 2017 +0000 Polyfill fetch and promise only in older browsers using unpkg.com commit fdc044150dc8e2b755f93119b196ba0455bbbb83 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:46:05 2017 +0000 Generated js from webpack/babel commit d24e6aa9fff38823a0c667e6f9e43dcb2ca179c4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:45:32 2017 +0000 Lots of es6 to generate and add map, particularly the new note form commit e7004a9fe475e07d43de905fb00d51c659878474 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:44:54 2017 +0000 Don’t link to commons.js, it aint being made at the moment commit d4a2e4e143b644287f9da109eb2850c2361b2f20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:43:27 2017 +0000 Temporarily don’t optimize JS commit 05623de122da7d88642af60f85e5320a3ff651fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:24:15 2017 +0000 Add places to geojson data commit 3eb1a4f29bb4263b9998a6f3f53abb7d1eeff520 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:22:53 2017 +0000 Use alertify.js to give relevant feedback to user commit 6f123fa178d6cd19528130ebd78157c37eaab1a1 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:21:24 2017 +0000 Add alertify.css back commit 89fca3b3aeb23ef97fb767514e0502298d1b83fd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:19:56 2017 +0000 Webpack’d javascript commit 94ab60f34079238ed6228bf6e789f14d7a09823b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:10:17 2017 +0000 Webpack’d javascript commit 1ca3a55a27c20ea08633b589023fe5ad1acb2b68 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:09:06 2017 +0000 Define const functions in order of usage commit dc5535b32a357611860e0e98fcdc7d9c12c5d383 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:55 2017 +0000 Link to correct js files with defer option commit 42f0e5b85825943ed148736e8e0fe22f5654ae90 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:18 2017 +0000 New webpacked es6 code commit 300443bb0ce7b65bda1cf550fe5c7173a89edaf3 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:49:44 2017 +0000 Moving towards consolidated es6 map code commit b1001760e03dd358f896feb90dd3acc0bc6728fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:44:40 2017 +0000 Don’t mangle the fetch function commit 289e59025634b6d2569b73ae87e3ea4942034e33 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:43:47 2017 +0000 Updated yarn/npm dependencies commit 3439b008e6bd96d8c45591c2a945c4ac246440ec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:58:50 2016 +0000 Link to the correct assets on the new note page commit 81dc83e362266028f8336ae5a27e92c8c8a2b6dc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:57:46 2016 +0000 Add a map to the new note page commit 5101ecd3dd60cd78e9a4bce81a5e60a2f575bc57 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:56:54 2016 +0000 Bundle common JS between entry points commit 1f916adcfd1b07df388417b6bd800e109cec543c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:55:31 2016 +0000 Add geojson to individual notes commit 7a6ae8ca49b4ca49413ddb977f7b534f62b41c20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:53:30 2016 +0000 Link to self-hosted mapbox-gl.css commit 8be006ec2b738cbcebd06283e18c292b3efd7d16 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:52:41 2016 +0000 Use self-hosted mapbox-gl css, and a better default geojson title value commit 5ec480842a2194a071b6a23ae181a8de5b8d47cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:46 2016 +0000 Access geojson data to markup map correctly commit f2f1d7563f7b0cb7cc62658cc2817e56d2b47c31 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:07 2016 +0000 Generate geojson data for places commit 9f8c9ba02f7ac37b4ab81aad2fb0cd2c077c45cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 23 11:55:10 2016 +0000 Use geojson to add a default you location point commit 3da499d3ea6a214f8008d1b98f9b0c2f31ecba0c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:29:18 2016 +0000 Some code cleaning commit 39376097eda82491df272cc214d70ff3095d4873 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:21:29 2016 +0000 Use satellite streets view commit f3db8f43fc403bc180e24d63e21c8311441cb2b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 16:46:03 2016 +0000 Semi working map state, still need to add own css, and add marker commit 5f398a642b9db67f4b0733988c20138b37d2141d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:17:04 2016 +0000 Reference new maps.js with bundled mapbox commit bad97649a623c5552e6b607a1975aa2de8131191 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:16:25 2016 +0000 Add mapbox-gl again commit 47484962e7620aa7a9a5153cfc03e2ba4030dd5c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 21 00:03:23 2016 +0000 Early working version of maps.js commit e53e0f39952a65996c09b06fd35918ffabed0de2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 17:14:17 2016 +0000 Setup webpack commit f930a1e2bd7d18809bd40d0cc22f9c3af75f1984 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 15:00:42 2016 +0000 Add webpack v2 commit b16e8d62db071155a8b5fb216d3d60ebf6fa9468 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:47 2016 +0000 Define default settings for babel commit 97c13cb753e08d25aa48ecff579efa05173a2c81 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:31 2016 +0000 Add babeljs commit dd9efc3b056cf96323d7f11acff0fb1ab137caef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:49:23 2016 +0000 Remove old javascript commit ab99c251ad5847b48d347e2c9426077b3ba8e0f5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 16 13:26:10 2016 +0000 update readme to reflect changes to how syndication targets need to be set
2017-01-26 15:21:21 +00:00
* @author George Raptis <georapbox@gmail.com> (georapbox.github.io)
* @homepage https://github.com/georapbox/webStorage#readme
* @repository git+https://github.com/georapbox/webStorage.git
*/
!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(1),s=n(a),u=r(2),l=n(u),c=r(3),h=n(c),p=r(4),f=n(p),d=r(5),m=n(d),y=r(6),v=n(y),g=r(7),_=n(g),x={driver:localStorage,name:"webStorage"},b={set:"setItem",set_err:"setItemError",get:"getItem",get_err:"getItemError",remove:"removeItem",clear:"clear"},w=function(){function t(e){if(i(this,t),e=(0,f.default)({},x,e),null==e.name||""===(0,h.default)(e.name))throw"You must use a valid name for the database.";this.options=e,this.storeKeyPrefix=(0,v.default)(this),s.default.apply(Object.getPrototypeOf(this))}return o(t,[{key:"createInstance",value:function(e){return new t(e)}},{key:"config",value:function(t){if(t=(0,f.default)({},x,t),null==t.name||""===(0,h.default)(t.name))throw"You must use a valid name for the database.";this.options=t,this.storeKeyPrefix=(0,v.default)(this)}},{key:"getItem",value:function(t){var e=this.options.driver.getItem(this.storeKeyPrefix+t);try{var r=JSON.parse(e);return this.dispatchEvent({type:b.get,data:r}),r}catch(t){throw this.dispatchEvent({type:b.get_err,data:t}),t}}},{key:"setItem",value:function(t,e){try{return e=null==e?null:e,t=this.storeKeyPrefix+t,this.options.driver.setItem(t,JSON.stringify(e)),this.dispatchEvent({type:b.set,data:e}),e}catch(t){throw this.dispatchEvent({type:b.set_err,data:t}),t}}},{key:"removeItem",value:function(t){this.dispatchEvent({type:b.remove,data:t}),this.options.driver.removeItem(this.storeKeyPrefix+t)}},{key:"clear",value:function(t){var e=this.options.driver;t===!0?e.clear():(0,_.default)(this,function(t){e.removeItem(t)}),this.dispatchEvent({type:b.clear})}},{key:"keys",value:function(){var t=[],e=this.storeKeyPrefix;return(0,_.default)(this,function(r){t.push((0,l.default)(r,e))}),t}},{key:"length",value:function(){var t=0;return(0,_.default)(this,function(){t+=1}),t}},{key:"iterate",value:function(t){var e=this.storeKeyPrefix;(0,_.default)(this,function(r,n,i){var o=(0,l.default)(r,e),a=JSON.parse(n);if(t&&t(o,a,i)===!1)return!1})}},{key:"quota",value:function(){var t={},e=0;return(0,_.default)(this,function(r,n){var i=2*n.length/1024/1024;e+=i,t[r]=i}),{total:e,items:t}}},{key:"supported",value:function(){return(0,m.default)(this.options.driver)}}]),t}();e.default=new w,t.exports=e.default},function(t,e,r){var n,i;!function(o,a,s){"use strict";n=s,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}("eventDispatcher",this,function(t){"use strict";var e={nonExtensible:'Cannot apply "'+t+'" on an non extensible object'},r={addEventListener:function(t,r){var n;if(!Object.isExtensible(this))throw new TypeError(e.nonExtensible);return"undefined"==typeof this._listeners&&(this._listeners={}),n=this._listeners,"undefined"==typeof n[t]&&(n[t]=[]),n[t].indexOf(r)===-1&&n[t].push(r),this},hasEventListener:function(t,e){var r;return"undefined"!=typeof this._listeners&&(r=this._listeners,"undefined"!=typeof r[t]&&r[t].indexOf(e)!==-1)},removeEventListener:function(t,e){var r,n,i;if("undefined"!=typeof this._listeners)return r=this._listeners,n=r[t],"undefined"!=typeof n&&(i=n.indexOf(e),i!==-1&&n.splice(i,1)),this},dispatchEvent:function(t){var e,r,n,i;if("undefined"!=typeof this._listeners){if(e=this._listeners,r=e[t.type],"undefined"!=typeof r)for(t.target=this,i=r.length,n=0;n<i;n+=1)r[n].call(this,t);return this}}},n=Object.create(r,{apply:{value:function(t){if(!Object.isExtensible(t))throw new TypeError(e.nonExtensible);return t.a