!function(t,e){t.Bokeh=function(t,e,i){var n={},r=function(i){var o=null!=e[i]?e[i]:i;if(!n[o]){if(!t[o]){var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var a=n[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return n[o].exports},o=r(52);return o.require=r,o.register_plugin=function(i,n,s){for(var a in i)t[a]=i[a];for(var a in n)e[a]=n[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,i){var n=t(142),r=t(32);i.overrides={};var o=r.clone(n);i.Models=function(t){var e=i.overrides[t]||o[t];if(null==e)throw new Error("Model '"+t+"' does not exist. This could be due to a widget\n                     or a custom model not being registered before first usage.");return e},i.Models.register=function(t,e){i.overrides[t]=e},i.Models.unregister=function(t){delete i.overrides[t]},i.Models.register_models=function(t,e,i){if(void 0===e&&(e=!1),null!=t)for(var n in t){var r=t[n];e||!o.hasOwnProperty(n)?o[n]=r:null!=i?i(n):console.warn("Model '"+n+"' was already registered")}},i.register_models=i.Models.register_models,i.Models.registered_names=function(){return Object.keys(o)},i.index={}},function(t,e,i){var n=t(317),r=t(14),o=t(50),s=t(260),a=t(261),l=t(2);i.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",i.DEFAULT_SESSION_ID="default";var h=0,c=function(){function t(t,e,n,o,s){void 0===t&&(t=i.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=i.DEFAULT_SESSION_ID),void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=n,this._on_have_session_hook=o,this._on_closed_permanently_hook=s,this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new a.Receiver,r.logger.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'")}return t.prototype.connect=function(){var t=this;if(this.closed_permanently)return n.Promise.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return n.Promise.reject(new Error("Already connected"));this._pending_replies={},this._current_handler=null;try{var e=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id;return null!=this.args_string&&this.args_string.length>0&&(e+="&"+this.args_string),this.socket=new WebSocket(e),new n.Promise(function(e,i){t.socket.binaryType="arraybuffer",t.socket.onopen=function(){return t._on_open(e,i)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(i)}})}catch(t){return r.logger.error("websocket creation failed to url: "+this.url),r.logger.error(" - "+t),n.Promise.reject(t)}},t.prototype.close=function(){this.closed_permanently||(r.logger.debug("Permanently closing websocket connection "+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,"close method called on ClientConnection "+this._number),this.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this;setTimeout(function(){e.closed_permanently||r.logger.info("Websocket connection "+e._number+" disconnected, will not attempt to reconnect");return},t)},t.prototype.send=function(t){if(null==this.socket)throw new Error("not connected so cannot send "+t);t.send(this.socket)},t.prototype.send_with_reply=function(t){var e=this,i=new n.Promise(function(i,n){e._pending_replies[t.msgid()]=[i,n],e.send(t)});return i.then(function(t){if("ERROR"===t.msgtype())throw new Error("Error reply "+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t=s.Message.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t);return e.then(function(t){if(!("doc"in t.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){var t=this;null==this.session?r.logger.debug("Pulling session for first time"):r.logger.debug("Repulling session"),this._pull_doc_json().then(function(e){if(null==t.session)if(t.closed_permanently)r.logger.debug("Got new document after connection was already closed");else{var i=o.Document.from_json(e),n=o.Document._compute_patch_since_json(e,i);if(n.events.length>0){r.logger.debug("Sending "+n.events.length+" changes from model construction back to server");var a=s.Message.create("PATCH-DOC",{},n);t.send(a)}t.session=new l.ClientSession(t,i,t.id),r.logger.debug("Created a new session from new pulled doc"),null!=t._on_have_session_hook&&(t._on_have_session_hook(t.session),t._on_have_session_hook=null)}else t.session.document.replace_with_json(e),r.logger.debug("Updated existing session with new pulled doc")},function(t){throw t}).catch(function(t){null!=console.trace&&console.trace(t),r.logger.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){var i=this;r.logger.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){i._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(t.data)}catch(t){this._close_bad_protocol(t.toString())}if(null!=this._receiver.message){var e=this._receiver.message,i=e.problem();null!=i&&this._close_bad_protocol(i),this._current_handler(e)}},t.prototype._on_close=function(t){var e=this;r.logger.info("Lost websocket "+this._number+" connection, "+t.code+" ("+t.reason+")"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error("Lost websocket connection, "+t.code+" ("+t.reason+")")),this._pending_ack=null);for(var i=function(){for(var t in e._pending_replies){var i=e._pending_replies[t];return delete e._pending_replies[t],i}return null},n=i();null!=n;)n[1]("Disconnected"),n=i();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){r.logger.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){r.logger.error("Closing connection: "+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;"ACK"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol("First message was not an ACK")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();i.ClientConnection=c,i.pull_session=function(t,e,i){return new n.Promise(function(n,o){return new c(t,e,i,function(t){try{n(t)}catch(e){throw r.logger.error("Promise handler threw an error, closing session "+e),t.close(),e}},function(){o(new Error("Connection was closed before we successfully pulled a session"))}).connect().then(function(t){},function(t){throw r.logger.error("Failed to connect to Bokeh server "+t),t})})}},function(t,e,i){var n=t(14),r=t(50),o=t(260),s=function(){function t(t,e,i){var n=this;this._connection=t,this.document=e,this.id=i,this._document_listener=function(t){return n._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();"PATCH-DOC"===e?this._handle_patch(t):"OK"===e?this._handle_ok(t):"ERROR"===e?this._handle_error(t):n.logger.debug("Doing nothing with message "+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create("EVENT",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create("PATCH-DOC",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){n.logger.trace("Unhandled OK reply to "+t.reqid())},t.prototype._handle_error=function(t){n.logger.error("Unhandled ERROR reply to "+t.reqid()+": "+t.content.text)},t}();i.ClientSession=s},function(t,e,i){function n(t){return function(e){e.prototype.event_name=t,a[t]=e}}var r=t(379),o=t(14),s=t(32),a={};i.register_event_class=n,i.register_with_event=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=n};var l=function(){function t(t){void 0===t&&(t={}),this.model_id=null,this._options=t,t.model_id&&(this.model_id=t.model_id)}return t.prototype.set_model_id=function(t){return this._options.model_id=t,this.model_id=t,this},t.prototype.is_applicable_to=function(t){return this.applicable_models.some(function(e){return t instanceof e})},t.event_class=function(t){if(t.type)return a[t.type];o.logger.warn("BokehEvent.event_class required events with a string type attribute")},t.prototype.toJSON=function(){return{event_name:this.event_name,event_values:s.clone(this._options)}},t.prototype._customize_event=function(t){return this},t}();i.BokehEvent=l,l.prototype.applicable_models=[];var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("button_click")],e)}(l);i.ButtonClick=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(l);i.UIEvent=c;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("lodstart")],e)}(c);i.LODStart=u;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("lodend")],e)}(c);i.LODEnd=_;var p=function(t){function e(e){var i=t.call(this,e)||this;return i.geometry=e.geometry,i.final=e.final,i}return r.__extends(e,t),e=r.__decorate([n("selectiongeometry")],e)}(c);i.SelectionGeometry=p;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("reset")],e)}(c);i.Reset=d;var f=function(t){function e(e){var i=t.call(this,e)||this;return i.sx=e.sx,i.sy=e.sy,i.x=null,i.y=null,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,model_id:e})},e.prototype._customize_event=function(t){var e=t.plot_canvas.frame.xscales.default,i=t.plot_canvas.frame.yscales.default;return this.x=e.invert(this.sx),this.y=i.invert(this.sy),this._options.x=this.x,this._options.y=this.y,this},e}(c);i.PointEvent=f;var v=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.delta_x=e.delta_x,i.delta_y=e.delta_y,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta_x:t.deltaX,delta_y:t.deltaY,direction:t.direction,model_id:e})},e=r.__decorate([n("pan")],e)}(f);i.Pan=v;var m=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.scale=e.scale,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,scale:t.scale,model_id:e})},e=r.__decorate([n("pinch")],e)}(f);i.Pinch=m;var g=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.delta=e.delta,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta:t.delta,model_id:e})},e=r.__decorate([n("wheel")],e)}(f);i.MouseWheel=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("mousemove")],e)}(f);i.MouseMove=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("mouseenter")],e)}(f);i.MouseEnter=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("mouseleave")],e)}(f);i.MouseLeave=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("tap")],e)}(f);i.Tap=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("doubletap")],e)}(f);i.DoubleTap=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("press")],e)}(f);i.Press=S;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("panstart")],e)}(f);i.PanStart=C;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("panend")],e)}(f);i.PanEnd=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("pinchstart")],e)}(f);i.PinchStart=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n("pinchend")],e)}(f);i.PinchEnd=E},function(t,e,i){var n=t(21),r=t(32);i.build_views=function(t,e,i,o){void 0===o&&(o=function(t){return t.default_view});for(var s=0,a=n.difference(Object.keys(t),e.map(function(t){return t.id}));s<a.length;s++){var l=a[s];t[l].remove(),delete t[l]}for(var h=[],c=0,u=e.filter(function(e){return null==t[e.id]});c<u.length;c++){var _=u[c],p=o(_),d=r.extend({},i,{model:_,connect_signals:!1}),f=new p(d);t[_.id]=f,h.push(f)}for(var v=0,m=h;v<m.length;v++){var f=m[v];f.connect_signals()}return h},i.remove_views=function(t){for(var e in t)t[e].remove(),delete t[e]}},function(t,e,i){function n(t,e){var i=Element.prototype,n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;return n.call(t,e)}var r=t(44),o=function(t){return function(e){function i(t){if(t instanceof HTMLElement)s.appendChild(t);else if(r.isString(t))s.appendChild(document.createTextNode(t));else if(null!=t&&!1!==t)throw new Error("expected an HTMLElement, string, false or null, got "+JSON.stringify(t))}void 0===e&&(e={});for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var s=document.createElement(t);for(var a in e){var l=e[a];if(null!=l&&(!r.isBoolean(l)||l))if("class"===a&&r.isArray(l))for(var h=0,c=l;h<c.length;h++){var u=c[h];null!=u&&s.classList.add(u)}else if("style"===a&&r.isObject(l))for(var _ in l)s.style[_]=l[_];else if("data"===a&&r.isObject(l))for(var p in l)s.dataset[p]=l[p];else s.setAttribute(a,l)}for(var d=0,f=n;d<f.length;d++){var v=f[d];if(r.isArray(v))for(var m=0,g=v;m<g.length;m++){var y=g[m];i(y)}else i(v)}return s}};i.createElement=function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return o(t).apply(void 0,[e].concat(i))},i.div=o("div"),i.span=o("span"),i.link=o("link"),i.style=o("style"),i.a=o("a"),i.p=o("p"),i.i=o("i"),i.pre=o("pre"),i.button=o("button"),i.label=o("label"),i.input=o("input"),i.select=o("select"),i.option=o("option"),i.optgroup=o("optgroup"),i.textarea=o("textarea"),i.canvas=o("canvas"),i.ul=o("ul"),i.ol=o("ol"),i.li=o("li"),i.nbsp=document.createTextNode("Â "),i.removeElement=function(t){var e=t.parentNode;null!=e&&e.removeChild(t)},i.replaceWith=function(t,e){var i=t.parentNode;null!=i&&i.replaceChild(e,t)},i.prepend=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.firstChild,r=0,o=e;r<o.length;r++){var s=o[r];t.insertBefore(s,n)}},i.empty=function(t){var e;for(;e=t.firstChild;)t.removeChild(e)},i.show=function(t){t.style.display=""},i.hide=function(t){t.style.display="none"},i.position=function(t){return{top:t.offsetTop,left:t.offsetLeft}},i.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},i.matches=n,i.parent=function(t,e){var i=t;for(;i=i.parentElement;)if(n(i,e))return i;return null},i.margin=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.marginTop)||0,bottom:parseFloat(e.marginBottom)||0,left:parseFloat(e.marginLeft)||0,right:parseFloat(e.marginRight)||0}},i.padding=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0}};!function(t){t[t.Backspace=8]="Backspace",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Esc=27]="Esc",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Delete=46]="Delete"}(i.Keys||(i.Keys={}))},function(t,e,i){var n=t(379),r=t(48),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._has_finished=!1,this.el=this._createElement()},e.prototype.remove=function(){o.removeElement(this.el),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return[]},Object.defineProperty(e.prototype,"cursor",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.layout=function(){},e.prototype.render=function(){},e.prototype.renderTo=function(t,e){void 0===e&&(e=!1),e?o.replaceWith(t,this.el):t.appendChild(this.el),this.layout()},e.prototype.has_finished=function(){return this._has_finished},Object.defineProperty(e.prototype,"_root_element",{get:function(){return o.parent(this.el,".bk-root")||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"solver",{get:function(){return this.is_root?this._solver:this.parent.solver},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_idle",{get:function(){return this.has_finished()},enumerable:!0,configurable:!0}),e.prototype._createElement=function(){return o.createElement(this.tagName,{id:this.id,class:this.css_classes()})},e}(r.View);i.DOMView=s,s.prototype.tagName="div"},function(t,e,i){i.AngleUnits=["deg","rad"],i.Dimension=["width","height"],i.Dimensions=["width","height","both"],i.Direction=["clock","anticlock"],i.FontStyle=["normal","italic","bold"],i.LatLon=["lat","lon"],i.LineCap=["butt","round","square"],i.LineJoin=["miter","round","bevel"],i.Location=["above","below","left","right"],i.LegendClickPolicy=["none","hide","mute"],i.LegendLocation=["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"],i.Anchor=i.LegendLocation,i.Orientation=["vertical","horizontal"],i.OutputBackend=["canvas","svg","webgl"],i.RenderLevel=["image","underlay","glyph","annotation","overlay"],i.RenderMode=["canvas","css"],i.Side=["above","below","left","right"],i.Place=["above","below","left","right","center"],i.SpatialUnits=["screen","data"],i.StartEnd=["start","end"],i.VerticalAlign=["top","middle","bottom"],i.TextAlign=["left","right","center"],i.TextBaseline=["top","middle","bottom","alphabetic","hanging","ideographic"],i.TooltipAttachment=["horizontal","vertical","left","right","above","below"],i.Distribution=["uniform","normal"],i.StepMode=["after","before","center"],i.SizingMode=["stretch_both","scale_width","scale_height","scale_both","fixed"],i.PaddingUnits=["percent","absolute"],i.SliderCallbackPolicy=["continuous","throttle","mouseup"],i.RoundingFunction=["round","nearest","floor","rounddown","ceil","roundup"],i.UpdateMode=["replace","append"],i.HTTPMethod=["POST","GET"],i.Logo=["normal","grey"]},function(t,e,i){var n=t(379),r=t(19),o=t(16),s=t(34),a=t(15),l=t(38),h=t(21),c=t(32),u=t(44),_=t(30),p=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;i._subtype=void 0,i.document=null,i.destroyed=new r.Signal0(i,"destroyed"),i.change=new r.Signal0(i,"change"),i.transformchange=new r.Signal0(i,"transformchange"),i.attributes={},i.properties={},i._set_after_defaults={},i._pending=!1,i._changing=!1;for(var n in i.props){var o=i.props[n],s=o.type,a=o.default_value;if(null==s)throw new Error("undefined property type for "+i.type+"."+n);i.properties[n]=new s(i,n,a)}null==e.id&&i.setv({id:l.uniqueId()},{silent:!0});var h=e.__deferred__||!1;return h&&delete(e=c.clone(e)).__deferred__,i.setv(e,{silent:!0}),h||i.finalize(),i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="HasProps",this.prototype.props={},this.prototype.mixins=[],this.define({id:[a.Any]})},e._fix_default=function(t,e){return void 0===t?void 0:u.isFunction(t)?t:u.isObject(t)?u.isArray(t)?function(){return h.copy(t)}:function(){return c.clone(t)}:function(){return t}},e.define=function(t){var e=function(e){var n=t[e];if(null!=i.prototype.props[e])throw new Error("attempted to redefine property '"+i.prototype.type+"."+e+"'");if(null!=i.prototype[e])throw new Error("attempted to redefine attribute '"+i.prototype.type+"."+e+"'");Object.defineProperty(i.prototype,e,{get:function(){var t=this.getv(e);return t},set:function(t){return this.setv((i={},i[e]=t,i)),this;var i},configurable:!1,enumerable:!0});var r=n[0],o=n[1],s=n[2],a={type:r,default_value:i._fix_default(o,e),internal:s||!1},l=c.clone(i.prototype.props);l[e]=a,i.prototype.props=l},i=this;for(var n in t)e(n)},e.internal=function(t){var e={};for(var i in t){var n=t[i],r=n[0],o=n[1];e[i]=[r,o,!0]}this.define(e)},e.mixin=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.define(o.create(t));var i=this.prototype.mixins.concat(t);this.prototype.mixins=i},e.mixins=function(t){this.mixin.apply(this,t)},e.override=function(t){for(var e in t){var i=this._fix_default(t[e],e),n=this.prototype.props[e];if(null==n)throw new Error("attempted to override nonexistent '"+this.prototype.type+"."+e+"'");var r=c.clone(this.prototype.props);r[e]=c.extend({},n,{default_value:i}),this.prototype.props=r}},e.prototype.toString=function(){return this.type+"("+this.id+")"},e.prototype.finalize=function(){var t=this;for(var e in this.properties){var i=this.properties[e];i.update(),null!=i.spec.transform&&this.connect(i.spec.transform.change,function(){return t.transformchange.emit()})}this.initialize(),this.connect_signals()},e.prototype.initialize=function(){},e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.destroy=function(){this.disconnect_signals(),this.destroyed.emit()},e.prototype.clone=function(){return new this.constructor(this.attributes)},e.prototype._setv=function(t,e){var i=e.check_eq,n=e.silent,r=[],o=this._changing;this._changing=!0;var s=this.attributes;for(var a in t){var l=t[a];!1!==i?_.isEqual(s[a],l)||r.push(a):r.push(a),s[a]=l}if(!n){r.length>0&&(this._pending=!0);for(var h=0;h<r.length;h++)this.properties[r[h]].change.emit()}if(!o){if(!n&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}},e.prototype.setv=function(t,e){void 0===e&&(e={});for(var i in t)if(t.hasOwnProperty(i)){var n=i;if(null==this.props[n])throw new Error("property "+this.type+"."+n+" wasn't declared");null!=e&&e.defaults||(this._set_after_defaults[i]=!0)}if(!c.isEmpty(t)){var r={};for(var i in t)r[i]=this.getv(i);this._setv(t,e);var o=e.silent;if(null==o||!o)for(var i in t)this._tell_document_about_change(i,r[i],this.getv(i),e)}},e.prototype.getv=function(t){if(null==this.props[t])throw new Error("property "+this.type+"."+t+" wasn't declared");return this.attributes[t]},e.prototype.ref=function(){return s.create_ref(this)},e.prototype.set_subtype=function(t){this._subtype=t},e.prototype.attribute_is_serializable=function(t){var e=this.props[t];if(null==e)throw new Error(this.type+".attribute_is_serializable('"+t+"'): "+t+" wasn't declared");return!e.internal},e.prototype.serializable_attributes=function(){var t={};for(var e in this.attributes){var i=this.attributes[e];this.attribute_is_serializable(e)&&(t[e]=i)}return t},e._value_to_json=function(t,i,n){if(i instanceof e)return i.ref();if(u.isArray(i)){for(var r=[],o=0;o<i.length;o++){var s=i[o];r.push(e._value_to_json(o.toString(),s,i))}return r}if(u.isObject(i)){var a={};for(var l in i)i.hasOwnProperty(l)&&(a[l]=e._value_to_json(l,i[l],i));return a}return i},e.prototype.attributes_as_json=function(t,i){void 0===t&&(t=!0),void 0===i&&(i=e._value_to_json);var n=this.serializable_attributes(),r={};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o];t?r[o]=s:o in this._set_after_defaults&&(r[o]=s)}return i("attributes",r,this)},e._json_record_references=function(t,i,n,r){if(null==i);else if(s.is_ref(i)){if(!(i.id in n)){var o=t.get_model_by_id(i.id);e._value_record_references(o,n,r)}}else if(u.isArray(i))for(var a=0,l=i;a<l.length;a++){var h=l[a];e._json_record_references(t,h,n,r)}else if(u.isObject(i))for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];e._json_record_references(t,h,n,r)}},e._value_record_references=function(t,i,n){if(null==t);else if(t instanceof e){if(!(t.id in i)&&(i[t.id]=t,n))for(var r=t._immediate_references(),o=0,s=r;o<s.length;o++){var a=s[o];e._value_record_references(a,i,!0)}}else if(t.buffer instanceof ArrayBuffer);else if(u.isArray(t))for(var l=0,h=t;l<h.length;l++){var c=h[l];e._value_record_references(c,i,n)}else if(u.isObject(t))for(var _ in t)if(t.hasOwnProperty(_)){var c=t[_];e._value_record_references(c,i,n)}},e.prototype._immediate_references=function(){var t={},i=this.serializable_attributes();for(var n in i){var r=i[n];e._value_record_references(r,t,!1)}return c.values(t)},e.prototype.references=function(){var t={};return e._value_record_references(this,t,!0),c.values(t)},e.prototype._doc_attached=function(){},e.prototype.attach_document=function(t){if(null!=this.document&&this.document!=t)throw new Error("models must be owned by only a single document");this.document=t,this._doc_attached()},e.prototype.detach_document=function(){this.document=null},e.prototype._tell_document_about_change=function(t,i,n,r){if(this.attribute_is_serializable(t)&&null!=this.document){var o={};e._value_record_references(n,o,!1);var s={};e._value_record_references(i,s,!1);var a=!1;for(var l in o)if(!(l in s)){a=!0;break}if(!a)for(var h in s)if(!(h in o)){a=!0;break}a&&this.document._invalidate_all_models(),this.document._notify_change(this,t,i,n,r)}},e.prototype.materialize_dataspecs=function(t){var e={};for(var i in this.properties){var n=this.properties[i];n.dataspec&&((!n.optional||null!=n.spec.value||i in this._set_after_defaults)&&(e["_"+i]=n.array(t),null!=n.spec.field&&n.spec.field in t._shapes&&(e["_"+i+"_shape"]=t._shapes[n.spec.field]),n instanceof a.Distance&&(e["max_"+i]=h.max(e["_"+i]))))}return e},e}(r.Signalable());i.HasProps=p,p.initClass()},function(t,e,i){function n(t){return t*t}function r(t,e){return n(t.x-e.x)+n(t.y-e.y)}function o(t,e,i){var n=r(e,i);if(0==n)return r(t,e);var o=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;if(o<0)return r(t,e);if(o>1)return r(t,i);var s={x:e.x+o*(i.x-e.x),y:e.y+o*(i.y-e.y)};return r(t,s)}var s=t(21),a=t(181);i.point_in_poly=function(t,e,i,n){for(var r=!1,o=i[i.length-1],s=n[n.length-1],a=0;a<i.length;a++){var l=i[a],h=n[a];s<e!=h<e&&o+(e-s)/(h-s)*(l-o)<t&&(r=!r),o=l,s=h}return r},i.create_empty_hit_test_result=function(){return new a.Selection},i.create_hit_test_result_from_hits=function(t){var e=new a.Selection;return e.indices=s.sortBy(t,function(t){return t[0],t[1]}).map(function(t){var e=t[0];return t[1],e}),e},i.validate_bbox_coords=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1];i>n&&(s=[n,i],i=s[0],n=s[1]);r>o&&(a=[o,r],r=a[0],o=a[1]);return{minX:i,minY:r,maxX:n,maxY:o};var s,a},i.dist_2_pts=r,i.dist_to_segment_squared=o,i.dist_to_segment=function(t,e,i){return Math.sqrt(o(t,e,i))},i.check_2_segments_intersect=function(t,e,i,n,r,o,s,a){var l=(a-o)*(i-t)-(s-r)*(n-e);if(0==l)return{hit:!1,x:null,y:null};var h=e-o,c=t-r,u=(s-r)*h-(a-o)*c,_=(i-t)*h-(n-e)*c;c=_/l;var p=t+(h=u/l)*(i-t),d=e+h*(n-e);return{hit:h>0&&h<1&&c>0&&c<1,x:p,y:d}}},function(t,e,i){var n=t(13),r=t(21);i.vstack=function(t,e){var i=[];if(e.length>0){i.push(n.EQ(r.head(e)._bottom,[-1,t._bottom])),i.push(n.EQ(r.tail(e)._top,[-1,t._top])),i.push.apply(i,r.pairwise(e,function(t,e){return n.EQ(t._top,[-1,e._bottom])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];i.push(n.EQ(a._left,[-1,t._left])),i.push(n.EQ(a._right,[-1,t._right]))}}return i},i.hstack=function(t,e){var i=[];if(e.length>0){i.push(n.EQ(r.head(e)._right,[-1,t._right])),i.push(n.EQ(r.tail(e)._left,[-1,t._left])),i.push.apply(i,r.pairwise(e,function(t,e){return n.EQ(t._left,[-1,e._right])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];i.push(n.EQ(a._top,[-1,t._top])),i.push(n.EQ(a._bottom,[-1,t._bottom]))}}return i}},function(t,e,i){var n=t(379),r=t(13),o=t(8),s=t(24),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LayoutCanvas"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._top=new r.Variable(this.toString()+".top"),this._left=new r.Variable(this.toString()+".left"),this._width=new r.Variable(this.toString()+".width"),this._height=new r.Variable(this.toString()+".height"),this._right=new r.Variable(this.toString()+".right"),this._bottom=new r.Variable(this.toString()+".bottom"),this._hcenter=new r.Variable(this.toString()+".hcenter"),this._vcenter=new r.Variable(this.toString()+".vcenter")},e.prototype.get_editables=function(){return[]},e.prototype.get_constraints=function(){return[r.GE(this._top),r.GE(this._bottom),r.GE(this._left),r.GE(this._right),r.GE(this._width),r.GE(this._height),r.EQ(this._left,this._width,[-1,this._right]),r.EQ(this._top,this._height,[-1,this._bottom]),r.EQ([2,this._hcenter],[-1,this._left],[-1,this._right]),r.EQ([2,this._vcenter],[-1,this._top],[-1,this._bottom])]},e.prototype.get_layoutable_children=function(){return[]},Object.defineProperty(e.prototype,"bbox",{get:function(){return new s.BBox({x0:this._left.value,y0:this._top.value,x1:this._right.value,y1:this._bottom.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout_bbox",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,hcenter:this._hcenter.value,vcenter:this._vcenter.value}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xview",{get:function(){var t=this;return{compute:function(e){return t._left.value+e},v_compute:function(e){for(var i=new Float64Array(e.length),n=t._left.value,r=0;r<e.length;r++)i[r]=n+e[r];return i}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yview",{get:function(){var t=this;return{compute:function(e){return t._bottom.value-e},v_compute:function(e){for(var i=new Float64Array(e.length),n=t._bottom.value,r=0;r<e.length;r++)i[r]=n-e[r];return i}}},enumerable:!0,configurable:!0}),e}(o.HasProps);i.LayoutCanvas=a,a.initClass()},function(t,e,i){function n(t){return"panel"in t}var r=t(379),o=t(13),s=t(11),a=t(15),l=t(14),h=t(44),c=Math.PI/2,u="alphabetic",_="center",p={above:{parallel:0,normal:-c,horizontal:0,vertical:-c},below:{parallel:0,normal:c,horizontal:0,vertical:c},left:{parallel:-c,normal:0,horizontal:0,vertical:-c},right:{parallel:c,normal:0,horizontal:0,vertical:c}},d={above:{justified:"top",parallel:u,normal:"middle",horizontal:u,vertical:"middle"},below:{justified:"bottom",parallel:"hanging",normal:"middle",horizontal:"hanging",vertical:"middle"},left:{justified:"top",parallel:u,normal:"middle",horizontal:"middle",vertical:u},right:{justified:"top",parallel:u,normal:"middle",horizontal:"middle",vertical:u}},f={above:{justified:_,parallel:_,normal:"left",horizontal:_,vertical:"left"},below:{justified:_,parallel:_,normal:"left",horizontal:_,vertical:"left"},left:{justified:_,parallel:_,normal:"right",horizontal:"right",vertical:_},right:{justified:_,parallel:_,normal:"left",horizontal:"left",vertical:_}},v={above:"right",below:"left",left:"right",right:"left"},m={above:"left",below:"right",left:"right",right:"left"};i.isSizeable=n,i.isSizeableView=function(t){return n(t.model)&&"get_size"in t},i._view_sizes=new WeakMap,i._view_constraints=new WeakMap,i.update_panel_constraints=function(t){var e=t.solver,n=t.get_size(),r=i._view_constraints.get(t);if(null!=r&&e.has_constraint(r)){if(i._view_sizes.get(t)===n)return;e.remove_constraint(r)}r=o.GE(t.model.panel._size,-n),e.add_constraint(r),i._view_sizes.set(t,n),i._view_constraints.set(t,r)};var g=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type="SidePanel",this.internal({side:[a.String]})},e.prototype.toString=function(){return this.type+"("+this.id+", "+this.side+")"},e.prototype.initialize=function(){switch(t.prototype.initialize.call(this),this.side){case"above":this._dim=0,this._normals=[0,-1],this._size=this._height;break;case"below":this._dim=0,this._normals=[0,1],this._size=this._height;break;case"left":this._dim=1,this._normals=[-1,0],this._size=this._width;break;case"right":this._dim=1,this._normals=[1,0],this._size=this._width;break;default:l.logger.error("unrecognized side: '"+this.side+"'")}},Object.defineProperty(e.prototype,"dimension",{get:function(){return this._dim},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normals",{get:function(){return this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_horizontal",{get:function(){return"above"==this.side||"below"==this.side},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_vertical",{get:function(){return"left"==this.side||"right"==this.side},enumerable:!0,configurable:!0}),e.prototype.apply_label_text_heuristics=function(t,e){var i,n,r=this.side;h.isString(e)?(i=d[r][e],n=f[r][e]):0===e?(i="whatever",n="whatever"):e<0?(i="middle",n=v[r]):(i="middle",n=m[r]),t.textBaseline=i,t.textAlign=n},e.prototype.get_label_angle_heuristic=function(t){return p[this.side][t]},e}(s.LayoutCanvas);i.SidePanel=g,g.initClass()},function(t,e,i){function n(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t)}}function r(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t,o.Strength.weak)}}var o=t(336);i.Variable=o.Variable,i.Expression=o.Expression,i.Constraint=o.Constraint,i.Operator=o.Operator,i.Strength=o.Strength,i.EQ=n(o.Operator.Eq),i.LE=n(o.Operator.Le),i.GE=n(o.Operator.Ge),i.WEAK_EQ=r(o.Operator.Eq),i.WEAK_LE=r(o.Operator.Le),i.WEAK_GE=r(o.Operator.Ge);var s=function(){function t(){this.solver=new o.Solver}return t.prototype.clear=function(){this.solver=new o.Solver},t.prototype.toString=function(){return"Solver(num_constraints="+this.num_constraints+", num_editables="+this.num_editables+")"},Object.defineProperty(t.prototype,"num_constraints",{get:function(){return this.solver.numConstraints},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"num_editables",{get:function(){return this.solver.numEditVariables},enumerable:!0,configurable:!0}),t.prototype.get_constraints=function(){return this.solver.getConstraints()},t.prototype.update_variables=function(){this.solver.updateVariables()},t.prototype.has_constraint=function(t){return this.solver.hasConstraint(t)},t.prototype.add_constraint=function(t){try{this.solver.addConstraint(t)}catch(e){throw new Error(e.message+": "+t.toString())}},t.prototype.remove_constraint=function(t){this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){this.solver.removeEditVariable(t)},t.prototype.suggest_value=function(t,e){this.solver.suggestValue(t,e)},t}();i.Solver=s},function(t,e,i){var n=t(44),r={},o=function(){return function(t,e){this.name=t,this.level=e}}();i.LogLevel=o;var s=function(){function t(e,i){void 0===i&&(i=t.INFO),this._name=e,this.set_level(i)}return Object.defineProperty(t,"levels",{get:function(){return Object.keys(t.log_levels)},enumerable:!0,configurable:!0}),t.get=function(e,i){if(void 0===i&&(i=t.INFO),e.length>0){var n=r[e];return null==n&&(r[e]=n=new t(e,i)),n}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")},Object.defineProperty(t.prototype,"level",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){if(e instanceof o)this._log_level=e;else{if(!n.isString(e)||null==t.log_levels[e])throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=t.log_levels[e]}var i="["+this._name+"]";for(var r in t.log_levels){var s=t.log_levels[r];s.level<this._log_level.level||this._log_level.level===t.OFF.level?this[r]=function(){}:this[r]=function(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}(r,i)}},t.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.TRACE=new o("trace",0),t.DEBUG=new o("debug",1),t.INFO=new o("info",2),t.WARN=new o("warn",6),t.ERROR=new o("error",7),t.FATAL=new o("fatal",8),t.OFF=new o("off",9),t.log_levels={trace:t.TRACE,debug:t.DEBUG,info:t.INFO,warn:t.WARN,error:t.ERROR,fatal:t.FATAL,off:t.OFF},t}();i.Logger=s,i.logger=s.get("bokeh"),i.set_log_level=function(t){null==s.log_levels[t]?(console.log("[bokeh] unrecognized logging level '"+t+"' passed to Bokeh.set_log_level(), ignoring"),console.log("[bokeh] valid log levels are: "+s.levels.join(", "))):(console.log("[bokeh] setting log level to: '"+t+"'"),i.logger.set_level(t))}},function(t,e,i){function n(t){try{return JSON.stringify(t)}catch(e){return t.toString()}}function r(t,e){return function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return a.__extends(r,i),r.prototype.validate=function(i){if(!e(i))throw new Error(t+" property '"+this.attr+"' given invalid value: "+n(i))},r}(f)}function o(t,e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(t,function(t){return _.includes(e,t)}))}function s(t,e,i){return function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return a.__extends(r,n),r.prototype.init=function(){null==this.spec.units&&(this.spec.units=i);var n=this.spec.units;if(!_.includes(e,n))throw new Error(t+" units must be one of "+e+", given invalid value: "+n)},Object.defineProperty(r.prototype,"units",{get:function(){return this.spec.units},set:function(t){this.spec.units=t},enumerable:!0,configurable:!0}),r}(x)}var a=t(379),l=t(19),h=t(7),c=t(39),u=t(27),_=t(21),p=t(22),d=t(44);l.Signal;var f=function(t){function e(e,i,n){var r=t.call(this)||this;return r.optional=!1,r.obj=e,r.attr=i,r.default_value=n,r.change=new l.Signal0(r.obj,"change"),r._init(),r.connect(r.change,function(){return r._init()}),r}return a.__extends(e,t),e.prototype.update=function(){this._init()},e.prototype.init=function(){},e.prototype.transform=function(t){return t},e.prototype.validate=function(t){},e.prototype.value=function(t){if(void 0===t&&(t=!0),void 0===this.spec.value)throw new Error("attempted to retrieve property value for property without value specification");var e=this.transform([this.spec.value])[0];return null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},e.prototype.array=function(t){if(!this.dataspec)throw new Error("attempted to retrieve property array for non-dataspec property");var e,i=t.data;if(null!=this.spec.field){if(!(this.spec.field in i))throw new Error("attempted to retrieve property array for nonexistent field '"+this.spec.field+"'");e=this.transform(t.get_column(this.spec.field))}else if(null!=this.spec.expr)e=this.transform(this.spec.expr._v_compute(t));else{var n=t.get_length();null==n&&(n=1);var r=this.value(!1);e=_.repeat(r,n)}return null!=this.spec.transform&&(e=this.spec.transform.v_compute(e)),e},e.prototype._init=function(){var t=this.obj,e=this.attr,i=t.getv(e);if(void 0===i){var n=this.default_value;i=void 0!==n?n(t):null,t.setv((r={},r[e]=i,r),{silent:!0,defaults:!0})}if(d.isArray(i)?this.spec={value:i}:d.isObject(i)&&(void 0===i.value?0:1)+(void 0===i.field?0:1)+(void 0===i.expr?0:1)==1?this.spec=i:this.spec={value:i},null!=this.spec.field&&!d.isString(this.spec.field))throw new Error("field value for property '"+e+"' is not a string");null!=this.spec.value&&this.validate(this.spec.value),this.init();var r},e.prototype.toString=function(){return"Prop("+this.obj+"."+this.attr+", spec: "+n(this.spec)+")"},e}(l.Signalable());i.Property=f,f.prototype.dataspec=!1,i.simple_prop=r;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Any",function(t){return!0}));i.Any=v;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Array",function(t){return d.isArray(t)||t instanceof Float64Array}));i.Array=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Bool",d.isBoolean));i.Bool=g,i.Boolean=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Color",function(t){return c.is_svg_color(t.toLowerCase())||"#"==t.substring(0,1)||u.valid_rgb(t)}));i.Color=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Instance",function(t){return null!=t.properties}));i.Instance=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Number",function(t){return d.isNumber(t)||d.isBoolean(t)}));i.Number=x,i.Int=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("Number",function(t){return(d.isNumber(t)||d.isBoolean(t))&&0<=t&&t<=1}));i.Percent=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r("String",d.isString));i.String=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.Font=S,i.enum_prop=o;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Anchor",h.LegendLocation));i.Anchor=C;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("AngleUnits",h.AngleUnits));i.AngleUnits=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)switch(t[i]){case"clock":e[i]=0;break;case"anticlock":e[i]=1}return e},e}(o("Direction",h.Direction));i.Direction=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Dimension",h.Dimension));i.Dimension=E;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Dimensions",h.Dimensions));i.Dimensions=M;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("FontStyle",h.FontStyle));i.FontStyle=O;var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LatLon",h.LatLon));i.LatLon=z;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LineCap",h.LineCap));i.LineCap=P;var j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LineJoin",h.LineJoin));i.LineJoin=j;var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("LegendLocation",h.LegendLocation));i.LegendLocation=N;var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Location",h.Location));i.Location=F;var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("OutputBackend",h.OutputBackend));i.OutputBackend=D;var I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Orientation",h.Orientation));i.Orientation=I;var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("VerticalAlign",h.VerticalAlign));i.VerticalAlign=B;var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("TextAlign",h.TextAlign));i.TextAlign=R;var L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("TextBaseline",h.TextBaseline));i.TextBaseline=L;var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("RenderLevel",h.RenderLevel));i.RenderLevel=V;var G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("RenderMode",h.RenderMode));i.RenderMode=G;var U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("SizingMode",h.SizingMode));i.SizingMode=U;var Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("SpatialUnits",h.SpatialUnits));i.SpatialUnits=Y;var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("Distribution",h.Distribution));i.Distribution=q;var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("StepMode",h.StepMode));i.StepMode=X;var W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("PaddingUnits",h.PaddingUnits));i.PaddingUnits=W;var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o("StartEnd",h.StartEnd));i.StartEnd=H,i.units_prop=s;var J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(e){return"deg"==this.spec.units&&(e=p.map(e,function(t){return t*Math.PI/180})),e=p.map(e,function(t){return-t}),t.prototype.transform.call(this,e)},e}(s("Angle",h.AngleUnits,"rad"));i.Angle=J;var Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(s("Distance",h.SpatialUnits,"data"));i.Distance=Q;var $=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(J);i.AngleSpec=$,$.prototype.dataspec=!0;var K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(y);i.ColorSpec=K,K.prototype.dataspec=!0;var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(Q);i.DistanceSpec=Z,Z.prototype.dataspec=!0;var tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.FontSizeSpec=tt,tt.prototype.dataspec=!0;var et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(x);i.NumberSpec=et,et.prototype.dataspec=!0;var it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.StringSpec=it,it.prototype.dataspec=!0},function(t,e,i){function n(t,e){var i={};for(var n in t){var r=t[n];i[e+n]=r}return i}var r=t(15),o=t(32),s={line_color:[r.ColorSpec,"black"],line_width:[r.NumberSpec,1],line_alpha:[r.NumberSpec,1],line_join:[r.LineJoin,"miter"],line_cap:[r.LineCap,"butt"],line_dash:[r.Array,[]],line_dash_offset:[r.Number,0]};i.line=function(t){return void 0===t&&(t=""),n(s,t)};var a={fill_color:[r.ColorSpec,"gray"],fill_alpha:[r.NumberSpec,1]};i.fill=function(t){return void 0===t&&(t=""),n(a,t)};var l={text_font:[r.Font,"helvetica"],text_font_size:[r.FontSizeSpec,"12pt"],text_font_style:[r.FontStyle,"normal"],text_color:[r.ColorSpec,"#444444"],text_alpha:[r.NumberSpec,1],text_align:[r.TextAlign,"left"],text_baseline:[r.TextBaseline,"bottom"],text_line_height:[r.Number,1.2]};i.text=function(t){return void 0===t&&(t=""),n(l,t)},i.create=function(t){for(var e={},n=0,r=t;n<r.length;n++){var s=r[n],a=s.split(":"),l=a[0],h=a[1],c=void 0;switch(l){case"line":c=i.line;break;case"fill":c=i.fill;break;case"text":c=i.text;break;default:throw new Error("Unknown property mixin kind '"+l+"'")}o.extend(e,c(h))}return e}},function(t,e,i){var n=t(379),r=t(8),o=t(181),s=t(170),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="SelectionManager",this.internal({source:[a.Any]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.inspectors={}},e.prototype.select=function(t,e,i,n){void 0===n&&(n=!1);for(var r=[],o=[],a=0,l=t;a<l.length;a++){var h=l[a];"GlyphRenderer"==h.model.type?r.push(h):h.model instanceof s.GraphRenderer&&o.push(h)}for(var c=!1,u=0,_=o;u<_.length;u++){var h=_[u],p=h.model.selection_policy.hit_test(e,h);c=c||h.model.selection_policy.do_selection(p,h.model,i,n)}if(r.length>0){var p=this.source.selection_policy.hit_test(e,t);c=c||this.source.selection_policy.do_selection(p,this.source,i,n)}return c},e.prototype.inspect=function(t,e){var i=!1;if("GlyphRenderer"==t.model.type){var n=t.hit_test(e);i=!n.is_empty();var r=this.get_or_create_inspector(t.model);r.update(n,!0,!1),this.source.setv({inspected:r},{silent:!0}),this.source.inspect.emit([t,{geometry:e}])}else if(t.model instanceof s.GraphRenderer){var n=t.model.inspection_policy.hit_test(e,t);i=i||t.model.inspection_policy.do_inspection(n,e,t,!1,!1)}return i},e.prototype.clear=function(t){this.source.selected.clear(),null!=t&&this.get_or_create_inspector(t.model).clear()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new o.Selection),this.inspectors[t.id]},e}(r.HasProps);i.SelectionManager=l,l.initClass()},function(t,e,i){var n=function(){function t(){this._dev=!1}return Object.defineProperty(t.prototype,"dev",{get:function(){return this._dev},set:function(t){this._dev=t},enumerable:!0,configurable:!0}),t}();i.Settings=n,i.settings=new n},function(t,e,i){function n(t,e,i,n){return l.find(t,function(t){return t.signal===e&&t.slot===i&&t.context===n})}function r(t){0===p.size&&a.defer(o),p.add(t)}function o(){p.forEach(function(t){l.removeBy(t,function(t){return null==t.signal})}),p.clear()}var s=t(379),a=t(25),l=t(21),h=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),u.has(this.sender)||u.set(this.sender,[]);var i=u.get(this.sender);if(null!=n(i,this,t,e))return!1;var r=e||t;_.has(r)||_.set(r,[]);var o=_.get(r),s={signal:this,slot:t,context:e};return i.push(s),o.push(s),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var i=u.get(this.sender);if(null==i||0===i.length)return!1;var o=n(i,this,t,e);if(null==o)return!1;var s=e||t,a=_.get(s);return o.signal=null,r(i),r(a),!0},t.prototype.emit=function(t){for(var e=u.get(this.sender)||[],i=0,n=e;i<n.length;i++){var r=n[i],o=r.signal,s=r.slot,a=r.context;o===this&&s.call(a,t,this.sender)}},t}();i.Signal=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.emit=function(){t.prototype.emit.call(this,void 0)},e}(h);i.Signal0=c,function(t){t.disconnectBetween=function(t,e){var i=u.get(t);if(null==i||0===i.length)return;var n=_.get(e);if(null==n||0===n.length)return;for(var o=0,s=n;o<s.length;o++){var a=s[o];if(null==a.signal)return;a.signal.sender===t&&(a.signal=null)}r(i),r(n)},t.disconnectSender=function(t){var e=u.get(t);if(null==e||0===e.length)return;for(var i=0,n=e;i<n.length;i++){var o=n[i];if(null==o.signal)return;var s=o.context||o.slot;o.signal=null,r(_.get(s))}r(e)},t.disconnectReceiver=function(t){var e=_.get(t);if(null==e||0===e.length)return;for(var i=0,n=e;i<n.length;i++){var o=n[i];if(null==o.signal)return;var s=o.signal.sender;o.signal=null,r(u.get(s))}r(e)},t.disconnectAll=function(t){var e=u.get(t);if(null!=e&&0!==e.length){for(var i=0,n=e;i<n.length;i++){var o=n[i];o.signal=null}r(e)}var s=_.get(t);if(null!=s&&0!==s.length){for(var a=0,l=s;a<l.length;a++){var o=l[a];o.signal=null}r(s)}}}(h=i.Signal||(i.Signal={})),i.Signal=h,i.Signalable=function(t){return null!=t?function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.connect=function(t,e){return t.connect(e,this)},e}(t):function(){function t(){}return t.prototype.connect=function(t,e){return t.connect(e,this)},t}()};!function(t){t.connect=function(t,e){return t.connect(e,this)}}(i._Signalable||(i._Signalable={}));var u=new WeakMap,_=new WeakMap,p=new Set},function(t,e,i){var n=t(379),r=t(333),o=t(19),s=t(14),a=t(5),l=t(45),h=t(21),c=t(32),u=t(44),_=t(3);i.is_mobile="ontouchstart"in window||navigator.maxTouchPoints>0;var p=function(){function t(t,e,i,n){this.plot_view=t,this.toolbar=e,this.hit_area=i,this.plot=n,this.pan_start=new o.Signal(this,"pan:start"),this.pan=new o.Signal(this,"pan"),this.pan_end=new o.Signal(this,"pan:end"),this.pinch_start=new o.Signal(this,"pinch:start"),this.pinch=new o.Signal(this,"pinch"),this.pinch_end=new o.Signal(this,"pinch:end"),this.rotate_start=new o.Signal(this,"rotate:start"),this.rotate=new o.Signal(this,"rotate"),this.rotate_end=new o.Signal(this,"rotate:end"),this.tap=new o.Signal(this,"tap"),this.doubletap=new o.Signal(this,"doubletap"),this.press=new o.Signal(this,"press"),this.move_enter=new o.Signal(this,"move:enter"),this.move=new o.Signal(this,"move"),this.move_exit=new o.Signal(this,"move:exit"),this.scroll=new o.Signal(this,"scroll"),this.keydown=new o.Signal(this,"keydown"),this.keyup=new o.Signal(this,"keyup"),this.hammer=new r(this.hit_area),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){var t=this;this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",function(e){return t._doubletap(e)}),this.hammer.on("tap",function(e){return t._tap(e)}),this.hammer.on("press",function(e){return t._press(e)}),this.hammer.get("pan").set({direction:r.DIRECTION_ALL}),this.hammer.on("panstart",function(e){return t._pan_start(e)}),this.hammer.on("pan",function(e){return t._pan(e)}),this.hammer.on("panend",function(e){return t._pan_end(e)}),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",function(e){return t._pinch_start(e)}),this.hammer.on("pinch",function(e){return t._pinch(e)}),this.hammer.on("pinchend",function(e){return t._pinch_end(e)}),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",function(e){return t._rotate_start(e)}),this.hammer.on("rotate",function(e){return t._rotate(e)}),this.hammer.on("rotateend",function(e){return t._rotate_end(e)}),this.hit_area.addEventListener("mousemove",function(e){return t._mouse_move(e)}),this.hit_area.addEventListener("mouseenter",function(e){return t._mouse_enter(e)}),this.hit_area.addEventListener("mouseleave",function(e){return t._mouse_exit(e)}),this.hit_area.addEventListener("wheel",function(e){return t._mouse_wheel(e)}),document.addEventListener("keydown",function(e){return t._key_down(e)}),document.addEventListener("keyup",function(e){return t._key_up(e)})},t.prototype.register_tool=function(t){var e=this,i=t.model.event_type;null!=i&&(u.isString(i)?this._register_tool(t,i):i.forEach(function(i,n){return e._register_tool(t,i,n<1)}))},t.prototype._register_tool=function(t,e,n){void 0===n&&(n=!0);var r=t,o=r.model.id,a=function(t){return function(e){e.id==o&&t(e.e)}},l=function(t){return function(e){t(e.e)}};switch(e){case"pan":null!=r._pan_start&&r.connect(this.pan_start,a(r._pan_start.bind(r))),null!=r._pan&&r.connect(this.pan,a(r._pan.bind(r))),null!=r._pan_end&&r.connect(this.pan_end,a(r._pan_end.bind(r)));break;case"pinch":null!=r._pinch_start&&r.connect(this.pinch_start,a(r._pinch_start.bind(r))),null!=r._pinch&&r.connect(this.pinch,a(r._pinch.bind(r))),null!=r._pinch_end&&r.connect(this.pinch_end,a(r._pinch_end.bind(r)));break;case"rotate":null!=r._rotate_start&&r.connect(this.rotate_start,a(r._rotate_start.bind(r))),null!=r._rotate&&r.connect(this.rotate,a(r._rotate.bind(r))),null!=r._rotate_end&&r.connect(this.rotate_end,a(r._rotate_end.bind(r)));break;case"move":null!=r._move_enter&&r.connect(this.move_enter,a(r._move_enter.bind(r))),null!=r._move&&r.connect(this.move,a(r._move.bind(r))),null!=r._move_exit&&r.connect(this.move_exit,a(r._move_exit.bind(r)));break;case"tap":null!=r._tap&&r.connect(this.tap,a(r._tap.bind(r)));break;case"press":null!=r._press&&r.connect(this.press,a(r._press.bind(r)));break;case"scroll":null!=r._scroll&&r.connect(this.scroll,a(r._scroll.bind(r)));break;default:throw new Error("unsupported event_type: "+e)}n&&(null!=r._doubletap&&r.connect(this.doubletap,l(r._doubletap.bind(r))),null!=r._keydown&&r.connect(this.keydown,l(r._keydown.bind(r))),null!=r._keyup&&r.connect(this.keyup,l(r._keyup.bind(r))),i.is_mobile&&null!=r._scroll&&"pinch"==e&&(s.logger.debug("Registering scroll on touch screen"),r.connect(this.scroll,a(r._scroll.bind(r)))))},t.prototype._hit_test_renderers=function(t,e){for(var i=this.plot_view.get_renderer_views(),n=0,r=h.reversed(i);n<r.length;n++){var o=r[n],s=o.model.level;if(("annotation"==s||"overlay"==s)&&null!=o.bbox&&o.bbox().contains(t,e))return o}return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(t,e,n){var r=this;this._trigger_bokeh_event(e);var o=this.toolbar.gestures,s=t.name,a=s.split(":")[0],l=this._hit_test_renderers(e.sx,e.sy);switch(a){case"move":var h=o[a].active;null!=h&&this.trigger(t,e,h.id);var u=this.toolbar.inspectors.filter(function(t){return t.active}),_="default";null!=l?(_=l.cursor||_,c.isEmpty(u)||(t=this.move_exit,s=t.name)):this._hit_test_frame(e.sx,e.sy)&&(c.isEmpty(u)||(_="crosshair")),this.plot_view.set_cursor(_),u.map(function(i){return r.trigger(t,e,i.id)});break;case"tap":null!=l&&null!=l.on_hit&&l.on_hit(e.sx,e.sy);var h=o[a].active;null!=h&&this.trigger(t,e,h.id);break;case"scroll":var p=i.is_mobile?"pinch":"scroll",h=o[p].active;null!=h&&(n.preventDefault(),n.stopPropagation(),this.trigger(t,e,h.id));break;default:var h=o[a].active;null!=h&&this.trigger(t,e,h.id)}},t.prototype.trigger=function(t,e,i){void 0===i&&(i=null),t.emit({id:i,e:e})},t.prototype._trigger_bokeh_event=function(t){var e=_.BokehEvent.event_class(t);null!=e?this.plot.trigger_event(e.from_event(t)):s.logger.debug("Unhandled event of type "+t.type)},t.prototype._get_sxy=function(t){var e=function(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}(t)?t.touches[0]:t,i=e.pageX,n=e.pageY,r=a.offset(this.hit_area),o=r.left,s=r.top;return{sx:i-o,sy:n-s}},t.prototype._gesture_event=function(t){return n.__assign({type:t.type},this._get_sxy(t.srcEvent),{deltaX:t.deltaX,deltaY:t.deltaY,scale:t.scale,shiftKey:t.srcEvent.shiftKey})},t.prototype._tap_event=function(t){return n.__assign({type:t.type},this._get_sxy(t.srcEvent),{shiftKey:t.srcEvent.shiftKey})},t.prototype._move_event=function(t){return n.__assign({type:t.type},this._get_sxy(t))},t.prototype._scroll_event=function(t){return n.__assign({type:t.type},this._get_sxy(t),{delta:l.getDeltaY(t)})},t.prototype._key_event=function(t){return{type:t.type,keyCode:t.keyCode}},t.prototype._pan_start=function(t){var e=this._gesture_event(t);e.sx-=t.deltaX,e.sy-=t.deltaY,this._trigger(this.pan_start,e)},t.prototype._pan=function(t){this._trigger(this.pan,this._gesture_event(t))},t.prototype._pan_end=function(t){this._trigger(this.pan_end,this._gesture_event(t))},t.prototype._pinch_start=function(t){this._trigger(this.pinch_start,this._gesture_event(t))},t.prototype._pinch=function(t){this._trigger(this.pinch,this._gesture_event(t))},t.prototype._pinch_end=function(t){this._trigger(this.pinch_end,this._gesture_event(t))},t.prototype._rotate_start=function(t){this._trigger(this.rotate_start,this._gesture_event(t))},t.prototype._rotate=function(t){this._trigger(this.rotate,this._gesture_event(t))},t.prototype._rotate_end=function(t){this._trigger(this.rotate_end,this._gesture_event(t))},t.prototype._tap=function(t){this._trigger(this.tap,this._tap_event(t))},t.prototype._doubletap=function(t){var e=this._tap_event(t);this._trigger_bokeh_event(e),this.trigger(this.doubletap,e)},t.prototype._press=function(t){this._trigger(this.press,this._tap_event(t))},t.prototype._mouse_enter=function(t){this._trigger(this.move_enter,this._move_event(t))},t.prototype._mouse_move=function(t){this._trigger(this.move,this._move_event(t))},t.prototype._mouse_exit=function(t){this._trigger(this.move_exit,this._move_event(t))},t.prototype._mouse_wheel=function(t){this._trigger(this.scroll,this._scroll_event(t),t)},t.prototype._key_down=function(t){this.trigger(this.keydown,this._key_event(t))},t.prototype._key_up=function(t){this.trigger(this.keyup,this._key_event(t))},t}();i.UIEvents=p},function(t,e,i){function n(t){return(e=[]).concat.apply(e,t);var e}function r(t,e){return-1!==t.indexOf(e)}function o(t,e,i){void 0===i&&(i=1),h.assert(i>0,"'step' must be a positive number"),null==e&&(e=t,t=0);for(var n=Math.max,r=Math.ceil,o=Math.abs,s=t<=e?i:-i,a=n(r(o(e-t)/i),0),l=Array(a),c=0;c<a;c++,t+=s)l[c]=t;return l}function s(t){return function(e,i){for(var n=e.length,r=t>0?0:n-1;r>=0&&r<n;r+=t)if(i(e[r]))return r;return-1}}function a(t){for(var e=[],i=0,n=t;i<n.length;i++){var o=n[i];r(e,o)||e.push(o)}return e}var l=t(31),h=t(23),c=t(22);i.min=c.min,i.minBy=c.minBy,i.max=c.max,i.maxBy=c.maxBy,i.sum=c.sum;var u=Array.prototype.slice;i.head=function(t){return t[0]},i.tail=function(t){return t[t.length-1]},i.last=function(t){return t[t.length-1]},i.copy=function(t){return u.call(t)},i.concat=n,i.includes=r,i.contains=r,i.nth=function(t,e){return t[e>=0?e:t.length+e]},i.zip=function(t,e){for(var i=Math.min(t.length,e.length),n=new Array(i),r=0;r<i;r++)n[r]=[t[r],e[r]];return n},i.unzip=function(t){for(var e=t.length,i=new Array(e),n=new Array(e),r=0;r<e;r++)o=t[r],i[r]=o[0],n[r]=o[1];return[i,n];var o},i.range=o,i.linspace=function(t,e,i){void 0===i&&(i=100);for(var n=(e-t)/(i-1),r=new Array(i),o=0;o<i;o++)r[o]=t+n*o;return r},i.transpose=function(t){for(var e=t.length,i=t[0].length,n=[],r=0;r<i;r++){n[r]=[];for(var o=0;o<e;o++)n[r][o]=t[o][r]}return n},i.cumsum=function(t){var e=[];return t.reduce(function(t,i,n){return e[n]=t+i},0),e},i.argmin=function(t){return c.minBy(o(t.length),function(e){return t[e]})},i.argmax=function(t){return c.maxBy(o(t.length),function(e){return t[e]})},i.all=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!e(r))return!1}return!0},i.any=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(e(r))return!0}return!1},i.findIndex=s(1),i.findLastIndex=s(-1),i.find=function(t,e){var n=i.findIndex(t,e);return-1==n?void 0:t[n]},i.findLast=function(t,e){var n=i.findLastIndex(t,e);return-1==n?void 0:t[n]},i.sortedIndex=function(t,e){var i=0,n=t.length;for(;i<n;){var r=Math.floor((i+n)/2);t[r]<e?i=r+1:n=r}return i},i.sortBy=function(t,e){var i=t.map(function(t,i){return{value:t,index:i,key:e(t)}});return i.sort(function(t,e){var i=t.key,n=e.key;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return t.index-e.index}),i.map(function(t){return t.value})},i.uniq=a,i.uniqBy=function(t,e){for(var i=[],n=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e(a);r(n,l)||(n.push(l),i.push(a))}return i},i.union=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a(n(t))},i.intersection=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=[];t:for(var o=0,s=t;o<s.length;o++){var a=s[o];if(!r(n,a)){for(var l=0,h=e;l<h.length;l++){var c=h[l];if(!r(c,a))continue t}n.push(a)}}return n},i.difference=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=n(e);return t.filter(function(t){return!r(o,t)})},i.removeBy=function(t,e){for(var i=0;i<t.length;)e(t[i])?t.splice(i,1):i++},i.shuffle=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++){var r=l.randomIn(0,n);r!==n&&(i[n]=i[r]),i[r]=t[n]}return i},i.pairwise=function(t,e){for(var i=t.length,n=new Array(i-1),r=0;r<i-1;r++)n[r]=e(t[r],t[r+1]);return n},i.reversed=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++)i[e-n-1]=t[n];return i},i.repeat=function(t,e){for(var i=new Array(e),n=0;n<e;n++)i[n]=t;return i}},function(t,e,i){function n(t,e,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var o=t.length;e<0&&(e+=o),e<0?e=0:e>o&&(e=o),null==i||i>o-e?i=o-e:i<0&&(i=0);for(var s=o-i+n.length,a=new t.constructor(s),l=0;l<e;l++)a[l]=t[l];for(var h=0,c=n;h<c.length;h++){var u=c[h];a[l++]=u}for(var _=e+i;_<o;_++)a[l++]=t[_];return a}i.splice=n,i.insert=function(t,e,i){return n(t,i,0,e)},i.append=function(t,e){return n(t,t.length,0,e)},i.prepend=function(t,e){return n(t,0,0,e)},i.indexOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){for(var i=t.length,n=new t.constructor(i),r=0;r<i;r++)n[r]=e(t[r],r,t);return n},i.min=function(t){for(var e,i=1/0,n=0,r=t.length;n<r;n++)(e=t[n])<i&&(i=e);return i},i.minBy=function(t,e){if(0==t.length)throw new Error("minBy() called with an empty array");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a<n&&(i=s,n=a)}return i},i.max=function(t){for(var e,i=-1/0,n=0,r=t.length;n<r;n++)(e=t[n])>i&&(i=e);return i},i.maxBy=function(t,e){if(0==t.length)throw new Error("maxBy() called with an empty array");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a>n&&(i=s,n=a)}return i},i.sum=function(t){for(var e=0,i=0,n=t.length;i<n;i++)e+=t[i];return e}},function(t,e,i){var n=t(379),r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(Error);i.AssertionError=r,i.assert=function(t,e){if(!0===t||!1!==t&&t())return;throw new r(e||"Assertion failed")}},function(t,e,i){var n=Math.min,r=Math.max;i.empty=function(){return{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},i.positive_x=function(){return{minX:Number.MIN_VALUE,minY:-1/0,maxX:1/0,maxY:1/0}},i.positive_y=function(){return{minX:-1/0,minY:Number.MIN_VALUE,maxX:1/0,maxY:1/0}},i.union=function(t,e){return{minX:n(t.minX,e.minX),maxX:r(t.maxX,e.maxX),minY:n(t.minY,e.minY),maxY:r(t.maxY,e.maxY)}};var o=function(){function t(t){if("x0"in t&&"y0"in t&&"x1"in t&&"y1"in t){var e=t,i=e.x0,n=e.y0,r=e.x1,o=e.y1;if(!(i<=r&&n<=o))throw new Error("invalid bbox {x0: "+i+", y0: "+n+", x1: "+r+", y1: "+o+"}");this.x0=i,this.y0=n,this.x1=r,this.y1=o}else{var s=t,a=s.x,l=s.y,h=s.width,c=s.height;if(!(h>=0&&c>=0))throw new Error("invalid bbox {x: "+a+", y: "+l+", width: "+h+", height: "+c+"}");this.x0=a,this.y0=l,this.x1=a+h,this.y1=l+c}}return Object.defineProperty(t.prototype,"minX",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p0",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p1",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"h_range",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v_range",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ranges",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.clip=function(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:n(this.x0,e.x0),y0:n(this.y0,e.y0),x1:r(this.x1,e.x1),y1:r(this.y1,e.y1)})},t}();i.BBox=o},function(t,e,i){i.delay=function(t,e){return setTimeout(t,e)};var n="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;i.defer=function(t){return n(t)},i.throttle=function(t,e,i){void 0===i&&(i={});var n,r,o,s=null,a=0,l=function(){a=!1===i.leading?0:Date.now(),s=null,o=t.apply(n,r),s||(n=r=null)};return function(){var h=Date.now();a||!1!==i.leading||(a=h);var c=e-(h-a);return n=this,r=arguments,c<=0||c>e?(s&&(clearTimeout(s),s=null),a=h,o=t.apply(n,r),s||(n=r=null)):s||!1===i.trailing||(s=setTimeout(l,c)),o}},i.once=function(t){var e,i=!1;return function(){return i||(i=!0,e=t()),e}}},function(t,e,i){i.fixup_ctx=function(t){(function(t){t.setLineDash||(t.setLineDash=function(e){t.mozDash=e,t.webkitLineDash=e});t.getLineDash||(t.getLineDash=function(){return t.mozDash})})(t),function(t){t.setLineDashOffset=function(e){t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}}(t),function(t){t.setImageSmoothingEnabled=function(e){t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e=t.imageSmoothingEnabled;return null==e||e}}(t),function(t){t.measureText&&null==t.html5MeasureText&&(t.html5MeasureText=t.measureText,t.measureText=function(e){var i=t.html5MeasureText(e);return i.ascent=1.6*t.html5MeasureText("m").width,i})}(t),function(t){t.ellipse||(t.ellipse=function(e,i,n,r,o,s,a,l){void 0===l&&(l=!1);t.translate(e,i),t.rotate(o);var h=n,c=r;l&&(h=-n,c=-r);t.moveTo(-h,0),t.bezierCurveTo(-h,.551784*c,.551784*-h,c,0,c),t.bezierCurveTo(.551784*h,c,h,.551784*c,h,0),t.bezierCurveTo(h,.551784*-c,.551784*h,-c,0,-c),t.bezierCurveTo(.551784*-h,-c,-h,.551784*-c,-h,0),t.rotate(-o),t.translate(-e,-i)})}(t)},i.get_scale_ratio=function(t,e,i){if("svg"==i)return 1;if(e){var n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}return 1}},function(t,e,i){function n(t){var e=Number(t).toString(16);return 1==e.length?"0"+e:e}function r(t){if(0==(t+="").indexOf("#"))return t;if(o.is_svg_color(t))return o.svg_colors[t];if(0==t.indexOf("rgb")){var e=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),i=e.slice(0,3).map(n).join("");return 4==e.length&&(i+=n(Math.floor(255*parseFloat(e[3])))),"#"+i.slice(0,8)}return t}var o=t(39),s=t(21);i.color2hex=r,i.color2rgba=function(t,e){void 0===e&&(e=1);if(!t)return[0,0,0,0];var i=r(t);(i=i.replace(/ |#/g,"")).length<=4&&(i=i.replace(/(.)/g,"$1$1"));var n=i.match(/../g).map(function(t){return parseInt(t,16)/255});for(;n.length<3;)n.push(0);n.length<4&&n.push(e);return n.slice(0,4)},i.valid_rgb=function(t){var e;switch(t.substring(0,4)){case"rgba":e={start:"rgba(",len:4,alpha:!0};break;case"rgb(":e={start:"rgb(",len:3,alpha:!1};break;default:return!1}if(new RegExp(".*?(\\.).*(,)").test(t))throw new Error("color expects integers for rgb in rgb/rgba tuple, received "+t);var i=t.replace(e.start,"").replace(")","").split(",").map(parseFloat);if(i.length!=e.len)throw new Error("color expects rgba "+e.len+"-tuple, received "+t);if(e.alpha&&!(0<=i[3]&&i[3]<=1))throw new Error("color expects rgba 4-tuple to have alpha value between 0 and 1");if(s.includes(i.slice(0,3).map(function(t){return 0<=t&&t<=255}),!1))throw new Error("color expects rgb to have value between 0 and 255");return!0}},function(t,e,i){i.is_ie=navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0,i.is_little_endian=function(){var t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t);i[1]=168496141;var n=!0;return 10==e[4]&&11==e[5]&&12==e[6]&&13==e[7]&&(n=!1),n}()},function(t,e,i){var n=t(21),r=t(30),o=t(44),s=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var i=this._existing(t);null==i?this._dict[t]=e:o.isArray(i)?i.push(e):this._dict[t]=[i,e]},t.prototype.remove_value=function(t,e){var i=this._existing(t);if(o.isArray(i)){var s=n.difference(i,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(i,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var i=this._existing(t);if(o.isArray(i)){if(1===i.length)return i[0];throw new Error(e)}return i},t}();i.MultiDict=s;var a=function(){function t(e){this.values=null==e?[]:e instanceof t?n.copy(e.values):this._compact(e)}return t.prototype._compact=function(t){for(var e=[],i=0,n=t;i<n.length;i++){var r=n[i];-1===e.indexOf(r)&&e.push(r)}return e},t.prototype.push=function(t){this.missing(t)&&this.values.push(t)},t.prototype.remove=function(t){var e=this.values.indexOf(t);this.values=this.values.slice(0,e).concat(this.values.slice(e+1))},t.prototype.length=function(){return this.values.length},t.prototype.includes=function(t){return-1!=this.values.indexOf(t)},t.prototype.missing=function(t){return!this.includes(t)},t.prototype.slice=function(t,e){return this.values.slice(t,e)},t.prototype.join=function(t){return this.values.join(t)},t.prototype.toString=function(){return this.join(", ")},t.prototype.union=function(e){return e=new t(e),new t(this.values.concat(e.values))},t.prototype.intersect=function(e){e=new t(e);for(var i=new t,n=0,r=e.values;n<r.length;n++){var o=r[n];this.includes(o)&&e.includes(o)&&i.push(o)}return i},t.prototype.diff=function(e){e=new t(e);for(var i=new t,n=0,r=this.values;n<r.length;n++){var o=r[n];e.missing(o)&&i.push(o)}return i},t}();i.Set=a},function(t,e,i){function n(t,e,i,s){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;var a=o.call(t);if(a!==o.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var l="[object Array]"===a;if(!l){if("object"!=typeof t||"object"!=typeof e)return!1;var h=t.constructor,c=e.constructor;if(h!==c&&!(r.isFunction(h)&&h instanceof h&&r.isFunction(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}i=i||[],s=s||[];for(var u=i.length;u--;)if(i[u]===t)return s[u]===e;if(i.push(t),s.push(e),l){if((u=t.length)!==e.length)return!1;for(;u--;)if(!n(t[u],e[u],i,s))return!1}else{var _=Object.keys(t),p=void 0;if(u=_.length,Object.keys(e).length!==u)return!1;for(;u--;)if(p=_[u],!e.hasOwnProperty(p)||!n(t[p],e[p],i,s))return!1}return i.pop(),s.pop(),!0}var r=t(44),o=Object.prototype.toString;i.isEqual=function(t,e){return n(t,e)}},function(t,e,i){function n(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(n(t-e))}function o(){return Math.random()}i.angle_norm=n,i.angle_dist=r,i.angle_between=function(t,e,i,o){var s=n(t),a=r(e,i),l=r(e,s)<=a&&r(s,i)<=a;return"anticlock"==o?l:!l},i.random=o,i.randomIn=function(t,e){null==e&&(e=t,t=0);return t+Math.floor(Math.random()*(e-t+1))},i.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},i.rnorm=function(t,e){var i,n;for(;i=o(),n=o(),n=(2*n-1)*Math.sqrt(1/Math.E*2),!(-4*i*i*Math.log(i)>=n*n););var r=n/i;return r=t+e*r},i.clamp=function(t,e,i){return t>i?i:t<e?e:t}},function(t,e,i){function n(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,r=e;n<r.length;n++){var o=r[n];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function r(t){return Object.keys(t).length}var o=t(21);i.keys=Object.keys,i.values=function(t){for(var e=Object.keys(t),i=e.length,n=new Array(i),r=0;r<i;r++)n[r]=t[e[r]];return n},i.extend=n,i.clone=function(t){return n({},t)},i.merge=function(t,e){for(var i=Object.create(Object.prototype),n=0,r=o.concat([Object.keys(t),Object.keys(e)]);n<r.length;n++){var s=r[n],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];i[s]=o.union(a,l)}return i},i.size=r,i.isEmpty=function(t){return 0===r(t)}},function(t,e,i){function n(t,e){for(var n=Math.min(t.length,e.length),r=new Array(n),o=new Array(n),s=0;s<n;s++){var a=i.wgs84_mercator.forward([t[s],e[s]]),l=a[0],h=a[1];r[s]=l,o[s]=h}return[r,o]}var r=t(360),o=t(348),s=new o("GOOGLE"),a=new o("WGS84");i.wgs84_mercator=r(a,s);var l={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},h={lon:[-180,180],lat:[-85.06,85.06]};i.clip_mercator=function(t,e,i){var n=l[i],r=n[0],o=n[1];return[Math.max(t,r),Math.min(e,o)]},i.in_bounds=function(t,e){return t>h[e][0]&&t<h[e][1]},i.project_xy=n,i.project_xsys=function(t,e){for(var i=Math.min(t.length,e.length),r=new Array(i),o=new Array(i),s=0;s<i;s++){var a=n(t[s],e[s]),l=a[0],h=a[1];r[s]=l,o[s]=h}return[r,o]}},function(t,e,i){var n=t(44);i.create_ref=function(t){var e={type:t.type,id:t.id};null!=t._subtype&&(e.subtype=t._subtype);return e},i.is_ref=function(t){if(n.isObject(t)){var e=Object.keys(t).sort();if(2==e.length)return"id"==e[0]&&"type"==e[1];if(3==e.length)return"id"==e[0]&&"subtype"==e[1]&&"type"==e[2]}return!1}},function(t,e,i){i.get_indices=function(t){var e=t.selected;return e["0d"].glyph?e["0d"].indices:e["1d"].indices.length>0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]}},function(t,e,i){function n(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,2*t.length),i=0,n=e.length;i<n;i+=2){var r=e[i];e[i]=e[i+1],e[i+1]=r}}function r(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,4*t.length),i=0,n=e.length;i<n;i+=4){var r=e[i];e[i]=e[i+3],e[i+3]=r,r=e[i+1],e[i+1]=e[i+2],e[i+2]=r}}function o(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,8*t.length),i=0,n=e.length;i<n;i+=8){var r=e[i];e[i]=e[i+7],e[i+7]=r,r=e[i+1],e[i+1]=e[i+6],e[i+6]=r,r=e[i+2],e[i+2]=e[i+5],e[i+5]=r,r=e[i+3],e[i+3]=e[i+4],e[i+4]=r}}function s(t,e){for(var s=t.order!==i.BYTE_ORDER,a=t.shape,l=null,h=0,c=e;h<c.length;h++){var u=c[h],_=JSON.parse(u[0]);if(_.id===t.__buffer__){l=u[1];break}}var p=new i.ARRAY_TYPES[t.dtype](l);return s&&(2===p.BYTES_PER_ELEMENT?n(p):4===p.BYTES_PER_ELEMENT?r(p):8===p.BYTES_PER_ELEMENT&&o(p)),[p,a]}function a(t,e){return _.isObject(t)&&"__ndarray__"in t?c(t):_.isObject(t)&&"__buffer__"in t?s(t,e):_.isArray(t)?[t,[]]:void 0}function l(t){var e=new Uint8Array(t),i=Array.from(e).map(function(t){return String.fromCharCode(t)});return btoa(i.join(""))}function h(t){for(var e=atob(t),i=e.length,n=new Uint8Array(i),r=0,o=i;r<o;r++)n[r]=e.charCodeAt(r);return n.buffer}function c(t){var e,n=h(t.__ndarray__),r=t.dtype,o=t.shape;if(!(r in i.ARRAY_TYPES))throw new Error("unknown dtype: "+r);return e=new i.ARRAY_TYPES[r](n),[e,o]}function u(t,e){var n,r=l(t.buffer),o=function(t){if("name"in t.constructor)return t.constructor.name;switch(!0){case t instanceof Uint8Array:return"Uint8Array";case t instanceof Int8Array:return"Int8Array";case t instanceof Uint16Array:return"Uint16Array";case t instanceof Int16Array:return"Int16Array";case t instanceof Uint32Array:return"Uint32Array";case t instanceof Int32Array:return"Int32Array";case t instanceof Float32Array:return"Float32Array";case t instanceof Float64Array:return"Float64Array";default:throw new Error("unsupported typed array")}}(t);if(!(o in i.DTYPES))throw new Error("unknown array type: "+o);n=i.DTYPES[o];var s={__ndarray__:r,shape:e,dtype:n};return s}var _=t(44),p=t(28);i.ARRAY_TYPES={uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array,float32:Float32Array,float64:Float64Array},i.DTYPES={Uint8Array:"uint8",Int8Array:"int8",Uint16Array:"uint16",Int16Array:"int16",Uint32Array:"uint32",Int32Array:"int32",Float32Array:"float32",Float64Array:"float64"},i.BYTE_ORDER=p.is_little_endian?"little":"big",i.swap16=n,i.swap32=r,i.swap64=o,i.process_buffer=s,i.process_array=a,i.arrayBufferToBase64=l,i.base64ToArrayBuffer=h,i.decode_base64=c,i.encode_base64=u,i.decode_column_data=function(t,e){void 0===e&&(e=[]);var i={},n={};for(var r in t){var o=t[r];if(_.isArray(o)){if(0==o.length||!_.isObject(o[0])&&!_.isArray(o[0])){i[r]=o;continue}for(var s=[],l=[],h=0,c=o;h<c.length;h++){var u=c[h],p=a(u,e),d=p[0],f=p[1];s.push(d),l.push(f)}i[r]=s,n[r]=l}else{var v=a(o,e),d=v[0],f=v[1];i[r]=d,n[r]=f}}return[i,n]},i.encode_column_data=function(t,e){var i={};for(var n in t){var r=t[n],o=void 0;if(_.isTypedArray(r))o=u(r,null!=e?e[n]:void 0);else if(_.isArray(r)){for(var s=[],a=0,l=r.length;a<l;a++){var h=r[a];if(_.isTypedArray(h)){var c=null!=e&&null!=e[n]?e[n][a]:void 0;s.push(u(h,c))}else s.push(h)}o=s}else o=r;i[n]=o}return i}},function(t,e,i){var n=t(379),r=t(376),o=function(){return function(){}}();i.SpatialIndex=o;var s=function(t){function e(e){var i=t.call(this)||this;return i.index=r(),i.index.load(e),i}return n.__extends(e,t),Object.defineProperty(e.prototype,"bbox",{get:function(){var t=this.index.toJSON(),e=t.minX,i=t.minY,n=t.maxX,r=t.maxY;return{minX:e,minY:i,maxX:n,maxY:r}},enumerable:!0,configurable:!0}),e.prototype.search=function(t){return this.index.search(t)},e.prototype.indices=function(t){for(var e=this.search(t),i=e.length,n=new Array(i),r=0;r<i;r++)n[r]=e[r].i;return n},e}(o);i.RBush=s},function(t,e,i){function n(){for(var t=new Array(32),e=0;e<32;e++)t[e]="0123456789ABCDEF".substr(Math.floor(16*Math.random()),1);return t[12]="4",t[16]="0123456789ABCDEF".substr(3&t[16].charCodeAt(0)|8,1),t.join("")}var r=t(18);i.startsWith=function(t,e,i){void 0===i&&(i=0);return t.substr(i,e.length)==e},i.uuid4=n;var o=1e3;i.uniqueId=function(t){var e=r.settings.dev?"j"+o++:n();return null!=t?t+"-"+e:e},i.escape=function(t){return t.replace(/(?:[&<>"'`])/g,function(t){switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return t}})},i.unescape=function(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return e}})}},function(t,e,i){i.svg_colors={indianred:"#CD5C5C",lightcoral:"#F08080",salmon:"#FA8072",darksalmon:"#E9967A",lightsalmon:"#FFA07A",crimson:"#DC143C",red:"#FF0000",firebrick:"#B22222",darkred:"#8B0000",pink:"#FFC0CB",lightpink:"#FFB6C1",hotpink:"#FF69B4",deeppink:"#FF1493",mediumvioletred:"#C71585",palevioletred:"#DB7093",coral:"#FF7F50",tomato:"#FF6347",orangered:"#FF4500",darkorange:"#FF8C00",orange:"#FFA500",gold:"#FFD700",yellow:"#FFFF00",lightyellow:"#FFFFE0",lemonchiffon:"#FFFACD",lightgoldenrodyellow:"#FAFAD2",papayawhip:"#FFEFD5",moccasin:"#FFE4B5",peachpuff:"#FFDAB9",palegoldenrod:"#EEE8AA",khaki:"#F0E68C",darkkhaki:"#BDB76B",lavender:"#E6E6FA",thistle:"#D8BFD8",plum:"#DDA0DD",violet:"#EE82EE",orchid:"#DA70D6",fuchsia:"#FF00FF",magenta:"#FF00FF",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",blueviolet:"#8A2BE2",darkviolet:"#9400D3",darkorchid:"#9932CC",darkmagenta:"#8B008B",purple:"#800080",indigo:"#4B0082",slateblue:"#6A5ACD",darkslateblue:"#483D8B",mediumslateblue:"#7B68EE",greenyellow:"#ADFF2F",chartreuse:"#7FFF00",lawngreen:"#7CFC00",lime:"#00FF00",limegreen:"#32CD32",palegreen:"#98FB98",lightgreen:"#90EE90",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",mediumseagreen:"#3CB371",seagreen:"#2E8B57",forestgreen:"#228B22",green:"#008000",darkgreen:"#006400",yellowgreen:"#9ACD32",olivedrab:"#6B8E23",olive:"#808000",darkolivegreen:"#556B2F",mediumaquamarine:"#66CDAA",darkseagreen:"#8FBC8F",lightseagreen:"#20B2AA",darkcyan:"#008B8B",teal:"#008080",aqua:"#00FFFF",cyan:"#00FFFF",lightcyan:"#E0FFFF",paleturquoise:"#AFEEEE",aquamarine:"#7FFFD4",turquoise:"#40E0D0",mediumturquoise:"#48D1CC",darkturquoise:"#00CED1",cadetblue:"#5F9EA0",steelblue:"#4682B4",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",lightblue:"#ADD8E6",skyblue:"#87CEEB",lightskyblue:"#87CEFA",deepskyblue:"#00BFFF",dodgerblue:"#1E90FF",cornflowerblue:"#6495ED",royalblue:"#4169E1",blue:"#0000FF",mediumblue:"#0000CD",darkblue:"#00008B",navy:"#000080",midnightblue:"#191970",cornsilk:"#FFF8DC",blanchedalmond:"#FFEBCD",bisque:"#FFE4C4",navajowhite:"#FFDEAD",wheat:"#F5DEB3",burlywood:"#DEB887",tan:"#D2B48C",rosybrown:"#BC8F8F",sandybrown:"#F4A460",goldenrod:"#DAA520",darkgoldenrod:"#B8860B",peru:"#CD853F",chocolate:"#D2691E",saddlebrown:"#8B4513",sienna:"#A0522D",brown:"#A52A2A",maroon:"#800000",white:"#FFFFFF",snow:"#FFFAFA",honeydew:"#F0FFF0",mintcream:"#F5FFFA",azure:"#F0FFFF",aliceblue:"#F0F8FF",ghostwhite:"#F8F8FF",whitesmoke:"#F5F5F5",seashell:"#FFF5EE",beige:"#F5F5DC",oldlace:"#FDF5E6",floralwhite:"#FFFAF0",ivory:"#FFFFF0",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lavenderblush:"#FFF0F5",mistyrose:"#FFE4E1",gainsboro:"#DCDCDC",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",silver:"#C0C0C0",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",gray:"#808080",grey:"#808080",dimgray:"#696969",dimgrey:"#696969",lightslategray:"#778899",lightslategrey:"#778899",slategray:"#708090",slategrey:"#708090",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",black:"#000000"},i.is_svg_color=function(t){return t in i.svg_colors}},function(t,e,i){var n=t(377),r=t(347),o=t(378),s=t(38),a=t(44);i.replace_placeholders=function(t,e,i,l,h){void 0===l&&(l=null);void 0===h&&(h={});return t=t.replace(/(^|[^\$])\$(\w+)/g,function(t,e,i){return e+"@$"+i}),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,c,u,_,p){var d;if("$"==(u=null!=_?_:u)[0])d=h[u.substring(1)];else{var f=e.get_column(u);null!=f&&(d=f[i])}var v=null;if(null==d)v="???";else{if("safe"==p)return""+c+d;if(null!=p)if(null!=l&&u in l){var m=l[u];switch(m){case"numeral":v=r.format(d,p);break;case"datetime":v=o(d,p);break;case"printf":v=n.sprintf(p,d);break;default:throw new Error("Unknown tooltip field formatter type '"+m+"'")}}else v=r.format(d,p);else v=function(t){if(a.isNumber(t)){var e=function(){switch(!1){case Math.floor(t)!=t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}();return n.sprintf(e,t)}return""+t}(d)}return""+c+s.escape(v)})}},function(t,e,i){var n=t(5),r={};i.get_text_height=function(t){if(null!=r[t])return r[t];var e=n.span({style:{font:t}},"Hg"),i=n.div({style:{display:"inline-block",width:"1px",height:"0px"}}),o=n.div({},e,i);document.body.appendChild(o);try{i.style.verticalAlign="baseline";var s=n.offset(i).top-n.offset(e).top;i.style.verticalAlign="bottom";var a=n.offset(i).top-n.offset(e).top,l={height:a,ascent:s,descent:a-s};return r[t]=l,l}finally{document.body.removeChild(o)}}},function(t,e,i){var n=("undefined"!=typeof window?window.requestAnimationFrame:void 0)||("undefined"!=typeof window?window.webkitRequestAnimationFrame:void 0)||("undefined"!=typeof window?window.mozRequestAnimationFrame:void 0)||("undefined"!=typeof window?window.msRequestAnimationFrame:void 0)||function(t){return t(Date.now()),-1};i.throttle=function(t,e){var i=null,r=0,o=!1,s=function(){r=Date.now(),i=null,o=!1,t()};return function(){var t=Date.now(),a=e-(t-r);a<=0&&!o?(null!=i&&clearTimeout(i),o=!0,n(s)):i||o||(i=setTimeout(function(){return n(s)},a))}}},function(t,e,i){i.concat=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.length,r=0,o=e;r<o.length;r++){var s=o[r];n+=s.length}var a=new t.constructor(n);a.set(t,0);for(var l=t.length,h=0,c=e;h<c.length;h++){var s=c[h];a.set(s,l),l+=s.length}return a}},function(t,e,i){function n(t){return"[object Number]"===o.call(t)}var r=t(21),o=Object.prototype.toString;i.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===o.call(t)},i.isNumber=n,i.isInteger=function(t){return n(t)&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"[object String]"===o.call(t)},i.isStrictNaN=function(t){return n(t)&&t!==+t},i.isFunction=function(t){return"[object Function]"===o.call(t)},i.isArray=function(t){return Array.isArray(t)},i.isArrayOf=function(t,e){return r.all(t,e)},i.isArrayableOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(!e(t[i]))return!1;return!0},i.isTypedArray=function(t){return null!=t&&null!=t.buffer&&t.buffer instanceof ArrayBuffer},i.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t}},function(t,e,i){function n(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}i.getDeltaY=function(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=function(t){return n(t.offsetParent||document.body)||n(t)||16}(t.target);break;case t.DOM_DELTA_PAGE:e*=function(t){return t.clientHeight}(t.target)}return e}},function(t,e,i){function n(t,e,i){var n=[t.start,t.end],r=n[0],o=n[1],s=null!=i?i:(o+r)/2,a=r-(r-s)*e,l=o-(o-s)*e;return[a,l]}function r(t,e){var i=e[0],n=e[1],r={};for(var o in t){var s=t[o],a=s.r_invert(i,n),l=a[0],h=a[1];r[o]={start:l,end:h}}return r}var o=t(31);i.scale_highlow=n,i.get_info=r,i.scale_range=function(t,e,i,s,a){void 0===i&&(i=!0);void 0===s&&(s=!0);e=o.clamp(e,-.9,.9);var l=i?e:0,h=n(t.bbox.h_range,l,null!=a?a.x:void 0),c=h[0],u=h[1],_=r(t.xscales,[c,u]),p=s?e:0,d=n(t.bbox.v_range,p,null!=a?a.y:void 0),f=d[0],v=d[1],m=r(t.yscales,[f,v]);return{xrs:_,yrs:m,factor:e}}},function(t,e,i){var n=t(44);i.isValue=function(t){return n.isObject(t)&&"value"in t},i.isField=function(t){return n.isObject(t)&&"field"in t}},function(t,e,i){var n=t(379),r=t(19),o=t(38),s=function(t){function e(e){var i=t.call(this)||this;if(i.removed=new r.Signal0(i,"removed"),null==e.model)throw new Error("model of a view wasn't configured");return i.model=e.model,i._parent=e.parent,i.id=e.id||o.uniqueId(),i.initialize(e),!1!==e.connect_signals&&i.connect_signals(),i}return n.__extends(e,t),e.prototype.initialize=function(t){},e.prototype.remove=function(){this._parent=void 0,this.disconnect_signals(),this.removed.emit()},e.prototype.toString=function(){return this.model.type+"View("+this.id+")"},Object.defineProperty(e.prototype,"parent",{get:function(){if(void 0!==this._parent)return this._parent;throw new Error("parent of a view wasn't configured")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_root",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.is_root?this:this.parent.root},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.notify_finished=function(){this.root.notify_finished()},e}(r.Signalable());i.View=s},function(t,e,i){var n=t(379),r=t(16),o=t(27),s=function(){function t(t,e){void 0===e&&(e=""),this.obj=t,this.prefix=e,this.cache={};var i=t.properties[e+this.do_attr].spec;this.doit=null!==i.value;for(var n=0,r=this.attrs;n<r.length;n++){var o=r[n];this[o]=t.properties[e+o]}}return t.prototype.warm_cache=function(t){for(var e=0,i=this.attrs;e<i.length;e++){var n=i[e],r=this.obj.properties[this.prefix+n];if(void 0!==r.spec.value)this.cache[n]=r.spec.value;else{if(null==t)throw new Error("source is required with a vectorized visual property");this.cache[n+"_array"]=r.array(t)}}},t.prototype.cache_select=function(t,e){var i,n=this.obj.properties[this.prefix+t];return void 0!==n.spec.value?this.cache[t]=i=n.spec.value:this.cache[t]=i=this.cache[t+"_array"][e],i},t.prototype.set_vectorize=function(t,e){null!=this.all_indices?this._set_vectorize(t,this.all_indices[e]):this._set_vectorize(t,e)},t}();i.ContextProperties=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.strokeStyle=this.line_color.value(),t.globalAlpha=this.line_alpha.value(),t.lineWidth=this.line_width.value(),t.lineJoin=this.line_join.value(),t.lineCap=this.line_cap.value(),t.setLineDash(this.line_dash.value()),t.setLineDashOffset(this.line_dash_offset.value())},e.prototype._set_vectorize=function(t,e){this.cache_select("line_color",e),t.strokeStyle!==this.cache.line_color&&(t.strokeStyle=this.cache.line_color),this.cache_select("line_alpha",e),t.globalAlpha!==this.cache.line_alpha&&(t.globalAlpha=this.cache.line_alpha),this.cache_select("line_width",e),t.lineWidth!==this.cache.line_width&&(t.lineWidth=this.cache.line_width),this.cache_select("line_join",e),t.lineJoin!==this.cache.line_join&&(t.lineJoin=this.cache.line_join),this.cache_select("line_cap",e),t.lineCap!==this.cache.line_cap&&(t.lineCap=this.cache.line_cap),this.cache_select("line_dash",e),t.getLineDash()!==this.cache.line_dash&&t.setLineDash(this.cache.line_dash),this.cache_select("line_dash_offset",e),t.getLineDashOffset()!==this.cache.line_dash_offset&&t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t=o.color2rgba(this.line_color.value(),this.line_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return"rgba("+255*e+","+255*i+","+255*n+","+r+")"},e}(s);i.Line=a,a.prototype.attrs=Object.keys(r.line()),a.prototype.do_attr="line_color";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.fillStyle=this.fill_color.value(),t.globalAlpha=this.fill_alpha.value()},e.prototype._set_vectorize=function(t,e){this.cache_select("fill_color",e),t.fillStyle!==this.cache.fill_color&&(t.fillStyle=this.cache.fill_color),this.cache_select("fill_alpha",e),t.globalAlpha!==this.cache.fill_alpha&&(t.globalAlpha=this.cache.fill_alpha)},e.prototype.color_value=function(){var t=o.color2rgba(this.fill_color.value(),this.fill_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return"rgba("+255*e+","+255*i+","+255*n+","+r+")"},e}(s);i.Fill=l,l.prototype.attrs=Object.keys(r.fill()),l.prototype.do_attr="fill_color";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.cache_select=function(e,i){var n;if("font"==e){t.prototype.cache_select.call(this,"text_font_style",i),t.prototype.cache_select.call(this,"text_font_size",i),t.prototype.cache_select.call(this,"text_font",i);var r=this.cache,o=r.text_font_style,s=r.text_font_size,a=r.text_font;this.cache.font=n=o+" "+s+" "+a}else n=t.prototype.cache_select.call(this,e,i);return n},e.prototype.font_value=function(){var t=this.text_font.value(),e=this.text_font_size.value(),i=this.text_font_style.value();return i+" "+e+" "+t},e.prototype.color_value=function(){var t=o.color2rgba(this.text_color.value(),this.text_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return"rgba("+255*e+","+255*i+","+255*n+","+r+")"},e.prototype.set_value=function(t){t.font=this.font_value(),t.fillStyle=this.text_color.value(),t.globalAlpha=this.text_alpha.value(),t.textAlign=this.text_align.value(),t.textBaseline=this.text_baseline.value()},e.prototype._set_vectorize=function(t,e){this.cache_select("font",e),t.font!==this.cache.font&&(t.font=this.cache.font),this.cache_select("text_color",e),t.fillStyle!==this.cache.text_color&&(t.fillStyle=this.cache.text_color),this.cache_select("text_alpha",e),t.globalAlpha!==this.cache.text_alpha&&(t.globalAlpha=this.cache.text_alpha),this.cache_select("text_align",e),t.textAlign!==this.cache.text_align&&(t.textAlign=this.cache.text_align),this.cache_select("text_baseline",e),t.textBaseline!==this.cache.text_baseline&&(t.textBaseline=this.cache.text_baseline)},e}(s);i.Text=h,h.prototype.attrs=Object.keys(r.text()),h.prototype.do_attr="text_color";var c=function(){function t(t){for(var e=0,i=t.mixins;e<i.length;e++){var n=i[e],r=n.split(":"),o=r[0],s=r[1],c=void 0===s?"":s,u=void 0;switch(o){case"line":u=a;break;case"fill":u=l;break;case"text":u=h;break;default:throw new Error("unknown visual: "+o)}this[c+o]=new u(t,c)}}return t.prototype.warm_cache=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&i.warm_cache(t)}},t.prototype.set_all_indices=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&(i.all_indices=t)}},t}();i.Visuals=c},function(t,e,i){var n=t(379),r=t(0),o=t(263),s=t(14),a=t(3),l=t(8),h=t(19),c=t(34),u=t(36),_=t(29),p=t(21),d=t(32),f=t(30),v=t(44),m=t(146),g=t(184),y=t(53),b=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new _.Set}return t.prototype.send_event=function(t){null!=this.session&&this.session.send_event(t)},t.prototype.trigger=function(t){for(var e=0,i=this.subscribed_models.values;e<i.length;e++){var n=i[e];if(null==t.model_id||t.model_id===n){var r=this.document._all_models[n];null!=r&&r._process_event(t)}}},t}();i.EventManager=b;var x=function(){return function(t){this.document=t}}();i.DocumentChangedEvent=x;var w=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e)||this;return a.model=i,a.attr=n,a.old=r,a.new_=o,a.setter_id=s,a}return n.__extends(e,t),e.prototype.json=function(t){if("id"===this.attr)throw new Error("'id' field should never change, whatever code just set it is wrong");var e=this.new_,i=l.HasProps._value_to_json(this.attr,e,this.model),n={};l.HasProps._value_record_references(e,n,!0),this.model.id in n&&this.model!==e&&delete n[this.model.id];for(var r in n)t[r]=n[r];return{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:i}},e}(x);i.ModelChangedEvent=w;var k=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.title=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return{kind:"TitleChanged",title:this.title}},e}(x);i.TitleChangedEvent=k;var S=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.model=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return l.HasProps._value_record_references(this.model,t,!0),{kind:"RootAdded",model:this.model.ref()}},e}(x);i.RootAddedEvent=S;var C=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.model=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return{kind:"RootRemoved",model:this.model.ref()}},e}(x);i.RootRemovedEvent=C,i.documents=[],i.DEFAULT_TITLE="Bokeh Application";var T=function(){function t(){i.documents.push(this),this._init_timestamp=Date.now(),this._title=i.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new _.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new b(this),this.idle=new h.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return Object.defineProperty(t.prototype,"layoutables",{get:function(){return this._roots.filter(function(t){return t instanceof m.LayoutDOM})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"is_idle",{get:function(){for(var t=0,e=this.layoutables;t<e.length;t++){var i=e[t];if(!this._idle_roots.has(i))return!1}return!0},enumerable:!0,configurable:!0}),t.prototype.notify_idle=function(t){this._idle_roots.set(t,!0),this.is_idle&&(s.logger.info("document idle at "+(Date.now()-this._init_timestamp)+" ms"),this.idle.emit())},t.prototype.clear=function(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}},t.prototype.interactive_start=function(t){null==this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new a.LODStart({}))),this._interactive_timestamp=Date.now()},t.prototype.interactive_stop=function(t){null!=this._interactive_plot&&this._interactive_plot.id===t.id&&this._interactive_plot.trigger_event(new a.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},t.prototype.interactive_duration=function(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},t.prototype.destructively_move=function(t){if(t===this)throw new Error("Attempted to overwrite a document with itself");t.clear();var e=p.copy(this._roots);this.clear();for(var i=0,n=e;i<n.length;i++){var r=n[i];if(null!=r.document)throw new Error("Somehow we didn't detach "+r)}if(0!==Object.keys(this._all_models).length)throw new Error("this._all_models still had stuff in it: "+this._all_models);for(var o=0,s=e;o<s.length;o++){var r=s[o];t.add_root(r)}t.set_title(this._title)},t.prototype._push_all_models_freeze=function(){this._all_models_freeze_count+=1},t.prototype._pop_all_models_freeze=function(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._invalidate_all_models=function(){s.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._recompute_all_models=function(){for(var t=new _.Set,e=0,i=this._roots;e<i.length;e++){var n=i[e];t=t.union(n.references())}for(var r=new _.Set(d.values(this._all_models)),o=r.diff(t),s=t.diff(r),a={},l=0,h=t.values;l<h.length;l++){var c=h[l];a[c.id]=c}for(var u=0,p=o.values;u<p.length;u++){var f=p[u];f.detach_document(),f instanceof y.Model&&null!=f.name&&this._all_models_by_name.remove_value(f.name,f)}for(var v=0,m=s.values;v<m.length;v++){var g=m[v];g.attach_document(this),g instanceof y.Model&&null!=g.name&&this._all_models_by_name.add_value(g.name,g)}this._all_models=a},t.prototype.roots=function(){return this._roots},t.prototype.add_root=function(t,e){if(s.logger.debug("Adding root: "+t),!p.includes(this._roots,t)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new S(this,t,e))}},t.prototype.remove_root=function(t,e){var i=this._roots.indexOf(t);if(!(i<0)){this._push_all_models_freeze();try{this._roots.splice(i,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new C(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){t!==this._title&&(this._title=t,this._trigger_on_change(new k(this,t,e)))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,"Multiple models are named '"+t+"'")},t.prototype.on_change=function(t){p.includes(this._callbacks,t)||this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e=this._callbacks.indexOf(t);e>=0&&this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){for(var e=0,i=this._callbacks;e<i.length;e++){var n=i[e];n(t)}},t.prototype._notify_change=function(t,e,i,n,r){"name"===e&&(this._all_models_by_name.remove_value(i,t),null!=n&&this._all_models_by_name.add_value(n,t));var o=null!=r?r.setter_id:void 0;this._trigger_on_change(new w(this,t,e,i,n,o))},t._references_json=function(t,e){void 0===e&&(e=!0);for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.ref();s.attributes=o.attributes_as_json(e),delete s.attributes.id,i.push(s)}return i},t._instantiate_object=function(t,e,i){var n=d.extend({},i,{id:t,__deferred__:!0}),o=r.Models(e);return new o(n)},t._instantiate_references_json=function(e,i){for(var n={},r=0,o=e;r<o.length;r++){var s=o[r],a=s.id,l=s.type,h=s.attributes||{},c=void 0;a in i?c=i[a]:(c=t._instantiate_object(a,l,h),null!=s.subtype&&c.set_subtype(s.subtype)),n[c.id]=c}return n},t._resolve_refs=function(t,e,i){function n(t){if(c.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in i)return i[t.id];throw new Error("reference "+JSON.stringify(t)+" isn't known (not in Document?)")}return v.isArray(t)?function(t){for(var e=[],i=0,r=t;i<r.length;i++){var o=r[i];e.push(n(o))}return e}(t):v.isObject(t)?function(t){var e={};for(var i in t){var r=t[i];e[i]=n(r)}return e}(t):t}return n(t)},t._initialize_references_json=function(e,i,n){function r(t,e){function i(r){if(r instanceof l.HasProps){if(!(r.id in n)&&r.id in t){n[r.id]=!0;var o=t[r.id],s=o[1],a=o[2];for(var h in s){var c=s[h];i(c)}e(r,s,a)}}else if(v.isArray(r))for(var u=0,_=r;u<_.length;u++){var c=_[u];i(c)}else if(v.isObject(r))for(var p in r){var c=r[p];i(c)}}var n={};for(var r in t){var o=t[r],s=o[0];i(s)}}for(var o={},s=0,a=e;s<a.length;s++){var h=a[s],c=h.id,u=h.attributes,_=!(c in i),p=_?n[c]:i[c],d=t._resolve_refs(u,i,n);o[p.id]=[p,d,_]}r(o,function(t,e,i){i&&t.setv(e,{silent:!0})}),r(o,function(t,e,i){i&&t.finalize()})},t._event_for_attribute_change=function(t,e,i,n,r){var o=n.get_model_by_id(t.id);if(o.attribute_is_serializable(e)){var s={kind:"ModelChanged",model:{id:t.id,type:t.type},attr:e,new:i};return l.HasProps._json_record_references(n,i,r,!0),s}return null},t._events_to_sync_objects=function(e,i,n,r){for(var o=Object.keys(e.attributes),a=Object.keys(i.attributes),l=p.difference(o,a),h=p.difference(a,o),c=p.intersection(o,a),u=[],_=0,d=l;_<d.length;_++){var v=d[_];s.logger.warn("Server sent key "+v+" but we don't seem to have it in our JSON")}for(var m=0,g=h;m<g.length;m++){var v=g[m],y=i.attributes[v];u.push(t._event_for_attribute_change(e,v,y,n,r))}for(var b=0,x=c;b<x.length;b++){var v=x[b],w=e.attributes[v],y=i.attributes[v];null==w&&null==y||(null==w||null==y?u.push(t._event_for_attribute_change(e,v,y,n,r)):f.isEqual(w,y)||u.push(t._event_for_attribute_change(e,v,y,n,r)))}return u.filter(function(t){return null!=t})},t._compute_patch_since_json=function(e,i){function n(t){for(var e={},i=0,n=t.roots.references;i<n.length;i++){var r=n[i];e[r.id]=r}return e}for(var r=i.to_json(!1),o=n(e),s={},a=[],l=0,h=e.roots.root_ids;l<h.length;l++){var c=h[l];s[c]=o[c],a.push(c)}for(var u=n(r),_={},f=[],v=0,m=r.roots.root_ids;v<m.length;v++){var c=m[v];_[c]=u[c],f.push(c)}if(a.sort(),f.sort(),p.difference(a,f).length>0||p.difference(f,a).length>0)throw new Error("Not implemented: computing add/remove of document roots");var g={},y=[];for(var b in i._all_models)if(b in o){var x=t._events_to_sync_objects(o[b],u[b],i,g);y=y.concat(x)}return{references:t._references_json(d.values(g),!1),events:y}},t.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){void 0===e&&(e=!0);var i=this._roots.map(function(t){return t.id}),n=d.values(this._all_models);return{title:this._title,roots:{root_ids:i,references:t._references_json(n,e)}}},t.from_json_string=function(e){var i=JSON.parse(e);return t.from_json(i)},t.from_json=function(e){s.logger.debug("Creating Document from JSON");var i=e.version,n=-1!==i.indexOf("+")||-1!==i.indexOf("-"),r="Library versions: JS ("+o.version+") / Python ("+i+")";n||o.version===i?s.logger.debug(r):(s.logger.warn("JS/Python version mismatch"),s.logger.warn(r));var a=e.roots,l=a.root_ids,h=a.references,c=t._instantiate_references_json(h,{});t._initialize_references_json(h,{},c);for(var u=new t,_=0,p=l;_<p.length;_++){var d=p[_];u.add_root(c[d])}return u.set_title(e.title),u},t.prototype.replace_with_json=function(e){var i=t.from_json(e);i.destructively_move(this)},t.prototype.create_json_patch_string=function(t){return JSON.stringify(this.create_json_patch(t))},t.prototype.create_json_patch=function(e){for(var i={},n=[],r=0,o=e;r<o.length;r++){var a=o[r];if(a.document!==this)throw s.logger.warn("Cannot create a patch using events from a different document, event had ",a.document," we are ",this),new Error("Cannot create a patch using events from a different document");n.push(a.json(i))}return{events:n,references:t._references_json(d.values(i))}},t.prototype.apply_json_patch=function(e,i,n){for(var r=e.references,o=e.events,a=t._instantiate_references_json(r,this._all_models),l=0,h=o;l<h.length;l++){var c=h[l];switch(c.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":var _=c.model.id;if(_ in this._all_models)a[_]=this._all_models[_];else if(!(_ in a))throw s.logger.warn("Got an event for unknown model ",c.model),new Error("event model wasn't known")}}var p={},d={};for(var f in a){var v=a[f];f in this._all_models?p[f]=v:d[f]=v}t._initialize_references_json(r,p,d);for(var m=0,y=o;m<y.length;m++){var c=y[m];switch(c.kind){case"ModelChanged":var b=c.model.id;if(!(b in this._all_models))throw new Error("Cannot apply patch to "+b+" which is not in the document");var x=this._all_models[b],w=c.attr,k=c.model.type;if("data"===w&&"ColumnDataSource"===k){var S=u.decode_column_data(c.new,i),C=S[0],T=S[1];x.setv({_shapes:T,data:C},{setter_id:n})}else{var v=t._resolve_refs(c.new,p,d);x.setv((F={},F[w]=v,F),{setter_id:n})}break;case"ColumnDataChanged":var A=c.column_source.id;if(!(A in this._all_models))throw new Error("Cannot stream to "+A+" which is not in the document");var E=this._all_models[A],M=u.decode_column_data(c.new,i),C=M[0],T=M[1];if(null!=c.cols){for(var O in E.data)O in C||(C[O]=E.data[O]);for(var O in E._shapes)O in T||(T[O]=E._shapes[O])}E.setv({_shapes:T,data:C},{setter_id:n,check_eq:!1});break;case"ColumnsStreamed":var A=c.column_source.id;if(!(A in this._all_models))throw new Error("Cannot stream to "+A+" which is not in the document");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");var C=c.data,z=c.rollover;E.stream(C,z);break;case"ColumnsPatched":var A=c.column_source.id;if(!(A in this._all_models))throw new Error("Cannot patch "+A+" which is not in the document");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");var P=c.patches;E.patch(P);break;case"RootAdded":var j=c.model.id,N=a[j];this.add_root(N,n);break;case"RootRemoved":var j=c.model.id,N=a[j];this.remove_root(N,n);break;case"TitleChanged":this.set_title(c.title,n);break;default:throw new Error("Unknown patch event "+JSON.stringify(c))}}var F},t}();i.Document=T},function(t,e,i){function n(t,e){e.buffers.length>0?t.consume(e.buffers[0].buffer):t.consume(e.content.data);var i=t.message;null!=i&&this.apply_json_patch(i.content,i.buffers)}function r(t,e){if("undefined"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){d.logger.info("Registering Jupyter comms for target "+t);var r=Jupyter.notebook.kernel.comm_manager;try{r.register_target(t,function(i){d.logger.info("Registering Jupyter comms for target "+t);var r=new x.Receiver;i.on_msg(n.bind(e,r))})}catch(t){d.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+t+")")}}else if(e.roots()[0].id in i.kernels){d.logger.info("Registering JupyterLab comms for target "+t);var o=i.kernels[e.roots()[0].id];try{o.registerCommTarget(t,function(i){d.logger.info("Registering JupyterLab comms for target "+t);var r=new x.Receiver;i.onMsg=n.bind(e,r)})}catch(t){d.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+t+")")}}else console.warn("Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest jupyterlab_bokeh extension is installed. In an exported notebook this warning is expected.")}function o(t){var e=new t.default_view({model:t,parent:null});return p.index[t.id]=e,e}function s(t){var e=t.elementid,n=document.getElementById(e);if(null==n)throw new Error("Error rendering Bokeh model: could not find tag with id: "+e);if(!document.body.contains(n))throw new Error("Error rendering Bokeh model: element with id '"+e+"' must be under <body>");if("SCRIPT"==n.tagName){!function(t,e){var i=t.dataset,n=i.bokehLogLevel,r=i.bokehDocId,o=i.bokehModelId,s=i.bokehSessionId;null!=n&&n.length>0&&d.set_log_level(n);null!=r&&r.length>0&&(e.docid=r);null!=o&&o.length>0&&(e.modelid=o);null!=s&&s.length>0&&(e.sessionid=s);d.logger.info("Will inject Bokeh script tag with params "+JSON.stringify(e))}(n,t);var r=v.div({class:i.BOKEH_ROOT});v.replaceWith(n,r);var o=v.div();r.appendChild(o),n=o}return n}function a(t,e,i){var n=i.get_model_by_id(t);if(null==n)throw new Error("Model "+t+" was not in document "+i);var r=o(n);return r.renderTo(e,!0),r}function l(t,e,i){function n(t){var i=o(t);i.renderTo(e),r[t.id]=i}void 0===i&&(i=!1);for(var r={},s=0,a=t.roots();s<a.length;s++){var l=a[s];n(l)}return i&&(window.document.title=t.title()),t.on_change(function(t){t instanceof f.RootAddedEvent?n(t.model):t instanceof f.RootRemovedEvent?function(t){if(t.id in r){var i=r[t.id];e.removeChild(i.el),delete r[t.id],delete p.index[t.id]}}(t.model):i&&t instanceof f.TitleChangedEvent&&(window.document.title=t.title)}),r}function h(t,e,i){t in k||(k[t]={});var n=k[t];return e in n||(n[e]=w.pull_session(t,e,i)),n[e]}function c(t,e,i,n){var r=window.location.search.substr(1),o=h(e,i,r);return o.then(function(e){return l(e.document,t,n)},function(t){throw d.logger.error("Failed to load Bokeh session "+i+": "+t),t})}function u(t,e,i,n){var r=window.location.search.substr(1),s=h(e,n,r);return s.then(function(e){var n=e.document.get_model_by_id(i);if(null==n)throw new Error("Did not find model "+i+" in session");var r=o(n);return r.renderTo(t,!0),r},function(t){throw d.logger.error("Failed to load Bokeh session "+n+": "+t),t})}function _(t,e){var i="ws:";"https:"==window.location.protocol&&(i="wss:");var n;return null!=e?(n=document.createElement("a")).href=e:n=window.location,null!=t?"/"==t&&(t=""):t=n.pathname.replace(/\/+$/,""),i+"//"+n.host+t+"/ws"}var p=t(0),d=t(14),f=t(50),v=t(5),m=t(25),g=t(38),y=t(32),b=t(44),x=t(261),w=t(1);i.kernels={},i.BOKEH_ROOT="bk-root",i.add_model_standalone=a,i.add_document_standalone=l;var k={};i.add_document_from_session=c,i.add_model_from_session=u,i.inject_css=function(t){var e=v.link({href:t,rel:"stylesheet",type:"text/css"});document.body.appendChild(e)},i.inject_raw_css=function(t){var e=v.style({},t);document.body.appendChild(e)},i.embed_items_notebook=function(t,e){if(1!=y.size(t))throw new Error("embed_items_notebook expects exactly one document in docs_json");for(var i=f.Document.from_json(y.values(t)[0]),n=0,o=e;n<o.length;n++){var h=o[n];null!=h.notebook_comms_target&&r(h.notebook_comms_target,i);var c=s(h);null!=h.modelid?a(h.modelid,c,i):l(i,c,!1)}},i.embed_items=function(t,e,i,n){m.defer(function(){return function(t,e,i,n){b.isString(t)&&(t=JSON.parse(g.unescape(t)));var r={};for(var o in t){var h=t[o];r[o]=f.Document.from_json(h)}for(var p=0,v=e;p<v.length;p++){var m=v[p],y=s(m),x=null!=m.use_for_title&&m.use_for_title;if(null!=m.sessionid){var w=_(i,n);d.logger.debug("embed: computed ws url: "+w);(null!=m.modelid?u(y,w,m.modelid,m.sessionid):c(y,w,m.sessionid,x)).then(function(){console.log("Bokeh items were rendered successfully")},function(t){console.log("Error rendering Bokeh items ",t)})}else{if(null==m.docid)throw new Error("Error rendering Bokeh items to element "+m.elementid+": no document ID or session ID specified");null!=m.modelid?a(m.modelid,y,r[m.docid]):l(r[m.docid],y,x)}}}(t,e,i,n)})}},function(t,e,i){t(258);var n=t(263);i.version=n.version;var r=t(51);i.embed=r;var o=t(259);i.protocol=o;var s=t(14);i.logger=s.logger,i.set_log_level=s.set_log_level;var a=t(18);i.settings=a.settings;var l=t(0);i.Models=l.Models,i.index=l.index;var h=t(50);i.documents=h.documents;var c=t(262);i.safely=c.safely},function(t,e,i){var n=t(379),r=t(8),o=t(15),s=t(44),a=t(32),l=t(14),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Model",this.define({tags:[o.Array,[]],name:[o.String],js_property_callbacks:[o.Any,{}],js_event_callbacks:[o.Any,{}],subscribed_events:[o.Array,[]]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this);for(var i in this.js_property_callbacks)for(var n=this.js_property_callbacks[i],r=i.split(":"),o=r[0],s=r[1],a=void 0===s?null:s,l=function(t){var i=null!=a?h.properties[a][o]:h[o];h.connect(i,function(){return t.execute(e,{})})},h=this,c=0,u=n;c<u.length;c++){var _=u[c];l(_)}this.connect(this.properties.js_event_callbacks.change,function(){return e._update_event_callbacks}),this.connect(this.properties.subscribed_events.change,function(){return e._update_event_callbacks})},e.prototype._process_event=function(t){if(t.is_applicable_to(this)){t=t._customize_event(this);for(var e=0,i=this.js_event_callbacks[t.event_name]||[];e<i.length;e++){var n=i[e];n.execute(t,{})}null!=this.document&&this.subscribed_events.some(function(e){return e==t.event_name})&&this.document.event_manager.send_event(t)}},e.prototype.trigger_event=function(t){null!=this.document&&this.document.event_manager.trigger(t.set_model_id(this.id))},e.prototype._update_event_callbacks=function(){null!=this.document?this.document.event_manager.subscribed_models.push(this.id):l.logger.warn("WARNING: Document not defined for updating event callbacks")},e.prototype._doc_attached=function(){a.isEmpty(this.js_event_callbacks)&&a.isEmpty(this.subscribed_events)||this._update_event_callbacks()},e.prototype.select=function(t){if(s.isString(t))return this.references().filter(function(i){return i instanceof e&&i.name===t});if(t.prototype instanceof r.HasProps)return this.references().filter(function(e){return e instanceof t});throw new Error("invalid selector")},e.prototype.select_one=function(t){var e=this.select(t);switch(e.length){case 0:return null;case 1:return e[0];default:throw new Error("found more than one object matching given selector")}},e}(r.HasProps);i.Model=h,h.initClass()},function(t,e,i){var n=t(379),r=t(12),o=t(15),s=t(33),a=t(32),l=t(173),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._get_size=function(){throw new Error("not implemented")},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype.set_data=function(t){var e=this.model.materialize_dataspecs(t);if(a.extend(this,e),this.plot_model.use_map){null!=this._x&&(i=s.project_xy(this._x,this._y),this._x=i[0],this._y=i[1]),null!=this._xs&&(n=s.project_xsys(this._xs,this._ys),this._xs=n[0],this._ys=n[1])}var i,n},e}(l.RendererView);i.AnnotationView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Annotation",this.define({plot:[o.Instance]}),this.override({level:"annotation"})},e.prototype.add_panel=function(t){if(null==this.panel||t!==this.panel.side){var e=new r.SidePanel({side:t});e.attach_document(this.document),this.set_panel(e)}},e.prototype.set_panel=function(t){this.panel=t,this.level="overlay"},e}(l.Renderer);i.Annotation=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(56),s=t(184),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),null==this.model.source&&(this.model.source=new s.ColumnDataSource),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,i=this.plot_view.frame;"data"==this.model.start_units?(t=i.xscales[this.model.x_range_name].v_compute(this._x_start),e=i.yscales[this.model.y_range_name].v_compute(this._y_start)):(t=i.xview.v_compute(this._x_start),e=i.yview.v_compute(this._y_start));var n,r;return"data"==this.model.end_units?(n=i.xscales[this.model.x_range_name].v_compute(this._x_end),r=i.yscales[this.model.y_range_name].v_compute(this._y_end)):(n=i.xview.v_compute(this._x_end),r=i.yview.v_compute(this._y_end)),[[t,e],[n,r]]},e.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save();var e=this._map_data(),i=e[0],n=e[1];null!=this.model.end&&this._arrow_head(t,"render",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,"render",this.model.start,n,i),t.beginPath();var r=this.plot_model.canvas.bbox.rect,o=r.x,s=r.y,a=r.width,l=r.height;t.rect(o,s,a,l),null!=this.model.end&&this._arrow_head(t,"clip",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,"clip",this.model.start,n,i),t.closePath(),t.clip(),this._arrow_body(t,i,n),t.restore()}},e.prototype._arrow_head=function(t,e,i,n,r){for(var o=0,s=this._x_start.length;o<s;o++){var a=Math.PI/2+l.atan2([n[0][o],n[1][o]],[r[0][o],r[1][o]]);t.save(),t.translate(r[0][o],r[1][o]),t.rotate(a),"render"==e?i.render(t,o):"clip"==e&&i.clip(t,o),t.restore()}},e.prototype._arrow_body=function(t,e,i){if(this.visuals.line.doit)for(var n=0,r=this._x_start.length;n<r;n++)this.visuals.line.set_vectorize(t,n),t.beginPath(),t.moveTo(e[0][n],e[1][n]),t.lineTo(i[0][n],i[1][n]),t.stroke()},e}(r.AnnotationView);i.ArrowView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Arrow",this.prototype.default_view=h,this.mixins(["line"]),this.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,"data"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,"data"],end:[a.Instance,function(){return new o.OpenHead({})}],source:[a.Instance],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]})},e}(r.Annotation);i.Arrow=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(49),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ArrowHead",this.define({size:[s.Number,25]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.visuals=new o.Visuals(this)},e}(r.Annotation);i.ArrowHead=a,a.initClass();var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="OpenHead",this.mixins(["line"])},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke())},e}(a);i.OpenHead=l,l.initClass();var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="NormalHead",this.mixins(["line","fill"]),this.override({fill_color:"black"})},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke())},e.prototype._normal=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);i.NormalHead=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="VeeHead",this.mixins(["line","fill"]),this.override({fill_color:"black"})},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke())},e.prototype._vee=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},e}(a);i.VeeHead=c,c.initClass();var u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TeeHead",this.mixins(["line"])},e.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke())},e.prototype.clip=function(t,e){},e}(a);i.TeeHead=u,u.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(184),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e=this.plot_view.frame,i=this.model.dimension,n=e.xscales[this.model.x_range_name],r=e.yscales[this.model.y_range_name],o="height"==i?r:n,s="height"==i?n:r,a="height"==i?e.yview:e.xview,l="height"==i?e.xview:e.yview;t="data"==this.model.lower.units?o.v_compute(this._lower):a.v_compute(this._lower);var h;h="data"==this.model.upper.units?o.v_compute(this._upper):a.v_compute(this._upper);var c;c="data"==this.model.base.units?s.v_compute(this._base):l.v_compute(this._base);var u="height"==i?[1,0]:[0,1],_=u[0],p=u[1],d=[t,c],f=[h,c];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},e.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(var n=this._upper_sx.length-1,e=n;e>=0;e--)t.lineTo(this._upper_sx[e],this._upper_sy[e]);t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]);for(var e=0,i=this._upper_sx.length;e<i;e++)t.lineTo(this._upper_sx[e],this._upper_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke())}},e}(r.AnnotationView);i.BandView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Band",this.prototype.default_view=a,this.mixins(["line","fill"]),this.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,"height"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),this.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},e}(r.Annotation);i.Band=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(19),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add("bk-shading"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),"css"==this.model.render_mode?(this.connect(this.model.change,function(){return e.render()}),this.connect(this.model.data_update,function(){return e.render()})):(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()}))},e.prototype.render=function(){var t=this;if(this.model.visible||"css"!=this.model.render_mode||s.hide(this.el),this.model.visible)if(null!=this.model.left||null!=this.model.right||null!=this.model.top||null!=this.model.bottom){var e=this.plot_model.frame,i=e.xscales[this.model.x_range_name],n=e.yscales[this.model.y_range_name],r=function(e,i,n,r,o){return null!=e?t.model.screen?e:"data"==i?n.compute(e):r.compute(e):o},o=r(this.model.left,this.model.left_units,i,e.xview,e._left.value),a=r(this.model.right,this.model.right_units,i,e.xview,e._right.value),l=r(this.model.top,this.model.top_units,n,e.yview,e._top.value),h=r(this.model.bottom,this.model.bottom_units,n,e.yview,e._bottom.value),c="css"==this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this);c(o,a,h,l)}else s.hide(this.el)},e.prototype._css_box=function(t,e,i,n){var r=Math.abs(e-t),o=Math.abs(i-n);this.el.style.left=t+"px",this.el.style.width=r+"px",this.el.style.top=n+"px",this.el.style.height=o+"px",this.el.style.borderWidth=this.model.properties.line_width.value()+"px",this.el.style.borderColor=this.model.properties.line_color.value(),this.el.style.backgroundColor=this.model.properties.fill_color.value(),this.el.style.opacity=this.model.properties.fill_alpha.value();var a=this.model.properties.line_dash.value().length<2?"solid":"dashed";this.el.style.borderStyle=a,s.show(this.el)},e.prototype._canvas_box=function(t,e,i,n){var r=this.plot_view.canvas_view.ctx;r.save(),r.beginPath(),r.rect(t,n,e-t,i-n),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);i.BoxAnnotationView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BoxAnnotation",this.prototype.default_view=l,this.mixins(["line","fill"]),this.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],top:[a.Number,null],top_units:[a.SpatialUnits,"data"],bottom:[a.Number,null],bottom_units:[a.SpatialUnits,"data"],left:[a.Number,null],left_units:[a.SpatialUnits,"data"],right:[a.Number,null],right_units:[a.SpatialUnits,"data"]}),this.internal({screen:[a.Boolean,!1]}),this.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.data_update=new o.Signal0(this,"data_update")},e.prototype.update=function(t){var e=t.left,i=t.right,n=t.top,r=t.bottom;this.setv({left:e,right:i,top:n,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);i.BoxAnnotation=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(191),s=t(96),a=t(154),l=t(176),h=t(177),c=t(168),u=t(15),_=t(41),p=t(21),d=t(22),f=t(32),v=t(44),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return e.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return e.plot_view.request_render()}),null!=this.model.color_mapper&&this.connect(this.model.color_mapper.change,function(){e._set_canvas_image(),e.plot_view.request_render()})},e.prototype._get_size=function(){if(null==this.model.color_mapper)return 0;var t=this.compute_legend_dimensions(),e=this.model.panel.side;switch(e){case"above":case"below":return t.height;case"left":case"right":return t.width;default:throw new Error("unreachable code")}},e.prototype._set_canvas_image=function(){if(null!=this.model.color_mapper){var t=this.model.color_mapper.palette;"vertical"==this.model.orientation&&(t=p.reversed(t));var e,i;switch(this.model.orientation){case"vertical":h=[1,t.length],e=h[0],i=h[1];break;case"horizontal":c=[t.length,1],e=c[0],i=c[1];break;default:throw new Error("unreachable code")}var n=document.createElement("canvas");n.width=e,n.height=i;var r=n.getContext("2d"),o=r.getImageData(0,0,e,i),s=new a.LinearColorMapper({palette:t}).rgba_mapper,l=s.v_compute(p.range(0,t.length));o.data.set(l),r.putImageData(o,0,0),this.image=n;var h,c}},e.prototype.compute_legend_dimensions=function(){var t,e,i=this.model._computed_image_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this._get_label_extent(),a=this.model._title_extent(),l=this.model._tick_extent(),h=this.model.padding;switch(this.model.orientation){case"vertical":t=r+a+2*h,e=o+l+s+2*h;break;case"horizontal":t=r+a+l+s+2*h,e=o+2*h;break;default:throw new Error("unreachable code")}return{width:e,height:t}},e.prototype.compute_legend_location=function(){var t,e,i=this.compute_legend_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this.model.margin,a=null!=this.model.panel?this.model.panel:this.plot_view.frame,l=a.bbox.ranges,h=l[0],c=l[1],u=this.model.location;if(v.isString(u))switch(u){case"top_left":t=h.start+s,e=c.start+s;break;case"top_center":t=(h.end+h.start)/2-o/2,e=c.start+s;break;case"top_right":t=h.end-s-o,e=c.start+s;break;case"bottom_right":t=h.end-s-o,e=c.end-s-r;break;case"bottom_center":t=(h.end+h.start)/2-o/2,e=c.end-s-r;break;case"bottom_left":t=h.start+s,e=c.end-s-r;break;case"center_left":t=h.start+s,e=(c.end+c.start)/2-r/2;break;case"center":t=(h.end+h.start)/2-o/2,e=(c.end+c.start)/2-r/2;break;case"center_right":t=h.end-s-o,e=(c.end+c.start)/2-r/2;break;default:throw new Error("unreachable code")}else{if(!v.isArray(u)||2!=u.length)throw new Error("unreachable code");var _=u[0],p=u[1];t=a.xview.compute(_),e=a.yview.compute(p)-r}return{sx:t,sy:e}},e.prototype.render=function(){if(this.model.visible&&null!=this.model.color_mapper){var t=this.plot_view.canvas_view.ctx;t.save();var e=this.compute_legend_location(),i=e.sx,n=e.sy;t.translate(i,n),this._draw_bbox(t);var r=this._get_image_offset();if(t.translate(r.x,r.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high){var o=this.model.tick_info();this._draw_major_ticks(t,o),this._draw_minor_ticks(t,o),this._draw_major_labels(t,o)}this.model.title&&this._draw_title(t),t.restore()}},e.prototype._draw_bbox=function(t){var e=this.compute_legend_dimensions();t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_image=function(t){var e=this.model._computed_image_dimensions();t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_major_ticks=function(t,e){if(this.visuals.major_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.major,c=h[0],u=h[1],_=this.model.major_tick_in,p=this.model.major_tick_out;t.save(),t.translate(a,l),this.visuals.major_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},e.prototype._draw_minor_ticks=function(t,e){if(this.visuals.minor_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.minor,c=h[0],u=h[1],_=this.model.minor_tick_in,p=this.model.minor_tick_out;t.save(),t.translate(a,l),this.visuals.minor_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},e.prototype._draw_major_labels=function(t,e){if(this.visuals.major_label_text.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=this.model.label_standoff+this.model._tick_extent(),c=[h*n,h*r],u=c[0],_=c[1],p=e.coords.major,d=p[0],f=p[1],v=e.labels.major;this.visuals.major_label_text.set_value(t),t.save(),t.translate(a+u,l+_);for(var m=0,g=d.length;m<g;m++)t.fillText(v[m],Math.round(d[m]+n*this.model.label_standoff),Math.round(f[m]+r*this.model.label_standoff));t.restore()}},e.prototype._draw_title=function(t){this.visuals.title_text.doit&&(t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore())},e.prototype._get_label_extent=function(){var t,e=this.model.tick_info().labels.major;if(null==this.model.color_mapper.low||null==this.model.color_mapper.high||f.isEmpty(e))t=0;else{var i=this.plot_view.canvas_view.ctx;switch(i.save(),this.visuals.major_label_text.set_value(i),this.model.orientation){case"vertical":t=p.max(e.map(function(t){return i.measureText(t.toString()).width}));break;case"horizontal":t=_.get_text_height(this.visuals.major_label_text.font_value()).height;break;default:throw new Error("unreachable code")}t+=this.model.label_standoff,i.restore()}return t},e.prototype._get_image_offset=function(){var t=this.model.padding,e=this.model.padding+this.model._title_extent();return{x:t,y:e}},e}(r.AnnotationView);i.ColorBarView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ColorBar",this.prototype.default_view=m,this.mixins(["text:major_label_","text:title_","line:major_tick_","line:minor_tick_","line:border_","line:bar_","fill:background_"]),this.define({location:[u.Any,"top_right"],orientation:[u.Orientation,"vertical"],title:[u.String],title_standoff:[u.Number,2],width:[u.Any,"auto"],height:[u.Any,"auto"],scale_alpha:[u.Number,1],ticker:[u.Instance,function(){return new o.BasicTicker}],formatter:[u.Instance,function(){return new s.BasicTickFormatter}],major_label_overrides:[u.Any,{}],color_mapper:[u.Instance],label_standoff:[u.Number,5],margin:[u.Number,30],padding:[u.Number,10],major_tick_in:[u.Number,5],major_tick_out:[u.Number,0],minor_tick_in:[u.Number,0],minor_tick_out:[u.Number,0]}),this.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_align:"center",major_label_text_baseline:"middle",major_label_text_font_size:"8pt",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"10pt",title_text_font_style:"italic"})},e.prototype._normals=function(){return"vertical"==this.orientation?[1,0]:[0,1]},e.prototype._title_extent=function(){var t=this.title_text_font+" "+this.title_text_font_size+" "+this.title_text_font_style,e=this.title?_.get_text_height(t).height+this.title_standoff:0;return e},e.prototype._tick_extent=function(){return null!=this.color_mapper.low&&null!=this.color_mapper.high?p.max([this.major_tick_out,this.minor_tick_out]):0},e.prototype._computed_image_dimensions=function(){var t,e,i=this.plot.plot_canvas.frame._height.value,n=this.plot.plot_canvas.frame._width.value,r=this._title_extent();switch(this.orientation){case"vertical":"auto"==this.height?null!=this.panel?t=i-2*this.padding-r:(t=p.max([25*this.color_mapper.palette.length,.3*i]),t=p.min([t,.8*i-2*this.padding-r])):t=this.height,e="auto"==this.width?25:this.width;break;case"horizontal":t="auto"==this.height?25:this.height,"auto"==this.width?null!=this.panel?e=n-2*this.padding:(e=p.max([25*this.color_mapper.palette.length,.3*n]),e=p.min([e,.8*n-2*this.padding])):e=this.width;break;default:throw new Error("unreachable code")}return{width:e,height:t}},e.prototype._tick_coordinate_scale=function(t){var e={source_range:new c.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new c.Range1d({start:0,end:t})};switch(this.color_mapper.type){case"LinearColorMapper":return new l.LinearScale(e);case"LogColorMapper":return new h.LogScale(e);default:throw new Error("unreachable code")}},e.prototype._format_major_labels=function(t,e){for(var i=this.formatter.doFormat(t,null),n=0,r=e.length;n<r;n++)e[n]in this.major_label_overrides&&(i[n]=this.major_label_overrides[e[n]]);return i},e.prototype.tick_info=function(){var t,e=this._computed_image_dimensions();switch(this.orientation){case"vertical":t=e.height;break;case"horizontal":t=e.width;break;default:throw new Error("unreachable code")}for(var i=this._tick_coordinate_scale(t),n=this._normals(),r=n[0],o=n[1],s=[this.color_mapper.low,this.color_mapper.high],a=s[0],l=s[1],h=this.ticker.get_ticks(a,l,null,null,this.ticker.desired_num_ticks),c=h.major,u=h.minor,_=[[],[]],p=[[],[]],f=0,v=c.length;f<v;f++)c[f]<a||c[f]>l||(_[r].push(c[f]),_[o].push(0));for(var f=0,v=u.length;f<v;f++)u[f]<a||u[f]>l||(p[r].push(u[f]),p[o].push(0));var m={major:this._format_major_labels(_[r],c)},g={major:[[],[]],minor:[[],[]]};return g.major[r]=i.v_compute(_[r]),g.minor[r]=i.v_compute(p[r]),g.major[o]=_[o],g.minor[o]=p[o],"vertical"==this.orientation&&(g.major[r]=d.map(g.major[r],function(e){return t-e}),g.minor[r]=d.map(g.minor[r],function(e){return t-e})),{coords:g,labels:m}},e}(r.Annotation);i.ColorBar=g,g.initClass()},function(t,e,i){var n=t(54);i.Annotation=n.Annotation;var r=t(55);i.Arrow=r.Arrow;var o=t(56);i.ArrowHead=o.ArrowHead;var s=t(56);i.OpenHead=s.OpenHead;var a=t(56);i.NormalHead=a.NormalHead;var l=t(56);i.TeeHead=l.TeeHead;var h=t(56);i.VeeHead=h.VeeHead;var c=t(57);i.Band=c.Band;var u=t(58);i.BoxAnnotation=u.BoxAnnotation;var _=t(59);i.ColorBar=_.ColorBar;var p=t(61);i.Label=p.Label;var d=t(62);i.LabelSet=d.LabelSet;var f=t(63);i.Legend=f.Legend;var v=t(64);i.LegendItem=v.LegendItem;var m=t(65);i.PolyAnnotation=m.PolyAnnotation;var g=t(66);i.Span=g.Span;var y=t(67);i.TextAnnotation=y.TextAnnotation;var b=t(68);i.Title=b.Title;var x=t(69);i.ToolbarPanel=x.ToolbarPanel;var w=t(70);i.Tooltip=w.Tooltip;var k=t(71);i.Whisker=k.Whisker},function(t,e,i){var n=t(379),r=t(67),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.visuals.warm_cache()},e.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;if(this.visuals.text.set_value(t),this.model.panel.is_horizontal){var e=t.measureText(this.model.text).ascent;return e}var i=t.measureText(this.model.text).width;return i},e.prototype.render=function(){if(this.model.visible||"css"!=this.model.render_mode||o.hide(this.el),this.model.visible){var t;switch(this.model.angle_units){case"rad":t=-this.model.angle;break;case"deg":t=-this.model.angle*Math.PI/180;break;default:throw new Error("unreachable code")}var e=null!=this.model.panel?this.model.panel:this.plot_view.frame,i=this.plot_view.frame.xscales[this.model.x_range_name],n=this.plot_view.frame.yscales[this.model.y_range_name],r="data"==this.model.x_units?i.compute(this.model.x):e.xview.compute(this.model.x),s="data"==this.model.y_units?n.compute(this.model.y):e.yview.compute(this.model.y);r+=this.model.x_offset,s-=this.model.y_offset;var a="canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);a(this.plot_view.canvas_view.ctx,this.model.text,r,s,t)}},e}(r.TextAnnotationView);i.LabelView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Label",this.prototype.default_view=a,this.mixins(["text","line:border_","fill:background_"]),this.define({x:[s.Number],x_units:[s.SpatialUnits,"data"],y:[s.Number],y_units:[s.SpatialUnits,"data"],text:[s.String],angle:[s.Angle,0],angle_units:[s.AngleUnits,"rad"],x_offset:[s.Number,0],y_offset:[s.Number,0],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),this.override({background_fill_color:null,border_line_color:null})},e}(r.TextAnnotation);i.Label=l,l.initClass()},function(t,e,i){var n=t(379),r=t(67),o=t(184),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),this.set_data(this.model.source),"css"==this.model.render_mode)for(var i=0,n=this._text.length;i<n;i++){var r=s.div({class:"bk-annotation-child",style:{display:"none"}});this.el.appendChild(r)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),"css"==this.model.render_mode?(this.connect(this.model.change,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.streaming,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.patching,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.change,function(){e.set_data(e.model.source),e.render()})):(this.connect(this.model.change,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.patching,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.change,function(){e.set_data(e.model.source),e.plot_view.request_render()}))},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t=this.plot_view.frame.xscales[this.model.x_range_name],e=this.plot_view.frame.yscales[this.model.y_range_name],i=null!=this.model.panel?this.model.panel:this.plot_view.frame,n="data"==this.model.x_units?t.v_compute(this._x):i.xview.v_compute(this._x),r="data"==this.model.y_units?e.v_compute(this._y):i.yview.v_compute(this._y);return[n,r]},e.prototype.render=function(){if(this.model.visible||"css"!=this.model.render_mode||s.hide(this.el),this.model.visible)for(var t="canvas"==this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),e=this.plot_view.canvas_view.ctx,i=this._map_data(),n=i[0],r=i[1],o=0,a=this._text.length;o<a;o++)t(e,o,this._text[o],n[o]+this._x_offset[o],r[o]-this._y_offset[o],this._angle[o])},e.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;switch(this.visuals.text.set_value(t),this.model.panel.side){case"above":case"below":var e=t.measureText(this._text[0]).ascent;return e;case"left":case"right":var i=t.measureText(this._text[0]).width;return i;default:throw new Error("unreachable code")}},e.prototype._v_canvas_text=function(t,e,i,n,r,o){this.visuals.text.set_vectorize(t,e);var s=this._calculate_bounding_box_dimensions(t,i);t.save(),t.beginPath(),t.translate(n,r),t.rotate(o),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(i,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,i,n,r,o){var a=this.el.children[e];a.textContent=i,this.visuals.text.set_vectorize(t,e);var l=this._calculate_bounding_box_dimensions(t,i),h=this.visuals.border_line.line_dash.value(),c=h.length<2?"solid":"dashed";this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),a.style.position="absolute",a.style.left=n+l[0]+"px",a.style.top=r+l[1]+"px",a.style.color=""+this.visuals.text.text_color.value(),a.style.opacity=""+this.visuals.text.text_alpha.value(),a.style.font=""+this.visuals.text.font_value(),a.style.lineHeight="normal",o&&(a.style.transform="rotate("+o+"rad)"),this.visuals.background_fill.doit&&(a.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(a.style.borderStyle=""+c,a.style.borderWidth=this.visuals.border_line.line_width.value()+"px",a.style.borderColor=""+this.visuals.border_line.color_value()),s.show(a)},e}(r.TextAnnotationView);i.LabelSetView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LabelSet",this.prototype.default_view=l,this.mixins(["text","line:border_","fill:background_"]),this.define({x:[a.NumberSpec],y:[a.NumberSpec],x_units:[a.SpatialUnits,"data"],y_units:[a.SpatialUnits,"data"],text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,{value:0}],y_offset:[a.NumberSpec,{value:0}],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),this.override({background_fill_color:null,border_line_color:null})},e}(r.TextAnnotation);i.LabelSet=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(15),s=t(41),a=t(24),l=t(21),h=t(32),c=t(44),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"cursor",{get:function(){return"none"==this.model.click_policy?null:"pointer"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"legend_padding",{get:function(){return null!=this.visuals.border_line.line_color.value()?this.model.padding:0},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()})},e.prototype.compute_legend_bbox=function(){var t=this.model.get_legend_names(),e=this.model,i=e.glyph_height,n=e.glyph_width,r=this.model,o=r.label_height,a=r.label_width;this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,i]);var u=this.plot_view.canvas_view.ctx;u.save(),this.visuals.label_text.set_value(u),this.text_widths={};for(var _=0,p=t;_<p.length;_++){var d=p[_];this.text_widths[d]=l.max([u.measureText(d).width,a])}u.restore();var f,v,m=Math.max(l.max(h.values(this.text_widths)),0),g=this.model.margin,y=this.legend_padding,b=this.model.spacing,x=this.model.label_standoff;if("vertical"==this.model.orientation)f=t.length*this.max_label_height+Math.max(t.length-1,0)*b+2*y,v=m+n+x+2*y;else{v=2*y+Math.max(t.length-1,0)*b;for(var w in this.text_widths){var k=this.text_widths[w];v+=l.max([k,a])+n+x}f=this.max_label_height+2*y}var S,C,T=null!=this.model.panel?this.model.panel:this.plot_view.frame,A=T.bbox.ranges,E=A[0],M=A[1],O=this.model.location;if(c.isString(O))switch(O){case"top_left":S=E.start+g,C=M.start+g;break;case"top_center":S=(E.end+E.start)/2-v/2,C=M.start+g;break;case"top_right":S=E.end-g-v,C=M.start+g;break;case"bottom_right":S=E.end-g-v,C=M.end-g-f;break;case"bottom_center":S=(E.end+E.start)/2-v/2,C=M.end-g-f;break;case"bottom_left":S=E.start+g,C=M.end-g-f;break;case"center_left":S=E.start+g,C=(M.end+M.start)/2-f/2;break;case"center":S=(E.end+E.start)/2-v/2,C=(M.end+M.start)/2-f/2;break;case"center_right":S=E.end-g-v,C=(M.end+M.start)/2-f/2;break;default:throw new Error("unreachable code")}else{if(!c.isArray(O)||2!=O.length)throw new Error("unreachable code");var z=O[0],P=O[1];S=T.xview.compute(z),C=T.yview.compute(P)-f}return{x:S,y:C,width:v,height:f}},e.prototype.bbox=function(){var t=this.compute_legend_bbox(),e=t.x,i=t.y,n=t.width,r=t.height;return new a.BBox({x:e,y:i,width:n,height:r})},e.prototype.on_hit=function(t,e){for(var i,n=this.model.glyph_width,r=this.legend_padding,o=this.model.spacing,s=this.model.label_standoff,l=i=r,h=this.compute_legend_bbox(),c="vertical"==this.model.orientation,u=0,_=this.model.items;u<_.length;u++)for(var p=_[u],d=p.get_labels_list_from_label_prop(),f=0,v=d;f<v.length;f++){var m=v[f],g=h.x+l,y=h.y+i,b=void 0,x=void 0;c?(E=[h.width-2*r,this.max_label_height],b=E[0],x=E[1]):(M=[this.text_widths[m]+n+s,this.max_label_height],b=M[0],x=M[1]);var w=new a.BBox({x:g,y:y,width:b,height:x});if(w.contains(t,e)){switch(this.model.click_policy){case"hide":for(var k=0,S=p.renderers;k<S.length;k++){var C=S[k];C.visible=!C.visible}break;case"mute":for(var T=0,A=p.renderers;T<A.length;T++){var C=A[T];C.muted=!C.muted}}return!0}c?i+=this.max_label_height+o:l+=this.text_widths[m]+n+s+o}return!1;var E,M},e.prototype.render=function(){if(this.model.visible&&0!=this.model.items.length){var t=this.plot_view.canvas_view.ctx,e=this.compute_legend_bbox();t.save(),this._draw_legend_box(t,e),this._draw_legend_items(t,e),t.restore()}},e.prototype._draw_legend_box=function(t,e){t.beginPath(),t.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(t),t.fill(),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke())},e.prototype._draw_legend_items=function(t,e){for(var i=this,n=this.model,r=n.glyph_width,o=n.glyph_height,s=this.legend_padding,a=this.model.spacing,h=this.model.label_standoff,c=s,u=s,_="vertical"==this.model.orientation,p=function(n){var p=n.get_labels_list_from_label_prop(),f=n.get_field_from_label_prop();if(0==p.length)return"continue";for(var v=function(){switch(i.model.click_policy){case"none":return!0;case"hide":return l.all(n.renderers,function(t){return t.visible});case"mute":return l.all(n.renderers,function(t){return!t.muted})}}(),m=0,g=p;m<g.length;m++){var y=g[m],b=e.x+c,x=e.y+u,w=b+r,k=x+o;_?u+=d.max_label_height+a:c+=d.text_widths[y]+r+h+a,d.visuals.label_text.set_value(t),t.fillText(y,w+h,x+d.max_label_height/2);for(var S=0,C=n.renderers;S<C.length;S++){var T=C[S],A=d.plot_view.renderer_views[T.id];A.draw_legend(t,b,w,x,k,f,y)}if(!v){var E=void 0,M=void 0;_?(O=[e.width-2*s,d.max_label_height],E=O[0],M=O[1]):(z=[d.text_widths[y]+r+h,d.max_label_height],E=z[0],M=z[1]),t.beginPath(),t.rect(b,x,E,M),d.visuals.inactive_fill.set_value(t),t.fill()}}var O,z},d=this,f=0,v=this.model.items;f<v.length;f++){var m=v[f];p(m)}},e.prototype._get_size=function(){var t=this.compute_legend_bbox();switch(this.model.panel.side){case"above":case"below":return t.height+2*this.model.margin;case"left":case"right":return t.width+2*this.model.margin}},e}(r.AnnotationView);i.LegendView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Legend",this.prototype.default_view=u,this.mixins(["text:label_","fill:inactive_","line:border_","fill:background_"]),this.define({orientation:[o.Orientation,"vertical"],location:[o.Any,"top_right"],label_standoff:[o.Number,5],glyph_height:[o.Number,20],glyph_width:[o.Number,20],label_height:[o.Number,20],label_width:[o.Number,20],margin:[o.Number,10],padding:[o.Number,10],spacing:[o.Number,3],items:[o.Array,[]],click_policy:[o.Any,"none"]}),this.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,inactive_fill_color:"white",inactive_fill_alpha:.7,label_text_font_size:"10pt",label_text_baseline:"middle"})},e.prototype.get_legend_names=function(){for(var t=[],e=0,i=this.items;e<i.length;e++){var n=i[e],r=n.get_labels_list_from_label_prop();t.push.apply(t,r)}return t},e}(r.Annotation);i.Legend=_,_.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(185),s=t(47),a=t(15),l=t(14),h=t(21),c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LegendItem",this.define({label:[a.StringSpec,null],renderers:[a.Array,[]]})},e.prototype._check_data_sources_on_renderers=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e)for(var i=0,n=this.renderers;i<n.length;i++){var r=n[i];if(r.data_source!=e)return!1}}return!0},e.prototype._check_field_label_on_data_source=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e&&!h.includes(e.columns(),t))return!1}return!0},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this._check_data_sources_on_renderers();e||l.logger.error("Non matching data sources on legend item renderers");var i=this._check_field_label_on_data_source();i||l.logger.error("Bad column name on label: "+this.label)},e.prototype.get_field_from_label_prop=function(){var t=this.label;return s.isField(t)?t.field:null},e.prototype.get_labels_list_from_label_prop=function(){if(s.isValue(this.label))return[this.label.value];var t=this.get_field_from_label_prop();if(null!=t){var e=void 0;if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if((e=this.renderers[0].data_source)instanceof o.ColumnarDataSource){var i=e.get_column(t);return null!=i?h.uniq(Array.from(i)):["Invalid field"]}}return[]},e}(r.Model);i.LegendItem=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(19),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()})},e.prototype.render=function(){if(this.model.visible){var t=this.model,e=t.xs,i=t.ys;if(e.length==i.length&&!(e.length<3||i.length<3)){for(var n=this.plot_view.frame,r=this.plot_view.canvas_view.ctx,o=0,s=e.length;o<s;o++){var a=void 0;if("screen"!=this.model.xs_units)throw new Error("not implemented");a=this.model.screen?e[o]:n.xview.compute(e[o]);var l=void 0;if("screen"!=this.model.ys_units)throw new Error("not implemented");l=this.model.screen?i[o]:n.yview.compute(i[o]),0==o?(r.beginPath(),r.moveTo(a,l)):r.lineTo(a,l)}r.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(r),r.stroke()),this.visuals.fill.doit&&(this.visuals.fill.set_value(r),r.fill())}}},e}(r.AnnotationView);i.PolyAnnotationView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PolyAnnotation",this.prototype.default_view=a,this.mixins(["line","fill"]),this.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,"data"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,"data"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),this.internal({screen:[s.Boolean,!1]}),this.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.data_update=new o.Signal0(this,"data_update")},e.prototype.update=function(t){var e=t.xs,i=t.ys;this.setv({xs:e,ys:i,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);i.PolyAnnotation=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position="absolute",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return e._draw_span()}):"canvas"==this.model.render_mode?(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return e.plot_view.request_render()})):(this.connect(this.model.change,function(){return e.render()}),this.connect(this.model.properties.location.change,function(){return e._draw_span()}))},e.prototype.render=function(){this.model.visible||"css"!=this.model.render_mode||o.hide(this.el),this.model.visible&&this._draw_span()},e.prototype._draw_span=function(){var t=this,e=this.model.for_hover?this.model.computed_location:this.model.location;if(null!=e){var i,n,r,s,a=this.plot_view.frame,l=a.xscales[this.model.x_range_name],h=a.yscales[this.model.y_range_name],c=function(i,n){return t.model.for_hover?t.model.computed_location:"data"==t.model.location_units?i.compute(e):n.compute(e)};if("width"==this.model.dimension?(r=c(h,a.yview),n=a._left.value,s=a._width.value,i=this.model.properties.line_width.value()):(r=a._top.value,n=c(l,a.xview),s=this.model.properties.line_width.value(),i=a._height.value),"css"==this.model.render_mode)this.el.style.top=r+"px",this.el.style.left=n+"px",this.el.style.width=s+"px",this.el.style.height=i+"px",this.el.style.zIndex="1000",this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el);else if("canvas"==this.model.render_mode){var u=this.plot_view.canvas_view.ctx;u.save(),u.beginPath(),this.visuals.line.set_value(u),u.moveTo(n,r),"width"==this.model.dimension?u.lineTo(n+s,r):u.lineTo(n,r+i),u.stroke(),u.restore()}}else o.hide(this.el)},e}(r.AnnotationView);i.SpanView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Span",this.prototype.default_view=a,this.mixins(["line"]),this.define({render_mode:[s.RenderMode,"canvas"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],location:[s.Number,null],location_units:[s.SpatialUnits,"data"],dimension:[s.Dimension,"width"]}),this.override({line_color:"black"}),this.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},e}(r.Annotation);i.Span=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(5),s=t(15),a=t(41),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),"css"==this.model.render_mode&&(this.el.classList.add("bk-annotation"),this.plot_view.canvas_overlays.appendChild(this.el))},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),"css"==this.model.render_mode?this.connect(this.model.change,function(){return e.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height;return[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var i,n=this._calculate_text_dimensions(t,e),r=n[0],o=n[1];switch(t.textAlign){case"left":i=0;break;case"center":i=-r/2;break;case"right":i=-r;break;default:throw new Error("unreachable code")}var s;switch(t.textBaseline){case"top":s=0;break;case"middle":s=-.5*o;break;case"bottom":s=-1*o;break;case"alphabetic":s=-.8*o;break;case"hanging":s=-.17*o;break;case"ideographic":s=-.83*o;break;default:throw new Error("unreachable code")}return[i,s,r,o]},e.prototype._canvas_text=function(t,e,i,n,r){this.visuals.text.set_value(t);var o=this._calculate_bounding_box_dimensions(t,e);t.save(),t.beginPath(),t.translate(i,n),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},e.prototype._css_text=function(t,e,i,n,r){o.hide(this.el),this.visuals.text.set_value(t);var s=this._calculate_bounding_box_dimensions(t,e),a=this.visuals.border_line.line_dash.value(),l=a.length<2?"solid":"dashed";this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position="absolute",this.el.style.left=i+s[0]+"px",this.el.style.top=n+s[1]+"px",this.el.style.color=""+this.visuals.text.text_color.value(),this.el.style.opacity=""+this.visuals.text.text_alpha.value(),this.el.style.font=""+this.visuals.text.font_value(),this.el.style.lineHeight="normal",r&&(this.el.style.transform="rotate("+r+"rad)"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=""+l,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+"px",this.el.style.borderColor=""+this.visuals.border_line.color_value()),this.el.textContent=e,o.show(this.el)},e}(r.AnnotationView);i.TextAnnotationView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TextAnnotation",this.define({render_mode:[s.RenderMode,"canvas"]})},e}(r.Annotation);i.TextAnnotation=h,h.initClass()},function(t,e,i){var n=t(379),r=t(67),o=t(5),s=t(15),a=t(49),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,i=this.model.panel,n=this.model.offset;switch(i.side){case"above":case"below":switch(this.model.vertical_align){case"top":e=i._top.value+5;break;case"middle":e=i._vcenter.value;break;case"bottom":e=i._bottom.value-5;break;default:throw new Error("unreachable code")}switch(this.model.align){case"left":t=i._left.value+n;break;case"center":t=i._hcenter.value;break;case"right":t=i._right.value-n;break;default:throw new Error("unreachable code")}break;case"left":switch(this.model.vertical_align){case"top":t=i._left.value-5;break;case"middle":t=i._hcenter.value;break;case"bottom":t=i._right.value+5;break;default:throw new Error("unreachable code")}switch(this.model.align){case"left":e=i._bottom.value-n;break;case"center":e=i._vcenter.value;break;case"right":e=i._top.value+n;break;default:throw new Error("unreachable code")}break;case"right":switch(this.model.vertical_align){case"top":t=i._right.value-5;break;case"middle":t=i._hcenter.value;break;case"bottom":t=i._left.value+5;break;default:throw new Error("unreachable code")}switch(this.model.align){case"left":e=i._top.value+n;break;case"center":e=i._vcenter.value;break;case"right":e=i._bottom.value-n;break;default:throw new Error("unreachable code")}break;default:throw new Error("unreachable code")}return[t,e]},e.prototype.render=function(){if(this.model.visible){var t=this.model.text;if(null!=t&&0!=t.length){this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;var e=this._get_location(),i=e[0],n=e[1],r=this.model.panel.get_label_angle_heuristic("parallel"),s="canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);s(this.plot_view.canvas_view.ctx,t,i,n,r)}}else"css"==this.model.render_mode&&o.hide(this.el)},e.prototype._get_size=function(){var t=this.model.text;if(null==t||0==t.length)return 0;var e=this.plot_view.canvas_view.ctx;return this.visuals.text.set_value(e),e.measureText(t).ascent+10},e}(r.TextAnnotationView);i.TitleView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Title",this.prototype.default_view=l,this.mixins(["line:border_","fill:background_"]),this.define({text:[s.String],text_font:[s.Font,"helvetica"],text_font_size:[s.FontSizeSpec,"10pt"],text_font_style:[s.FontStyle,"bold"],text_color:[s.ColorSpec,"#444444"],text_alpha:[s.NumberSpec,1],vertical_align:[s.VerticalAlign,"bottom"],align:[s.TextAlign,"left"],offset:[s.Number,0]}),this.override({background_fill_color:null,border_line_color:null}),this.internal({text_align:[s.TextAlign,"left"],text_baseline:[s.TextBaseline,"bottom"]})},e}(r.TextAnnotation);i.Title=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(4),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){if(t.prototype.render.call(this),this.model.visible){var e=this.model.panel;this.el.style.position="absolute",this.el.style.left=e._left.value+"px",this.el.style.top=e._top.value+"px",this.el.style.width=e._width.value+"px",this.el.style.height=e._height.value+"px",this.el.style.overflow="hidden";var i=this._toolbar_views[this.model.toolbar.id];i.render(),s.empty(this.el),this.el.appendChild(i.el),s.show(this.el)}else s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);i.ToolbarPanelView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ToolbarPanel",this.prototype.default_view=l,this.define({toolbar:[a.Instance]})},e}(r.Annotation);i.ToolbarPanel=h,h.initClass()},function(t,e,i){function n(t,e,i,n,r){var o;switch(t){case"horizontal":o=e<n?"right":"left";break;case"vertical":o=i<r?"below":"above";break;default:o=t}return o}var r=t(379),o=t(54),s=t(5),a=t(15);i.compute_side=n;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex="1010",s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return e._draw_tips()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-tooltip")},e.prototype.render=function(){this.model.visible&&this._draw_tips()},e.prototype._draw_tips=function(){var t=this.model.data;if(s.empty(this.el),s.hide(this.el),this.model.custom?this.el.classList.add("bk-tooltip-custom"):this.el.classList.remove("bk-tooltip-custom"),0!=t.length){for(var e=this.plot_view.frame,i=0,r=t;i<r.length;i++){var o=r[i],a=o[0],l=o[1],h=o[2];if(!this.model.inner_only||e.bbox.contains(a,l)){var c=s.div({},h);this.el.appendChild(c)}}var u=t[t.length-1],_=u[0],p=u[1],d=n(this.model.attachment,_,p,e._hcenter.value,e._vcenter.value);this.el.classList.remove("bk-right"),this.el.classList.remove("bk-left"),this.el.classList.remove("bk-above"),this.el.classList.remove("bk-below");s.show(this.el);var f,v;switch(d){case"right":this.el.classList.add("bk-left"),f=_+(this.el.offsetWidth-this.el.clientWidth)+10,v=p-this.el.offsetHeight/2;break;case"left":this.el.classList.add("bk-right"),f=_-this.el.offsetWidth-10,v=p-this.el.offsetHeight/2;break;case"below":this.el.classList.add("bk-above"),v=p+(this.el.offsetHeight-this.el.clientHeight)+10,f=Math.round(_-this.el.offsetWidth/2);break;case"above":this.el.classList.add("bk-below"),v=p-this.el.offsetHeight-10,f=Math.round(_-this.el.offsetWidth/2);break;default:throw new Error("unreachable code")}this.model.show_arrow&&this.el.classList.add("bk-tooltip-arrow"),this.el.childNodes.length>0?(this.el.style.top=v+"px",this.el.style.left=f+"px"):s.hide(this.el)}},e}(o.AnnotationView);i.TooltipView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type="Tooltip",this.prototype.default_view=l,this.define({attachment:[a.String,"horizontal"],inner_only:[a.Bool,!0],show_arrow:[a.Bool,!0]}),this.override({level:"overlay"}),this.internal({data:[a.Any,[]],custom:[a.Any]})},e.prototype.clear=function(){this.data=[]},e.prototype.add=function(t,e,i){this.data=this.data.concat([[t,e,i]])},e}(o.Annotation);i.Tooltip=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(184),s=t(56),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e=this.plot_model.frame,i=this.model.dimension,n=e.xscales[this.model.x_range_name],r=e.yscales[this.model.y_range_name],o="height"==i?r:n,s="height"==i?n:r,a="height"==i?e.yview:e.xview,l="height"==i?e.xview:e.yview;t="data"==this.model.lower.units?o.v_compute(this._lower):a.v_compute(this._lower);var h;h="data"==this.model.upper.units?o.v_compute(this._upper):a.v_compute(this._upper);var c;c="data"==this.model.base.units?s.v_compute(this._base):l.v_compute(this._base);var u="height"==i?[1,0]:[0,1],_=u[0],p=u[1],d=[t,c],f=[h,c];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},e.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;if(this.visuals.line.doit)for(var e=0,i=this._lower_sx.length;e<i;e++)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this._lower_sx[e],this._lower_sy[e]),t.lineTo(this._upper_sx[e],this._upper_sy[e]),t.stroke();var n="height"==this.model.dimension?0:Math.PI/2;if(null!=this.model.lower_head)for(var e=0,i=this._lower_sx.length;e<i;e++)t.save(),t.translate(this._lower_sx[e],this._lower_sy[e]),t.rotate(n+Math.PI),this.model.lower_head.render(t,e),t.restore();if(null!=this.model.upper_head)for(var e=0,i=this._upper_sx.length;e<i;e++)t.save(),t.translate(this._upper_sx[e],this._upper_sy[e]),t.rotate(n),this.model.upper_head.render(t,e),t.restore()}},e}(r.AnnotationView);i.WhiskerView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Whisker",this.prototype.default_view=l,this.mixins(["line"]),this.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,"height"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),this.override({level:"underlay"})},e}(r.Annotation);i.Whisker=h,h.initClass()},function(t,e,i){var n=t(379),r=t(171),o=t(15),s=t(12),a=t(21),l=t(44),h=Math.abs,c=Math.min,u=Math.max,_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){if(this.model.visible){var t={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},e=this.model.tick_coords,i=this.plot_view.canvas_view.ctx;i.save(),this._draw_rule(i,t),this._draw_major_ticks(i,t,e),this._draw_minor_ticks(i,t,e),this._draw_major_labels(i,t,e),this._draw_axis_label(i,t,e),null!=this._render&&this._render(i,t,e),i.restore()}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype._draw_rule=function(t,e){if(this.visuals.axis_line.doit){var i=this.model.rule_coords,n=i[0],r=i[1],o=this.plot_view.map_to_screen(n,r,this.model.x_range_name,this.model.y_range_name),s=o[0],a=o[1],l=this.model.normals,h=l[0],c=l[1],u=this.model.offsets,_=u[0],p=u[1];this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(s[0]+h*_),Math.round(a[0]+c*p));for(var d=1;d<s.length;d++){var f=Math.round(s[d]+h*_),v=Math.round(a[d]+c*p);t.lineTo(f,v)}t.stroke()}},e.prototype._draw_major_ticks=function(t,e,i){var n=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line;this._draw_ticks(t,i.major,n,r,o)},e.prototype._draw_minor_ticks=function(t,e,i){var n=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line;this._draw_ticks(t,i.minor,n,r,o)},e.prototype._draw_major_labels=function(t,e,i){var n=i.major,r=this.model.compute_labels(n[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text;this._draw_oriented_labels(t,r,n,o,this.model.panel.side,s,a)},e.prototype._draw_axis_label=function(t,e,i){if(null!=this.model.axis_label&&0!=this.model.axis_label.length){var n,r;switch(this.model.panel.side){case"above":n=this.model.panel._hcenter.value,r=this.model.panel._bottom.value;break;case"below":n=this.model.panel._hcenter.value,r=this.model.panel._top.value;break;case"left":n=this.model.panel._right.value,r=this.model.panel._vcenter.value;break;case"right":n=this.model.panel._left.value,r=this.model.panel._vcenter.value;break;default:throw new Error("unknown side: "+this.model.panel.side)}var o=[[n],[r]],s=e.tick+a.sum(e.tick_label)+this.model.axis_label_standoff,l=this.visuals.axis_label_text;this._draw_oriented_labels(t,[this.model.axis_label],o,"parallel",this.model.panel.side,s,l,"screen")}},e.prototype._draw_ticks=function(t,e,i,n,r){if(r.doit){var o=e[0],s=e[1],a=this.plot_view.map_to_screen(o,s,this.model.x_range_name,this.model.y_range_name),l=a[0],h=a[1],c=this.model.normals,u=c[0],_=c[1],p=this.model.offsets,d=p[0],f=p[1],v=[u*(d-i),_*(f-i)],m=v[0],g=v[1],y=[u*(d+n),_*(f+n)],b=y[0],x=y[1];r.set_value(t);for(var w=0;w<l.length;w++){var k=Math.round(l[w]+b),S=Math.round(h[w]+x),C=Math.round(l[w]+m),T=Math.round(h[w]+g);t.beginPath(),t.moveTo(k,S),t.lineTo(C,T),t.stroke()}}},e.prototype._draw_oriented_labels=function(t,e,i,n,r,o,s,a){if(void 0===a&&(a="data"),s.doit&&0!=e.length){var h,c,u,_;if("screen"==a)h=i[0],c=i[1],u=(S=[0,0])[0],_=S[1];else{var p=i[0],d=i[1];C=this.plot_view.map_to_screen(p,d,this.model.x_range_name,this.model.y_range_name),h=C[0],c=C[1],T=this.model.offsets,u=T[0],_=T[1]}var f=this.model.normals,v=f[0],m=f[1],g=v*(u+o),y=m*(_+o);s.set_value(t),this.model.panel.apply_label_text_heuristics(t,n);var b;b=l.isString(n)?this.model.panel.get_label_angle_heuristic(n):-n;for(var x=0;x<h.length;x++){var w=Math.round(h[x]+g),k=Math.round(c[x]+y);t.translate(w,k),t.rotate(b),t.fillText(e[x],0,0),t.rotate(-b),t.translate(-w,-k)}var S,C,T}},e.prototype._axis_label_extent=function(){if(null==this.model.axis_label||""==this.model.axis_label)return 0;var t=this.model.axis_label_standoff,e=this.visuals.axis_label_text;return this._oriented_labels_extent([this.model.axis_label],"parallel",this.model.panel.side,t,e)},e.prototype._tick_extent=function(){return this.model.major_tick_out},e.prototype._tick_label_extent=function(){return a.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),i=this.model.major_label_orientation,n=this.model.major_label_standoff,r=this.visuals.major_label_text;return[this._oriented_labels_extent(e,i,this.model.panel.side,n,r)]},e.prototype._oriented_labels_extent=function(t,e,i,n,r){if(0==t.length)return 0;var o=this.plot_view.canvas_view.ctx;r.set_value(o);var s,a;l.isString(e)?(s=1,a=this.model.panel.get_label_angle_heuristic(e)):(s=2,a=-e),a=Math.abs(a);for(var h=Math.cos(a),c=Math.sin(a),u=0,_=0;_<t.length;_++){var p=1.1*o.measureText(t[_]).width,d=.9*o.measureText(t[_]).ascent,f=void 0;(f="above"==i||"below"==i?p*c+d/s*h:p*h+d/s*c)>u&&(u=f)}return u>0&&(u+=n),u},e}(r.GuideRendererView);i.AxisView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Axis",this.prototype.default_view=_,this.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),this.define({bounds:[o.Any,"auto"],ticker:[o.Instance,null],formatter:[o.Instance,null],x_range_name:[o.String,"default"],y_range_name:[o.String,"default"],axis_label:[o.String,""],axis_label_standoff:[o.Int,5],major_label_standoff:[o.Int,5],major_label_orientation:[o.Any,"horizontal"],major_label_overrides:[o.Any,{}],major_tick_in:[o.Number,2],major_tick_out:[o.Number,6],minor_tick_in:[o.Number,0],minor_tick_out:[o.Number,4]}),this.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"8pt",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"10pt",axis_label_text_font_style:"italic"})},e.prototype.add_panel=function(t){this.panel=new s.SidePanel({side:t}),this.panel.attach_document(this.document)},Object.defineProperty(e.prototype,"normals",{get:function(){return this.panel.normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dimension",{get:function(){return this.panel.dimension},enumerable:!0,configurable:!0}),e.prototype.compute_labels=function(t){for(var e=this.formatter.doFormat(t,this),i=0;i<t.length;i++)t[i]in this.major_label_overrides&&(e[i]=this.major_label_overrides[t[i]]);return e},e.prototype.label_info=function(t){return{dim:this.dimension,coords:t,side:this.panel.side,orient:this.major_label_orientation,standoff:this.major_label_standoff}},Object.defineProperty(e.prototype,"offsets",{get:function(){var t=this.plot.plot_canvas.frame,e=[0,0],i=e[0],n=e[1];switch(this.panel.side){case"below":n=h(this.panel._top.value-t._bottom.value);break;case"above":n=h(this.panel._bottom.value-t._top.value);break;case"right":i=h(this.panel._left.value-t._right.value);break;case"left":i=h(this.panel._right.value-t._left.value)}return[i,n]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ranges",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computed_bounds",{get:function(){var t=this.ranges[0],e=this.bounds,i=[t.min,t.max];if("auto"==e)return[t.min,t.max];if(l.isArray(e)){var n=void 0,r=void 0,o=e[0],s=e[1],a=i[0],_=i[1];return h(o-s)>h(a-_)?(n=u(c(o,s),a),r=c(u(o,s),_)):(n=c(o,s),r=u(o,s)),[n,r]}throw new Error("user bounds '"+e+"' not understood")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rule_coords",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=new Array(2),a=new Array(2),l=[s,a];return l[t][0]=Math.max(r,i.min),l[t][1]=Math.min(o,i.max),l[t][0]>l[t][1]&&(l[t][0]=l[t][1]=NaN),l[e][0]=this.loc,l[e][1]=this.loc,l},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tick_coords",{get:function(){for(var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=this.ticker.get_ticks(r,o,i,this.loc,{}),a=s.major,l=s.minor,h=[[],[]],c=[[],[]],u=[i.min,i.max],_=u[0],p=u[1],d=0;d<a.length;d++)a[d]<_||a[d]>p||(h[t].push(a[d]),h[e].push(this.loc));for(var d=0;d<l.length;d++)l[d]<_||l[d]>p||(c[t].push(l[d]),c[e].push(this.loc));return{major:h,minor:c}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loc",{get:function(){var t=this.ranges,e=t[1];switch(this.panel.side){case"left":case"below":return e.start;case"right":case"above":return e.end}},enumerable:!0,configurable:!0}),e}(r.GuideRenderer);i.Axis=p,p.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(192),s=t(97),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){this._draw_group_separators(t,e,i)},e.prototype._draw_group_separators=function(t,e,i){var n=this.model.ranges[0],r=this.model.computed_bounds,o=r[0],s=r[1];if(n.tops&&!(n.tops.length<2)&&this.visuals.separator_line.doit){for(var a=this.model.dimension,l=(a+1)%2,h=[[],[]],c=0,u=0;u<n.tops.length-1;u++){for(var _=void 0,p=void 0,d=c;d<n.factors.length;d++)if(n.factors[d][0]==n.tops[u+1]){m=[n.factors[d-1],n.factors[d]],_=m[0],p=m[1],c=d;break}var f=(n.synthetic(_)+n.synthetic(p))/2;f>o&&f<s&&(h[a].push(f),h[l].push(this.model.loc))}var v=this._tick_label_extent();this._draw_ticks(t,h,-3,v-6,this.visuals.separator_line);var m}},e.prototype._draw_major_labels=function(t,e,i){for(var n=this._get_factor_info(),r=e.tick+this.model.major_label_standoff,o=0;o<n.length;o++){var s=n[o],a=s[0],l=s[1],h=s[2],c=s[3];this._draw_oriented_labels(t,a,l,h,this.model.panel.side,r,c),r+=e.tick_label[o]}},e.prototype._tick_label_extents=function(){for(var t=this._get_factor_info(),e=[],i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[2],a=r[3],l=this._oriented_labels_extent(o,s,this.model.panel.side,this.model.major_label_standoff,a);e.push(l)}return e},e.prototype._get_factor_info=function(){var t=this.model.ranges[0],e=this.model.computed_bounds,i=e[0],n=e[1],r=this.model.loc,o=this.model.ticker.get_ticks(i,n,t,r,{}),s=this.model.tick_coords,a=[];if(1==t.levels){var l=this.model.formatter.doFormat(o.major,this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[1]}),this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([o.tops,s.tops,"parallel",this.visuals.group_text])}else if(3==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[2]}),this.model),h=o.mids.map(function(t){return t[1]});a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([h,s.mids,"parallel",this.visuals.subgroup_text]),a.push([o.tops,s.tops,"parallel",this.visuals.group_text])}return a},e}(r.AxisView);i.CategoricalAxisView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CategoricalAxis",this.prototype.default_view=a,this.mixins(["line:separator_","text:group_","text:subgroup_"]),this.override({ticker:function(){return new o.CategoricalTicker},formatter:function(){return new s.CategoricalTickFormatter},separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"8pt",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"8pt"})},Object.defineProperty(e.prototype,"tick_coords",{get:function(){var t=this,e=this.dimension,i=(e+1)%2,n=this.ranges[0],r=this.computed_bounds,o=r[0],s=r[1],a=this.ticker.get_ticks(o,s,n,this.loc,{}),l={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return l.major[e]=a.major,l.major[i]=a.major.map(function(e){return t.loc}),3==n.levels&&(l.mids[e]=a.mids),l.mids[i]=a.mids.map(function(e){return t.loc}),n.levels>1&&(l.tops[e]=a.tops),l.tops[i]=a.tops.map(function(e){return t.loc}),l},enumerable:!0,configurable:!0}),e}(r.Axis);i.CategoricalAxis=l,l.initClass()},function(t,e,i){var n=t(379),r=t(72),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ContinuousAxis"},e}(r.Axis);i.ContinuousAxis=o,o.initClass()},function(t,e,i){var n=t(379),r=t(77),o=t(98),s=t(195),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.LinearAxisView);i.DatetimeAxisView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DatetimeAxis",this.prototype.default_view=a,this.override({ticker:function(){return new s.DatetimeTicker},formatter:function(){return new o.DatetimeTickFormatter}})},e}(r.LinearAxis);i.DatetimeAxis=l,l.initClass()},function(t,e,i){var n=t(72);i.Axis=n.Axis;var r=t(73);i.CategoricalAxis=r.CategoricalAxis;var o=t(74);i.ContinuousAxis=o.ContinuousAxis;var s=t(75);i.DatetimeAxis=s.DatetimeAxis;var a=t(77);i.LinearAxis=a.LinearAxis;var l=t(78);i.LogAxis=l.LogAxis;var h=t(79);i.MercatorAxis=h.MercatorAxis},function(t,e,i){var n=t(379),r=t(72),o=t(74),s=t(96),a=t(191),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LinearAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LinearAxis",this.prototype.default_view=l,this.override({ticker:function(){return new a.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},e}(o.ContinuousAxis);i.LinearAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(74),s=t(101),a=t(199),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LogAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LogAxis",this.prototype.default_view=l,this.override({ticker:function(){return new a.LogTicker},formatter:function(){return new s.LogTickFormatter}})},e}(o.ContinuousAxis);i.LogAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(77),s=t(102),a=t(200),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.MercatorAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MercatorAxis",this.prototype.default_view=l,this.override({ticker:function(){return new a.MercatorTicker},formatter:function(){return new s.MercatorTickFormatter}})},e}(o.LinearAxis);i.MercatorAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Callback"},e}(r.Model);i.Callback=o,o.initClass()},function(t,e,i){var n=t(379),r=t(80),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type="CustomJS",this.define({args:[o.Any,{}],code:[o.String,""]})},Object.defineProperty(i.prototype,"names",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"func",{get:function(){return new(Function.bind.apply(Function,[void 0].concat(this.names,["cb_obj","cb_data","require","exports",this.code])))},enumerable:!0,configurable:!0}),i.prototype.execute=function(e,i){return this.func.apply(e,this.values.concat(e,i,t,{}))},i}(r.Callback);i.CustomJS=a,a.initClass()},function(t,e,i){var n=t(81);i.CustomJS=n.CustomJS;var r=t(83);i.OpenURL=r.OpenURL},function(t,e,i){var n=t(379),r=t(80),o=t(15),s=t(35),a=t(40),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="OpenURL",this.define({url:[o.String,"http://"]})},e.prototype.execute=function(t,e){for(var i=0,n=s.get_indices(e.source);i<n.length;i++){var r=n[i],o=a.replace_placeholders(this.url,e.source,r);window.open(o)}return null},e}(r.Callback);i.OpenURL=l,l.initClass()},function(t,e,i){var n=t(379),r=t(11),o=t(6),s=t(13),a=t(14),l=t(15),h=t(5),c=t(26),u=t(264);null!=window.CanvasPixelArray&&(window.CanvasPixelArray.prototype.set=function(t){for(var e=0;e<this.length;e++)this[e]=t[e]});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(h.div({class:"bk-canvas-map"})):null,this.model.output_backend){case"canvas":case"webgl":this.canvas_el=this.el.appendChild(h.canvas({class:"bk-canvas"})),this._ctx=this.canvas_el.getContext("2d");break;case"svg":this._ctx=new u,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}this.overlays_el=this.el.appendChild(h.div({class:"bk-canvas-overlays"})),this.events_el=this.el.appendChild(h.div({class:"bk-canvas-events"})),this.ctx=this.get_ctx(),c.fixup_ctx(this.ctx),a.logger.debug("CanvasView initialized")},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-canvas-wrapper")},e.prototype.get_ctx=function(){return this._ctx},e.prototype.get_canvas_element=function(){return this.canvas_el},e.prototype.prepare_canvas=function(){var t=this.model._width.value,e=this.model._height.value;this.el.style.width=t+"px",this.el.style.height=e+"px";var i=c.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend);this.model.pixel_ratio=i,this.canvas_el.style.width=t+"px",this.canvas_el.style.height=e+"px",this.canvas_el.setAttribute("width",""+t*i),this.canvas_el.setAttribute("height",""+e*i),a.logger.debug("Rendering CanvasView with width: "+t+", height: "+e+", pixel ratio: "+i)},e.prototype.set_dims=function(t){var e=t[0],i=t[1];0!=e&&0!=i&&(e!=this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),i!=this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-i),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables())},e}(o.DOMView);i.CanvasView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Canvas",this.prototype.default_view=_,this.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,"canvas"]})},Object.defineProperty(e.prototype,"panel",{get:function(){return this},enumerable:!0,configurable:!0}),e}(r.LayoutCanvas);i.Canvas=p,p.initClass()},function(t,e,i){var n=t(379),r=t(174),o=t(176),s=t(177),a=t(168),l=t(164),h=t(165),c=t(11),u=t(15),_=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CartesianFrame",this.internal({extra_x_ranges:[u.Any,{}],extra_y_ranges:[u.Any,{}],x_range:[u.Instance],y_range:[u.Instance],x_scale:[u.Instance],y_scale:[u.Instance]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._configure_scales()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._configure_scales()})},Object.defineProperty(e.prototype,"panel",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.get_editables=function(){return t.prototype.get_editables.call(this).concat([this._width,this._height])},e.prototype.map_to_screen=function(t,e,i,n){void 0===i&&(i="default"),void 0===n&&(n="default");var r=this.xscales[i].v_compute(t),o=this.yscales[n].v_compute(e);return[r,o]},e.prototype._get_ranges=function(t,e){var i={};if(i.default=t,null!=e)for(var n in e)i[n]=e[n];return i},e.prototype._get_scales=function(t,e,i){var n={};for(var c in e){var u=e[c];if(u instanceof l.DataRange1d||u instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error("Range "+u.type+" is incompatible is Scale "+t.type);if(t instanceof r.CategoricalScale)throw new Error("Range "+u.type+" is incompatible is Scale "+t.type)}if(u instanceof h.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error("Range "+u.type+" is incompatible is Scale "+t.type);t instanceof s.LogScale&&u instanceof l.DataRange1d&&(u.scale_hint="log");var _=t.clone();_.setv({source_range:u,target_range:i}),n[c]=_}return n},e.prototype._configure_frame_ranges=function(){this._h_target=new a.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new a.Range1d({start:this._bottom.value,end:this._top.value})},e.prototype._configure_scales=function(){this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},e.prototype.update_scales=function(){this._configure_frame_ranges();for(var t in this._xscales){var e=this._xscales[t];e.target_range=this._h_target}for(var i in this._yscales){var e=this._yscales[i];e.target_range=this._v_target}},Object.defineProperty(e.prototype,"x_ranges",{get:function(){return this._x_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y_ranges",{get:function(){return this._y_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xscales",{get:function(){return this._xscales},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yscales",{get:function(){return this._yscales},enumerable:!0,configurable:!0}),e}(c.LayoutCanvas);i.CartesianFrame=_,_.initClass()},function(t,e,i){var n=t(84);i.Canvas=n.Canvas;var r=t(85);i.CartesianFrame=r.CartesianFrame},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){var i=t.call(this,e)||this;return i._connected={},i._result={},i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Expression"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._connected={},this._result={}},e.prototype._v_compute=function(t){var e=this;null==this._connected[t.id]&&(this.connect(t.change,function(){return delete e._result[t.id]}),this._connected[t.id]=!0);var i=this._result[t.id];return null==i&&(this._result[t.id]=i=this.v_compute(t)),i},e}(r.Model);i.Expression=o,o.initClass()},function(t,e,i){var n=t(87);i.Expression=n.Expression;var r=t(89);i.Stack=r.Stack},function(t,e,i){var n=t(379),r=t(87),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Stack",this.define({fields:[o.Array,[]]})},e.prototype.v_compute=function(t){for(var e=new Float64Array(t.get_length()||0),i=0,n=this.fields;i<n.length;i++)for(var r=n[i],o=0;o<t.data[r].length;o++){var s=t.data[r][o];e[o]+=s}return e},e}(r.Expression);i.Stack=s,s.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(21),l=t(44),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BooleanFilter",this.define({booleans:[o.Array,null]})},e.prototype.compute_indices=function(t){var e=this.booleans;return null!=e&&e.length>0?a.all(e,l.isBoolean)?(e.length!==t.get_length()&&s.logger.warn("BooleanFilter "+this.id+": length of booleans doesn't match data source"),a.range(0,e.length).filter(function(t){return!0===e[t]})):(s.logger.warn("BooleanFilter "+this.id+": booleans should be array of booleans, defaulting to no filtering"),null):(null!=e&&0==e.length?s.logger.warn("BooleanFilter "+this.id+": booleans is empty, defaulting to no filtering"):s.logger.warn("BooleanFilter "+this.id+": booleans was not set, defaulting to no filtering"),null)},e}(r.Filter);i.BooleanFilter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type="CustomJSFilter",this.define({args:[o.Any,{}],code:[o.String,""]})},Object.defineProperty(i.prototype,"values",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"func",{get:function(){return new(Function.bind.apply(Function,[void 0].concat(s.keys(this.args),["source","require","exports",this.code])))},enumerable:!0,configurable:!0}),i.prototype.compute_indices=function(i){return this.filter=this.func.apply(this,this.values.concat([i,t,{}])),e.prototype.compute_indices.call(this,i)},i}(r.Filter);i.CustomJSFilter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=t(21),l=t(14),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Filter",this.define({filter:[o.Array,null]})},e.prototype.compute_indices=function(t){var e=this.filter;return null!=e&&e.length>=0?s.isArrayOf(e,s.isBoolean)?a.range(0,e.length).filter(function(t){return!0===e[t]}):s.isArrayOf(e,s.isInteger)?e:(l.logger.warn("Filter "+this.id+": filter should either be array of only booleans or only integers, defaulting to no filtering"),null):(l.logger.warn("Filter "+this.id+": filter was not set to be an array, defaulting to no filtering"),null)},e}(r.Model);i.Filter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(21),l=function(t){function e(e){var i=t.call(this,e)||this;return i.indices=null,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GroupFilter",this.define({column_name:[o.String],group:[o.String]})},e.prototype.compute_indices=function(t){var e=this,i=t.get_column(this.column_name);return null==i?(s.logger.warn("group filter: groupby column not found in data source"),null):(this.indices=a.range(0,t.get_length()||0).filter(function(t){return i[t]===e.group}),0===this.indices.length&&s.logger.warn("group filter: group '"+this.group+"' did not match any values in column '"+this.column_name+"'"),this.indices)},e}(r.Filter);i.GroupFilter=l,l.initClass()},function(t,e,i){var n=t(90);i.BooleanFilter=n.BooleanFilter;var r=t(91);i.CustomJSFilter=r.CustomJSFilter;var o=t(92);i.Filter=o.Filter;var s=t(93);i.GroupFilter=s.GroupFilter;var a=t(95);i.IndexFilter=a.IndexFilter},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(44),l=t(21),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="IndexFilter",this.define({indices:[o.Array,null]})},e.prototype.compute_indices=function(t){return null!=this.indices&&this.indices.length>=0?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn("IndexFilter "+this.id+": indices should be array of integers, defaulting to no filtering"),null):(s.logger.warn("IndexFilter "+this.id+": indices was not set, defaulting to no filtering"),null)},e}(r.Filter);i.IndexFilter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(15),s=t(44),a=function(t){function e(e){var i=t.call(this,e)||this;return i.last_precision=3,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BasicTickFormatter",this.define({precision:[o.Any,"auto"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]})},Object.defineProperty(e.prototype,"scientific_limit_low",{get:function(){return Math.pow(10,this.power_limit_low)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scientific_limit_high",{get:function(){return Math.pow(10,this.power_limit_high)},enumerable:!0,configurable:!0}),e.prototype.doFormat=function(t,e){if(0==t.length)return[];var i=0;t.length>=2&&(i=Math.abs(t[1]-t[0])/1e4);var n=!1;if(this.use_scientific)for(var r=0,o=t;r<o.length;r++){var a=o[r],l=Math.abs(a);if(l>i&&(l>=this.scientific_limit_high||l<=this.scientific_limit_low)){n=!0;break}}var h=new Array(t.length),c=this.precision;if(null==c||s.isNumber(c))if(n)for(var u=0,_=t.length;u<_;u++)h[u]=t[u].toExponential(c||void 0);else for(var u=0,_=t.length;u<_;u++)h[u]=t[u].toFixed(c||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");else for(var p=this.last_precision,d=this.last_precision<=15;d?p<=15:p>=15;d?p++:p--){var f=!0;if(n){for(var u=0,_=t.length;u<_;u++)if(h[u]=t[u].toExponential(p),u>0&&h[u]===h[u-1]){f=!1;break}if(f)break}else{for(var u=0,_=t.length;u<_;u++)if(h[u]=t[u].toFixed(p).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),u>0&&h[u]==h[u-1]){f=!1;break}if(f)break}if(f){this.last_precision=p;break}}return h},e}(r.TickFormatter);i.BasicTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(21),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CategoricalTickFormatter"},e.prototype.doFormat=function(t,e){return o.copy(t)},e}(r.TickFormatter);i.CategoricalTickFormatter=s,s.initClass()},function(t,e,i){function n(t){return a(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})}function r(t,e){if(_.isFunction(e))return e(t);var i=s.sprintf("$1%06d",function(t){return Math.round(t/1e3%1*1e6)}(t));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,i)).indexOf("%")?e:a(t,e)}var o=t(379),s=t(377),a=t(378),l=t(105),h=t(14),c=t(15),u=t(21),_=t(44),p=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],d=function(t){function e(e){var i=t.call(this,e)||this;return i.strip_leading_zeros=!0,i}return o.__extends(e,t),e.initClass=function(){this.prototype.type="DatetimeTickFormatter",this.define({microseconds:[c.Array,["%fus"]],milliseconds:[c.Array,["%3Nms","%S.%3Ns"]],seconds:[c.Array,["%Ss"]],minsec:[c.Array,[":%M:%S"]],minutes:[c.Array,[":%M","%Mm"]],hourmin:[c.Array,["%H:%M"]],hours:[c.Array,["%Hh","%H:%M"]],days:[c.Array,["%m/%d","%a%d"]],months:[c.Array,["%m/%Y","%b%y"]],years:[c.Array,["%Y"]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._update_width_formats()},e.prototype._update_width_formats=function(){var t=+a(new Date),e=function(e){var i=e.map(function(e){return r(t,e).length}),n=u.sortBy(u.zip(i,e),function(t){var e=t[0];return e});return u.unzip(n)};this._width_formats={microseconds:e(this.microseconds),milliseconds:e(this.milliseconds),seconds:e(this.seconds),minsec:e(this.minsec),minutes:e(this.minutes),hourmin:e(this.hourmin),hours:e(this.hours),days:e(this.days),months:e(this.months),years:e(this.years)}},e.prototype._get_resolution_str=function(t,e){var i=1.1*t;switch(!1){case!(i<.001):return"microseconds";case!(i<1):return"milliseconds";case!(i<60):return e>=60?"minsec":"seconds";case!(i<3600):return e>=3600?"hourmin":"minutes";case!(i<86400):return"hours";case!(i<2678400):return"days";case!(i<31536e3):return"months";default:return"years"}},e.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=Math.abs(t[t.length-1]-t[0])/1e3,o=i/(t.length-1),s=this._get_resolution_str(o,i),a=this._width_formats[s],l=a[1],c=l[0],u=[],_=p.indexOf(s),d={},f=0,v=p;f<v.length;f++){var m=v[f];d[m]=0}d.seconds=5,d.minsec=4,d.minutes=4,d.hourmin=3,d.hours=3;for(var g=0,y=t;g<y.length;g++){var b=y[g],x=void 0,w=void 0;try{w=n(b),x=r(b,c)}catch(t){h.logger.warn("unable to format tick for timestamp value "+b),h.logger.warn(" - "+t),u.push("ERR");continue}for(var k=!1,S=_;0==w[d[p[S]]];){var C=void 0;if((S+=1)==p.length)break;if(("minsec"==s||"hourmin"==s)&&!k){if("minsec"==s&&0==w[4]&&0!=w[5]||"hourmin"==s&&0==w[3]&&0!=w[4]){C=this._width_formats[p[_-1]][1][0],x=r(b,C);break}k=!0}C=this._width_formats[p[S]][1][0],x=r(b,C)}if(this.strip_leading_zeros){var T=x.replace(/^0+/g,"");T!=x&&isNaN(parseInt(T))&&(T="0"+T),u.push(T)}else u.push(x)}return u},e}(l.TickFormatter);i.DatetimeTickFormatter=d,d.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type="FuncTickFormatter",this.define({args:[o.Any,{}],code:[o.String,""]})},i.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0,"tick","index","ticks"].concat(s.keys(this.args),["require",this.code])))},i.prototype.doFormat=function(e,i){var n=this,r=this._make_func().bind({});return e.map(function(e,i,o){return r.apply(void 0,[e,i,o].concat(s.values(n.args),[t]))})},i}(r.TickFormatter);i.FuncTickFormatter=a,a.initClass()},function(t,e,i){var n=t(96);i.BasicTickFormatter=n.BasicTickFormatter;var r=t(97);i.CategoricalTickFormatter=r.CategoricalTickFormatter;var o=t(98);i.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(99);i.FuncTickFormatter=s.FuncTickFormatter;var a=t(101);i.LogTickFormatter=a.LogTickFormatter;var l=t(102);i.MercatorTickFormatter=l.MercatorTickFormatter;var h=t(103);i.NumeralTickFormatter=h.NumeralTickFormatter;var c=t(104);i.PrintfTickFormatter=c.PrintfTickFormatter;var u=t(105);i.TickFormatter=u.TickFormatter},function(t,e,i){var n=t(379),r=t(105),o=t(96),s=t(14),a=t(15),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LogTickFormatter",this.define({ticker:[a.Instance,null]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.basic_formatter=new o.BasicTickFormatter,null==this.ticker&&s.logger.warn("LogTickFormatter not configured with a ticker, using default base of 10 (labels will be incorrect if ticker base is not 10)")},e.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=null!=this.ticker?this.ticker.base:10,n=!1,r=new Array(t.length),o=0,s=t.length;o<s;o++)if(r[o]=i+"^"+Math.round(Math.log(t[o])/Math.log(i)),o>0&&r[o]==r[o-1]){n=!0;break}return n?this.basic_formatter.doFormat(t,e):r},e}(r.TickFormatter);i.LogTickFormatter=l,l.initClass()},function(t,e,i){var n=t(379),r=t(96),o=t(15),s=t(33),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MercatorTickFormatter",this.define({dimension:[o.LatLon]})},e.prototype.doFormat=function(e,i){if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0==e.length)return[];var n=e.length,r=new Array(n);if("lon"==this.dimension)for(var o=0;o<n;o++){var a=s.wgs84_mercator.inverse([e[o],i.loc])[0];r[o]=a}else for(var o=0;o<n;o++){var l=s.wgs84_mercator.inverse([i.loc,e[o]]),h=l[1];r[o]=h}return t.prototype.doFormat.call(this,r,i)},e}(r.BasicTickFormatter);i.MercatorTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(347),o=t(105),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="NumeralTickFormatter",this.define({format:[s.String,"0,0"],language:[s.String,"en"],rounding:[s.String,"round"]})},Object.defineProperty(e.prototype,"_rounding_fn",{get:function(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}},enumerable:!0,configurable:!0}),e.prototype.doFormat=function(t,e){var i=this.format,n=this.language,o=this._rounding_fn;return t.map(function(t){return r.format(t,i,n,o)})},e}(o.TickFormatter);i.NumeralTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(377),o=t(105),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PrintfTickFormatter",this.define({format:[s.String,"%s"]})},e.prototype.doFormat=function(t,e){var i=this;return t.map(function(t){return r.sprintf(i.format,t)})},e}(o.TickFormatter);i.PrintfTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TickFormatter"},e}(r.Model);i.TickFormatter=o,o.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length);for(var t=0,e=this._start_angle.length;t<e;t++)this._angle[t]=this._end_angle[t]-this._start_angle[t]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._start_angle,s=i._angle,a=i.sinner_radius,l=i.souter_radius,h=this.model.properties.direction.value(),c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+a[_]+l[_]+o[_]+s[_])||(t.translate(n[_],r[_]),t.rotate(o[_]),t.moveTo(l[_],0),t.beginPath(),t.arc(0,0,l[_],0,s[_],h),t.rotate(s[_]),t.lineTo(a[_],0),t.arc(0,0,a[_],0,-s[_],!h),t.closePath(),t.rotate(-s[_]-o[_]),t.translate(-n[_],-r[_]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,_),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,_),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o=t.sx,a=t.sy,h=this.renderer.xscale.invert(o),c=this.renderer.yscale.invert(a);if("data"==this.model.properties.outer_radius.units)e=h-this.max_outer_radius,n=h+this.max_outer_radius,i=c-this.max_outer_radius,r=c+this.max_outer_radius;else{var u=o-this.max_outer_radius,_=o+this.max_outer_radius;z=this.renderer.xscale.r_invert(u,_),e=z[0],n=z[1];var p=a-this.max_outer_radius,d=a+this.max_outer_radius;P=this.renderer.yscale.r_invert(p,d),i=P[0],r=P[1]}for(var f=[],v=s.validate_bbox_coords([e,n],[i,r]),m=0,g=this.index.indices(v);m<g.length;m++){var y=g[m],b=Math.pow(this.souter_radius[y],2),x=Math.pow(this.sinner_radius[y],2),w=this.renderer.xscale.r_compute(h,this._x[y]),u=w[0],_=w[1],k=this.renderer.yscale.r_compute(c,this._y[y]),p=k[0],d=k[1],S=Math.pow(u-_,2)+Math.pow(p-d,2);S<=b&&S>=x&&f.push([y,S])}for(var C=this.model.properties.direction.value(),T=[],A=0,E=f;A<E.length;A++){var M=E[A],y=M[0],S=M[1],O=Math.atan2(a-this.sy[y],o-this.sx[y]);l.angle_between(-O,-this._start_angle[y],-this._end_angle[y],C)&&T.push([y,S])}return s.create_hit_test_result_from_hits(T);var z,P},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._scenterxy=function(t){var e=(this.sinner_radius[t]+this.souter_radius[t])/2,i=(this._start_angle[t]+this._end_angle[t])/2;return{x:this.sx[t]+e*Math.cos(i),y:this.sy[t]+e*Math.sin(i)}},e.prototype.scenterx=function(t){return this._scenterxy(t).x},e.prototype.scentery=function(t){return this._scenterxy(t).y},e}(r.XYGlyphView);i.AnnularWedgeView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="AnnularWedge",this.prototype.default_view=h,this.mixins(["line","fill"]),this.define({direction:[a.Direction,"anticlock"],inner_radius:[a.DistanceSpec],outer_radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]})},e}(r.XYGlyph);i.AnnularWedge=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(28),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,"data"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sinner_radius,s=i.souter_radius,l=0,h=e;l<h.length;l++){var c=h[l];if(!isNaN(n[c]+r[c]+o[c]+s[c])){if(this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,c),t.beginPath(),a.is_ie)for(var u=0,_=[!1,!0];u<_.length;u++){var p=_[u];t.arc(n[c],r[c],o[c],0,Math.PI,p),t.arc(n[c],r[c],s[c],Math.PI,0,!p)}else t.arc(n[c],r[c],o[c],0,2*Math.PI,!0),t.arc(n[c],r[c],s[c],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.beginPath(),t.arc(n[c],r[c],o[c],0,2*Math.PI),t.moveTo(n[c]+s[c],r[c]),t.arc(n[c],r[c],s[c],0,2*Math.PI),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=n-this.max_outer_radius,s=n+this.max_outer_radius,a=this.renderer.yscale.invert(i),l=a-this.max_outer_radius,h=a+this.max_outer_radius,c=[],u=o.validate_bbox_coords([r,s],[l,h]),_=0,p=this.index.indices(u);_<p.length;_++){var d=p[_],f=Math.pow(this.souter_radius[d],2),v=Math.pow(this.sinner_radius[d],2),m=this.renderer.xscale.r_compute(n,this._x[d]),g=m[0],y=m[1],b=this.renderer.yscale.r_compute(a,this._y[d]),x=b[0],w=b[1],k=Math.pow(g-y,2)+Math.pow(x-w,2);k<=f&&k>=v&&c.push([d,k])}return o.create_hit_test_result_from_hits(c)},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=.5*Math.min(Math.abs(o-n),Math.abs(s-r)),u=new Array(a);u[i]=.4*c;var _=new Array(a);_[i]=.8*c,this._render(t,[i],{sx:l,sy:h,sinner_radius:u,souter_radius:_})},e}(r.XYGlyphView);i.AnnulusView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Annulus",this.prototype.default_view=l,this.mixins(["line","fill"]),this.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},e}(r.XYGlyph);i.Annulus=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle;if(this.visuals.line.doit)for(var l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.ArcView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Arc",this.prototype.default_view=a,this.mixins(["line"]),this.define({direction:[s.Direction,"anticlock"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},e}(r.XYGlyph);i.Arc=l,l.initClass()},function(t,e,i){function n(t,e,i,n,r,o,s,a){for(var l=[],h=[[],[]],c=0;c<=2;c++){var u=void 0,_=void 0,p=void 0;if(0===c?(_=6*t-12*i+6*r,u=-3*t+9*i-9*r+3*s,p=3*i-3*t):(_=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*a,p=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(_)<1e-12)continue;var d=-p/_;0<d&&d<1&&l.push(d)}else{var f=_*_-4*p*u,v=Math.sqrt(f);if(!(f<0)){var m=(-_+v)/(2*u);0<m&&m<1&&l.push(m);var g=(-_-v)/(2*u);0<g&&g<1&&l.push(g)}}}for(var y=l.length,b=y;y--;){var d=l[y],x=1-d,w=x*x*x*t+3*x*x*d*i+3*x*d*d*r+d*d*d*s;h[0][y]=w;var k=x*x*x*e+3*x*x*d*n+3*x*d*d*o+d*d*d*a;h[1][y]=k}return h[0][b]=t,h[1][b]=e,h[0][b+1]=s,h[1][b+1]=a,[Math.min.apply(Math,h[0]),Math.max.apply(Math,h[1]),Math.max.apply(Math,h[0]),Math.min.apply(Math,h[1])]}var r=t(379),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx0[e]+this._cy0[e]+this._cx1[e]+this._cy1[e])){var r=n(this._x0[e],this._y0[e],this._x1[e],this._y1[e],this._cx0[e],this._cy0[e],this._cx1[e],this._cy1[e]),s=r[0],a=r[1],l=r[2],h=r[3];t.push({minX:s,minY:a,maxX:l,maxY:h,i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx0,l=i.scy0,h=i.scx1,c=i.scy1;if(this.visuals.line.doit)for(var u=0,_=e;u<_.length;u++){var p=_[u];isNaN(n[p]+r[p]+o[p]+s[p]+a[p]+l[p]+h[p]+c[p])||(t.beginPath(),t.moveTo(n[p],r[p]),t.bezierCurveTo(a[p],l[p],h[p],c[p],o[p],s[p]),this.visuals.line.set_vectorize(t,p),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error("not implemented")},e.prototype.scentery=function(){throw new Error("not implemented")},e}(s.GlyphView);i.BezierView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type="Bezier",this.prototype.default_view=l,this.coords([["x0","y0"],["x1","y1"],["cx0","cy0"],["cx1","cy1"]]),this.mixins(["line"])},e}(s.Glyph);i.Bezier=h,h.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=t(132),a=t(9),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_box=function(t){for(var e=[],i=0;i<t;i++){var n=this._lrtb(i),o=n[0],s=n[1],a=n[2],l=n[3];!isNaN(o+s+a+l)&&isFinite(o+s+a+l)&&e.push({minX:o,minY:l,maxX:s,maxY:a,i:i})}return new r.RBush(e)},e.prototype._render=function(t,e,i){for(var n=i.sleft,r=i.sright,o=i.stop,s=i.sbottom,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+o[h]+r[h]+s[h])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fillRect(n[h],o[h],r[h]-n[h],s[h]-o[h])),this.visuals.line.doit&&(t.beginPath(),t.rect(n[h],o[h],r[h]-n[h],s[h]-o[h]),this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=a.create_empty_hit_test_result();return s.indices=o,s},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if("v"==t.direction){var r=this.renderer.yscale.invert(n),o=this.renderer.plot_view.frame.bbox.h_range,s=this.renderer.xscale.r_invert(o.start,o.end),l=s[0],h=s[1];e=this.index.indices({minX:l,minY:r,maxX:h,maxY:r})}else{var c=this.renderer.xscale.invert(i),u=this.renderer.plot_view.frame.bbox.v_range,_=this.renderer.yscale.r_invert(u.start,u.end),p=_[0],d=_[1];e=this.index.indices({minX:c,minY:p,maxX:c,maxY:d})}var f=a.create_empty_hit_test_result();return f.indices=e,f},e.prototype.draw_legend_for_index=function(t,e,i){s.generic_area_legend(this.visuals,t,e,i)},e}(o.GlyphView);i.BoxView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Box",this.mixins(["line","fill"])},e}(o.Glyph);i.Box=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(21),l=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){if(null!=this._radius)if("data"==this.model.properties.radius.spec.units){var t=this.model.properties.radius_dimension.spec.value;switch(t){case"x":this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius);break;case"y":this.sradius=this.sdist(this.renderer.yscale,this._y,this._radius)}}else this.sradius=this._radius,this.max_size=2*this.max_radius;else this.sradius=l.map(this._size,function(t){return t/2})},e.prototype._mask_data=function(){var t,e,i,n,r=this.renderer.plot_view.frame.bbox.ranges,s=r[0],a=r[1];if(null!=this._radius&&"data"==this.model.properties.radius.units){var l=s.start,h=s.end;p=this.renderer.xscale.r_invert(l,h),t=p[0],i=p[1],t-=this.max_radius,i+=this.max_radius;var c=a.start,u=a.end;d=this.renderer.yscale.r_invert(c,u),e=d[0],n=d[1],e-=this.max_radius,n+=this.max_radius}else{var l=s.start-this.max_size,h=s.end+this.max_size;f=this.renderer.xscale.r_invert(l,h),t=f[0],i=f[1];var c=a.start-this.max_size,u=a.end+this.max_size;v=this.renderer.yscale.r_invert(c,u),e=v[0],n=v[1]}var _=o.validate_bbox_coords([t,i],[e,n]);return this.index.indices(_);var p,d,f,v},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=0,a=e;s<a.length;s++){var l=a[s];isNaN(n[l]+r[l]+o[l])||(t.beginPath(),t.arc(n[l],r[l],o[l],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,l),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,l),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,s,a,l,h,c,u,_=t.sx,p=t.sy,d=this.renderer.xscale.invert(_),f=this.renderer.yscale.invert(p);null!=this._radius&&"data"==this.model.properties.radius.units?(l=d-this.max_radius,h=d+this.max_radius,c=f-this.max_radius,u=f+this.max_radius):(n=_-this.max_size,r=_+this.max_size,S=this.renderer.xscale.r_invert(n,r),l=S[0],h=S[1],C=[Math.min(l,h),Math.max(l,h)],l=C[0],h=C[1],s=p-this.max_size,a=p+this.max_size,T=this.renderer.yscale.r_invert(s,a),c=T[0],u=T[1],A=[Math.min(c,u),Math.max(c,u)],c=A[0],u=A[1]);var v=o.validate_bbox_coords([l,h],[c,u]),m=this.index.indices(v),g=[];if(null!=this._radius&&"data"==this.model.properties.radius.units)for(var y=0,b=m;y<b.length;y++){var x=b[y];i=Math.pow(this.sradius[x],2),E=this.renderer.xscale.r_compute(d,this._x[x]),n=E[0],r=E[1],M=this.renderer.yscale.r_compute(f,this._y[x]),s=M[0],a=M[1],(e=Math.pow(n-r,2)+Math.pow(s-a,2))<=i&&g.push([x,e])}else for(var w=0,k=m;w<k.length;w++){var x=k[w];i=Math.pow(this.sradius[x],2),(e=Math.pow(this.sx[x]-_,2)+Math.pow(this.sy[x]-p,2))<=i&&g.push([x,e])}return o.create_hit_test_result_from_hits(g);var S,C,T,A,E,M},e.prototype._hit_span=function(t){var e,i,n,r,s,a=t.sx,l=t.sy,h=this.bounds(),c=h.minX,u=h.minY,_=h.maxX,p=h.maxY,d=o.create_empty_hit_test_result();if("h"==t.direction){var f=void 0,v=void 0;r=u,s=p,null!=this._radius&&"data"==this.model.properties.radius.units?(f=a-this.max_radius,v=a+this.max_radius,x=this.renderer.xscale.r_invert(f,v),i=x[0],n=x[1]):(e=this.max_size/2,f=a-e,v=a+e,w=this.renderer.xscale.r_invert(f,v),i=w[0],n=w[1])}else{var m=void 0,g=void 0;i=c,n=_,null!=this._radius&&"data"==this.model.properties.radius.units?(m=l-this.max_radius,g=l+this.max_radius,k=this.renderer.yscale.r_invert(m,g),r=k[0],s=k[1]):(e=this.max_size/2,m=l-e,g=l+e,S=this.renderer.yscale.r_invert(m,g),r=S[0],s=S[1])}var y=o.validate_bbox_coords([i,n],[r,s]),b=this.index.indices(y);return d.indices=b,d;var x,w,k,S},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=a.range(0,this.sx.length),r=[],s=0,l=n.length;s<l;s++){var h=n[s];o.point_in_poly(this.sx[s],this.sy[s],e,i)&&r.push(h)}var c=o.create_empty_hit_test_result();return c.indices=r,c},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=new Array(a);c[i]=.2*Math.min(Math.abs(o-n),Math.abs(s-r)),this._render(t,[i],{sx:l,sy:h,sradius:c})},e}(r.XYGlyphView);i.CircleView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Circle",this.prototype.default_view=h,this.mixins(["line","fill"]),this.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:"screen",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,"x"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.properties.radius.optional=!0},e}(r.XYGlyph);i.Circle=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,"data"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h]+this._angle[h])||(t.beginPath(),t.ellipse(n[h],r[h],o[h]/2,s[h]/2,this._angle[h],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);c>1?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.EllipseView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Ellipse",this.prototype.default_view=s,this.mixins(["line","fill"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},e}(r.XYGlyph);i.Ellipse=a,a.initClass()},function(t,e,i){var n=t(379),r=t(9),o=t(15),s=t(24),a=t(33),l=t(49),h=t(48),c=t(53),u=t(14),_=t(22),p=t(32),d=t(44),f=t(120),v=t(165),m=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._nohit_warned={},t}return n.__extends(i,e),i.prototype.initialize=function(i){e.prototype.initialize.call(this,i),this._nohit_warned={},this.renderer=i.renderer,this.visuals=new l.Visuals(this.model);var n=this.renderer.plot_view.gl;if(null!=n){var r=null;try{r=t(440)}catch(t){if("MODULE_NOT_FOUND"!==t.code)throw t;u.logger.warn("WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering.")}if(null!=r){var o=r[this.model.type+"GLGlyph"];null!=o&&(this.glglyph=new o(n.ctx,this))}}},i.prototype.set_visuals=function(t){this.visuals.warm_cache(t),null!=this.glglyph&&this.glglyph.set_visuals_changed()},i.prototype.render=function(t,e,i){t.beginPath(),null!=this.glglyph&&this.glglyph.render(t,e,i)||this._render(t,e,i)},i.prototype.has_finished=function(){return!0},i.prototype.notify_finished=function(){this.renderer.notify_finished()},i.prototype._bounds=function(t){return t},i.prototype.bounds=function(){return this._bounds(this.index.bbox)},i.prototype.log_bounds=function(){for(var t=s.empty(),e=this.index.search(s.positive_x()),i=0,n=e;i<n.length;i++){var r=n[i];r.minX<t.minX&&(t.minX=r.minX),r.maxX>t.maxX&&(t.maxX=r.maxX)}for(var o=this.index.search(s.positive_y()),a=0,l=o;a<l.length;a++){var h=l[a];h.minY<t.minY&&(t.minY=h.minY),h.maxY>t.maxY&&(t.maxY=h.maxY)}return this._bounds(t)},i.prototype.get_anchor_point=function(t,e,i){var n=i[0],r=i[1];switch(t){case"center":return{x:this.scenterx(e,n,r),y:this.scentery(e,n,r)};default:return null}},i.prototype.sdist=function(t,e,i,n,r){void 0===n&&(n="edge"),void 0===r&&(r=!1);var o,s,a=e.length;if("center"==n){var l=_.map(i,function(t){return t/2});o=new Float64Array(a);for(var h=0;h<a;h++)o[h]=e[h]-l[h];s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=e[h]+l[h]}else{o=e,s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=o[h]+i[h]}var c=t.v_compute(o),u=t.v_compute(s);return r?_.map(c,function(t,e){return Math.ceil(Math.abs(u[e]-c[e]))}):_.map(c,function(t,e){return Math.abs(u[e]-c[e])})},i.prototype.draw_legend_for_index=function(t,e,i){},i.prototype.hit_test=function(t){var e=null,i="_hit_"+t.type;return null!=this[i]?e=this[i](t):null==this._nohit_warned[t.type]&&(u.logger.debug("'"+t.type+"' selection not available for "+this.model.type),this._nohit_warned[t.type]=!0),e},i.prototype._hit_rect_against_index=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,o=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,o),c=h[0],u=h[1],_=r.validate_bbox_coords([a,l],[c,u]),p=r.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},i.prototype.set_data=function(t,e,i){var n=this.model.materialize_dataspecs(t);if(this.visuals.set_all_indices(e),e&&!(this instanceof f.LineView)){var r={},o=function(t){var i=n[t];"_"===t.charAt(0)?r[t]=e.map(function(t){return i[t]}):r[t]=i};for(var s in n)o(s);n=r}if(p.extend(this,n),this.renderer.plot_view.model.use_map&&(null!=this._x&&(g=a.project_xy(this._x,this._y),this._x=g[0],this._y=g[1]),null!=this._xs&&(y=a.project_xsys(this._xs,this._ys),this._xs=y[0],this._ys=y[1])),null!=this.renderer.plot_view.frame.x_ranges)for(var l=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],h=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],c=0,u=this.model._coords;c<u.length;c++){var _=u[c],d=_[0],m=_[1];d="_"+d,m="_"+m,l instanceof v.FactorRange&&(this[d]=l.v_synthetic(this[d])),h instanceof v.FactorRange&&(this[m]=h.v_synthetic(this[m]))}null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(i),this.index_data();var g,y},i.prototype._set_data=function(t){},i.prototype.index_data=function(){this.index=this._index_data()},i.prototype.mask_data=function(t){return null!=this.glglyph||null==this._mask_data?t:this._mask_data()},i.prototype.map_data=function(){for(var t=0,e=this.model._coords;t<e.length;t++){var i=e[t],n=i[0],r=i[1],o="s"+n,s="s"+r;if(n="_"+n,r="_"+r,null!=this[n]&&(d.isArray(this[n][0])||d.isTypedArray(this[n][0]))){var a=this[n].length;this[o]=new Array(a),this[s]=new Array(a);for(var l=0;l<a;l++){var h=this.map_to_screen(this[n][l],this[r][l]),c=h[0],u=h[1];this[o][l]=c,this[s][l]=u}}else _=this.map_to_screen(this[n],this[r]),this[o]=_[0],this[s]=_[1]}this._map_data();var _},i.prototype._map_data=function(){},i.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},i}(h.View);i.GlyphView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Glyph",this.prototype._coords=[],this.internal({x_range_name:[o.String,"default"],y_range_name:[o.String,"default"]})},e.coords=function(t){var e=this.prototype._coords.concat(t);this.prototype._coords=e;for(var i={},n=0,r=t;n<r.length;n++){var s=r[n],a=s[0],l=s[1];i[a]=[o.NumberSpec],i[l]=[o.NumberSpec]}this.define(i)},e}(c.Model);i.Glyph=g,g.initClass()},function(t,e,i){var n=t(379),r=t(110),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._index_data=function(){return this._index_box(this._y.length)},e.prototype._lrtb=function(t){var e=Math.min(this._left[t],this._right[t]),i=Math.max(this._left[t],this._right[t]),n=this._y[t]+.5*this._height[t],r=this._y[t]-.5*this._height[t];return[e,i,n,r]},e.prototype._map_data=function(){this.sy=this.renderer.yscale.v_compute(this._y),this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"),this.sleft=this.renderer.xscale.v_compute(this._left),this.sright=this.renderer.xscale.v_compute(this._right);var t=this.sy.length;this.stop=new Float64Array(t),this.sbottom=new Float64Array(t);for(var e=0;e<t;e++)this.stop[e]=this.sy[e]-this.sh[e]/2,this.sbottom[e]=this.sy[e]+this.sh[e]/2},e}(r.BoxView);i.HBarView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="HBar",this.prototype.default_view=s,this.coords([["left","y"]]),this.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),this.override({left:0})},e}(r.Box);i.HBar=a,a.initClass()},function(t,e,i){var n=t(379),r=t(113),o=t(9),s=t(15),a=t(37),l=t(132),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._set_data=function(){var t=this._q.length,e=this.model.size,i=this.model.aspect_scale;if(this._x=new Float64Array(t),this._y=new Float64Array(t),"pointytop"==this.model.orientation)for(var n=0;n<t;n++)this._x[n]=e*Math.sqrt(3)*(this._q[n]+this._r[n]/2)/i,this._y[n]=3*-e/2*this._r[n];else for(var n=0;n<t;n++)this._x[n]=3*e/2*this._q[n],this._y[n]=-e*Math.sqrt(3)*(this._r[n]+this._q[n]/2)*i},e.prototype._index_data=function(){var t=this.model.size,e=Math.sqrt(3)*t/2;"flattop"==this.model.orientation?(e=(s=[t,e])[0],t=s[1],t*=this.model.aspect_scale):e/=this.model.aspect_scale;for(var i=[],n=0;n<this._x.length;n++){var r=this._x[n],o=this._y[n];!isNaN(r+o)&&isFinite(r+o)&&i.push({minX:r-e,minY:o-t,maxX:r+e,maxY:o+t,i:n})}return new a.RBush(i);var s},e.prototype.map_data=function(){t=this.map_to_screen(this._x,this._y),this.sx=t[0],this.sy=t[1],e=this._get_unscaled_vertices(),this.svx=e[0],this.svy=e[1];var t,e},e.prototype._get_unscaled_vertices=function(){var t=this.model.size,e=this.model.aspect_scale;if("pointytop"==this.model.orientation){var i=this.renderer.yscale,n=this.renderer.xscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))/e,s=r/2,a=[0,-o,-o,0,o,o],l=[r,s,-s,-r,-s,s];return[a,l]}var i=this.renderer.xscale,n=this.renderer.yscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))*e,s=r/2,a=[r,s,-s,-r,-s,s],l=[0,-o,-o,0,o,o];return[a,l]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.svx,s=i.svy,a=i._scale,l=0,h=e;l<h.length;l++){var c=h[l];if(!isNaN(n[c]+r[c]+a[c])){t.translate(n[c],r[c]),t.beginPath();for(var u=0;u<6;u++)t.lineTo(o[u]*a[c],s[u]*a[c]);t.closePath(),t.translate(-n[c],-r[c]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),s=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),a=[],l=0,h=s;l<h.length;l++){var c=h[l];o.point_in_poly(e-this.sx[c],i-this.sy[c],this.svx,this.svy)&&a.push(c)}var u=o.create_empty_hit_test_result();return u.indices=a,u},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if("v"==t.direction){var r=this.renderer.yscale.invert(n),s=this.renderer.plot_view.frame.bbox.h_range,a=this.renderer.xscale.r_invert(s.start,s.end),l=a[0],h=a[1];e=this.index.indices({minX:l,minY:r,maxX:h,maxY:r})}else{var c=this.renderer.xscale.invert(i),u=this.renderer.plot_view.frame.bbox.v_range,_=this.renderer.yscale.r_invert(u.start,u.end),p=_[0],d=_[1];e=this.index.indices({minX:c,minY:p,maxX:c,maxY:d})}var f=o.create_empty_hit_test_result();return f.indices=e,f},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype.draw_legend_for_index=function(t,e,i){l.generic_area_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.HexTileView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="HexTile",this.prototype.default_view=h,this.coords([["r","q"]]),this.mixins(["line","fill"]),this.define({size:[s.Number,1],aspect_scale:[s.Number,1],scale:[s.NumberSpec,1],orientation:[s.String,"pointytop"]}),this.override({line_color:null})},e}(r.Glyph);i.HexTile=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(154),s=t(15),a=t(21),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return i._update_image()}),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._update_image=function(){null!=this.image_data&&(this._set_data(),this.renderer.plot_view.request_render())},e.prototype._set_data=function(){null!=this.image_data&&this.image_data.length==this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length==this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length==this._image.length||(this._height=new Array(this._image.length));for(var t=this.model.color_mapper.rgba_mapper,e=0,i=this._image.length;e<i;e++){var n=void 0;if(null!=this._image_shape&&this._image_shape[e].length>0){n=this._image[e];var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e];n=a.concat(o),this._height[e]=o.length,this._width[e]=o[0].length}var s=this.image_data[e],l=void 0;null!=s&&s.width==this._width[e]&&s.height==this._height[e]?l=s:((l=document.createElement("canvas")).width=this._width[e],l.height=this._height[e]);var h=l.getContext("2d"),c=h.getImageData(0,0,this._width[e],this._height[e]),u=t.v_compute(n);c.data.set(u),h.putImageData(c,0,0),this.image_data[e]=l,this.max_dw=0,"data"==this.model.properties.dw.units&&(this.max_dw=a.max(this._dw)),this.max_dh=0,"data"==this.model.properties.dh.units&&(this.max_dh=a.max(this._dh))}},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);break;case"screen":this.sh=this._dh}},e.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(null!=n[u]&&!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},e.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);i.ImageView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Image",this.prototype.default_view=l,this.define({image:[s.NumberSpec],dw:[s.DistanceSpec],dh:[s.DistanceSpec],dilate:[s.Bool,!1],global_alpha:[s.Number,1],color_mapper:[s.Instance,function(){return new o.LinearColorMapper({palette:["#000000","#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0","#ffffff"]})}]})},e}(r.XYGlyph);i.Image=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=t(21),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._set_data=function(t){null!=this.image_data&&this.image_data.length==this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length==this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length==this._image.length||(this._height=new Array(this._image.length));for(var e=0,i=this._image.length;e<i;e++)if(!(null!=t&&t.indexOf(e)<0)){var n=void 0;if(null!=this._image_shape&&this._image_shape[e].length>0){n=this._image[e].buffer;var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e],a=s.concat(o);n=new ArrayBuffer(4*a.length);for(var l=new Uint32Array(n),h=0,c=a.length;h<c;h++)l[h]=a[h];this._height[e]=o.length,this._width[e]=o[0].length}var u=this.image_data[e],_=void 0;null!=u&&u.width==this._width[e]&&u.height==this._height[e]?_=u:((_=document.createElement("canvas")).width=this._width[e],_.height=this._height[e]);var p=_.getContext("2d"),d=p.getImageData(0,0,this._width[e],this._height[e]),f=new Uint8Array(n);d.data.set(f),p.putImageData(d,0,0),this.image_data[e]=_,this.max_dw=0,"data"==this.model.properties.dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,"data"==this.model.properties.dh.units&&(this.max_dh=s.max(this._dh))}},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);break;case"screen":this.sh=this._dh}},e.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},e.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);i.ImageRGBAView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ImageRGBA",this.prototype.default_view=a,this.define({image:[o.NumberSpec],dw:[o.DistanceSpec],dh:[o.DistanceSpec],global_alpha:[o.Number,1],dilate:[o.Bool,!1]})},e}(r.XYGlyph);i.ImageRGBA=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(14),s=t(15),a=t(22),l=t(37);i.CanvasImage=Image;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._images_rendered=!1,e}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._index_data=function(){return new l.RBush([])},e.prototype._set_data=function(){var t=this;null!=this.image&&this.image.length==this._url.length||(this.image=a.map(this._url,function(){return null}));var e=this.model,n=e.retry_attempts,r=e.retry_timeout;this.retries=a.map(this._url,function(){return n});for(var s=function(e,s){if(null==l._url[e])return"continue";var a=new i.CanvasImage;a.onerror=function(){t.retries[e]>0?(o.logger.trace("ImageURL failed to load "+t._url[e]+" image, retrying in "+r+" ms"),setTimeout(function(){return a.src=t._url[e]},r)):o.logger.warn("ImageURL unable to load "+t._url[e]+" image after "+n+" retries"),t.retries[e]-=1},a.onload=function(){t.image[e]=a,t.renderer.request_render()},a.src=l._url[e]},l=this,h=0,c=this._url.length;h<c;h++)s(h,c)},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&1==this._images_rendered},e.prototype._map_data=function(){var t=null!=this.model.w?this._w:a.map(this._x,function(){return NaN}),e=null!=this.model.h?this._h:a.map(this._x,function(){return NaN});switch(this.model.properties.w.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,t,"edge",this.model.dilate);break;case"screen":this.sw=t}switch(this.model.properties.h.units){case"data":this.sh=this.sdist(this.renderer.yscale,this._y,e,"edge",this.model.dilate);break;case"screen":this.sh=e}},e.prototype._render=function(t,e,i){i._url;var n=i.image,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=i._angle,h=this.renderer.plot_view.frame;t.rect(h._left.value+1,h._top.value+1,h._width.value-2,h._height.value-2),t.clip();for(var c=!0,u=0,_=e;u<_.length;u++){var p=_[u];if(!isNaN(r[p]+o[p]+l[p])&&-1!=this.retries[p]){var d=n[p];null!=d?this._render_image(t,p,d,r,o,s,a,l):c=!1}}c&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())},e.prototype._final_sx_sy=function(t,e,i,n,r){switch(t){case"top_left":return[e,i];case"top_center":return[e-n/2,i];case"top_right":return[e-n,i];case"center_right":return[e-n,i-r/2];case"bottom_right":return[e-n,i-r];case"bottom_center":return[e-n/2,i-r];case"bottom_left":return[e,i-r];case"center_left":return[e,i-r/2];case"center":return[e-n/2,i-r/2]}},e.prototype._render_image=function(t,e,i,n,r,o,s,a){isNaN(o[e])&&(o[e]=i.width),isNaN(s[e])&&(s[e]=i.height);var l=this.model.anchor,h=this._final_sx_sy(l,n[e],r[e],o[e],s[e]),c=h[0],u=h[1];t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(c,u),t.rotate(a[e]),t.drawImage(i,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-c,-u)):t.drawImage(i,c,u,o[e],s[e]),t.restore()},e}(r.XYGlyphView);i.ImageURLView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ImageURL",this.prototype.default_view=h,this.define({url:[s.StringSpec],anchor:[s.Anchor,"top_left"],global_alpha:[s.Number,1],angle:[s.AngleSpec,0],w:[s.DistanceSpec],h:[s.DistanceSpec],dilate:[s.Bool,!1],retry_attempts:[s.Number,0],retry_timeout:[s.Number,0]})},e}(r.XYGlyph);i.ImageURL=c,c.initClass()},function(t,e,i){var n=t(106);i.AnnularWedge=n.AnnularWedge;var r=t(107);i.Annulus=r.Annulus;var o=t(108);i.Arc=o.Arc;var s=t(109);i.Bezier=s.Bezier;var a=t(111);i.Circle=a.Circle;var l=t(112);i.Ellipse=l.Ellipse;var h=t(113);i.Glyph=h.Glyph;var c=t(114);i.HBar=c.HBar;var u=t(115);i.HexTile=u.HexTile;var _=t(116);i.Image=_.Image;var p=t(117);i.ImageRGBA=p.ImageRGBA;var d=t(118);i.ImageURL=d.ImageURL;var f=t(120);i.Line=f.Line;var v=t(121);i.MultiLine=v.MultiLine;var m=t(122);i.Oval=m.Oval;var g=t(123);i.Patch=g.Patch;var y=t(124);i.Patches=y.Patches;var b=t(125);i.Quad=b.Quad;var x=t(126);i.Quadratic=x.Quadratic;var w=t(127);i.Ray=w.Ray;var k=t(128);i.Rect=k.Rect;var S=t(129);i.Segment=S.Segment;var C=t(130);i.Step=C.Step;var T=t(131);i.Text=T.Text;var A=t(133);i.VBar=A.VBar;var E=t(134);i.Wedge=E.Wedge;var M=t(135);i.XYGlyph=M.XYGlyph},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=!1,s=null;this.visuals.line.set_value(t);for(var a=0,l=e;a<l.length;a++){var h=l[a];if(o){if(!isFinite(n[h]+r[h])){t.stroke(),t.beginPath(),o=!1,s=h;continue}null!=s&&h-s>1&&(t.stroke(),o=!1)}o?t.lineTo(n[h],r[h]):(t.beginPath(),t.moveTo(n[h],r[h]),o=!0),s=h}o&&t.stroke()},e.prototype._hit_point=function(t){for(var e=this,i=s.create_empty_hit_test_result(),n={x:t.sx,y:t.sy},r=9999,o=Math.max(2,this.visuals.line.line_width.value()/2),a=0,l=this.sx.length-1;a<l;a++){var h={x:this.sx[a],y:this.sy[a]},c={x:this.sx[a+1],y:this.sy[a+1]},u=s.dist_to_segment(n,h,c);u<o&&u<r&&(r=u,i.add_to_selected_glyphs(this.model),i.get_view=function(){return e},i.line_indices=[a])}return i},e.prototype._hit_span=function(t){var e,i,n=this,r=t.sx,o=t.sy,a=s.create_empty_hit_test_result();"v"==t.direction?(e=this.renderer.yscale.invert(o),i=this._y):(e=this.renderer.xscale.invert(r),i=this._x);for(var l=0,h=i.length-1;l<h;l++)(i[l]<=e&&e<=i[l+1]||i[l+1]<=e&&e<=i[l])&&(a.add_to_selected_glyphs(this.model),a.get_view=function(){return n},a.line_indices.push(l));return a},e.prototype.get_interpolation_hit=function(t,e){var i,n,r,o,a=e.sx,l=e.sy,h=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],c=h[0],u=h[1],_=h[2],p=h[3];"point"==e.type?(m=this.renderer.yscale.r_invert(l-1,l+1),r=m[0],o=m[1],g=this.renderer.xscale.r_invert(a-1,a+1),i=g[0],n=g[1]):"v"==e.direction?(y=this.renderer.yscale.r_invert(l,l),r=y[0],o=y[1],i=(b=[c,_])[0],n=b[1]):(x=this.renderer.xscale.r_invert(a,a),i=x[0],n=x[1],r=(w=[u,p])[0],o=w[1]);var d=s.check_2_segments_intersect(i,r,n,o,c,u,_,p),f=d.x,v=d.y;return[f,v];var m,g,y,b,x,w},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.LineView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Line",this.prototype.default_view=a,this.mixins(["line"])},e}(r.XYGlyph);i.Line=l,l.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(9),s=t(32),a=t(21),l=t(44),h=t(113),c=t(132),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._xs.length;e<i;e++)if(null!=this._xs[e]&&0!==this._xs[e].length){for(var n=this._xs[e],o=[],s=0,h=n.length;s<h;s++){var c=n[s];l.isStrictNaN(c)||o.push(c)}for(var u=this._ys[e],_=[],s=0,h=u.length;s<h;s++){var p=u[s];l.isStrictNaN(p)||_.push(p)}var d=[a.min(o),a.max(o)],f=d[0],v=d[1],m=[a.min(_),a.max(_)],g=m[0],y=m[1];t.push({minX:f,minY:g,maxX:v,maxY:y,i:e})}return new r.RBush(t)},e.prototype._render=function(t,e,i){for(var n=i.sxs,r=i.sys,o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u])||isNaN(c[u])?(t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.stroke()}},e.prototype._hit_point=function(t){for(var e=o.create_empty_hit_test_result(),i={x:t.sx,y:t.sy},n=9999,r={},a=0,l=this.sxs.length;a<l;a++){for(var h=Math.max(2,this.visuals.line.cache_select("line_width",a)/2),c=null,u=0,_=this.sxs[a].length-1;u<_;u++){var p={x:this.sxs[a][u],y:this.sys[a][u]},d={x:this.sxs[a][u+1],y:this.sys[a][u+1]},f=o.dist_to_segment(i,p,d);f<h&&f<n&&(n=f,c=[u])}c&&(r[a]=c)}return e.indices=s.keys(r).map(function(t){return parseInt(t,10)}),e.multiline_indices=r,e},e.prototype._hit_span=function(t){var e,i,n=t.sx,r=t.sy,a=o.create_empty_hit_test_result();"v"===t.direction?(e=this.renderer.yscale.invert(r),i=this._ys):(e=this.renderer.xscale.invert(n),i=this._xs);for(var l={},h=0,c=i.length;h<c;h++){for(var u=[],_=0,p=i[h].length-1;_<p;_++)i[h][_]<=e&&e<=i[h][_+1]&&u.push(_);u.length>0&&(l[h]=u)}return a.indices=s.keys(l).map(function(t){return parseInt(t,10)}),a.multiline_indices=l,a},e.prototype.get_interpolation_hit=function(t,e,i){var n,r,s,a,l=i.sx,h=i.sy,c=this._xs[t][e],u=this._ys[t][e],_=this._xs[t][e+1],p=this._ys[t][e+1];"point"==i.type?(m=this.renderer.yscale.r_invert(h-1,h+1),s=m[0],a=m[1],g=this.renderer.xscale.r_invert(l-1,l+1),n=g[0],r=g[1]):"v"==i.direction?(y=this.renderer.yscale.r_invert(h,h),s=y[0],a=y[1],n=(b=[c,_])[0],r=b[1]):(x=this.renderer.xscale.r_invert(l,l),n=x[0],r=x[1],s=(w=[u,p])[0],a=w[1]);var d=o.check_2_segments_intersect(n,s,r,a,c,u,_,p),f=d.x,v=d.y;return[f,v];var m,g,y,b,x,w},e.prototype.draw_legend_for_index=function(t,e,i){c.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error("not implemented")},e.prototype.scentery=function(){throw new Error("not implemented")},e}(h.GlyphView);i.MultiLineView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MultiLine",this.prototype.default_view=u,this.coords([["xs","ys"]]),this.mixins(["line"])},e}(h.Glyph);i.MultiLine=_,_.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,"data"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=i._angle,l=0,h=e;l<h.length;l++){var c=h[l];isNaN(n[c]+r[c]+o[c]+s[c]+a[c])||(t.translate(n[c],r[c]),t.rotate(a[c]),t.beginPath(),t.moveTo(0,-s[c]/2),t.bezierCurveTo(o[c]/2,-s[c]/2,o[c]/2,s[c]/2,0,s[c]/2),t.bezierCurveTo(-o[c]/2,s[c]/2,-o[c]/2,-s[c]/2,0,-s[c]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke()),t.rotate(-a[c]),t.translate(-n[c],-r[c]))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);c>1?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.OvalView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Oval",this.prototype.default_view=s,this.mixins(["line","fill"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},e}(r.XYGlyph);i.Oval=a,a.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy;if(this.visuals.fill.doit){this.visuals.fill.set_value(t);for(var o=0,s=e;o<s.length;o++){var a=s[o];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_value(t);for(var l=0,h=e;l<h.length;l++){var a=h[l];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.PatchView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Patch",this.prototype.default_view=s,this.mixins(["line","fill"])},e}(r.XYGlyph);i.Patch=a,a.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=t(132),a=t(21),l=t(22),h=t(44),c=t(9),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._build_discontinuous_object=function(t){for(var e=[],i=0,n=t.length;i<n;i++){e[i]=[];for(var r=a.copy(t[i]);r.length>0;){var o=a.findLastIndex(r,function(t){return h.isStrictNaN(t)}),s=void 0;o>=0?s=r.splice(o):(s=r,r=[]);var l=s.filter(function(t){return!h.isStrictNaN(t)});e[i].push(l)}}return e},e.prototype._index_data=function(){for(var t=this._build_discontinuous_object(this._xs),e=this._build_discontinuous_object(this._ys),i=[],n=0,o=this._xs.length;n<o;n++)for(var s=0,l=t[n].length;s<l;s++){var h=t[n][s],c=e[n][s];0!=h.length&&i.push({minX:a.min(h),minY:a.min(c),maxX:a.max(h),maxY:a.max(c),i:n})}return new r.RBush(i)},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.x_ranges.default,e=[t.min,t.max],i=e[0],n=e[1],r=this.renderer.plot_view.frame.y_ranges.default,o=[r.min,r.max],s=o[0],a=o[1],l=c.validate_bbox_coords([i,n],[s,a]),h=this.index.indices(l);return h.sort(function(t,e){return t-e})},e.prototype._render=function(t,e,i){var n=i.sxs,r=i.sys;this.sxss=this._build_discontinuous_object(n),this.syss=this._build_discontinuous_object(r);for(var o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];if(this.visuals.fill.doit){this.visuals.fill.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.stroke()}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=[],a=0,l=o.length;a<l;a++)for(var h=o[a],u=this.sxss[h],_=this.syss[h],p=0,d=u.length;p<d;p++)c.point_in_poly(e,i,u[p],_[p])&&s.push(h);var f=c.create_empty_hit_test_result();return f.indices=s,f},e.prototype._get_snap_coord=function(t){return l.sum(t)/t.length},e.prototype.scenterx=function(t,e,i){if(1==this.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(c.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(n[o]);throw new Error("unreachable code")},e.prototype.scentery=function(t,e,i){if(1==this.syss[t].length)return this._get_snap_coord(this.sys[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(c.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(r[o]);throw new Error("unreachable code")},e.prototype.draw_legend_for_index=function(t,e,i){s.generic_area_legend(this.visuals,t,e,i)},e}(o.GlyphView);i.PatchesView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Patches",this.prototype.default_view=u,this.coords([["xs","ys"]]),this.mixins(["line","fill"])},e}(o.Glyph);i.Patches=_,_.initClass()},function(t,e,i){var n=t(379),r=t(110),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.get_anchor_point=function(t,e,i){var n=Math.min(this.sleft[e],this.sright[e]),r=Math.max(this.sright[e],this.sleft[e]),o=Math.min(this.stop[e],this.sbottom[e]),s=Math.max(this.sbottom[e],this.stop[e]);switch(t){case"top_left":return{x:n,y:o};case"top_center":return{x:(n+r)/2,y:o};case"top_right":return{x:r,y:o};case"center_right":return{x:r,y:(o+s)/2};case"bottom_right":return{x:r,y:s};case"bottom_center":return{x:(n+r)/2,y:s};case"bottom_left":return{x:n,y:s};case"center_left":return{x:n,y:(o+s)/2};case"center":return{x:(n+r)/2,y:(o+s)/2};default:return null}},e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e=this._left[t],i=this._right[t],n=this._top[t],r=this._bottom[t];return[e,i,n,r]},e}(r.BoxView);i.QuadView=o;var s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Quad",this.prototype.default_view=o,this.coords([["right","bottom"],["left","top"]])},e}(r.Box);i.Quad=s,s.initClass()},function(t,e,i){function n(t,e,i){if(e==(t+i)/2)return[t,i];var n=(t-e)/(t-2*e+i),r=t*Math.pow(1-n,2)+2*e*(1-n)*n+i*Math.pow(n,2);return[Math.min(t,i,r),Math.max(t,i,r)]}var r=t(379),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx[e]+this._cy[e])){var r=n(this._x0[e],this._cx[e],this._x1[e]),s=r[0],a=r[1],l=n(this._y0[e],this._cy[e],this._y1[e]),h=l[0],c=l[1];t.push({minX:s,minY:h,maxX:a,maxY:c,i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx,l=i.scy;if(this.visuals.line.doit)for(var h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u]+l[u])||(t.beginPath(),t.moveTo(n[u],r[u]),t.quadraticCurveTo(a[u],l[u],o[u],s[u]),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error("not implemented")},e.prototype.scentery=function(){throw new Error("not implemented")},e}(s.GlyphView);i.QuadraticView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type="Quadratic",this.prototype.default_view=l,this.coords([["x0","y0"],["x1","y1"],["cx","cy"]]),this.mixins(["line"])},e}(s.Glyph);i.Quadratic=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){"data"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this._length):this.slength=this._length},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.slength,s=i._angle;if(this.visuals.line.doit){for(var a=this.renderer.plot_view.frame._width.value,l=this.renderer.plot_view.frame._height.value,h=2*(a+l),c=0,u=o.length;c<u;c++)0==o[c]&&(o[c]=h);for(var _=0,p=e;_<p.length;_++){var c=p[_];isNaN(n[c]+r[c]+s[c]+o[c])||(t.translate(n[c],r[c]),t.rotate(s[c]),t.beginPath(),t.moveTo(0,0),t.lineTo(o[c],0),this.visuals.line.set_vectorize(t,c),t.stroke(),t.rotate(-s[c]),t.translate(-n[c],-r[c]))}}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.RayView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Ray",this.prototype.default_view=a,this.mixins(["line"]),this.define({length:[s.DistanceSpec],angle:[s.AngleSpec]})},e}(r.XYGlyph);i.Ray=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,"data"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){if("data"==this.model.properties.width.units)r=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale),this.sw=r[0],this.sx0=r[1];else{this.sw=this._width;var t=this.sx.length;this.sx0=new Float64Array(t);for(var e=0;e<t;e++)this.sx0[e]=this.sx[e]-this.sw[e]/2}if("data"==this.model.properties.height.units)o=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale),this.sh=o[0],this.sy1=o[1];else{this.sh=this._height;var i=this.sy.length;this.sy1=new Float64Array(i);for(var e=0;e<i;e++)this.sy1[e]=this.sy[e]-this.sh[e]/2}var n=this.sw.length;this.ssemi_diag=new Float64Array(n);for(var e=0;e<n;e++)this.ssemi_diag[e]=Math.sqrt(this.sw[e]/2*this.sw[e]/2+this.sh[e]/2*this.sh[e]/2);var r,o},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sx0,s=i.sy1,a=i.sw,l=i.sh,h=i._angle;if(this.visuals.fill.doit)for(var c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||(this.visuals.fill.set_vectorize(t,_),h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.fillRect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.fillRect(o[_],s[_],a[_],l[_]))}if(this.visuals.line.doit){t.beginPath();for(var p=0,d=e;p<d.length;p++){var _=d[p];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||0!=a[_]&&0!=l[_]&&(h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.rect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.rect(o[_],s[_],a[_],l[_]),this.visuals.line.set_vectorize(t,_),t.stroke(),t.beginPath())}t.stroke()}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=[],a=0,h=this.sx0.length;a<h;a++)o.push(this.sx0[a]+this.sw[a]/2);for(var c=[],a=0,h=this.sy1.length;a<h;a++)c.push(this.sy1[a]+this.sh[a]/2);for(var u=l.max(this._ddist(0,o,this.ssemi_diag)),_=l.max(this._ddist(1,c,this.ssemi_diag)),p=n-u,d=n+u,f=r-_,v=r+_,m=[],g=s.validate_bbox_coords([p,d],[f,v]),y=0,b=this.index.indices(g);y<b.length;y++){var a=b[y],x=void 0,w=void 0;if(this._angle[a]){var k=Math.sin(-this._angle[a]),S=Math.cos(-this._angle[a]),C=S*(e-this.sx[a])-k*(i-this.sy[a])+this.sx[a],T=k*(e-this.sx[a])+S*(i-this.sy[a])+this.sy[a];e=C,i=T,w=Math.abs(this.sx[a]-e)<=this.sw[a]/2,x=Math.abs(this.sy[a]-i)<=this.sh[a]/2}else w=e-this.sx0[a]<=this.sw[a]&&e-this.sx0[a]>=0,x=i-this.sy1[a]<=this.sh[a]&&i-this.sy1[a]>=0;x&&w&&m.push(a)}var A=s.create_empty_hit_test_result();return A.indices=m,A},e.prototype._map_dist_corner_for_data_side_length=function(t,e,i){for(var n=t.length,r=new Float64Array(n),o=new Float64Array(n),s=0;s<n;s++)r[s]=Number(t[s])-e[s]/2,o[s]=Number(t[s])+e[s]/2;for(var a=i.v_compute(r),l=i.v_compute(o),h=this.sdist(i,r,e,"edge",this.model.dilate),c=a,s=0,u=a.length;s<u;s++)if(a[s]!=l[s]){c=a[s]<l[s]?a:l;break}return[h,c]},e.prototype._ddist=function(t,e,i){for(var n=0==t?this.renderer.xscale:this.renderer.yscale,r=e,o=r.length,s=new Float64Array(o),a=0;a<o;a++)s[a]=r[a]+i[a];for(var l=n.v_invert(r),h=n.v_invert(s),c=l.length,u=new Float64Array(c),a=0;a<c;a++)u[a]=Math.abs(h[a]-l[a]);return u},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.RectView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Rect",this.prototype.default_view=h,this.mixins(["line","fill"]),this.define({angle:[a.AngleSpec,0],width:[a.DistanceSpec],height:[a.DistanceSpec],dilate:[a.Bool,!1]})},e}(r.XYGlyph);i.Rect=c,c.initClass()},function(t,e,i){var n=t(379),r=t(9),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++){var n=this._x0[e],r=this._x1[e],s=this._y0[e],a=this._y1[e];isNaN(n+r+s+a)||t.push({minX:Math.min(n,r),minY:Math.min(s,a),maxX:Math.max(n,r),maxY:Math.max(s,a),i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1;if(this.visuals.line.doit)for(var a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h])||(t.beginPath(),t.moveTo(n[h],r[h]),t.lineTo(o[h],s[h]),this.visuals.line.set_vectorize(t,h),t.stroke())}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n={x:e,y:i},o=[],s=this.renderer.xscale.r_invert(e-2,e+2),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(i-2,i+2),c=h[0],u=h[1],_=this.index.indices({minX:a,minY:c,maxX:l,maxY:u}),p=0,d=_;p<d.length;p++){var f=d[p],v=Math.pow(Math.max(2,this.visuals.line.cache_select("line_width",f)/2),2),m={x:this.sx0[f],y:this.sy0[f]},g={x:this.sx1[f],y:this.sy1[f]},y=r.dist_to_segment_squared(n,m,g);y<v&&o.push(f)}var b=r.create_empty_hit_test_result();return b.indices=o,b},e.prototype._hit_span=function(t){var e,i,n,o=this.renderer.plot_view.frame.bbox.ranges,s=o[0],a=o[1],l=t.sx,h=t.sy;"v"==t.direction?(n=this.renderer.yscale.invert(h),w=[this._y0,this._y1],e=w[0],i=w[1]):(n=this.renderer.xscale.invert(l),k=[this._x0,this._x1],e=k[0],i=k[1]);for(var c=[],u=this.renderer.xscale.r_invert(s.start,s.end),_=u[0],p=u[1],d=this.renderer.yscale.r_invert(a.start,a.end),f=d[0],v=d[1],m=this.index.indices({minX:_,minY:f,maxX:p,maxY:v}),g=0,y=m;g<y.length;g++){var b=y[g];(e[b]<=n&&n<=i[b]||i[b]<=n&&n<=e[b])&&c.push(b)}var x=r.create_empty_hit_test_result();return x.indices=c,x;var w,k},e.prototype.scenterx=function(t){return(this.sx0[t]+this.sx1[t])/2},e.prototype.scentery=function(t){return(this.sy0[t]+this.sy1[t])/2},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e}(s.GlyphView);i.SegmentView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Segment",this.prototype.default_view=l,this.coords([["x0","y0"],["x1","y1"]]),this.mixins(["line"])},e}(s.Glyph);i.Segment=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy;this.visuals.line.set_value(t);var o=e.length;if(!(o<2)){t.beginPath(),t.moveTo(n[0],r[0]);for(var s=1;s<o;s++){var a=void 0,l=void 0,h=void 0,c=void 0;switch(this.model.mode){case"before":_=[n[s-1],r[s]],a=_[0],h=_[1],p=[n[s],r[s]],l=p[0],c=p[1];break;case"after":d=[n[s],r[s-1]],a=d[0],h=d[1],f=[n[s],r[s]],l=f[0],c=f[1];break;case"center":var u=(n[s-1]+n[s])/2;v=[u,r[s-1]],a=v[0],h=v[1],m=[u,r[s]],l=m[0],c=m[1];break;default:throw new Error("unexpected")}t.lineTo(a,h),t.lineTo(l,c)}t.lineTo(n[o-1],r[o-1]),t.stroke();var _,p,d,f,v,m}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.StepView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Step",this.prototype.default_view=a,this.mixins(["line"]),this.define({mode:[s.StepMode,"before"]})},e}(r.XYGlyph);i.Step=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=t(41),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._x_offset,a=i._y_offset,l=i._angle,h=i._text,c=0,u=e;c<u.length;c++){var _=u[c];if(!isNaN(n[_]+r[_]+o[_]+a[_]+l[_])&&null!=h[_]&&this.visuals.text.doit){var p=""+h[_];if(t.save(),t.translate(n[_]+o[_],r[_]+a[_]),t.rotate(l[_]),this.visuals.text.set_vectorize(t,_),-1==p.indexOf("\n"))t.fillText(p,0,0);else{var d=p.split("\n"),f=this.visuals.text.cache_select("font",_),v=s.get_text_height(f).height,m=this.visuals.text.text_line_height.value()*v,g=m*d.length,y=this.visuals.text.cache_select("text_baseline",_),b=void 0;switch(y){case"top":b=0;break;case"middle":b=-g/2+m/2;break;case"bottom":b=-g+m;break;default:b=0,console.warn("'"+y+"' baseline not supported with multi line text")}for(var x=0,w=d;x<w.length;x++){var k=w[x];t.fillText(k,0,b),b+=m}}t.restore()}}},e}(r.XYGlyphView);i.TextView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Text",this.prototype.default_view=a,this.mixins(["text"]),this.define({text:[o.StringSpec,{field:"text"}],angle:[o.AngleSpec,0],x_offset:[o.NumberSpec,0],y_offset:[o.NumberSpec,0]})},e}(r.XYGlyph);i.Text=l,l.initClass()},function(t,e,i){i.generic_line_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1;e.save(),e.beginPath(),e.moveTo(r,(s+a)/2),e.lineTo(o,(s+a)/2),t.line.doit&&(t.line.set_vectorize(e,n),e.stroke());e.restore()},i.generic_area_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1,l=.1*Math.abs(o-r),h=.1*Math.abs(a-s),c=r+l,u=o-l,_=s+h,p=a-h;t.fill.doit&&(t.fill.set_vectorize(e,n),e.fillRect(c,_,u-c,p-_));t.line.doit&&(e.beginPath(),e.rect(c,_,u-c,p-_),t.line.set_vectorize(e,n),e.stroke())}},function(t,e,i){var n=t(379),r=t(110),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._x.length)},e.prototype._lrtb=function(t){var e=this._x[t]-this._width[t]/2,i=this._x[t]+this._width[t]/2,n=Math.max(this._top[t],this._bottom[t]),r=Math.min(this._top[t],this._bottom[t]);return[e,i,n,r]},e.prototype._map_data=function(){this.sx=this.renderer.xscale.v_compute(this._x),this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"),this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom);var t=this.sx.length;this.sleft=new Float64Array(t),this.sright=new Float64Array(t);for(var e=0;e<t;e++)this.sleft[e]=this.sx[e]-this.sw[e]/2,this.sright[e]=this.sx[e]+this.sw[e]/2},e}(r.BoxView);i.VBarView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="VBar",this.prototype.default_view=s,this.coords([["x","bottom"]]),this.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),this.override({bottom:0})},e}(r.Box);i.VBar=a,a.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle,l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),t.lineTo(n[u],r[u]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,u),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,u),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o,a,h,c,u,_=t.sx,p=t.sy,d=this.renderer.xscale.invert(_),f=this.renderer.yscale.invert(p);"data"===this.model.properties.radius.units?(a=d-this.max_radius,h=d+this.max_radius,c=f-this.max_radius,u=f+this.max_radius):(i=_-this.max_radius,n=_+this.max_radius,M=this.renderer.xscale.r_invert(i,n),a=M[0],h=M[1],r=p-this.max_radius,o=p+this.max_radius,O=this.renderer.yscale.r_invert(r,o),c=O[0],u=O[1]);for(var v=[],m=s.validate_bbox_coords([a,h],[c,u]),g=0,y=this.index.indices(m);g<y.length;g++){var b=y[g],x=Math.pow(this.sradius[b],2);z=this.renderer.xscale.r_compute(d,this._x[b]),i=z[0],n=z[1],P=this.renderer.yscale.r_compute(f,this._y[b]),r=P[0],o=P[1],(e=Math.pow(i-n,2)+Math.pow(r-o,2))<=x&&v.push([b,e])}for(var w=this.model.properties.direction.value(),k=[],S=0,C=v;S<C.length;S++){var T=C[S],b=T[0],A=T[1],E=Math.atan2(p-this.sy[b],_-this.sx[b]);l.angle_between(-E,-this._start_angle[b],-this._end_angle[b],w)&&k.push([b,A])}return s.create_hit_test_result_from_hits(k);var M,O,z,P},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.WedgeView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Wedge",this.prototype.default_view=h,this.mixins(["line","fill"]),this.define({direction:[a.Direction,"anticlock"],radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]})},e}(r.XYGlyph);i.Wedge=c,c.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x.length;e<i;e++){var n=this._x[e],o=this._y[e];!isNaN(n+o)&&isFinite(n+o)&&t.push({minX:n,minY:o,maxX:n,maxY:o,i:e})}return new r.RBush(t)},e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e}(o.GlyphView);i.XYGlyphView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="XYGlyph",this.coords([["x","y"]])},e}(o.Glyph);i.XYGlyph=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(22),s=t(21),a=t(9),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GraphHitTestPolicy"},e.prototype._hit_test_nodes=function(t,e){if(!e.model.visible)return null;var i=e.node_view.glyph.hit_test(t);return null==i?null:e.node_view.model.view.convert_selection_from_subset(i)},e.prototype._hit_test_edges=function(t,e){if(!e.model.visible)return null;var i=e.edge_view.glyph.hit_test(t);return null==i?null:e.edge_view.model.view.convert_selection_from_subset(i)},e}(r.Model);i.GraphHitTestPolicy=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="NodesOnly"},e.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;return r.update(t,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.model.get_selection_manager().get_or_create_inspector(i.node_view.model);return o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},e}(l);i.NodesOnly=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="NodesAndLinkedEdges"},e.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},e.prototype.get_linked_edges=function(t,e,i){var n=[];"selection"==i?n=t.selected.indices.map(function(e){return t.data.index[e]}):"inspection"==i&&(n=t.inspected.indices.map(function(e){return t.data.index[e]}));for(var r=[],o=0;o<e.data.start.length;o++)(s.contains(n,e.data.start[o])||s.contains(n,e.data.end[o]))&&r.push(o);for(var l=a.create_empty_hit_test_result(),h=0,c=r;h<c.length;h++){var o=c[h];l.multiline_indices[o]=[0]}return l.indices=r,l},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;r.update(t,i,n);var o=e.edge_renderer.data_source.selected,s=this.get_linked_edges(e.node_renderer.data_source,e.edge_renderer.data_source,"selection");return o.update(s,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model);o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model),a=this.get_linked_edges(i.node_view.model.data_source,i.edge_view.model.data_source,"inspection");return s.update(a,n,r),i.edge_view.model.data_source.setv({inspected:s},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},e}(l);i.NodesAndLinkedEdges=c,c.initClass();var u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="EdgesAndLinkedNodes"},e.prototype.hit_test=function(t,e){return this._hit_test_edges(t,e)},e.prototype.get_linked_nodes=function(t,e,i){var n=[];"selection"==i?n=e.selected.indices:"inspection"==i&&(n=e.inspected.indices);for(var r=[],l=0,h=n;l<h.length;l++){var c=h[l];r.push(e.data.start[c]),r.push(e.data.end[c])}var u=s.uniq(r).map(function(e){return o.indexOf(t.data.index,e)}),_=a.create_empty_hit_test_result();return _.indices=u,_},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.edge_renderer.data_source.selected;r.update(t,i,n);var o=e.node_renderer.data_source.selected,s=this.get_linked_nodes(e.node_renderer.data_source,e.edge_renderer.data_source,"selection");return o.update(s,i,n),e.edge_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model);o.update(t,n,r),i.edge_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model),a=this.get_linked_nodes(i.node_view.model.data_source,i.edge_view.model.data_source,"inspection");return s.update(a,n,r),i.node_view.model.data_source.setv({inspected:s},{silent:!0}),i.edge_view.model.data_source.inspect.emit([i.edge_view,{geometry:e}]),!o.is_empty()},e}(l);i.EdgesAndLinkedNodes=u,u.initClass()},function(t,e,i){var n=t(379);n.__exportStar(t(136),i),n.__exportStar(t(138),i),n.__exportStar(t(139),i)},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LayoutProvider"},e}(r.Model);i.LayoutProvider=o,o.initClass()},function(t,e,i){var n=t(379),r=t(138),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="StaticLayoutProvider",this.define({graph_layout:[o.Any,{}]})},e.prototype.get_node_coordinates=function(t){for(var e=[],i=[],n=t.data.index,r=0,o=n.length;r<o;r++){var s=this.graph_layout[n[r]],a=null!=s?s:[NaN,NaN],l=a[0],h=a[1];e.push(l),i.push(h)}return[e,i]},e.prototype.get_edge_coordinates=function(t){for(var e=[],i=[],n=t.data.start,r=t.data.end,o=null!=t.data.xs&&null!=t.data.ys,s=0,a=n.length;s<a;s++){var l=null!=this.graph_layout[n[s]]&&null!=this.graph_layout[r[s]];if(o&&l)e.push(t.data.xs[s]),i.push(t.data.ys[s]);else{var h=void 0,c=void 0;l?(u=[this.graph_layout[n[s]],this.graph_layout[r[s]]],c=u[0],h=u[1]):(_=[[NaN,NaN],[NaN,NaN]],c=_[0],h=_[1]),e.push([c[0],h[0]]),i.push([c[1],h[1]])}}return[e,i];var u,_},e}(r.LayoutProvider);i.StaticLayoutProvider=s,s.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(171),s=t(15),a=t(44),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"_x_range_name",{get:function(){return this.model.x_range_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_y_range_name",{get:function(){return this.model.y_range_name},enumerable:!0,configurable:!0}),e.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()})},e.prototype._draw_regions=function(t){if(this.visuals.band_fill.doit){var e=this.model.grid_coords("major",!1),i=e[0],n=e[1];this.visuals.band_fill.set_value(t);for(var r=0;r<i.length-1;r++)if(r%2==1){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1],l=this.plot_view.map_to_screen(i[r+1],n[r+1],this._x_range_name,this._y_range_name),h=l[0],c=l[1];t.fillRect(s[0],a[0],h[1]-s[0],c[1]-a[0]),t.fill()}}},e.prototype._draw_grids=function(t){if(this.visuals.grid_line.doit){var e=this.model.grid_coords("major"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.grid_line,i,n)}},e.prototype._draw_minor_grids=function(t){if(this.visuals.minor_grid_line.doit){var e=this.model.grid_coords("minor"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.minor_grid_line,i,n)}},e.prototype._draw_grid_helper=function(t,e,i,n){e.set_value(t);for(var r=0;r<i.length;r++){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1];t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(a[0]));for(var l=1;l<s.length;l++)t.lineTo(Math.round(s[l]),Math.round(a[l]));t.stroke()}},e}(o.GuideRendererView);i.GridView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Grid",this.prototype.default_view=l,this.mixins(["line:grid_","line:minor_grid_","fill:band_"]),this.define({bounds:[s.Any,"auto"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),this.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},e.prototype.ranges=function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},e.prototype.computed_bounds=function(){var t,e,i=this.ranges()[0],n=this.bounds,o=[i.min,i.max];if(a.isArray(n))t=Math.min(n[0],n[1]),e=Math.max(n[0],n[1]),t<o[0]&&(t=o[0]),e>o[1]&&(e=o[1]);else{t=o[0],e=o[1];for(var s=0,l=this.plot.select(r.Axis);s<l.length;s++){var h=l[s];h.dimension==this.dimension&&h.x_range_name==this.x_range_name&&h.y_range_name==this.y_range_name&&(c=h.computed_bounds,t=c[0],e=c[1])}}return[t,e];var c},e.prototype.grid_coords=function(t,e){void 0===e&&(e=!0);var i=this.dimension,n=(i+1)%2,r=this.ranges(),o=r[0],s=r[1],a=this.computed_bounds(),l=a[0],h=a[1];x=[Math.min(l,h),Math.max(l,h)],l=x[0],h=x[1];for(var c=this.ticker.get_ticks(l,h,o,s.min,{})[t],u=o.min,_=o.max,p=s.min,d=s.max,f=[[],[]],v=0;v<c.length;v++)if(c[v]!=u&&c[v]!=_||!e){for(var m=[],g=[],y=0;y<2;y++){var b=p+(d-p)/1*y;m.push(c[v]),g.push(b)}f[i].push(m),f[n].push(g)}return f;var x},e}(o.GuideRenderer);i.Grid=h,h.initClass()},function(t,e,i){var n=t(140);i.Grid=n.Grid},function(t,e,i){var n=t(379);n.__exportStar(t(60),i),n.__exportStar(t(76),i),n.__exportStar(t(82),i),n.__exportStar(t(86),i),n.__exportStar(t(88),i),n.__exportStar(t(94),i),n.__exportStar(t(100),i),n.__exportStar(t(119),i),n.__exportStar(t(137),i),n.__exportStar(t(141),i),n.__exportStar(t(145),i),n.__exportStar(t(153),i),n.__exportStar(t(252),i),n.__exportStar(t(156),i),n.__exportStar(t(160),i),n.__exportStar(t(166),i),n.__exportStar(t(172),i),n.__exportStar(t(175),i),n.__exportStar(t(179),i),n.__exportStar(t(188),i),n.__exportStar(t(198),i),n.__exportStar(t(208),i),n.__exportStar(t(240),i)},function(t,e,i){var n=t(379),r=t(13),o=t(15),s=t(21),a=t(32),l=t(146),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-grid")},e.prototype.get_height=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._height.value});return this.model._horizontal?s.max(e):s.sum(e)},e.prototype.get_width=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._width.value});return this.model._horizontal?s.sum(e):s.max(e)},e}(l.LayoutDOMView);i.BoxView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Box",this.prototype.default_view=h,this.define({children:[o.Array,[]]}),this.internal({spacing:[o.Number,6]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._child_equal_size_width=new r.Variable(this.toString()+".child_equal_size_width"),this._child_equal_size_height=new r.Variable(this.toString()+".child_equal_size_height"),this._box_equal_size_top=new r.Variable(this.toString()+".box_equal_size_top"),this._box_equal_size_bottom=new r.Variable(this.toString()+".box_equal_size_bottom"),this._box_equal_size_left=new r.Variable(this.toString()+".box_equal_size_left"),this._box_equal_size_right=new r.Variable(this.toString()+".box_equal_size_right"),this._box_cell_align_top=new r.Variable(this.toString()+".box_cell_align_top"),this._box_cell_align_bottom=new r.Variable(this.toString()+".box_cell_align_bottom"),this._box_cell_align_left=new r.Variable(this.toString()+".box_cell_align_left"),this._box_cell_align_right=new r.Variable(this.toString()+".box_cell_align_right")},e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return a.extend({},t.prototype.get_constrained_variables.call(this),{box_equal_size_top:this._box_equal_size_top,box_equal_size_bottom:this._box_equal_size_bottom,box_equal_size_left:this._box_equal_size_left,box_equal_size_right:this._box_equal_size_right,box_cell_align_top:this._box_cell_align_top,box_cell_align_bottom:this._box_cell_align_bottom,box_cell_align_left:this._box_cell_align_left,box_cell_align_right:this._box_cell_align_right})},e.prototype.get_constraints=function(){var e=t.prototype.get_constraints.call(this),i=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.push.apply(e,t)},n=this.get_layoutable_children();if(0==n.length)return e;for(var o=0,s=n;o<s.length;o++){var a=s[o],l=a.get_constrained_variables(),h=this._child_rect(l);this._horizontal?null!=l.height&&i(r.EQ(h.height,[-1,this._height])):null!=l.width&&i(r.EQ(h.width,[-1,this._width])),this._horizontal?null!=l.box_equal_size_left&&null!=l.box_equal_size_right&&null!=l.width&&i(r.EQ([-1,l.box_equal_size_left],[-1,l.box_equal_size_right],l.width,this._child_equal_size_width)):null!=l.box_equal_size_top&&null!=l.box_equal_size_bottom&&null!=l.height&&i(r.EQ([-1,l.box_equal_size_top],[-1,l.box_equal_size_bottom],l.height,this._child_equal_size_height))}var c=this._info(n[0].get_constrained_variables());i(r.EQ(c.span.start,0));for(var u=1;u<n.length;u++){var _=this._info(n[u].get_constrained_variables());c.span.size&&i(r.EQ(c.span.start,c.span.size,[-1,_.span.start])),i(r.WEAK_EQ(c.whitespace.after,_.whitespace.before,0-this.spacing)),i(r.GE(c.whitespace.after,_.whitespace.before,0-this.spacing)),c=_}var p=n[n.length-1].get_constrained_variables();return this._horizontal?null!=p.width&&i(r.EQ(c.span.start,c.span.size,[-1,this._width])):null!=p.height&&i(r.EQ(c.span.start,c.span.size,[-1,this._height])),e=e.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},e.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e;e=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom};var i=this._span(this._child_rect(t));return{span:i,whitespace:e}},e.prototype._flatten_cell_edge_variables=function(t){var i;i=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables;for(var n=t!=this._horizontal,r=this.get_layoutable_children(),o=r.length,s={},a=0,l=0,h=r;l<h.length;l++){var c=h[l],u=void 0;u=c instanceof e?c._flatten_cell_edge_variables(t):{};for(var _=c.get_constrained_variables(),p=0,d=i;p<d.length;p++){var f=d[p];f in _&&(u[f]=[_[f]])}for(var v in u){var m=u[v],g=void 0;if(n){var y=v.split(" "),b=y[0],x=y.length>1?y[1]:"",w=this._horizontal?"row":"col";g=b+" "+w+"-"+o+"-"+a+"-"+x}else g=v;s[g]=g in s?s[g].concat(m):m}a++}return s},e.prototype._align_inner_cell_edges_constraints=function(){var t=[];if(null!=this.document&&s.includes(this.document.roots(),this)){var e=this._flatten_cell_edge_variables(this._horizontal);for(var i in e){var n=e[i];if(n.length>1)for(var o=n[0],a=1;a<n.length;a++)t.push(r.EQ(n[a],[-1,o]))}}return t},e.prototype._find_edge_leaves=function(t){var i=this.get_layoutable_children(),n=[[],[]];if(i.length>0)if(this._horizontal==t){var r=i[0],o=i[i.length-1];r instanceof e?n[0]=n[0].concat(r._find_edge_leaves(t)[0]):n[0].push(r),o instanceof e?n[1]=n[1].concat(o._find_edge_leaves(t)[1]):n[1].push(o)}else for(var s=0,a=i;s<a.length;s++){var l=a[s];if(l instanceof e){var h=l._find_edge_leaves(t);n[0]=n[0].concat(h[0]),n[1]=n[1].concat(h[1])}else n[0].push(l),n[1].push(l)}return n},e.prototype._align_outer_edges_constraints=function(t){var e,i,n=this._find_edge_leaves(t),o=n[0],s=n[1];t?(e="on_edge_align_left",i="on_edge_align_right"):(e="on_edge_align_top",i="on_edge_align_bottom");var a=function(t,e){for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.get_constrained_variables();e in s&&i.push(s[e])}return i},l=a(o,e),h=a(s,i),c=[],u=function(t){if(t.length>1)for(var e=t[0],i=1;i<t.length;i++){var n=t[i];c.push(r.EQ([-1,e],n))}};return u(l),u(h),c},e.prototype._box_insets_from_child_insets=function(t,e,i,n){var o,s,a,l,h=this._find_edge_leaves(t),c=h[0],u=h[1];t?(o=e+"_left",s=e+"_right",a=this[i+"_left"],l=this[i+"_right"]):(o=e+"_top",s=e+"_bottom",a=this[i+"_top"],l=this[i+"_bottom"]);var _=[],p=function(t,e,i){for(var o=0,s=e;o<s.length;o++){var a=s[o],l=a.get_constrained_variables();i in l&&(n?_.push(r.GE([-1,t],l[i])):_.push(r.EQ([-1,t],l[i])))}};return p(a,c,o),p(l,u,s),_},e.prototype._box_equal_size_bounds=function(t){return this._box_insets_from_child_insets(t,"box_equal_size","_box_equal_size",!1)},e.prototype._box_cell_align_bounds=function(t){return this._box_insets_from_child_insets(t,"box_cell_align","_box_cell_align",!1)},e.prototype._box_whitespace=function(t){return this._box_insets_from_child_insets(t,"whitespace","_whitespace",!0)},e._left_right_inner_cell_edge_variables=["box_cell_align_left","box_cell_align_right"],e._top_bottom_inner_cell_edge_variables=["box_cell_align_top","box_cell_align_bottom"],e}(l.LayoutDOM);i.Box=c,c.initClass()},function(t,e,i){var n=t(379),r=t(143),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-grid-column")},e}(r.BoxView);i.ColumnView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i._horizontal=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Column",this.prototype.default_view=o},e}(r.Box);i.Column=s,s.initClass()},function(t,e,i){var n=t(143);i.Box=n.Box;var r=t(144);i.Column=r.Column;var o=t(146);i.LayoutDOM=o.LayoutDOM;var s=t(147);i.Row=s.Row;var a=t(148);i.Spacer=a.Spacer;var l=t(149);i.WidgetBox=l.WidgetBox},function(t,e,i){var n=t(379),r=t(53),o=t(5),s=t(15),a=t(11),l=t(13),h=t(4),c=t(6),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._solver_inited=!1,e._idle_notified=!1,e}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.is_root&&(this._solver=new l.Solver),this.child_views={},this.build_child_views()},e.prototype.remove=function(){for(var e in this.child_views){var i=this.child_views[e];i.remove()}this.child_views={},t.prototype.remove.call(this)},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;for(var e in this.child_views){var i=this.child_views[e];if(!i.has_finished())return!1}return!0},e.prototype.notify_finished=function(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):t.prototype.notify_finished.call(this)},e.prototype._calc_width_height=function(){for(var t=this.el;t=t.parentElement;)if(!t.classList.contains("bk-root")){if(t==document.body){var e=o.margin(document.body),i=e.left,n=e.right,r=e.top,s=e.bottom,a=document.documentElement.clientWidth-i-n,l=document.documentElement.clientHeight-r-s;return[a,l]}var h=o.padding(t),c=h.left,u=h.right,_=h.top,p=h.bottom,d=t.getBoundingClientRect(),f=d.width-c-u,v=d.height-_-p;if(0!=f&&0!=v)return[f,v]}return[null,null]},e.prototype._init_solver=function(){this._root_width=new l.Variable(this.toString()+".root_width"),this._root_height=new l.Variable(this.toString()+".root_height"),this._solver.add_edit_variable(this._root_width,NaN),this._solver.add_edit_variable(this._root_height,NaN);for(var t=this.model.get_all_editables(),e=0,i=t;e<i.length;e++){var n=i[e];this._solver.add_edit_variable(n,l.Strength.strong)}for(var r=this.model.get_all_constraints(),o=0,s=r;o<s.length;o++){var a=s[o];this._solver.add_constraint(a)}var h=this.model.get_constrained_variables();null!=h.width&&this._solver.add_constraint(l.EQ(h.width,this._root_width)),null!=h.height&&this._solver.add_constraint(l.EQ(h.height,this._root_height)),this._solver.update_variables(),this._solver_inited=!0},e.prototype._suggest_dims=function(t,e){var i=this.model.get_constrained_variables();null==i.width&&null==i.height||(null!=t&&null!=e||(n=this._calc_width_height(),t=n[0],e=n[1]),null!=i.width&&null!=t&&this._solver.suggest_value(this._root_width,t),null!=i.height&&null!=e&&this._solver.suggest_value(this._root_height,e),this._solver.update_variables());var n},e.prototype.resize=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},e.prototype.partial_layout=function(){this.is_root?this._do_layout(!1):this.root.partial_layout()},e.prototype.layout=function(){this.is_root?this._do_layout(!0):this.root.layout()},e.prototype._do_layout=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this._solver_inited&&!t||(this._solver.clear(),this._init_solver()),this._suggest_dims(e,i),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},e.prototype._layout=function(t){void 0===t&&(t=!1);for(var e=0,i=this.model.get_layoutable_children();e<i.length;e++){var n=i[e],r=this.child_views[n.id];null!=r._layout&&r._layout(t)}this.render(),t&&(this._has_finished=!0)},e.prototype.rebuild_child_views=function(){this.solver.clear(),this.build_child_views(),this.layout()},e.prototype.build_child_views=function(){var t=this.model.get_layoutable_children();h.build_views(this.child_views,t,{parent:this}),o.empty(this.el);for(var e=0,i=t;e<i.length;e++){var n=i[e],r=this.child_views[n.id];this.el.appendChild(r.el)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.is_root&&window.addEventListener("resize",function(){return e.resize()}),this.connect(this.model.properties.sizing_mode.change,function(){return e.layout()})},e.prototype._render_classes=function(){this.el.className="";for(var t=0,e=this.css_classes();t<e.length;t++){var i=e[t];this.el.classList.add(i)}this.el.classList.add("bk-layout-"+this.model.sizing_mode);for(var n=0,r=this.model.css_classes;n<r.length;n++){var o=r[n];this.el.classList.add(o)}},e.prototype.render=function(){switch(this._render_classes(),this.model.sizing_mode){case"fixed":var t=void 0;t=null!=this.model.width?this.model.width:this.get_width(),this.model.setv({width:t},{silent:!0});var e=void 0;e=null!=this.model.height?this.model.height:this.get_height(),this.model.setv({height:e},{silent:!0}),this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e);break;case"scale_width":var e=this.get_height();this.solver.suggest_value(this.model._height,e);break;case"scale_height":var t=this.get_width();this.solver.suggest_value(this.model._width,t);break;case"scale_both":var i=this.get_width_height(),t=i[0],e=i[1];this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e)}this.solver.update_variables(),this.position()},e.prototype.position=function(){switch(this.model.sizing_mode){case"fixed":case"scale_width":case"scale_height":this.el.style.position="relative",this.el.style.left="",this.el.style.top="";break;case"scale_both":case"stretch_both":this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px"}this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype.get_width_height=function(){var t=this.el.parentElement;if(null==t)throw new Error("detached element");var e,i,n=t.clientHeight,r=t.clientWidth,o=this.model.get_aspect_ratio(),s=r,a=r/o,l=n*o,h=n;return s<l?(e=s,i=a):(e=l,i=h),[e,i]},e}(c.DOMView);i.LayoutDOMView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LayoutDOM",this.define({height:[s.Number],width:[s.Number],disabled:[s.Bool,!1],sizing_mode:[s.SizingMode,"fixed"],css_classes:[s.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._width=new l.Variable(this.toString()+".width"),this._height=new l.Variable(this.toString()+".height"),this._left=new l.Variable(this.toString()+".left"),this._right=new l.Variable(this.toString()+".right"),this._top=new l.Variable(this.toString()+".top"),this._bottom=new l.Variable(this.toString()+".bottom"),this._dom_top=new l.Variable(this.toString()+".dom_top"),this._dom_left=new l.Variable(this.toString()+".dom_left"),this._width_minus_right=new l.Variable(this.toString()+".width_minus_right"),this._height_minus_bottom=new l.Variable(this.toString()+".height_minus_bottom"),this._whitespace_top=new l.Variable(this.toString()+".whitespace_top"),this._whitespace_bottom=new l.Variable(this.toString()+".whitespace_bottom"),this._whitespace_left=new l.Variable(this.toString()+".whitespace_left"),this._whitespace_right=new l.Variable(this.toString()+".whitespace_right")},Object.defineProperty(e.prototype,"layout_bbox",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,dom_top:this._dom_top.value,dom_left:this._dom_left.value}},enumerable:!0,configurable:!0}),e.prototype.dump_layout=function(){for(var t,e={},i=[this];t=i.shift();)i.push.apply(i,t.get_layoutable_children()),e[t.toString()]=t.layout_bbox;console.table(e)},e.prototype.get_all_constraints=function(){for(var t=this.get_constraints(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof a.LayoutCanvas?t.concat(n.get_constraints()):t.concat(n.get_all_constraints())}return t},e.prototype.get_all_editables=function(){for(var t=this.get_editables(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof a.LayoutCanvas?t.concat(n.get_editables()):t.concat(n.get_all_editables())}return t},e.prototype.get_constraints=function(){return[l.GE(this._dom_left),l.GE(this._dom_top),l.GE(this._left),l.GE(this._width,[-1,this._right]),l.GE(this._top),l.GE(this._height,[-1,this._bottom]),l.EQ(this._width_minus_right,[-1,this._width],this._right),l.EQ(this._height_minus_bottom,[-1,this._height],this._bottom)]},e.prototype.get_layoutable_children=function(){return[]},e.prototype.get_editables=function(){switch(this.sizing_mode){case"fixed":return[this._height,this._width];case"scale_width":return[this._height];case"scale_height":return[this._width];case"scale_both":return[this._width,this._height];default:return[]}},e.prototype.get_constrained_variables=function(){var t={origin_x:this._dom_left,origin_y:this._dom_top,whitespace_top:this._whitespace_top,whitespace_bottom:this._whitespace_bottom,whitespace_left:this._whitespace_left,whitespace_right:this._whitespace_right};switch(this.sizing_mode){case"stretch_both":t.width=this._width,t.height=this._height;break;case"scale_width":t.width=this._width;break;case"scale_height":t.height=this._height}return t},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e}(r.Model);i.LayoutDOM=_,_.initClass()},function(t,e,i){var n=t(379),r=t(143),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-grid-row")},e}(r.BoxView);i.RowView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i._horizontal=!0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Row",this.prototype.default_view=o},e}(r.Box);i.Row=s,s.initClass()},function(t,e,i){var n=t(379),r=t(146),o=t(32),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),"fixed"==this.model.sizing_mode&&(this.el.style.width=this.model.width+"px",this.el.style.height=this.model.height+"px")},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-spacer-box")},e.prototype.get_width=function(){return 1},e.prototype.get_height=function(){return 1},e}(r.LayoutDOMView);i.SpacerView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Spacer",this.prototype.default_view=s},e.prototype.get_constrained_variables=function(){return o.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom,box_equal_size_left:this._left,box_equal_size_right:this._width_minus_right})},e}(r.LayoutDOM);i.Spacer=a,a.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(15),s=t(32),a=t(146),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-widget-box")},e.prototype.render=function(){if(this._render_classes(),"fixed"==this.model.sizing_mode||"scale_height"==this.model.sizing_mode){var t=this.get_width();this.model._width.value!=t&&this.solver.suggest_value(this.model._width,t)}if("fixed"==this.model.sizing_mode||"scale_width"==this.model.sizing_mode){var e=this.get_height();this.model._height.value!=e&&this.solver.suggest_value(this.model._height,e)}if(this.solver.update_variables(),"stretch_both"==this.model.sizing_mode)this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px";else{var i=void 0;i=this.model._width.value-20>0?this.model._width.value-20+"px":"100%",this.el.style.width=i}},e.prototype.get_height=function(){var t=0;for(var e in this.child_views){var i=this.child_views[e],n=i.el,r=getComputedStyle(n),o=parseInt(r.marginTop)||0,s=parseInt(r.marginBottom)||0;t+=n.offsetHeight+o+s}return t+20},e.prototype.get_width=function(){if(null!=this.model.width)return this.model.width;var t=this.el.scrollWidth+20;for(var e in this.child_views){var i=this.child_views[e],n=i.el.scrollWidth;n>t&&(t=n)}return t},e}(a.LayoutDOMView);i.WidgetBoxView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="WidgetBox",this.prototype.default_view=l,this.define({children:[o.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),"fixed"==this.sizing_mode&&null==this.width&&(this.width=300,r.logger.info("WidgetBox mode is fixed, but no width specified. Using default of 300."))},e.prototype.get_constrained_variables=function(){var e=s.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom});return"fixed"!=this.sizing_mode&&(e.box_equal_size_left=this._left,e.box_equal_size_right=this._width_minus_right),e},e.prototype.get_layoutable_children=function(){return this.children},e}(a.LayoutDOM);i.WidgetBox=h,h.initClass()},function(t,e,i){var n=t(379),r=t(151),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CategoricalColorMapper",this.define({factors:[o.Array],start:[o.Number,0],end:[o.Number]})},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,o=function(n,o){var h=t[n],c=void 0;a.isString(h)?c=l.factors.indexOf(h):(null!=l.start?h=null!=l.end?h.slice(l.start,l.end):h.slice(l.start):null!=l.end&&(h=h.slice(0,l.end)),c=1==h.length?l.factors.indexOf(h[0]):s.findIndex(l.factors,function(t){return function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}(t,h)}));var u=void 0;u=c<0||c>=i.length?r:i[c],e[n]=u},l=this,h=0,c=t.length;h<c;h++)o(h,c)},e}(r.ColorMapper);i.CategoricalColorMapper=l,l.initClass()},function(t,e,i){function n(t){return"#"!=t[0]&&(t=h.color2hex(t)),9!=t.length&&(t+="ff"),parseInt(t.slice(1),16)}function r(t){for(var e=new Uint32Array(t.length),i=0,r=t.length;i<r;i++)e[i]=n(t[i]);return e}function o(t){if(c.is_little_endian)for(var e=new DataView(t.buffer),i=0,n=t.length;i<n;i++)e.setUint32(4*i,t[i]);return new Uint8Array(t.buffer)}var s=t(379),a=t(257),l=t(15),h=t(27),c=t(28);i._convert_color=n,i._convert_palette=r,i._uint32_to_rgba=o;var u=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type="ColorMapper",this.define({palette:[l.Any],nan_color:[l.Color,"gray"]})},e.prototype.compute=function(t){throw new Error("not supported")},e.prototype.v_compute=function(t){var e=new Array(t.length);return this._v_compute(t,e,this.palette,this._colors(function(t){return t})),e},Object.defineProperty(e.prototype,"rgba_mapper",{get:function(){var t=this,e=r(this.palette),i=this._colors(n);return{v_compute:function(n){var r=new Uint32Array(n.length);return t._v_compute(n,r,e,i),o(r)}}},enumerable:!0,configurable:!0}),e.prototype._colors=function(t){return{nan_color:t(this.nan_color)}},e}(a.Transform);i.ColorMapper=u,u.initClass()},function(t,e,i){var n=t(379),r=t(151),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ContinuousColorMapper",this.define({high:[o.Number],low:[o.Number],high_color:[o.Color],low_color:[o.Color]})},e.prototype._colors=function(e){return n.__assign({},t.prototype._colors.call(this,e),{low_color:null!=this.low_color?e(this.low_color):void 0,high_color:null!=this.high_color?e(this.high_color):void 0})},e}(r.ColorMapper);i.ContinuousColorMapper=s,s.initClass()},function(t,e,i){var n=t(150);i.CategoricalColorMapper=n.CategoricalColorMapper;var r=t(152);i.ContinuousColorMapper=r.ContinuousColorMapper;var o=t(151);i.ColorMapper=o.ColorMapper;var s=t(154);i.LinearColorMapper=s.LinearColorMapper;var a=t(155);i.LogColorMapper=a.LogColorMapper},function(t,e,i){var n=t(379),r=t(152),o=t(22),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LinearColorMapper"},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,s=n.low_color,a=n.high_color,l=null!=this.low?this.low:o.min(t),h=null!=this.high?this.high:o.max(t),c=i.length-1,u=1/(h-l),_=1/i.length,p=0,d=t.length;p<d;p++){var f=t[p];if(isNaN(f))e[p]=r;else if(f!=h){var v=(f-l)*u,m=Math.floor(v/_);e[p]=m<0?null!=s?s:i[0]:m>c?null!=a?a:i[c]:i[m]}else e[p]=i[c]}},e}(r.ContinuousColorMapper);i.LinearColorMapper=s,s.initClass()},function(t,e,i){var n=t(379),r=t(152),o=t(22),s=null!=Math.log1p?Math.log1p:function(t){return Math.log(1+t)},a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LogColorMapper"},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,a=n.low_color,l=n.high_color,h=i.length,c=null!=this.low?this.low:o.min(t),u=null!=this.high?this.high:o.max(t),_=h/(s(u)-s(c)),p=i.length-1,d=0,f=t.length;d<f;d++){var v=t[d];if(isNaN(v))e[d]=r;else if(v>u)e[d]=null!=l?l:i[p];else if(v!=u)if(v<c)e[d]=null!=a?a:i[0];else{var m=s(v)-s(c),g=Math.floor(m*_);g>p&&(g=p),e[d]=i[g]}else e[d]=i[p]}},e}(r.ContinuousColorMapper);i.LogColorMapper=a,a.initClass()},function(t,e,i){function n(t,e){t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)}function r(t,e){t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)}function o(t,e){t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()}function s(t,e){var i=e*c,n=i/3;t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-i),t.closePath()}function a(t,e){var i=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(i,t),i.initClass=function(){this.prototype._render_one=e},i}(h.MarkerView);i.initClass();var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l.__extends(n,e),n.initClass=function(){this.prototype.default_view=i,this.prototype.type=t},n}(h.Marker);return n.initClass(),n}var l=t(379),h=t(157),c=Math.sqrt(3);i.Asterisk=a("Asterisk",function(t,e,i,o,s){var a=.65*i;r(t,i),n(t,a),o.doit&&(o.set_vectorize(t,e),t.stroke())}),i.CircleCross=a("CircleCross",function(t,e,i,n,o){t.arc(0,0,i,0,2*Math.PI,!1),o.doit&&(o.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.CircleX=a("CircleX",function(t,e,i,r,o){t.arc(0,0,i,0,2*Math.PI,!1),o.doit&&(o.set_vectorize(t,e),t.fill());r.doit&&(r.set_vectorize(t,e),n(t,i),t.stroke())}),i.Cross=a("Cross",function(t,e,i,n,o){r(t,i),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Diamond=a("Diamond",function(t,e,i,n,r){o(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.DiamondCross=a("DiamondCross",function(t,e,i,n,s){o(t,i),s.doit&&(s.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.Hex=a("Hex",function(t,e,i,n,r){(function(t,e){var i=e/2,n=c*i;t.moveTo(e,0),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-e,0),t.lineTo(-i,n),t.lineTo(i,n),t.closePath()})(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.InvertedTriangle=a("InvertedTriangle",function(t,e,i,n,r){t.rotate(Math.PI),s(t,i),t.rotate(-Math.PI),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Square=a("Square",function(t,e,i,n,r){var o=2*i;t.rect(-i,-i,o,o),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.SquareCross=a("SquareCross",function(t,e,i,n,o){var s=2*i;t.rect(-i,-i,s,s),o.doit&&(o.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.SquareX=a("SquareX",function(t,e,i,r,o){var s=2*i;t.rect(-i,-i,s,s),o.doit&&(o.set_vectorize(t,e),t.fill());r.doit&&(r.set_vectorize(t,e),n(t,i),t.stroke())}),i.Triangle=a("Triangle",function(t,e,i,n,r){s(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.X=a("X",function(t,e,i,r,o){n(t,i),r.doit&&(r.set_vectorize(t,e),t.stroke())})},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(21),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._size,s=i._angle,a=0,l=e;a<l.length;a++){var h=l[a];if(!isNaN(n[h]+r[h]+o[h]+s[h])){var c=o[h]/2;t.beginPath(),t.translate(n[h],r[h]),s[h]&&t.rotate(s[h]),this._render_one(t,h,c,this.visuals.line,this.visuals.fill),s[h]&&t.rotate(-s[h]),t.translate(-n[h],-r[h])}}},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.bbox.h_range,e=t.start-this.max_size,i=t.end+this.max_size,n=this.renderer.xscale.r_invert(e,i),r=n[0],s=n[1],a=this.renderer.plot_view.frame.bbox.v_range,l=a.start-this.max_size,h=a.end+this.max_size,c=this.renderer.yscale.r_invert(l,h),u=c[0],_=c[1],p=o.validate_bbox_coords([r,s],[u,_]);return this.index.indices(p)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=e-this.max_size,r=e+this.max_size,s=this.renderer.xscale.r_invert(n,r),a=s[0],l=s[1],h=i-this.max_size,c=i+this.max_size,u=this.renderer.yscale.r_invert(h,c),_=u[0],p=u[1],d=o.validate_bbox_coords([a,l],[_,p]),f=this.index.indices(d),v=[],m=0,g=f;m<g.length;m++){var y=g[m],b=this._size[y]/2,x=Math.abs(this.sx[y]-e)+Math.abs(this.sy[y]-i);Math.abs(this.sx[y]-e)<=b&&Math.abs(this.sy[y]-i)<=b&&v.push([y,x])}return o.create_hit_test_result_from_hits(v)},e.prototype._hit_span=function(t){var e,i,n,r,s=t.sx,a=t.sy,l=this.bounds(),h=l.minX,c=l.minY,u=l.maxX,_=l.maxY,p=o.create_empty_hit_test_result();if("h"==t.direction){n=c,r=_;var d=this.max_size/2,f=s-d,v=s+d;x=this.renderer.xscale.r_invert(f,v),e=x[0],i=x[1]}else{e=h,i=u;var d=this.max_size/2,m=a-d,g=a+d;w=this.renderer.yscale.r_invert(m,g),n=w[0],r=w[1]}var y=o.validate_bbox_coords([e,i],[n,r]),b=this.index.indices(y);return p.indices=b,p;var x,w},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=a.range(0,this.sx.length),r=[],s=0,l=n.length;s<l;s++){var h=n[s];o.point_in_poly(this.sx[s],this.sy[s],e,i)&&r.push(h)}var c=o.create_empty_hit_test_result();return c.indices=r,c},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.x1,o=e.y0,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+r)/2;var h=new Array(a);h[i]=(o+s)/2;var c=new Array(a);c[i]=.4*Math.min(Math.abs(r-n),Math.abs(s-o));var u=new Array(a);u[i]=this._angle[i],this._render(t,[i],{sx:l,sy:h,_size:c,_angle:u})},e}(r.XYGlyphView);i.MarkerView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.mixins(["line","fill"]),this.define({size:[s.DistanceSpec,{units:"screen",value:4}],angle:[s.AngleSpec,0]})},e}(r.XYGlyph);i.Marker=h,h.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(159),s=t(161),a=t(15),l=t(53),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MapOptions",this.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]})},e}(l.Model);i.MapOptions=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GMapOptions",this.define({map_type:[a.String,"roadmap"],scale_control:[a.Bool,!1],styles:[a.String]})},e}(h);i.GMapOptions=c,c.initClass();var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(s.PlotView);i.GMapPlotView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GMapPlot",this.prototype.default_view=u,this.define({map_options:[a.Instance],api_key:[a.String]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.api_key||r.logger.error("api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.")},e.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},e}(s.Plot);i.GMapPlot=_,_.initClass()},function(t,e,i){var n=t(379),r=t(19),o=t(33),s=t(162),a=new r.Signal0({},"gmaps_ready"),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0;var n=this.model.plot.map_options,r=n.zoom,o=n.lat,s=n.lng;this.initial_zoom=r,this.initial_lat=o,this.initial_lng=s,this.canvas_view.map_el.style.position="absolute","undefined"!=typeof google&&null!=google.maps||("undefined"==typeof _bokeh_gmaps_callback&&function(t){_bokeh_gmaps_callback=function(){return a.emit()};var e=document.createElement("script");e.type="text/javascript",e.src="https://maps.googleapis.com/maps/api/js?key="+t+"&callback=_bokeh_gmaps_callback",document.body.appendChild(e)}(this.model.plot.api_key),a.connect(function(){return i.request_render()})),this.unpause()},e.prototype.update_range=function(e){if(null==e)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),t.prototype.update_range.call(this,null);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(e.sdx||0,e.sdy||0),t.prototype.update_range.call(this,e);else if(null!=e.factor){var i=void 0;if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),i=e.factor<0?-1:1;var n=this.map.getZoom(),r=n+i;if(r>=2){this.map.setZoom(r);var o=this._get_projected_bounds(),s=o[0],a=o[1];a-s<0&&this.map.setZoom(n)}this.unpause()}this._set_bokeh_ranges()},e.prototype._build_map=function(){var t=this,e=google.maps;this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID};var i=this.model.plot.map_options,n={center:new e.LatLng(i.lat,i.lng),zoom:i.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[i.map_type],scaleControl:i.scale_control};null!=i.styles&&(n.styles=JSON.parse(i.styles)),this.map=new e.Map(this.canvas_view.map_el,n),e.event.addListener(this.map,"idle",function(){return t._set_bokeh_ranges()}),e.event.addListener(this.map,"bounds_changed",function(){return t._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,"tilesloaded",function(){return t._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return t._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return t._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return t._update_center("lat")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return t._update_center("lng")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return t._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return t._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return t._update_scale_control()})},e.prototype._render_finished=function(){this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&!0===this._tiles_loaded},e.prototype._get_latlon_bounds=function(){var t=this.map.getBounds(),e=t.getNorthEast(),i=t.getSouthWest(),n=i.lng(),r=e.lng(),o=i.lat(),s=e.lat();return[n,r,o,s]},e.prototype._get_projected_bounds=function(){var t=this._get_latlon_bounds(),e=t[0],i=t[1],n=t[2],r=t[3],s=o.wgs84_mercator.forward([e,n]),a=s[0],l=s[1],h=o.wgs84_mercator.forward([i,r]),c=h[0],u=h[1];return[a,c,l,u]},e.prototype._set_bokeh_ranges=function(){var t=this._get_projected_bounds(),e=t[0],i=t[1],n=t[2],r=t[3];this.frame.x_range.setv({start:e,end:i}),this.frame.y_range.setv({start:n,end:r})},e.prototype._update_center=function(t){var e=this.map.getCenter().toJSON();e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},e.prototype._update_map_type=function(){this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3];this.canvas_view.map_el.style.top=n+"px",this.canvas_view.map_el.style.left=i+"px",this.canvas_view.map_el.style.width=r+"px",this.canvas_view.map_el.style.height=o+"px",null==this.map&&"undefined"!=typeof google&&null!=google.maps&&this._build_map()},e.prototype._paint_empty=function(t,e){var i=this.canvas._width.value,n=this.canvas._height.value,r=e[0],o=e[1],s=e[2],a=e[3];t.clearRect(0,0,i,n),t.beginPath(),t.moveTo(0,0),t.lineTo(0,n),t.lineTo(i,n),t.lineTo(i,0),t.lineTo(0,0),t.moveTo(r,o),t.lineTo(r+s,o),t.lineTo(r+s,o+a),t.lineTo(r,o+a),t.lineTo(r,o),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(s.PlotCanvasView);i.GMapPlotCanvasView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GMapPlotCanvas",this.prototype.default_view=l},e.prototype.initialize=function(){this.use_map=!0,t.prototype.initialize.call(this)},e}(s.PlotCanvas);i.GMapPlotCanvas=h,h.initClass()},function(t,e,i){var n=t(158);i.MapOptions=n.MapOptions;var r=t(158);i.GMapOptions=r.GMapOptions;var o=t(158);i.GMapPlot=o.GMapPlot;var s=t(159);i.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(161);i.Plot=a.Plot;var l=t(162);i.PlotCanvas=l.PlotCanvas},function(t,e,i){var n=t(379),r=t(13),o=t(14),s=t(15),a=t(21),l=t(32),h=t(44),c=t(146),u=t(68),_=t(176),p=t(247),d=t(69),f=t(162),v=t(184),m=t(169),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){t.prototype.connect_signals.call(this);this.connect(this.model.properties.title.change,function(){return o.logger.warn("Title object cannot be replaced. Try changing properties on title to update it after initialization.")})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-plot-layout")},e.prototype.get_height=function(){return this.model._width.value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height.value*this.model.get_aspect_ratio()},e.prototype.save=function(t){this.plot_canvas_view.save(t)},Object.defineProperty(e.prototype,"plot_canvas_view",{get:function(){return this.child_views[this.model.plot_canvas.id]},enumerable:!0,configurable:!0}),e}(c.LayoutDOMView);i.PlotView=y;var b=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Plot",this.prototype.default_view=y,this.mixins(["line:outline_","fill:background_","fill:border_"]),this.define({toolbar:[s.Instance,function(){return new p.Toolbar}],toolbar_location:[s.Location,"right"],toolbar_sticky:[s.Boolean,!0],plot_width:[s.Number,600],plot_height:[s.Number,600],title:[s.Any,function(){return new u.Title({text:""})}],title_location:[s.Location,"above"],h_symmetry:[s.Bool,!0],v_symmetry:[s.Bool,!1],above:[s.Array,[]],below:[s.Array,[]],left:[s.Array,[]],right:[s.Array,[]],renderers:[s.Array,[]],x_range:[s.Instance],extra_x_ranges:[s.Any,{}],y_range:[s.Instance],extra_y_ranges:[s.Any,{}],x_scale:[s.Instance,function(){return new _.LinearScale}],y_scale:[s.Instance,function(){return new _.LinearScale}],lod_factor:[s.Number,10],lod_interval:[s.Number,300],lod_threshold:[s.Number,2e3],lod_timeout:[s.Number,500],hidpi:[s.Bool,!0],output_backend:[s.OutputBackend,"canvas"],min_border:[s.Number,5],min_border_top:[s.Number,null],min_border_left:[s.Number,null],min_border_bottom:[s.Number,null],min_border_right:[s.Number,null],inner_width:[s.Number],inner_height:[s.Number],layout_width:[s.Number],layout_height:[s.Number],match_aspect:[s.Bool,!1],aspect_scale:[s.Number,1]}),this.override({outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"}),g.register_with_event(g.UIEvent,this)},e.prototype.initialize=function(){t.prototype.initialize.call(this);for(var e=0,i=l.values(this.extra_x_ranges).concat(this.x_range);e<i.length;e++){var n=i[e],r=n.plots;h.isArray(r)&&(r=r.concat(this),n.setv({plots:r},{silent:!0}))}for(var o=0,s=l.values(this.extra_y_ranges).concat(this.y_range);o<s.length;o++){var a=s[o],r=a.plots;h.isArray(r)&&(r=r.concat(this),a.setv({plots:r},{silent:!0}))}null!=this.min_border&&(null==this.min_border_top&&(this.min_border_top=this.min_border),null==this.min_border_bottom&&(this.min_border_bottom=this.min_border),null==this.min_border_left&&(this.min_border_left=this.min_border),null==this.min_border_right&&(this.min_border_right=this.min_border));for(var c=0,u=["above","below","left","right"];c<u.length;c++)for(var _=u[c],p=this.getv(_),d=0,f=p;d<f.length;d++){var v=f[d];v.add_panel(_)}this._init_title_panel(),this._init_toolbar_panel(),this._plot_canvas=this._init_plot_canvas(),this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height)},e.prototype._init_plot_canvas=function(){return new f.PlotCanvas({plot:this})},e.prototype._init_title_panel=function(){if(null!=this.title){var t=h.isString(this.title)?new u.Title({text:this.title}):this.title;this.add_layout(t,this.title_location)}},e.prototype._init_toolbar_panel=function(){var t=this,e=a.find(this.renderers,function(e){return e instanceof d.ToolbarPanel&&a.includes(e.tags,t.id)});switch(null!=e&&this.remove_layout(e),this.toolbar_location){case"left":case"right":case"above":case"below":if(e=new d.ToolbarPanel({toolbar:this.toolbar,tags:[this.id]}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar_sticky){var i=this.getv(this.toolbar_location),n=a.find(i,function(t){return t instanceof u.Title});if(null!=n)return e.set_panel(n.panel),void this.add_renderers(e)}this.add_layout(e,this.toolbar_location)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.toolbar_location.change,function(){return e._init_toolbar_panel()})},Object.defineProperty(e.prototype,"plot_canvas",{get:function(){return this._plot_canvas},enumerable:!0,configurable:!0}),e.prototype._doc_attached=function(){this.plot_canvas.attach_document(this.document),t.prototype._doc_attached.call(this)},e.prototype.add_renderers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this.renderers;i=i.concat(t),this.renderers=i},e.prototype.add_layout=function(t,e){if(void 0===e&&(e="center"),null!=t.props.plot&&(t.plot=this),"center"!=e){var i=this.getv(e);i.push(t),t.add_panel(e)}this.add_renderers(t)},e.prototype.remove_layout=function(t){var e=function(e){a.removeBy(e,function(e){return e==t})};e(this.left),e(this.right),e(this.above),e(this.below),e(this.renderers)},e.prototype.add_glyph=function(t,e,i){void 0===e&&(e=new v.ColumnDataSource),void 0===i&&(i={});var n=l.extend({},i,{data_source:e,glyph:t}),r=new m.GlyphRenderer(n);return this.add_renderers(r),r},e.prototype.add_tools=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var r=n[i];null!=r.overlay&&this.add_renderers(r.overlay)}this.toolbar.tools=this.toolbar.tools.concat(t)},e.prototype.get_layoutable_children=function(){return[this.plot_canvas]},e.prototype.get_constraints=function(){var e=t.prototype.get_constraints.call(this);return e.push(r.EQ(this._width,[-1,this.plot_canvas._width])),e.push(r.EQ(this._height,[-1,this.plot_canvas._height])),e},e.prototype.get_constrained_variables=function(){var e=l.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this.plot_canvas._top,on_edge_align_bottom:this.plot_canvas._height_minus_bottom,on_edge_align_left:this.plot_canvas._left,on_edge_align_right:this.plot_canvas._width_minus_right,box_cell_align_top:this.plot_canvas._top,box_cell_align_bottom:this.plot_canvas._height_minus_bottom,box_cell_align_left:this.plot_canvas._left,box_cell_align_right:this.plot_canvas._width_minus_right,box_equal_size_top:this.plot_canvas._top,box_equal_size_bottom:this.plot_canvas._height_minus_bottom});return"fixed"!=this.sizing_mode&&(e.box_equal_size_left=this.plot_canvas._left,e.box_equal_size_right=this.plot_canvas._width_minus_right),e},Object.defineProperty(e.prototype,"all_renderers",{get:function(){for(var t=this.renderers,e=0,i=this.toolbar.tools;e<i.length;e++){var n=i[e];t=t.concat(n.synthetic_renderers)}return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"webgl",{get:function(){return o.logger.warn("webgl attr is deprecated, use output_backend"),"webgl"==this.output_backend},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tool_events",{get:function(){return o.logger.warn("tool_events attr is deprecated, use SelectionGeometry Event"),null},enumerable:!0,configurable:!0}),e}(c.LayoutDOM);i.Plot=b,b.initClass()},function(t,e,i){var n=t(379),r=t(84),o=t(85),s=t(164),a=t(169),l=t(146),h=t(19),c=t(4),u=t(20),_=t(49),p=t(6),d=t(11),f=t(10),v=t(13),m=t(14),g=t(7),y=t(15),b=t(42),x=t(44),w=t(21),k=t(32),S=t(12),C=null,T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"frame",{get:function(){return this.model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvas",{get:function(){return this.model.canvas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvas_overlays",{get:function(){return this.canvas_view.overlays_el},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvas_events",{get:function(){return this.canvas_view.events_el},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_paused",{get:function(){return null!=this._is_paused&&0!==this._is_paused},enumerable:!0,configurable:!0}),e.prototype.view_options=function(){return{plot_view:this,parent:this}},e.prototype.pause=function(){null==this._is_paused?this._is_paused=1:this._is_paused+=1},e.prototype.unpause=function(t){if(void 0===t&&(t=!1),null==this._is_paused)throw new Error("wasn't paused");this._is_paused-=1,0!=this._is_paused||t||this.request_render()},e.prototype.request_render=function(){this.request_paint()},e.prototype.request_paint=function(){this.is_paused||this.throttled_paint()},e.prototype.remove=function(){c.remove_views(this.renderer_views),c.remove_views(this.tool_views),this.canvas_view.remove(),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-plot-wrapper")},e.prototype.initialize=function(e){var i=this;this.pause(),t.prototype.initialize.call(this,e),this.force_paint=new h.Signal0(this,"force_paint"),this.state_changed=new h.Signal0(this,"state_changed"),this.lod_started=!1,this.visuals=new _.Visuals(this.model.plot),this._initial_state_info={selection:{},dimensions:{width:this.model.canvas._width.value,height:this.model.canvas._height.value}},this.state={history:[],index:-1},this.canvas_view=new this.canvas.default_view({model:this.canvas,parent:this}),this.el.appendChild(this.canvas_view.el),this.canvas_view.render(),"webgl"==this.model.plot.output_backend&&this.init_webgl(),this.throttled_paint=b.throttle(function(){return i.force_paint.emit()},15),this.ui_event_bus=new u.UIEvents(this,this.model.toolbar,this.canvas_view.el,this.model.plot),this.levels={};for(var n=0,r=g.RenderLevel;n<r.length;n++){var o=r[n];this.levels[o]={}}this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.update_dataranges(),this.unpause(!0),m.logger.debug("PlotView initialized")},e.prototype.set_cursor=function(t){void 0===t&&(t="default"),this.canvas_view.el.style.cursor=t},e.prototype.init_webgl=function(){if(null==C){var t=document.createElement("canvas"),e={premultipliedAlpha:!0},i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);null!=i&&(C={canvas:t,ctx:i})}null!=C?this.gl=C:m.logger.warn("WebGL is not supported, falling back to 2D canvas.")},e.prototype.prepare_webgl=function(t,e){if(null!=this.gl){var i=this.canvas_view.get_canvas_element();this.gl.canvas.width=i.width,this.gl.canvas.height=i.height;var n=this.gl.ctx;n.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT||n.DEPTH_BUFFER_BIT),n.enable(n.SCISSOR_TEST);var r=e[0],o=e[1],s=e[2],a=e[3],l=this.model.canvas,h=l.xview,c=l.yview,u=h.compute(r),_=c.compute(o+a);n.scissor(t*u,t*_,t*s,t*a),n.enable(n.BLEND),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_DST_ALPHA,n.ONE)}},e.prototype.blit_webgl=function(t){var e=this.canvas_view.ctx;null!=this.gl&&(m.logger.debug("drawing with WebGL"),e.restore(),e.drawImage(this.gl.canvas,0,0),e.save(),e.scale(t,t),e.translate(.5,.5))},e.prototype.update_dataranges=function(){for(var t=this.model.frame,e={},i={},n=!1,r=0,o=k.values(t.x_ranges).concat(k.values(t.y_ranges));r<o.length;r++){var l=o[r];l instanceof s.DataRange1d&&"log"==l.scale_hint&&(n=!0)}for(var h in this.renderer_views){var c=this.renderer_views[h];if(c instanceof a.GlyphRendererView){var u=c.glyph.bounds();if(null!=u&&(e[h]=u),n){var _=c.glyph.log_bounds();null!=_&&(i[h]=_)}}}var p,d=!1,f=!1;!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&(p=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value));for(var v=0,g=k.values(t.x_ranges);v<g.length;v++){var y=g[v];if(y instanceof s.DataRange1d){var b="log"==y.scale_hint?i:e;y.update(b,0,this.model.id,p),y.follow&&(d=!0)}null!=y.bounds&&(f=!0)}for(var x=0,w=k.values(t.y_ranges);x<w.length;x++){var S=w[x];if(S instanceof s.DataRange1d){var b="log"==S.scale_hint?i:e;S.update(b,1,this.model.id,p),S.follow&&(d=!0)}null!=S.bounds&&(f=!0)}if(d&&f){m.logger.warn("Follow enabled so bounds are unset.");for(var C=0,T=k.values(t.x_ranges);C<T.length;C++){var y=T[C];y.bounds=null}for(var A=0,E=k.values(t.y_ranges);A<E.length;A++){var S=E[A];S.bounds=null}}this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,i,n){return void 0===i&&(i="default"),void 0===n&&(n="default"),this.frame.map_to_screen(t,e,i,n)},e.prototype.push_state=function(t,e){var i=this.state,n=i.history,r=i.index,o=null!=n[r]?n[r].info:{},s=k.extend({},this._initial_state_info,o,e);this.state.history=this.state.history.slice(0,this.state.index+1),this.state.history.push({type:t,info:s}),this.state.index=this.state.history.length-1,this.state_changed.emit()},e.prototype.clear_state=function(){this.state={history:[],index:-1},this.state_changed.emit()},e.prototype.can_undo=function(){this.state.index},e.prototype.can_redo=function(){this.state.index,this.state.history.length},e.prototype.undo=function(){this.can_undo()&&(this.state.index-=1,this._do_state_change(this.state.index),this.state_changed.emit())},e.prototype.redo=function(){this.can_redo()&&(this.state.index+=1,this._do_state_change(this.state.index),this.state_changed.emit())},e.prototype._do_state_change=function(t){var e=null!=this.state.history[t]?this.state.history[t].info:this._initial_state_info;null!=e.range&&this.update_range(e.range),null!=e.selection&&this.update_selection(e.selection)},e.prototype.get_selection=function(){for(var t={},e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof a.GlyphRenderer){var r=n.data_source.selected;t[n.id]=r}}return t},e.prototype.update_selection=function(t){for(var e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof a.GlyphRenderer){var r=n.data_source;null!=t?null!=t[n.id]&&(r.selected=t[n.id]):r.selection_manager.clear()}}},e.prototype.reset_selection=function(){this.update_selection(null)},e.prototype._update_ranges_together=function(t){for(var e=1,i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[1];e=Math.min(e,this._get_weight_to_constrain_interval(o,s))}if(e<1)for(var a=0,l=t;a<l.length;a++){var h=l[a],o=h[0],s=h[1];s.start=e*s.start+(1-e)*o.start,s.end=e*s.end+(1-e)*o.end}},e.prototype._update_ranges_individually=function(t,e,i,n){for(var r=!1,o=0,s=t;o<s.length;o++){var a=s[o],l=a[0],h=a[1],c=l.start>l.end;if(!i){var u=this._get_weight_to_constrain_interval(l,h);u<1&&(h.start=u*h.start+(1-u)*l.start,h.end=u*h.end+(1-u)*l.end)}if(null!=l.bounds&&"auto"!=l.bounds){var _=l.bounds,p=_[0],d=_[1],f=Math.abs(h.end-h.start);c?(null!=p&&p>=h.end&&(r=!0,h.end=p,(e||i)&&(h.start=p+f)),null!=d&&d<=h.start&&(r=!0,h.start=d,(e||i)&&(h.end=d-f))):(null!=p&&p>=h.start&&(r=!0,h.start=p,(e||i)&&(h.end=p+f)),null!=d&&d<=h.end&&(r=!0,h.end=d,(e||i)&&(h.start=d-f)))}}if(!(i&&r&&n))for(var v=0,m=t;v<m.length;v++){var g=m[v],l=g[0],h=g[1];l.have_updated_interactively=!0,l.start==h.start&&l.end==h.end||l.setv(h)}},e.prototype._get_weight_to_constrain_interval=function(t,e){var i=t.min_interval,n=t.max_interval;if(null!=t.bounds&&"auto"!=t.bounds){var r=t.bounds,o=r[0],s=r[1];if(null!=o&&null!=s){var a=Math.abs(s-o);n=null!=n?Math.min(n,a):a}}var l=1;if(null!=i||null!=n){var h=Math.abs(t.end-t.start),c=Math.abs(e.end-e.start);i>0&&c<i&&(l=(h-i)/(h-c)),n>0&&c>n&&(l=(n-h)/(c-h)),l=Math.max(0,Math.min(1,l))}return l},e.prototype.update_range=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!0),this.pause();var r=this.frame,o=r.x_ranges,s=r.y_ranges;if(null==t){for(var a in o){var l=o[a];l.reset()}for(var h in s){var l=s[h];l.reset()}this.update_dataranges()}else{var c=[];for(var u in o){var l=o[u];c.push([l,t.xrs[u]])}for(var _ in s){var l=s[_];c.push([l,t.yrs[_]])}i&&this._update_ranges_together(c),this._update_ranges_individually(c,e,i,n)}this.unpause()},e.prototype.reset_range=function(){this.update_range(null)},e.prototype.build_levels=function(){for(var t=this.model.plot.all_renderers,e=k.keys(this.renderer_views),i=c.build_views(this.renderer_views,t,this.view_options()),n=w.difference(e,t.map(function(t){return t.id})),r=0,o=n;r<o.length;r++){var s=o[r];delete this.levels.glyph[s]}for(var a=0,l=i;a<l.length;a++){var h=l[a];this.levels[h.model.level][h.model.id]=h}},e.prototype.get_renderer_views=function(){var t=this;return this.model.plot.renderers.map(function(e){return t.levels[e.level][e.id]})},e.prototype.build_tools=function(){var t=this,e=this.model.plot.toolbar.tools,i=c.build_views(this.tool_views,e,this.view_options());i.map(function(e){return t.ui_event_bus.register_tool(e)})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.force_paint,function(){return e.repaint()});var i=this.model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];this.connect(s.change,function(){return e.request_render()})}for(var a in r){var s=r[a];this.connect(s.change,function(){return e.request_render()})}this.connect(this.model.plot.properties.renderers.change,function(){return e.build_levels()}),this.connect(this.model.plot.toolbar.properties.tools.change,function(){e.build_levels(),e.build_tools()}),this.connect(this.model.plot.change,function(){return e.request_render()})},e.prototype.set_initial_range=function(){var t=!0,e=this.frame,i=e.x_ranges,n=e.y_ranges,r={},o={};for(var s in i){var a=i[s],l=a.start,h=a.end;if(null==l||null==h||x.isStrictNaN(l+h)){t=!1;break}r[s]={start:l,end:h}}if(t)for(var c in n){var u=n[c],l=u.start,h=u.end;if(null==l||null==h||x.isStrictNaN(l+h)){t=!1;break}o[c]={start:l,end:h}}t?(this._initial_state_info.range={xrs:r,yrs:o},m.logger.debug("initial ranges set")):m.logger.warn("could not set initial ranges")},e.prototype.update_constraints=function(){this.solver.suggest_value(this.frame._width,this.canvas._width.value),this.solver.suggest_value(this.frame._height,this.canvas._height.value);for(var t in this.renderer_views){var e=this.renderer_views[t];S.isSizeableView(e)&&null!=e.model.panel&&S.update_panel_constraints(e)}this.solver.update_variables()},e.prototype._layout=function(t){void 0===t&&(t=!1),this.render(),t&&(this.model.plot.setv({inner_width:Math.round(this.frame._width.value),inner_height:Math.round(this.frame._height.value),layout_width:Math.round(this.canvas._width.value),layout_height:Math.round(this.canvas._height.value)},{no_change:!0}),this.paint())},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;for(var e in this.levels){var i=this.levels[e];for(var n in i){var r=i[n];if(!r.has_finished())return!1}}return!0},e.prototype.render=function(){var t=this.model._width.value,e=this.model._height.value;this.canvas_view.set_dims([t,e]),this.update_constraints(),!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&this.update_dataranges(),this.el.style.position="absolute",this.el.style.left=this.model._dom_left.value+"px",this.el.style.top=this.model._dom_top.value+"px",this.el.style.width=this.model._width.value+"px",this.el.style.height=this.model._height.value+"px"},e.prototype._needs_layout=function(){for(var t in this.renderer_views){var e=this.renderer_views[t];if(S.isSizeableView(e)&&null!=e.model.panel&&S._view_sizes.get(e)!=e.get_size())return!0}return!1},e.prototype.repaint=function(){this._needs_layout()?this.parent.partial_layout():this.paint()},e.prototype.paint=function(){var t=this;if(!this.is_paused){m.logger.trace("PlotCanvas.render() for "+this.model.id),this.canvas_view.prepare_canvas();var e=this.model.document;if(null!=e){var i=e.interactive_duration(),n=this.model.plot;i>=0&&i<n.lod_interval?setTimeout(function(){e.interactive_duration()>n.lod_timeout&&e.interactive_stop(n),t.request_render()},n.lod_timeout):e.interactive_stop(n)}for(var r in this.renderer_views){var o=this.renderer_views[r];if(null==this.range_update_timestamp||o instanceof a.GlyphRendererView&&o.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}}this.model.frame.update_scales();var s=this.canvas_view.ctx,l=this.canvas.pixel_ratio;s.save(),s.scale(l,l),s.translate(.5,.5);var h=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value];if(this._map_hook(s,h),this._paint_empty(s,h),this.prepare_webgl(l,h),s.save(),this.visuals.outline_line.doit){this.visuals.outline_line.set_value(s);var c=h[0],u=h[1],_=h[2],p=h[3];c+_==this.canvas._width.value&&(_-=1),u+p==this.canvas._height.value&&(p-=1),s.strokeRect(c,u,_,p)}s.restore(),this._paint_levels(s,["image","underlay","glyph"],h),this.blit_webgl(l),this._paint_levels(s,["annotation"],h),this._paint_levels(s,["overlay"]),null==this._initial_state_info.range&&this.set_initial_range(),s.restore(),this._has_finished||(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,i){t.save(),null!=i&&(t.beginPath(),t.rect.apply(t,i),t.clip());for(var n={},r=0;r<this.model.plot.renderers.length;r++){var o=this.model.plot.renderers[r];n[o.id]=r}for(var s=function(t){return n[t.model.id]},a=0,l=e;a<l.length;a++)for(var h=l[a],c=w.sortBy(k.values(this.levels[h]),s),u=0,_=c;u<_.length;u++){var p=_[u];p.render()}t.restore()},e.prototype._map_hook=function(t,e){},e.prototype._paint_empty=function(t,e){var i=[0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value],n=i[0],r=i[1],o=i[2],s=i[3],a=e[0],l=e[1],h=e[2],c=e[3];t.clearRect(n,r,o,s),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(n,r,o,s),t.clearRect(a,l,h,c)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(a,l,h,c))},e.prototype.save=function(t){switch(this.model.plot.output_backend){case"canvas":case"webgl":var e=this.canvas_view.get_canvas_element();if(null!=e.msToBlob){var i=e.msToBlob();window.navigator.msSaveBlob(i,t)}else{var n=document.createElement("a");n.href=e.toDataURL("image/png"),n.download=t+".png",n.target="_blank",n.dispatchEvent(new MouseEvent("click"))}case"svg":var r=this.canvas_view.ctx.getSerializedSvg(!0),o=new Blob([r],{type:"text/plain"}),s=document.createElement("a");s.download=t+".svg",s.innerHTML="Download svg",s.href=window.URL.createObjectURL(o),s.onclick=function(t){return document.body.removeChild(t.target)},s.style.display="none",document.body.appendChild(s),s.click()}},e}(p.DOMView);i.PlotCanvasView=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="AbovePanel"},e}(d.LayoutCanvas);i.AbovePanel=A,A.initClass();var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BelowPanel"},e}(d.LayoutCanvas);i.BelowPanel=E,E.initClass();var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LeftPanel"},e}(d.LayoutCanvas);i.LeftPanel=M,M.initClass();var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="RightPanel"},e}(d.LayoutCanvas);i.RightPanel=O,O.initClass();var z=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PlotCanvas",this.prototype.default_view=T,this.internal({plot:[y.Instance],toolbar:[y.Instance],canvas:[y.Instance],frame:[y.Instance]}),this.override({sizing_mode:"stretch_both"})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.canvas=new r.Canvas({map:null!=this.use_map&&this.use_map,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new o.CartesianFrame({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_scale:this.plot.x_scale,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_scale:this.plot.y_scale}),this.above_panel=new A,this.below_panel=new E,this.left_panel=new M,this.right_panel=new O,m.logger.debug("PlotCanvas initialized")},e.prototype._doc_attached=function(){this.canvas.attach_document(this.document),this.frame.attach_document(this.document),this.above_panel.attach_document(this.document),this.below_panel.attach_document(this.document),this.left_panel.attach_document(this.document),this.right_panel.attach_document(this.document),t.prototype._doc_attached.call(this),m.logger.debug("PlotCanvas attached to document")},e.prototype.get_layoutable_children=function(){var t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],e=function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];S.isSizeable(r)&&null!=r.panel&&t.push(r.panel)}};return e(this.plot.above),e(this.plot.below),e(this.plot.left),e(this.plot.right),t},e.prototype.get_constraints=function(){return t.prototype.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},e.prototype._get_constant_constraints=function(){return[v.EQ(this.canvas._left,0),v.EQ(this.canvas._top,0),v.GE(this.above_panel._top,[-1,this.canvas._top]),v.EQ(this.above_panel._bottom,[-1,this.frame._top]),v.EQ(this.above_panel._left,[-1,this.left_panel._right]),v.EQ(this.above_panel._right,[-1,this.right_panel._left]),v.EQ(this.below_panel._top,[-1,this.frame._bottom]),v.LE(this.below_panel._bottom,[-1,this.canvas._bottom]),v.EQ(this.below_panel._left,[-1,this.left_panel._right]),v.EQ(this.below_panel._right,[-1,this.right_panel._left]),v.EQ(this.left_panel._top,[-1,this.above_panel._bottom]),v.EQ(this.left_panel._bottom,[-1,this.below_panel._top]),v.GE(this.left_panel._left,[-1,this.canvas._left]),v.EQ(this.left_panel._right,[-1,this.frame._left]),v.EQ(this.right_panel._top,[-1,this.above_panel._bottom]),v.EQ(this.right_panel._bottom,[-1,this.below_panel._top]),v.EQ(this.right_panel._left,[-1,this.frame._right]),v.LE(this.right_panel._right,[-1,this.canvas._right]),v.EQ(this._top,[-1,this.above_panel._bottom]),v.EQ(this._left,[-1,this.left_panel._right]),v.EQ(this._height,[-1,this._bottom],[-1,this.canvas._bottom],this.below_panel._top),v.EQ(this._width,[-1,this._right],[-1,this.canvas._right],this.right_panel._left),v.GE(this._top,-this.plot.min_border_top),v.GE(this._left,-this.plot.min_border_left),v.GE(this._height,[-1,this._bottom],-this.plot.min_border_bottom),v.GE(this._width,[-1,this._right],-this.plot.min_border_right)]},e.prototype._get_side_constraints=function(){var t=function(t){return t.map(function(t){return t.panel})},e=f.vstack(this.above_panel,t(this.plot.above)),i=f.vstack(this.below_panel,w.reversed(t(this.plot.below))),n=f.hstack(this.left_panel,t(this.plot.left)),r=f.hstack(this.right_panel,w.reversed(t(this.plot.right)));return w.concat([e,i,n,r])},e}(l.LayoutDOM);i.PlotCanvas=z,z.initClass()},function(t,e,i){var n=t(379),r=t(167),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DataRange",this.define({names:[o.Array,[]],renderers:[o.Array,[]]})},e}(r.Range);i.DataRange=s,s.initClass()},function(t,e,i){var n=t(379),r=t(163),o=t(169),s=t(14),a=t(15),l=t(24),h=t(21),c=function(t){function e(e){var i=t.call(this,e)||this;return i._plot_bounds={},i.have_updated_interactively=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DataRange1d",this.define({start:[a.Number],end:[a.Number],range_padding:[a.Number,.1],range_padding_units:[a.PaddingUnits,"percent"],flipped:[a.Bool,!1],follow:[a.StartEnd],follow_interval:[a.Number],default_span:[a.Number,2]}),this.internal({scale_hint:[a.String,"auto"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span},Object.defineProperty(e.prototype,"min",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),e.prototype.computed_renderers=function(){var t=this.names,e=this.renderers;if(0==e.length)for(var i=0,n=this.plots;i<n.length;i++){var r=n[i],a=r.renderers.filter(function(t){return t instanceof o.GlyphRenderer});e=e.concat(a)}t.length>0&&(e=e.filter(function(e){return h.includes(t,e.name)})),s.logger.debug("computed "+e.length+" renderers for DataRange1d "+this.id);for(var l=0,c=e;l<c.length;l++){var u=c[l];s.logger.trace(" - "+u.type+" "+u.id)}return e},e.prototype._compute_plot_bounds=function(t,e){for(var i=l.empty(),n=0,r=t;n<r.length;n++){var o=r[n];null!=e[o.id]&&(i=l.union(i,e[o.id]))}return i},e.prototype.adjust_bounds_for_aspect=function(t,e){var i=l.empty(),n=t.maxX-t.minX;n<=0&&(n=1);var r=t.maxY-t.minY;r<=0&&(r=1);var o=.5*(t.maxX+t.minX),s=.5*(t.maxY+t.minY);return n<e*r?n=e*r:r=n/e,i.maxX=o+.5*n,i.minX=o-.5*n,i.maxY=s+.5*r,i.minY=s-.5*r,i},e.prototype._compute_min_max=function(t,e){var i=l.empty();for(var n in t){var r=t[n];i=l.union(i,r)}var o,s;return 0==e?(a=[i.minX,i.maxX],o=a[0],s=a[1]):(h=[i.minY,i.maxY],o=h[0],s=h[1]),[o,s];var a,h},e.prototype._compute_range=function(t,e){var i,n,r=this.range_padding;if("log"==this.scale_hint){(isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,s.logger.warn("could not determine minimum data value for log axis, DataRange1d using value "+t)),(isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?10:100*t,s.logger.warn("could not determine maximum data value for log axis, DataRange1d using value "+e));var o=void 0,a=void 0;if(e==t)a=this.default_span+.001,o=Math.log(t)/Math.log(10);else{var l=void 0,h=void 0;"percent"==this.range_padding_units?(l=Math.log(t)/Math.log(10),h=Math.log(e)/Math.log(10),a=(h-l)*(1+r)):(l=Math.log(t-r)/Math.log(10),h=Math.log(e+r)/Math.log(10),a=h-l),o=(l+h)/2}i=Math.pow(10,o-a/2),n=Math.pow(10,o+a/2)}else{var a=void 0;a=e==t?this.default_span:"percent"==this.range_padding_units?(e-t)*(1+r):e-t+2*r;var o=(e+t)/2;i=o-a/2,n=o+a/2}var c=1;this.flipped&&(i=(_=[n,i])[0],n=_[1],c=-1);var u=this.follow_interval;return null!=u&&Math.abs(i-n)>u&&("start"==this.follow?n=i+c*u:"end"==this.follow&&(i=n-c*u)),[i,n];var _},e.prototype.update=function(t,e,i,n){if(!this.have_updated_interactively){var r=this.computed_renderers(),o=this._compute_plot_bounds(r,t);null!=n&&(o=this.adjust_bounds_for_aspect(o,n)),this._plot_bounds[i]=o;var s=this._compute_min_max(this._plot_bounds,e),a=s[0],l=s[1],h=this._compute_range(a,l),c=h[0],u=h[1];null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(c=this._initial_start):c=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(u=this._initial_end):u=this._initial_end);var _=[this.start,this.end],p=_[0],d=_[1];if(c!=p||u!=d){var f={};c!=p&&(f.start=c),u!=d&&(f.end=u),this.setv(f)}"auto"==this.bounds&&this.setv({bounds:[c,u]},{silent:!0}),this.change.emit()}},e.prototype.reset=function(){this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},e}(r.DataRange);i.DataRange1d=c,c.initClass()},function(t,e,i){function n(t,e,i){void 0===i&&(i=0);for(var n={},r=0;r<t.length;r++){var o=t[r];if(o in n)throw new Error("duplicate factor or subfactor: "+o);n[o]={value:.5+r*(1+e)+i}}return[n,(t.length-1)*e]}function r(t,e,i,r){void 0===r&&(r=0);for(var o={},s={},a=[],l=0,h=t;l<h.length;l++){var u=h[l],_=u[0],p=u[1];_ in s||(s[_]=[],a.push(_)),s[_].push(p)}for(var d=r,f=0,v=function(t){var r=s[t].length,a=n(s[t],i,d),l=a[0],h=a[1];f+=h;var u=c.sum(s[t].map(function(t){return l[t].value}));o[t]={value:u/r,mapping:l},d+=r+e+h},m=0,g=a;m<g.length;m++){var _=g[m];v(_)}return[o,a,(a.length-1)*e+f]}function o(t,e,i,n,o){void 0===o&&(o=0);for(var s={},a={},l=[],h=0,u=t;h<u.length;h++){var _=u[h],p=_[0],d=_[1],f=_[2];p in a||(a[p]=[],l.push(p)),a[p].push([d,f])}for(var v=[],m=o,g=0,y=function(t){for(var o=a[t].length,l=r(a[t],i,n,m),h=l[0],u=l[1],_=l[2],p=0,d=u;p<d.length;p++){var f=d[p];v.push([t,f])}g+=_;var y=c.sum(a[t].map(function(t){var e=t[0];return h[e].value}));s[t]={value:y/o,mapping:h},m+=o+e+_},b=0,x=l;b<x.length;b++){var p=x[b];y(p)}return[s,l,v,(l.length-1)*e+g]}var s=t(379),a=t(167),l=t(15),h=t(22),c=t(21),u=t(44);i.map_one_level=n,i.map_two_levels=r,i.map_three_levels=o;var _=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type="FactorRange",this.define({factors:[l.Array,[]],factor_padding:[l.Number,0],subgroup_padding:[l.Number,.8],group_padding:[l.Number,1.4],range_padding:[l.Number,0],range_padding_units:[l.PaddingUnits,"percent"],start:[l.Number],end:[l.Number]}),this.internal({levels:[l.Number],mids:[l.Array],tops:[l.Array],tops_groups:[l.Array]})},Object.defineProperty(e.prototype,"min",{get:function(){return this.start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.end},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.factors.change,function(){return e.reset()}),this.connect(this.properties.factor_padding.change,function(){return e.reset()}),this.connect(this.properties.group_padding.change,function(){return e.reset()}),this.connect(this.properties.subgroup_padding.change,function(){return e.reset()}),this.connect(this.properties.range_padding.change,function(){return e.reset()}),this.connect(this.properties.range_padding_units.change,function(){return e.reset()})},e.prototype.reset=function(){this._init(),this.change.emit()},e.prototype._lookup=function(t){if(1==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])?e[t[0]].value:NaN}if(2==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])?e[t[0]].mapping[t[1]].value:NaN}if(3==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])&&e[t[0]].mapping[t[1]].mapping.hasOwnProperty(t[2])?e[t[0]].mapping[t[1]].mapping[t[2]].value:NaN}throw new Error("unreachable code")},e.prototype.synthetic=function(t){if(u.isNumber(t))return t;if(u.isString(t))return this._lookup([t]);var e=0,i=t[t.length-1];return u.isNumber(i)&&(e=i,t=t.slice(0,-1)),this._lookup(t)+e},e.prototype.v_synthetic=function(t){var e=this;return h.map(t,function(t){return e.synthetic(t)})},e.prototype._init=function(){var t,e;if(c.all(this.factors,u.isString))t=1,l=n(this.factors,this.factor_padding),this._mapping=l[0],e=l[1];else if(c.all(this.factors,function(t){return u.isArray(t)&&2==t.length&&u.isString(t[0])&&u.isString(t[1])}))t=2,h=r(this.factors,this.group_padding,this.factor_padding),this._mapping=h[0],this.tops=h[1],e=h[2];else{if(!c.all(this.factors,function(t){return u.isArray(t)&&3==t.length&&u.isString(t[0])&&u.isString(t[1])&&u.isString(t[2])}))throw new Error("???");t=3,_=o(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=_[0],this.tops=_[1],this.mids=_[2],e=_[3]}var i=0,s=this.factors.length+e;if("percent"==this.range_padding_units){var a=(s-i)*this.range_padding/2;i-=a,s+=a}else i-=this.range_padding,s+=this.range_padding;this.setv({start:i,end:s,levels:t},{silent:!0}),"auto"==this.bounds&&this.setv({bounds:[i,s]},{silent:!0});var l,h,_},e}(a.Range);i.FactorRange=_,_.initClass()},function(t,e,i){var n=t(163);i.DataRange=n.DataRange;var r=t(164);i.DataRange1d=r.DataRange1d;var o=t(165);i.FactorRange=o.FactorRange;var s=t(167);i.Range=s.Range;var a=t(168);i.Range1d=a.Range1d},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=function(t){function e(e){var i=t.call(this,e)||this;return i.have_updated_interactively=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Range",this.define({callback:[o.Any],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),this.internal({plots:[o.Array,[]]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._emit_callback()})},e.prototype.reset=function(){this.change.emit()},e.prototype._emit_callback=function(){null!=this.callback&&(s.isFunction(this.callback)?this.callback(this):this.callback.execute(this,{}))},e}(r.Model);i.Range=a,a.initClass()},function(t,e,i){var n=t(379),r=t(167),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Range1d",this.define({start:[o.Number,0],end:[o.Number,1]})},e.prototype._set_auto_bounds=function(){if("auto"==this.bounds){var t=Math.min(this._initial_start,this._initial_end),e=Math.max(this._initial_start,this._initial_end);this.setv({bounds:[t,e]},{silent:!0})}},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._initial_start=this.start,this._initial_end=this.end,this._set_auto_bounds()},Object.defineProperty(e.prototype,"min",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is_reversed",{get:function(){return this.start>this.end},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._set_auto_bounds(),this.start!=this._initial_start||this.end!=this._initial_end?this.setv({start:this._initial_start,end:this._initial_end}):this.change.emit()},e}(r.Range);i.Range1d=s,s.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(120),s=t(189),a=t(183),l=t(14),h=t(15),c=t(22),u=t(21),_=t(32),p=t(165),d={fill:{},line:{}},f={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},v={fill:{fill_alpha:.2},line:{}},m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){function i(t){var e=_.clone(a);return r&&_.extend(e,t.fill),o&&_.extend(e,t.line),new n.constructor(e)}t.prototype.initialize.call(this,e);var n=this.model.glyph,r=u.includes(n.mixins,"fill"),o=u.includes(n.mixins,"line"),a=_.clone(n.attributes);delete a.id,this.glyph=this.build_glyph_view(n);var l=this.model.selection_glyph;null==l?l=i({fill:{},line:{}}):"auto"===l&&(l=i(d)),this.selection_glyph=this.build_glyph_view(l);var h=this.model.nonselection_glyph;null==h?h=i({fill:{},line:{}}):"auto"===h&&(h=i(v)),this.nonselection_glyph=this.build_glyph_view(h);var c=this.model.hover_glyph;null!=c&&(this.hover_glyph=this.build_glyph_view(c));var p=this.model.muted_glyph;null!=p&&(this.muted_glyph=this.build_glyph_view(p));var m=i(f);this.decimated_glyph=this.build_glyph_view(m),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1),this.model.data_source instanceof s.RemoteDataSource&&this.model.data_source.setup()},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()}),this.connect(this.model.glyph.change,function(){return e.set_data()}),this.connect(this.model.data_source.change,function(){return e.set_data()}),this.connect(this.model.data_source.streaming,function(){return e.set_data()}),this.connect(this.model.data_source.patching,function(t){return e.set_data(!0,t)}),this.connect(this.model.data_source._select,function(){return e.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return e.request_render()}),this.connect(this.model.properties.view.change,function(){return e.set_data()}),this.connect(this.model.view.change,function(){return e.set_data()});var i=this.plot_model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];s instanceof p.FactorRange&&this.connect(s.change,function(){return e.set_data()})}for(var a in r){var s=r[a];s instanceof p.FactorRange&&this.connect(s.change,function(){return e.set_data()})}this.connect(this.model.glyph.transformchange,function(){return e.set_data()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=null);var i=Date.now(),n=this.model.data_source;this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(n,this.all_indices,e),this.glyph.set_visuals(n),this.decimated_glyph.set_visuals(n),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(n),this.nonselection_glyph.set_visuals(n)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(n),null!=this.muted_glyph&&this.muted_glyph.set_visuals(n);var r=this.plot_model.plot.lod_factor;this.decimated=[];for(var o=0,s=Math.floor(this.all_indices.length/r);o<s;o++)this.decimated.push(o*r);var a=Date.now()-i;l.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+a+"ms"),this.set_data_timestamp=Date.now(),t&&this.request_render()},e.prototype.render=function(){var t=this;if(this.model.visible){var e=Date.now(),i=this.glyph.glglyph;this.glyph.map_data();var n=Date.now()-e,r=Date.now(),s=this.glyph.mask_data(this.all_indices);s.length===this.all_indices.length&&(s=u.range(0,this.all_indices.length));var a=Date.now()-r,h=this.plot_view.canvas_view.ctx;h.save();var c,_=this.model.data_source.selected;c=!_||_.is_empty()?[]:this.glyph instanceof o.LineView&&_.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(s):_.indices;var p,d=this.model.data_source.inspected;p=d&&0!==d.length?d["0d"].glyph?this.model.view.convert_indices_from_subset(s):d["1d"].indices.length>0?d["1d"].indices:function(){for(var t=[],e=0,i=Object.keys(d["2d"].indices);e<i.length;e++){var n=i[e];t.push(parseInt(n))}return t}():[];var f,v,m,g=function(){for(var e=[],i=0,n=s;i<n.length;i++){var r=n[i];u.includes(p,t.all_indices[r])&&e.push(r)}return e}(),y=this.plot_model.plot.lod_threshold;null!=this.model.document&&this.model.document.interactive_duration()>0&&!i&&null!=y&&this.all_indices.length>y?(s=this.decimated,f=this.decimated_glyph,v=this.decimated_glyph,m=this.selection_glyph):(f=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,v=this.nonselection_glyph,m=this.selection_glyph),null!=this.hover_glyph&&g.length&&(s=u.difference(s,g));var b,x=null;if(c.length&&this.have_selection_glyphs()){for(var w=Date.now(),k={},S=0,C=c;S<C.length;S++){var T=C[S];k[T]=!0}var A=new Array,E=new Array;if(this.glyph instanceof o.LineView)for(var M=0,O=this.all_indices;M<O.length;M++){var T=O[M];null!=k[T]?A.push(T):E.push(T)}else for(var z=0,P=s;z<P.length;z++){var T=P[z];null!=k[this.all_indices[T]]?A.push(T):E.push(T)}x=Date.now()-w,b=Date.now(),v.render(h,E,this.glyph),m.render(h,A,this.glyph),null!=this.hover_glyph&&(this.glyph instanceof o.LineView?this.hover_glyph.render(h,this.model.view.convert_indices_from_subset(g),this.glyph):this.hover_glyph.render(h,g,this.glyph))}else b=Date.now(),this.glyph instanceof o.LineView?this.hover_glyph&&g.length?this.hover_glyph.render(h,this.model.view.convert_indices_from_subset(g),this.glyph):f.render(h,this.all_indices,this.glyph):(f.render(h,s,this.glyph),this.hover_glyph&&g.length&&this.hover_glyph.render(h,g,this.glyph));var j=Date.now()-b;this.last_dtrender=j;var N=Date.now()-e;return l.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): render finished in "+N+"ms"),l.logger.trace(" - map_data finished in       : "+n+"ms"),l.logger.trace(" - mask_data finished in      : "+a+"ms"),null!=x&&l.logger.trace(" - selection mask finished in : "+x+"ms"),l.logger.trace(" - glyph renders finished in  : "+j+"ms"),h.restore()}},e.prototype.draw_legend=function(t,e,i,n,r,o,s){var a=this.model.get_reference_point(o,s);this.glyph.draw_legend_for_index(t,{x0:e,x1:i,y0:n,y1:r},a)},e.prototype.hit_test=function(t){if(!this.model.visible)return null;var e=this.glyph.hit_test(t);return null==e?null:this.model.view.convert_selection_from_subset(e)},e}(r.RendererView);i.GlyphRendererView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GlyphRenderer",this.prototype.default_view=m,this.define({x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],data_source:[h.Instance],view:[h.Instance,function(){return new a.CDSView}],glyph:[h.Instance],hover_glyph:[h.Instance],nonselection_glyph:[h.Any,"auto"],selection_glyph:[h.Any,"auto"],muted_glyph:[h.Instance],muted:[h.Bool,!1]}),this.override({level:"glyph"})},e.prototype.initialize=function(){t.prototype.initialize.call(this),null==this.view.source&&(this.view.source=this.data_source,this.view.compute_indices())},e.prototype.get_reference_point=function(t,e){var i=0;if(null!=t){var n=this.data_source.get_column(t);if(null!=n){var r=c.indexOf(n,e);-1!=r&&(i=r)}}return i},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(r.Renderer);i.GlyphRenderer=g,g.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(136),s=t(15),a=t(4),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales.default,this.yscale=this.plot_view.frame.yscales.default,this._renderer_views={},i=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=i[0],this.edge_view=i[1],this.set_data();var i},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source._select,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source._select,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return e.set_data()});var i=this.plot_model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];this.connect(s.change,function(){return e.set_data()})}for(var a in r){var s=r[a];this.connect(s.change,function(){return e.set_data()})}},e.prototype.set_data=function(t){void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0});var e=this.node_view.glyph;n=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),e._x=n[0],e._y=n[1];var i=this.edge_view.glyph;r=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),i._xs=r[0],i._ys=r[1],e.index_data(),i.index_data(),t&&this.request_render();var n,r},e.prototype.render=function(){this.edge_view.render(),this.node_view.render()},e}(r.RendererView);i.GraphRendererView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GraphRenderer",this.prototype.default_view=l,this.define({x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),this.override({level:"glyph"})},e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);i.GraphRenderer=h,h.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.RendererView);i.GuideRendererView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GuideRenderer",this.define({plot:[o.Instance]}),this.override({level:"overlay"})},e}(r.Renderer);i.GuideRenderer=a,a.initClass()},function(t,e,i){var n=t(169);i.GlyphRenderer=n.GlyphRenderer;var r=t(170);i.GraphRenderer=r.GraphRenderer;var o=t(171);i.GuideRenderer=o.GuideRenderer;var s=t(173);i.Renderer=s.Renderer},function(t,e,i){var n=t(379),r=t(6),o=t(49),s=t(15),a=t(53),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},Object.defineProperty(e.prototype,"plot_model",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),e.prototype.request_render=function(){this.plot_view.request_render()},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},e}(r.DOMView);i.RendererView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Renderer",this.define({level:[s.RenderLevel],visible:[s.Bool,!0]})},e}(a.Model);i.Renderer=h,h.initClass()},function(t,e,i){var n=t(379),r=t(176),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CategoricalScale"},e.prototype.compute=function(e){return t.prototype.compute.call(this,this.source_range.synthetic(e))},e.prototype.v_compute=function(e){return t.prototype.v_compute.call(this,this.source_range.v_synthetic(e))},e}(r.LinearScale);i.CategoricalScale=o,o.initClass()},function(t,e,i){var n=t(174);i.CategoricalScale=n.CategoricalScale;var r=t(176);i.LinearScale=r.LinearScale;var o=t(177);i.LogScale=o.LogScale;var s=t(178);i.Scale=s.Scale},function(t,e,i){var n=t(379),r=t(178),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LinearScale"},e.prototype.compute=function(t){var e=this._compute_state(),i=e[0],n=e[1];return i*t+n},e.prototype.v_compute=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=i*t[o]+n;return r},e.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1];return(t-n)/i},e.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=(t[o]-n)/i;return r},e.prototype._compute_state=function(){var t=this.source_range.start,e=this.source_range.end,i=this.target_range.start,n=this.target_range.end,r=(n-i)/(e-t),o=-r*t+i;return[r,o]},e}(r.Scale);i.LinearScale=o,o.initClass()},function(t,e,i){var n=t(379),r=t(178),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LogScale"},e.prototype.compute=function(t){var e,i=this._compute_state(),n=i[0],r=i[1],o=i[2],s=i[3];if(0==o)e=0;else{var a=(Math.log(t)-s)/o;e=isFinite(a)?a*n+r:NaN}return e},e.prototype.v_compute=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length);if(0==r)for(var a=0;a<t.length;a++)s[a]=0;else for(var a=0;a<t.length;a++){var l=(Math.log(t[a])-o)/r,h=void 0;h=isFinite(l)?l*i+n:NaN,s[a]=h}return s},e.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=(t-n)/i;return Math.exp(r*s+o)},e.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length),a=0;a<t.length;a++){var l=(t[a]-n)/i;s[a]=Math.exp(r*l+o)}return s},e.prototype._get_safe_factor=function(t,e){var i=t<0?0:t,n=e<0?0:e;if(i==n)if(0==i)o=[1,10],i=o[0],n=o[1];else{var r=Math.log(i)/Math.log(10);i=Math.pow(10,Math.floor(r)),n=Math.ceil(r)!=Math.floor(r)?Math.pow(10,Math.ceil(r)):Math.pow(10,Math.ceil(r)+1)}return[i,n];var o},e.prototype._compute_state=function(){var t,e,i=this.source_range.start,n=this.source_range.end,r=this.target_range.start,o=this.target_range.end,s=o-r,a=this._get_safe_factor(i,n),l=a[0],h=a[1];0==l?(t=Math.log(h),e=0):(t=Math.log(h)-Math.log(l),e=Math.log(l));var c=s,u=r;return[c,u,t,e]},e}(r.Scale);i.LogScale=o,o.initClass()},function(t,e,i){var n=t(379),r=t(252),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Scale",this.internal({source_range:[o.Any],target_range:[o.Any]})},e.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},e.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},e}(r.Transform);i.Scale=s,s.initClass()},function(t,e,i){var n=t(379);n.__exportStar(t(180),i);var r=t(181);i.Selection=r.Selection},function(t,e,i){var n=t(379),r=t(53),o=t(181),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.do_selection=function(t,e,i,n){if(null===t)return!1;e.selected.update(t,i,n);var r=new o.Selection;return r.update(e.selected,i,!1),e.selected=r,e._select.emit(),!e.selected.is_empty()},e}(r.Model);i.SelectionPolicy=s,s.prototype.type="SelectionPolicy";var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(i.length>0){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_intersection(c)}return a}return null},e}(s);i.IntersectRenderers=a,a.prototype.type="IntersectRenderers";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(i.length>0){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_union(c)}return a}return null},e}(s);i.UnionRenderers=l,l.prototype.type="UnionRenderers"},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(21),a=t(32),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Selection",this.define({indices:[o.Array,[]],line_indices:[o.Array,[]],multiline_indices:[o.Any,{}]}),this.internal({final:[o.Boolean],selected_glyphs:[o.Array,[]],get_view:[o.Any]})},e.prototype.initialize=function(){var e=this;t.prototype.initialize.call(this),this["0d"]={glyph:null,indices:[],flag:!1,get_view:function(){return null}},this["2d"]={indices:{}},this["1d"]={indices:this.indices},this.get_view=function(){return null},this.connect(this.properties.indices.change,function(){return e["1d"].indices=e.indices}),this.connect(this.properties.line_indices.change,function(){e["0d"].indices=e.line_indices,0==e.line_indices.length?e["0d"].flag=!1:e["0d"].flag=!0}),this.connect(this.properties.selected_glyphs.change,function(){return e["0d"].glyph=e.selected_glyph}),this.connect(this.properties.get_view.change,function(){return e["0d"].get_view=e.get_view}),this.connect(this.properties.multiline_indices.change,function(){return e["2d"].indices=e.multiline_indices})},Object.defineProperty(e.prototype,"selected_glyph",{get:function(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null},enumerable:!0,configurable:!0}),e.prototype.add_to_selected_glyphs=function(t){this.selected_glyphs.push(t)},e.prototype.update=function(t,e,i){this.final=e,i?this.update_through_union(t):(this.indices=t.indices,this.line_indices=t.line_indices,this.selected_glyphs=t.selected_glyphs,this.get_view=t.get_view,this.multiline_indices=t.multiline_indices)},e.prototype.clear=function(){this.final=!0,this.indices=[],this.line_indices=[],this.multiline_indices={},this.get_view=function(){return null},this.selected_glyphs=[]},e.prototype.is_empty=function(){return 0==this.indices.length&&0==this.line_indices.length},e.prototype.update_through_union=function(t){this.indices=s.union(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},e.prototype.update_through_intersection=function(t){this.indices=s.intersection(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},e}(r.Model);i.Selection=l,l.initClass()},function(t,e,i){var n=t(379),r=t(189),o=t(14),s=t(15),a=function(t){function e(e){var i=t.call(this,e)||this;return i.initialized=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="AjaxDataSource",this.define({mode:[s.String,"replace"],content_type:[s.String,"application/json"],http_headers:[s.Any,{}],max_size:[s.Number],method:[s.String,"POST"],if_modified:[s.Bool,!1]})},e.prototype.destroy=function(){null!=this.interval&&clearInterval(this.interval),t.prototype.destroy.call(this)},e.prototype.setup=function(){var t=this;if(!this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval)){var e=function(){return t.get_data(t.mode,t.max_size,t.if_modified)};this.interval=setInterval(e,this.polling_interval)}},e.prototype.get_data=function(t,e,i){var n=this;void 0===e&&(e=0),void 0===i&&(i=!1);var r=this.prepare_request();r.addEventListener("load",function(){return n.do_load(r,t,e)}),r.addEventListener("error",function(){return n.do_error(r)}),r.send()},e.prototype.prepare_request=function(){var t=new XMLHttpRequest;t.open(this.method,this.data_url,!0),t.withCredentials=!1,t.setRequestHeader("Content-Type",this.content_type);var e=this.http_headers;for(var i in e){var n=e[i];t.setRequestHeader(i,n)}return t},e.prototype.do_load=function(t,e,i){if(200===t.status){var n=JSON.parse(t.responseText);switch(e){case"replace":this.data=n;break;case"append":for(var r=this.data,o=0,s=this.columns();o<s.length;o++){var a=s[o],l=Array.from(r[a]),h=Array.from(n[a]);n[a]=l.concat(h).slice(-i)}this.data=n}}},e.prototype.do_error=function(t){o.logger.error("Failed to fetch JSON from "+this.data_url+" with code "+t.status)},e}(r.RemoteDataSource);i.AjaxDataSource=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(181),a=t(21),l=t(185),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CDSView",this.define({filters:[o.Array,[]],source:[o.Instance]}),this.internal({indices:[o.Array,[]],indices_map:[o.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.compute_indices()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.filters.change,function(){e.compute_indices(),e.change.emit()}),null!=this.source&&(null!=this.source.change&&this.connect(this.source.change,function(){return e.compute_indices()}),null!=this.source.streaming&&this.connect(this.source.streaming,function(){return e.compute_indices()}),null!=this.source.patching&&this.connect(this.source.patching,function(){return e.compute_indices()}))},e.prototype.compute_indices=function(){var t=this,e=this.filters.map(function(e){return e.compute_indices(t.source)});(e=function(){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i];null!=r&&t.push(r)}return t}()).length>0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=this.source.get_indices()),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){this.indices_map={};for(var t=0;t<this.indices.length;t++)this.indices_map[this.indices[t]]=t},e.prototype.convert_selection_from_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices[t]});return i.indices=n,i},e.prototype.convert_selection_to_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices_map[t]});return i.indices=n,i},e.prototype.convert_indices_from_subset=function(t){var e=this;return t.map(function(t){return e.indices[t]})},e}(r.Model);i.CDSView=h,h.initClass()},function(t,e,i){function n(t,e,i){if(_.isArray(t)){var n=t.concat(e);return null!=i&&n.length>i?n.slice(-i):n}if(_.isTypedArray(t)){var r=t.length+e.length;if(null!=i&&r>i){var o=r-i,s=t.length,n=void 0;t.length<i?(n=new t.constructor(i)).set(t,0):n=t;for(var a=o,l=s;a<l;a++)n[a-o]=n[a];for(var a=0,l=e.length;a<l;a++)n[a+(s-o)]=e[a];return n}var h=new t.constructor(e);return p.concat(t,h)}throw new Error("unsupported array types")}function r(t,e){var i,n,r;return _.isNumber(t)?(i=t,r=t+1,n=1):(i=null!=t.start?t.start:0,r=null!=t.stop?t.stop:e,n=null!=t.step?t.step:1),[i,r,n]}function o(t,e,i){for(var n=new c.Set,o=!1,s=0,a=e;s<a.length;s++){var l=a[s],h=l[0],u=l[1],p=void 0,d=void 0;if(_.isArray(h)){var f=h[0];n.push(f),d=i[f],p=t[f]}else _.isNumber(h)?(u=[u],n.push(h)):o=!0,h=[0,0,h],d=[1,t.length],p=t;2===h.length&&(d=[1,d[0]],h=[h[0],0,h[1]]);for(var v=0,m=r(h[1],d[0]),g=m[0],y=m[1],b=m[2],x=r(h[2],d[1]),w=x[0],k=x[1],S=x[2],f=g;f<y;f+=b)for(var C=w;C<k;C+=S)o&&n.push(C),p[f*d[1]+C]=u[v],v++}return n}var s=t(379),a=t(185),l=t(8),h=t(15),c=t(29),u=t(36),_=t(44),p=t(43),d=t(32);i.stream_to_column=n,i.slice=r,i.patch_to_column=o;var f=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type="ColumnDataSource",this.define({data:[h.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),e=u.decode_column_data(this.data),this.data=e[0],this._shapes=e[1];var e},e.prototype.attributes_as_json=function(t,i){void 0===t&&(t=!0),void 0===i&&(i=e._value_to_json);for(var n={},r=this.serializable_attributes(),o=0,s=d.keys(r);o<s.length;o++){var a=s[o],l=r[a];"data"===a&&(l=u.encode_column_data(l,this._shapes)),t?n[a]=l:a in this._set_after_defaults&&(n[a]=l)}return i("attributes",n,this)},e._value_to_json=function(t,e,i){return _.isObject(e)&&"data"===t?u.encode_column_data(e,i._shapes):l.HasProps._value_to_json(t,e,i)},e.prototype.stream=function(t,e){var i=this.data;for(var r in t)i[r]=n(i[r],t[r],e);this.setv({data:i},{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e=this.data,i=new c.Set;for(var n in t){var r=t[n];i=i.union(o(e[n],r,this._shapes[n]))}this.setv({data:e},{silent:!0}),this.patching.emit(i.values)},e}(a.ColumnarDataSource);i.ColumnDataSource=f,f.initClass()},function(t,e,i){var n=t(379),r=t(186),o=t(19),s=t(14),a=t(17),l=t(15),h=t(44),c=t(21),u=t(32),_=t(181),p=t(180),d=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.prototype.get_array=function(t){var e=this.data[t];return null==e?this.data[t]=e=[]:h.isArray(e)||(this.data[t]=e=Array.from(e)),e},e.initClass=function(){this.prototype.type="ColumnarDataSource",this.define({column_names:[l.Array,[]],selection_policy:[l.Instance]}),this.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Instance,function(){return new _.Selection}],_shapes:[l.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._select=new o.Signal0(this,"select"),this.inspect=new o.Signal(this,"inspect"),this.streaming=new o.Signal0(this,"streaming"),this.patching=new o.Signal(this,"patching"),this.selection_policy||(this.selection_policy=new p.UnionRenderers)},e.prototype.get_column=function(t){var e=this.data[t];return null!=e?e:null},e.prototype.columns=function(){return u.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e=c.uniq(u.values(this.data).map(function(t){return t.length}));switch(e.length){case 0:return null;case 1:return e[0];default:var i="data source has columns of inconsistent lengths";if(t)return s.logger.warn(i),e.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t=this.get_length();return c.range(0,null!=t?t:1)},e}(r.DataSource);i.ColumnarDataSource=d,d.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=t(181),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DataSource",this.define({selected:[o.Instance],callback:[o.Any]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.selected||(this.selected=new a.Selection)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.selected.change,function(){var t=e.callback;null!=t&&(s.isFunction(t)?t(e):t.execute(e))})},e}(r.Model);i.DataSource=l,l.initClass()},function(t,e,i){var n=t(379),r=t(185),o=t(14),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GeoJSONDataSource",this.define({geojson:[s.Any]}),this.internal({data:[s.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._update_data()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.geojson.change,function(){return e._update_data()})},e.prototype._update_data=function(){this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){return a.range(0,t).map(function(t){return[]})},e.prototype._get_new_nan_array=function(t){return a.range(0,t).map(function(t){return NaN})},e.prototype._add_properties=function(t,e,i,n){var r=t.properties||{};for(var o in r)e.hasOwnProperty(o)||(e[o]=this._get_new_nan_array(n)),e[o][i]=r[o]},e.prototype._add_geometry=function(t,e,i){function n(t){return null!=t?t:NaN}function r(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)}switch(t.type){case"Point":var s=t.coordinates,a=s[0],l=s[1],h=s[2];e.x[i]=a,e.y[i]=l,e.z[i]=n(h);break;case"LineString":for(var c=t.coordinates,u=0;u<c.length;u++){var _=c[u],a=_[0],l=_[1],h=_[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case"Polygon":t.coordinates.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used.");for(var p=t.coordinates[0],u=0;u<p.length;u++){var d=p[u],a=d[0],l=d[1],h=d[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case"MultiPoint":o.logger.warn("MultiPoint not supported in Bokeh");break;case"MultiLineString":for(var c=t.coordinates.reduce(r),u=0;u<c.length;u++){var f=c[u],a=f[0],l=f[1],h=f[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case"MultiPolygon":for(var v=[],m=0,g=t.coordinates;m<g.length;m++){var y=g[m];y.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),v.push(y[0])}for(var c=v.reduce(r),u=0;u<c.length;u++){var b=c[u],a=b[0],l=b[1],h=b[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;default:throw new Error("Invalid GeoJSON geometry type: "+t.type)}},e.prototype.geojson_to_column_data=function(){var t,e=JSON.parse(this.geojson);switch(e.type){case"GeometryCollection":if(null==e.geometries)throw new Error("No geometries found in GeometryCollection");if(0===e.geometries.length)throw new Error("geojson.geometries must have one or more items");t=e.geometries;break;case"FeatureCollection":if(null==e.features)throw new Error("No features found in FeaturesCollection");if(0==e.features.length)throw new Error("geojson.features must have one or more items");t=e.features;break;default:throw new Error("Bokeh only supports type GeometryCollection and FeatureCollection at top level")}for(var i=0,n=0,r=t;n<r.length;n++){var o=r[n],s="Feature"===o.type?o.geometry:o;"GeometryCollection"==s.type?i+=s.geometries.length:i+=1}for(var a={x:this._get_new_nan_array(i),y:this._get_new_nan_array(i),z:this._get_new_nan_array(i),xs:this._get_new_list_array(i),ys:this._get_new_list_array(i),zs:this._get_new_list_array(i)},l=0,h=0,c=t;h<c.length;h++){var o=c[h],s="Feature"==o.type?o.geometry:o;if("GeometryCollection"==s.type)for(var u=0,_=s.geometries;u<_.length;u++){var p=_[u];this._add_geometry(p,a,l),"Feature"===o.type&&this._add_properties(o,a,l,i),l+=1}else this._add_geometry(s,a,l),"Feature"===o.type&&this._add_properties(o,a,l,i),l+=1}return a},e}(r.ColumnarDataSource);i.GeoJSONDataSource=l,l.initClass()},function(t,e,i){var n=t(182);i.AjaxDataSource=n.AjaxDataSource;var r=t(184);i.ColumnDataSource=r.ColumnDataSource;var o=t(185);i.ColumnarDataSource=o.ColumnarDataSource;var s=t(183);i.CDSView=s.CDSView;var a=t(186);i.DataSource=a.DataSource;var l=t(187);i.GeoJSONDataSource=l.GeoJSONDataSource;var h=t(189);i.RemoteDataSource=h.RemoteDataSource},function(t,e,i){var n=t(379),r=t(184),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="RemoteDataSource",this.define({data_url:[o.String],polling_interval:[o.Number]})},e}(r.ColumnDataSource);i.RemoteDataSource=s,s.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=t(21),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="AdaptiveTicker",this.define({base:[o.Number,10],mantissas:[o.Array,[1,2,5]],min_interval:[o.Number,0],max_interval:[o.Number]})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=s.nth(this.mantissas,-1)/this.base,i=s.nth(this.mantissas,0)*this.base;this.extended_mantissas=[e].concat(this.mantissas,[i]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,i){var n=e-t,r=this.get_ideal_interval(t,e,i),o=Math.floor(function(t,e){void 0===e&&(e=Math.E);return Math.log(t)/Math.log(e)}(r/this.base_factor,this.base)),a=Math.pow(this.base,o)*this.base_factor,l=this.extended_mantissas,h=l.map(function(t){return Math.abs(i-n/(t*a))}),c=l[s.argmin(h)],u=c*a;return function(t,e,i){return Math.max(e,Math.min(i,t))}(u,this.get_min_interval(),this.get_max_interval())},e}(r.ContinuousTicker);i.AdaptiveTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(190),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BasicTicker"},e}(r.AdaptiveTicker);i.BasicTicker=o,o.initClass()},function(t,e,i){var n=t(379),r=t(203),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CategoricalTicker"},e.prototype.get_ticks=function(t,e,i,n,r){var o=this._collect(i.factors,i,t,e),s=this._collect(i.tops||[],i,t,e),a=this._collect(i.mids||[],i,t,e);return{major:o,minor:[],tops:s,mids:a}},e.prototype._collect=function(t,e,i,n){for(var r=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e.synthetic(a);l>i&&l<n&&r.push(a)}return r},e}(r.Ticker);i.CategoricalTicker=o,o.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=t(21),a=t(32),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CompositeTicker",this.define({tickers:[o.Array,[]]})},Object.defineProperty(e.prototype,"min_intervals",{get:function(){return this.tickers.map(function(t){return t.get_min_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max_intervals",{get:function(){return this.tickers.map(function(t){return t.get_max_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min_interval",{get:function(){return this.min_intervals[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max_interval",{get:function(){return this.max_intervals[0]},enumerable:!0,configurable:!0}),e.prototype.get_best_ticker=function(t,e,i){var n,r=e-t,o=this.get_ideal_interval(t,e,i),l=[s.sortedIndex(this.min_intervals,o)-1,s.sortedIndex(this.max_intervals,o)],h=[this.min_intervals[l[0]],this.max_intervals[l[1]]],c=h.map(function(t){return Math.abs(i-r/t)});if(a.isEmpty(c.filter(function(t){return!isNaN(t)})))n=this.tickers[0];else{var u=s.argmin(c),_=l[u];n=this.tickers[_]}return n},e.prototype.get_interval=function(t,e,i){var n=this.get_best_ticker(t,e,i);return n.get_interval(t,e,i)},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=this.get_best_ticker(t,e,n);return r.get_ticks_no_defaults(t,e,i,n)},e}(r.ContinuousTicker);i.CompositeTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(203),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ContinuousTicker",this.define({num_minor_ticks:[o.Number,5],desired_num_ticks:[o.Number,6]})},e.prototype.get_ticks=function(t,e,i,n,r){return this.get_ticks_no_defaults(t,e,n,this.desired_num_ticks)},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=this.get_interval(t,e,n),o=Math.floor(t/r),l=Math.ceil(e/r),h=(a.isStrictNaN(o)||a.isStrictNaN(l)?[]:s.range(o,l+1)).map(function(t){return t*r}).filter(function(i){return t<=i&&i<=e}),c=this.num_minor_ticks,u=[];if(c>0&&h.length>0){for(var _=r/c,p=s.range(0,c).map(function(t){return t*_}),d=0,f=p.slice(1);d<f.length;d++){var v=f[d],m=h[0]-v;t<=m&&m<=e&&u.push(m)}for(var g=0,y=h;g<y.length;g++)for(var b=y[g],x=0,w=p;x<w.length;x++){var v=w[x],m=b+v;t<=m&&m<=e&&u.push(m)}}return{major:h,minor:u}},e.prototype.get_min_interval=function(){return this.min_interval},e.prototype.get_max_interval=function(){return null!=this.max_interval?this.max_interval:1/0},e.prototype.get_ideal_interval=function(t,e,i){var n=e-t;return n/i},e}(r.Ticker);i.ContinuousTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(21),o=t(190),s=t(193),a=t(196),l=t(201),h=t(205),c=t(204),u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DatetimeTicker",this.override({num_minor_ticks:0,tickers:function(){return[new o.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*c.ONE_MILLI,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:c.ONE_SECOND,max_interval:30*c.ONE_MINUTE,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:c.ONE_HOUR,max_interval:12*c.ONE_HOUR,num_minor_ticks:0}),new a.DaysTicker({days:r.range(1,32)}),new a.DaysTicker({days:r.range(1,31,3)}),new a.DaysTicker({days:[1,8,15,22]}),new a.DaysTicker({days:[1,15]}),new l.MonthsTicker({months:r.range(0,12,1)}),new l.MonthsTicker({months:r.range(0,12,2)}),new l.MonthsTicker({months:r.range(0,12,4)}),new l.MonthsTicker({months:r.range(0,12,6)}),new h.YearsTicker({})]}})},e}(s.CompositeTicker);i.DatetimeTicker=u,u.initClass()},function(t,e,i){var n=t(379),r=t(202),o=t(204),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="DaysTicker",this.define({days:[s.Array,[]]}),this.override({num_minor_ticks:0})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this.days;e.length>1?this.interval=(e[1]-e[0])*o.ONE_DAY:this.interval=31*o.ONE_DAY},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=function(t,e){var i=o.last_month_no_later_than(new Date(t)),n=o.last_month_no_later_than(new Date(e));n.setUTCMonth(n.getUTCMonth()+1);var r=[],s=i;for(;r.push(o.copy_date(s)),s.setUTCMonth(s.getUTCMonth()+1),!(s>n););return r}(t,e),s=this.days,l=this.interval,h=a.concat(r.map(function(t){return function(t,e){for(var i=[],n=0,r=s;n<r.length;n++){var a=r[n],l=o.copy_date(t);l.setUTCDate(a);var h=new Date(l.getTime()+e/2);h.getUTCMonth()==t.getUTCMonth()&&i.push(l)}return i}(t,l)})),c=h.map(function(t){return t.getTime()}),u=c.filter(function(i){return t<=i&&i<=e});return{major:u,minor:[]}},e}(r.SingleIntervalTicker);i.DaysTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=function(t){function e(e){var i=t.call(this,e)||this;return i.min_interval=0,i.max_interval=0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="FixedTicker",this.define({ticks:[o.Array,[]]})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){return{major:this.ticks,minor:[]}},e.prototype.get_interval=function(t,e,i){return 0},e}(r.ContinuousTicker);i.FixedTicker=s,s.initClass()},function(t,e,i){var n=t(190);i.AdaptiveTicker=n.AdaptiveTicker;var r=t(191);i.BasicTicker=r.BasicTicker;var o=t(192);i.CategoricalTicker=o.CategoricalTicker;var s=t(193);i.CompositeTicker=s.CompositeTicker;var a=t(194);i.ContinuousTicker=a.ContinuousTicker;var l=t(195);i.DatetimeTicker=l.DatetimeTicker;var h=t(196);i.DaysTicker=h.DaysTicker;var c=t(197);i.FixedTicker=c.FixedTicker;var u=t(199);i.LogTicker=u.LogTicker;var _=t(200);i.MercatorTicker=_.MercatorTicker;var p=t(201);i.MonthsTicker=p.MonthsTicker;var d=t(202);i.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(203);i.Ticker=f.Ticker;var v=t(205);i.YearsTicker=v.YearsTicker},function(t,e,i){var n=t(379),r=t(21),o=t(190),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LogTicker",this.override({mantissas:[1,5]})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var o,s=this.num_minor_ticks,a=[],l=this.base,h=Math.log(t)/Math.log(l),c=Math.log(e)/Math.log(l),u=c-h;if(isFinite(u))if(u<2){var _=this.get_interval(t,e,n),p=Math.floor(t/_),d=Math.ceil(e/_);if(o=r.range(p,d+1).filter(function(t){return 0!=t}).map(function(t){return t*_}).filter(function(i){return t<=i&&i<=e}),s>0&&o.length>0){for(var f=_/s,v=r.range(0,s).map(function(t){return t*f}),m=0,g=v.slice(1);m<g.length;m++){var y=g[m];a.push(o[0]-y)}for(var b=0,x=o;b<x.length;b++)for(var w=x[b],k=0,S=v;k<S.length;k++){var y=S[k];a.push(w+y)}}}else{var C=Math.ceil(.999999*h),T=Math.floor(1.000001*c),A=Math.ceil((T-C)/9);if(o=r.range(C,T+1,A).map(function(t){return Math.pow(l,t)}).filter(function(i){return t<=i&&i<=e}),s>0&&o.length>0){for(var E=Math.pow(l,A)/s,v=r.range(1,s+1).map(function(t){return t*E}),M=0,O=v;M<O.length;M++){var y=O[M];a.push(o[0]/y)}a.push(o[0]);for(var z=0,P=o;z<P.length;z++)for(var w=P[z],j=0,N=v;j<N.length;j++){var y=N[j];a.push(w*y)}}}else o=[];return{major:o,minor:a}},e}(o.AdaptiveTicker);i.LogTicker=s,s.initClass()},function(t,e,i){var n=t(379),r=t(191),o=t(15),s=t(33),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MercatorTicker",this.define({dimension:[o.LatLon]})},e.prototype.get_ticks_no_defaults=function(e,i,n,r){if(null==this.dimension)throw new Error("MercatorTicker.dimension not configured");C=s.clip_mercator(e,i,this.dimension),e=C[0],i=C[1];var o,a,l;"lon"===this.dimension?(T=s.wgs84_mercator.inverse([e,n]),o=T[0],l=T[1],A=s.wgs84_mercator.inverse([i,n]),a=A[0],l=A[1]):(E=s.wgs84_mercator.inverse([n,e]),l=E[0],o=E[1],M=s.wgs84_mercator.inverse([n,i]),l=M[0],a=M[1]);var h=t.prototype.get_ticks_no_defaults.call(this,o,a,n,r),c=[],u=[];if("lon"===this.dimension){for(var _=0,p=h.major;_<p.length;_++){var d=p[_];if(s.in_bounds(d,"lon")){var f=s.wgs84_mercator.forward([d,l])[0];c.push(f)}}for(var v=0,m=h.minor;v<m.length;v++){var d=m[v];if(s.in_bounds(d,"lon")){var f=s.wgs84_mercator.forward([d,l])[0];u.push(f)}}}else{for(var g=0,y=h.major;g<y.length;g++){var d=y[g];if(s.in_bounds(d,"lat")){var b=s.wgs84_mercator.forward([l,d]),x=b[1];c.push(x)}}for(var w=0,k=h.minor;w<k.length;w++){var d=k[w];if(s.in_bounds(d,"lat")){var S=s.wgs84_mercator.forward([l,d]),x=S[1];u.push(x)}}}return{major:c,minor:u};var C,T,A,E,M},e}(r.BasicTicker);i.MercatorTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(202),o=t(204),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MonthsTicker",this.define({months:[s.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this.months;e.length>1?this.interval=(e[1]-e[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=function(t,e){var i=o.last_year_no_later_than(new Date(t)),n=o.last_year_no_later_than(new Date(e));n.setUTCFullYear(n.getUTCFullYear()+1);var r=[],s=i;for(;r.push(o.copy_date(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>n););return r}(t,e),s=this.months,l=a.concat(r.map(function(t){return s.map(function(e){var i=o.copy_date(t);return i.setUTCMonth(e),i})})),h=l.map(function(t){return t.getTime()}),c=h.filter(function(i){return t<=i&&i<=e});return{major:c,minor:[]}},e}(r.SingleIntervalTicker);i.MonthsTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="SingleIntervalTicker",this.define({interval:[o.Number]})},e.prototype.get_interval=function(t,e,i){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);i.SingleIntervalTicker=s,s.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Ticker"},e}(r.Model);i.Ticker=o,o.initClass()},function(t,e,i){function n(t){return new Date(t.getTime())}function r(t){var e=n(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}i.ONE_MILLI=1,i.ONE_SECOND=1e3,i.ONE_MINUTE=60*i.ONE_SECOND,i.ONE_HOUR=60*i.ONE_MINUTE,i.ONE_DAY=24*i.ONE_HOUR,i.ONE_MONTH=30*i.ONE_DAY,i.ONE_YEAR=365*i.ONE_DAY,i.copy_date=n,i.last_month_no_later_than=r,i.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,i){var n=t(379),r=t(191),o=t(202),s=t(204),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="YearsTicker"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.interval=s.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){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,i,n).major,l=a.map(function(t){return Date.UTC(t,0,1)}),h=l.filter(function(i){return t<=i&&i<=e});return{major:h,minor:[]}},e}(o.SingleIntervalTicker);i.YearsTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(209),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BBoxTileSource",this.define({use_latlon:[o.Bool,!1]})},e.prototype.get_image_url=function(t,e,i){var n,r,o,s,a=this.string_lookup_replace(this.url,this.extra_url_vars);return this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,i),r=l[0],s=l[1],n=l[2],o=l[3]):(h=this.get_tile_meter_bounds(t,e,i),r=h[0],s=h[1],n=h[2],o=h[3]),a.replace("{XMIN}",r.toString()).replace("{YMIN}",s.toString()).replace("{XMAX}",n.toString()).replace("{YMAX}",o.toString());var l,h},e}(r.MercatorTileSource);i.BBoxTileSource=s,s.initClass()},function(t,e,i){var n=t(44),r=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t=this.images.pop();return null!=t?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50)){n.isArray(t)?(e=this.images).push.apply(e,t):this.images.push(t);var e}},t}();i.ImagePool=r},function(t,e,i){var n=t(206);i.BBoxTileSource=n.BBoxTileSource;var r=t(209);i.MercatorTileSource=r.MercatorTileSource;var o=t(210);i.QUADKEYTileSource=o.QUADKEYTileSource;var s=t(211);i.TileRenderer=s.TileRenderer;var a=t(212);i.TileSource=a.TileSource;var l=t(214);i.TMSTileSource=l.TMSTileSource;var h=t(215);i.WMTSTileSource=h.WMTSTileSource},function(t,e,i){var n=t(379),r=t(212),o=t(15),s=t(21),a=t(213),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="MercatorTileSource",this.define({snap_to_zoom:[o.Bool,!1],wrap_around:[o.Bool,!0]}),this.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},e.prototype.initialize=function(){var e=this;t.prototype.initialize.call(this),this._resolutions=s.range(this.min_zoom,this.max_zoom+1).map(function(t){return e.get_resolution(t)})},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,i){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,i)))&&!(e<0||e>=Math.pow(2,i))},e.prototype.parent_by_tile_xyz=function(t,e,i){var n=this.tile_xyz_to_quadkey(t,e,i),r=n.substring(0,n.length-1);return this.quadkey_to_tile_xyz(r)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e;return[n,r]},e.prototype.get_level_by_extent=function(t,e,i){for(var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=0,a=0,l=this._resolutions;a<l.length;a++){var h=l[a];if(o>h){if(0===s)return 0;if(s>0)return s-1}s+=1}throw new Error("unreachable code")},e.prototype.get_closest_level_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=this._resolutions.reduce(function(t,e){return Math.abs(e-o)<Math.abs(t-o)?e:t});return this._resolutions.indexOf(s)},e.prototype.snap_to_zoom_level=function(t,e,i,n){var r=t[0],o=t[1],s=t[2],a=t[3],l=this._resolutions[n],h=i*l,c=e*l;if(!this.snap_to_zoom){var u=(s-r)/h,_=(a-o)/c;u>_?(h=s-r,c*=u):(h*=_,c=a-o)}var p=(h-(s-r))/2,d=(c-(a-o))/2;return[r-p,o-d,s+p,a+d]},e.prototype.tms_to_wmts=function(t,e,i){"Note this works both ways";return[t,Math.pow(2,i)-1-e,i]},e.prototype.wmts_to_tms=function(t,e,i){"Note this works both ways";return[t,Math.pow(2,i)-1-e,i]},e.prototype.pixels_to_meters=function(t,e,i){var n=this.get_resolution(i),r=t*n-this.x_origin_offset,o=e*n-this.y_origin_offset;return[r,o]},e.prototype.meters_to_pixels=function(t,e,i){var n=this.get_resolution(i),r=(t+this.x_origin_offset)/n,o=(e+this.y_origin_offset)/n;return[r,o]},e.prototype.pixels_to_tile=function(t,e){var i=Math.ceil(t/this.tile_size);i=0===i?i:i-1;var n=Math.max(Math.ceil(e/this.tile_size)-1,0);return[i,n]},e.prototype.pixels_to_raster=function(t,e,i){var n=this.tile_size<<i;return[t,n-e]},e.prototype.meters_to_tile=function(t,e,i){var n=this.meters_to_pixels(t,e,i),r=n[0],o=n[1];return this.pixels_to_tile(r,o)},e.prototype.get_tile_meter_bounds=function(t,e,i){var n=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,i),r=n[0],o=n[1],s=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,i),a=s[0],l=s[1];return[r,o,a,l]},e.prototype.get_tile_geographic_bounds=function(t,e,i){var n=this.get_tile_meter_bounds(t,e,i),r=a.meters_extent_to_geographic(n),o=r[0],s=r[1],l=r[2],h=r[3];return[o,s,l,h]},e.prototype.get_tiles_by_extent=function(t,e,i){void 0===i&&(i=1);var n=t[0],r=t[1],o=t[2],s=t[3],a=this.meters_to_tile(n,r,e),l=a[0],h=a[1],c=this.meters_to_tile(o,s,e),u=c[0],_=c[1];l-=i,h-=i,u+=i;for(var p=[],d=_+=i;d>=h;d--)for(var f=l;f<=u;f++)this.is_valid_tile(f,d,e)&&p.push([f,d,e,this.get_tile_meter_bounds(f,d,e)]);return this.sort_tiles_from_center(p,[l,h,u,_]),p},e.prototype.quadkey_to_tile_xyz=function(t){for(var e=0,i=0,n=t.length,r=n;r>0;r--){var o=t.charAt(n-r),s=1<<r-1;switch(o){case"0":continue;case"1":e|=s;break;case"2":i|=s;break;case"3":e|=s,i|=s;break;default:throw new TypeError("Invalid Quadkey: "+t)}}return[e,i,n]},e.prototype.tile_xyz_to_quadkey=function(t,e,i){for(var n="",r=i;r>0;r--){var o=1<<r-1,s=0;0!=(t&o)&&(s+=1),0!=(e&o)&&(s+=2),n+=s.toString()}return n},e.prototype.children_by_tile_xyz=function(t,e,i){for(var n=this.tile_xyz_to_quadkey(t,e,i),r=[],o=0;o<=3;o++){var s=this.quadkey_to_tile_xyz(n+o.toString()),a=s[0],l=s[1],h=s[2],c=this.get_tile_meter_bounds(a,l,h);r.push([a,l,h,c])}return r},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,i){var n=this.calculate_world_x_by_tile_xyz(t,e,i);o=this.normalize_xyz(t,e,i),t=o[0],e=o[1],i=o[2];for(var r=this.tile_xyz_to_quadkey(t,e,i);r.length>0;)if(r=r.substring(0,r.length-1),s=this.quadkey_to_tile_xyz(r),t=s[0],e=s[1],i=s[2],a=this.denormalize_xyz(t,e,i,n),t=a[0],e=a[1],i=a[2],this.tile_xyz_to_key(t,e,i)in this.tiles)return[t,e,i];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,i){if(this.wrap_around){var n=Math.pow(2,i);return[(t%n+n)%n,e,i]}return[t,e,i]},e.prototype.denormalize_xyz=function(t,e,i,n){return[t+n*Math.pow(2,i),e,i]},e.prototype.denormalize_meters=function(t,e,i,n){return[t+2*n*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,i){return Math.floor(t/Math.pow(2,i))},e}(r.TileSource);i.MercatorTileSource=l,l.initClass()},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="QUADKEYTileSource"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2],l=this.tile_xyz_to_quadkey(o,s,a);return n.replace("{Q}",l)},e}(r.MercatorTileSource);i.QUADKEYTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(207),o=t(215),s=t(173),a=t(5),l=t(15),h=t(21),c=t(44),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},Object.defineProperty(e.prototype,"map_plot",{get:function(){return this.plot_model.plot},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"map_canvas",{get:function(){return this.plot_view.canvas_view.ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"map_frame",{get:function(){return this.plot_model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x_range",{get:function(){return this.map_plot.x_range},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y_range",{get:function(){return this.map_plot.y_range},enumerable:!0,configurable:!0}),e.prototype._set_data=function(){this.pool=new r.ImagePool,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t=this.model.tile_source.attribution;if(c.isString(t)&&t.length>0){if(null==this.attributionEl){var e=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,i=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,n=this.map_frame._width.value;this.attributionEl=a.div({class:"bk-tile-attribution",style:{position:"absolute",bottom:i+"px",right:e+"px","max-width":n+"px",padding:"2px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}});var r=this.plot_view.canvas_view.events_el;r.appendChild(this.attributionEl)}this.attributionEl.innerHTML=t}},e.prototype._map_data=function(){this.initial_extent=this.get_extent();var t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this._add_attribution()},e.prototype._on_tile_load=function(t,e){t.img=e.target,t.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t,e){t.img=e.target,t.loaded=!0,t.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){t.finished=!0},e.prototype._create_tile=function(t,e,i,n,r){void 0===r&&(r=!1);var o=this.model.tile_source.normalize_xyz(t,e,i),s=o[0],a=o[1],l=o[2],h=this.pool.pop(),c={img:h,tile_coords:[t,e,i],normalized_coords:[s,a,l],quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,i),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,i),bounds:n,loaded:!1,finished:!1,x_coord:n[0],y_coord:n[3]};h.onload=r?this._on_tile_cache_load.bind(this,c):this._on_tile_load.bind(this,c),h.onerror=this._on_tile_error.bind(this,c),h.alt="",h.src=this.model.tile_source.get_image_url(s,a,l),this.model.tile_source.tiles[c.cache_key]=c,this._tiles.push(c)},e.prototype._enforce_aspect_ratio=function(){if(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value){var t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame._height.value,this.map_frame._width.value,e);return this.x_range.setv({start:i[0],end:i[2]}),this.y_range.setv({start:i[1],end:i[3]}),this.extent=i,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0}return!1},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(var e=0,i=this._tiles;e<i.length;e++){var n=i[e];if(!n.finished)return!1}return!0},e.prototype.render=function(){null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),this._enforce_aspect_ratio()||(this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles.bind(this),500),this.has_finished()&&this.notify_finished())},e.prototype._draw_tile=function(t){var e=this.model.tile_source.tiles[t];if(null!=e){var i=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),n=i[0][0],r=i[1][0],o=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),s=o[0][0],a=o[1][0],l=s-n,h=a-r,c=n,u=r;this.map_canvas.drawImage(e.img,c,u,l,h)}},e.prototype._set_rect=function(){var t=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+t/2,i=this.map_frame._top.value+t/2,n=this.map_frame._width.value-t,r=this.map_frame._height.value-t;this.map_canvas.rect(e,i,n,r),this.map_canvas.clip()},e.prototype._render_tiles=function(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(var e=0,i=t;e<i.length;e++){var n=i[e];this._draw_tile(n)}this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){for(var t=this.model.tile_source,e=this.get_extent(),i=this.map_frame._height.value,n=this.map_frame._width.value,r=this.model.tile_source.get_level_by_extent(e,i,n),o=this.model.tile_source.get_tiles_by_extent(e,r),s=0,a=Math.min(10,o.length);s<a;s++)for(var l=o[s],h=l[0],c=l[1],u=l[2],_=this.model.tile_source.children_by_tile_xyz(h,c,u),p=0,d=_;p<d.length;p++){var f=d[p],v=f[0],m=f[1],g=f[2],y=f[3];t.tile_xyz_to_key(v,m,g)in t.tiles||this._create_tile(v,m,g,y,!0)}},e.prototype._fetch_tiles=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e],r=n[0],o=n[1],s=n[2],a=n[3];this._create_tile(r,o,s,a)}},e.prototype._update=function(){var t=this,e=this.model.tile_source,i=e.min_zoom,n=e.max_zoom,r=this.get_extent(),o=this.extent[2]-this.extent[0]<r[2]-r[0],s=this.map_frame._height.value,a=this.map_frame._width.value,l=e.get_level_by_extent(r,s,a),c=!1;l<i?(r=this.extent,l=i,c=!0):l>n&&(r=this.extent,l=n,c=!0),c&&(this.x_range.setv({x_range:{start:r[0],end:r[2]}}),this.y_range.setv({start:r[1],end:r[3]}),this.extent=r),this.extent=r;for(var u=e.get_tiles_by_extent(r,l),_=[],p=[],d=[],f=[],v=0,m=u;v<m.length;v++){var g=m[v],y=g[0],b=g[1],x=g[2],w=e.tile_xyz_to_key(y,b,x),k=e.tiles[w];if(null!=k&&k.loaded)p.push(w);else if(this.model.render_parents){var S=e.get_closest_parent_by_tile_xyz(y,b,x),C=S[0],T=S[1],A=S[2],E=e.tile_xyz_to_key(C,T,A),M=e.tiles[E];if(null!=M&&M.loaded&&!h.includes(d,E)&&d.push(E),o)for(var O=e.children_by_tile_xyz(y,b,x),z=0,P=O;z<P.length;z++){var j=P[z],N=j[0],F=j[1],D=j[2],I=e.tile_xyz_to_key(N,F,D);I in e.tiles&&f.push(I)}}null==k&&_.push(g)}this._render_tiles(d),this._render_tiles(f),this._render_tiles(p),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(){return t._fetch_tiles(_)},65)},e}(s.RendererView);i.TileRendererView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TileRenderer",this.prototype.default_view=u,this.define({alpha:[l.Number,1],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],tile_source:[l.Instance,function(){return new o.WMTSTileSource}],render_parents:[l.Bool,!0]}),this.override({level:"underlay"})},e}(s.Renderer);i.TileRenderer=_,_.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(207),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TileSource",this.define({url:[s.String,""],tile_size:[s.Number,256],max_zoom:[s.Number,30],min_zoom:[s.Number,0],extra_url_vars:[s.Any,{}],attribution:[s.String,""],x_origin_offset:[s.Number],y_origin_offset:[s.Number],initial_resolution:[s.Number]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.tiles={},this.pool=new o.ImagePool,this._normalize_case()},e.prototype.string_lookup_replace=function(t,e){var i=t;for(var n in e){var r=e[n];i=i.replace("{"+n+"}",r)}return i},e.prototype._normalize_case=function(){var t=this.url.replace("{x}","{X}").replace("{y}","{Y}").replace("{z}","{Z}").replace("{q}","{Q}").replace("{xmin}","{XMIN}").replace("{ymin}","{YMIN}").replace("{xmax}","{XMAX}").replace("{ymax}","{YMAX}");this.url=t},e.prototype.tile_xyz_to_key=function(t,e,i){return t+":"+e+":"+i},e.prototype.key_to_tile_xyz=function(t){var e=t.split(":").map(function(t){return parseInt(t)}),i=e[0],n=e[1],r=e[2];return[i,n,r]},e.prototype.sort_tiles_from_center=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=(r-i)/2+i,a=(o-n)/2+n;t.sort(function(t,e){var i=Math.sqrt(Math.pow(s-t[0],2)+Math.pow(a-t[1],2)),n=Math.sqrt(Math.pow(s-e[0],2)+Math.pow(a-e[1],2));return i-n})},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace("{X}",t.toString()).replace("{Y}",e.toString()).replace("{Z}",i.toString())},e}(r.Model);i.TileSource=a,a.initClass()},function(t,e,i){function n(t,e){return o.wgs84_mercator.forward([t,e])}function r(t,e){return o.wgs84_mercator.inverse([t,e])}var o=t(33);i.geographic_to_meters=n,i.meters_to_geographic=r,i.geographic_extent_to_meters=function(t){var e=t[0],i=t[1],r=t[2],o=t[3],s=n(e,i),a=s[0],l=s[1],h=n(r,o),c=h[0],u=h[1];return[a,l,c,u]},i.meters_extent_to_geographic=function(t){var e=t[0],i=t[1],n=t[2],o=t[3],s=r(e,i),a=s[0],l=s[1],h=r(n,o),c=h[0],u=h[1];return[a,l,c,u]}},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TMSTileSource"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace("{X}",t.toString()).replace("{Y}",e.toString()).replace("{Z}",i.toString())},e}(r.MercatorTileSource);i.TMSTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="WMTSTileSource"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2];return n.replace("{X}",o.toString()).replace("{Y}",s.toString()).replace("{Z}",a.toString())},e}(r.MercatorTileSource);i.WMTSTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(19),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._clicked=function(){this.model.do.emit()},e}(r.ButtonToolButtonView);i.ActionToolButtonView=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.do,function(){return e.doit()})},e}(r.ButtonToolView);i.ActionToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.button_view=s,i.do=new o.Signal0(i,"do"),i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ActionTool"},e}(r.ButtonTool);i.ActionTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){window.open(this.model.redirect)},e}(r.ActionToolView);i.HelpToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Help",i.icon="bk-tool-icon-help",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="HelpTool",this.prototype.default_view=s,this.define({help_tooltip:[o.String,"Click the question mark to learn more about Bokeh plot tools."],redirect:[o.String,"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools"]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this.help_tooltip},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.HelpTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return e.model.disabled=!e.plot_view.can_redo()})},e.prototype.doit=function(){this.plot_view.redo()},e}(r.ActionToolView);i.RedoToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Redo",i.icon="bk-tool-icon-redo",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="RedoTool",this.prototype.default_view=o,this.override({disabled:!0})},e}(r.ActionTool);i.RedoTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(3),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.plot_model.plot.trigger_event(new o.Reset)},e}(r.ActionToolView);i.ResetToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Reset",i.icon="bk-tool-icon-reset",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ResetTool",this.prototype.default_view=s},e}(r.ActionTool);i.ResetTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.save("bokeh_plot")},e}(r.ActionToolView);i.SaveToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Save",i.icon="bk-tool-icon-save",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="SaveTool",this.prototype.default_view=o},e}(r.ActionTool);i.SaveTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return e.model.disabled=!e.plot_view.can_undo()})},e.prototype.doit=function(){this.plot_view.undo()},e}(r.ActionToolView);i.UndoToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Undo",i.icon="bk-tool-icon-undo",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="UndoTool",this.prototype.default_view=o,this.override({disabled:!0})},e}(r.ActionTool);i.UndoTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i="width"==e||"both"==e,n="height"==e||"both"==e,r=o.scale_range(t,this.model.factor,i,n);this.plot_view.push_state("zoom_out",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomInToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Zoom In",i.icon="bk-tool-icon-zoom-in",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ZoomInTool",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.ZoomInTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i="width"==e||"both"==e,n="height"==e||"both"==e,r=o.scale_range(t,-this.model.factor,i,n);this.plot_view.push_state("zoom_out",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomOutToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Zoom Out",i.icon="bk-tool-icon-zoom-out",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ZoomOutTool",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,"both"]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.ZoomOutTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(6),o=t(245),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.change,function(){return i.render()}),this.el.addEventListener("click",function(t){t.stopPropagation(),t.preventDefault(),i._clicked()}),this.render()},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-toolbar-button")},e.prototype.render=function(){s.empty(this.el),this.el.classList.add(this.model.icon),this.el.title=this.model.tooltip},e}(r.DOMView);i.ButtonToolButtonView=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(o.ToolView);i.ButtonToolView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ButtonTool",this.internal({disabled:[a.Boolean,!1]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this.tool_name},enumerable:!0,configurable:!0}),e}(o.Tool);i.ButtonTool=c,c.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){if(null==this._draw_basepoint&&null==this._basepoint){var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){var o=n.data_source;o.selection_manager.clear()}}},e.prototype._set_extent=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l=this.model.renderers[0],h=this.plot_model.frame,c=l.glyph,u=l.data_source,_=h.xscales[l.x_range_name],p=h.yscales[l.y_range_name],d=_.r_invert(r,o),f=d[0],v=d[1],m=p.r_invert(s,a),g=m[0],y=m[1],b=[(f+v)/2,(g+y)/2],x=b[0],w=b[1],k=[v-f,y-g],S=k[0],C=k[1],T=[c.x.field,c.y.field],A=T[0],E=T[1],M=[c.width.field,c.height.field],O=M[0],z=M[1];if(i)A&&u.get_array(A).push(x),E&&u.get_array(E).push(w),O&&u.get_array(O).push(S),z&&u.get_array(z).push(C),this._pad_empty_columns(u,[A,E,O,z]);else{var P=u.data[A].length-1;A&&(u.data[A][P]=x),E&&(u.data[E][P]=w),O&&(u.data[O][P]=S),z&&(u.data[z][P]=C)}u.change.emit(),n&&u.properties.data.change.emit()},e.prototype._update_box=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),null!=this._draw_basepoint){var n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._draw_basepoint,n,r,o);if(null!=s){var a=s[0],l=s[1];this._set_extent(a,l,e,i)}}},e.prototype._doubletap=function(t){if(null!=this._draw_basepoint){this._update_box(t,!1,!0),this._draw_basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}}else this._draw_basepoint=[t.sx,t.sy],this._select_event(t,!0,this.model.renderers),this._update_box(t,!0,!1)},e.prototype._move=function(t){this._update_box(t,!1,!1)},e.prototype._pan_start=function(t){if(t.shiftKey){if(null!=this._draw_basepoint)return;this._draw_basepoint=[t.sx,t.sy],this._update_box(t,!0,!1)}else{if(null!=this._basepoint)return;this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy]}},e.prototype._pan=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),t.shiftKey){if(null==this._draw_basepoint)return;this._update_box(t,e,i)}else{if(null==this._basepoint)return;this._drag_points(t,this.model.renderers)}},e.prototype._pan_end=function(t){this._pan(t,!1,!0),t.shiftKey?this._draw_basepoint=null:this._basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}},e}(s.EditToolView);i.BoxEditToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Box Edit Tool",i.icon="bk-tool-icon-box-edit",i.event_type=["tap","pan","move"],i.default_order=1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BoxEditTool",this.prototype.default_view=a,this.define({dimensions:[o.Dimensions,"both"]})},e}(s.EditTool);i.BoxEditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(21),s=t(232),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._mouse_in_frame=!0,e}return n.__extends(e,t),e.prototype._move_enter=function(t){this._mouse_in_frame=!0},e.prototype._move_exit=function(t){this._mouse_in_frame=!1},e.prototype._map_drag=function(t,e,i){var n=this.plot_model.frame;if(!n.bbox.contains(t,e))return null;var r=n.xscales[i.x_range_name].invert(t),o=n.yscales[i.y_range_name].invert(e);return[r,o]},e.prototype._delete_selected=function(t){var e=t.data_source,i=e.selected.indices;i.sort();for(var n=0,r=e.columns();n<r.length;n++)for(var o=r[n],s=e.get_array(o),a=0;a<i.length;a++){var l=i[a];s.splice(l-a,1)}e.change.emit(),e.properties.data.change.emit(),e.selection_manager.clear()},e.prototype._drag_points=function(t,e){if(null!=this._basepoint){for(var i=this._basepoint,n=i[0],r=i[1],o=0,s=e;o<s.length;o++){var a=s[o],l=this._map_drag(n,r,a),h=this._map_drag(t.sx,t.sy,a);if(null!=h&&null!=l)for(var c=h[0],u=h[1],_=l[0],p=l[1],d=[c-_,u-p],f=d[0],v=d[1],m=a.glyph,g=a.data_source,y=[m.x.field,m.y.field],b=y[0],x=y[1],w=0,k=g.selected.indices;w<k.length;w++){var S=k[w];b&&(g.data[b][S]+=f),x&&(g.data[x][S]+=v)}}for(var C=0,T=e;C<T.length;C++){var a=T[C];a.data_source.change.emit()}this._basepoint=[t.sx,t.sy]}},e.prototype._pad_empty_columns=function(t,e){for(var i=0,n=t.columns();i<n.length;i++){var r=n[i];o.includes(e,r)||t.get_array(r).push(this.model.empty_value)}},e.prototype._select_event=function(t,e,i){var n=this.plot_model.frame,r=t.sx,o=t.sy;if(!n.bbox.contains(r,o))return[];for(var s={type:"point",sx:r,sy:o},a=[],l=0,h=i;l<h.length;l++){var c=h[l],u=c.get_selection_manager(),_=c.data_source,p=[this.plot_view.renderer_views[c.id]],d=u.select(p,s,!0,e);d&&a.push(c),_.properties.selected.change.emit()}return a},e}(s.GestureToolView);i.EditToolView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="EditTool",this.define({empty_value:[r.Any],renderers:[r.Array,[]]})},e}(s.GestureTool);i.EditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.shiftKey,i=this._select_event(t,e,this.model.renderers);if(!i.length&&this.model.add){var n=this.model.renderers[0],r=this._map_drag(t.sx,t.sy,n);if(null!=r){var o=n.glyph,s=n.data_source,a=[o.x.field,o.y.field],l=a[0],h=a[1],c=r[0],u=r[1];l&&s.get_array(l).push(c),h&&s.get_array(h).push(u),this._pad_empty_columns(s,[l,h]),s.change.emit(),s.properties.data.change.emit()}}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){var o=n.data_source;o.selection_manager.clear()}}},e.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},e.prototype._pan=function(t){this.model.drag&&null!=this._basepoint&&this._drag_points(t,this.model.renderers)},e.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}this._basepoint=null}},e}(s.EditToolView);i.PointDrawToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Point Draw Tool",i.icon="bk-tool-icon-point-draw",i.event_type=["tap","pan","move"],i.default_order=2,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PointDrawTool",this.prototype.default_view=a,this.define({add:[o.Bool,!0],drag:[o.Bool,!0]})},e}(s.EditTool);i.PointDrawTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._drawing=!1,e}return n.__extends(e,t),e.prototype._tap=function(t){if(this._drawing)this._draw(t,"add"),this.model.renderers[0].data_source.properties.data.change.emit();else{var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},e.prototype._draw=function(t,e){var i=this.model.renderers[0],n=this._map_drag(t.sx,t.sy,i);if(null!=n){var r=n[0],o=n[1],s=i.data_source,a=i.glyph,l=[a.xs.field,a.ys.field],h=l[0],c=l[1];if("new"==e)h&&s.get_array(h).push([r,r]),c&&s.get_array(c).push([o,o]),this._pad_empty_columns(s,[h,c]);else if("edit"==e){if(h){var u=s.data[h][s.data[h].length-1];u[u.length-1]=r}if(c){var _=s.data[c][s.data[c].length-1];_[_.length-1]=o}}else if("add"==e){if(h){var p=s.data[h].length-1,u=s.get_array(h)[p],d=u[u.length-1];u[u.length-1]=r,u.push(d)}if(c){var f=s.data[c].length-1,_=s.get_array(c)[f],v=_[_.length-1];_[_.length-1]=o,_.push(v)}}s.change.emit()}},e.prototype._doubletap=function(t){this.model.active&&(this._drawing?(this._drawing=!1,this._draw(t,"edit")):(this._drawing=!0,this._draw(t,"new")),this.model.renderers[0].data_source.properties.data.change.emit())},e.prototype._move=function(t){this._drawing&&this._draw(t,"edit")},e.prototype._remove=function(){var t=this.model.renderers[0],e=t.data_source,i=t.glyph,n=[i.xs.field,i.ys.field],r=n[0],o=n[1];if(r){var s=e.data[r].length-1,a=e.get_array(r)[s];a.splice(a.length-1,1)}if(o){var l=e.data[o].length-1,h=e.get_array(o)[l];h.splice(h.length-1,1)}e.change.emit(),e.properties.data.change.emit()},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){this._drawing&&(this._remove(),this._drawing=!1);var o=n.data_source;o.selection_manager.clear()}}},e.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},e.prototype._pan=function(t){if(null!=this._basepoint&&this.model.drag){for(var e=this._basepoint,i=e[0],n=e[1],r=0,o=this.model.renderers;r<o.length;r++){var s=o[r],a=this._map_drag(i,n,s),l=this._map_drag(t.sx,t.sy,s);if(null!=l&&null!=a){var h=s.data_source,c=s.glyph,u=[c.xs.field,c.ys.field],_=u[0],p=u[1];if(_||p){for(var d=l[0],f=l[1],v=a[0],m=a[1],g=[d-v,f-m],y=g[0],b=g[1],x=0,w=h.selected.indices;x<w.length;x++){var k=w[x],S=void 0,C=void 0,T=void 0;_&&(C=h.data[_][k]),p?(T=h.data[p][k],S=T.length):S=C.length;for(var A=0;A<S;A++)C&&(C[A]+=y),T&&(T[A]+=b)}h.change.emit()}}}this._basepoint=[t.sx,t.sy]}},e.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}this._basepoint=null}},e.prototype.deactivate=function(){this._drawing&&(this._remove(),this._drawing=!1)},e}(s.EditToolView);i.PolyDrawToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Polygon Draw Tool",i.icon="bk-tool-icon-poly-draw",i.event_type=["pan","tap","move"],i.default_order=3,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PolyDrawTool",this.prototype.default_view=a,this.define({drag:[o.Bool,!0]})},e}(s.EditTool);i.PolyDrawTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._drawing=!1,e}return n.__extends(e,t),e.prototype._doubletap=function(t){if(this.model.active){var e=this._map_drag(t.sx,t.sy,this.model.vertex_renderer);if(null!=e){var i=e[0],n=e[1],r=this._select_event(t,!1,this.model.renderers),o=this._select_event(t,!1,[this.model.vertex_renderer]),s=this.model.vertex_renderer.data_source,a=this.model.vertex_renderer.glyph,l=[a.x.field,a.y.field],h=l[0],c=l[1];if(o.length&&null!=this._selected_renderer){var u=s.selected.indices[0];return this._drawing?(s.selected.indices=[],h&&(s.data[h][u]=i),c&&(s.data[c][u]=n),this._drawing=!1,this._selected_renderer.data_source.properties.data.change.emit()):(s.selected.indices=[u+1],h&&s.get_array(h).splice(u+1,0,i),c&&s.get_array(c).splice(u+1,0,n),this._drawing=!0),s.change.emit(),void this._selected_renderer.data_source.change.emit()}if(!r.length)return h&&(s.data[h]=[]),c&&(s.data[c]=[]),this._selected_renderer=null,this._drawing=!1,void s.change.emit();var _=r[0],p=_.glyph,d=_.data_source,f=d.selected.indices[0],v=[p.xs.field,p.ys.field],m=v[0],g=v[1];if(m){var y=d.data[m][f];h&&(s.data[h]=y)}else a.x={value:p.xs.value};if(g){var b=d.data[g][f];c&&(s.data[c]=b)}else a.y={value:p.ys.value};s.selected.indices=[],this._selected_renderer=_,s.change.emit(),s.properties.data.change.emit()}}},e.prototype._move=function(t){if(this._drawing&&null!=this._selected_renderer){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null==i)return;var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];l&&(o.data[l][c]=n),h&&(o.data[h][c]=r),o.change.emit(),this._selected_renderer.data_source.change.emit()}},e.prototype._tap=function(t){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null!=i){if(this._drawing&&this._selected_renderer){var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];if(o.selected.indices=[c+1],l){var u=o.get_array(l),_=u[c];u[c]=n,u.splice(c+1,0,_)}if(h){var p=o.get_array(h),d=p[c];p[c]=r,p.splice(c+1,0,d)}o.change.emit();var f=this._selected_renderer.data_source;return f.change.emit(),void f.properties.data.change.emit()}var v=t.shiftKey;this._select_event(t,v,[e]),this._select_event(t,v,this.model.renderers)}},e.prototype._remove_vertex=function(t){if(void 0===t&&(t=!0),this._drawing&&this._selected_renderer){var e=this.model.vertex_renderer,i=e.data_source,n=e.glyph,r=i.selected.indices[0],o=[n.x.field,n.y.field],s=o[0],a=o[1];s&&i.get_array(s).splice(r,1),a&&i.get_array(a).splice(r,1),t&&(i.change.emit(),i.properties.data.change.emit())}},e.prototype._pan_start=function(t){this._select_event(t,!0,[this.model.vertex_renderer]),this._basepoint=[t.sx,t.sy]},e.prototype._pan=function(t){null!=this._basepoint&&(this._drag_points(t,[this.model.vertex_renderer]),this._selected_renderer&&this._selected_renderer.data_source.change.emit())},e.prototype._pan_end=function(t){this.model.vertex_renderer.data_source.selected.indices=[],this._selected_renderer&&this._selected_renderer.data_source.properties.data.change.emit(),this._basepoint=null},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this._selected_renderer?[this.model.vertex_renderer]:this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){this._drawing&&(this._remove_vertex(),this._drawing=!1);var o=n.data_source;o.selection_manager.clear()}}},e.prototype.deactivate=function(){if(this._selected_renderer){this._drawing&&(this._remove_vertex(!1),this._drawing=!1);var t=this.model.vertex_renderer,e=t.data_source,i=t.glyph,n=[i.x.field,i.y.field],r=n[0],o=n[1];r&&(e.data[r]=[]),o&&(e.data[o]=[]),e.selection_manager.clear(),e.change.emit(),this._selected_renderer.data_source.change.emit(),e.properties.data.change.emit(),this._selected_renderer.data_source.properties.data.change.emit(),this._selected_renderer=null}},e}(s.EditToolView);i.PolyEditToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Poly Edit Tool",i.icon="bk-tool-icon-poly-edit",i.event_type=["tap","pan","move"],i.default_order=4,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PolyEditTool",this.prototype.default_view=a,this.define({vertex_renderer:[o.Instance]})},e}(s.EditTool);i.PolyEditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(58),s=t(15),a=t(32),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this._base_point=[e,i]},e.prototype._pan=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._base_point,n,r,o),a=s[0],l=s[1];if(this.model.overlay.update({left:a[0],right:a[1],top:l[0],bottom:l[1]}),this.model.select_every_mousemove){var h=t.shiftKey;this._do_select(a,l,!1,h)}},e.prototype._pan_end=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._base_point,n,r,o),a=s[0],l=s[1],h=t.shiftKey;this._do_select(a,l,!0,h),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.push_state("box_select",{selection:this.plot_view.get_selection()})},e.prototype._do_select=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l={type:"rect",sx0:r,sx1:o,sy0:s,sy1:a};this._select(l,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=t.sx0,s=t.sx1,l=t.sy0,h=t.sy1,c=n.r_invert(o,s),u=c[0],_=c[1],p=r.r_invert(l,h),d=p[0],f=p[1],v=a.extend({x0:u,y0:d,x1:_,y1:f},t);this.model.callback.execute(this.model,{geometry:v})},e}(r.SelectToolView);i.BoxSelectToolView=l;var h=function(){return new o.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_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]}})},c=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Box Select",i.icon="bk-tool-icon-box-select",i.event_type="pan",i.default_order=30,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BoxSelectTool",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,"both"],select_every_mousemove:[s.Bool,!1],callback:[s.Instance],overlay:[s.Instance,h]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.SelectTool);i.BoxSelectTool=c,c.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(58),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._match_aspect=function(t,e,i){var n,r,o=i.bbox.aspect,s=i.bbox.h_range.end,a=i.bbox.h_range.start,l=i.bbox.v_range.end,h=i.bbox.v_range.start,c=Math.abs(t[0]-e[0]),u=Math.abs(t[1]-e[1]),_=0==u?0:c/u,p=(_>=o?[1,_/o]:[o/_,1])[0];t[0]<=e[0]?(n=t[0],(r=t[0]+c*p)>s&&(r=s)):(r=t[0],(n=t[0]-c*p)<a&&(n=a)),c=Math.abs(r-n);var d,f;return t[1]<=e[1]?(f=t[1],(d=t[1]+c/o)>l&&(d=l)):(d=t[1],(f=t[1]-c/o)<h&&(f=h)),u=Math.abs(d-f),t[0]<=e[0]?r=t[0]+o*u:n=t[0]-o*u,[[n,r],[f,d]]},e.prototype._pan_start=function(t){this._base_point=[t.sx,t.sy]},e.prototype._pan=function(t){var e,i,n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions;this.model.match_aspect&&"both"==o?(s=this._match_aspect(this._base_point,n,r),e=s[0],i=s[1]):(a=this.model._get_dim_limits(this._base_point,n,r,o),e=a[0],i=a[1]),this.model.overlay.update({left:e[0],right:e[1],top:i[0],bottom:i[1]});var s,a},e.prototype._pan_end=function(t){var e,i,n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions;this.model.match_aspect&&"both"==o?(s=this._match_aspect(this._base_point,n,r),e=s[0],i=s[1]):(a=this.model._get_dim_limits(this._base_point,n,r,o),e=a[0],i=a[1]),this._update(e,i),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null;var s,a},e.prototype._update=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1];if(!(Math.abs(n-i)<=5||Math.abs(o-r)<=5)){var s=this.plot_model.frame,a=s.xscales,l=s.yscales,h={};for(var c in a){var u=a[c],_=u.r_invert(i,n),p=_[0],d=_[1];h[c]={start:p,end:d}}var f={};for(var v in l){var u=l[v],m=u.r_invert(r,o),p=m[0],d=m[1];f[v]={start:p,end:d}}var g={xrs:h,yrs:f};this.plot_view.push_state("box_zoom",{range:g}),this.plot_view.update_range(g)}},e}(r.GestureToolView);i.BoxZoomToolView=a;var l=function(){return new o.BoxAnnotation({level:"overlay",render_mode:"css",top_units:"screen",left_units:"screen",bottom_units:"screen",right_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]}})},h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Box Zoom",i.icon="bk-tool-icon-box-zoom",i.event_type="pan",i.default_order=20,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="BoxZoomTool",this.prototype.default_view=a,this.define({dimensions:[s.Dimensions,"both"],overlay:[s.Instance,l],match_aspect:[s.Bool,!1]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.BoxZoomTool=h,h.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(244),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.GestureToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.button_view=o.OnOffButtonView,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="GestureTool"},e}(r.ButtonTool);i.GestureTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(65),s=t(5),a=t(15),l=t(32),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.data=null},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e._active_change()})},e.prototype._active_change=function(){this.model.active||this._clear_overlay()},e.prototype._keyup=function(t){t.keyCode==s.Keys.Enter&&this._clear_overlay()},e.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this.data={sx:[e],sy:[i]}},e.prototype._pan=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox.clip(e,i),r=n[0],o=n[1];this.data.sx.push(r),this.data.sy.push(o);var s=this.model.overlay;if(s.update({xs:this.data.sx,ys:this.data.sy}),this.model.select_every_mousemove){var a=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!1,a)}},e.prototype._pan_end=function(t){this._clear_overlay();var e=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("lasso_select",{selection:this.plot_view.get_selection()})},e.prototype._clear_overlay=function(){this.model.overlay.update({xs:[],ys:[]})},e.prototype._do_select=function(t,e,i,n){var r={type:"poly",sx:t,sy:e};this._select(r,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=l.extend({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},e}(r.SelectToolView);i.LassoSelectToolView=h;var c=function(){return new o.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]}})},u=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Lasso Select",i.icon="bk-tool-icon-lasso-select",i.event_type="pan",i.default_order=12,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LassoSelectTool",this.prototype.default_view=h,this.define({select_every_mousemove:[a.Bool,!0],callback:[a.Instance],overlay:[a.Instance,c]})},e}(r.SelectTool);i.LassoSelectTool=u,u.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pan_start=function(t){this.last_dx=0,this.last_dy=0;var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox;if(!n.contains(e,i)){var r=n.h_range,o=n.v_range;(e<r.start||e>r.end)&&(this.v_axis_only=!0),(i<o.start||i>o.end)&&(this.h_axis_only=!0)}null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan=function(t){this._update(t.deltaX,t.deltaY),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan_end=function(t){this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info&&this.plot_view.push_state("pan",{range:this.pan_info})},e.prototype._update=function(t,e){var i,n,r,o=this.plot_model.frame,s=t-this.last_dx,a=e-this.last_dy,l=o.bbox.h_range,h=l.start-s,c=l.end-s,u=o.bbox.v_range,_=u.start-a,p=u.end-a,d=this.model.dimensions;"width"!=d&&"both"!=d||this.v_axis_only?(i=l.start,n=l.end,r=0):(i=h,n=c,r=-s);var f,v,m;"height"!=d&&"both"!=d||this.h_axis_only?(f=u.start,v=u.end,m=0):(f=_,v=p,m=-a),this.last_dx=t,this.last_dy=e;var g=o.xscales,y=o.yscales,b={};for(var x in g){var w=g[x],k=w.r_invert(i,n),S=k[0],C=k[1];b[x]={start:S,end:C}}var T={};for(var A in y){var w=y[A],E=w.r_invert(f,v),S=E[0],C=E[1];T[A]={start:S,end:C}}this.pan_info={xrs:b,yrs:T,sdx:r,sdy:m},this.plot_view.update_range(this.pan_info,!0)},e}(r.GestureToolView);i.PanToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Pan",i.event_type="pan",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PanTool",this.prototype.default_view=s,this.define({dimensions:[o.Dimensions,"both"]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip("Pan",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){switch(this.dimensions){case"both":return"bk-tool-icon-pan";case"width":return"bk-tool-icon-xpan";case"height":return"bk-tool-icon-ypan"}},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.PanTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(65),s=t(5),a=t(15),l=t(21),h=t(32),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.data={sx:[],sy:[]}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e._active_change()})},e.prototype._active_change=function(){this.model.active||this._clear_data()},e.prototype._keyup=function(t){t.keyCode==s.Keys.Enter&&this._clear_data()},e.prototype._doubletap=function(t){var e=t.shiftKey;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(){this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame;n.bbox.contains(e,i)&&(this.data.sx.push(e),this.data.sy.push(i),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)}))},e.prototype._do_select=function(t,e,i,n){var r={type:"poly",sx:t,sy:e};this._select(r,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=h.extend({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},e}(r.SelectToolView);i.PolySelectToolView=c;var u=function(){return new o.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]}})},_=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Poly Select",i.icon="bk-tool-icon-polygon-select",i.event_type="tap",i.default_order=11,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="PolySelectTool",this.prototype.default_view=c,this.define({callback:[a.Instance],overlay:[a.Instance,u]})},e}(r.SelectTool);i.PolySelectTool=_,_.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(169),s=t(170),a=t(15),l=t(32),h=t(21),c=t(5),u=t(3),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"computed_renderers",{get:function(){var t=this.model.renderers,e=this.model.names;if(0==t.length){var i=this.plot_model.plot.renderers;t=i.filter(function(t){return t instanceof o.GlyphRenderer||t instanceof s.GraphRenderer})}return e.length>0&&(t=t.filter(function(t){return h.includes(e,t.name)})),t},enumerable:!0,configurable:!0}),e.prototype._computed_renderers_by_data_source=function(){for(var t={},e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=void 0;(r=n instanceof s.GraphRenderer?n.node_renderer.data_source.id:n.data_source.id)in t||(t[r]=[]),t[r].push(n)}return t},e.prototype._keyup=function(t){if(t.keyCode==c.Keys.Esc)for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source,o=r.selection_manager;o.clear()}},e.prototype._select=function(t,e,i){var n=this._computed_renderers_by_data_source();for(var r in n){for(var o=n[r],s=o[0].get_selection_manager(),a=[],l=0,h=o;l<h.length;l++){var c=h[l];c.id in this.plot_view.renderer_views&&a.push(this.plot_view.renderer_views[c.id])}s.select(a,t,e,i)}null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e)},e.prototype._emit_selection_event=function(t,e){void 0===e&&(e=!0);var i,n=this.plot_model.frame.xscales.default,r=this.plot_model.frame.yscales.default;switch(t.type){case"point":var o=t.sx,s=t.sy,a=n.invert(o),h=r.invert(s);i=l.extend({},t,{x:a,y:h});break;case"rect":var c=t.sx0,_=t.sx1,p=t.sy0,d=t.sy1,f=n.r_invert(c,_),v=f[0],m=f[1],g=r.r_invert(p,d),y=g[0],b=g[1];i=l.extend({},t,{x0:v,y0:y,x1:m,y1:b});break;case"poly":var o=t.sx,s=t.sy,a=n.v_invert(o),h=r.v_invert(s);i=l.extend({},t,{x:a,y:h});break;default:throw new Error("Unrecognized selection geometry type: '"+t.type+"'")}this.plot_model.plot.trigger_event(new u.SelectionGeometry({geometry:i,final:e}))},e}(r.GestureToolView);i.SelectToolView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="SelectTool",this.define({renderers:[a.Array,[]],names:[a.Array,[]]})},e}(r.GestureTool);i.SelectTool=p,p.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(15),s=t(44),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.sx,i=t.sy,n={type:"point",sx:e,sy:i},r=t.shiftKey;this._select(n,!0,r)},e.prototype._select=function(t,e,i){var n=this,r=this.model.callback,o={geometries:t,source:null};if("select"==this.model.behavior){var a=this._computed_renderers_by_data_source();for(var l in a){var h=a[l],c=h[0].get_selection_manager(),u=h.map(function(t){return n.plot_view.renderer_views[t.id]}),_=c.select(u,t,e,i);_&&null!=r&&(o.source=c.source,s.isFunction(r)?r(this,o):r.execute(this,o))}this._emit_selection_event(t),this.plot_view.push_state("tap",{selection:this.plot_view.get_selection()})}else for(var p=0,d=this.computed_renderers;p<d.length;p++){var f=d[p],c=f.get_selection_manager(),_=c.inspect(this.plot_view.renderer_views[f.id],t);_&&null!=r&&(o.source=c.source,s.isFunction(r)?r(this,o):r.execute(this,o))}},e}(r.SelectToolView);i.TapToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Tap",i.icon="bk-tool-icon-tap-select",i.event_type="tap",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="TapTool",this.prototype.default_view=a,this.define({behavior:[o.String,"select"],callback:[o.Any]})},e}(r.SelectTool);i.TapTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._scroll=function(t){var e=this.model.speed*t.delta;e>.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,i,n,r,o=this.plot_model.frame,s=o.bbox.h_range,a=o.bbox.v_range,l=[s.start,s.end],h=l[0],c=l[1],u=[a.start,a.end],_=u[0],p=u[1];switch(this.model.dimension){case"height":var d=Math.abs(p-_);e=h,i=c,n=_-d*t,r=p-d*t;break;case"width":var f=Math.abs(c-h);e=h-f*t,i=c-f*t,n=_,r=p;break;default:throw new Error("this shouldn't have happened")}var v=o.xscales,m=o.yscales,g={};for(var y in v){var b=v[y],x=b.r_invert(e,i),w=x[0],k=x[1];g[y]={start:w,end:k}}var S={};for(var C in m){var b=m[C],T=b.r_invert(n,r),w=T[0],k=T[1];S[C]={start:w,end:k}}var A={xrs:g,yrs:S,factor:t};this.plot_view.push_state("wheel_pan",{range:A}),this.plot_view.update_range(A,!1,!0),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.GestureToolView);i.WheelPanToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Wheel Pan",i.icon="bk-tool-icon-wheel-pan",i.event_type="scroll",i.default_order=12,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="WheelPanTool",this.prototype.default_view=s,this.define({dimension:[o.Dimension,"width"]}),this.internal({speed:[o.Number,.001]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.WheelPanTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(46),s=t(15),a=t(20),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pinch=function(t){var e,i=t.sx,n=t.sy,r=t.scale;e=r>=1?20*(r-1):-20/r,this._scroll({type:"mousewheel",sx:i,sy:n,delta:e})},e.prototype._scroll=function(t){var e=this.plot_model.frame,i=e.bbox.h_range,n=e.bbox.v_range,r=t.sx,s=t.sy,a=this.model.dimensions,l=("width"==a||"both"==a)&&i.start<r&&r<i.end,h=("height"==a||"both"==a)&&n.start<s&&s<n.end,c=this.model.speed*t.delta,u=o.scale_range(e,c,l,h,{x:r,y:s});this.plot_view.push_state("wheel_zoom",{range:u}),this.plot_view.update_range(u,!1,!0,this.model.maintain_focus),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.GestureToolView);i.WheelZoomToolView=l;var h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Wheel Zoom",i.icon="bk-tool-icon-wheel-zoom",i.event_type=a.is_mobile?"pinch":"scroll",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="WheelZoomTool",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,"both"],maintain_focus:[s.Boolean,!0]}),this.internal({speed:[s.Number,1/600]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.WheelZoomTool=h,h.initClass()},function(t,e,i){var n=t(216);i.ActionTool=n.ActionTool;var r=t(217);i.HelpTool=r.HelpTool;var o=t(218);i.RedoTool=o.RedoTool;var s=t(219);i.ResetTool=s.ResetTool;var a=t(220);i.SaveTool=a.SaveTool;var l=t(221);i.UndoTool=l.UndoTool;var h=t(222);i.ZoomInTool=h.ZoomInTool;var c=t(223);i.ZoomOutTool=c.ZoomOutTool;var u=t(224);i.ButtonTool=u.ButtonTool;var _=t(226);i.EditTool=_.EditTool;var p=t(225);i.BoxEditTool=p.BoxEditTool;var d=t(227);i.PointDrawTool=d.PointDrawTool;var f=t(228);i.PolyDrawTool=f.PolyDrawTool;var v=t(229);i.PolyEditTool=v.PolyEditTool;var m=t(230);i.BoxSelectTool=m.BoxSelectTool;var g=t(231);i.BoxZoomTool=g.BoxZoomTool;var y=t(232);i.GestureTool=y.GestureTool;var b=t(233);i.LassoSelectTool=b.LassoSelectTool;var x=t(234);i.PanTool=x.PanTool;var w=t(235);i.PolySelectTool=w.PolySelectTool;var k=t(236);i.SelectTool=k.SelectTool;var S=t(237);i.TapTool=S.TapTool;var C=t(238);i.WheelPanTool=C.WheelPanTool;var T=t(239);i.WheelZoomTool=T.WheelZoomTool;var A=t(241);i.CrosshairTool=A.CrosshairTool;var E=t(242);i.HoverTool=E.HoverTool;var M=t(243);i.InspectTool=M.InspectTool;var O=t(245);i.Tool=O.Tool;var z=t(246);i.ToolProxy=z.ToolProxy;var P=t(247);i.Toolbar=P.Toolbar;var j=t(248);i.ToolbarBase=j.ToolbarBase;var N=t(249);i.ProxyToolbar=N.ProxyToolbar;var F=t(249);i.ToolbarBox=F.ToolbarBox},function(t,e,i){var n=t(379),r=t(243),o=t(66),s=t(15),a=t(32),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._update_spans(e,i):this._update_spans(null,null)}},e.prototype._move_exit=function(t){this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var i=this.model.dimensions;"width"!=i&&"both"!=i||(this.model.spans.width.computed_location=e),"height"!=i&&"both"!=i||(this.model.spans.height.computed_location=t)},e}(r.InspectToolView);i.CrosshairToolView=l;var h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Crosshair",i.icon="bk-tool-icon-crosshair",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="CrosshairTool",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,"both"],line_color:[s.Color,"black"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),this.internal({location_units:[s.SpatialUnits,"screen"],render_mode:[s.RenderMode,"css"],spans:[s.Any]})},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._get_dim_tooltip("Crosshair",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"synthetic_renderers",{get:function(){return a.values(this.spans)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),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);i.CrosshairTool=h,h.initClass()},function(t,e,i){function n(t,e,i,n,r,o){var s,a,l={x:r[t],y:o[t]},h={x:r[t+1],y:o[t+1]};if("span"==e.type)"h"==e.direction?(s=Math.abs(l.x-i),a=Math.abs(h.x-i)):(s=Math.abs(l.y-n),a=Math.abs(h.y-n));else{var u={x:i,y:n};s=c.dist_2_pts(l,u),a=c.dist_2_pts(h,u)}return s<a?[[l.x,l.y],t]:[[h.x,h.y],t+1]}function r(t,e,i){return[[t[i],e[i]],i]}var o=t(379),s=t(243),a=t(70),l=t(169),h=t(170),c=t(9),u=t(40),_=t(5),p=t(15),d=t(27),f=t(21),v=t(32),m=t(44),g=t(4);i._nearest_line_hit=n,i._line_hit=r;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){g.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this);for(var i=0,n=this.computed_renderers;i<n.length;i++){var r=n[i];r instanceof l.GlyphRenderer?this.connect(r.data_source.inspect,this._update):r instanceof h.GraphRenderer&&(this.connect(r.node_renderer.data_source.inspect,this._update),this.connect(r.edge_renderer.data_source.inspect,this._update))}this.connect(this.model.properties.renderers.change,function(){return e._computed_renderers=e._ttmodels=null}),this.connect(this.model.properties.names.change,function(){return e._computed_renderers=e._ttmodels=null}),this.connect(this.model.properties.tooltips.change,function(){return e._ttmodels=null})},e.prototype._compute_renderers=function(){var t=this.model.renderers,e=this.model.names;if(0==t.length){var i=this.plot_model.plot.renderers;t=i.filter(function(t){return t instanceof l.GlyphRenderer||t instanceof h.GraphRenderer})}return e.length>0&&(t=t.filter(function(t){return f.includes(e,t.name)})),t},e.prototype._compute_ttmodels=function(){var t={},e=this.model.tooltips;if(null!=e)for(var i=0,n=this.computed_renderers;i<n.length;i++){var r=n[i];if(r instanceof l.GlyphRenderer){var o=new a.Tooltip({custom:m.isString(e)||m.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.id]=o}else if(r instanceof h.GraphRenderer){var o=new a.Tooltip({custom:m.isString(e)||m.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.node_renderer.id]=o,t[r.edge_renderer.id]=o}}return g.build_views(this.ttviews,v.values(t),{parent:this,plot_view:this.plot_view}),t},Object.defineProperty(e.prototype,"computed_renderers",{get:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ttmodels",{get:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels},enumerable:!0,configurable:!0}),e.prototype._clear=function(){this._inspect(1/0,1/0);for(var t in this.ttmodels){var e=this.ttmodels[t];e.clear()}},e.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._inspect(e,i):this._clear()}},e.prototype._move_exit=function(){this._clear()},e.prototype._inspect=function(t,e){var i;if("mouse"==this.model.mode)i={type:"point",sx:t,sy:e};else{var n="vline"==this.model.mode?"h":"v";i={type:"span",direction:n,sx:t,sy:e}}for(var r=0,o=this.computed_renderers;r<o.length;r++){var s=o[r],a=s.get_selection_manager();a.inspect(this.plot_view.renderer_views[s.id],i)}null!=this.model.callback&&this._emit_callback(i)},e.prototype._update=function(t){var e=t[0],i=t[1].geometry;if(this.model.active){var o=this.ttmodels[e.model.id];if(null!=o){o.clear();var s=e.model.get_selection_manager().inspectors[e.model.id];e.model instanceof l.GlyphRenderer&&(s=e.model.view.convert_selection_to_subset(s));var a=e.model.get_selection_manager().source;if(!s.is_empty()){for(var h=this.plot_model.frame,c=i.sx,u=i.sy,_=h.xscales[e.model.x_range_name],p=h.yscales[e.model.y_range_name],d=_.invert(c),f=p.invert(u),m=e.glyph,g=0,y=s.line_indices;g<y.length;g++){var b=y[g],x=m._x[b+1],w=m._y[b+1],k=b,S=void 0,C=void 0;switch(this.model.line_policy){case"interp":F=m.get_interpolation_hit(b,i),x=F[0],w=F[1],S=_.compute(x),C=p.compute(w);break;case"prev":D=r(m.sx,m.sy,b),I=D[0],S=I[0],C=I[1],k=D[1];break;case"next":B=r(m.sx,m.sy,b+1),R=B[0],S=R[0],C=R[1],k=B[1];break;case"nearest":L=n(b,i,c,u,m.sx,m.sy),V=L[0],S=V[0],C=V[1],k=L[1],x=m._x[k],w=m._y[k];break;default:S=(G=[c,u])[0],C=G[1]}var T={index:k,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w,rx:S,ry:C};o.add(S,C,this._render_tooltips(a,k,T))}for(var A=0,E=s.indices;A<E.length;A++){var b=E[A];if(v.isEmpty(s.multiline_indices)){var x=null!=m._x?m._x[b]:void 0,w=null!=m._y?m._y[b]:void 0,S=void 0,C=void 0;if("snap_to_data"==this.model.point_policy){var M=m.get_anchor_point(this.model.anchor,b,[c,u]);null==M&&(M=m.get_anchor_point("center",b,[c,u])),S=M.x,C=M.y}else Q=[c,u],S=Q[0],C=Q[1];var O=void 0,T={index:O=e.model instanceof l.GlyphRenderer?e.model.view.convert_indices_from_subset([b])[0]:b,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w};o.add(S,C,this._render_tooltips(a,O,T))}else for(var z=0,P=s.multiline_indices[b.toString()];z<P.length;z++){var j=P[z],x=m._xs[b][j],w=m._ys[b][j],N=j,S=void 0,C=void 0;switch(this.model.line_policy){case"interp":U=m.get_interpolation_hit(b,j,i),x=U[0],w=U[1],S=_.compute(x),C=p.compute(w);break;case"prev":Y=r(m.sxs[b],m.sys[b],j),q=Y[0],S=q[0],C=q[1],N=Y[1];break;case"next":X=r(m.sxs[b],m.sys[b],j+1),W=X[0],S=W[0],C=W[1],N=X[1];break;case"nearest":H=n(j,i,c,u,m.sxs[b],m.sys[b]),J=H[0],S=J[0],C=J[1],N=H[1],x=m._xs[b][N],w=m._ys[b][N];break;default:throw new Error("should't have happened")}var O=void 0,T={index:O=e.model instanceof l.GlyphRenderer?e.model.view.convert_indices_from_subset([b])[0]:b,segment_index:N,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w};o.add(S,C,this._render_tooltips(a,O,T))}}var F,D,I,B,R,L,V,G,U,Y,q,X,W,H,J,Q}}}},e.prototype._emit_callback=function(t){for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source.inspected,o=this.plot_model.frame,s=o.xscales[n.x_range_name],a=o.yscales[n.y_range_name],l=s.invert(t.sx),h=a.invert(t.sy),c=v.extend({x:l,y:h},t),u=this.model.callback,_=[u,{index:r,geometry:c,renderer:n}],p=_[0],d=_[1];m.isFunction(u)?u(p,d):u.execute(p,d)}},e.prototype._render_tooltips=function(t,e,i){var n=this.model.tooltips;if(m.isString(n)){var r=_.div();return r.innerHTML=u.replace_placeholders(n,t,e,this.model.formatters,i),r}if(m.isFunction(n))return n(t,i);for(var o=_.div({style:{display:"table",borderSpacing:"2px"}}),s=0,a=n;s<a.length;s++){var l=a[s],h=l[0],c=l[1],p=_.div({style:{display:"table-row"}});o.appendChild(p);var f=void 0;if(f=_.div({style:{display:"table-cell"},class:"bk-tooltip-row-label"},h+": "),p.appendChild(f),f=_.div({style:{display:"table-cell"},class:"bk-tooltip-row-value"}),p.appendChild(f),c.indexOf("$color")>=0){var v=c.match(/\$color(\[.*\])?:(\w*)/),g=v[1],y=void 0===g?"":g,b=v[2],x=t.get_column(b);if(null==x){var w=_.span({},b+" unknown");f.appendChild(w);continue}var k=y.indexOf("hex")>=0,S=y.indexOf("swatch")>=0,C=x[e];if(null==C){var T=_.span({},"(null)");f.appendChild(T);continue}k&&(C=d.color2hex(C));var r=_.span({},C);f.appendChild(r),S&&(r=_.span({class:"bk-tooltip-color-block",style:{backgroundColor:C}}," "),f.appendChild(r))}else{var r=_.span();r.innerHTML=u.replace_placeholders(c.replace("$~","$data_"),t,e,this.model.formatters,i),f.appendChild(r)}}return o},e}(s.InspectToolView);i.HoverToolView=y;var b=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name="Hover",i.icon="bk-tool-icon-hover",i}return o.__extends(e,t),e.initClass=function(){this.prototype.type="HoverTool",this.prototype.default_view=y,this.define({tooltips:[p.Any,[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[p.Any,{}],renderers:[p.Array,[]],names:[p.Array,[]],mode:[p.String,"mouse"],point_policy:[p.String,"snap_to_data"],line_policy:[p.String,"nearest"],show_arrow:[p.Boolean,!0],anchor:[p.String,"center"],attachment:[p.String,"horizontal"],callback:[p.Any]})},e}(s.InspectTool);i.HoverTool=b,b.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(244),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.InspectToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.event_type="move",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="InspectTool",this.prototype.button_view=o.OnOffButtonView,this.define({toggleable:[s.Bool,!0]}),this.override({active:!0})},e}(r.ButtonTool);i.InspectTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(224),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){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=this.model.active;this.model.active=!t},e}(r.ButtonToolButtonView);i.OnOffButtonView=o},function(t,e,i){var n=t(379),r=t(15),o=t(48),s=t(21),a=t(53),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},Object.defineProperty(e.prototype,"plot_model",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);i.ToolView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Tool",this.internal({active:[r.Boolean,!1]})},Object.defineProperty(e.prototype,"synthetic_renderers",{get:function(){return[]},enumerable:!0,configurable:!0}),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,i,n){var r,o=t[0],a=t[1],l=e[0],h=e[1],c=i.bbox.h_range;"width"==n||"both"==n?(r=[s.min([o,l]),s.max([o,l])],r=[s.max([r[0],c.start]),s.min([r[1],c.end])]):r=[c.start,c.end];var u,_=i.bbox.v_range;return"height"==n||"both"==n?(u=[s.min([a,h]),s.max([a,h])],u=[s.max([u[0],_.start]),s.min([u[1],_.end])]):u=[_.start,_.end],[r,u]},e}(a.Model);i.Tool=h,h.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(19),s=t(53),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ToolProxy",this.define({tools:[r.Array,[]],active:[r.Bool,!1],disabled:[r.Bool,!1]})},Object.defineProperty(e.prototype,"button_view",{get:function(){return this.tools[0].button_view},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"event_type",{get:function(){return this.tools[0].event_type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tooltip",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tool_name",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return this.tools[0].icon},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.do=new o.Signal0(this,"do")},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.do,function(){return e.doit()}),this.connect(this.properties.active.change,function(){return e.set_active()})},e.prototype.doit=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.do.emit()}},e.prototype.set_active=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.active=this.active}},e}(s.Model);i.ToolProxy=a,a.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(14),s=t(44),a=t(21),l=t(216),h=t(217),c=t(232),u=t(243),_=t(248),p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Toolbar",this.prototype.default_view=_.ToolbarBaseView,this.define({active_drag:[r.Any,"auto"],active_inspect:[r.Any,"auto"],active_scroll:[r.Any,"auto"],active_tap:[r.Any,"auto"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init_tools()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.tools.change,function(){return e._init_tools()})},e.prototype._init_tools=function(){for(var t=this,e=function(t){if(t instanceof u.InspectTool)a.any(i.inspectors,function(e){return e.id==t.id})||(i.inspectors=i.inspectors.concat([t]));else if(t instanceof h.HelpTool)a.any(i.help,function(e){return e.id==t.id})||(i.help=i.help.concat([t]));else if(t instanceof l.ActionTool)a.any(i.actions,function(e){return e.id==t.id})||(i.actions=i.actions.concat([t]));else if(t instanceof c.GestureTool){var e=void 0,n=void 0;s.isString(t.event_type)?(e=[t.event_type],n=!1):(e=t.event_type||[],n=!0);for(var r=0,_=e;r<_.length;r++){var p=_[r];p in i.gestures?(n&&(p="multi"),a.any(i.gestures[p].tools,function(e){return e.id==t.id})||(i.gestures[p].tools=i.gestures[p].tools.concat([t])),i.connect(t.properties.active.change,i._active_change.bind(i,t))):o.logger.warn("Toolbar: unknown event type '"+p+"' for tool: "+t.type+" ("+t.id+")")}}},i=this,n=0,r=this.tools;n<r.length;n++){var _=r[n];e(_)}if("auto"==this.active_inspect);else if(this.active_inspect instanceof u.InspectTool)for(var p=0,d=this.inspectors;p<d.length;p++){var f=d[p];f!=this.active_inspect&&(f.active=!1)}else if(s.isArray(this.active_inspect))for(var v=0,m=this.inspectors;v<m.length;v++){var f=m[v];a.includes(this.active_inspect,f)||(f.active=!1)}else if(null==this.active_inspect)for(var g=0,y=this.inspectors;g<y.length;g++){var f=y[g];f.active=!1}var b=function(e){e.active?t._active_change(e):e.active=!0};for(var x in this.gestures){var w=this.gestures[x];if(0!=w.tools.length){if(w.tools=a.sortBy(w.tools,function(t){return t.default_order}),"tap"==x){if(null==this.active_tap)continue;"auto"==this.active_tap?b(w.tools[0]):b(this.active_tap)}if("pan"==x){if(null==this.active_drag)continue;"auto"==this.active_drag?b(w.tools[0]):b(this.active_drag)}if("pinch"==x||"scroll"==x){if(null==this.active_scroll||"auto"==this.active_scroll)continue;b(this.active_scroll)}}}},e}(_.ToolbarBase);i.Toolbar=p,p.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(5),s=t(4),a=t(15),l=t(6),h=t(44),c=t(53),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._tool_button_views={},this._build_tool_button_views()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.tools.change,function(){return e._build_tool_button_views()})},e.prototype.remove=function(){s.remove_views(this._tool_button_views),t.prototype.remove.call(this)},e.prototype._build_tool_button_views=function(){var t=null!=this.model._proxied_tools?this.model._proxied_tools:this.model.tools;s.build_views(this._tool_button_views,t,{parent:this},function(t){return t.button_view})},e.prototype.render=function(){var t=this;if(o.empty(this.el),this.el.classList.add("bk-toolbar"),this.el.classList.add("bk-toolbar-"+this.model.toolbar_location),null!=this.model.logo){var e="grey"===this.model.logo?"bk-grey":null,i=o.a({href:"https://bokeh.pydata.org/",target:"_blank",class:["bk-logo","bk-logo-small",e]});this.el.appendChild(i)}var n=[],r=function(e){return t._tool_button_views[e.id].el},s=this.model.gestures;for(var a in s)n.push(s[a].tools.map(r));n.push(this.model.actions.map(r)),n.push(this.model.inspectors.filter(function(t){return t.toggleable}).map(r)),n.push(this.model.help.map(r));for(var l=0,h=n;l<h.length;l++){var c=h[l];if(0!==c.length){var u=o.div({class:"bk-button-bar"},c);this.el.appendChild(u)}}},e}(l.DOMView);i.ToolbarBaseView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ToolbarBase",this.prototype.default_view=u,this.define({tools:[a.Array,[]],logo:[a.String,"normal"]}),this.internal({gestures:[a.Any,function(){return{pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}],actions:[a.Array,[]],inspectors:[a.Array,[]],help:[a.Array,[]],toolbar_location:[a.Location,"right"]})},Object.defineProperty(e.prototype,"horizontal",{get:function(){return"above"===this.toolbar_location||"below"===this.toolbar_location},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertical",{get:function(){return"left"===this.toolbar_location||"right"===this.toolbar_location},enumerable:!0,configurable:!0}),e.prototype._active_change=function(t){var e=t.event_type;if(null!=e)for(var i=h.isString(e)?[e]:e,n=0,o=i;n<o.length;n++){var s=o[n];if(t.active){var a=this.gestures[s].active;null!=a&&t!=a&&(r.logger.debug("Toolbar: deactivating tool: "+a.type+" ("+a.id+") for event type '"+s+"'"),a.active=!1),this.gestures[s].active=t,r.logger.debug("Toolbar: activating tool: "+t.type+" ("+t.id+") for event type '"+s+"'")}else this.gestures[s].active=null}},e}(c.Model);i.ToolbarBase=_,_.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(5),s=t(14),a=t(44),l=t(21),h=t(216),c=t(217),u=t(232),_=t(243),p=t(248),d=t(246),f=t(146),v=t(4),m=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ProxyToolbar"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init_tools(),this._merge_tools()},e.prototype._init_tools=function(){for(var t=function(t){if(t instanceof _.InspectTool)l.any(e.inspectors,function(e){return e.id==t.id})||(e.inspectors=e.inspectors.concat([t]));else if(t instanceof c.HelpTool)l.any(e.help,function(e){return e.id==t.id})||(e.help=e.help.concat([t]));else if(t instanceof h.ActionTool)l.any(e.actions,function(e){return e.id==t.id})||(e.actions=e.actions.concat([t]));else if(t instanceof u.GestureTool){var i=void 0,n=void 0;a.isString(t.event_type)?(i=[t.event_type],n=!1):(i=t.event_type||[],n=!0);for(var r=0,o=i;r<o.length;r++){var p=o[r];p in e.gestures?(n&&(p="multi"),l.any(e.gestures[p].tools,function(e){return e.id==t.id})||(e.gestures[p].tools=e.gestures[p].tools.concat([t]))):s.logger.warn("Toolbar: unknown event type '"+p+"' for tool: "+t.type+" ("+t.id+")")}}},e=this,i=0,n=this.tools;i<n.length;i++){var r=n[i];t(r)}},e.prototype._merge_tools=function(){var t=this;this._proxied_tools=[];for(var e={},i={},n={},r=[],o=[],s=0,a=this.help;s<a.length;s++){var h=a[s];l.includes(o,h.redirect)||(r.push(h),o.push(h.redirect))}(C=this._proxied_tools).push.apply(C,r),this.help=r;for(var c in this.gestures){var u=this.gestures[c];c in n||(n[c]={});for(var _=0,p=u.tools;_<p.length;_++){var f=p[_];f.type in n[c]||(n[c][f.type]=[]),n[c][f.type].push(f)}}for(var v=0,m=this.inspectors;v<m.length;v++){var f=m[v];f.type in e||(e[f.type]=[]),e[f.type].push(f)}for(var g=0,y=this.actions;g<y.length;g++){var f=y[g];f.type in i||(i[f.type]=[]),i[f.type].push(f)}var b=function(e,i){void 0===i&&(i=!1);var n=new d.ToolProxy({tools:e,active:i});return t._proxied_tools.push(n),n};for(var c in n){var u=this.gestures[c];u.tools=[];for(var x in n[c]){var w=n[c][x];if(w.length>0){var k=b(w);u.tools.push(k),this.connect(k.properties.active.change,this._active_change.bind(this,k))}}}this.actions=[];for(var x in i){var w=i[x];w.length>0&&this.actions.push(b(w))}this.inspectors=[];for(var x in e){var w=e[x];w.length>0&&this.inspectors.push(b(w,!0))}for(var S in this.gestures){var u=this.gestures[S];0!=u.tools.length&&(u.tools=l.sortBy(u.tools,function(t){return t.default_order}),"pinch"!=S&&"scroll"!=S&&"multi"!=S&&(u.tools[0].active=!0))}var C},e}(p.ToolbarBase);i.ProxyToolbar=m,m.initClass();var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},v.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){v.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat("bk-toolbar-box")},e.prototype.render=function(){t.prototype.render.call(this);var e=this._toolbar_views[this.model.toolbar.id];e.render(),o.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}(f.LayoutDOMView);i.ToolbarBoxView=g;var y=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="ToolbarBox",this.prototype.default_view=g,this.define({toolbar:[r.Instance],toolbar_location:[r.Location,"right"]})},Object.defineProperty(e.prototype,"sizing_mode",{get:function(){switch(this.toolbar_location){case"above":case"below":return"scale_width";case"left":case"right":return"scale_height"}},enumerable:!0,configurable:!0}),e}(f.LayoutDOM);i.ToolbarBox=y,y.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(15),s=t(32),a=function(e){function r(t){return e.call(this,t)||this}return n.__extends(r,e),r.initClass=function(){this.prototype.type="CustomJSTransform",this.define({args:[o.Any,{}],func:[o.String,""],v_func:[o.String,""]})},Object.defineProperty(r.prototype,"values",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(s.keys(this.args),[t,"require","exports",e])))},Object.defineProperty(r.prototype,"scalar_transform",{get:function(){return this._make_transform("x",this.func)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"vector_transform",{get:function(){return this._make_transform("xs",this.v_func)},enumerable:!0,configurable:!0}),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,i]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,i]))},r}(r.Transform);i.CustomJSTransform=a,a.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(165),s=t(15),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Dodge",this.define({value:[s.Number,0],range:[s.Instance]})},e.prototype.v_compute=function(t){var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!a.isArrayableOf(t,a.isNumber))throw new Error("unexpected");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return i},e.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(a.isNumber(t))return this._compute(t);throw new Error("unexpected")},e.prototype._compute=function(t){return t+this.value},e}(r.Transform);i.Dodge=l,l.initClass()},function(t,e,i){var n=t(250);i.CustomJSTransform=n.CustomJSTransform;var r=t(251);i.Dodge=r.Dodge;var o=t(253);i.Interpolator=o.Interpolator;var s=t(254);i.Jitter=s.Jitter;var a=t(255);i.LinearInterpolator=a.LinearInterpolator;var l=t(256);i.StepInterpolator=l.StepInterpolator;var h=t(257);i.Transform=h.Transform},function(t,e,i){var n=t(379),r=t(257),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){var i=t.call(this,e)||this;return i._sorted_dirty=!0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Interpolator",this.define({x:[o.Any],y:[o.Any],data:[o.Any],clip:[o.Bool,!0]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._sorted_dirty=!0})},e.prototype.v_compute=function(t){for(var e=new Float64Array(t.length),i=0;i<t.length;i++){var n=t[i];e[i]=this.compute(n)}return e},e.prototype.sort=function(t){if(void 0===t&&(t=!1),this._sorted_dirty){var e,i;if(a.isString(this.x)&&a.isString(this.y)&&null!=this.data){var n=this.data.columns();if(!s.includes(n,this.x))throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(!s.includes(n,this.y))throw new Error("The y parameter does not correspond to a valid column name defined in the data parameter");e=this.data.get_column(this.x),i=this.data.get_column(this.y)}else{if(!a.isArray(this.x)||!a.isArray(this.y))throw new Error("parameters 'x' and 'y' must be both either string fields or arrays");e=this.x,i=this.y}if(e.length!==i.length)throw new Error("The length for x and y do not match");if(e.length<2)throw new Error("x and y must have at least two elements to support interpolation");var r=[];for(var o in e)r.push({x:e[o],y:i[o]});t?r.sort(function(t,e){return t.x>e.x?-1:t.x==e.x?0:1}):r.sort(function(t,e){return t.x<e.x?-1:t.x==e.x?0:1}),this._x_sorted=[],this._y_sorted=[];for(var l=0,h=r;l<h.length;l++){var c=h[l],u=c.x,_=c.y;this._x_sorted.push(u),this._y_sorted.push(_)}this._sorted_dirty=!1}},e}(r.Transform);i.Interpolator=l,l.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(165),s=t(44),a=t(15),l=t(31),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Jitter",this.define({mean:[a.Number,0],width:[a.Number,1],distribution:[a.Distribution,"uniform"],range:[a.Instance]})},e.prototype.v_compute=function(t){var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!s.isArrayableOf(t,s.isNumber))throw new Error("unexpected");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return i},e.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(s.isNumber(t))return this._compute(t);throw new Error("unexpected")},e.prototype._compute=function(t){switch(this.distribution){case"uniform":return t+this.mean+(l.random()-.5)*this.width;case"normal":return t+l.rnorm(this.mean,this.width)}},e}(r.Transform);i.Jitter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(21),o=t(253),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="LinearInterpolator"},e.prototype.compute=function(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}if(t==this._x_sorted[0])return this._y_sorted[0];var e=r.findLastIndex(this._x_sorted,function(e){return e<t}),i=this._x_sorted[e],n=this._x_sorted[e+1],o=this._y_sorted[e],s=this._y_sorted[e+1];return o+(t-i)/(n-i)*(s-o)},e}(o.Interpolator);i.LinearInterpolator=s,s.initClass()},function(t,e,i){var n=t(379),r=t(253),o=t(15),s=t(21),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="StepInterpolator",this.define({mode:[o.StepMode,"after"]})},e.prototype.compute=function(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}var e;switch(this.mode){case"after":e=s.findLastIndex(this._x_sorted,function(e){return t>=e});break;case"before":e=s.findIndex(this._x_sorted,function(e){return t<=e});break;case"center":var i=this._x_sorted.map(function(e){return Math.abs(e-t)}),n=s.min(i);e=s.findIndex(i,function(t){return n===t});break;default:throw new Error("unknown mode: "+this.mode)}return-1!=e?this._y_sorted[e]:NaN},e}(r.Interpolator);i.StepInterpolator=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type="Transform"},e}(r.Model);i.Transform=o,o.initClass()},function(t,e,i){"function"!=typeof WeakMap&&t(328),"function"!=typeof Set&&t(318),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t});var n=String.prototype;n.repeat||(n.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var e=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==e.length||0==t)return"";if(e.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var i="";1==(1&t)&&(i+=e),0!=(t>>>=1);)e+=e;return i}),Array.from||(Array.from=function(){var t=Object.prototype.toString,e=function(e){return"function"==typeof e||"[object Function]"===t.call(e)},i=Math.pow(2,53)-1,n=function(t){var e=function(t){var e=Number(t);if(isNaN(e))return 0;if(0===e||!isFinite(e))return e;return(e>0?1:-1)*Math.floor(Math.abs(e))}(t);return Math.min(Math.max(e,0),i)};return function(t){var i=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var r,o=arguments.length>1?arguments[1]:void 0;if(void 0!==o){if(!e(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(r=arguments[2])}for(var s=n(i.length),a=e(this)?Object(new this(s)):new Array(s),l=0;l<s;){var h=i[l];a[l]=o?void 0===r?o(h,l):o.call(r,h,l):h,l+=1}return a.length=s,a}}())},function(t,e,i){var n=t(379);n.__exportStar(t(260),i),n.__exportStar(t(261),i)},function(t,e,i){var n=t(38),r=function(){function t(t,e,i){this.header=t,this.metadata=e,this.content=i,this.buffers=[]}return t.assemble=function(e,i,n){var r=JSON.parse(e),o=JSON.parse(i),s=JSON.parse(n);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var i=null!=this.header.num_buffers?this.header.num_buffers:0;if(i<=this.buffers.length)throw new Error("too many buffers received, expecting #{nb}");this.buffers.push([t,e])},t.create=function(e,i,n){void 0===n&&(n={});var r=t.create_header(e);return new t(r,i,n)},t.create_header=function(t){return{msgid:n.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 i=JSON.stringify(this.header),n=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(i),t.send(n),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}();i.Message=r},function(t,e,i){var n=t(260),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),i=e[0],r=e[1],o=e[2];this._partial=n.Message.assemble(i,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}();i.Receiver=r},function(t,e,i){i.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 i=document.createElement("span");i.style.backgroundColor="#a94442",i.style.borderRadius="0px 4px 0px 0px",i.style.color="white",i.style.cursor="pointer",i.style.cssFloat="right",i.style.fontSize="0.8em",i.style.margin="-6px -6px 0px 0px",i.style.padding="2px 5px 4px 5px",i.title="close",i.setAttribute("aria-label","close"),i.appendChild(document.createTextNode("x")),i.addEventListener("click",function(){return o.removeChild(e)});var n=document.createElement("h3");n.style.color="#a94442",n.style.margin="8px 0px 0px 0px",n.style.padding="0px",n.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(i),e.appendChild(n),e.appendChild(r);var o=document.getElementsByTagName("body")[0];o.insertBefore(e,o.firstChild)}(t),e)return;throw t}}},function(t,e,i){i.version="0.12.15"},/*!!
 *  Canvas 2 Svg v1.0.21
 *  A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.
 *
 *  Licensed under the MIT license:
 *  http://www.opensource.org/licenses/mit-license.php
 *
 *  Author:
 *  Kerry Liu
 *
 *  Copyright (c) 2014 Gliffy Inc.
 */
function(t,e,i){!function(){"use strict";function t(t,e){var i,n=Object.keys(e);for(i=0;i<n.length;i++)t=t.replace(new RegExp("\\{"+n[i]+"\\}","gi"),e[n[i]]);return t}function i(t){var e,i,n;if(!t)throw new Error("cannot create a random attribute name for an undefined object");e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="";do{for(i="",n=0;n<12;n++)i+=e[Math.floor(Math.random()*e.length)]}while(t[i]);return i}var n,r,o,s,a;a=function(t,e){var i,n,r,o={};for(t=t.split(","),e=e||10,i=0;i<t.length;i+=2)n="&"+t[i+1]+";",r=parseInt(t[i],e),o[n]="&#"+r+";";return o["\\xa0"]="&#160;",o}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),n={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}},(o=function(t,e){this.__root=t,this.__ctx=e}).prototype.addColorStop=function(e,i){var n,r=this.__ctx.__createElement("stop");r.setAttribute("offset",e),-1!==i.indexOf("rgba")?(n=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(i),r.setAttribute("stop-color",t("rgb({r},{g},{b})",{r:n[1],g:n[2],b:n[3]})),r.setAttribute("stop-opacity",n[4])):r.setAttribute("stop-color",i),this.__root.appendChild(r)},s=function(t,e){this.__root=t,this.__ctx=e},(r=function(t){var e,i={width:500,height:500,enableMirroring:!1};if(arguments.length>1?((e=i).width=arguments[0],e.height=arguments[1]):e=t||i,!(this instanceof r))return new r(e);this.width=e.width||i.width,this.height=e.height||i.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:i.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,i){void 0===e&&(e={});var n,r,o=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);for(i&&(o.setAttribute("fill","none"),o.setAttribute("stroke","none")),n=0;n<s.length;n++)r=s[n],o.setAttribute(r,e[r]);return o},r.prototype.__setDefaultStyles=function(){var t,e,i=Object.keys(n);for(t=0;t<i.length;t++)this[e=i[t]]=n[e].canvas},r.prototype.__applyStyleState=function(t){var e,i,n=Object.keys(t);for(e=0;e<n.length;e++)this[i=n[e]]=t[i]},r.prototype.__getStyleState=function(){var t,e,i={},r=Object.keys(n);for(t=0;t<r.length;t++)e=r[t],i[e]=this[e];return i},r.prototype.__applyStyleToCurrentElement=function(e){var i=this.__currentElement,r=this.__currentElementsToStyle;r&&(i.setAttribute(e,""),i=r.element,r.children.forEach(function(t){t.setAttribute(e,"")}));var a,l,h,c,u,_=Object.keys(n);for(a=0;a<_.length;a++)if(l=n[_[a]],h=this[_[a]],l.apply)if(h instanceof s){if(h.__ctx)for(;h.__ctx.__defs.childNodes.length;)c=h.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[c]=c,this.__defs.appendChild(h.__ctx.__defs.childNodes[0]);i.setAttribute(l.apply,t("url(#{id})",{id:h.__root.getAttribute("id")}))}else if(h instanceof o)i.setAttribute(l.apply,t("url(#{id})",{id:h.__root.getAttribute("id")}));else if(-1!==l.apply.indexOf(e)&&l.svg!==h)if("stroke"!==l.svgAttr&&"fill"!==l.svgAttr||-1===h.indexOf("rgba")){var p=l.svgAttr;if("globalAlpha"===_[a]&&(p=e+"-"+l.svgAttr,i.getAttribute(p)))continue;i.setAttribute(p,h)}else{u=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(h),i.setAttribute(l.svgAttr,t("rgb({r},{g},{b})",{r:u[1],g:u[2],b:u[3]}));var d=u[4],f=this.globalAlpha;null!=f&&(d*=f),i.setAttribute(l.svgAttr+"-opacity",d)}},r.prototype.__closestGroupOrSvg=function(t){return"g"===(t=t||this.__currentElement).nodeName||"svg"===t.nodeName?t:this.__closestGroupOrSvg(t.parentNode)},r.prototype.getSerializedSvg=function(t){var e,i,n,r,o,s=(new XMLSerializer).serializeToString(this.__root);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(s)&&(s=s.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t)for(e=Object.keys(a),i=0;i<e.length;i++)n=e[i],r=a[n],(o=new RegExp(n,"gi")).test(s)&&(s=s.replace(o,r));return s},r.prototype.getSvg=function(){return this.__root},r.prototype.save=function(){var t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__stack.push(this.__getStyleState())},r.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var t=this.__stack.pop();this.__applyStyleState(t)},r.prototype.__addTransform=function(t){var e=this.__closestGroupOrSvg();if(e.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)},r.prototype.scale=function(e,i){void 0===i&&(i=e),this.__addTransform(t("scale({x},{y})",{x:e,y:i}))},r.prototype.rotate=function(e){var i=180*e/Math.PI;this.__addTransform(t("rotate({angle},{cx},{cy})",{angle:i,cx:0,cy:0}))},r.prototype.translate=function(e,i){this.__addTransform(t("translate({x},{y})",{x:e,y:i}))},r.prototype.transform=function(e,i,n,r,o,s){this.__addTransform(t("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:i,c:n,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,i){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:i},this.__addPathCommand(t("M {x} {y}",{x:e,y:i}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},r.prototype.lineTo=function(e,i){this.__currentPosition={x:e,y:i},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(t("L {x} {y}",{x:e,y:i})):this.__addPathCommand(t("M {x} {y}",{x:e,y:i}))},r.prototype.bezierCurveTo=function(e,i,n,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:i,cp2x:n,cp2y:r,x:o,y:s}))},r.prototype.quadraticCurveTo=function(e,i,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(t("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:i,x:n,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,i,n,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===i&&e===n||0===r)this.lineTo(t,e);else{var a=l([o-t,s-e]),h=l([i-t,n-e]);if(a[0]*h[1]!=a[1]*h[0]){var c=a[0]*h[0]+a[1]*h[1],u=Math.acos(Math.abs(c)),_=l([a[0]+h[0],a[1]+h[1]]),p=r/Math.sin(u/2),d=t+p*_[0],f=e+p*_[1],v=[-a[1],a[0]],m=[h[1],-h[0]],g=function(t){var e=t[0],i=t[1];return i>=0?Math.acos(e):-Math.acos(e)},y=g(v),b=g(m);this.lineTo(d+v[0]*r,f+v[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,i,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()},r.prototype.fillRect=function(t,e,i,n){var r;r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")},r.prototype.strokeRect=function(t,e,i,n){var r;r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")},r.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute("transform"),i=this.__root.childNodes[1],n=i.childNodes,r=n.length-1;r>=0;r--)n[r]&&i.removeChild(n[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)},r.prototype.clearRect=function(t,e,i,n){if(0!==t||0!==e||i!==this.width||n!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:t,y:e,width:i,height:n,fill:"#FFFFFF"},!0),o.appendChild(r)}else this.__clearCanvas()},r.prototype.createLinearGradient=function(t,e,n,r){var s=this.__createElement("linearGradient",{id:i(this.__ids),x1:t+"px",x2:n+"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,n,r,s,a){var l=this.__createElement("radialGradient",{id:i(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 i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e},r.prototype.__applyText=function(t,e,i,n){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:i,"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(n),o.appendChild(this.__wrapTextLink(r,s))},r.prototype.fillText=function(t,e,i){this.__applyText(t,e,i,"fill")},r.prototype.strokeText=function(t,e,i){this.__applyText(t,e,i,"stroke")},r.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},r.prototype.arc=function(e,i,n,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+n*Math.cos(o),l=i+n*Math.sin(o),h=e+n*Math.cos(r),c=i+n*Math.sin(r),u=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(h,c),this.__addPathCommand(t("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:_,sweepFlag:u,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),n=this.__createElement("clipPath"),r=i(this.__ids),o=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),n.setAttribute("id",r),n.appendChild(this.__currentElement),this.__defs.appendChild(n),e.setAttribute("clip-path",t("url(#{id})",{id:r})),e.appendChild(o),this.__currentElement=o},r.prototype.drawImage=function(){var t,e,i,n,o,s,a,l,h,c,u,_,p,d,f=Array.prototype.slice.call(arguments),v=f[0],m=0,g=0;if(3===f.length)t=f[1],e=f[2],o=v.width,s=v.height,i=o,n=s;else if(5===f.length)t=f[1],e=f[2],i=f[3],n=f[4],o=v.width,s=v.height;else{if(9!==f.length)throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);m=f[1],g=f[2],o=f[3],s=f[4],t=f[5],e=f[6],i=f[7],n=f[8]}a=this.__closestGroupOrSvg(),this.__currentElement;var y="translate("+t+", "+e+")";if(v instanceof r){if((l=v.getSvg().cloneNode(!0)).childNodes&&l.childNodes.length>1){for(h=l.childNodes[0];h.childNodes.length;)d=h.childNodes[0].getAttribute("id"),this.__ids[d]=d,this.__defs.appendChild(h.childNodes[0]);if(c=l.childNodes[1]){var b,x=c.getAttribute("transform");b=x?x+" "+y:y,c.setAttribute("transform",b),a.appendChild(c)}}}else"IMG"===v.nodeName?((u=this.__createElement("image")).setAttribute("width",i),u.setAttribute("height",n),u.setAttribute("preserveAspectRatio","none"),(m||g||o!==v.width||s!==v.height)&&((_=this.__document.createElement("canvas")).width=i,_.height=n,(p=_.getContext("2d")).drawImage(v,m,g,o,s,0,0,i,n),v=_),u.setAttribute("transform",y),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===v.nodeName?v.toDataURL():v.getAttribute("src")),a.appendChild(u)):"CANVAS"===v.nodeName&&((u=this.__createElement("image")).setAttribute("width",i),u.setAttribute("height",n),u.setAttribute("preserveAspectRatio","none"),(_=this.__document.createElement("canvas")).width=i,_.height=n,(p=_.getContext("2d")).imageSmoothingEnabled=!1,p.mozImageSmoothingEnabled=!1,p.oImageSmoothingEnabled=!1,p.webkitImageSmoothingEnabled=!1,p.drawImage(v,m,g,o,s,0,0,i,n),v=_,u.setAttribute("transform",y),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v.toDataURL()),a.appendChild(u))},r.prototype.createPattern=function(t,e){var n,o=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),a=i(this.__ids);return o.setAttribute("id",a),o.setAttribute("width",t.width),o.setAttribute("height",t.height),"CANVAS"===t.nodeName||"IMG"===t.nodeName?((n=this.__document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("width",t.width),n.setAttribute("height",t.height),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===t.nodeName?t.toDataURL():t.getAttribute("src")),o.appendChild(n),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,i){var n,r=t(288),o=t(298),s=t(302),a=t(297),l=t(302),h=t(304),c=Function.prototype.bind,u=Object.defineProperty,_=Object.prototype.hasOwnProperty;n=function(t,e,i){var n,o=h(e)&&l(e.value);return n=r(e),delete n.writable,delete n.value,n.get=function(){return!i.overwriteDefinition&&_.call(this,t)?o:(e.value=c.call(o,i.resolveContext?i.resolveContext(this):this),u(this,t,e),this[t])},n},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,i){return n(i,t,e)})}},function(t,e,i){var n=t(285),r=t(298),o=t(291),s=t(305);(e.exports=function(t,e){var i,o,a,l,h;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(i=a=!0,o=!1):(i=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),h={value:e,configurable:i,enumerable:o,writable:a},l?n(r(l),h):h}).gs=function(t,e,i){var a,l,h,c;return"string"!=typeof t?(h=i,i=e,e=t,t=null):h=arguments[3],null==e?e=void 0:o(e)?null==i?i=void 0:o(i)||(h=i,i=void 0):(h=e,e=i=void 0),null==t?(a=!0,l=!1):(a=s.call(t,"c"),l=s.call(t,"e")),c={get:e,set:i,configurable:a,enumerable:l},h?n(r(h),c):c}},function(t,e,i){var n=t(304);e.exports=function(){return n(this).length=0,this}},function(t,e,i){var n=t(279),r=t(283),o=t(304),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,h=Math.floor;e.exports=function(t){var e,i,c,u;if(!n(t))return s.apply(this,arguments);for(i=r(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?h(c):r(this.length)-h(l(c)),e=c;e<i;++e)if(a.call(this,e)&&(u=this[e],n(u)))return e;return-1}},function(t,e,i){e.exports=t(270)()?Array.from:t(271)},function(t,e,i){e.exports=function(){var t,e,i=Array.from;return"function"==typeof i&&(t=["raz","dwa"],e=i(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,i){var n=t(323).iterator,r=t(272),o=t(273),s=t(283),a=t(302),l=t(304),h=t(293),c=t(308),u=Array.isArray,_=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,i,f,v,m,g,y,b,x,w,k=arguments[1],S=arguments[2];if(t=Object(l(t)),h(k)&&a(k),this&&this!==Array&&o(this))e=this;else{if(!k){if(r(t))return 1!==(m=t.length)?Array.apply(null,t):(v=new Array(1),v[0]=t[0],v);if(u(t)){for(v=new Array(m=t.length),i=0;i<m;++i)v[i]=t[i];return v}}v=[]}if(!u(t))if(void 0!==(x=t[n])){for(y=a(x).call(t),e&&(v=new e),b=y.next(),i=0;!b.done;)w=k?_.call(k,S,b.value,i):b.value,e?(p.value=w,d(v,i,p)):v[i]=w,b=y.next(),++i;m=i}else if(c(t)){for(m=t.length,e&&(v=new e),i=0,f=0;i<m;++i)w=t[i],i+1<m&&(g=w.charCodeAt(0))>=55296&&g<=56319&&(w+=t[++i]),w=k?_.call(k,S,w,f):w,e?(p.value=w,d(v,f,p)):v[f]=w,++f;m=f}if(void 0===m)for(m=s(t.length),e&&(v=new e(m)),i=0;i<m;++i)w=k?_.call(k,S,t[i],i):t[i],e?(p.value=w,d(v,i,p)):v[i]=w;return e&&(p.value=null,v.length=m),v}},function(t,e,i){var n=Object.prototype.toString,r=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===r}},function(t,e,i){var n=Object.prototype.toString,r=n.call(t(274));e.exports=function(t){return"function"==typeof t&&n.call(t)===r}},function(t,e,i){e.exports=function(){}},function(t,e,i){e.exports=function(){return this}()},function(t,e,i){e.exports=t(277)()?Math.sign:t(278)},function(t,e,i){e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,i){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,i){e.exports=t(280)()?Number.isNaN:t(281)},function(t,e,i){e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,i){e.exports=function(t){return t!=t}},function(t,e,i){var n=t(276),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(r(t)):t}},function(t,e,i){var n=t(282),r=Math.max;e.exports=function(t){return r(0,n(t))}},function(t,e,i){var n=t(302),r=t(304),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(i,h){var c,u=arguments[2],_=arguments[3];return i=Object(r(i)),n(h),c=a(i),_&&c.sort("function"==typeof _?o.call(_,i):void 0),"function"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return l.call(i,t)?s.call(h,u,i[t],t,i,n):e})}}},function(t,e,i){e.exports=t(286)()?Object.assign:t(287)},function(t,e,i){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,i){var n=t(294),r=t(304),o=Math.max;e.exports=function(t,e){var i,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(n){try{t[n]=e[n]}catch(t){i||(i=t)}},s=1;s<l;++s)e=arguments[s],n(e).forEach(a);if(void 0!==i)throw i;return t}},function(t,e,i){var n=t(269),r=t(285),o=t(304);e.exports=function(t){var e=Object(o(t)),i=arguments[1],s=Object(arguments[2]);if(e!==t&&!i)return e;var a={};return i?n(i,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):r(a,t),a}},function(t,e,i){var n,r=Object.create;t(300)()||(n=t(301)),e.exports=function(){var t,e,i;return n?1!==n.level?r:(t={},e={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){e[t]="__proto__"!==t?i:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(t,e),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,i){return r(null===e?t:e,i)}):r}()},function(t,e,i){e.exports=t(284)("forEach")},function(t,e,i){e.exports=function(t){return"function"==typeof t}},function(t,e,i){var n=t(293),r={function:!0,object:!0};e.exports=function(t){return n(t)&&r[typeof t]||!1}},function(t,e,i){var n=t(274)();e.exports=function(t){return t!==n&&null!==t}},function(t,e,i){e.exports=t(295)()?Object.keys:t(296)},function(t,e,i){e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,i){var n=t(293),r=Object.keys;e.exports=function(t){return r(n(t)?Object(t):t)}},function(t,e,i){var n=t(302),r=t(290),o=Function.prototype.call;e.exports=function(t,e){var i={},s=arguments[2];return n(e),r(t,function(t,n,r,a){i[n]=o.call(e,s,t,n,r,a)}),i}},function(t,e,i){var n=t(293),r=Array.prototype.forEach,o=Object.create;e.exports=function(t){var e=o(null);return r.call(arguments,function(t){n(t)&&function(t,e){var i;for(i in t)e[i]=t[i]}(Object(t),e)}),e}},function(t,e,i){e.exports=t(300)()?Object.setPrototypeOf:t(301)},function(t,e,i){var n=Object.create,r=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&r(t(e(null),o))===o}},function(t,e,i){var n,r=t(292),o=t(304),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||r(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,i;return t?(2===t.level?t.set?(i=t.set,e=function(t,e){return i.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,i){var r;return n(e,i),(r=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===i&&(i=t.nullPolyfill),e.__proto__=i,r&&a(t.nullPolyfill,"__proto__",l),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),i={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,i)}catch(t){}if(Object.getPrototypeOf(e)===i)return{set:t,level:2}}return e.__proto__=i,Object.getPrototypeOf(e)===i?{level:2}:(e={},e.__proto__=i,Object.getPrototypeOf(e)===i&&{level:1})}()),t(289)},function(t,e,i){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,i){var n=t(292);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},function(t,e,i){var n=t(293);e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,i){e.exports=t(306)()?String.prototype.contains:t(307)},function(t,e,i){e.exports=function(){return"function"==typeof"razdwatrzy".contains&&(!0==="razdwatrzy".contains("dwa")&&!1==="razdwatrzy".contains("foo"))}},function(t,e,i){var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,i){var n=Object.prototype.toString,r=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===r)||!1}},function(t,e,i){var n=Object.create(null),r=Math.random;e.exports=function(){var t;do{t=r().toString(36).slice(2)}while(n[t]);return t}},function(t,e,i){var n,r=t(299),o=t(305),s=t(266),a=t(323),l=t(313),h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))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",h(this,"__kind__",s("",e))},r&&r(n,l),delete n.prototype.constructor,n.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})}),h(n.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,i){var n=t(272),r=t(302),o=t(308),s=t(312),a=Array.isArray,l=Function.prototype.call,h=Array.prototype.some;e.exports=function(t,e){var i,c,u,_,p,d,f,v,m=arguments[2];if(a(t)||n(t)?i="array":o(t)?i="string":t=s(t),r(e),u=function(){_=!0},"array"!==i)if("string"!==i)for(c=t.next();!c.done;){if(l.call(e,m,c.value,u),_)return;c=t.next()}else for(d=t.length,p=0;p<d&&(f=t[p],p+1<d&&(v=f.charCodeAt(0))>=55296&&v<=56319&&(f+=t[++p]),l.call(e,m,f,u),!_);++p);else h.call(t,function(t){return l.call(e,m,t,u),_})}},function(t,e,i){var n=t(272),r=t(308),o=t(310),s=t(315),a=t(316),l=t(323).iterator;e.exports=function(t){return"function"==typeof a(t)[l]?t[l]():n(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,i){var n,r=t(267),o=t(285),s=t(302),a=t(304),l=t(266),h=t(265),c=t(323),u=Object.defineProperty,_=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))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 n.prototype.constructor,_(n.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:l(function(){return this._createResult(this._next())}),_createResult:l(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:l(function(t){return this.__list__[t]}),_unBind:l(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:l(function(){return"[object "+(this[c.toStringTag]||"Object")+"]"})},h({_onAdd:l(function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,i){e>=t&&(this.__redo__[i]=++e)},this),this.__redo__.push(t)):u(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,i){e>t&&(this.__redo__[i]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),u(n.prototype,c.iterator,l(function(){return this}))},function(t,e,i){var n=t(272),r=t(293),o=t(308),s=t(323).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!n(t)||"function"==typeof t[s])))}},function(t,e,i){var n,r=t(299),o=t(266),s=t(323),a=t(313),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),l(this,"__length__",o("",t.length))},r&&r(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,i=this.__list__[t];return this.__nextIndex__===this.__length__?i:(e=i.charCodeAt(0))>=55296&&e<=56319?i+this.__list__[this.__nextIndex__++]:i})}),l(n.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,i){var n=t(314);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},/*!
 * @overview es6-promise - a tiny implementation of Promises/A+.
 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
 * @license   Licensed under MIT license
 *            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
 * @version   3.0.2
 */
function(t,e,i){(function(){"use strict";function i(t){return"function"==typeof t}function n(){return function(){setTimeout(r,1)}}function r(){for(var t=0;t<w;t+=2){var e=M[t],i=M[t+1];e(i),M[t]=void 0,M[t+1]=void 0}w=0}function o(){try{var e=t,i=e("vertx");return g=i.runOnLoop||i.runOnContext,function(){g(r)}}catch(t){return n()}}function s(){}function a(t,e){if(e.constructor===t.constructor)!function(t,e){e._state===z?c(t,e._result):e._state===P?u(t,e._result):_(e,void 0,function(e){l(t,e)},function(e){u(t,e)})}(t,e);else{var n=function(t){try{return t.then}catch(t){return j.error=t,j}}(e);n===j?u(t,j.error):void 0===n?c(t,e):i(n)?function(t,e,i){k(function(t){var n=!1,r=function(t,e,i,n){try{t.call(e,i,n)}catch(t){return t}}(i,e,function(i){n||(n=!0,e!==i?l(t,i):c(t,i))},function(e){n||(n=!0,u(t,e))},t._label);!n&&r&&(n=!0,u(t,r))},t)}(t,e,n):c(t,e)}}function l(t,e){t===e?u(t,new TypeError("You cannot resolve a promise with itself")):!function(t){return"function"==typeof t||"object"==typeof t&&null!==t}(e)?c(t,e):a(t,e)}function h(t){t._onerror&&t._onerror(t._result),p(t)}function c(t,e){t._state===O&&(t._result=e,t._state=z,0!==t._subscribers.length&&k(p,t))}function u(t,e){t._state===O&&(t._state=P,t._result=e,k(h,t))}function _(t,e,i,n){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+z]=i,r[o+P]=n,0===o&&t._state&&k(p,t)}function p(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var n,r,o=t._result,s=0;s<e.length;s+=3)n=e[s],r=e[s+i],n?f(i,n,r,o):r(o);t._subscribers.length=0}}function d(){this.error=null}function f(t,e,n,r){var o,s,a,h,_=i(n);if(_){if((o=function(t,e){try{return t(e)}catch(t){return N.error=t,N}}(n,r))===N?(h=!0,s=o.error,o=null):a=!0,e===o)return void u(e,new TypeError("A promises callback cannot return that same promise."))}else o=r,a=!0;e._state!==O||(_&&a?l(e,o):h?u(e,s):t===z?c(e,o):t===P&&u(e,o))}function v(t,e){this._instanceConstructor=t,this.promise=new t(s),this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?c(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&c(this.promise,this._result))):u(this.promise,this._validationError())}function m(t){this._id=L++,this._state=void 0,this._result=void 0,this._subscribers=[],s!==t&&(i(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof m||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(t,e){try{e(function(e){l(t,e)},function(e){u(t,e)})}catch(e){u(t,e)}}(this,t))}var g,y,b,x=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},w=0,k=function(t,e){M[w]=t,M[w+1]=e,2===(w+=2)&&(y?y(r):b())},S="undefined"!=typeof window?window:void 0,C=S||{},T=C.MutationObserver||C.WebKitMutationObserver,A="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),E="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,M=new Array(1e3);b=A?function(){process.nextTick(r)}:T?function(){var t=0,e=new T(r),i=document.createTextNode("");return e.observe(i,{characterData:!0}),function(){i.data=t=++t%2}}():E?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){t.port2.postMessage(0)}}():void 0===S&&"function"==typeof t?o():n();var O=void 0,z=1,P=2,j=new d,N=new d;v.prototype._validateInput=function(t){return x(t)},v.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},v.prototype._init=function(){this._result=new Array(this.length)};var F=v;v.prototype._enumerate=function(){for(var t=this.length,e=this.promise,i=this._input,n=0;e._state===O&&n<t;n++)this._eachEntry(i[n],n)},v.prototype._eachEntry=function(t,e){var i=this._instanceConstructor;!function(t){return"object"==typeof t&&null!==t}(t)?(this._remaining--,this._result[e]=t):t.constructor===i&&t._state!==O?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(i.resolve(t),e)},v.prototype._settledAt=function(t,e,i){var n=this.promise;n._state===O&&(this._remaining--,t===P?u(n,i):this._result[e]=i),0===this._remaining&&c(n,this._result)},v.prototype._willSettleAt=function(t,e){var i=this;_(t,void 0,function(t){i._settledAt(z,e,t)},function(t){i._settledAt(P,e,t)})};var D=function(t){return new F(this,t).promise},I=function(t){function e(t){l(n,t)}function i(t){u(n,t)}var n=new this(s);if(!x(t))return u(n,new TypeError("You must pass an array to race.")),n;var r=t.length;for(var o=0;n._state===O&&o<r;o++)_(this.resolve(t[o]),void 0,e,i);return n},B=function(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(s);return l(e,t),e},R=function(t){var e=new this(s);return u(e,t),e},L=0,V=m;m.all=D,m.race=I,m.resolve=B,m.reject=R,m._setScheduler=function(t){y=t},m._setAsap=function(t){k=t},m._asap=k,m.prototype={constructor:m,then:function(t,e){var i=this._state;if(i===z&&!t||i===P&&!e)return this;var n=new this.constructor(s),r=this._result;if(i){var o=arguments[i-1];k(function(){f(i,n,o,r)})}else _(this,n,t,e);return n},catch:function(t){return this.then(null,t)}};var G=function(){var t;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e&&"[object Promise]"===Object.prototype.toString.call(e.resolve())&&!e.cast)return;t.Promise=V},U={Promise:V,polyfill:G};void 0!==e&&e.exports?e.exports=U:void 0!==this&&(this.ES6Promise=U),G()}).call(this)},function(t,e,i){t(319)()||Object.defineProperty(t(275),"Set",{value:t(322),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e,i;return"function"==typeof Set&&(t=new Set(["raz","dwa","trzy"]),"[object Set]"===String(t)&&(3===t.size&&("function"==typeof t.add&&("function"==typeof t.clear&&("function"==typeof t.delete&&("function"==typeof t.entries&&("function"==typeof t.forEach&&("function"==typeof t.has&&("function"==typeof t.keys&&("function"==typeof t.values&&(e=t.values(),!1===(i=e.next()).done&&"raz"===i.value)))))))))))}},function(t,e,i){e.exports="undefined"!=typeof Set&&"[object Set]"===Object.prototype.toString.call(Set.prototype)},function(t,e,i){var n,r=t(299),o=t(305),s=t(266),a=t(313),l=t(323).toStringTag,h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))return new n(t,e);a.call(this,t.__setData__,t),e=e&&o.call(e,"key+value")?"key+value":"value",h(this,"__kind__",s("",e))},r&&r(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__list__[t]]}),toString:s(function(){return"[object Set Iterator]"})}),h(n.prototype,l,s("c","Set Iterator"))},function(t,e,i){var n,r,o,s=t(267),a=t(268),l=t(299),h=t(302),c=t(266),u=t(332),_=t(323),p=t(316),d=t(311),f=t(321),v=t(320),m=Function.prototype.call,g=Object.defineProperty,y=Object.getPrototypeOf;v&&(o=Set),e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=v&&l?l(new o,y(this)):this,null!=e&&p(e),g(t,"__setData__",c("c",[])),e?(d(e,function(t){-1===a.call(this,t)&&this.push(t)},t.__setData__),t):t},v&&(l&&l(n,o),n.prototype=Object.create(o.prototype,{constructor:c(n)})),u(Object.defineProperties(n.prototype,{add:c(function(t){return this.has(t)?this:(this.emit("_add",this.__setData__.push(t)-1,t),this)}),clear:c(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit("_clear"))}),delete:c(function(t){var e=a.call(this.__setData__,t);return-1!==e&&(this.__setData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:c(function(){return new f(this,"key+value")}),forEach:c(function(t){var e,i,n,r=arguments[1];for(h(t),e=this.values(),i=e._next();void 0!==i;)n=e._resolve(i),m.call(t,r,n,n,this),i=e._next()}),has:c(function(t){return-1!==a.call(this.__setData__,t)}),keys:c(r=function(){return this.values()}),size:c.gs(function(){return this.__setData__.length}),values:c(function(){return new f(this)}),toString:c(function(){return"[object Set]"})})),g(n.prototype,_.iterator,c(r)),g(n.prototype,_.toStringTag,c("c","Set"))},function(t,e,i){e.exports=t(324)()?Symbol:t(326)},function(t,e,i){var n={object:!0,symbol:!0};e.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&(!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag])}},function(t,e,i){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,i){var n,r,o,s,a=t(266),l=t(327),h=Object.create,c=Object.defineProperties,u=Object.defineProperty,_=Object.prototype,p=h(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var d=function(){var t=h(null);return function(e){for(var i,n,r=0;t[e+(r||"")];)++r;return e+=r||"",t[e]=!0,i="@@"+e,u(_,i,a.gs(null,function(t){n||(n=!0,u(this,i,a(t)),n=!1)})),i}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return r(t)},e.exports=r=function t(e){var i;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(i=h(o.prototype),e=void 0===e?"":String(e),c(i,{__description__:a("",e),__name__:a("",d(e))}))},c(r,{for:a(function(t){return p[t]?p[t]:p[t]=r(String(t))}),keyFor:a(function(t){var e;l(t);for(e in p)if(p[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||r("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||r("isConcatSpreadable")),iterator:a("",n&&n.iterator||r("iterator")),match:a("",n&&n.match||r("match")),replace:a("",n&&n.replace||r("replace")),search:a("",n&&n.search||r("search")),species:a("",n&&n.species||r("species")),split:a("",n&&n.split||r("split")),toPrimitive:a("",n&&n.toPrimitive||r("toPrimitive")),toStringTag:a("",n&&n.toStringTag||r("toStringTag")),unscopables:a("",n&&n.unscopables||r("unscopables"))}),c(o.prototype,{constructor:a(r),toString:a("",function(){return this.__name__})}),c(r.prototype,{toString:a(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:a(function(){return l(this)})}),u(r.prototype,r.toPrimitive,a("",function(){var t=l(this);return"symbol"==typeof t?t:t.toString()})),u(r.prototype,r.toStringTag,a("c","Symbol")),u(o.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),u(o.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))},function(t,e,i){var n=t(325);e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,i){t(329)()||Object.defineProperty(t(275),"WeakMap",{value:t(331),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},function(t,e,i){e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(t,e,i){var n,r=t(299),o=t(303),s=t(304),a=t(309),l=t(266),h=t(312),c=t(311),u=t(323).toStringTag,_=t(330),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=_&&r&&WeakMap!==n?r(new WeakMap,v(this)):this,null!=e&&(p(e)||(e=h(e))),d(t,"__weakMapData__",l("c","$weakMap$"+a())),e?(c(e,function(e){s(e),t.set(e[0],e[1])}),t):t},_&&(r&&r(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:l(n)})),Object.defineProperties(n.prototype,{delete:l(function(t){return!!f.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(f.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return f.call(o(t),this.__weakMapData__)}),set:l(function(t,e){return d(o(t),this.__weakMapData__,l("c",e)),this}),toString:l(function(){return"[object WeakMap]"})}),d(n.prototype,u,l("c","WeakMap"))},function(t,e,i){var n,r,o,s,a,l,h,c=t(266),u=t(302),_=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};a={on:n=function(t,e){var i;return u(e),m.call(this,"__ee__")?i=this.__ee__:(i=g.value=d(null),f(this,"__ee__",g),g.value=null),i[t]?"object"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},once:r=function(t,e){var i,r;return u(e),r=this,n.call(this,t,i=function(){o.call(r,t,i),_.call(e,this,arguments)}),i.__eeOnceListener__=e,this},off:o=function(t,e){var i,n,r,o;if(u(e),!m.call(this,"__ee__"))return this;if(!(i=this.__ee__)[t])return this;if("object"==typeof(n=i[t]))for(o=0;r=n[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},emit:s=function(t){var e,i,n,r,o;if(m.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;n=r[e];++e)_.call(n,this,o)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];_.call(r,this,o)}}},l={on:c(n),once:c(r),off:c(o),emit:c(s)},h=v({},l),e.exports=i=function(t){return null==t?d(h):v(Object(t),l)},i.methods=a},/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
function(t,e,i){!function(t,i,n,r){"use strict";function o(t,e,i){return setTimeout(c(t,i),e)}function s(t,e,i){return!!Array.isArray(t)&&(a(t,i[e],i),!0)}function a(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==r)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function l(e,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,n),e.apply(this,arguments)}}function h(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&K(n,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function u(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,i){a(m(e),function(e){t.addEventListener(e,i,!1)})}function d(t,e,i){a(m(e),function(e){t.removeEventListener(e,i,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function m(t){return t.trim().split(/\s+/g)}function g(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function y(t){return Array.prototype.slice.call(t,0)}function b(t,e,i){for(var n=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];g(r,s)<0&&n.push(t[o]),r[o]=s,o++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function x(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<Z.length;){if(i=Z[s],(n=i?i+o:e)in t)return n;s++}return r}function w(e){var i=e.ownerDocument||e;return i.defaultView||i.parentWindow||t}function k(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){u(t.options.enable,[t])&&i.handler(e)},this.init()}function S(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&_t&&n-o==0,a=e&(dt|ft)&&n-o==0;i.isFirst=!!s,i.isFinal=!!a,s&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=C(e));o>1&&!i.firstMultiple?i.firstMultiple=C(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,l=a?a.center:s.center,h=e.center=T(n);e.timeStamp=rt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=O(l,h),e.distance=M(l,h),function(t,e){var i=e.center,n=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},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=E(e.deltaX,e.deltaY);var c=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=nt(c.x)>nt(c.y)?c.x:c.y,e.scale=a?function(t,e){return M(e[0],e[1],Ct)/M(t[0],t[1],Ct)}(a.pointers,n):1,e.rotation=a?function(t,e){return O(e[1],e[0],Ct)+O(t[1],t[0],Ct)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=ft&&(l>ut||a.velocity===r)){var h=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,u=A(l,h,c);n=u.x,o=u.y,i=nt(u.x)>nt(u.y)?u.x:u.y,s=E(h,c),t.lastInterval=e}else i=a.velocity,n=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u=t.element;f(e.srcEvent.target,u)&&(u=e.srcEvent.target);e.target=u}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function C(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:it(t.pointers[i].clientX),clientY:it(t.pointers[i].clientY)},i++;return{timeStamp:rt(),pointers:e,center:T(e),deltaX:t.deltaX,deltaY:t.deltaY}}function T(t){var e=t.length;if(1===e)return{x:it(t[0].clientX),y:it(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:it(i/e),y:it(n/e)}}function A(t,e,i){return{x:e/t||0,y:i/t||0}}function E(t,e){return t===e?vt:nt(t)>=nt(e)?t<0?mt:gt:e<0?yt:bt}function M(t,e,i){i||(i=St);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function O(t,e,i){i||(i=St);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}function z(){this.evEl=At,this.evWin=Et,this.pressed=!1,k.apply(this,arguments)}function P(){this.evEl=zt,this.evWin=Pt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function j(){this.evTarget=Nt,this.evWin=Ft,this.started=!1,k.apply(this,arguments)}function N(){this.evTarget=It,this.targetIds={},k.apply(this,arguments)}function F(){k.apply(this,arguments);var t=c(this.handler,this);this.touch=new N(this.manager,t),this.mouse=new z(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function D(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches,r=function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)};setTimeout(r,Bt)}}function I(t,e){this.manager=t,this.set(e)}function B(t){this.options=K({},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&Zt?"cancel":t&$t?"end":t&Qt?"move":t&Jt?"start":""}function L(t){return t==bt?"down":t==yt?"up":t==mt?"left":t==gt?"right":""}function V(t,e){var i=e.manager;return i?i.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=K({},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,i=t.options.inputClass;e=i||(ht?P:ct?N:lt?F:z);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 i=t.element;if(i.style){var n;a(t.options.cssProps,function(r,o){n=x(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=t.oldCssProps[n]||""}),e||(t.oldCssProps={})}}var K,Z=["","webkit","Moz","MS","ms","o"],tt=i.createElement("div"),et="function",it=Math.round,nt=Math.abs,rt=Date.now;K="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),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==r&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var ot=l(function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&t[n[o]]===r)&&(t[n[o]]=e[n[o]]),o++;return t},"extend","Use `assign`."),st=l(function(t,e){return ot(t,e,!0)},"merge","Use `assign`."),at=1,lt="ontouchstart"in t,ht=x(t,"PointerEvent")!==r,ct=lt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ut=25,_t=1,pt=2,dt=4,ft=8,vt=1,mt=2,gt=4,yt=8,bt=16,xt=mt|gt,wt=yt|bt,kt=xt|wt,St=["x","y"],Ct=["clientX","clientY"];k.prototype={handler:function(){},init:function(){this.evEl&&p(this.element,this.evEl,this.domHandler),this.evTarget&&p(this.target,this.evTarget,this.domHandler),this.evWin&&p(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(w(this.element),this.evWin,this.domHandler)}};var Tt={mousedown:_t,mousemove:pt,mouseup:dt},At="mousedown",Et="mousemove mouseup";h(z,k,{handler:function(t){var e=Tt[t.type];e&_t&&0===t.button&&(this.pressed=!0),e&pt&&1!==t.which&&(e=dt),this.pressed&&(e&dt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Mt={pointerdown:_t,pointermove:pt,pointerup:dt,pointercancel:ft,pointerout:ft},Ot={2:"touch",3:"pen",4:"mouse",5:"kinect"},zt="pointerdown",Pt="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(zt="MSPointerDown",Pt="MSPointerMove MSPointerUp MSPointerCancel"),h(P,k,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=Mt[n],o=Ot[t.pointerType]||t.pointerType,s="touch"==o,a=g(e,t.pointerId,"pointerId");r&_t&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(dt|ft)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var jt={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},Nt="touchstart",Ft="touchstart touchmove touchend touchcancel";h(j,k,{handler:function(t){var e=jt[t.type];if(e===_t&&(this.started=!0),this.started){var i=function(t,e){var i=y(t.touches),n=y(t.changedTouches);e&(dt|ft)&&(i=b(i.concat(n),"identifier",!0));return[i,n]}.call(this,t,e);e&(dt|ft)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}}});var Dt={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},It="touchstart touchmove touchend touchcancel";h(N,k,{handler:function(t){var e=Dt[t.type],i=function(t,e){var i=y(t.touches),n=this.targetIds;if(e&(_t|pt)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=y(t.changedTouches),a=[],l=this.target;if(o=i.filter(function(t){return f(t.target,l)}),e===_t)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;r=0;for(;r<s.length;)n[s[r].identifier]&&a.push(s[r]),e&(dt|ft)&&delete n[s[r].identifier],r++;if(!a.length)return;return[b(o.concat(a),"identifier",!0),a]}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}});var Bt=2500,Rt=25;h(F,k,{handler:function(t,e,i){var n="touch"==i.pointerType,r="mouse"==i.pointerType;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)(function(t,e){t&_t?(this.primaryTouch=e.changedPointers[0].identifier,D.call(this,e)):t&(dt|ft)&&D.call(this,e)}).call(this,e,i);else if(r&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),s=Math.abs(i-r.y);if(o<=Rt&&s<=Rt)return!0}return!1}.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Lt=x(tt.style,"touchAction"),Vt=Lt!==r,Gt="auto",Ut="manipulation",Yt="none",qt="pan-x",Xt="pan-y",Wt=function(){if(!Vt)return!1;var e={},i=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){e[n]=!i||t.CSS.supports("touch-action",n)}),e}();I.prototype={set:function(t){"compute"==t&&(t=this.compute()),Vt&&this.manager.element.style&&Wt[t]&&(this.manager.element.style[Lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){u(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(v(t,Yt))return Yt;var e=v(t,qt),i=v(t,Xt);if(e&&i)return Yt;if(e||i)return e?qt:Xt;if(v(t,Ut))return Ut;return Gt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=v(n,Yt)&&!Wt[Yt],o=v(n,Xt)&&!Wt[Xt],s=v(n,qt)&&!Wt[qt];if(r){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!s||!o)return r||o&&i&xt||s&&i&wt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ht=1,Jt=2,Qt=4,$t=8,Kt=$t,Zt=16;B.prototype={defaults:{},set:function(t){return K(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(s(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=V(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return s(t,"dropRecognizeWith",this)?this:(t=V(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(s(t,"requireFailure",this))return this;var e=this.requireFail;return t=V(t,this),-1===g(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(s(t,"dropRequireFailure",this))return this;t=V(t,this);var e=g(this.requireFail,t);return e>-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){i.manager.emit(e,t)}var i=this,n=this.state;n<$t&&e(i.options.event+R(n)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),n>=$t&&e(i.options.event+R(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|Ht)))return!1;t++}return!0},recognize:function(t){var e=K({},t);if(!u(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(Kt|Zt|32)&&(this.state=Ht),this.state=this.process(e),this.state&(Jt|Qt|$t|Zt)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},h(G,B,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(Jt|Qt),r=this.attrTest(t);return n&&(i&ft||!r)?e|Zt:n||r?i&dt?e|$t:e&Jt?e|Qt:Jt:32}}),h(U,G,{defaults:{event:"pan",threshold:10,pointers:1,direction:kt},getTouchAction:function(){var t=this.options.direction,e=[];return t&xt&&e.push(Xt),t&wt&&e.push(qt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&xt?(r=0===o?vt:o<0?mt:gt,i=o!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?vt:s<0?yt:bt,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.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)}}),h(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)}}),h(q,B,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(dt|ft)&&!r)this.reset();else if(t.eventType&_t)this.reset(),this._timer=o(function(){this.state=Kt,this.tryEmit()},e.time,this);else if(t.eventType&dt)return Kt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Kt&&(t&&t.eventType&dt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=rt(),this.manager.emit(this.options.event,this._input)))}}),h(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)}}),h(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,i=this.options.direction;return i&(xt|wt)?e=t.overallVelocity:i&xt?e=t.overallVelocityX:i&wt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&nt(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)}}),h(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,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&_t&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=dt)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||M(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=o(function(){this.state=Kt,this.tryEmit()},e.interval,this),Jt):Kt}return 32},failTimeout:function(){return this._timer=o(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Kt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),J.VERSION="2.0.7",J.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[X,{enable:!1}],[Y,{enable:!1},["rotate"]],[W,{direction:xt}],[U,{direction:xt},["swipe"]],[H],[H,{event:"doubletap",taps:2},["tap"]],[q]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};Q.prototype={set:function(t){return K(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,n=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&Kt)&&(r=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&i.state&(Jt|Qt|$t)&&(r=e.curRecognizer=i),o++}},get:function(t){if(t instanceof B)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(s(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(s(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=g(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==r&&e!==r){var i=this.handlers;return a(m(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==r){var i=this.handlers;return a(m(t),function(t){e?i[t]&&i[t].splice(g(i[t],e),1):delete i[t]}),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&$(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},K(J,{INPUT_START:_t,INPUT_MOVE:pt,INPUT_END:dt,INPUT_CANCEL:ft,STATE_POSSIBLE:Ht,STATE_BEGAN:Jt,STATE_CHANGED:Qt,STATE_ENDED:$t,STATE_RECOGNIZED:Kt,STATE_CANCELLED:Zt,STATE_FAILED:32,DIRECTION_NONE:vt,DIRECTION_LEFT:mt,DIRECTION_RIGHT:gt,DIRECTION_UP:yt,DIRECTION_DOWN:bt,DIRECTION_HORIZONTAL:xt,DIRECTION_VERTICAL:wt,DIRECTION_ALL:kt,Manager:Q,Input:k,TouchAction:I,TouchInput:N,MouseInput:z,PointerEventInput:P,TouchMouseInput:F,SingleTouchInput:j,Recognizer:B,AttrRecognizer:G,Tap:H,Pan:U,Swipe:W,Pinch:Y,Rotate:X,Press:q,on:p,off:d,each:a,merge:st,extend:ot,assign:K,inherit:h,bindFn:c,prefixed:x});var te=void 0!==t?t:"undefined"!=typeof self?self:{};te.Hammer=J,void 0!==e&&e.exports?e.exports=J:t.Hammer=J}(window,document)},function(t,e,i){var n,r=t(339);!function(t){t[t.Le=0]="Le",t[t.Ge=1]="Ge",t[t.Eq=2]="Eq"}(n=i.Operator||(i.Operator={}));var o=function(){function t(t,e,i){void 0===i&&(i=r.Strength.required),this._id=s++,this._operator=e,this._expression=t,this._strength=r.Strength.clip(i)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this;return this._expression+" "+function(){switch(t._operator){case n.Le:return"<=";case n.Ge:return">=";case n.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}();i.Constraint=o;var s=0},function(t,e,i){var n=t(343),r=t(346),o=t(337),s=function(){function t(){var t=function(t){for(var e=0,i=function(){return 0},n=o.createMap(r.Variable.Compare),s=0,a=t.length;s<a;++s){var l=t[s];if("number"==typeof l)e+=l;else if(l instanceof r.Variable)n.setDefault(l,i).second+=1;else{if(!(l instanceof Array))throw new Error("invalid Expression argument: "+JSON.stringify(l));if(2!==l.length)throw new Error("array must have length 2");var h=l[0],c=l[1];if("number"!=typeof h)throw new Error("array item 0 must be a number");if(!(c instanceof r.Variable))throw new Error("array item 1 must be a variable");n.setDefault(c,i).second+=h}}return{terms:n,constant:e}}(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var t=[];n.forEach(this._terms,function(e){t.push([e.first,e.second])});for(var e=!0,i="",r=0,o=t;r<o.length;r++){var s=o[r],a=s[0],l=s[1];e?(e=!1,i+=1==l?""+a:-1==l?"-"+a:l+"*"+a):i+=1==l?" + "+a:-1==l?" - "+a:l>=0?" + "+l+a:" - "+-l+a}var h=this.constant;return h<0?i+=" - "+-h:h>0&&(i+=" + "+h),i},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 n.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();i.Expression=s},function(t,e,i){/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(346)),n(t(335)),n(t(334)),n(t(339)),n(t(338))},function(t,e,i){var n=t(343);i.createMap=function(t){return new n.AssociativeArray(t)}},function(t,e,i){function n(t){return t<0?-t<1e-8:t<1e-8}var r=t(346),o=t(335),s=t(334),a=t(339),l=t(337),h=t(343),c=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 i=this._createRow(t),r=i.row,o=i.tag,s=this._chooseSubject(r,o);if(s.type()===u.Invalid&&r.allDummies()){if(!n(r.constant())){for(var a=[],l=0,h=t.expression.terms._array;l<h.length;l++){var c=h[l];a.push(c.first.name)}var _=["LE","GE","EQ"][t.op];throw new Error("unsatisfiable constraint ["+a.join(",")+"] operator: "+_)}s=o.marker}if(s.type()===u.Invalid){if(!this._addWithArtificialVariable(r))throw new Error("unsatisfiable constraint")}else r.solveFor(s),this._substitute(s,r),this._rowMap.insert(s,r);this._cnMap.insert(t,o),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var i=this._cnMap.erase(t);if(void 0===i){if(e)return;throw new Error("unknown constraint")}this._removeConstraintEffects(t,i.second);var n=i.second.marker,r=this._rowMap.erase(n);if(void 0===r){var o=this._getMarkerLeavingSymbol(n);if(o.type()===u.Invalid)throw new Error("failed to find leaving row");(r=this._rowMap.erase(o)).second.solveForEx(o,n),this._substitute(n,r.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var i=this._editMap.find(t);if(void 0!==i)throw new Error("duplicate edit variable: "+t.name);if((e=a.Strength.clip(e))===a.Strength.required)throw new Error("bad required strength");var n=new o.Expression(t),r=new s.Constraint(n,s.Operator.Eq,e);this.addConstraint(r);var l=this._cnMap.find(r).second,h={tag:l,constraint:r,constant:0};this._editMap.insert(t,h)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var i=this._editMap.erase(t);if(void 0===i){if(e)return;throw new Error("unknown edit variable: "+t.name)}this.removeConstraint(i.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var i=this._editMap.find(t);if(void 0===i)throw new Error("unknown edit variable: "+t.name);var n=this._rowMap,r=i.second,o=e-r.constant;r.constant=e;var s=r.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=r.tag.other;if(void 0!==(a=n.find(l)))return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var h=0,c=n.size();h<c;++h){var _=n.itemAt(h),p=_.second,d=p.coefficientFor(s);0!==d&&p.add(o*d)<0&&_.first.type()!==u.External&&this._infeasibleRows.push(_.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,i=0,n=t.size();i<n;++i){var r=t.itemAt(i),o=e.find(r.second),s=0;void 0!==o&&-0===(s=o.second.constant())&&(s=0),r.first.setValue(s)}},t.prototype.getConstraints=function(){var t=[];return h.forEach(this._cnMap,function(e){t.push(e.first)}),t},Object.defineProperty(t.prototype,"numConstraints",{get:function(){return this._cnMap.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numEditVariables",{get:function(){return this._editMap.size()},enumerable:!0,configurable:!0}),t.prototype._getVarSymbol=function(t){var e=this;return this._varMap.setDefault(t,function(){return e._makeSymbol(u.External)}).second},t.prototype._createRow=function(t){for(var e=t.expression,i=new d(e.constant),r=e.terms,o=0,l=r.size();o<l;++o){var h=r.itemAt(o);if(!n(h.second)){var c=this._getVarSymbol(h.first),_=this._rowMap.find(c);void 0!==_?i.insertRow(_.second,h.second):i.insertSymbol(c,h.second)}}var f=this._objective,v=t.strength,m={marker:p,other:p};switch(t.op){case s.Operator.Le:case s.Operator.Ge:var g=t.op===s.Operator.Le?1:-1,y=this._makeSymbol(u.Slack);if(m.marker=y,i.insertSymbol(y,g),v<a.Strength.required){var b=this._makeSymbol(u.Error);m.other=b,i.insertSymbol(b,-g),f.insertSymbol(b,v)}break;case s.Operator.Eq:if(v<a.Strength.required){var x=this._makeSymbol(u.Error),w=this._makeSymbol(u.Error);m.marker=x,m.other=w,i.insertSymbol(x,-1),i.insertSymbol(w,1),f.insertSymbol(x,v),f.insertSymbol(w,v)}else{var k=this._makeSymbol(u.Dummy);m.marker=k,i.insertSymbol(k)}}return i.constant()<0&&i.reverseSign(),{row:i,tag:m}},t.prototype._chooseSubject=function(t,e){for(var i=t.cells(),n=0,r=i.size();n<r;++n){var o=i.itemAt(n);if(o.first.type()===u.External)return o.first}var s=e.marker.type();return(s===u.Slack||s===u.Error)&&t.coefficientFor(e.marker)<0?e.marker:((s=e.other.type())===u.Slack||s===u.Error)&&t.coefficientFor(e.other)<0?e.other:p},t.prototype._addWithArtificialVariable=function(t){var e=this._makeSymbol(u.Slack);this._rowMap.insert(e,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var i=n(this._artificial.constant());this._artificial=null;var r=this._rowMap.erase(e);if(void 0!==r){var o=r.second;if(o.isConstant())return i;var s=this._anyPivotableSymbol(o);if(s.type()===u.Invalid)return!1;o.solveForEx(e,s),this._substitute(s,o),this._rowMap.insert(s,o)}for(var a=this._rowMap,l=0,h=a.size();l<h;++l)a.itemAt(l).second.removeSymbol(e);return this._objective.removeSymbol(e),i},t.prototype._substitute=function(t,e){for(var i=this._rowMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);o.second.substitute(t,e),o.second.constant()<0&&o.first.type()!==u.External&&this._infeasibleRows.push(o.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},t.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(e.type()===u.Invalid)return;var i=this._getLeavingSymbol(e);if(i.type()===u.Invalid)throw new Error("the objective is unbounded");var n=this._rowMap.erase(i).second;n.solveForEx(i,e),this._substitute(e,n),this._rowMap.insert(e,n)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var i=e.pop(),n=t.find(i);if(void 0!==n&&n.second.constant()<0){var r=this._getDualEnteringSymbol(n.second);if(r.type()===u.Invalid)throw new Error("dual optimize failed");var o=n.second;t.erase(i),o.solveForEx(i,r),this._substitute(r,o),t.insert(r,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first;if(r.second<0&&o.type()!==u.Dummy)return o}return p},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,i=p,n=t.cells(),r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first,l=s.second;if(l>0&&a.type()!==u.Dummy){var h=this._objective.coefficientFor(a),c=h/l;c<e&&(e=c,i=a)}}return i},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=p,n=this._rowMap,r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first;if(a.type()!==u.External){var l=s.second,h=l.coefficientFor(t);if(h<0){var c=-l.constant()/h;c<e&&(e=c,i=a)}}}return i},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=e,n=e,r=p,o=r,s=r,a=r,l=this._rowMap,h=0,c=l.size();h<c;++h){var _=l.itemAt(h),d=_.second,f=d.coefficientFor(t);if(0!==f){var v=_.first;if(v.type()===u.External)a=v;else if(f<0){var m=-d.constant()/f;m<i&&(i=m,o=v)}else{var m=d.constant()/f;m<n&&(n=m,s=v)}}}return o!==r?o:s!==r?s:a},t.prototype._removeConstraintEffects=function(t,e){e.marker.type()===u.Error&&this._removeMarkerEffects(e.marker,t.strength),e.other.type()===u.Error&&this._removeMarkerEffects(e.other,t.strength)},t.prototype._removeMarkerEffects=function(t,e){var i=this._rowMap.find(t);void 0!==i?this._objective.insertRow(i.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first.type();if(o===u.Slack||o===u.Error)return r.first}return p},t.prototype._makeSymbol=function(t){return new _(t,this._idTick++)},t}();i.Solver=c;var u;!function(t){t[t.Invalid=0]="Invalid",t[t.External=1]="External",t[t.Slack=2]="Slack",t[t.Error=3]="Error",t[t.Dummy=4]="Dummy"}(u||(u={}));var _=function(){function t(t,e){this._id=e,this._type=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.type=function(){return this._type},t}(),p=new _(u.Invalid,-1),d=function(){function t(t){void 0===t&&(t=0),this._cellMap=l.createMap(_.Compare),this._constant=t}return t.prototype.cells=function(){return this._cellMap},t.prototype.constant=function(){return this._constant},t.prototype.isConstant=function(){return this._cellMap.empty()},t.prototype.allDummies=function(){for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);if(n.first.type()!==u.Dummy)return!1}return!0},t.prototype.copy=function(){var e=new t(this._constant);return e._cellMap=this._cellMap.copy(),e},t.prototype.add=function(t){return this._constant+=t},t.prototype.insertSymbol=function(t,e){void 0===e&&(e=1);var i=this._cellMap.setDefault(t,function(){return 0});n(i.second+=e)&&this._cellMap.erase(t)},t.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var i=t._cellMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);this.insertSymbol(o.first,o.second*e)}},t.prototype.removeSymbol=function(t){this._cellMap.erase(t)},t.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);n.second=-n.second}},t.prototype.solveFor=function(t){var e=this._cellMap,i=e.erase(t),n=-1/i.second;this._constant*=n;for(var r=0,o=e.size();r<o;++r)e.itemAt(r).second*=n},t.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},t.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},t.prototype.substitute=function(t,e){var i=this._cellMap.erase(t);void 0!==i&&this.insertRow(e,i.second)},t}()},function(t,e,i){!function(t){function e(t,e,i,n){void 0===n&&(n=1);var r=0;return r+=1e6*Math.max(0,Math.min(1e3,t*n)),r+=1e3*Math.max(0,Math.min(1e3,e*n)),r+=Math.max(0,Math.min(1e3,i*n))}t.create=e,t.required=e(1e3,1e3,1e3),t.strong=e(1,0,0),t.medium=e(0,1,0),t.weak=e(0,0,1),t.clip=function(e){return Math.max(0,Math.min(t.required,e))}}(i.Strength||(i.Strength={}))},function(t,e,i){function n(t,e,i){for(var n,r,o=0,s=t.length;s>0;)i(t[r=o+(n=s>>1)],e)<0?(o=r+1,s-=n+1):s=n;return o}var r=t(344);i.lowerBound=n,i.binarySearch=function(t,e,i){var r=n(t,e,i);if(r===t.length)return-1;var o=t[r];if(0!==i(o,e))return-1;return r},i.binaryFind=function(t,e,i){var r=n(t,e,i);if(r===t.length)return;var o=t[r];if(0!==i(o,e))return;return o},i.asSet=function(t,e){var i=r.asArray(t),n=i.length;if(n<=1)return i;i.sort(e);for(var o=[i[0]],s=1,a=0;s<n;++s){var l=i[s];0!==e(o[a],l)&&(o.push(l),++a)}return o},i.setIsDisjoint=function(t,e,i){var n=0,r=0,o=t.length,s=e.length;for(;n<o&&r<s;){var a=i(t[n],e[r]);if(a<0)++n;else{if(!(a>0))return!1;++r}}return!0},i.setIsSubset=function(t,e,i){var n=t.length,r=e.length;if(n>r)return!1;var o=0,s=0;for(;o<n&&s<r;){var a=i(t[o],e[s]);if(a<0)return!1;a>0?++s:(++o,++s)}if(o<n)return!1;return!0},i.setUnion=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?(a.push(h),++r):(a.push(l),++n,++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a},i.setIntersection=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?++n:c>0?++r:(a.push(l),++n,++r)}return a},i.setDifference=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?++r:(++n,++r)}for(;n<o;)a.push(t[n]),++n;return a},i.setSymmetricDifference=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?(a.push(h),++r):(++n,++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a}},function(t,e,i){var n=t(344),r=function(){function t(){this._array=[]}return t.prototype.size=function(){return this._array.length},t.prototype.empty=function(){return 0===this._array.length},t.prototype.itemAt=function(t){return this._array[t]},t.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},t.prototype.clear=function(){this._array=[]},t.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},t.prototype.__iter__=function(){return n.iter(this._array)},t.prototype.__reversed__=function(){return n.reversed(this._array)},t}();i.ArrayBase=r},function(t,e,i){/*-----------------------------------------------------------------------------
| Copyright (c) 2014, Nucleic Development Team.
|
| Distributed under the terms of the Modified BSD License.
|
| The full license is in the file COPYING.txt, distributed with this software.
|----------------------------------------------------------------------------*/
var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=t(345),o=t(341),s=t(340),a=t(344),l=function(t){function e(e){var i=t.call(this)||this;return i._compare=e,i._wrapped=function(t){return function(e,i){return t(e.first,i)}}(e),i}return n(e,t),e.prototype.comparitor=function(){return this._compare},e.prototype.indexOf=function(t){return s.binarySearch(this._array,t,this._wrapped)},e.prototype.contains=function(t){return s.binarySearch(this._array,t,this._wrapped)>=0},e.prototype.find=function(t){return s.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var i=this._array,n=s.lowerBound(i,t,this._wrapped);if(n===i.length){var o=new r.Pair(t,e());return i.push(o),o}var a=i[n];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e());return i.splice(n,0,o),o}return a},e.prototype.insert=function(t,e){var i=this._array,n=s.lowerBound(i,t,this._wrapped);if(n===i.length){var o=new r.Pair(t,e);return i.push(o),o}var a=i[n];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e);return i.splice(n,0,o),o}return a.second=e,a},e.prototype.update=function(t){var i=this;t instanceof e?this._array=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l.first,h.first);c<0?(a.push(l.copy()),++n):c>0?(a.push(h.copy()),++r):(a.push(h.copy()),++n,++r)}for(;n<o;)a.push(t[n].copy()),++n;for(;r<s;)a.push(e[r].copy()),++r;return a}(this._array,t._array,this._compare):a.forEach(t,function(t){i.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,i=s.binarySearch(e,t,this._wrapped);if(!(i<0))return e.splice(i,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),i=t._array,n=this._array,r=0,o=n.length;r<o;++r)i.push(n[r].copy());return t},e}(o.ArrayBase);i.AssociativeArray=l},function(t,e,i){function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(340)),n(t(341)),n(t(342)),n(t(344)),n(t(345))},function(t,e,i){var n=function(){function t(t,e){void 0===e&&(e=0),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[this._index++]},t.prototype.__iter__=function(){return this},t}();i.ArrayIterator=n;var r=function(){function t(t,e){void 0===e&&(e=t.length),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[--this._index]},t.prototype.__iter__=function(){return this},t}();i.ReverseArrayIterator=r,i.iter=function(t){if(t instanceof Array)return new n(t);return t.__iter__()},i.reversed=function(t){if(t instanceof Array)return new r(t);return t.__reversed__()},i.next=function(t){return t.__next__()},i.asArray=function(t){if(t instanceof Array)return t.slice();var e,i=[],n=t.__iter__();for(;void 0!==(e=n.__next__());)i.push(e);return i},i.forEach=function(t,e){if(t instanceof Array){for(var i=0,n=t.length;i<n;++i)if(!1===e(t[i]))return}else for(var r,o=t.__iter__();void 0!==(r=o.__next__());)if(!1===e(r))return},i.map=function(t,e){var i=[];if(t instanceof Array)for(var n=0,r=t.length;n<r;++n)i.push(e(t[n]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)i.push(e(o));return i},i.filter=function(t,e){var i,n=[];if(t instanceof Array)for(var r=0,o=t.length;r<o;++r)i=t[r],e(i)&&n.push(i);else for(var s=t.__iter__();void 0!==(i=s.__next__());)e(i)&&n.push(i);return n}},function(t,e,i){var n=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();i.Pair=n},function(t,e,i){var n=function(){function t(t){void 0===t&&(t=""),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){return this._name},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.setName=function(t){this._name=t},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),t.prototype.setContext=function(t){this._context=t},Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){this._value=t},t}();i.Variable=n;var r=0},/*!
 * numbro.js
 * version : 1.6.2
 * author : FÃ¶retagsplatsen AB
 * license : MIT
 * http://www.foretagsplatsen.se
 */
function(t,e,i){function n(t){this._value=t}function r(t){var e,i="";for(e=0;e<t;e++)i+="0";return i}function o(t,e,i,n){var o,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?function(t,e){var i,n,o,s,a;a=t.toString(),i=a.split("e")[0],s=a.split("e")[1],n=i.split(".")[0],o=i.split(".")[1]||"",a=n+o+r(s-o.length),e>0&&(a+="."+r(e));return a}(t,e):(i(t*a)/a).toFixed(e),n&&(o=new RegExp("0{1,"+n+"}$"),s=s.replace(o,"")),s}function s(t,e,i){return e.indexOf("$")>-1?function(t,e,i){var n,r,o=e,s=o.indexOf("$"),l=o.indexOf("("),h=o.indexOf("+"),c=o.indexOf("-"),_="",d="";-1===o.indexOf("$")?"infix"===u[p].currency.position?(d=u[p].currency.symbol,u[p].currency.spaceSeparated&&(d=" "+d+" ")):u[p].currency.spaceSeparated&&(_=" "):o.indexOf(" $")>-1?(_=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(_=" ",o=o.replace("$ ","")):o=o.replace("$","");if(r=a(t,o,i,d),-1===e.indexOf("$"))switch(u[p].currency.position){case"postfix":r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+u[p].currency.symbol),r=r.join("")):r=r+_+u[p].currency.symbol;break;case"infix":break;case"prefix":r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),n=Math.max(l,c)+1,r.splice(n,0,u[p].currency.symbol+_),r=r.join("")):r=u[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(""),n=1,(s<l||s<h||s<c)&&(n=0),r.splice(n,0,u[p].currency.symbol+_),r=r.join("")):r=u[p].currency.symbol+_+r:r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,_+u[p].currency.symbol),r=r.join("")):r=r+_+u[p].currency.symbol;return r}(t,e,i):e.indexOf("%")>-1?function(t,e,i){var n,r="";t*=100,e.indexOf(" %")>-1?(r=" ",e=e.replace(" %","")):e=e.replace("%","");(n=a(t,e,i)).indexOf(")")>-1?((n=n.split("")).splice(-1,0,r+"%"),n=n.join("")):n=n+r+"%";return n}(t,e,i):e.indexOf(":")>-1?function(t){var e=Math.floor(t/60/60),i=Math.floor((t-60*e*60)/60),n=Math.round(t-60*e*60-60*i);return e+":"+(i<10?"0"+i:i)+":"+(n<10?"0"+n:n)}(t):a(t,e,i)}function a(t,e,i,n){var r,s,a,l,h,c,_,f,v,m,g,y,b,x,w,k,S,C,T=!1,A=!1,E=!1,M="",O=!1,z=!1,P=!1,j=!1,N=!1,F="",D="",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]+)\..*/),C=null===X?-1:X[1].length,-1!==e.indexOf("-")&&(V=!0),e.indexOf("(")>-1?(T=!0,e=e.slice(1,-1)):e.indexOf("+")>-1&&(A=!0,e=e.replace(/\+/g,"")),e.indexOf("a")>-1){if(m=e.split(".")[0].match(/[0-9]+/g)||["0"],m=parseInt(m[0],10),O=e.indexOf("aK")>=0,z=e.indexOf("aM")>=0,P=e.indexOf("aB")>=0,j=e.indexOf("aT")>=0,N=O||z||P||j,e.indexOf(" a")>-1?(M=" ",e=e.replace(" a","")):e=e.replace("a",""),h=Math.floor(Math.log(I)/Math.LN10)+1,_=h%3,_=0===_?3:_,m&&0!==I&&(c=Math.floor(Math.log(I)/Math.LN10)+1-m,f=3*~~((Math.min(m,h)-_)/3),I/=Math.pow(10,f),-1===e.indexOf(".")&&m>3))for(e+="[.]",k=(k=0===c?0:3*~~(c/3)-c)<0?k+3:k,r=0;r<k;r++)e+="0";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==m&&(I>=Math.pow(10,12)&&!N||j?(M+=u[p].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!N||P?(M+=u[p].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!N||z?(M+=u[p].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!N||O)&&(M+=u[p].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf("b")>-1)for(e.indexOf(" b")>-1?(F=" ",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&&t<a){F+=B[l],s>0&&(t/=s);break}if(e.indexOf("d")>-1)for(e.indexOf(" d")>-1?(F=" ",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&&t<a){F+=R[l],s>0&&(t/=s);break}if(e.indexOf("o")>-1&&(e.indexOf(" o")>-1?(D=" ",e=e.replace(" o","")):e=e.replace("o",""),u[p].ordinal&&(D+=u[p].ordinal(t))),e.indexOf("[.]")>-1&&(E=!0,e=e.replace("[.]",".")),v=t.toString().split(".")[0],g=e.split(".")[1],x=e.indexOf(","),g){if(-1!==g.indexOf("*")?L=o(t,t.toString().split(".")[1].length,i):g.indexOf("[")>-1?(g=(g=g.replace("]","")).split("["),L=o(t,g[0].length+g[1].length,i,g[1].length)):L=o(t,g.length,i),v=L.split(".")[0],L.split(".")[1].length){var W=n?M+n:u[p].delimiters.decimal;L=W+L.split(".")[1]}else L="";E&&0===Number(L.slice(1))&&(L="")}else v=o(t,null,i);return v.indexOf("-")>-1&&(v=v.slice(1),G=!0),v.length<C&&(v=new Array(C-v.length+1).join("0")+v),x>-1&&(v=v.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+u[p].delimiters.thousands)),0===e.indexOf(".")&&(v=""),w=e.indexOf("("),S=e.indexOf("-"),U=w<S?(T&&G?"(":"")+(V&&G||!T&&G?"-":""):(V&&G||!T&&G?"-":"")+(T&&G?"(":""),y+U+(!G&&A&&0!==t?"+":"")+v+L+(D||"")+(M&&!n?M:"")+(F||"")+(T&&G?")":"")+b}function l(t,e){u[t]=e}function h(t){p=t;var e=u[t].defaults;e&&e.format&&c.defaultFormat(e.format),e&&e.currencyFormat&&c.defaultCurrencyFormat(e.currencyFormat)}var c,u={},_=u,p="en-US",d=null,f="0,0";void 0!==e&&e.exports;(c=function(t){return c.isNumbro(t)?t=t.value():0===t||void 0===t?t=0:Number(t)||(t=c.fn.unformat(t)),new n(Number(t))}).version="1.6.2",c.isNumbro=function(t){return t instanceof n},c.setLanguage=function(t,e){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var i=t,n=t.split("-")[0],r=null;_[i]||(Object.keys(_).forEach(function(t){r||t.split("-")[0]!==n||(r=t)}),i=r||e||"en-US"),h(i)},c.setCulture=function(t,e){var i=t,n=t.split("-")[1],r=null;u[i]||(n&&Object.keys(u).forEach(function(t){r||t.split("-")[1]!==n||(r=t)}),i=r||e||"en-US"),h(i)},c.language=function(t,e){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!t)return p;if(t&&!e){if(!_[t])throw new Error("Unknown language : "+t);h(t)}return!e&&_[t]||l(t,e),c},c.culture=function(t,e){if(!t)return p;if(t&&!e){if(!u[t])throw new Error("Unknown culture : "+t);h(t)}return!e&&u[t]||l(t,e),c},c.languageData=function(t){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!t)return _[p];if(!_[t])throw new Error("Unknown language : "+t);return _[t]},c.cultureData=function(t){if(!t)return u[p];if(!u[t])throw new Error("Unknown culture : "+t);return u[t]},c.culture("en-US",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}}),c.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),_},c.cultures=function(){return u},c.zeroFormat=function(t){d="string"==typeof t?t:null},c.defaultFormat=function(t){f="string"==typeof t?t:"0.0"},c.defaultCurrencyFormat=function(t){"string"==typeof t?t:"0$"},c.validate=function(t,e){var i,n,r,o,s,a,l,h;if("string"!=typeof t&&(t+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{l=c.cultureData(e)}catch(t){l=c.cultureData(c.culture())}return r=l.currency.symbol,s=l.abbreviations,i=l.delimiters.decimal,n="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,(null===(h=t.match(/^[^\d]+/))||(t=t.substr(1),h[0]===r))&&((null===(h=t.match(/[^\d]+$/))||(t=t.slice(0,-1),h[0]===s.thousand||h[0]===s.million||h[0]===s.billion||h[0]===s.trillion))&&(a=new RegExp(n+"{2}"),!t.match(/[^\d.,]/g)&&!((o=t.split(i)).length>2||(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,i,n){null!=i&&i!==c.culture()&&c.setCulture(i);return s(Number(t),null!=e?e:f,null==n?Math.round:n)}}},function(t,e,i){function n(t,e){if(!(this instanceof n))return new n(t);e=e||function(t){if(t)throw t};var i=r(t);if("object"==typeof i){var s=n.projections.get(i.projName);if(s){if(i.datumCode&&"none"!==i.datumCode){var c=l[i.datumCode];c&&(i.datum_params=c.towgs84?c.towgs84.split(","):null,i.ellps=c.ellipse,i.datumName=c.datumName?c.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu";var u=a.sphere(i.a,i.b,i.rf,i.ellps,i.sphere),_=a.eccentricity(u.a,u.b,u.rf,i.R_A),p=i.datum||h(i.datumCode,i.datum_params,u.a,u.b,_.es,_.ep2);o(this,i),o(this,s),this.a=u.a,this.b=u.b,this.rf=u.rf,this.sphere=u.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(368),o=t(366),s=t(370),a=t(365),l=t(356),h=t(361);(n.projections=s).start(),e.exports=n},function(t,e,i){e.exports=function(t,e,i){var n,r,o,s=i.x,a=i.y,l=i.z||0,h={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==i.z)switch(0===o?(n=s,r="x"):1===o?(n=a,r="y"):(n=l,r="z"),t.axis[o]){case"e":h[r]=n;break;case"w":h[r]=-n;break;case"n":h[r]=n;break;case"s":h[r]=-n;break;case"u":void 0!==i[r]&&(h.z=n);break;case"d":void 0!==i[r]&&(h.z=-n);break;default:return null}return h}},function(t,e,i){var n=2*Math.PI,r=t(353);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*n}},function(t,e,i){e.exports=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)}},function(t,e,i){var n=Math.PI/2;e.exports=function(t,e){for(var i,r,o=.5*t,s=n-2*Math.atan(e),a=0;a<=15;a++)if(i=t*Math.sin(s),r=n-2*Math.atan(e*Math.pow((1-i)/(1+i),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,i){e.exports=function(t){return t<0?-1:1}},function(t,e,i){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,i){var n=Math.PI/2;e.exports=function(t,e,i){var r=t*i,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(n-e))/r}},function(t,e,i){i.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},i.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},i.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},i.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},i.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},i.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},i.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},i.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},i.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},i.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},i.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},i.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},i.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},i.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},i.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},i.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,i){i.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},i.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},i.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},i.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},i.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},i.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},i.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},i.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},i.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},i.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},i.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},i.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},i.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},i.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},i.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},i.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},i.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},i.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},i.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},i.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},i.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},i.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},i.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},i.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},i.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},i.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},i.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},i.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},i.hough={a:6378270,rf:297,ellipseName:"Hough"},i.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},i.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},i.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},i.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},i.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},i.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},i.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},i.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},i.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},i.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},i.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},i.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},i.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},i.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,i){i.greenwich=0,i.lisbon=-9.131906111111,i.paris=2.337229166667,i.bogota=-74.080916666667,i.madrid=-3.687938888889,i.rome=12.452333333333,i.bern=7.439583333333,i.jakarta=106.807719444444,i.ferro=-17.666666666667,i.brussels=4.367975,i.stockholm=18.058277777778,i.athens=23.7163375,i.oslo=10.722916666667},function(t,e,i){i.ft={to_meter:.3048},i["us-ft"]={to_meter:1200/3937}},function(t,e,i){function n(t,e,i){var n;return Array.isArray(i)?(n=s(t,e,i),3===i.length?[n.x,n.y,n.z]:[n.x,n.y]):s(t,e,i)}function r(t){return t instanceof o?t:t.oProj?t.oProj:o(t)}var o=t(348),s=t(373),a=o("WGS84");e.exports=function(t,e,i){t=r(t);var o,s=!1;void 0===e?(e=t,t=a,s=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=a,s=!0);return e=r(e),i?n(t,e,i):(o={forward:function(i){return n(t,e,i)},inverse:function(i){return n(e,t,i)}},s&&(o.oProj=e),o)}},function(t,e,i){var n=1,r=2,o=4,s=5,a=484813681109536e-20;e.exports=function(t,e,i,l,h,c){var u={};u.datum_type=o,t&&"none"===t&&(u.datum_type=s);e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=n),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=r,u.datum_params[3]*=a,u.datum_params[4]*=a,u.datum_params[5]*=a,u.datum_params[6]=u.datum_params[6]/1e6+1)));return u.a=i,u.b=l,u.es=h,u.ep2=c,u}},function(t,e,i){var n=Math.PI/2;i.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]))},i.geodeticToGeocentric=function(t,e,i){var r,o,s,a,l=t.x,h=t.y,c=t.z?t.z:0;if(h<-n&&h>-1.001*n)h=-n;else if(h>n&&h<1.001*n)h=n;else if(h<-n||h>n)return null;return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(h),a=Math.cos(h),s=o*o,r=i/Math.sqrt(1-e*s),{x:(r+c)*a*Math.cos(l),y:(r+c)*a*Math.sin(l),z:(r*(1-e)+c)*o}},i.geocentricToGeodetic=function(t,e,i,r){var o,s,a,l,h,c,u,_,p,d,f,v,m,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/i<1e-12){if(g=0,s/i<1e-12)return y=n,b=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(w,x);a=k/s,l=o/s,h=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*h,p=a*h,m=0;do{m++,u=i/Math.sqrt(1-e*p*p),c=e*u/(u+(b=o*_+k*p-u*(1-e*p*p))),h=1/Math.sqrt(1-c*(2-c)*l*l),v=(f=a*h)*_-(d=l*(1-c)*h)*p,_=d,p=f}while(v*v>1e-24&&m<30);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},i.geocentricToWgs84=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-s*t.z)+r,z:h*(-a*t.x+s*t.y+t.z)+o}}},i.geocentricFromWgs84=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,_=(t.z-o)/h;return{x:c+l*u-a*_,y:-l*c+u+s*_,z:a*c-s*u+_}}}},function(t,e,i){function n(t){return t===r||t===o}var r=1,o=2,s=t(362);e.exports=function(t,e,i){return s.compareDatums(t,e)?i:5===t.datum_type||5===e.datum_type?i:t.es!==e.es||t.a!==e.a||n(t.datum_type)||n(e.datum_type)?(i=s.geodeticToGeocentric(i,t.es,t.a),n(t.datum_type)&&(i=s.geocentricToWgs84(i,t.datum_type,t.datum_params)),n(e.datum_type)&&(i=s.geocentricFromWgs84(i,e.datum_type,e.datum_params)),s.geocentricToGeodetic(i,e.es,e.a,e.b)):i}},function(t,e,i){function n(t){var e=this;if(2===arguments.length){var i=arguments[1];n[t]="string"==typeof i?"+"===i.charAt(0)?o(arguments[1]):s(arguments[1]):i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if("string"==typeof t){if(t in n)return n[t]}else"EPSG"in t?n["EPSG:"+t.EPSG]=t:"ESRI"in t?n["ESRI:"+t.ESRI]=t:"IAU2000"in t?n["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var r=t(367),o=t(369),s=t(374);r(n),e.exports=n},function(t,e,i){var n=t(357);i.eccentricity=function(t,e,i,n){var r=t*t,o=e*e,s=(r-o)/r,a=0;n?(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}},i.sphere=function(t,e,i,r,o){if(!t){var s=n[r];s||(s=n.WGS84),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(0===i||Math.abs(t-e)<1e-10)&&(o=!0,e=t),{a:t,b:e,rf:i,sphere:o}}},function(t,e,i){e.exports=function(t,e){t=t||{};var i,n;if(!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t}},function(t,e,i){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,i){var n=t(364),r=t(374),o=t(369),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 n}(t))return n[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,i){var n=.017453292519943295,r=t(358),o=t(359);e.exports=function(t){var e,i,s,a={},l=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),h={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*n},lat_1:function(t){a.lat1=t*n},lat_2:function(t){a.lat2=t*n},lat_ts:function(t){a.lat_ts=t*n},lon_0:function(t){a.long0=t*n},lon_1:function(t){a.long1=t*n},lon_2:function(t){a.long2=t*n},alpha:function(t){a.alpha=parseFloat(t)*n},lonc:function(t){a.longc=t*n},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*n},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*n},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)i=l[e],e in h?"function"==typeof(s=h[e])?s(i):a[s]=i:a[e]=i;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,i){function n(t,e){var i=s.length;return t.names?(s[i]=t,t.names.forEach(function(t){o[t.toLowerCase()]=i}),this):(console.log(e),!0)}var r=[t(372),t(371)],o={},s=[];i.add=n,i.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==o[e]&&s[o[e]]?s[o[e]]:void 0},i.start=function(){r.forEach(n)}},function(t,e,i){function n(t){return t}i.init=function(){},i.forward=n,i.inverse=n,i.names=["longlat","identity"]},function(t,e,i){var n=t(351),r=Math.PI/2,o=57.29577951308232,s=t(350),a=Math.PI/4,l=t(355),h=t(352);i.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=n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},i.forward=function(t){var e=t.x,i=t.y;if(i*o>90&&i*o<-90&&e*o>180&&e*o<-180)return null;var n,h;if(Math.abs(Math.abs(i)-r)<=1e-10)return null;if(this.sphere)n=this.x0+this.a*this.k0*s(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*i));else{var c=Math.sin(i),u=l(this.e,i,c);n=this.x0+this.a*this.k0*s(e-this.long0),h=this.y0-this.a*this.k0*Math.log(u)}return t.x=n,t.y=h,t},i.inverse=function(t){var e,i,n=t.x-this.x0,o=t.y-this.y0;if(this.sphere)i=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(i=h(this.e,a)))return null}return e=s(this.long0+n/(this.a*this.k0)),t.x=e,t.y=i,t},i.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},function(t,e,i){var n=1,r=2,o=t(363),s=t(349),a=t(348),l=t(354);e.exports=function t(e,i,h){var c;return Array.isArray(h)&&(h=l(h)),e.datum&&i.datum&&function(t,e){return(t.datum.datum_type===n||t.datum.datum_type===r)&&"WGS84"!==e.datumCode||(e.datum.datum_type===n||e.datum.datum_type===r)&&"WGS84"!==t.datumCode}(e,i)&&(c=new a("WGS84"),h=t(e,c,h),e=c),"enu"!==e.axis&&(h=s(e,!1,h)),"longlat"===e.projName?h={x:.017453292519943295*h.x,y:.017453292519943295*h.y}:(e.to_meter&&(h={x:h.x*e.to_meter,y:h.y*e.to_meter}),h=e.inverse(h)),e.from_greenwich&&(h.x+=e.from_greenwich),h=o(e.datum,i.datum,h),i.from_greenwich&&(h={x:h.x-i.grom_greenwich,y:h.y}),"longlat"===i.projName?h={x:57.29577951308232*h.x,y:57.29577951308232*h.y}:(h=i.forward(h),i.to_meter&&(h={x:h.x/i.to_meter,y:h.y/i.to_meter})),"enu"!==i.axis?s(i,!0,h):h}},function(t,e,i){function n(t,e,i){t[e]=i.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return a(t,e)},{})}function r(t,e){var i;Array.isArray(t)?("PARAMETER"===(i=t.shift())&&(i=t.shift()),1===t.length?Array.isArray(t[0])?(e[i]={},r(t[0],e[i])):e[i]=t[0]:t.length?"TOWGS84"===i?e[i]=t:(e[i]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(i)>-1?(e[i]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[i].auth=t[2])):"SPHEROID"===i?(e[i]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[i].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(i)>-1?(t[0]=["name",t[0]],n(e,i,t)):t.every(function(t){return Array.isArray(t)})?n(e,i,t):r(t,e[i])):e[i]=!0):e[t]=!0}function o(t){return t*s}var s=.017453292519943295,a=t(366);e.exports=function(t,e){var i=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".+/,"")),n=i.shift(),s=i.shift();i.unshift(["name",s]),i.unshift(["type",n]),i.unshift("output");var l={};return r(i,l),function(t){function e(e){var i=t.to_meter||1;return parseFloat(e,10)*i}"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 i=e[0],n=e[1];!(i in t)&&n in t&&(t[i]=t[n],3===e.length&&(t[i]=e[2](t[i])))}(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,i){function n(t,e,i,o,s){for(i=i||0,o=o||t.length-1,s=s||function(t,e){return t<e?-1:t>e?1:0};o>i;){if(o-i>600){var a=o-i+1,l=e-i+1,h=Math.log(a),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(a-c)/a)*(l-a/2<0?-1:1),_=Math.max(i,Math.floor(e-l*c/a+u)),p=Math.min(o,Math.floor(e+(a-l)*c/a+u));n(t,e,_,p,s)}var d=t[e],f=i,v=o;for(r(t,i,e),s(t[o],d)>0&&r(t,i,o);f<v;){for(r(t,f,v),f++,v--;s(t[f],d)<0;)f++;for(;s(t[v],d)>0;)v--}0===s(t[i],d)?r(t,i,v):r(t,++v,o),v<=e&&(i=v+1),e<=v&&(o=v-1)}}function r(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}e.exports=n},function(t,e,i){function n(t,e){if(!(this instanceof n))return new n(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e){o(t,0,t.children.length,e,t)}function o(t,e,i,n,r){r||(r=p(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,a=e;a<i;a++)o=t.children[a],s(r,t.leaf?n(o):o);return r}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function a(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function _(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(t,e,i,n,r){for(var o,s=[e,i];s.length;)i=s.pop(),e=s.pop(),i-e<=n||(o=e+Math.ceil((i-e)/n/2)*n,f(t,o,e,i,r),s.push(e,o,o,i))}e.exports=n;var f=t(375);n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!_(t,e))return i;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],a=e.leaf?n(s):s,_(t,a)&&(e.leaf?i.push(s):u(t,a)?this._all(s,i):l.push(s));e=l.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!_(t,e))return!1;for(var n,r,o,s,a=[];e;){for(n=0,r=e.children.length;n<r;n++)if(o=e.children[n],s=e.leaf?i(o):o,_(t,s)){if(e.leaf||u(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=p([]),this},remove:function(t,e){if(!t)return this;for(var i,n,r,o,s=this.data,a=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),n=l[l.length-1],i=h.pop(),o=!0),s.leaf&&-1!==(r=function(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}(t,s.children,e)))return s.children.splice(r,1),l.push(s),this._condense(l),this;o||s.leaf||!u(s,a)?n?(i++,s=n.children[i],o=!1):s=null:(l.push(s),h.push(i),i=0,n=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:a,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var o,s=i-e+1,a=this._maxEntries;if(s<=a)return o=p(t.slice(e,i+1)),r(o,this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(o=p([])).leaf=!1,o.height=n;var l,h,c,u,_=Math.ceil(s/a),f=_*Math.ceil(Math.sqrt(a));for(d(t,e,i,f,this.compareMinX),l=e;l<=i;l+=f)for(c=Math.min(l+f-1,i),d(t,l,c,_,this.compareMinY),h=l;h<=c;h+=_)u=Math.min(h+_-1,c),o.children.push(this._build(t,h,u,n-1));return r(o,this.toBBox),o},_chooseSubtree:function(t,e,i,n){for(var r,o,s,a,l,c,u,_;n.push(e),!e.leaf&&n.length-1!==i;){for(u=_=1/0,r=0,o=e.children.length;r<o;r++)s=e.children[r],l=h(s),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-l)<_?(_=c,u=l<u?l:u,a=s):c===_&&l<u&&(u=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,r=i?t:n(t),o=[],a=this._chooseSubtree(r,this.data,e,o);for(a.children.push(t),s(a,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=p(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,s,a,l,c,u,_;for(c=u=1/0,n=e;n<=i-e;n++)r=o(t,0,n,this.toBBox),s=o(t,n,i,this.toBBox),a=function(t,e){var i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}(r,s),l=h(r)+h(s),a<c?(c=a,_=n,u=l<u?l:u):a===c&&l<u&&(u=l,_=n);return _},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:a,r=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,i,n),s=this._allDistMargin(t,e,i,r);o<s&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var r,a,l=this.toBBox,h=o(t,0,e,l),u=o(t,i-e,i,l),_=c(h)+c(u);for(r=e;r<i-e;r++)a=t.children[r],s(h,t.leaf?l(a):a),_+=c(h);for(r=i-e-1;r>=e;r--)a=t.children[r],s(u,t.leaf?l(a):a),_+=c(u);return _},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)s(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():r(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,i){!function(){"use strict";function t(e){return function(e,i){var r,o,s,a,l,h,c,u,_,p=1,d=e.length,f="";for(o=0;o<d;o++)if("string"==typeof e[o])f+=e[o];else if(Array.isArray(e[o])){if((a=e[o])[2])for(r=i[p],s=0;s<a[2].length;s++){if(!r.hasOwnProperty(a[2][s]))throw new Error(t('[sprintf] property "%s" does not exist',a[2][s]));r=r[a[2][s]]}else r=a[1]?i[a[1]]:i[p++];if(n.not_type.test(a[8])&&n.not_primitive.test(a[8])&&r instanceof Function&&(r=r()),n.numeric_arg.test(a[8])&&"number"!=typeof r&&isNaN(r))throw new TypeError(t("[sprintf] expecting number but found %T",r));switch(n.number.test(a[8])&&(u=r>=0),a[8]){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a[6]?parseInt(a[6]):0);break;case"e":r=a[7]?parseFloat(r).toExponential(a[7]):parseFloat(r).toExponential();break;case"f":r=a[7]?parseFloat(r).toFixed(a[7]):parseFloat(r);break;case"g":r=a[7]?String(Number(r.toPrecision(a[7]))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a[7]?r.substring(0,a[7]):r;break;case"t":r=String(!!r),r=a[7]?r.substring(0,a[7]):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a[7]?r.substring(0,a[7]):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a[7]?r.substring(0,a[7]):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}n.json.test(a[8])?f+=r:(!n.number.test(a[8])||u&&!a[3]?_="":(_=u?"+":"-",r=r.toString().replace(n.sign,"")),h=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",c=a[6]-(_+r).length,l=a[6]&&c>0?h.repeat(c):"",f+=a[5]?_+r+l:"0"===h?_+l+r:l+_+r)}return f}(function(t){if(r[t])return r[t];var e,i=t,o=[],s=0;for(;i;){if(null!==(e=n.text.exec(i)))o.push(e[0]);else if(null!==(e=n.modulo.exec(i)))o.push("%");else{if(null===(e=n.placeholder.exec(i)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){s|=1;var a=[],l=e[2],h=[];if(null===(h=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(h[1]);""!==(l=l.substring(h[0].length));)if(null!==(h=n.key_access.exec(l)))a.push(h[1]);else{if(null===(h=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(h[1])}e[2]=a}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push(e)}i=i.substring(e[0].length)}return r[t]=o}(e),arguments)}function e(e,i){return t.apply(null,[e].concat(i||[]))}var n={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},r=Object.create(null);void 0!==i&&(i.sprintf=t,i.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},function(t,e,i){!function(t){"object"==typeof e&&e.exports?e.exports=t():this.tz=t()}(function(){function t(t,e,i){var n,r=e.day[1];do{n=new Date(Date.UTC(i,e.month,Math.abs(r++)))}while(e.day[0]<7&&n.getUTCDay()!=e.day[0]);return n={clock:e.clock,sort:n.getTime(),rule:e,save:6e4*e.save,offset:t.offset},n[n.clock]=n.sort+6e4*e.time,n.posix?n.wallclock=n[n.clock]+(t.offset+e.saved):n.posix=n[n.clock]-(t.offset+e.saved),n}function e(e,i,n){var r,o,s,a,l,h,c,u=e[e.zone],_=[],p=new Date(n).getUTCFullYear(),d=1;for(r=1,o=u.length;r<o&&!(u[r][i]<=n);r++);if((s=u[r]).rules){for(h=e[s.rules],c=p+1;c>=p-d;--c)for(r=0,o=h.length;r<o;r++)h[r].from<=c&&c<=h[r].to?_.push(t(s,h[r],c)):h[r].to<c&&1==d&&(d=c-h[r].to);for(_.sort(function(t,e){return t.sort-e.sort}),r=0,o=_.length;r<o;r++)n>=_[r][i]&&_[r][_[r].clock]>s[_[r].clock]&&(a=_[r])}return a&&((l=/^(.*)\/(.*)$/.exec(s.format))?a.abbrev=l[a.save?2:1]:a.abbrev=s.format.replace(/%s/,a.rule.letter)),a||s}function i(t,i){return"UTC"==t.zone?i:(t.entry=e(t,"posix",i),i+t.entry.offset+t.entry.save)}function n(t,i){if("UTC"==t.zone)return i;var n,r;return t.entry=n=e(t,"wallclock",i),0<(r=i-n.wallclock)&&r<n.save?null:i-n.offset-n.save}function r(t,e,r){var o,s=+(r[1]+1),a=r[2]*s,h=l.indexOf(r[3].toLowerCase());if(h>9)e+=a*c[h-10];else{if(o=new Date(i(t,e)),h<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==h&&(a-=s);else 7==h?o.setUTCFullYear(o.getUTCFullYear()+a):8==h?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=n(t,o.getTime()))&&(e=n(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t,e){var i,n,r;return n=new Date(Date.UTC(t.getUTCFullYear(),0)),i=Math.floor((t.getTime()-n.getTime())/864e5),n.getUTCDay()==e?r=0:8==(r=7-n.getUTCDay()+e)&&(r=1),i>=r?Math.floor((i-r)/7)+1:0}function s(t){var e,i,n;return i=t.getUTCFullYear(),e=new Date(Date.UTC(i,0)).getUTCDay(),(n=o(t,1)+(e>1&&e<=4?1:0))?53!=n||4==e||3==e&&29==new Date(i,1,29).getDate()?[n,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(i=t.getUTCFullYear()-1,e=new Date(Date.UTC(i,0)).getUTCDay(),n=4==e||3==e&&29==new Date(i,1,29).getDate()?53:52,[n,t.getUTCFullYear()-1])}var a={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(t,e,i,n){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],h=3600;for(r=0;r<3;r++)l.push(("0"+Math.floor(a/h)).slice(-2)),a%=h,h/=60;return"^"!=i||s?("^"==i&&(n=3),3==n?(o=(o=l.join(":")).replace(/:00$/,""),"^"!=i&&(o=o.replace(/:00$/,""))):n?(o=l.slice(0,n+1).join(":"),"^"==i&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(s<0?"-":"+")+o,o=o.replace(/([-+])(0)/,{_:" $1","-":"$1"}[i]||"$1$2")):"Z"},"%":function(t){return"%"},n:function(t){return"\n"},t:function(t){return"\t"},U:function(t){return o(t,0)},W:function(t){return o(t,1)},V:function(t){return s(t)[0]},G:function(t){return s(t)[1]},g:function(t){return s(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return t.getTime()%1e3*1e6},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(t){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,"%H:%M"])},T:function(t,e){return this.convert([e,"%H:%M:%S"])},D:function(t,e){return this.convert([e,"%m/%d/%y"])},F:function(t,e){return this.convert([e,"%Y-%m-%d"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||"%I:%M:%S"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:function(t){if(!t.length)return"1.0.13";var e,o,s,a,l,c=Object.create(this),u=[];for(e=0;e<t.length;e++)if(a=t[e],Array.isArray(a))e||isNaN(a[1])?a.splice.apply(t,[e--,1].concat(a)):l=a;else if(isNaN(a)){if("string"==(s=typeof a))~a.indexOf("%")?c.format=a:e||"*"!=a?!e&&(s=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(a))?((l=[]).push.apply(l,s.slice(1,8)),s[9]?(l.push(s[10]+1),l.push.apply(l,s[11].split(/:/))):s[8]&&l.push(1)):/^\w{2,3}_\w{2}$/.test(a)?c.locale=a:(s=h.exec(a))?u.push(s):c.zone=a:l=a;else if("function"==s){if(s=a.call(c))return s}else if(/^\w{2,3}_\w{2}$/.test(a.name))c[a.name]=a;else if(a.zones){for(s in a.zones)c[s]=a.zones[s];for(s in a.rules)c[s]=a.rules[s]}}else e||(l=a);c[c.locale]||delete c.locale;c[c.zone]||delete c.zone;if(null!=l){if("*"==l)l=c.clock();else if(Array.isArray(l)){for(s=[],o=!l[7],e=0;e<11;e++)s[e]=+(l[e]||0);--s[1],l=Date.UTC.apply(Date.UTC,s)+-s[7]*(36e5*s[8]+6e4*s[9]+1e3*s[10])}else l=Math.floor(l);if(!isNaN(l)){if(o&&(l=n(c,l)),null==l)return l;for(e=0,o=u.length;e<o;e++)l=r(c,l,u[e]);return c.format?(s=new Date(i(c,l)),c.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,function(t,e,i,n,r){var o,a,h="0";if(o=c[r]){for(t=String(o.call(c,s,l,e,i.length)),"_"==(e||o.style)&&(h=" "),a="-"==e?0:o.pad||0;t.length<a;)t=h+t;for(a="-"==e?0:n||o.pad;t.length<a;)t=h+t;"N"==r&&a<t.length&&(t=t.slice(0,a)),"^"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return c.convert(arguments)}},locale:"en_US",en_US:{date:"%m/%d/%Y",time24:"%I:%M:%S %p",time12:"%I:%M:%S %p",dateTime:"%a %d %b %Y %I:%M:%S %p %Z",meridiem:["AM","PM"],month:{abbrev:"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|"),full:"January|February|March|April|May|June|July|August|September|October|November|December".split("|")},day:{abbrev:"Sun|Mon|Tue|Wed|Thu|Fri|Sat".split("|"),full:"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|")}}},l="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",h=new RegExp("^\\s*([+-])(\\d+)\\s+("+l+")s?\\s*$","i"),c=[36e5,6e4,1e3,1];return l=l.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,function(t){a[t].pad=2}),a.N.pad=9,a.j.pad=3,a.k.style="_",a.l.style="_",a.e.style="_",function(){return a.convert(arguments)}})},/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function(t,e,i){var n,r,o,s,a,l,h,c,u,_,p,d,f,v,m,g,y;!function(t){function i(t,e){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(i,n){return t[i]=e?e(i,n):n}}var n="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};"object"==typeof e&&"object"==typeof e.exports?t(i(n,i(e.exports))):t(i(n))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};n=function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)},r=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&(i[n[r]]=t[n[r]]);return i},s=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},a=function(t,e){return function(i,n){e(i,n,t)}},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}l((n=n.apply(t,e||[])).next())})},c=function(t,e){function i(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}var n,r,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},u=function(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])},_=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},p=function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},d=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t},f=function(t){return this instanceof f?(this.v=t,this):new f(t)},v=function(t,e,i){function n(t){h[t]&&(l[t]=function(e){return new Promise(function(i,n){c.push([t,e,i,n])>1||r(t,e)})})}function r(t,e){try{!function(t){t.value instanceof f?Promise.resolve(t.value.v).then(o,s):a(c[0][2],t)}(h[t](e))}catch(t){a(c[0][3],t)}}function o(t){r("next",t)}function s(t){r("throw",t)}function a(t,e){t(e),c.shift(),c.length&&r(c[0][0],c[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,h=i.apply(t,e||[]),c=[];return l={},n("next"),n("throw"),n("return"),l[Symbol.asyncIterator]=function(){return this},l},m=function(t){function e(e,r){t[e]&&(i[e]=function(i){return(n=!n)?{value:f(t[e](i)),done:"return"===e}:r?r(i):i})}var i,n;return i={},e("next"),e("throw",function(t){throw t}),e("return"),i[Symbol.iterator]=function(){return this},i},g=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof _?_(t):t[Symbol.iterator]()},y=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},t("__extends",n),t("__assign",r),t("__rest",o),t("__decorate",s),t("__param",a),t("__metadata",l),t("__awaiter",h),t("__generator",c),t("__exportStar",u),t("__values",_),t("__read",p),t("__spread",d),t("__await",f),t("__asyncGenerator",v),t("__asyncDelegator",m),t("__asyncValues",g),t("__makeTemplateObject",y)})}],{base:0,"client/connection":1,"client/session":2,"core/bokeh_events":3,"core/build_views":4,"core/dom":5,"core/dom_view":6,"core/enums":7,"core/has_props":8,"core/hittest":9,"core/layout/alignments":10,"core/layout/layout_canvas":11,"core/layout/side_panel":12,"core/layout/solver":13,"core/logging":14,"core/properties":15,"core/property_mixins":16,"core/selection_manager":17,"core/settings":18,"core/signaling":19,"core/ui_events":20,"core/util/array":21,"core/util/arrayable":22,"core/util/assert":23,"core/util/bbox":24,"core/util/callback":25,"core/util/canvas":26,"core/util/color":27,"core/util/compat":28,"core/util/data_structures":29,"core/util/eq":30,"core/util/math":31,"core/util/object":32,"core/util/projections":33,"core/util/refs":34,"core/util/selection":35,"core/util/serialization":36,"core/util/spatial":37,"core/util/string":38,"core/util/svg_colors":39,"core/util/templating":40,"core/util/text":41,"core/util/throttle":42,"core/util/typed_array":43,"core/util/types":44,"core/util/wheel":45,"core/util/zoom":46,"core/vectorization":47,"core/view":48,"core/visuals":49,document:50,embed:51,main:52,model:53,"models/annotations/annotation":54,"models/annotations/arrow":55,"models/annotations/arrow_head":56,"models/annotations/band":57,"models/annotations/box_annotation":58,"models/annotations/color_bar":59,"models/annotations/index":60,"models/annotations/label":61,"models/annotations/label_set":62,"models/annotations/legend":63,"models/annotations/legend_item":64,"models/annotations/poly_annotation":65,"models/annotations/span":66,"models/annotations/text_annotation":67,"models/annotations/title":68,"models/annotations/toolbar_panel":69,"models/annotations/tooltip":70,"models/annotations/whisker":71,"models/axes/axis":72,"models/axes/categorical_axis":73,"models/axes/continuous_axis":74,"models/axes/datetime_axis":75,"models/axes/index":76,"models/axes/linear_axis":77,"models/axes/log_axis":78,"models/axes/mercator_axis":79,"models/callbacks/callback":80,"models/callbacks/customjs":81,"models/callbacks/index":82,"models/callbacks/open_url":83,"models/canvas/canvas":84,"models/canvas/cartesian_frame":85,"models/canvas/index":86,"models/expressions/expression":87,"models/expressions/index":88,"models/expressions/stack":89,"models/filters/boolean_filter":90,"models/filters/customjs_filter":91,"models/filters/filter":92,"models/filters/group_filter":93,"models/filters/index":94,"models/filters/index_filter":95,"models/formatters/basic_tick_formatter":96,"models/formatters/categorical_tick_formatter":97,"models/formatters/datetime_tick_formatter":98,"models/formatters/func_tick_formatter":99,"models/formatters/index":100,"models/formatters/log_tick_formatter":101,"models/formatters/mercator_tick_formatter":102,"models/formatters/numeral_tick_formatter":103,"models/formatters/printf_tick_formatter":104,"models/formatters/tick_formatter":105,"models/glyphs/annular_wedge":106,"models/glyphs/annulus":107,"models/glyphs/arc":108,"models/glyphs/bezier":109,"models/glyphs/box":110,"models/glyphs/circle":111,"models/glyphs/ellipse":112,"models/glyphs/glyph":113,"models/glyphs/hbar":114,"models/glyphs/hex_tile":115,"models/glyphs/image":116,"models/glyphs/image_rgba":117,"models/glyphs/image_url":118,"models/glyphs/index":119,"models/glyphs/line":120,"models/glyphs/multi_line":121,"models/glyphs/oval":122,"models/glyphs/patch":123,"models/glyphs/patches":124,"models/glyphs/quad":125,"models/glyphs/quadratic":126,"models/glyphs/ray":127,"models/glyphs/rect":128,"models/glyphs/segment":129,"models/glyphs/step":130,"models/glyphs/text":131,"models/glyphs/utils":132,"models/glyphs/vbar":133,"models/glyphs/wedge":134,"models/glyphs/xy_glyph":135,"models/graphs/graph_hit_test_policy":136,"models/graphs/index":137,"models/graphs/layout_provider":138,"models/graphs/static_layout_provider":139,"models/grids/grid":140,"models/grids/index":141,"models/index":142,"models/layouts/box":143,"models/layouts/column":144,"models/layouts/index":145,"models/layouts/layout_dom":146,"models/layouts/row":147,"models/layouts/spacer":148,"models/layouts/widget_box":149,"models/mappers/categorical_color_mapper":150,"models/mappers/color_mapper":151,"models/mappers/continuous_color_mapper":152,"models/mappers/index":153,"models/mappers/linear_color_mapper":154,"models/mappers/log_color_mapper":155,"models/markers/index":156,"models/markers/marker":157,"models/plots/gmap_plot":158,"models/plots/gmap_plot_canvas":159,"models/plots/index":160,"models/plots/plot":161,"models/plots/plot_canvas":162,"models/ranges/data_range":163,"models/ranges/data_range1d":164,"models/ranges/factor_range":165,"models/ranges/index":166,"models/ranges/range":167,"models/ranges/range1d":168,"models/renderers/glyph_renderer":169,"models/renderers/graph_renderer":170,"models/renderers/guide_renderer":171,"models/renderers/index":172,"models/renderers/renderer":173,"models/scales/categorical_scale":174,"models/scales/index":175,"models/scales/linear_scale":176,"models/scales/log_scale":177,"models/scales/scale":178,"models/selections/index":179,"models/selections/interaction_policy":180,"models/selections/selection":181,"models/sources/ajax_data_source":182,"models/sources/cds_view":183,"models/sources/column_data_source":184,"models/sources/columnar_data_source":185,"models/sources/data_source":186,"models/sources/geojson_data_source":187,"models/sources/index":188,"models/sources/remote_data_source":189,"models/tickers/adaptive_ticker":190,"models/tickers/basic_ticker":191,"models/tickers/categorical_ticker":192,"models/tickers/composite_ticker":193,"models/tickers/continuous_ticker":194,"models/tickers/datetime_ticker":195,"models/tickers/days_ticker":196,"models/tickers/fixed_ticker":197,"models/tickers/index":198,"models/tickers/log_ticker":199,"models/tickers/mercator_ticker":200,"models/tickers/months_ticker":201,"models/tickers/single_interval_ticker":202,"models/tickers/ticker":203,"models/tickers/util":204,"models/tickers/years_ticker":205,"models/tiles/bbox_tile_source":206,"models/tiles/image_pool":207,"models/tiles/index":208,"models/tiles/mercator_tile_source":209,"models/tiles/quadkey_tile_source":210,"models/tiles/tile_renderer":211,"models/tiles/tile_source":212,"models/tiles/tile_utils":213,"models/tiles/tms_tile_source":214,"models/tiles/wmts_tile_source":215,"models/tools/actions/action_tool":216,"models/tools/actions/help_tool":217,"models/tools/actions/redo_tool":218,"models/tools/actions/reset_tool":219,"models/tools/actions/save_tool":220,"models/tools/actions/undo_tool":221,"models/tools/actions/zoom_in_tool":222,"models/tools/actions/zoom_out_tool":223,"models/tools/button_tool":224,"models/tools/edit/box_edit_tool":225,"models/tools/edit/edit_tool":226,"models/tools/edit/point_draw_tool":227,"models/tools/edit/poly_draw_tool":228,"models/tools/edit/poly_edit_tool":229,"models/tools/gestures/box_select_tool":230,"models/tools/gestures/box_zoom_tool":231,"models/tools/gestures/gesture_tool":232,"models/tools/gestures/lasso_select_tool":233,"models/tools/gestures/pan_tool":234,"models/tools/gestures/poly_select_tool":235,"models/tools/gestures/select_tool":236,"models/tools/gestures/tap_tool":237,"models/tools/gestures/wheel_pan_tool":238,"models/tools/gestures/wheel_zoom_tool":239,"models/tools/index":240,"models/tools/inspectors/crosshair_tool":241,"models/tools/inspectors/hover_tool":242,"models/tools/inspectors/inspect_tool":243,"models/tools/on_off_button":244,"models/tools/tool":245,"models/tools/tool_proxy":246,"models/tools/toolbar":247,"models/tools/toolbar_base":248,"models/tools/toolbar_box":249,"models/transforms/customjs_transform":250,"models/transforms/dodge":251,"models/transforms/index":252,"models/transforms/interpolator":253,"models/transforms/jitter":254,"models/transforms/linear_interpolator":255,"models/transforms/step_interpolator":256,"models/transforms/transform":257,polyfill:258,"protocol/index":259,"protocol/message":260,"protocol/receiver":261,safely:262,version:263})}(this);/*!
Copyright (c) 2012, Anaconda, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

Neither the name of Anaconda nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*/

//# sourceMappingURL=bokeh.min.js.map
