n;0<=n?++e:--e)i.push(NaN);return i},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,n,i){var r,o;o=[];for(r in t.properties)e.hasOwnProperty(r)||(e[r]=this._get_new_nan_array(i)),o.push(e[r][n]=t.properties[r]);return o},e.prototype._add_geometry=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;switch(t.type){case\"Point\":return r=t.coordinates,e.x[n]=r[0],e.y[n]=r[1],e.z[n]=null!=(x=r[2])?x:NaN;case\"LineString\":for(i=t.coordinates,A=[],u=h=0,_=i.length;h<_;u=++h)r=i[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],A.push(e.zs[n][u]=null!=(w=r[2])?w:NaN);return A;case\"Polygon\":for(t.coordinates.length>1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),s=t.coordinates[0],E=[],u=c=0,p=s.length;c1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),a.push(b[0]);for(l=a.reduce(this._flatten_function),C=[],u=y=0,m=l.length;yn&&l0&&u.length>0){for(var _=r/h,p=s.range(0,h).map(function(t){return t*_}),d=0,f=p.slice(1);d1?this.interval=(i[1]-i[0])*o.ONE_DAY:this.interval=31*o.ONE_DAY},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_month_no_later_than(new Date(t)),i=o.last_month_no_later_than(new Date(e));i.setUTCMonth(i.getUTCMonth()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCMonth(s.getUTCMonth()+1),!(s>i););return r}(t,e),s=this.days,l=this.interval,u=a.concat(r.map(function(t){return function(t,e){for(var n=[],i=0,r=s;i0&&o.length>0){for(var f=_/s,m=r.range(0,s).map(function(t){return t*f}),v=0,g=m.slice(1);v0&&o.length>0){for(var E=Math.pow(l,A)/s,m=r.range(1,s+1).map(function(t){return t*E}),z=0,C=m;z1?this.interval=(i[1]-i[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_year_no_later_than(new Date(t)),i=o.last_year_no_later_than(new Date(e));i.setUTCFullYear(i.getUTCFullYear()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>i););return r}(t,e),s=this.months,l=a.concat(r.map(function(t){return s.map(function(e){var n=o.copy_date(t);return n.setUTCMonth(e),n})})),u=l.map(function(t){return t.getTime()}),h=u.filter(function(n){return t<=n&&n<=e});return{major:h,minor:[]}},e}(r.SingleIntervalTicker);n.MonthsTicker=l,l.prototype.type=\"MonthsTicker\",l.define({months:[s.Array,[]]})},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_interval=function(t,e,n){return this.interval},Object.defineProperty(e.prototype,\"min_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),e}(r.ContinuousTicker);n.SingleIntervalTicker=s,s.prototype.type=\"SingleIntervalTicker\",s.define({interval:[o.Number]})},function(t,e,n){var i=t(364),r=t(50),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Model);n.Ticker=o,o.prototype.type=\"Ticker\"},function(t,e,n){function i(t){return new Date(t.getTime())}function r(t){var e=i(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}n.ONE_MILLI=1,n.ONE_SECOND=1e3,n.ONE_MINUTE=60*n.ONE_SECOND,n.ONE_HOUR=60*n.ONE_MINUTE,n.ONE_DAY=24*n.ONE_HOUR,n.ONE_MONTH=30*n.ONE_DAY,n.ONE_YEAR=365*n.ONE_DAY,n.copy_date=i,n.last_month_no_later_than=r,n.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,n){var i=t(364),r=t(180),o=t(191),s=t(193),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.interval=s.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=s.last_year_no_later_than(new Date(t)).getUTCFullYear(),o=s.last_year_no_later_than(new Date(e)).getUTCFullYear(),a=this.basic_ticker.get_ticks_no_defaults(r,o,n,i).major,l=a.map(function(t){return Date.UTC(t,0,1)}),u=l.filter(function(n){return t<=n&&n<=e});return{major:u,minor:[]}},e}(o.SingleIntervalTicker);n.YearsTicker=a,a.prototype.type=\"YearsTicker\"},function(t,e,n){var i=t(364),r=t(200),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r,o,s,a;return i=this.string_lookup_replace(this.url,this.extra_url_vars),this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,n),o=l[0],a=l[1],r=l[2],s=l[3]):(u=this.get_tile_meter_bounds(t,e,n),o=u[0],a=u[1],r=u[2],s=u[3]),i.replace(\"{XMIN}\",o).replace(\"{YMIN}\",a).replace(\"{XMAX}\",r).replace(\"{YMAX}\",s);var l,u},e}(r.MercatorTileSource);n.BBoxTileSource=s,s.prototype.type=\"BBoxTileSource\",s.define({use_latlon:[o.Bool,!1]})},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},o=t(165),s=t(14),a=t(15);n.DynamicImageView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_image_load=e._on_image_load.bind(e),e._on_image_error=e._on_image_error.bind(e),e}return i.__extends(e,t),e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.map_plot=this.plot_view.model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_view.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.lastImage=void 0,this.extent=this.get_extent()},e.prototype._map_data=function(){return this.initial_extent=this.get_extent()},e.prototype._on_image_load=function(t){var n;if(r(this,e),n=t.target.image_data,n.img=t.target,n.loaded=!0,this.lastImage=n,this.get_extent().join(\":\")===n.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var n;return r(this,e),s.logger.error(\"Error loading image: \"+t.target.src),n=t.target.image_data,this.model.image_source.remove_image(n)},e.prototype._create_image=function(t){var e;return e=new Image,e.onload=this._on_image_load,e.onerror=this._on_image_error,e.alt=\"\",e.image_data={bounds:t,loaded:!1,cache_key:t.join(\":\")},this.model.image_source.add_image(e.image_data),e.src=this.model.image_source.get_image_url(t[0],t[1],t[2],t[3],Math.ceil(this.map_frame._height.value),Math.ceil(this.map_frame._width.value)),e},e.prototype.render=function(t,e,n){var i,r,o=this;if(null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),i=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),null==(r=this.model.image_source.images[i.join(\":\")])||!r.loaded)return null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==r?this.render_timer=setTimeout(function(){return o._create_image(i)},125):void 0;this._draw_image(i.join(\":\"))},e.prototype._draw_image=function(t){var e,n,i,r,o,s,a,l,u;if(null!=(e=this.model.image_source.images[t]))return this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,h=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),s=h[0],u=h[1],c=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),o=c[0],l=c[1],s=s[0],u=u[0],o=o[0],l=l[0],i=o-s,n=l-u,r=s,a=u,this.map_canvas.drawImage(e.img,r,a,i,n),this.map_canvas.restore();var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Renderer);n.DynamicImageRenderer=l,l.prototype.default_view=n.DynamicImageView,l.prototype.type=\"DynamicImageRenderer\",l.define({alpha:[a.Number,1],image_source:[a.Instance],render_parents:[a.Bool,!0]}),l.override({level:\"underlay\"})},function(t,e,n){n.ImagePool=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t;return null!=(t=this.images.pop())?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50))return t.constructor===Array?Array.prototype.push.apply(this.images,t):this.images.push(t)},t}()},function(t,e,n){var i=t(364),r=t(15),o=t(50),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.images={},this.normalize_case()},e.prototype.normalize_case=function(){\"Note: should probably be refactored into subclasses.\";var t;return t=this.url,t=t.replace(\"{xmin}\",\"{XMIN}\"),t=t.replace(\"{ymin}\",\"{YMIN}\"),t=t.replace(\"{xmax}\",\"{XMAX}\"),t=t.replace(\"{ymax}\",\"{YMAX}\"),t=t.replace(\"{height}\",\"{HEIGHT}\"),t=t.replace(\"{width}\",\"{WIDTH}\"),this.url=t},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace(\"{\"+n+\"}\",r.toString());return i},e.prototype.add_image=function(t){return this.images[t.cache_key]=t},e.prototype.remove_image=function(t){return delete this.images[t.cache_key]},e.prototype.get_image_url=function(t,e,n,i,r,o){return this.string_lookup_replace(this.url,this.extra_url_vars).replace(\"{XMIN}\",t).replace(\"{YMIN}\",e).replace(\"{XMAX}\",n).replace(\"{YMAX}\",i).replace(\"{WIDTH}\",o).replace(\"{HEIGHT}\",r)},e}(o.Model);n.ImageSource=s,s.prototype.type=\"ImageSource\",s.define({url:[r.String,\"\"],extra_url_vars:[r.Any,{}]})},function(t,e,n){var i=t(195);n.BBoxTileSource=i.BBoxTileSource;var r=t(196);n.DynamicImageRenderer=r.DynamicImageRenderer;var o=t(198);n.ImageSource=o.ImageSource;var s=t(200);n.MercatorTileSource=s.MercatorTileSource;var a=t(201);n.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(202);n.TileRenderer=l.TileRenderer;var u=t(203);n.TileSource=u.TileSource;var h=t(205);n.TMSTileSource=h.TMSTileSource;var c=t(206);n.WMTSTileSource=c.WMTSTileSource},function(t,e,n){var i=t(364),r=[].indexOf,o=t(203),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n;return t.prototype.initialize.call(this,e),this._resolutions=function(){var t,e,i,r;for(r=[],n=t=e=this.min_zoom,i=this.max_zoom;e<=i?t<=i:t>=i;n=e<=i?++t:--t)r.push(this.get_resolution(n));return r}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,n){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,n)))&&!(e<0||e>=Math.pow(2,n))},e.prototype.retain_children=function(t){var e,n,i,r,o,s,a;r=t.quadkey,i=r.length,n=i+3,o=this.tiles,s=[];for(e in o)0===(a=o[e]).quadkey.indexOf(r)&&a.quadkey.length>i&&a.quadkey.length<=n?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d;f=t.tile_coords,h=f[0],c=f[1],_=f[2],n=function(){var t,e,n,i;for(i=[],p=t=e=h-4,n=h+4;e<=n?t<=n:t>=n;p=e<=n?++t:--t)i.push(p);return i}(),i=function(){var t,e,n,i;for(i=[],d=t=e=c-4,n=c+4;e<=n?t<=n:t>=n;d=e<=n?++t:--t)i.push(d);return i}(),o=this.tiles,l=[];for(e in o)(u=o[e]).tile_coords[2]===_&&(s=u.tile_coords[0],r.call(n,s)>=0)&&(a=u.tile_coords[1],r.call(i,a)>=0)?l.push(u.retain=!0):l.push(void 0);return l;var f},e.prototype.retain_parents=function(t){var e,n,i,r,o;n=t.quadkey,i=this.tiles,r=[];for(e in i)o=i[e],r.push(o.retain=0===n.indexOf(o.quadkey));return r},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a,l;for(0!==(l=this.calculate_world_x_by_tile_xyz(t,e,n))&&(u=this.normalize_xyz(t,e,n),t=u[0],e=u[1],n=u[2]),a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)h=this.quadkey_to_tile_xyz(a+o.toString()),t=h[0],e=h[1],n=h[2],0!==l&&(c=this.denormalize_xyz(t,e,n,l),t=c[0],e=c[1],n=c[2]),null!=(i=this.get_tile_meter_bounds(t,e,n))&&r.push([t,e,n,i]);return r;var u,h,c},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,n){var i,r;return i=(t[2]-t[0])/n,r=(t[3]-t[1])/e,[i,r]},e.prototype.get_level_by_extent=function(t,e,n){var i,r,o,s,a,l,u,h;for(u=(t[2]-t[0])/n,h=(t[3]-t[1])/e,l=Math.max(u,h),i=0,a=this._resolutions,r=0,o=a.length;rs){if(0===i)return 0;if(i>0)return i-1}i+=1}},e.prototype.get_closest_level_by_extent=function(t,e,n){var i,r,o,s;return o=(t[2]-t[0])/n,s=(t[3]-t[1])/e,r=Math.max(o,s),this._resolutions,i=this._resolutions.reduce(function(t,e){return Math.abs(e-r)=o;c=i+=-1)for(l=r=h,s=u;r<=s;l=r+=1)this.is_valid_tile(l,c,e)&&a.push([l,c,e,this.get_tile_meter_bounds(l,c,e)]);return a=this.sort_tiles_from_center(a,[h,p,u,_]);var g,y},e.prototype.quadkey_to_tile_xyz=function(t){\"Computes tile x, y and z values based on quadKey.\";var e,n,i,r,o,s,a;for(r=0,o=0,s=t.length,e=n=s;n>0;e=n+=-1)switch(a=t.charAt(s-e),i=1<0;r=o+=-1)i=0,0!=(t&(s=1<0;)if(i=i.substring(0,i.length-1),s=this.quadkey_to_tile_xyz(i),t=s[0],e=s[1],n=s[2],a=this.denormalize_xyz(t,e,n,r),t=a[0],e=a[1],n=a[2],this.tile_xyz_to_key(t,e,n)in this.tiles)return[t,e,n];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,n){var i;return this.wrap_around?(i=Math.pow(2,n),[(t%i+i)%i,e,n]):[t,e,n]},e.prototype.denormalize_xyz=function(t,e,n,i){return[t+i*Math.pow(2,n),e,n]},e.prototype.denormalize_meters=function(t,e,n,i){return[t+2*i*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,n){return Math.floor(t/Math.pow(2,n))},e}(o.TileSource);n.MercatorTileSource=a,a.prototype.type=\"MercatorTileSource\",a.define({wrap_around:[s.Bool,!0]}),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(t,e,n){var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r;return i=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,n),t=o[0],e=o[1],n=o[2],r=this.tile_xyz_to_quadkey(t,e,n),i.replace(\"{Q}\",r);var o},e}(r.MercatorTileSource);n.QUADKEYTileSource=o,o.prototype.type=\"QUADKEYTileSource\"},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},o=[].indexOf,s=t(197),a=t(206),l=t(165),u=t(5),h=t(15),c=t(42);n.TileRendererView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._add_attribution=e._add_attribution.bind(e),e._on_tile_load=e._on_tile_load.bind(e),e._on_tile_cache_load=e._on_tile_cache_load.bind(e),e._on_tile_error=e._on_tile_error.bind(e),e._prefetch_tiles=e._prefetch_tiles.bind(e),e._update=e._update.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.pool=new s.ImagePool,this.map_plot=this.plot_model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_model.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,n,i,o;if(r(this,e),t=this.model.tile_source.attribution,c.isString(t)&&t.length>0)return null==this.attributionEl&&(o=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,n=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,i=this.map_frame._width.value,this.attributionEl=u.div({class:\"bk-tile-attribution\",style:{position:\"absolute\",bottom:n+\"px\",right:o+\"px\",\"max-width\":i+\"px\",padding:\"2px\",\"background-color\":\"rgba(255,255,255,0.8)\",\"font-size\":\"9pt\",\"font-family\":\"sans-serif\"}}),this.plot_view.canvas_view.events_el.appendChild(this.attributionEl)),this.attributionEl.innerHTML=t},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),t=this.model.tile_source.snap_to_zoom(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,e),this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this._add_attribution()},e.prototype._on_tile_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.current=!0,n.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.loaded=!0,n.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var n;return r(this,e),n=t.target.tile_data,n.finished=!0},e.prototype._create_tile=function(t,e,n,i,r){void 0===r&&(r=!1);var o,s;return o=this.model.tile_source.normalize_xyz(t,e,n),s=this.pool.pop(),s.onload=r?this._on_tile_cache_load:this._on_tile_load,s.onerror=this._on_tile_error,s.alt=\"\",s.tile_data={tile_coords:[t,e,n],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,n),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,n),bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]},this.model.tile_source.tiles[s.tile_data.cache_key]=s.tile_data,s.src=(a=this.model.tile_source).get_image_url.apply(a,o),this._tiles.push(s),s;var a},e.prototype._enforce_aspect_ratio=function(){var t,e,n;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),n=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom(t,this.map_frame._height.value,this.map_frame._width.value,n),this.x_range.setv({start:e[0],end:e[2]}),this.y_range.setv({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0)},e.prototype.has_finished=function(){var e,n,i;if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(i=this._tiles,e=0,n=i.length;ey&&(h=this.extent,I=y,E=!0),E&&(this.x_range.setv({x_range:{start:h[0],end:h[2]}}),this.y_range.setv({start:h[1],end:h[3]}),this.extent=h),this.extent=h,N=O.get_tiles_by_extent(h,I),S=[],x=[],n=[],s=[],_=0,m=N.length;_=i?(c=(_=[1,l/i])[0],_[1]):(c=(p=[i/l,1])[0],p[1]),t[0]<=e[0]?(o=t[0],(s=t[0]+h*c)>hend&&(s=hend)):(s=t[0],(o=t[0]-h*c)vend&&(a=vend)):(a=t[1],(r=t[1]-h/i)n.end)&&(this.v_axis_only=!0),(os.end)&&(this.h_axis_only=!0)),null!=(i=this.model.document)?i.interactive_start(this.plot_model.plot):void 0;var a},e.prototype._pan=function(t){var e;return this._update(t.deltaX,t.deltaY),null!=(e=this.model.document)?e.interactive_start(this.plot_model.plot):void 0},e.prototype._pan_end=function(t){if(this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info)return this.plot_view.push_state(\"pan\",{range:this.pan_info})},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T;r=this.plot_view.frame,a=t-this.last_dx,l=e-this.last_dy,o=r.bbox.h_range,g=o.start-a,v=o.end-a,k=r.bbox.v_range,w=k.start-l,x=k.end-l,\"width\"!==(n=this.model.dimensions)&&\"both\"!==n||this.v_axis_only?(f=o.start,m=o.end,_=0):(f=g,m=v,_=-a),\"height\"!==n&&\"both\"!==n||this.h_axis_only?(y=k.start,b=k.end,p=0):(y=w,b=x,p=-l),this.last_dx=t,this.last_dy=e,S={},u=r.xscales;for(s in u)c=u[s],M=c.r_invert(f,m),d=M[0],i=M[1],S[s]={start:d,end:i};T={},h=r.yscales;for(s in h)c=h[s],A=c.r_invert(y,b),d=A[0],i=A[1],T[s]={start:d,end:i};return this.pan_info={xrs:S,yrs:T,sdx:_,sdy:p},this.plot_view.update_range(this.pan_info,!0),null;var M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.PanTool=s,s.prototype.default_view=n.PanToolView,s.prototype.type=\"PanTool\",s.prototype.tool_name=\"Pan\",s.prototype.event_type=\"pan\",s.prototype.default_order=10,s.define({dimensions:[o.Dimensions,\"both\"]}),s.getters({tooltip:function(){return this._get_dim_tooltip(\"Pan\",this.dimensions)},icon:function(){return\"bk-tool-icon-\"+function(){switch(this.dimensions){case\"both\":return\"pan\";case\"width\":return\"xpan\";case\"height\":return\"ypan\"}}.call(this)}})},function(t,e,n){var i,r=t(364),o=t(222),s=t(62),a=t(15),l=t(22);n.PolySelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={sx:[],sy:[]}},e.prototype._active_change=function(){if(!this.model.active)return this._clear_data()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_data()},e.prototype._doubletap=function(t){var e,n;return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"poly_select\",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){return this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,n;if(i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)){return this.data.sx.push(e),this.data.sy.push(n),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)});var i}},e.prototype._do_select=function(t,e,n,i){var r;return r={type:\"poly\",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=i.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.PolySelectTool=u,u.prototype.default_view=n.PolySelectToolView,u.prototype.type=\"PolySelectTool\",u.prototype.tool_name=\"Poly Select\",u.prototype.icon=\"bk-tool-icon-polygon-select\",u.prototype.event_type=\"tap\",u.prototype.default_order=11,u.define({callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){var i=t(364),r=t(218),o=t(161),s=t(162),a=t(14),l=t(15),u=t(30),h=t(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._computed_renderers_by_data_source=function(){var t,e,n,i,r,a;for(r={},i=this.computed_renderers,t=0,e=i.length;to;i=0<=o?++r:--r)n.x[i]=s.invert(n.sx[i]),n.y[i]=l.invert(n.sy[i]);break;default:a.logger.debug(\"Unrecognized selection geometry type: '\"+n.type+\"'\")}return this.plot_model.plot.trigger_event(new h.SelectionGeometry({geometry:n,final:e}));var c,_},e}(r.GestureToolView);n.SelectToolView=c,c.getters({computed_renderers:function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.SelectTool=_,_.define({renderers:[l.Array,[]],names:[l.Array,[]]}),_.internal({multi_select_modifier:[l.String,\"shift\"]})},function(t,e,n){var i=t(364),r=t(222),o=t(15),s=t(42);n.TapToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tap=function(t){var e,n,i,r;return o=t.bokeh,i=o.sx,r=o.sy,e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,r,!0,e);var o},e.prototype._select=function(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m;if(l={type:\"point\",sx:t,sy:e},o=this.model.callback,a={geometries:l},\"select\"===this.model.behavior){f=this._computed_renderers_by_data_source();for(r in f)d=f[r],m=d[0].get_selection_manager(),_=function(){var t,e,n;for(n=[],t=0,e=d.length;t.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;switch(n=this.plot_model.frame,i=n.bbox.h_range,x=n.bbox.v_range,S=[i.start,i.end],d=S[0],p=S[1],T=[x.start,x.end],y=T[0],g=T[1],this.model.dimension){case\"height\":b=Math.abs(g-y),c=d,_=p,m=y-b*t,v=g-b*t;break;case\"width\":f=Math.abs(p-d),c=d-f*t,_=p-f*t,m=y,v=g}w={},s=n.xscales;for(r in s)u=s[r],M=u.r_invert(c,_),h=M[0],e=M[1],w[r]={start:h,end:e};k={},a=n.yscales;for(r in a)u=a[r],A=u.r_invert(m,v),h=A[0],e=A[1],k[r]={start:h,end:e};return o={xrs:w,yrs:k,factor:t},this.plot_view.push_state(\"wheel_pan\",{range:o}),this.plot_view.update_range(o,!1,!0),null!=(l=this.model.document)&&l.interactive_start(this.plot_model.plot),null;var S,T,M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelPanTool=s,s.prototype.type=\"WheelPanTool\",s.prototype.default_view=n.WheelPanToolView,s.prototype.tool_name=\"Wheel Pan\",s.prototype.icon=\"bk-tool-icon-wheel-pan\",s.prototype.event_type=\"scroll\",s.prototype.default_order=12,s.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),s.define({dimension:[o.Dimension,\"width\"]}),s.internal({speed:[o.Number,.001]})},function(t,e,n){var i=t(364),r=t(218),o=t(44),s=t(15);n.WheelZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pinch=function(t){var e;return e=t.scale>=1?20*(t.scale-1):-20/t.scale,t.bokeh.delta=e,this._scroll(t)},e.prototype._scroll=function(t){var e,n,i,r,s,a,l,u,h,c,_;return i=this.plot_model.frame,s=i.bbox.h_range,c=i.bbox.v_range,p=t.bokeh,l=p.sx,u=p.sy,e=this.model.dimensions,r=(\"width\"===e||\"both\"===e)&&s.start0?\"pinch\":\"scroll\",a.prototype.default_order=10,a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({dimensions:[s.Dimensions,\"both\"]}),a.internal({speed:[s.Number,1/600]})},function(t,e,n){var i=t(207);n.ActionTool=i.ActionTool;var r=t(208);n.HelpTool=r.HelpTool;var o=t(209);n.RedoTool=o.RedoTool;var s=t(210);n.ResetTool=s.ResetTool;var a=t(211);n.SaveTool=a.SaveTool;var l=t(212);n.UndoTool=l.UndoTool;var u=t(213);n.ZoomInTool=u.ZoomInTool;var h=t(214);n.ZoomOutTool=h.ZoomOutTool;var c=t(215);n.ButtonTool=c.ButtonTool;var _=t(216);n.BoxSelectTool=_.BoxSelectTool;var p=t(217);n.BoxZoomTool=p.BoxZoomTool;var d=t(218);n.GestureTool=d.GestureTool;var f=t(219);n.LassoSelectTool=f.LassoSelectTool;var m=t(220);n.PanTool=m.PanTool;var v=t(221);n.PolySelectTool=v.PolySelectTool;var g=t(222);n.SelectTool=g.SelectTool;var y=t(223);n.TapTool=y.TapTool;var b=t(224);n.WheelPanTool=b.WheelPanTool;var x=t(225);n.WheelZoomTool=x.WheelZoomTool;var w=t(227);n.CrosshairTool=w.CrosshairTool;var k=t(228);n.HoverTool=k.HoverTool;var S=t(229);n.InspectTool=S.InspectTool;var T=t(231);n.Tool=T.Tool;var M=t(232);n.ToolProxy=M.ToolProxy;var A=t(233);n.Toolbar=A.Toolbar;var E=t(234);n.ToolbarBase=E.ToolbarBase;var z=t(235);n.ProxyToolbar=z.ProxyToolbar;var C=t(235);n.ToolbarBox=C.ToolbarBox},function(t,e,n){var i=t(364),r=t(229),o=t(63),s=t(15),a=t(30);n.CrosshairToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)||(e=n=null),this._update_spans(e,n);var i}},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var n;if(\"width\"!==(n=this.model.dimensions)&&\"both\"!==n||(this.model.spans.width.computed_location=e),\"height\"===n||\"both\"===n)return this.model.spans.height.computed_location=t},e}(r.InspectToolView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.spans={width:new o.Span({for_hover:!0,dimension:\"width\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:\"height\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);n.CrosshairTool=l,l.prototype.default_view=n.CrosshairToolView,l.prototype.type=\"CrosshairTool\",l.prototype.tool_name=\"Crosshair\",l.prototype.icon=\"bk-tool-icon-crosshair\",l.define({dimensions:[s.Dimensions,\"both\"],line_color:[s.Color,\"black\"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),l.internal({location_units:[s.SpatialUnits,\"screen\"],render_mode:[s.RenderMode,\"css\"],spans:[s.Any]}),l.getters({tooltip:function(){return this._get_dim_tooltip(\"Crosshair\",this.dimensions)},synthetic_renderers:function(){return a.values(this.spans)}})},function(t,e,n){var i=t(364),r=t(229),o=t(67),s=t(161),a=t(162),l=t(9),u=t(39),h=t(5),c=t(15),_=t(26),p=t(30),d=t(42),f=t(4);n._nearest_line_hit=function(t,e,n,i,r,o){var s,a,u,h,c,_;if(s=r[t],a=o[t],u=r[t+1],h=o[t+1],\"span\"===e.type)switch(e.direction){case\"h\":c=Math.abs(s-n),_=Math.abs(u-n);break;case\"v\":c=Math.abs(a-i),_=Math.abs(h-i)}else c=l.dist_2_pts(s,a,n,i),_=l.dist_2_pts(u,h,n,i);return c<_?[[s,a],t]:[[u,h],t+1]},n._line_hit=function(t,e,n){return[[t[n],e[n]],n]};var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){return f.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e,n,i,r;for(t.prototype.connect_signals.call(this),r=this.computed_renderers,e=0,n=r.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i},e.prototype._compute_ttmodels=function(){var t,e,n,i,r,l,u;if(u={},null!=(l=this.model.tooltips))for(i=this.computed_renderers,t=0,e=i.length;t=0){if(k=x.match(/\\$color(\\[.*\\])?:(\\w*)/),k[0],m=k[1],r=k[2],null==(s=t.get_column(r))){a=h.span({},r+\" unknown\"),i.appendChild(a);continue}if(l=(null!=m?m.indexOf(\"hex\"):void 0)>=0,y=(null!=m?m.indexOf(\"swatch\"):void 0)>=0,null==(o=s[e])){a=h.span({},\"(null)\"),i.appendChild(a);continue}l&&(o=_.color2hex(o)),a=h.span({},o),i.appendChild(a),y&&(a=h.span({class:\"bk-tooltip-color-block\",style:{backgroundColor:o}},\" \"),i.appendChild(a))}else x=x.replace(\"$~\",\"$data_\"),(a=h.span()).innerHTML=u.replace_placeholders(x,t,e,this.model.formatters,n),i.appendChild(a);return g;var w,k},e}(r.InspectToolView);n.HoverToolView=m,m.getters({computed_renderers:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},ttmodels:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels}});var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InspectTool);n.HoverTool=v,v.prototype.default_view=m,v.prototype.type=\"HoverTool\",v.prototype.tool_name=\"Hover\",v.prototype.icon=\"bk-tool-icon-hover\",v.define({tooltips:[c.Any,[[\"index\",\"$index\"],[\"data (x, y)\",\"($x, $y)\"],[\"screen (x, y)\",\"($sx, $sy)\"]]],formatters:[c.Any,{}],renderers:[c.Array,[]],names:[c.Array,[]],mode:[c.String,\"mouse\"],point_policy:[c.String,\"snap_to_data\"],line_policy:[c.String,\"nearest\"],show_arrow:[c.Boolean,!0],anchor:[c.String,\"center\"],attachment:[c.String,\"horizontal\"],callback:[c.Any]})},function(t,e,n){var i=t(364),r=t(15),o=t(215),s=t(230);n.InspectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonTool);n.InspectTool=a,a.prototype.button_view=s.OnOffButtonView,a.prototype.event_type=\"move\",a.define({toggleable:[r.Bool,!0]}),a.override({active:!0})},function(t,e,n){var i=t(364),r=t(215);n.OnOffButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active?this.el.classList.add(\"bk-active\"):this.el.classList.remove(\"bk-active\")},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(r.ButtonToolButtonView)},function(t,e,n){var i=t(364),r=t(15),o=t(45),s=t(22),a=t(50),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);n.ToolView=l,l.getters({plot_model:function(){return this.plot_view.model}});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_dim_tooltip=function(t,e){switch(e){case\"width\":return t+\" (x-axis)\";case\"height\":return t+\" (y-axis)\";case\"both\":return t}},e.prototype._get_dim_limits=function(t,e,n,i){var r,o,a,l,u=t[0],h=t[1],c=e[0],_=e[1];return r=n.bbox.h_range,\"width\"===i||\"both\"===i?(o=[s.min([u,c]),s.max([u,c])],o=[s.max([o[0],r.start]),s.min([o[1],r.end])]):o=[r.start,r.end],l=n.bbox.v_range,\"height\"===i||\"both\"===i?(a=[s.min([h,_]),s.max([h,_])],a=[s.max([a[0],l.start]),s.min([a[1],l.end])]):a=[l.start,l.end],[o,a]},e}(a.Model);n.Tool=u,u.getters({synthetic_renderers:function(){return[]}}),u.internal({active:[r.Boolean,!1]})},function(t,e,n){var i=t(364),r=t(15),o=t(20),s=t(50),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.do=new o.Signal(this,\"do\"),this.connect(this.do,function(){return this.doit()}),this.connect(this.properties.active.change,function(){return this.set_active()})},e.prototype.doit=function(){var t,e,n;for(n=this.tools,t=0,e=n.length;t0&&(x=g(N),this.gestures[n].tools.push(x),this.connect(x.properties.active.change,this._active_change.bind(this,x)))}this.actions=[];for(O in t)(N=t[O]).length>0&&this.actions.push(g(N));this.inspectors=[];for(O in u)(N=u[O]).length>0&&this.inspectors.push(g(N,!0));z=[];for(e in this.gestures)0!==(N=this.gestures[e].tools).length&&(this.gestures[e].tools=a.sortBy(N,function(t){return t.default_order}),\"pinch\"!==e&&\"scroll\"!==e?z.push(this.gestures[e].tools[0].active=!0):z.push(void 0));return z;var P},e}(_.ToolbarBase);n.ProxyToolbar=m,m.prototype.type=\"ProxyToolbar\";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},f.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return f.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e;return t.prototype.render.call(this),(e=this._toolbar_views[this.model.toolbar.id]).render(),s.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(d.LayoutDOMView);n.ToolbarBoxView=v,v.prototype.className=\"bk-toolbar-box\";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(d.LayoutDOM);n.ToolbarBox=g,g.prototype.type=\"ToolbarBox\",g.prototype.default_view=v,g.define({toolbar:[o.Instance],toolbar_location:[o.Location,\"right\"]}),g.getters({sizing_mode:function(){switch(this.toolbar_location){case\"above\":case\"below\":return\"scale_width\";case\"left\":case\"right\":return\"scale_height\"}}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(30),a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(r,e),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,n]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,n]))},r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),[t,\"require\",\"exports\",e])))},r.prototype._make_values=function(){return s.values(this.args)},r}(r.Transform);n.CustomJSTransform=a,a.prototype.type=\"CustomJSTransform\",a.define({args:[o.Any,{}],func:[o.String,\"\"],v_func:[o.String,\"\"]}),a.getters({values:function(){return this._make_values()},scalar_transform:function(){return this._make_transform(\"x\",this.func)},vector_transform:function(){return this._make_transform(\"xs\",this.v_func)}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(r.Transform);n.Dodge=s,s.define({value:[o.Number,0],range:[o.Instance]})},function(t,e,n){var i=t(236);n.CustomJSTransform=i.CustomJSTransform;var r=t(237);n.Dodge=r.Dodge;var o=t(239);n.Interpolator=o.Interpolator;var s=t(240);n.Jitter=s.Jitter;var a=t(241);n.LinearInterpolator=a.LinearInterpolator;var l=t(242);n.StepInterpolator=l.StepInterpolator;var u=t(243);n.Transform=u.Transform},function(t,e,n){var i=t(364),r=[].indexOf,o=t(243),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.prototype.sort=function(t){void 0===t&&(t=!1);var e,n,i,o,s,a,l,u,h,c,_;if(typeof this.x!=typeof this.y)throw new Error(\"The parameters for x and y must be of the same type, either both strings which define a column in the data source or both arrays of the same length\");if(\"string\"==typeof this.x&&null===this.data)throw new Error(\"If the x and y parameters are not specified as an array, the data parameter is reqired.\");if(!1!==this._sorted_dirty){if(c=[],_=[],\"string\"==typeof this.x){if(n=this.data,e=n.columns(),l=this.x,r.call(e,l)<0)throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");if(u=this.y,r.call(e,u)<0)throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");c=n.get_column(this.x),_=n.get_column(this.y)}else c=this.x,_=this.y;if(c.length!==_.length)throw new Error(\"The length for x and y do not match\");if(c.length<2)throw new Error(\"x and y must have at least two elements to support interpolation\");a=[];for(o in c)a.push({x:c[o],y:_[o]});for(!0===t?a.sort(function(t,e){var n,i;return null!=(n=t.xe.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}),s=i=0,h=a.length;0<=h?ih;s=0<=h?++i:--i)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(o.Transform);n.Interpolator=a,a.define({x:[s.Any],y:[s.Any],data:[s.Any],clip:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),\"uniform\"===this.distribution?t+this.mean+(s.random()-.5)*this.width:\"normal\"===this.distribution?t+s.rnorm(this.mean,this.width):void 0},e}(r.Transform);n.Jitter=a,a.define({mean:[o.Number,0],width:[o.Number,1],distribution:[o.Distribution,\"uniform\"],range:[o.Instance]})},function(t,e,n){var i=t(364),r=t(22),o=t(239);n.LinearInterpolator=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,o,s;if(this.sort(!1),!0===this.clip){if(tthis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return t===this._x_sorted[0]?this._y_sorted[0]:(e=r.findLastIndex(this._x_sorted,function(e){return ethis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return n=-1,\"after\"===this.mode&&(n=s.findLastIndex(this._x_sorted,function(e){return t>=e})),\"before\"===this.mode&&(n=s.findIndex(this._x_sorted,function(e){return t<=e})),\"center\"===this.mode&&(e=function(){var e,n,i,o;for(i=this._x_sorted,o=[],e=0,n=i.length;e=1<<28)throw new RangeError(\"repeat count must not overflow maximum string size\");for(var n=\"\";1==(1&t)&&(n+=e),0!=(t>>>=1);)e+=e;return n})},function(t,e,n){var i=t(37),r=function(){function t(t,e,n){this.header=t,this.metadata=e,this.content=n,this.buffers=[]}return t.assemble=function(e,n,i){var r=JSON.parse(e),o=JSON.parse(n),s=JSON.parse(i);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.length)throw new Error(\"too many buffers received, expecting #{nb}\");this.buffers.push([t,e])},t.create=function(e,n,i){void 0===i&&(i={});var r=t.create_header(e);return new t(r,n,i)},t.create_header=function(t){return{msgid:i.uniqueId(),msgtype:t}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!(\"num_buffers\"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error(\"BokehJS only supports receiving buffers, not sending\");var n=JSON.stringify(this.header),i=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(n),t.send(i),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return\"msgid\"in this.header?\"msgtype\"in this.header?null:\"No msgtype in header\":\"No msgid in header\"},t}();n.Message=r},function(t,e,n){var i=t(245),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),n=e[0],r=e[1],o=e[2];this._partial=i.Message.assemble(n,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error(\"Expected text fragment but received binary fragment\")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error(\"Expected binary fragment but received text fragment\")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();n.Receiver=r},function(t,e,n){n.safely=function(t,e){void 0===e&&(e=!1);try{return t()}catch(t){if(function(t){var e=document.createElement(\"div\");e.style.backgroundColor=\"#f2dede\",e.style.border=\"1px solid #a94442\",e.style.borderRadius=\"4px\",e.style.display=\"inline-block\",e.style.fontFamily=\"sans-serif\",e.style.marginTop=\"5px\",e.style.minWidth=\"200px\",e.style.padding=\"5px 5px 5px 10px\";var n=document.createElement(\"span\");n.style.backgroundColor=\"#a94442\",n.style.borderRadius=\"0px 4px 0px 0px\",n.style.color=\"white\",n.style.cursor=\"pointer\",n.style.cssFloat=\"right\",n.style.fontSize=\"0.8em\",n.style.margin=\"-6px -6px 0px 0px\",n.style.padding=\"2px 5px 4px 5px\",n.title=\"close\",n.setAttribute(\"aria-label\",\"close\"),n.appendChild(document.createTextNode(\"x\")),n.addEventListener(\"click\",function(){return o.removeChild(e)});var i=document.createElement(\"h3\");i.style.color=\"#a94442\",i.style.margin=\"8px 0px 0px 0px\",i.style.padding=\"0px\",i.appendChild(document.createTextNode(\"Bokeh Error\"));var r=document.createElement(\"pre\");r.style.whiteSpace=\"unset\",r.style.overflowX=\"auto\",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(n),e.appendChild(i),e.appendChild(r);var o=document.getElementsByTagName(\"body\")[0];o.insertBefore(e,o.firstChild)}(t),e)return;throw t}}},function(t,e,n){n.version=\"0.12.13\"},/*!!\n",
- " * Canvas 2 Svg v1.0.21\n",
- " * A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.\n",
- " *\n",
- " * Licensed under the MIT license:\n",
- " * http://www.opensource.org/licenses/mit-license.php\n",
- " *\n",
- " * Author:\n",
- " * Kerry Liu\n",
- " *\n",
- " * Copyright (c) 2014 Gliffy Inc.\n",
- " */\n",
- " function(t,e,n){!function(){\"use strict\";function t(t,e){var n,i=Object.keys(e);for(n=0;n1?((e=n).width=arguments[0],e.height=arguments[1]):e=t||n,!(this instanceof r))return new r(e);this.width=e.width||n.width,this.height=e.height||n.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement(\"canvas\"),this.__ctx=this.__canvas.getContext(\"2d\")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),this.__root.setAttribute(\"version\",1.1),this.__root.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\",\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),this.__root.setAttribute(\"width\",this.width),this.__root.setAttribute(\"height\",this.height),this.__ids={},this.__defs=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"),this.__root.appendChild(this.__currentElement)}).prototype.__createElement=function(t,e,n){void 0===e&&(e={});var i,r,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",t),s=Object.keys(e);for(n&&(o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"none\")),i=0;i0){\"path\"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var n=this.__createElement(\"g\");e.appendChild(n),this.__currentElement=n}var i=this.__currentElement.getAttribute(\"transform\");i?i+=\" \":i=\"\",i+=t,this.__currentElement.setAttribute(\"transform\",i)},r.prototype.scale=function(e,n){void 0===n&&(n=e),this.__addTransform(t(\"scale({x},{y})\",{x:e,y:n}))},r.prototype.rotate=function(e){var n=180*e/Math.PI;this.__addTransform(t(\"rotate({angle},{cx},{cy})\",{angle:n,cx:0,cy:0}))},r.prototype.translate=function(e,n){this.__addTransform(t(\"translate({x},{y})\",{x:e,y:n}))},r.prototype.transform=function(e,n,i,r,o,s){this.__addTransform(t(\"matrix({a},{b},{c},{d},{e},{f})\",{a:e,b:n,c:i,d:r,e:o,f:s}))},r.prototype.beginPath=function(){var t;this.__currentDefaultPath=\"\",this.__currentPosition={},t=this.__createElement(\"path\",{},!0),this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t},r.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;\"path\"===t.nodeName?t.setAttribute(\"d\",this.__currentDefaultPath):console.error(\"Attempted to apply path command to node\",t.nodeName)},r.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=\" \",this.__currentDefaultPath+=t},r.prototype.moveTo=function(e,n){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:n}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand(\"Z\")},r.prototype.lineTo=function(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf(\"M\")>-1?this.__addPathCommand(t(\"L {x} {y}\",{x:e,y:n})):this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:n}))},r.prototype.bezierCurveTo=function(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))},r.prototype.quadraticCurveTo=function(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(t(\"Q {cpx} {cpy} {x} {y}\",{cpx:e,cpy:n,x:i,y:r}))};var l=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};r.prototype.arcTo=function(t,e,n,i,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if(void 0!==o&&void 0!==s){if(r<0)throw new Error(\"IndexSizeError: The radius provided (\"+r+\") is negative.\");if(o===t&&s===e||t===n&&e===i||0===r)this.lineTo(t,e);else{var a=l([o-t,s-e]),u=l([n-t,i-e]);if(a[0]*u[1]!=a[1]*u[0]){var h=a[0]*u[0]+a[1]*u[1],c=Math.acos(Math.abs(h)),_=l([a[0]+u[0],a[1]+u[1]]),p=r/Math.sin(c/2),d=t+p*_[0],f=e+p*_[1],m=[-a[1],a[0]],v=[u[1],-u[0]],g=function(t){var e=t[0],n=t[1];return n>=0?Math.acos(e):-Math.acos(e)},y=g(m),b=g(v);this.lineTo(d+m[0]*r,f+m[1]*r),this.arc(d,f,r,y,b)}else this.lineTo(t,e)}}},r.prototype.stroke=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"fill stroke markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.fill=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"stroke fill markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"fill\")},r.prototype.rect=function(t,e,n,i){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()},r.prototype.fillRect=function(t,e,n,i){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"fill\")},r.prototype.strokeRect=function(t,e,n,i){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute(\"transform\"),n=this.__root.childNodes[1],i=n.childNodes,r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)},r.prototype.clearRect=function(t,e,n,i){if(0!==t||0!==e||n!==this.width||i!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i,fill:\"#FFFFFF\"},!0),o.appendChild(r)}else this.__clearCanvas()},r.prototype.createLinearGradient=function(t,e,i,r){var s=this.__createElement(\"linearGradient\",{id:n(this.__ids),x1:t+\"px\",x2:i+\"px\",y1:e+\"px\",y2:r+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(s),new o(s,this)},r.prototype.createRadialGradient=function(t,e,i,r,s,a){var l=this.__createElement(\"radialGradient\",{id:n(this.__ids),cx:r+\"px\",cy:s+\"px\",r:a+\"px\",fx:t+\"px\",fy:e+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(l),new o(l,this)},r.prototype.__parseFont=function(){var t=/^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\'\\\"\\sa-z0-9]+?)\\s*$/i.exec(this.font),e={style:t[1]||\"normal\",size:t[4]||\"10px\",family:t[6]||\"sans-serif\",weight:t[3]||\"normal\",decoration:t[2]||\"normal\",href:null};return\"underline\"===this.__fontUnderline&&(e.decoration=\"underline\"),this.__fontHref&&(e.href=this.__fontHref),e},r.prototype.__wrapTextLink=function(t,e){if(t.href){var n=this.__createElement(\"a\");return n.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",t.href),n.appendChild(e),n}return e},r.prototype.__applyText=function(t,e,n,i){var r=this.__parseFont(),o=this.__closestGroupOrSvg(),s=this.__createElement(\"text\",{\"font-family\":r.family,\"font-size\":r.size,\"font-style\":r.style,\"font-weight\":r.weight,\"text-decoration\":r.decoration,x:e,y:n,\"text-anchor\":function(t){var e={left:\"start\",right:\"end\",center:\"middle\",start:\"start\",end:\"end\"};return e[t]||e.start}(this.textAlign),\"dominant-baseline\":function(t){var e={alphabetic:\"alphabetic\",hanging:\"hanging\",top:\"text-before-edge\",bottom:\"text-after-edge\",middle:\"central\"};return e[t]||e.alphabetic}(this.textBaseline)},!0);s.appendChild(this.__document.createTextNode(t)),this.__currentElement=s,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,s))},r.prototype.fillText=function(t,e,n){this.__applyText(t,e,n,\"fill\")},r.prototype.strokeText=function(t,e,n){this.__applyText(t,e,n,\"stroke\")},r.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},r.prototype.arc=function(e,n,i,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+i*Math.cos(o),l=n+i*Math.sin(o),u=e+i*Math.cos(r),h=n+i*Math.sin(r),c=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,h),this.__addPathCommand(t(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:_,sweepFlag:c,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),i=this.__createElement(\"clipPath\"),r=n(this.__ids),o=this.__createElement(\"g\");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),i.setAttribute(\"id\",r),i.appendChild(this.__currentElement),this.__defs.appendChild(i),e.setAttribute(\"clip-path\",t(\"url(#{id})\",{id:r})),e.appendChild(o),this.__currentElement=o},r.prototype.drawImage=function(){var t,e,n,i,o,s,a,l,u,h,c,_,p,d,f=Array.prototype.slice.call(arguments),m=f[0],v=0,g=0;if(3===f.length)t=f[1],e=f[2],o=m.width,s=m.height,n=o,i=s;else if(5===f.length)t=f[1],e=f[2],n=f[3],i=f[4],o=m.width,s=m.height;else{if(9!==f.length)throw new Error(\"Inavlid number of arguments passed to drawImage: \"+arguments.length);v=f[1],g=f[2],o=f[3],s=f[4],t=f[5],e=f[6],n=f[7],i=f[8]}a=this.__closestGroupOrSvg(),this.__currentElement;var y=\"translate(\"+t+\", \"+e+\")\";if(m instanceof r){if((l=m.getSvg().cloneNode(!0)).childNodes&&l.childNodes.length>1){for(u=l.childNodes[0];u.childNodes.length;)d=u.childNodes[0].getAttribute(\"id\"),this.__ids[d]=d,this.__defs.appendChild(u.childNodes[0]);if(h=l.childNodes[1]){var b,x=h.getAttribute(\"transform\");b=x?x+\" \"+y:y,h.setAttribute(\"transform\",b),a.appendChild(h)}}}else\"IMG\"===m.nodeName?((c=this.__createElement(\"image\")).setAttribute(\"width\",n),c.setAttribute(\"height\",i),c.setAttribute(\"preserveAspectRatio\",\"none\"),(v||g||o!==m.width||s!==m.height)&&((_=this.__document.createElement(\"canvas\")).width=n,_.height=i,(p=_.getContext(\"2d\")).drawImage(m,v,g,o,s,0,0,n,i),m=_),c.setAttribute(\"transform\",y),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===m.nodeName?m.toDataURL():m.getAttribute(\"src\")),a.appendChild(c)):\"CANVAS\"===m.nodeName&&((c=this.__createElement(\"image\")).setAttribute(\"width\",n),c.setAttribute(\"height\",i),c.setAttribute(\"preserveAspectRatio\",\"none\"),(_=this.__document.createElement(\"canvas\")).width=n,_.height=i,(p=_.getContext(\"2d\")).imageSmoothingEnabled=!1,p.mozImageSmoothingEnabled=!1,p.oImageSmoothingEnabled=!1,p.webkitImageSmoothingEnabled=!1,p.drawImage(m,v,g,o,s,0,0,n,i),m=_,c.setAttribute(\"transform\",y),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",m.toDataURL()),a.appendChild(c))},r.prototype.createPattern=function(t,e){var i,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"pattern\"),a=n(this.__ids);return o.setAttribute(\"id\",a),o.setAttribute(\"width\",t.width),o.setAttribute(\"height\",t.height),\"CANVAS\"===t.nodeName||\"IMG\"===t.nodeName?((i=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"image\")).setAttribute(\"width\",t.width),i.setAttribute(\"height\",t.height),i.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===t.nodeName?t.toDataURL():t.getAttribute(\"src\")),o.appendChild(i),this.__defs.appendChild(o)):t instanceof r&&(o.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(o)),new s(o,this)},r.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(\",\"):this.lineDash=null},r.prototype.drawFocusRing=function(){},r.prototype.createImageData=function(){},r.prototype.getImageData=function(){},r.prototype.putImageData=function(){},r.prototype.globalCompositeOperation=function(){},r.prototype.setTransform=function(){},\"object\"==typeof window&&(window.C2S=r),\"object\"==typeof e&&\"object\"==typeof e.exports&&(e.exports=r)}()},function(t,e,n){var i,r=t(273),o=t(283),s=t(287),a=t(282),l=t(287),u=t(289),h=Function.prototype.bind,c=Object.defineProperty,_=Object.prototype.hasOwnProperty;i=function(t,e,n){var i,o=u(e)&&l(e.value);return i=r(e),delete i.writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&_.call(this,t)?o:(e.value=h.call(o,n.resolveContext?n.resolveContext(this):this),c(this,t,e),this[t])},i},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,n){return i(n,t,e)})}},function(t,e,n){var i=t(270),r=t(283),o=t(276),s=t(290);(e.exports=function(t,e){var n,o,a,l,u;return arguments.length<2||\"string\"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=a=!0,o=!1):(n=s.call(t,\"c\"),o=s.call(t,\"e\"),a=s.call(t,\"w\")),u={value:e,configurable:n,enumerable:o,writable:a},l?i(r(l),u):u}).gs=function(t,e,n){var a,l,u,h;return\"string\"!=typeof t?(u=n,n=e,e=t,t=null):u=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=e,e=n=void 0),null==t?(a=!0,l=!1):(a=s.call(t,\"c\"),l=s.call(t,\"e\")),h={get:e,set:n,configurable:a,enumerable:l},u?i(r(u),h):h}},function(t,e,n){var i=t(289);e.exports=function(){return i(this).length=0,this}},function(t,e,n){var i=t(264),r=t(268),o=t(289),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,n,h,c;if(!i(t))return s.apply(this,arguments);for(n=r(o(this).length),h=arguments[1],h=isNaN(h)?0:h>=0?u(h):r(this.length)-u(l(h)),e=h;e=55296&&g<=56319&&(w+=t[++n]),w=k?_.call(k,S,w,f):w,e?(p.value=w,d(m,f,p)):m[f]=w,++f;v=f}if(void 0===v)for(v=s(t.length),e&&(m=new e(v)),n=0;n0?1:-1}},function(t,e,n){e.exports=t(265)()?Number.isNaN:t(266)},function(t,e,n){e.exports=function(){var t=Number.isNaN;return\"function\"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){e.exports=function(t){return t!=t}},function(t,e,n){var i=t(261),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?i(t)*o(r(t)):t}},function(t,e,n){var i=t(267),r=Math.max;e.exports=function(t){return r(0,i(t))}},function(t,e,n){var i=t(287),r=t(289),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(n,u){var h,c=arguments[2],_=arguments[3];return n=Object(r(n)),i(u),h=a(n),_&&h.sort(\"function\"==typeof _?o.call(_,n):void 0),\"function\"!=typeof t&&(t=h[t]),s.call(t,h,function(t,i){return l.call(n,t)?s.call(u,c,n[t],t,n,i):e})}}},function(t,e,n){e.exports=t(271)()?Object.assign:t(272)},function(t,e,n){e.exports=function(){var t,e=Object.assign;return\"function\"==typeof e&&(t={foo:\"raz\"},e(t,{bar:\"dwa\"},{trzy:\"trzy\"}),t.foo+t.bar+t.trzy===\"razdwatrzy\")}},function(t,e,n){var i=t(279),r=t(289),o=Math.max;e.exports=function(t,e){var n,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(i){try{t[i]=e[i]}catch(t){n||(n=t)}},s=1;s-1}},function(t,e,n){var i=Object.prototype.toString,r=i.call(\"\");e.exports=function(t){return\"string\"==typeof t||t&&\"object\"==typeof t&&(t instanceof String||i.call(t)===r)||!1}},function(t,e,n){var i=Object.create(null),r=Math.random;e.exports=function(){var t;do{t=r().toString(36).slice(2)}while(i[t]);return t}},function(t,e,n){var i,r=t(284),o=t(290),s=t(251),a=t(308),l=t(298),u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");l.call(this,t),e=e?o.call(e,\"key+value\")?\"key+value\":o.call(e,\"key\")?\"key\":\"value\":\"value\",u(this,\"__kind__\",s(\"\",e))},r&&r(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:\"key+value\"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,a.toStringTag,s(\"c\",\"Array Iterator\"))},function(t,e,n){var i=t(257),r=t(287),o=t(293),s=t(297),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var n,h,c,_,p,d,f,m,v=arguments[2];if(a(t)||i(t)?n=\"array\":o(t)?n=\"string\":t=s(t),r(e),c=function(){_=!0},\"array\"!==n)if(\"string\"!==n)for(h=t.next();!h.done;){if(l.call(e,v,h.value,c),_)return;h=t.next()}else for(d=t.length,p=0;p=55296&&m<=56319&&(f+=t[++p]),l.call(e,v,f,c),!_);++p);else u.call(t,function(t){return l.call(e,v,t,c),_})}},function(t,e,n){var i=t(257),r=t(293),o=t(295),s=t(300),a=t(301),l=t(308).iterator;e.exports=function(t){return\"function\"==typeof a(t)[l]?t[l]():i(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,n){var i,r=t(252),o=t(270),s=t(287),a=t(289),l=t(251),u=t(250),h=t(308),c=Object.defineProperty,_=Object.defineProperties;e.exports=i=function(t,e){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");_(this,{__list__:l(\"w\",a(t)),__context__:l(\"w\",e),__nextIndex__:l(\"w\",0)}),e&&(s(e.on),e.on(\"_add\",this._onAdd),e.on(\"_delete\",this._onDelete),e.on(\"_clear\",this._onClear))},delete i.prototype.constructor,_(i.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)):c(this,\"__redo__\",l(\"c\",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),c(i.prototype,h.iterator,l(function(){return this}))},function(t,e,n){var i=t(257),r=t(278),o=t(293),s=t(308).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!i(t)||\"function\"==typeof t[s])))}},function(t,e,n){var i,r=t(284),o=t(251),s=t(308),a=t(298),l=Object.defineProperty;i=e.exports=function(t){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");t=String(t),a.call(this,t),l(this,\"__length__\",o(\"\",t.length))},r&&r(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n})}),l(i.prototype,s.toStringTag,o(\"c\",\"String Iterator\"))},function(t,e,n){var i=t(299);e.exports=function(t){if(!i(t))throw new TypeError(t+\" is not iterable\");return t}},/*!\n",
- " * @overview es6-promise - a tiny implementation of Promises/A+.\n",
- " * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n",
- " * @license Licensed under MIT license\n",
- " * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE\n",
- " * @version 3.0.2\n",
- " */\n",
- " function(t,e,n){(function(){\"use strict\";function n(t){return\"function\"==typeof t}function i(){return function(){setTimeout(r,1)}}function r(){for(var t=0;t\\s*\\(/gm,\"{anonymous}()@\"):\"Unknown Stack Trace\",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}function u(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&Z(i,n)}function h(t,e){return function(){return t.apply(e,arguments)}}function c(t,e){return typeof t==et?t.apply(e?e[0]||r:r,e):t}function _(t,e){return t===r?e:t}function p(t,e,n){a(v(e),function(e){t.addEventListener(e,n,!1)})}function d(t,e,n){a(v(e),function(e){t.removeEventListener(e,n,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function x(t,e){for(var n,i,o=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=T(e):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,u=e.center=M(i);e.timeStamp=rt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=C(l,u),e.distance=z(l,u),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==_t&&o.eventType!==dt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y});e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=E(e.deltaX,e.deltaY);var h=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=it(h.x)>it(h.y)?h.x:h.y,e.scale=a?function(t,e){return z(e[0],e[1],Tt)/z(t[0],t[1],Tt)}(a.pointers,i):1,e.rotation=a?function(t,e){return C(e[1],e[0],Tt)+C(t[1],t[0],Tt)}(a.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=ft&&(l>ct||a.velocity===r)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=A(l,u,h);i=c.x,o=c.y,n=it(c.x)>it(c.y)?c.x:c.y,s=E(u,h),t.lastInterval=e}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=o,e.direction=s}(n,e);var c=t.element;f(e.srcEvent.target,c)&&(c=e.srcEvent.target);e.target=c}(t,n),t.emit(\"hammer.input\",n),t.recognize(n),t.session.prevInput=n}function T(t){for(var e=[],n=0;n=it(e)?t<0?vt:gt:e<0?yt:bt}function z(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function C(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function O(){this.evEl=At,this.evWin=Et,this.pressed=!1,k.apply(this,arguments)}function N(){this.evEl=Ot,this.evWin=Nt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function j(){this.evTarget=Pt,this.evWin=Dt,this.started=!1,k.apply(this,arguments)}function P(){this.evTarget=It,this.targetIds={},k.apply(this,arguments)}function D(){k.apply(this,arguments);var t=h(this.handler,this);this.touch=new P(this.manager,t),this.mouse=new O(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function F(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)};setTimeout(r,Bt)}}function I(t,e){this.manager=t,this.set(e)}function B(t){this.options=Z({},this.defaults,t||{}),this.id=at++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Ht,this.simultaneous={},this.requireFail=[]}function R(t){return t&Kt?\"cancel\":t&$t?\"end\":t&Qt?\"move\":t&Jt?\"start\":\"\"}function L(t){return t==bt?\"down\":t==yt?\"up\":t==vt?\"left\":t==gt?\"right\":\"\"}function V(t,e){var n=e.manager;return n?n.get(t):t}function G(){B.apply(this,arguments)}function U(){G.apply(this,arguments),this.pX=null,this.pY=null}function Y(){G.apply(this,arguments)}function q(){B.apply(this,arguments),this._timer=null,this._input=null}function X(){G.apply(this,arguments)}function W(){G.apply(this,arguments)}function H(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function J(t,e){return e=e||{},e.recognizers=_(e.recognizers,J.defaults.preset),new Q(t,e)}function Q(t,e){this.options=Z({},J.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){var e,n=t.options.inputClass;e=n||(ut?N:ht?P:lt?D:O);return new e(t,S)}(this),this.touchAction=new I(this,this.options.touchAction),$(this,!0),a(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function $(t,e){var n=t.element;if(n.style){var i;a(t.options.cssProps,function(r,o){i=x(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||\"\"}),e||(t.oldCssProps={})}}var Z,K=[\"\",\"webkit\",\"Moz\",\"MS\",\"ms\",\"o\"],tt=n.createElement(\"div\"),et=\"function\",nt=Math.round,it=Math.abs,rt=Date.now;Z=\"function\"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var e=Object(t),n=1;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i<$t&&e(n.options.event+R(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=$t&&e(n.options.event+R(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return G.prototype.attrTest.call(this,t)&&(this.state&Jt||!(this.state&Jt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=L(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(Y,G,{defaults:{event:\"pinch\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Jt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?\"in\":\"out\";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(q,B,{defaults:{event:\"press\",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||t.eventType&(dt|ft)&&!r)this.reset();else if(t.eventType&_t)this.reset(),this._timer=o(function(){this.state=Zt,this.tryEmit()},e.time,this);else if(t.eventType&dt)return Zt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Zt&&(t&&t.eventType&dt?this.manager.emit(this.options.event+\"up\",t):(this._input.timeStamp=rt(),this.manager.emit(this.options.event,this._input)))}}),u(X,G,{defaults:{event:\"rotate\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Jt)}}),u(W,G,{defaults:{event:\"swipe\",threshold:10,velocity:.3,direction:xt|wt,pointers:1},getTouchAction:function(){return U.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(xt|wt)?e=t.overallVelocity:n&xt?e=t.overallVelocityX:n&wt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&it(e)>this.options.velocity&&t.eventType&dt},emit:function(t){var e=L(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(H,B,{defaults:{event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ut]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance=\";case i.Eq:return\"==\"}}()+\" 0\"},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"expression\",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"op\",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"strength\",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();n.Constraint=o;var s=0},function(t,e,n){var i=t(328),r=t(331),o=t(322),s=function(){function t(){var t=function(t){for(var e=0,n=function(){return 0},i=o.createMap(r.Variable.Compare),s=0,a=t.length;s=0?\" + \"+l+a:\" - \"+-l+a}var u=this.constant;return u<0?n+=\" - \"+-u:u>0&&(n+=\" + \"+u),n},Object.defineProperty(t.prototype,\"terms\",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"constant\",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"value\",{get:function(){var t=this._constant;return i.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();n.Expression=s},function(t,e,n){/*-----------------------------------------------------------------------------\n",
- " | Copyright (c) 2014, Nucleic Development Team.\n",
- " |\n",
- " | Distributed under the terms of the Modified BSD License.\n",
- " |\n",
- " | The full license is in the file COPYING.txt, distributed with this software.\n",
- " |----------------------------------------------------------------------------*/\n",
- " function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}i(t(331)),i(t(320)),i(t(319)),i(t(324)),i(t(323))},function(t,e,n){var i=t(328);n.createMap=function(t){return new i.AssociativeArray(t)}},function(t,e,n){function i(t){return t<0?-t<1e-8:t<1e-8}var r=t(331),o=t(320),s=t(319),a=t(324),l=t(322),u=t(328),h=function(){function t(){this._cnMap=l.createMap(s.Constraint.Compare),this._rowMap=l.createMap(_.Compare),this._varMap=l.createMap(r.Variable.Compare),this._editMap=l.createMap(r.Variable.Compare),this._infeasibleRows=[],this._objective=new d,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error(\"duplicate constraint\");var n=this._createRow(t),r=n.row,o=n.tag,s=this._chooseSubject(r,o);if(s.type()===c.Invalid&&r.allDummies()){if(!i(r.constant())){for(var a=[],l=0,u=t.expression.terms._array;l0&&a.type()!==c.Dummy){var u=this._objective.coefficientFor(a),h=u/l;h0;)n(t[r=o+(i=s>>1)],e)<0?(o=r+1,s-=i+1):s=i;return o}var r=t(329);n.lowerBound=i,n.binarySearch=function(t,e,n){var r=i(t,e,n);if(r===t.length)return-1;var o=t[r];if(0!==n(o,e))return-1;return r},n.binaryFind=function(t,e,n){var r=i(t,e,n);if(r===t.length)return;var o=t[r];if(0!==n(o,e))return;return o},n.asSet=function(t,e){var n=r.asArray(t),i=n.length;if(i<=1)return n;n.sort(e);for(var o=[n[0]],s=1,a=0;s0))return!1;++r}}return!0},n.setIsSubset=function(t,e,n){var i=t.length,r=e.length;if(i>r)return!1;var o=0,s=0;for(;o0?++s:(++o,++s)}if(o0?(a.push(u),++r):(a.push(l),++i,++r)}for(;i0?++r:(a.push(l),++i,++r)}return a},n.setDifference=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i0?++r:(++i,++r)}for(;i0?(a.push(u),++r):(++i,++r)}for(;i=0},e.prototype.find=function(t){return s.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e());return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e());return n.splice(i,0,o),o}return a},e.prototype.insert=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e);return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e);return n.splice(i,0,o),o}return a.second=e,a},e.prototype.update=function(t){var n=this;t instanceof e?this._array=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i0?(a.push(u.copy()),++r):(a.push(u.copy()),++i,++r)}for(;i-1?function(t,e){var n,i,o,s,a;a=t.toString(),n=a.split(\"e\")[0],s=a.split(\"e\")[1],i=n.split(\".\")[0],o=n.split(\".\")[1]||\"\",a=i+o+r(s-o.length),e>0&&(a+=\".\"+r(e));return a}(t,e):(n(t*a)/a).toFixed(e),i&&(o=new RegExp(\"0{1,\"+i+\"}$\"),s=s.replace(o,\"\")),s}function s(t,e,n){return e.indexOf(\"$\")>-1?function(t,e,n){var i,r,o=e,s=o.indexOf(\"$\"),l=o.indexOf(\"(\"),u=o.indexOf(\"+\"),h=o.indexOf(\"-\"),_=\"\",d=\"\";-1===o.indexOf(\"$\")?\"infix\"===c[p].currency.position?(d=c[p].currency.symbol,c[p].currency.spaceSeparated&&(d=\" \"+d+\" \")):c[p].currency.spaceSeparated&&(_=\" \"):o.indexOf(\" $\")>-1?(_=\" \",o=o.replace(\" $\",\"\")):o.indexOf(\"$ \")>-1?(_=\" \",o=o.replace(\"$ \",\"\")):o=o.replace(\"$\",\"\");if(r=a(t,o,n,d),-1===e.indexOf(\"$\"))switch(c[p].currency.position){case\"postfix\":r.indexOf(\")\")>-1?((r=r.split(\"\")).splice(-1,0,_+c[p].currency.symbol),r=r.join(\"\")):r=r+_+c[p].currency.symbol;break;case\"infix\":break;case\"prefix\":r.indexOf(\"(\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),i=Math.max(l,h)+1,r.splice(i,0,c[p].currency.symbol+_),r=r.join(\"\")):r=c[p].currency.symbol+_+r;break;default:throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]')}else s<=1?r.indexOf(\"(\")>-1||r.indexOf(\"+\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),i=1,(s-1?((r=r.split(\"\")).splice(-1,0,_+c[p].currency.symbol),r=r.join(\"\")):r=r+_+c[p].currency.symbol;return r}(t,e,n):e.indexOf(\"%\")>-1?function(t,e,n){var i,r=\"\";t*=100,e.indexOf(\" %\")>-1?(r=\" \",e=e.replace(\" %\",\"\")):e=e.replace(\"%\",\"\");(i=a(t,e,n)).indexOf(\")\")>-1?((i=i.split(\"\")).splice(-1,0,r+\"%\"),i=i.join(\"\")):i=i+r+\"%\";return i}(t,e,n):e.indexOf(\":\")>-1?function(t){var e=Math.floor(t/60/60),n=Math.floor((t-60*e*60)/60),i=Math.round(t-60*e*60-60*n);return e+\":\"+(n<10?\"0\"+n:n)+\":\"+(i<10?\"0\"+i:i)}(t):a(t,e,n)}function a(t,e,n,i){var r,s,a,l,u,h,_,f,m,v,g,y,b,x,w,k,S,T,M=!1,A=!1,E=!1,z=\"\",C=!1,O=!1,N=!1,j=!1,P=!1,D=\"\",F=\"\",I=Math.abs(t),B=[\"B\",\"KiB\",\"MiB\",\"GiB\",\"TiB\",\"PiB\",\"EiB\",\"ZiB\",\"YiB\"],R=[\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\"],L=\"\",V=!1,G=!1,U=\"\";if(0===t&&null!==d)return d;if(!isFinite(t))return\"\"+t;if(0===e.indexOf(\"{\")){var Y=e.indexOf(\"}\");if(-1===Y)throw Error('Format should also contain a \"}\"');y=e.slice(1,Y),e=e.slice(Y+1)}else y=\"\";if(e.indexOf(\"}\")===e.length-1){var q=e.indexOf(\"{\");if(-1===q)throw Error('Format should also contain a \"{\"');b=e.slice(q+1,-1),e=e.slice(0,q+1)}else b=\"\";var X;if(X=-1===e.indexOf(\".\")?e.match(/([0-9]+).*/):e.match(/([0-9]+)\\..*/),T=null===X?-1:X[1].length,-1!==e.indexOf(\"-\")&&(V=!0),e.indexOf(\"(\")>-1?(M=!0,e=e.slice(1,-1)):e.indexOf(\"+\")>-1&&(A=!0,e=e.replace(/\\+/g,\"\")),e.indexOf(\"a\")>-1){if(v=e.split(\".\")[0].match(/[0-9]+/g)||[\"0\"],v=parseInt(v[0],10),C=e.indexOf(\"aK\")>=0,O=e.indexOf(\"aM\")>=0,N=e.indexOf(\"aB\")>=0,j=e.indexOf(\"aT\")>=0,P=C||O||N||j,e.indexOf(\" a\")>-1?(z=\" \",e=e.replace(\" a\",\"\")):e=e.replace(\"a\",\"\"),u=Math.floor(Math.log(I)/Math.LN10)+1,_=u%3,_=0===_?3:_,v&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-v,f=3*~~((Math.min(v,u)-_)/3),I/=Math.pow(10,f),-1===e.indexOf(\".\")&&v>3))for(e+=\"[.]\",k=(k=0===h?0:3*~~(h/3)-h)<0?k+3:k,r=0;r=Math.pow(10,12)&&!P||j?(z+=c[p].abbreviations.trillion,t/=Math.pow(10,12)):I=Math.pow(10,9)&&!P||N?(z+=c[p].abbreviations.billion,t/=Math.pow(10,9)):I=Math.pow(10,6)&&!P||O?(z+=c[p].abbreviations.million,t/=Math.pow(10,6)):(I=Math.pow(10,3)&&!P||C)&&(z+=c[p].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf(\"b\")>-1)for(e.indexOf(\" b\")>-1?(D=\" \",e=e.replace(\" b\",\"\")):e=e.replace(\"b\",\"\"),l=0;l<=B.length;l++)if(s=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=s&&t0&&(t/=s);break}if(e.indexOf(\"d\")>-1)for(e.indexOf(\" d\")>-1?(D=\" \",e=e.replace(\" d\",\"\")):e=e.replace(\"d\",\"\"),l=0;l<=R.length;l++)if(s=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=s&&t0&&(t/=s);break}if(e.indexOf(\"o\")>-1&&(e.indexOf(\" o\")>-1?(F=\" \",e=e.replace(\" o\",\"\")):e=e.replace(\"o\",\"\"),c[p].ordinal&&(F+=c[p].ordinal(t))),e.indexOf(\"[.]\")>-1&&(E=!0,e=e.replace(\"[.]\",\".\")),m=t.toString().split(\".\")[0],g=e.split(\".\")[1],x=e.indexOf(\",\"),g){if(-1!==g.indexOf(\"*\")?L=o(t,t.toString().split(\".\")[1].length,n):g.indexOf(\"[\")>-1?(g=(g=g.replace(\"]\",\"\")).split(\"[\"),L=o(t,g[0].length+g[1].length,n,g[1].length)):L=o(t,g.length,n),m=L.split(\".\")[0],L.split(\".\")[1].length){var W=i?z+i:c[p].delimiters.decimal;L=W+L.split(\".\")[1]}else L=\"\";E&&0===Number(L.slice(1))&&(L=\"\")}else m=o(t,null,n);return m.indexOf(\"-\")>-1&&(m=m.slice(1),G=!0),m.length-1&&(m=m.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1\"+c[p].delimiters.thousands)),0===e.indexOf(\".\")&&(m=\"\"),w=e.indexOf(\"(\"),S=e.indexOf(\"-\"),U=w2||(o.length<2?!o[0].match(/^\\d+.*\\d$/)||o[0].match(a):1===o[0].length?!o[0].match(/^\\d+$/)||o[0].match(a)||!o[1].match(/^\\d+$/):!o[0].match(/^\\d+.*\\d$/)||o[0].match(a)||!o[1].match(/^\\d+$/)))))},e.exports={format:function(t,e,n,i){null!=n&&n!==h.culture()&&h.setCulture(n);return s(Number(t),null!=e?e:f,null==i?Math.round:i)}}},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var n=r(t);if(\"object\"==typeof n){var s=i.projections.get(n.projName);if(s){if(n.datumCode&&\"none\"!==n.datumCode){var h=l[n.datumCode];h&&(n.datum_params=h.towgs84?h.towgs84.split(\",\"):null,n.ellps=h.ellipse,n.datumName=h.datumName?h.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||\"enu\";var c=a.sphere(n.a,n.b,n.rf,n.ellps,n.sphere),_=a.eccentricity(c.a,c.b,c.rf,n.R_A),p=n.datum||u(n.datumCode,n.datum_params,c.a,c.b,_.es,_.ep2);o(this,n),o(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}var r=t(353),o=t(351),s=t(355),a=t(350),l=t(341),u=t(346);(i.projections=s).start(),e.exports=i},function(t,e,n){e.exports=function(t,e,n){var i,r,o,s=n.x,a=n.y,l=n.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(i=s,r=\"x\"):1===o?(i=a,r=\"y\"):(i=l,r=\"z\"),t.axis[o]){case\"e\":u[r]=i;break;case\"w\":u[r]=-i;break;case\"n\":u[r]=i;break;case\"s\":u[r]=-i;break;case\"u\":void 0!==n[r]&&(u.z=i);break;case\"d\":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(t,e,n){var i=2*Math.PI,r=t(338);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*i}},function(t,e,n){e.exports=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,n){e.exports=function(t){return t<0?-1:1}},function(t,e,n){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r}},function(t,e,n){n.wgs84={towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"},n.ch1903={towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"},n.ggrs87={towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"},n.nad83={towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"},n.nad27={nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"},n.potsdam={towgs84:\"606.0,23.0,413.0\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"},n.carthage={towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"},n.hermannskogel={towgs84:\"653.0,-212.0,449.0\",ellipse:\"bessel\",datumName:\"Hermannskogel\"},n.ire65={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"},n.rassadiran={towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"},n.nzgd49={towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"},n.osgb36={towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Airy 1830\"},n.s_jtsk={towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"},n.beduaram={towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"},n.gunung_segara={towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"},n.rnb72={towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"}},function(t,e,n){n.MERIT={a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"},n.SGS85={a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"},n.IAU76={a:6378140,rf:298.257,ellipseName:\"IAU 1976\"},n.airy={a:6377563.396,b:6356256.91,ellipseName:\"Airy 1830\"},n.APL4={a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"},n.NWL9D={a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:\"Modified Airy\"},n.andrae={a:6377104.43,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"},n.aust_SA={a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:\"Bessel 1841\"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:\"Clarke 1866\"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:\"Clarke 1858\"},n.CPM={a:6375738.7,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"},n.delmbr={a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:\"Engelis 1985\"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:\"Everest 1830\"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:\"Everest 1948\"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:\"Everest 1956\"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:\"Everest 1969\"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"},n.fschr60={a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"},n.fschr60m={a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"},n.fschr68={a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"},n.helmert={a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"},n.hough={a:6378270,rf:297,ellipseName:\"Hough\"},n.intl={a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"},n.kaula={a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"},n.lerch={a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"},n.mprts={a:6397300,rf:191,ellipseName:\"Maupertius 1738\"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:\"New International 1967\"},n.plessis={a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"},n.krass={a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:\"Southeast Asia\"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:\"Walbeck\"},n.WGS60={a:6378165,rf:298.3,ellipseName:\"WGS 60\"},n.WGS66={a:6378145,rf:298.25,ellipseName:\"WGS 66\"},n.WGS7={a:6378135,rf:298.26,ellipseName:\"WGS 72\"},n.WGS84={a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"},n.sphere={a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"}},function(t,e,n){n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,n){n.ft={to_meter:.3048},n[\"us-ft\"]={to_meter:1200/3937}},function(t,e,n){function i(t,e,n){var i;return Array.isArray(n)?(i=s(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):s(t,e,n)}function r(t){return t instanceof o?t:t.oProj?t.oProj:o(t)}var o=t(333),s=t(358),a=o(\"WGS84\");e.exports=function(t,e,n){t=r(t);var o,s=!1;void 0===e?(e=t,t=a,s=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=a,s=!0);return e=r(e),n?i(t,e,n):(o={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},s&&(o.oProj=e),o)}},function(t,e,n){var i=1,r=2,o=4,s=5,a=484813681109536e-20;e.exports=function(t,e,n,l,u,h){var c={};c.datum_type=o,t&&\"none\"===t&&(c.datum_type=s);e&&(c.datum_params=e.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=i),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=r,c.datum_params[3]*=a,c.datum_params[4]*=a,c.datum_params[5]*=a,c.datum_params[6]=c.datum_params[6]/1e6+1)));return c.a=n,c.b=l,c.es=u,c.ep2=h,c}},function(t,e,n){var i=Math.PI/2;n.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(1===t.datum_type?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},n.geodeticToGeocentric=function(t,e,n){var r,o,s,a,l=t.x,u=t.y,h=t.z?t.z:0;if(u<-i&&u>-1.001*i)u=-i;else if(u>i&&u<1.001*i)u=i;else if(u<-i||u>i)return null;return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(u),a=Math.cos(u),s=o*o,r=n/Math.sqrt(1-e*s),{x:(r+h)*a*Math.cos(l),y:(r+h)*a*Math.sin(l),z:(r*(1-e)+h)*o}},n.geocentricToGeodetic=function(t,e,n,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t.x,w=t.y,k=t.z?t.z:0;if(o=Math.sqrt(x*x+w*w),s=Math.sqrt(x*x+w*w+k*k),o/n<1e-12){if(g=0,s/n<1e-12)return y=i,b=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(w,x);a=k/s,l=o/s,u=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*u,p=a*u,v=0;do{v++,c=n/Math.sqrt(1-e*p*p),h=e*c/(c+(b=o*_+k*p-c*(1-e*p*p))),u=1/Math.sqrt(1-h*(2-h)*l*l),m=(f=a*u)*_-(d=l*(1-h)*u)*p,_=d,p=f}while(m*m>1e-24&&v<30);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},n.geocentricToWgs84=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6];return{x:u*(t.x-l*t.y+a*t.z)+i,y:u*(l*t.x+t.y-s*t.z)+r,z:u*(-a*t.x+s*t.y+t.z)+o}}},n.geocentricFromWgs84=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6],h=(t.x-i)/u,c=(t.y-r)/u,_=(t.z-o)/u;return{x:h+l*c-a*_,y:-l*h+c+s*_,z:a*h-s*c+_}}}},function(t,e,n){function i(t){return t===r||t===o}var r=1,o=2,s=t(347);e.exports=function(t,e,n){return s.compareDatums(t,e)?n:5===t.datum_type||5===e.datum_type?n:t.es!==e.es||t.a!==e.a||i(t.datum_type)||i(e.datum_type)?(n=s.geodeticToGeocentric(n,t.es,t.a),i(t.datum_type)&&(n=s.geocentricToWgs84(n,t.datum_type,t.datum_params)),i(e.datum_type)&&(n=s.geocentricFromWgs84(n,e.datum_type,e.datum_params)),s.geocentricToGeodetic(n,e.es,e.a,e.b)):n}},function(t,e,n){function i(t){var e=this;if(2===arguments.length){var n=arguments[1];i[t]=\"string\"==typeof n?\"+\"===n.charAt(0)?o(arguments[1]):s(arguments[1]):n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?i.apply(e,t):i(t)});if(\"string\"==typeof t){if(t in i)return i[t]}else\"EPSG\"in t?i[\"EPSG:\"+t.EPSG]=t:\"ESRI\"in t?i[\"ESRI:\"+t.ESRI]=t:\"IAU2000\"in t?i[\"IAU2000:\"+t.IAU2000]=t:console.log(t);return}}var r=t(352),o=t(354),s=t(359);r(i),e.exports=i},function(t,e,n){var i=t(342);n.eccentricity=function(t,e,n,i){var r=t*t,o=e*e,s=(r-o)/r,a=0;i?(r=(t*=1-s*(.16666666666666666+s*(.04722222222222222+.022156084656084655*s)))*t,s=0):a=Math.sqrt(s);var l=(r-o)/o;return{es:s,e:a,ep2:l}},n.sphere=function(t,e,n,r,o){if(!t){var s=i[r];s||(s=i.WGS84),t=s.a,e=s.b,n=s.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<1e-10)&&(o=!0,e=t),{a:t,b:e,rf:n,sphere:o}}},function(t,e,n){e.exports=function(t,e){t=t||{};var n,i;if(!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t}},function(t,e,n){e.exports=function(t){t(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),t(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),t(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\"),t.WGS84=t[\"EPSG:4326\"],t[\"EPSG:3785\"]=t[\"EPSG:3857\"],t.GOOGLE=t[\"EPSG:3857\"],t[\"EPSG:900913\"]=t[\"EPSG:3857\"],t[\"EPSG:102113\"]=t[\"EPSG:3857\"]}},function(t,e,n){var i=t(349),r=t(359),o=t(354),s=[\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\"];e.exports=function(t){if(!function(t){return\"string\"==typeof t}(t))return t;if(function(t){return t in i}(t))return i[t];if(function(t){return s.some(function(e){return t.indexOf(e)>-1})}(t))return r(t);if(function(t){return\"+\"===t[0]}(t))return o(t)}},function(t,e,n){var i=.017453292519943295,r=t(343),o=t(344);e.exports=function(t){var e,n,s,a={},l=t.split(\"+\").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split(\"=\");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),u={proj:\"projName\",datum:\"datumCode\",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*i},lat_1:function(t){a.lat1=t*i},lat_2:function(t){a.lat2=t*i},lat_ts:function(t){a.lat_ts=t*i},lon_0:function(t){a.long0=t*i},lon_1:function(t){a.long1=t*i},lon_2:function(t){a.long2=t*i},alpha:function(t){a.alpha=parseFloat(t)*i},lonc:function(t){a.longc=t*i},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(\",\").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*i},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*i},nadgrids:function(t){\"@null\"===t?a.datumCode=\"none\":a.nadgrids=t},axis:function(t){3===t.length&&-1!==\"ewnsud\".indexOf(t.substr(0,1))&&-1!==\"ewnsud\".indexOf(t.substr(1,1))&&-1!==\"ewnsud\".indexOf(t.substr(2,1))&&(a.axis=t)}};for(e in l)n=l[e],e in u?\"function\"==typeof(s=u[e])?s(n):a[s]=n:a[e]=n;return\"string\"==typeof a.datumCode&&\"WGS84\"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,n){function i(t,e){var n=s.length;return t.names?(s[n]=t,t.names.forEach(function(t){o[t.toLowerCase()]=n}),this):(console.log(e),!0)}var r=[t(357),t(356)],o={},s=[];n.add=i,n.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==o[e]&&s[o[e]]?s[o[e]]:void 0},n.start=function(){r.forEach(i)}},function(t,e,n){function i(t){return t}n.init=function(){},n.forward=i,n.inverse=i,n.names=[\"longlat\",\"identity\"]},function(t,e,n){var i=t(336),r=Math.PI/2,o=57.29577951308232,s=t(335),a=Math.PI/4,l=t(340),u=t(337);n.init=function(){var t=this.b/this.a;this.es=1-t*t,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},n.forward=function(t){var e=t.x,n=t.y;if(n*o>90&&n*o<-90&&e*o>180&&e*o<-180)return null;var i,u;if(Math.abs(Math.abs(n)-r)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*n));else{var h=Math.sin(n),c=l(this.e,n,h);i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0-this.a*this.k0*Math.log(c)}return t.x=i,t.y=u,t},n.inverse=function(t){var e,n,i=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(n=u(this.e,a)))return null}return e=s(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},n.names=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"merc\"]},function(t,e,n){var i=1,r=2,o=t(348),s=t(334),a=t(333),l=t(339);e.exports=function t(e,n,u){var h;return Array.isArray(u)&&(u=l(u)),e.datum&&n.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===r)&&\"WGS84\"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===r)&&\"WGS84\"!==t.datumCode}(e,n)&&(h=new a(\"WGS84\"),u=t(e,h,u),e=h),\"enu\"!==e.axis&&(u=s(e,!1,u)),\"longlat\"===e.projName?u={x:.017453292519943295*u.x,y:.017453292519943295*u.y}:(e.to_meter&&(u={x:u.x*e.to_meter,y:u.y*e.to_meter}),u=e.inverse(u)),e.from_greenwich&&(u.x+=e.from_greenwich),u=o(e.datum,n.datum,u),n.from_greenwich&&(u={x:u.x-n.grom_greenwich,y:u.y}),\"longlat\"===n.projName?u={x:57.29577951308232*u.x,y:57.29577951308232*u.y}:(u=n.forward(u),n.to_meter&&(u={x:u.x/n.to_meter,y:u.y/n.to_meter})),\"enu\"!==n.axis?s(n,!0,u):u}},function(t,e,n){function i(t,e,n){t[e]=n.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return a(t,e)},{})}function r(t,e){var n;Array.isArray(t)?(\"PARAMETER\"===(n=t.shift())&&(n=t.shift()),1===t.length?Array.isArray(t[0])?(e[n]={},r(t[0],e[n])):e[n]=t[0]:t.length?\"TOWGS84\"===n?e[n]=t:(e[n]={},[\"UNIT\",\"PRIMEM\",\"VERT_DATUM\"].indexOf(n)>-1?(e[n]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[n].auth=t[2])):\"SPHEROID\"===n?(e[n]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[n].auth=t[3])):[\"GEOGCS\",\"GEOCCS\",\"DATUM\",\"VERT_CS\",\"COMPD_CS\",\"LOCAL_CS\",\"FITTED_CS\",\"LOCAL_DATUM\"].indexOf(n)>-1?(t[0]=[\"name\",t[0]],i(e,n,t)):t.every(function(t){return Array.isArray(t)})?i(e,n,t):r(t,e[n])):e[n]=!0):e[t]=!0}function o(t){return t*s}var s=.017453292519943295,a=t(351);e.exports=function(t,e){var n=JSON.parse((\",\"+t).replace(/\\s*\\,\\s*([A-Z_0-9]+?)(\\[)/g,',[\"$1\",').slice(1).replace(/\\s*\\,\\s*([A-Z_0-9]+?)\\]/g,',\"$1\"]').replace(/,\\[\"VERTCS\".+/,\"\")),i=n.shift(),s=n.shift();n.unshift([\"name\",s]),n.unshift([\"type\",i]),n.unshift(\"output\");var l={};return r(n,l),function(t){function e(e){var n=t.to_meter||1;return parseFloat(e,10)*n}\"GEOGCS\"===t.type?t.projName=\"longlat\":\"LOCAL_CS\"===t.type?(t.projName=\"identity\",t.local=!0):\"object\"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION;t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),\"metre\"===t.units&&(t.units=\"meter\"),t.UNIT.convert&&(\"GEOGCS\"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10)));t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),\"d_\"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),\"new_zealand_geodetic_datum_1949\"!==t.datumCode&&\"new_zealand_1949\"!==t.datumCode||(t.datumCode=\"nzgd49\"),\"wgs_1984\"===t.datumCode&&(\"Mercator_Auxiliary_Sphere\"===t.PROJECTION&&(t.sphere=!0),t.datumCode=\"wgs84\"),\"_ferro\"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),\"_jakarta\"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf(\"belge\")&&(t.datumCode=\"rnb72\"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),\"international\"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps=\"intl\"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf(\"osgb_1936\")&&(t.datumCode=\"osgb36\"));t.b&&!isFinite(t.b)&&(t.b=t.a);[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"false_easting\",\"False_Easting\"],[\"false_northing\",\"False_Northing\"],[\"central_meridian\",\"Central_Meridian\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",o],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longc\",\"longitude_of_center\",o],[\"x0\",\"false_easting\",e],[\"y0\",\"false_northing\",e],[\"long0\",\"central_meridian\",o],[\"lat0\",\"latitude_of_origin\",o],[\"lat0\",\"standard_parallel_1\",o],[\"lat1\",\"standard_parallel_1\",o],[\"lat2\",\"standard_parallel_2\",o],[\"alpha\",\"azimuth\",o],[\"srsCode\",\"name\"]].forEach(function(e){return function(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}(t,e)}),t.long0||!t.longc||\"Albers_Conic_Equal_Area\"!==t.projName&&\"Lambert_Azimuthal_Equal_Area\"!==t.projName||(t.long0=t.longc);t.lat_ts||!t.lat1||\"Stereographic_South_Pole\"!==t.projName&&\"Polar Stereographic (variant B)\"!==t.projName||(t.lat0=o(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(l.output),a(e,l.output)}},function(t,e,n){function i(t,e,n,o,s){for(n=n||0,o=o||t.length-1,s=s||function(t,e){return t