{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Installation check\n", "\n", "This workbook has a simple example of a model fit with PyMC3. If everything runs here then it should work fine in the workshop.\n", "\n", "First, check that you have the right kernel. It should say \"bayes\" in the top right next to the circle. If it doesn't say \"bayes\", then go to the kernel menu and the \"Change kernel\" sub-menu. Select \"bayes\" from that menu. If you still don't see \"bayes\" listed, close the notebook in the browser and command line, open a new terminal and run . Try to open jupyter again. Contact me if it still doesn't work.\n", "\n", "Use to run each cell or select `Run all` from the cell menu. It will take a couple of minutes for everything to run. \n", "\n", "When the notebook is running there will be a [*] next to In by each cell. If the brackets are empty e.g. In [] then an error has occurred at some point in the notebook. The plot at the bottom will load if everything runs successfully." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id !== undefined) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var element_id = msg.content.text.trim();\n", " Bokeh.index[element_id].model.document.clear();\n", " delete Bokeh.index[element_id];\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[0].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[0].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[0]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"
    \\n\"+\n", " \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n", " \"
  • use INLINE resources instead, as so:
  • \\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(null);\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };\n", "\n", " var js_urls = [];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " /* BEGIN bokeh.min.js */\n", " !function(t,e){t.Bokeh=function(t,e,n){var i={},r=function(n){var o=null!=e[n]?e[n]:n;if(!i[o]){if(!t[o]){var s=new Error(\"Cannot find module '\"+n+\"'\");throw s.code=\"MODULE_NOT_FOUND\",s}var a=i[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return i[o].exports},o=r(49);return o.require=r,o.register_plugin=function(n,i,s){for(var a in n)t[a]=n[a];for(var a in i)e[a]=i[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,n){var i=t(135),r=t(30);n.overrides={};var o=r.clone(i);n.Models=function(t){var e=n.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},n.Models.register=function(t,e){n.overrides[t]=e},n.Models.unregister=function(t){delete n.overrides[t]},n.Models.register_models=function(t,e,n){if(void 0===e&&(e=!1),null!=t)for(var i in t){var r=t[i];e||!o.hasOwnProperty(i)?o[i]=r:null!=n?n(i):console.warn(\"Model '\"+i+\"' was already registered\")}},n.register_models=n.Models.register_models,n.Models.registered_names=function(){return Object.keys(o)},n.index={}},function(t,e,n){var i=t(302),r=t(14),o=t(47),s=t(245),a=t(246),l=t(2);n.DEFAULT_SERVER_WEBSOCKET_URL=\"ws://localhost:5006/ws\",n.DEFAULT_SESSION_ID=\"default\";var u=0,h=function(){function t(t,e,i,o,s){void 0===t&&(t=n.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=n.DEFAULT_SESSION_ID),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=i,this._on_have_session_hook=o,this._on_closed_permanently_hook=s,this._number=u++,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 i.Promise.reject(new Error(\"Cannot connect() a closed ClientConnection\"));if(null!=this.socket)return i.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 i.Promise(function(e,n){t.socket.binaryType=\"arraybuffer\",t.socket.onopen=function(){return t._on_open(e,n)},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(n)}})}catch(t){return r.logger.error(\"websocket creation failed to url: \"+this.url),r.logger.error(\" - \"+t),i.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,n=new i.Promise(function(n,i){e._pending_replies[t.msgid()]=[n,i],e.send(t)});return n.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 n=o.Document.from_json(e),i=o.Document._compute_patch_since_json(e,n);if(i.events.length>0){r.logger.debug(\"Sending \"+i.events.length+\" changes from model construction back to server\");var a=s.Message.create(\"PATCH-DOC\",{},i);t.send(a)}t.session=new l.ClientSession(t,n,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 n=this;r.logger.info(\"Websocket connection \"+this._number+\" is now open\"),this._pending_ack=[t,e],this._current_handler=function(t){n._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,n=e.problem();null!=n&&this._close_bad_protocol(n),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 n=function(){for(var t in e._pending_replies){var n=e._pending_replies[t];return delete e._pending_replies[t],n}return null},i=n();null!=i;)i[1](\"Disconnected\"),i=n();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}();n.ClientConnection=h,n.pull_session=function(t,e,n){var o;return new i.Promise(function(i,s){return(o=new h(t,e,n,function(t){try{i(t)}catch(e){throw r.logger.error(\"Promise handler threw an error, closing session \"+e),t.close(),e}},function(){s(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,n){var i=t(14),r=t(47),o=t(245),s=function(){function t(t,e,n){var i=this;this._connection=t,this.document=e,this.id=n,this._document_listener=function(t){return i._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):i.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){i.logger.trace(\"Unhandled OK reply to \"+t.reqid())},t.prototype._handle_error=function(t){i.logger.error(\"Unhandled ERROR reply to \"+t.reqid()+\": \"+t.content.text)},t}();n.ClientSession=s},function(t,e,n){function i(t){return function(e){e.prototype.event_name=t,a[t]=e}}var r=t(364),o=t(14),s=t(30),a={};n.register_event_class=i,n.register_with_event=function(t){for(var e=[],n=1;n0&&(this._pending=!0);for(var u=0;u1?r(t.x,t.y,n.x,n.y):r(t.x,t.y,e.x+o*(n.x-e.x),e.y+o*(n.y-e.y))}var s=t(22),a=t(30);n.point_in_poly=function(t,e,n,i){for(var r=!1,o=n[n.length-1],s=i[i.length-1],a=0;ai&&(s=[i,n],n=s[0],i=s[1]);r>o&&(a=[o,r],r=a[0],o=a[1]);return{minX:n,minY:r,maxX:i,maxY:o};var s,a},n.dist_2_pts=r,n.dist_to_segment_squared=o,n.dist_to_segment=function(t,e,n){return Math.sqrt(o(t,e,n))},n.check_2_segments_intersect=function(t,e,n,i,r,o,s,a){var l=(a-o)*(n-t)-(s-r)*(i-e);if(0==l)return{hit:!1,x:null,y:null};var u=e-o,h=t-r,c=(s-r)*u-(a-o)*h,_=(n-t)*u-(i-e)*h;h=_/l;var p=t+(u=c/l)*(n-t),d=e+u*(i-e);return{hit:u>0&&u<1&&h>0&&h<1,x:p,y:d}}},function(t,e,n){var i=t(13),r=t(22);n.vstack=function(t,e){var n=[];if(e.length>0){n.push(i.EQ(r.head(e)._bottom,[-1,t._bottom])),n.push(i.EQ(r.tail(e)._top,[-1,t._top])),n.push.apply(n,r.pairwise(e,function(t,e){return i.EQ(t._top,[-1,e._bottom])}));for(var o=0,s=e;o0){n.push(i.EQ(r.head(e)._right,[-1,t._right])),n.push(i.EQ(r.tail(e)._left,[-1,t._left])),n.push.apply(n,r.pairwise(e,function(t,e){return i.EQ(t._left,[-1,e._right])}));for(var o=0,s=e;o0&&(i=\"middle\",n=l[r]),t.textBaseline=i,t.textAlign=n,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,u[e][t]},e}(d.LayoutCanvas);n.SidePanel=g,g.prototype.type=\"SidePanel\",g.internal({side:[f.String]}),g.getters({is_horizontal:function(){return\"above\"===this.side||\"below\"===this.side},is_vertical:function(){return\"left\"===this.side||\"right\"===this.side}})},function(t,e,n){function i(t){return function(){for(var e=[],n=0;n0){var i=r[e];return null==i&&(r[e]=i=new t(e,n)),i}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(!i.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 n=\"[\"+this._name+\"]\";for(var r in t.log_levels){var s=t.log_levels[r];s.level0)&&\"pinch\"===i?(o.logger.debug(\"Registering scroll on touch screen\"),u.connect(this.scroll,function(t){if(t.id===s)return u._scroll(t.e)})):void 0}o.logger.debug(\"Button tool: \"+l)}else for(r=0,a=i.length;r=0;n+=-1)if(o=i[n],(\"annotation\"===(r=o.model.level)||\"overlay\"===r)&&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){var n,i,r,o,s,a,u,h,c,_,p;switch(a=t.name,o=a.split(\":\")[0],p=this._hit_test_renderers(e.bokeh.sx,e.bokeh.sy),o){case\"move\":for(i=this.toolbar.inspectors.filter(function(t){return t.active}),s=\"default\",null!=p?(null!=p.model.cursor&&(s=p.model.cursor()),l.isEmpty(i)||(t=this.move_exit,a=t.name)):this._hit_test_frame(e.bokeh.sx,e.bokeh.sy)&&(l.isEmpty(i)||(s=\"crosshair\")),this.plot_view.set_cursor(s),_=[],u=0,c=i.length;u0?\"pinch\":\"scroll\",null!=(n=this.toolbar.gestures[r].active))return e.preventDefault(),e.stopPropagation(),this.trigger(t,e,n.id);break;default:if(null!=(n=this.toolbar.gestures[o].active))return this.trigger(t,e,n.id)}},t.prototype.trigger=function(t,e,n){return void 0===n&&(n=null),t.emit({id:n,e:e})},t.prototype._event_sxy=function(t){var e,n;return i=s.offset(this.hit_area),e=i.left,n=i.top,{sx:t.pageX-e,sy:t.pageY-n};var i},t.prototype._bokify_hammer=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t.srcEvent),e),null!=(n=u.BokehEvent.event_class(t))?this.plot.trigger_event(n.from_event(t)):o.logger.debug(\"Unhandled event of type \"+t.type)},t.prototype._bokify_point_event=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t),e),null!=(n=u.BokehEvent.event_class(t))?this.plot.trigger_event(n.from_event(t)):o.logger.debug(\"Unhandled event of type \"+t.type)},t.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger(this.tap,t)},t.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger(this.doubletap,t)},t.prototype._press=function(t){return this._bokify_hammer(t),this._trigger(this.press,t)},t.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger(this.pan_start,t)},t.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger(this.pan,t)},t.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger(this.pan_end,t)},t.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_start,t)},t.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger(this.pinch,t)},t.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_end,t)},t.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_start,t)},t.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger(this.rotate,t)},t.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_end,t)},t.prototype._mouse_enter=function(t){return this._bokify_point_event(t),this._trigger(this.move_enter,t)},t.prototype._mouse_move=function(t){return this._bokify_point_event(t),this._trigger(this.move,t)},t.prototype._mouse_exit=function(t){return this._bokify_point_event(t),this._trigger(this.move_exit,t)},t.prototype._mouse_wheel=function(t){return this._bokify_point_event(t,{delta:a.getDeltaY(t)}),this._trigger(this.scroll,t)},t.prototype._key_down=function(t){return this.trigger(this.keydown,t)},t.prototype._key_up=function(t){return this.trigger(this.keyup,t)},t}()},function(t,e,n){function i(t){return(e=[]).concat.apply(e,t);var e}function r(t,e){return-1!==t.indexOf(e)}function o(t,e,n){void 0===n&&(n=1),null==e&&(e=t,t=0);for(var i=Math.max(Math.ceil((e-t)/n),0),r=Array(i),o=0;oi&&(n=s,i=a)}return n}function l(t){return function(e,n){for(var i=e.length,r=t>0?0:i-1;r>=0&&r=0?e:t.length+e]},n.zip=function(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),r=0;rn&&(n=e);return n},n.maxBy=a,n.argmin=function(t){return s(o(t.length),function(e){return t[e]})},n.argmax=function(t){return a(o(t.length),function(e){return t[e]})},n.all=function(t,e){for(var n=0,i=t;ni||void 0===n)return 1;if(n=0&&h>=0))throw new Error(\"invalid bbox {x: \"+a+\", y: \"+l+\", width: \"+u+\", height: \"+h+\"}\");this.x0=a,this.y0=l,this.x1=a+u,this.y1=l+h}}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 tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:i(this.x0,e.x0),y0:i(this.y0,e.y0),x1:r(this.x1,e.x1),y1:r(this.y1,e.y1)})},t}();n.BBox=o},function(t,e,n){n.delay=function(t,e){return setTimeout(t,e)};var i=\"function\"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;n.defer=function(t){return i(t)},n.throttle=function(t,e,n){void 0===n&&(n={});var i,r,o,s=null,a=0,l=function(){a=!1===n.leading?0:Date.now(),s=null,o=t.apply(i,r),s||(i=r=null)};return function(){var u=Date.now();a||!1!==n.leading||(a=u);var h=e-(u-a);return i=this,r=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=u,o=t.apply(i,r),s||(i=r=null)):s||!1===n.trailing||(s=setTimeout(l,h)),o}},n.once=function(t){var e,n=!1;return function(){return n||(n=!0,e=t()),e}}},function(t,e,n){n.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 n=t.html5MeasureText(e);return n.ascent=1.6*t.html5MeasureText(\"m\").width,n})}(t),function(t){t.ellipse||(t.ellipse=function(e,n,i,r,o,s,a,l){void 0===l&&(l=!1);t.translate(e,n),t.rotate(o);var u=i,h=r;l&&(u=-i,h=-r);t.moveTo(-u,0),t.bezierCurveTo(-u,.551784*h,.551784*-u,h,0,h),t.bezierCurveTo(.551784*u,h,u,.551784*h,u,0),t.bezierCurveTo(u,.551784*-h,.551784*u,-h,0,-h),t.bezierCurveTo(.551784*-u,-h,-u,.551784*-h,-u,0),t.rotate(-o),t.translate(-e,-n)})}(t)},n.get_scale_ratio=function(t,e,n){if(\"svg\"==n)return 1;if(e){var i=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/r}return 1}},function(t,e,n){var i,r=[].indexOf,o=t(38);i=function(t){var e;return e=Number(t).toString(16),e=1===e.length?\"0\"+e:e},n.color2hex=function(t){var e,n,r;return 0===(t+=\"\").indexOf(\"#\")?t:null!=o[t]?o[t]:0===t.indexOf(\"rgb\")?(n=t.replace(/^rgba?\\(|\\s+|\\)$/g,\"\").split(\",\"),e=function(){var t,e,o,s;for(o=n.slice(0,3),s=[],t=0,e=o.length;t=0)throw new Error(\"color expects rgb to have value between 0 and 255\");return!0}},function(t,e,n){var i=t(22),r=t(28),o=t(42),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 n=this._existing(t);null==n?this._dict[t]=e:o.isArray(n)?n.push(e):this._dict[t]=[n,e]},t.prototype.remove_value=function(t,e){var n=this._existing(t);if(o.isArray(n)){var s=i.difference(n,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(n,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var n=this._existing(t);if(o.isArray(n)){if(1===n.length)return n[0];throw new Error(e)}return n},t}();n.MultiDict=s;var a=function(){function t(e){this.values=null==e?[]:e instanceof t?i.copy(e.values):this._compact(e)}return t.prototype._compact=function(t){for(var e=[],n=0,i=t;n2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(i(t-e))}function o(){return Math.random()}n.angle_norm=i,n.angle_dist=r,n.angle_between=function(t,e,n,o){var s=i(t),a=r(e,n),l=r(e,s)<=a&&r(s,n)<=a;return\"anticlock\"==o?l:!l},n.random=o,n.randomIn=function(t,e){null==e&&(e=t,t=0);return t+Math.floor(Math.random()*(e-t+1))},n.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},n.rnorm=function(t,e){var n,i;for(;n=o(),i=o(),i=(2*i-1)*Math.sqrt(1/Math.E*2),!(-4*n*n*Math.log(n)>=i*i););var r=i/n;return r=t+e*r},n.clamp=function(t,e,n){return t>n?n:ti[e][0]&&t0?e[\"1d\"].indices:e[\"2d\"].indices.length>0?e[\"2d\"].indices:[]}},function(t,e,n){var i,r,o,s,a,l,u=t(42);n.ARRAY_TYPES={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},n.DTYPES={};for(a in n.ARRAY_TYPES)l=n.ARRAY_TYPES[a],n.DTYPES[l.name]=a;r=new ArrayBuffer(2),s=new Uint8Array(r),o=new Uint16Array(r),s[0]=170,s[1]=187,i=48042===o[0]?\"little\":\"big\",n.BYTE_ORDER=i,n.swap16=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,2*t.length),e=n=0,i=o.length;ns;i=0<=s?++r:--r)n[i]=e.charCodeAt(i);return n.buffer},n.decode_base64=function(t){var e,i,r,o;return i=n.base64ToArrayBuffer(t.__ndarray__),(r=t.dtype)in n.ARRAY_TYPES&&(e=new n.ARRAY_TYPES[r](i)),o=t.shape,[e,o]},n.encode_base64=function(t,e){var i,r;return i=n.arrayBufferToBase64(t.buffer),r=n.DTYPES[t.constructor.name],{__ndarray__:i,shape:e,dtype:r}},n.decode_column_data=function(t,e){var i,r,o,s,h,c,_,p,d;h={},c={};for(a in t)if(l=t[a],u.isArray(l)){if(0===l.length||!u.isObject(l[0])&&!u.isArray(l[0])){h[a]=l;continue}for(r=[],d=[],o=0,s=l.length;oh;i=0<=h?++r:--r)(null!=(c=l[i])?c.buffer:void 0)instanceof ArrayBuffer?o.push(n.encode_base64(l[i],null!=e&&null!=(_=e[a])?_[i]:void 0)):o.push(l[i]);l=o}s[a]=l}return s}},function(t,e,n){var i=t(364),r=t(361),o=function(){return function(){}}();n.SpatialIndex=o;var s=function(t){function e(e){var n=t.call(this)||this;return n.index=r(),n.index.load(e),n}return i.__extends(e,t),Object.defineProperty(e.prototype,\"bbox\",{get:function(){var t=this.index.toJSON(),e=t.minX,n=t.minY,i=t.maxX,r=t.maxY;return{minX:e,minY:n,maxX:i,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),n=e.length,i=new Array(n),r=0;r\"'`])/g,function(t){switch(t){case\"&\":return\"&\";case\"<\":return\"<\";case\">\":return\">\";case'\"':return\""\";case\"'\":return\"'\";case\"`\":return\"`\";default:return t}})},n.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,n){n.indianred=\"#CD5C5C\",n.lightcoral=\"#F08080\",n.salmon=\"#FA8072\",n.darksalmon=\"#E9967A\",n.lightsalmon=\"#FFA07A\",n.crimson=\"#DC143C\",n.red=\"#FF0000\",n.firebrick=\"#B22222\",n.darkred=\"#8B0000\",n.pink=\"#FFC0CB\",n.lightpink=\"#FFB6C1\",n.hotpink=\"#FF69B4\",n.deeppink=\"#FF1493\",n.mediumvioletred=\"#C71585\",n.palevioletred=\"#DB7093\",n.coral=\"#FF7F50\",n.tomato=\"#FF6347\",n.orangered=\"#FF4500\",n.darkorange=\"#FF8C00\",n.orange=\"#FFA500\",n.gold=\"#FFD700\",n.yellow=\"#FFFF00\",n.lightyellow=\"#FFFFE0\",n.lemonchiffon=\"#FFFACD\",n.lightgoldenrodyellow=\"#FAFAD2\",n.papayawhip=\"#FFEFD5\",n.moccasin=\"#FFE4B5\",n.peachpuff=\"#FFDAB9\",n.palegoldenrod=\"#EEE8AA\",n.khaki=\"#F0E68C\",n.darkkhaki=\"#BDB76B\",n.lavender=\"#E6E6FA\",n.thistle=\"#D8BFD8\",n.plum=\"#DDA0DD\",n.violet=\"#EE82EE\",n.orchid=\"#DA70D6\",n.fuchsia=\"#FF00FF\",n.magenta=\"#FF00FF\",n.mediumorchid=\"#BA55D3\",n.mediumpurple=\"#9370DB\",n.blueviolet=\"#8A2BE2\",n.darkviolet=\"#9400D3\",n.darkorchid=\"#9932CC\",n.darkmagenta=\"#8B008B\",n.purple=\"#800080\",n.indigo=\"#4B0082\",n.slateblue=\"#6A5ACD\",n.darkslateblue=\"#483D8B\",n.mediumslateblue=\"#7B68EE\",n.greenyellow=\"#ADFF2F\",n.chartreuse=\"#7FFF00\",n.lawngreen=\"#7CFC00\",n.lime=\"#00FF00\",n.limegreen=\"#32CD32\",n.palegreen=\"#98FB98\",n.lightgreen=\"#90EE90\",n.mediumspringgreen=\"#00FA9A\",n.springgreen=\"#00FF7F\",n.mediumseagreen=\"#3CB371\",n.seagreen=\"#2E8B57\",n.forestgreen=\"#228B22\",n.green=\"#008000\",n.darkgreen=\"#006400\",n.yellowgreen=\"#9ACD32\",n.olivedrab=\"#6B8E23\",n.olive=\"#808000\",n.darkolivegreen=\"#556B2F\",n.mediumaquamarine=\"#66CDAA\",n.darkseagreen=\"#8FBC8F\",n.lightseagreen=\"#20B2AA\",n.darkcyan=\"#008B8B\",n.teal=\"#008080\",n.aqua=\"#00FFFF\",n.cyan=\"#00FFFF\",n.lightcyan=\"#E0FFFF\",n.paleturquoise=\"#AFEEEE\",n.aquamarine=\"#7FFFD4\",n.turquoise=\"#40E0D0\",n.mediumturquoise=\"#48D1CC\",n.darkturquoise=\"#00CED1\",n.cadetblue=\"#5F9EA0\",n.steelblue=\"#4682B4\",n.lightsteelblue=\"#B0C4DE\",n.powderblue=\"#B0E0E6\",n.lightblue=\"#ADD8E6\",n.skyblue=\"#87CEEB\",n.lightskyblue=\"#87CEFA\",n.deepskyblue=\"#00BFFF\",n.dodgerblue=\"#1E90FF\",n.cornflowerblue=\"#6495ED\",n.royalblue=\"#4169E1\",n.blue=\"#0000FF\",n.mediumblue=\"#0000CD\",n.darkblue=\"#00008B\",n.navy=\"#000080\",n.midnightblue=\"#191970\",n.cornsilk=\"#FFF8DC\",n.blanchedalmond=\"#FFEBCD\",n.bisque=\"#FFE4C4\",n.navajowhite=\"#FFDEAD\",n.wheat=\"#F5DEB3\",n.burlywood=\"#DEB887\",n.tan=\"#D2B48C\",n.rosybrown=\"#BC8F8F\",n.sandybrown=\"#F4A460\",n.goldenrod=\"#DAA520\",n.darkgoldenrod=\"#B8860B\",n.peru=\"#CD853F\",n.chocolate=\"#D2691E\",n.saddlebrown=\"#8B4513\",n.sienna=\"#A0522D\",n.brown=\"#A52A2A\",n.maroon=\"#800000\",n.white=\"#FFFFFF\",n.snow=\"#FFFAFA\",n.honeydew=\"#F0FFF0\",n.mintcream=\"#F5FFFA\",n.azure=\"#F0FFFF\",n.aliceblue=\"#F0F8FF\",n.ghostwhite=\"#F8F8FF\",n.whitesmoke=\"#F5F5F5\",n.seashell=\"#FFF5EE\",n.beige=\"#F5F5DC\",n.oldlace=\"#FDF5E6\",n.floralwhite=\"#FFFAF0\",n.ivory=\"#FFFFF0\",n.antiquewhite=\"#FAEBD7\",n.linen=\"#FAF0E6\",n.lavenderblush=\"#FFF0F5\",n.mistyrose=\"#FFE4E1\",n.gainsboro=\"#DCDCDC\",n.lightgray=\"#D3D3D3\",n.lightgrey=\"#D3D3D3\",n.silver=\"#C0C0C0\",n.darkgray=\"#A9A9A9\",n.darkgrey=\"#A9A9A9\",n.gray=\"#808080\",n.grey=\"#808080\",n.dimgray=\"#696969\",n.dimgrey=\"#696969\",n.lightslategray=\"#778899\",n.lightslategrey=\"#778899\",n.slategray=\"#708090\",n.slategrey=\"#708090\",n.darkslategray=\"#2F4F4F\",n.darkslategrey=\"#2F4F4F\",n.black=\"#000000\"},function(t,e,n){var i,r=t(362),o=t(332),s=t(363),a=t(37),l=t(42);i=function(t){var e;return l.isNumber(t)?(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\"}}(),r.sprintf(e,t)):\"\"+t},n.replace_placeholders=function(t,e,n,l,u){return void 0===u&&(u={}),t=t.replace(/(^|[^\\$])\\$(\\w+)/g,function(t,e,n){return e+\"@$\"+n}),t=t.replace(/(^|[^@])@(?:(\\$?\\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,h,c,_,p){var d,f,m;if(c=null!=_?_:c,m=\"$\"===c[0]?u[c.substring(1)]:null!=(d=e.get_column(c))?d[n]:void 0,f=null,null==m)f=\"???\";else{if(\"safe\"===p)return\"\"+h+m;if(null!=p)if(null!=l&&c in l)if(\"numeral\"===l[c])f=o.format(m,p);else if(\"datetime\"===l[c])f=s(m,p);else{if(\"printf\"!==l[c])throw new Error(\"Unknown tooltip field formatter type '\"+l[c]+\"'\");f=r.sprintf(p,m)}else f=o.format(m,p);else f=i(m)}return f=\"\"+h+a.escape(f)})}},function(t,e,n){var i=t(5),r={};n.get_text_height=function(t){if(null!=r[t])return r[t];var e=i.span({style:{font:t}},\"Hg\"),n=i.div({style:{display:\"inline-block\",width:\"1px\",height:\"0px\"}}),o=i.div({},e,n);document.body.appendChild(o);try{n.style.verticalAlign=\"baseline\";var s=i.offset(n).top-i.offset(e).top;n.style.verticalAlign=\"bottom\";var a=i.offset(n).top-i.offset(e).top,l={height:a,ascent:s,descent:a-s};return r[t]=l,l}finally{document.body.removeChild(o)}}},function(t,e,n){var i,r;i=function(t){return t()},r=(\"undefined\"!=typeof window&&null!==window?window.requestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.mozRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.webkitRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window&&null!==window?window.msRequestAnimationFrame:void 0)||i,n.throttle=function(t,e){var n,i,o,s,a,l,u;return h=[null,null,null,null],i=h[0],n=h[1],u=h[2],l=h[3],a=0,s=!1,o=function(){return a=new Date,u=null,s=!1,l=t.apply(i,n)},function(){var t,h;return t=new Date,h=e-(t-a),i=this,n=arguments,h<=0&&!s?(clearTimeout(u),s=!0,r(o)):u||s||(u=setTimeout(function(){return r(o)},h)),l};var h}},function(t,e,n){function i(t){return\"[object Number]\"===r.call(t)}var r=Object.prototype.toString;n.isBoolean=function(t){return!0===t||!1===t||\"[object Boolean]\"===r.call(t)},n.isNumber=i,n.isInteger=function(t){return i(t)&&isFinite(t)&&Math.floor(t)===t},n.isString=function(t){return\"[object String]\"===r.call(t)},n.isStrictNaN=function(t){return i(t)&&t!==+t},n.isFunction=function(t){return\"[object Function]\"===r.call(t)},n.isArray=function(t){return Array.isArray(t)},n.isObject=function(t){var e=typeof t;return\"function\"===e||\"object\"===e&&!!t}},function(t,e,n){function i(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}n.getDeltaY=function(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=function(t){return i(t.offsetParent||document.body)||i(t)||16}(t.target);break;case t.DOM_DELTA_PAGE:e*=function(t){return t.clientHeight}(t.target)}return e}},function(t,e,n){function i(t,e,n){var i=[t.start,t.end],r=i[0],o=i[1],s=null!=n?n:(o+r)/2,a=r-(r-s)*e,l=o-(o-s)*e;return[a,l]}function r(t,e){var n=e[0],i=e[1],r={};for(var o in t){var s=t[o],a=s.r_invert(n,i),l=a[0],u=a[1];r[o]={start:l,end:u}}return r}var o=t(29);n.scale_highlow=i,n.get_info=r,n.scale_range=function(t,e,n,s,a){void 0===n&&(n=!0);void 0===s&&(s=!0);e=o.clamp(e,-.9,.9);var l=n?e:0,u=i(t.bbox.h_range,l,null!=a?a.x:void 0),h=u[0],c=u[1],_=r(t.xscales,[h,c]),p=s?e:0,d=i(t.bbox.v_range,p,null!=a?a.y:void 0),f=d[0],m=d[1],v=r(t.yscales,[f,m]);return{xrs:_,yrs:v,factor:e}}},function(t,e,n){var i=t(364),r=t(20),o=t(37),s=function(t){function e(e){var n=t.call(this)||this;if(n.removed=new r.Signal(n,\"removed\"),null==e.model)throw new Error(\"model of a view wasn't configured\");return n.model=e.model,n._parent=e.parent,n.id=e.id||o.uniqueId(),n.initialize(e),!1!==e.connect_signals&&n.connect_signals(),n}return i.__extends(e,t),e.getters=function(t){for(var e in t){var n=t[e];Object.defineProperty(this.prototype,e,{get:n})}},e.prototype.initialize=function(t){},e.prototype.remove=function(){this._parent=void 0,this.disconnect_signals(),this.removed.emit(void 0)},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());n.View=s},function(t,e,n){var i,r=t(364),o={}.hasOwnProperty,s=t(16),a=t(26),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.set_value=function(t){return 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){if(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)return t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t;return\"rgba(\"+255*(t=a.color2rgba(this.line_color.value(),this.line_alpha.value()))[0]+\",\"+255*t[1]+\",\"+255*t[2]+\",\"+t[3]+\")\"},e}(i=function(){function t(t,e){void 0===e&&(e=\"\");var n,i,r,o,s;for(this.obj=t,this.prefix=e,this.cache={},i=t.properties[e+this.do_attr].spec,this.doit=null!==i.value,s=this.attrs,r=0,o=s.length;r0;)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 n=0,i=e;n=0&&this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){for(var e=0,n=this._callbacks;e0||p.difference(f,a).length>0)throw new Error(\"Not implemented: computing add/remove of document roots\");var g={},y=[];for(var b in n._all_models)if(b in o){var x=t._events_to_sync_objects(o[b],c[b],n,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 n=this._roots.map(function(t){return t.id}),i=d.values(this._all_models);return{title:this._title,roots:{root_ids:n,references:t._references_json(i,e)}}},t.from_json_string=function(e){var n=JSON.parse(e);return t.from_json(n)},t.from_json=function(e){s.logger.debug(\"Creating Document from JSON\");var n=e.version,i=-1!==n.indexOf(\"+\")||-1!==n.indexOf(\"-\"),r=\"Library versions: JS (\"+o.version+\") / Python (\"+n+\")\";i||o.version===n?s.logger.debug(r):(s.logger.warn(\"JS/Python version mismatch\"),s.logger.warn(r));var a=e.roots,l=a.root_ids,u=a.references,h=t._instantiate_references_json(u,{});t._initialize_references_json(u,{},h);for(var c=new t,_=0,p=l;_0?t.consume(e.buffers[0].buffer):t.consume(e.content.data),null!=(e=t.message))return this.apply_json_patch(e.content,e.buffers)},c=function(t,e,n){var i;if(t===n.target_name)return i=new S.Receiver,n.on_msg(l.bind(e,i))},u=function(t,e){var n,i,r,o,s;if(\"undefined\"==typeof Jupyter||null===Jupyter||null==Jupyter.notebook.kernel)return console.warn(\"Jupyter notebooks comms not available. push_notebook() will not function\");v.logger.info(\"Registering Jupyter comms for target \"+t),n=Jupyter.notebook.kernel.comm_manager,s=function(n){return c(t,e,n)},o=n.comms;for(r in o)o[r].then(s);try{return n.register_target(t,function(n,i){var r;return v.logger.info(\"Registering Jupyter comms for target \"+t),r=new S.Receiver,n.on_msg(l.bind(e,r))})}catch(t){return i=t,v.logger.warn(\"Jupyter comms failed to register. push_notebook() will not function. (exception reported: \"+i+\")\")}},i=function(t){var e;return e=new t.default_view({model:t,parent:null}),f.index[t.id]=e,e},o=function(t){var e,i,r,o;if(o=t.elementid,null==(r=document.getElementById(o)))throw new Error(\"Error rendering Bokeh model: could not find tag with id: \"+o);if(!document.body.contains(r))throw new Error(\"Error rendering Bokeh model: element with id '\"+o+\"' must be under \");return\"SCRIPT\"===r.tagName&&(d(r,t),i=y.div({class:n.BOKEH_ROOT}),y.replaceWith(r,i),e=y.div(),i.appendChild(e),r=e),r},n.add_model_standalone=function(t,e,n){var r;if(null==(r=n.get_model_by_id(t)))throw new Error(\"Model \"+t+\" was not in document \"+n);return i(r).renderTo(e,!0)},n.add_document_standalone=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,l,u,h;for(h={},l=function(t){var n;return(n=i(t)).renderTo(e),h[t.id]=n},u=function(t){var n;if(t.id in h)return n=h[t.id],e.removeChild(n.el),delete h[t.id],delete f.index[t.id]},a=t.roots(),r=0,o=a.length;r0&&v.set_log_level(n.bokehLogLevel),null!=n.bokehDocId&&n.bokehDocId.length>0&&(e.docid=n.bokehDocId),null!=n.bokehModelId&&n.bokehModelId.length>0&&(e.modelid=n.bokehModelId),null!=n.bokehSessionId&&n.bokehSessionId.length>0&&(e.sessionid=n.bokehSessionId),v.logger.info(\"Will inject Bokeh script tag with params \"+JSON.stringify(e))},n.embed_items_notebook=function(t,e){var i,r,s,a,l,h;if(1!==w.size(t))throw new Error(\"embed_items_notebook expects exactly one document in docs_json\");for(i=g.Document.from_json(w.values(t)[0]),h=[],s=0,l=e.length;si;e=0<=i?++n:--n)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this.start[0][e],this.start[1][e]),t.lineTo(this.end[0][e],this.end[1][e]),r.push(t.stroke());return r}},e.prototype._arrow_head=function(t,e,n,i,r){var o,s,a,u,h;for(h=[],s=a=0,u=this._x_start.length;0<=u?au;s=0<=u?++a:--a)o=Math.PI/2+l.atan2([i[0][s],i[1][s]],[r[0][s],r[1][s]]),t.save(),t.translate(r[0][s],r[1][s]),t.rotate(o),\"render\"===e?n.render(t):\"clip\"===e&&n.clip(t),h.push(t.restore());return h},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Arrow=u,u.prototype.default_view=n.ArrowView,u.prototype.type=\"Arrow\",u.mixins([\"line\"]),u.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\"]})},function(t,e,n){var i=t(364),r=t(51),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals=new o.Visuals(this)},e.prototype.render=function(t,e){return null},e.prototype.clip=function(t,e){return null},e}(r.Annotation);n.ArrowHead=a,a.prototype.type=\"ArrowHead\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return 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){if(this.visuals.line.doit)return 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);n.OpenHead=l,l.prototype.type=\"OpenHead\",l.mixins([\"line\"]),l.define({size:[s.Number,25]});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return 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){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke()},e.prototype._normal=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);n.NormalHead=u,u.prototype.type=\"NormalHead\",u.mixins([\"line\",\"fill\"]),u.define({size:[s.Number,25]}),u.override({fill_color:\"black\"});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return 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){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke()},e.prototype._vee=function(t,e){return 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);n.VeeHead=h,h.prototype.type=\"VeeHead\",h.mixins([\"line\",\"fill\"]),h.define({size:[s.Number,25]}),h.override({fill_color:\"black\"});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke()},e}(a);n.TeeHead=c,c.prototype.type=\"TeeHead\",c.mixins([\"line\"]),c.define({size:[s.Number,25]})},function(t,e,n){var i=t(364),r=t(51),o=t(173),s=t(15);n.BandView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return 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,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_view.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c=\"height\"===a?d:p,o=\"height\"===a?p:d,_=\"height\"===a?l.yview:l.xview,s=\"height\"===a?l.xview:l.yview,n=\"data\"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r=\"data\"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t=\"data\"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f=\"height\"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){for(this._map_data(),(t=this.plot_view.canvas_view.ctx).beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=n=0,s=this._lower_sx.length;0<=s?ns;e=0<=s?++n:--n)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(e=i=a=this._upper_sx.length-1;a<=0?i<=0:i>=0;e=a<=0?++i:--i)t.lineTo(this._upper_sx[e],this._upper_sy[e]);for(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]),e=r=0,l=this._lower_sx.length;0<=l?rl;e=0<=l?++r:--r)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]),e=o=0,u=this._upper_sx.length;0<=u?ou;e=0<=u?++o:--o)t.lineTo(this._upper_sx[e],this._upper_sy[e]);return this.visuals.line.doit?(this.visuals.line.set_value(t),t.stroke()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Band=a,a.prototype.default_view=n.BandView,a.prototype.type=\"Band\",a.mixins([\"line\",\"fill\"]),a.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\"]}),a.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(20),s=t(5),a=t(15),l=t(42);n.BoxAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add(\"bk-shading\"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),\"css\"===this.model.render_mode?(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.data_update,function(){return this.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,e,n,i,r,o,a,l,u=this;if(this.model.visible||\"css\"!==this.model.render_mode||s.hide(this.el),this.model.visible)return null==this.model.left&&null==this.model.right&&null==this.model.top&&null==this.model.bottom?(s.hide(this.el),null):(e=this.plot_model.frame,a=e.xscales[this.model.x_range_name],l=e.yscales[this.model.y_range_name],t=function(t,e,n,i,r){return null!=t?u.model.screen?t:\"data\"===e?n.compute(t):i.compute(t):r},i=t(this.model.left,this.model.left_units,a,e.xview,e._left.value),r=t(this.model.right,this.model.right_units,a,e.xview,e._right.value),o=t(this.model.top,this.model.top_units,l,e.yview,e._top.value),n=t(this.model.bottom,this.model.bottom_units,l,e.yview,e._bottom.value),(\"css\"===this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this))(i,r,n,o))},e.prototype._css_box=function(t,e,n,i){var r,o,a;return a=Math.abs(e-t),o=Math.abs(n-i),this.el.style.left=t+\"px\",this.el.style.width=a+\"px\",this.el.style.top=i+\"px\",this.el.style.height=o+\"px\",this.el.style.borderWidth=this.model.line_width.value+\"px\",this.el.style.borderColor=this.model.line_color.value,this.el.style.backgroundColor=this.model.fill_color.value,this.el.style.opacity=this.model.fill_alpha.value,r=this.model.line_dash,l.isArray(r)&&(r=r.length<2?\"solid\":\"dashed\"),l.isString(r)&&(this.el.style.borderStyle=r),s.show(this.el)},e.prototype._canvas_box=function(t,e,n,i){var r;return(r=this.plot_view.canvas_view.ctx).save(),r.beginPath(),r.rect(t,i,e-t,n-i),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,\"data_update\")},e.prototype.update=function(t){var e=t.left,n=t.right,i=t.top,r=t.bottom;return this.setv({left:e,right:n,top:i,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.BoxAnnotation=u,u.prototype.default_view=n.BoxAnnotationView,u.prototype.type=\"BoxAnnotation\",u.mixins([\"line\",\"fill\"]),u.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\"]}),u.internal({screen:[a.Boolean,!1]}),u.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(180),s=t(91),a=t(146),l=t(168),u=t(169),h=t(160),c=t(15),_=t(40),p=t(22),d=t(30),f=t(42);n.ColorBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;if(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)return this.connect(this.model.color_mapper.change,function(){return this._set_canvas_image(),this.plot_view.request_render()})},e.prototype._get_size=function(){var t,e;return null==this.model.color_mapper?0:(t=this.compute_legend_dimensions(),\"above\"===(e=this.model.panel.side)||\"below\"===e?t.height:\"left\"===e||\"right\"===e?t.width:void 0)},e.prototype._set_canvas_image=function(){var t,e,n,i,r,o,s,l,u,h;if(null!=this.model.color_mapper){switch(l=this.model.color_mapper.palette,\"vertical\"===this.model.orientation&&(l=l.slice(0).reverse()),this.model.orientation){case\"vertical\":c=[1,l.length],h=c[0],r=c[1];break;case\"horizontal\":_=[l.length,1],h=_[0],r=_[1]}return n=document.createElement(\"canvas\"),p=[h,r],n.width=p[0],n.height=p[1],o=n.getContext(\"2d\"),s=o.getImageData(0,0,h,r),i=new a.LinearColorMapper({palette:l}),t=i.v_map_screen(function(){u=[];for(var t=0,e=l.length;0<=e?te;0<=e?t++:t--)u.push(t);return u}.apply(this)),e=new Uint8Array(t),s.data.set(e),o.putImageData(s,0,0),this.image=n;var c,_,p}},e.prototype.compute_legend_dimensions=function(){var t,e,n,i,r,o,s,a,l;switch(t=this.model._computed_image_dimensions(),u=[t.height,t.width],e=u[0],n=u[1],i=this._get_label_extent(),l=this.model._title_extent(),a=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case\"vertical\":r=e+l+2*s,o=n+a+i+2*s;break;case\"horizontal\":r=e+l+a+i+2*s,o=n+2*s}return{height:r,width:o};var u},e.prototype.compute_legend_location=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_;if(e=this.compute_legend_dimensions(),p=[e.height,e.width],n=p[0],r=p[1],i=this.model.margin,s=null!=(a=this.model.panel)?a:this.plot_view.frame,d=s.bbox.ranges,t=d[0],h=d[1],o=this.model.location,f.isString(o))switch(o){case\"top_left\":l=t.start+i,u=h.start+i;break;case\"top_center\":l=(t.end+t.start)/2-r/2,u=h.start+i;break;case\"top_right\":l=t.end-i-r,u=h.start+i;break;case\"bottom_right\":l=t.end-i-r,u=h.end-i-n;break;case\"bottom_center\":l=(t.end+t.start)/2-r/2,u=h.end-i-n;break;case\"bottom_left\":l=t.start+i,u=h.end-i-n;break;case\"center_left\":l=t.start+i,u=(h.end+h.start)/2-n/2;break;case\"center\":l=(t.end+t.start)/2-r/2,u=(h.end+h.start)/2-n/2;break;case\"center_right\":l=t.end-i-r,u=(h.end+h.start)/2-n/2}else f.isArray(o)&&2===o.length&&(c=o[0],_=o[1],l=s.xview.compute(c),u=s.yview.compute(_)-n);return{sx:l,sy:u};var p,d},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible&&null!=this.model.color_mapper){return(t=this.plot_view.canvas_view.ctx).save(),o=this.compute_legend_location(),n=o.sx,i=o.sy,t.translate(n,i),this._draw_bbox(t),e=this._get_image_offset(),t.translate(e.x,e.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(r=this.model.tick_info(),this._draw_major_ticks(t,r),this._draw_minor_ticks(t,r),this._draw_major_labels(t,r)),this.model.title&&this._draw_title(t),t.restore();var o}},e.prototype._draw_bbox=function(t){var e;return 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;return 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){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.major_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.major,l=m[0],u=m[1],h=this.model.major_tick_in,c=this.model.major_tick_out,t.save(),t.translate(_,p),this.visuals.major_tick_line.set_value(t),n=r=0,a=l.length;0<=a?ra;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_minor_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.minor_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.minor,l=m[0],u=m[1],h=this.model.minor_tick_in,c=this.model.minor_tick_out,t.save(),t.translate(_,p),this.visuals.minor_tick_line.set_value(t),n=r=0,a=l.length;0<=a?ra;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_major_labels=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(this.visuals.major_label_text.doit){for(m=this.model._normals(),s=m[0],a=m[1],r=this.model._computed_image_dimensions(),v=[r.width*s,r.height*a],_=v[0],d=v[1],u=this.model.label_standoff+this.model._tick_extent(),p=(g=[u*s,u*a])[0],f=g[1],y=e.coords.major,h=y[0],c=y[1],n=e.labels.major,this.visuals.major_label_text.set_value(t),t.save(),t.translate(_+p,d+f),i=o=0,l=h.length;0<=l?ol;i=0<=l?++o:--o)t.fillText(n[i],Math.round(h[i]+s*this.model.label_standoff),Math.round(c[i]+a*this.model.label_standoff));return t.restore();var m,v,g,y}},e.prototype._draw_title=function(t){if(this.visuals.title_text.doit)return 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,n,i;if(i=this.model.tick_info().labels.major,null==this.model.color_mapper.low||null==this.model.color_mapper.high||d.isEmpty(i))n=0;else{switch((t=this.plot_view.canvas_view.ctx).save(),this.visuals.major_label_text.set_value(t),this.model.orientation){case\"vertical\":n=p.max(function(){var n,r,o;for(o=[],n=0,r=i.length;ns;i=0<=s?++r:--r)e[i]in this.major_label_overrides&&(n[i]=this.major_label_overrides[e[i]]);return n},e.prototype.tick_info=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;switch(o=this._computed_image_dimensions(),this.orientation){case\"vertical\":v=o.height;break;case\"horizontal\":v=o.width}for(m=this._tick_coordinate_scale(v),b=this._normals(),i=b[0],s=b[1],x=[this.color_mapper.low,this.color_mapper.high],g=x[0],n=x[1],y=this.ticker.get_ticks(g,n,null,null,this.ticker.desired_num_ticks),e={major:[[],[]],minor:[[],[]]},c=y.major,p=y.minor,h=e.major,_=e.minor,r=a=0,d=c.length;0<=d?ad;r=0<=d?++a:--a)c[r]n||(h[i].push(c[r]),h[s].push(0));for(r=l=0,f=p.length;0<=f?lf;r=0<=f?++l:--l)p[r]n||(_[i].push(p[r]),_[s].push(0));return u={major:this._format_major_labels(h[i].slice(0),c)},h[i]=m.v_compute(h[i]),_[i]=m.v_compute(_[i]),\"vertical\"===this.orientation&&(h[i]=new Float64Array(function(){var e,n,r,o;for(r=h[i],o=[],n=0,e=r.length;ni;0<=i?++n:--n)this.title_div=s.div({class:\"bk-annotation-child\",style:{display:\"none\"}}),r.push(this.el.appendChild(this.title_div));return r}},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),\"css\"===this.model.render_mode?(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.render()})):(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}))},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t,e,n,i,r,o;return r=this.plot_view.frame.xscales[this.model.x_range_name],o=this.plot_view.frame.yscales[this.model.y_range_name],t=null!=(e=this.model.panel)?e:this.plot_view.frame,n=\"data\"===this.model.x_units?r.v_compute(this._x):t.xview.v_compute(this._x),i=\"data\"===this.model.y_units?o.v_compute(this._y):t.yview.v_compute(this._y),[n,i]},e.prototype.render=function(){var t,e,n,i,r,o,a,l;if(this.model.visible||\"css\"!==this.model.render_mode||s.hide(this.el),this.model.visible){for(e=\"canvas\"===this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),t=this.plot_view.canvas_view.ctx,u=this._map_data(),a=u[0],l=u[1],o=[],n=i=0,r=this._text.length;0<=r?ir;n=0<=r?++i:--i)o.push(e(t,n,this._text[n],a[n]+this._x_offset[n],l[n]-this._y_offset[n],this._angle[n]));return o;var u}},e.prototype._get_size=function(){var t,e;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),\"above\"===(e=this.model.panel.side)||\"below\"===e?t.measureText(this._text[0]).ascent:\"left\"===e||\"right\"===e?t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,n,i,r,o){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,n),t.save(),t.beginPath(),t.translate(i,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(n,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,n,i,r,o){var a,u,h,c;return u=this.el.childNodes[e],u.textContent=n,this.visuals.text.set_vectorize(t,e),a=this._calculate_bounding_box_dimensions(t,n),h=this.visuals.border_line.line_dash.value(),l.isArray(h)&&(c=h.length<2?\"solid\":\"dashed\"),l.isString(h)&&(c=h),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),u.style.position=\"absolute\",u.style.left=i+a[0]+\"px\",u.style.top=r+a[1]+\"px\",u.style.color=\"\"+this.visuals.text.text_color.value(),u.style.opacity=\"\"+this.visuals.text.text_alpha.value(),u.style.font=\"\"+this.visuals.text.font_value(),u.style.lineHeight=\"normal\",o&&(u.style.transform=\"rotate(\"+o+\"rad)\"),this.visuals.background_fill.doit&&(u.style.backgroundColor=\"\"+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(u.style.borderStyle=\"\"+c,u.style.borderWidth=this.visuals.border_line.line_width.value()+\"px\",u.style.borderColor=\"\"+this.visuals.border_line.color_value()),s.show(u)},e}(r.TextAnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.LabelSet=u,u.prototype.default_view=n.LabelSetView,u.prototype.type=\"Label\",u.mixins([\"text\",\"line:border_\",\"fill:background_\"]),u.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\"],render_mode:[a.RenderMode,\"canvas\"]}),u.override({background_fill_color:null,border_line_color:null})},function(t,e,n){var i=t(364),r=t(51),o=t(15),s=t(40),a=t(23),l=t(22),u=t(30),h=t(42),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;return 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,e,n,i,r,o,a,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;for(d=this.model.get_legend_names(),e=this.model.glyph_height,n=this.model.glyph_width,o=this.model.label_height,c=this.model.label_width,this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,e]),(t=this.plot_view.canvas_view.ctx).save(),this.visuals.label_text.set_value(t),this.text_widths={},r=0,g=d.length;rr;n=0<=r?++i:--i)\"screen\"===this.model.xs_units&&(o=this.model.screen?a[n]:e.xview.compute(a[n])),\"screen\"===this.model.ys_units&&(s=this.model.screen?l[n]:e.yview.compute(l[n])),0===n?(t.beginPath(),t.moveTo(o,s)):t.lineTo(o,s);return t.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),this.visuals.fill.doit?(this.visuals.fill.set_value(t),t.fill()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,\"data_update\")},e.prototype.update=function(t){var e=t.xs,n=t.ys;return this.setv({xs:e,ys:n,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.PolyAnnotation=a,a.prototype.default_view=n.PolyAnnotationView,a.prototype.type=\"PolyAnnotation\",a.mixins([\"line\",\"fill\"]),a.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\"]}),a.internal({screen:[s.Boolean,!1]}),a.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(15);n.SpanView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position=\"absolute\",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return this._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 this.render()}),this.connect(this.model.properties.location.change,function(){return this._draw_span()}))},e.prototype.render=function(){if(this.model.visible||\"css\"!==this.model.render_mode||o.hide(this.el),this.model.visible)return this._draw_span()},e.prototype._draw_span=function(){var t,e,n,i,r,s,a,l,u,h,c=this;if(null!=(r=this.model.for_hover?this.model.computed_location:this.model.location))return n=this.plot_view.frame,u=n.xscales[this.model.x_range_name],h=n.yscales[this.model.y_range_name],t=function(t,e){return c.model.for_hover?c.model.computed_location:\"data\"===c.model.location_units?t.compute(r):e.compute(r)},\"width\"===this.model.dimension?(a=t(h,n.yview),s=n._left.value,l=n._width.value,i=this.model.properties.line_width.value()):(a=n._top.value,s=t(u,n.xview),l=this.model.properties.line_width.value(),i=n._height.value),\"css\"===this.model.render_mode?(this.el.style.top=a+\"px\",this.el.style.left=s+\"px\",this.el.style.width=l+\"px\",this.el.style.height=i+\"px\",this.el.style.zIndex=1e3,this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el)):\"canvas\"===this.model.render_mode?((e=this.plot_view.canvas_view.ctx).save(),e.beginPath(),this.visuals.line.set_value(e),e.moveTo(s,a),\"width\"===this.model.dimension?e.lineTo(s+l,a):e.lineTo(s,a+i),e.stroke(),e.restore()):void 0;o.hide(this.el)},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Span=a,a.prototype.default_view=n.SpanView,a.prototype.type=\"Span\",a.mixins([\"line\"]),a.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\"]}),a.override({line_color:\"black\"}),a.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(42),a=t(40);n.TextAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),\"css\"===this.model.render_mode)return this.el.classList.add(\"bk-annotation\"),this.plot_view.canvas_overlays.appendChild(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),\"css\"===this.model.render_mode?this.connect(this.model.change,function(){return this.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var n,i;return i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height,[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var n,i,r,o;switch(s=this._calculate_text_dimensions(t,e),i=s[0],n=s[1],t.textAlign){case\"left\":r=0;break;case\"center\":r=-i/2;break;case\"right\":r=-i}switch(t.textBaseline){case\"top\":o=0;break;case\"middle\":o=-.5*n;break;case\"bottom\":o=-1*n;break;case\"alphabetic\":o=-.8*n;break;case\"hanging\":o=-.17*n;break;case\"ideographic\":o=-.83*n}return[r,o,i,n];var s},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(this.model.text).ascent},e.prototype.render=function(){return null},e.prototype._canvas_text=function(t,e,n,i,r){var o;return this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(n,i),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,n,i,r){var a,l,u;return o.hide(this.el),this.visuals.text.set_value(t),a=this._calculate_bounding_box_dimensions(t,e),l=this.visuals.border_line.line_dash.value(),s.isArray(l)&&(u=l.length<2?\"solid\":\"dashed\"),s.isString(l)&&(u=l),this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position=\"absolute\",this.el.style.left=n+a[0]+\"px\",this.el.style.top=i+a[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=\"\"+u,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);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.TextAnnotation=l,l.prototype.type=\"TextAnnotation\",l.prototype.default_view=n.TextAnnotationView},function(t,e,n){var i=t(364),r=t(64),o=t(5),s=t(15),a=t(46);n.TitleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,n,i;switch(e=this.model.panel,t=this.model.offset,5,e.side){case\"above\":case\"below\":switch(this.model.vertical_align){case\"top\":i=e._top.value+5;break;case\"middle\":i=e._vcenter.value;break;case\"bottom\":i=e._bottom.value-5}switch(this.model.align){case\"left\":n=e._left.value+t;break;case\"center\":n=e._hcenter.value;break;case\"right\":n=e._right.value-t}break;case\"left\":switch(this.model.vertical_align){case\"top\":n=e._left.value-5;break;case\"middle\":n=e._hcenter.value;break;case\"bottom\":n=e._right.value+5}switch(this.model.align){case\"left\":i=e._bottom.value-t;break;case\"center\":i=e._vcenter.value;break;case\"right\":i=e._top.value+t}break;case\"right\":switch(this.model.vertical_align){case\"top\":n=e._right.value-5;break;case\"middle\":n=e._hcenter.value;break;case\"bottom\":n=e._left.value+5}switch(this.model.align){case\"left\":i=e._top.value+t;break;case\"center\":i=e._vcenter.value;break;case\"right\":i=e._bottom.value-t}}return[n,i]},e.prototype.render=function(){var t,e,n,i;if(this.model.visible){if(null!=(i=this.model.text)&&0!==i.length){return this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align,r=this._get_location(),e=r[0],n=r[1],t=this.model.panel.get_label_angle_heuristic(\"parallel\"),(\"canvas\"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,i,e,n,t);var r}}else\"css\"===this.model.render_mode&&o.hide(this.el)},e.prototype._get_size=function(){var t,e;return null==(e=this.model.text)||0===e.length?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(r.TextAnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Title=l,l.prototype.default_view=n.TitleView,l.prototype.type=\"Title\",l.mixins([\"line:border_\",\"fill:background_\"]),l.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],render_mode:[s.RenderMode,\"canvas\"]}),l.override({background_fill_color:null,border_line_color:null}),l.internal({text_align:[s.TextAlign,\"left\"],text_baseline:[s.TextBaseline,\"bottom\"]})},function(t,e,n){var i=t(364),r=t(51),o=t(4),s=t(5),a=t(15);n.ToolbarPanelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e,n;t.prototype.render.call(this);if(this.model.visible)return 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\",(n=this._toolbar_views[this.model.toolbar.id]).render(),s.empty(this.el),this.el.appendChild(n.el),s.show(this.el);s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.ToolbarPanel=l,l.prototype.type=\"ToolbarPanel\",l.prototype.default_view=n.ToolbarPanelView,l.define({toolbar:[a.Instance]})},function(t,e,n){var i=t(364),r=t(51),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=1010,o.hide(this.el)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return this._draw_tips()})},e.prototype.render=function(){if(this.model.visible)return this._draw_tips()},e.prototype._draw_tips=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p;if(n=this.model.data,o.empty(this.el),o.hide(this.el),this.model.custom?this.el.classList.add(\"bk-tooltip-custom\"):this.el.classList.remove(\"bk-tooltip-custom\"),0!==n.length){for(i=this.plot_view.frame,r=0,a=n.length;r0?(this.el.style.top=_+\"px\",this.el.style.left=s+\"px\"):o.hide(this.el)}},e}(r.AnnotationView);n.TooltipView=a,a.prototype.className=\"bk-tooltip\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,n){var i;return(i=this.data).push([t,e,n]),this.data=i,this.properties.data.change.emit()},e}(r.Annotation);n.Tooltip=l,l.prototype.default_view=a,l.prototype.type=\"Tooltip\",l.define({attachment:[s.String,\"horizontal\"],inner_only:[s.Bool,!0],show_arrow:[s.Bool,!0]}),l.override({level:\"overlay\"}),l.internal({data:[s.Any,[]],custom:[s.Any]})},function(t,e,n){var i=t(364),r=t(51),o=t(173),s=t(53),a=t(15);n.WhiskerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return 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,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_model.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c=\"height\"===a?d:p,o=\"height\"===a?p:d,_=\"height\"===a?l.yview:l.xview,s=\"height\"===a?l.xview:l.yview,n=\"data\"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r=\"data\"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t=\"data\"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f=\"height\"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){if(this._map_data(),e=this.plot_view.canvas_view.ctx,this.visuals.line.doit)for(n=i=0,s=this._lower_sx.length;0<=s?is;n=0<=s?++i:--i)this.visuals.line.set_vectorize(e,n),e.beginPath(),e.moveTo(this._lower_sx[n],this._lower_sy[n]),e.lineTo(this._upper_sx[n],this._upper_sy[n]),e.stroke();if(t=\"height\"===this.model.dimension?0:Math.PI/2,null!=this.model.lower_head)for(n=r=0,a=this._lower_sx.length;0<=a?ra;n=0<=a?++r:--r)e.save(),e.translate(this._lower_sx[n],this._lower_sy[n]),e.rotate(t+Math.PI),this.model.lower_head.render(e,n),e.restore();if(null!=this.model.upper_head){for(u=[],n=o=0,l=this._upper_sx.length;0<=l?ol;n=0<=l?++o:--o)e.save(),e.translate(this._upper_sx[n],this._upper_sy[n]),e.rotate(t),this.model.upper_head.render(e,n),u.push(e.restore());return u}}},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Whisker=l,l.prototype.default_view=n.WhiskerView,l.prototype.type=\"Whisker\",l.mixins([\"line\"]),l.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\"]}),l.override({level:\"underlay\"})},function(t,e,n){var i=t(364),r=t(12),o=t(163),s=t(165),a=t(14),l=t(15),u=t(22),h=t(42);n.AxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var t,e,n;if(!1!==this.model.visible)return e={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},n=this.model.tick_coords,(t=this.plot_view.canvas_view.ctx).save(),this._draw_rule(t,e),this._draw_major_ticks(t,e,n),this._draw_minor_ticks(t,e,n),this._draw_major_labels(t,e,n),this._draw_axis_label(t,e,n),null!=this._render&&this._render(t,e,n),t.restore()},e.prototype.connect_signals=function(){var e=this;return 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._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._draw_rule=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.axis_line.doit){for(d=this.model.rule_coords,h=d[0],_=d[1],f=this.plot_view.map_to_screen(h,_,this.model.x_range_name,this.model.y_range_name),l=f[0],u=f[1],m=this.model.normals,o=m[0],s=m[1],v=this.model.offsets,c=v[0],p=v[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(l[0]+o*c),Math.round(u[0]+s*p)),i=r=1,a=l.length;1<=a?ra;i=1<=a?++r:--r)l=Math.round(l[i]+o*c),u=Math.round(u[i]+s*p),t.lineTo(l,u);t.stroke();var d,f,m,v}},e.prototype._draw_major_ticks=function(t,e,n){var i,r,o;i=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line,this._draw_ticks(t,n.major,i,r,o)},e.prototype._draw_minor_ticks=function(t,e,n){var i,r,o;i=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line,this._draw_ticks(t,n.minor,i,r,o)},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a;i=n.major,r=this.model.compute_labels(i[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,i,o,this.model.panel_side,s,a)},e.prototype._draw_axis_label=function(t,e,n){var i,r,o,s,a;if(null!=this.model.axis_label&&0!==this.model.axis_label.length){switch(this.model.panel.side){case\"above\":o=this.model.panel._hcenter.value,s=this.model.panel._bottom.value;break;case\"below\":o=this.model.panel._hcenter.value,s=this.model.panel._top.value;break;case\"left\":o=this.model.panel._right.value,s=this.model.panel._vcenter._value;break;case\"right\":o=this.model.panel._left.value,s=this.model.panel._vcenter._value}i=[[o],[s]],r=e.tick+u.sum(e.tick_label)+this.model.axis_label_standoff,a=this.visuals.axis_label_text,this._draw_oriented_labels(t,[this.model.axis_label],i,\"parallel\",this.model.panel_side,r,a,\"screen\")}},e.prototype._draw_ticks=function(t,e,n,i,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(r.doit&&0!==e.length){for(b=e[0],w=e[1],S=this.plot_view.map_to_screen(b,w,this.model.x_range_name,this.model.y_range_name),m=S[0],y=S[1],T=this.model.normals,a=T[0],h=T[1],M=this.model.offsets,x=M[0],k=M[1],l=(A=[a*(x-n),h*(k-n)])[0],c=A[1],u=(E=[a*(x+i),h*(k+i)])[0],_=E[1],r.set_value(t),o=s=0,p=m.length;0<=p?sp;o=0<=p?++s:--s)d=Math.round(m[o]+u),v=Math.round(y[o]+_),f=Math.round(m[o]+l),g=Math.round(y[o]+c),t.beginPath(),t.moveTo(d,v),t.lineTo(f,g),t.stroke();var S,T,M,A,E}},e.prototype._draw_oriented_labels=function(t,e,n,i,r,o,s,a){void 0===a&&(a=\"data\");var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S;if(s.doit&&0!==e.length){for(\"screen\"===a?(b=n[0],w=n[1],k=(T=[0,0])[0],S=T[1]):(u=n[0],c=n[1],M=this.plot_view.map_to_screen(u,c,this.model.x_range_name,this.model.y_range_name),b=M[0],w=M[1],A=this.model.offsets,k=A[0],S=A[1]),E=this.model.normals,d=E[0],m=E[1],f=d*(k+o),v=m*(S+o),s.set_value(t),this.model.panel.apply_label_text_heuristics(t,i),l=h.isString(i)?this.model.panel.get_label_angle_heuristic(i):-i,_=p=0,g=b.length;0<=g?pg;_=0<=g?++p:--p)y=Math.round(b[_]+f),x=Math.round(w[_]+v),t.translate(y,x),t.rotate(l),t.fillText(e[_],0,0),t.rotate(-l),t.translate(-y,-x);var T,M,A,E}},e.prototype._axis_label_extent=function(){var t,e;return null==this.model.axis_label||\"\"===this.model.axis_label?0:(t=this.model.axis_label_standoff,e=this.visuals.axis_label_text,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 u.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t,e,n,i,r;return t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),n=this.model.major_label_orientation,i=this.model.major_label_standoff,r=this.visuals.major_label_text,[this._oriented_labels_extent(e,n,this.model.panel_side,i,r)]},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._oriented_labels_extent=function(t,e,n,i,r){var o,s,a,l,u,c,_,p,d,f,m,v;if(0===t.length)return 0;for(a=this.plot_view.canvas_view.ctx,r.set_value(a),h.isString(e)?(c=1,o=this.model.panel.get_label_angle_heuristic(e)):(c=2,o=-e),o=Math.abs(o),s=Math.cos(o),f=Math.sin(o),l=0,_=p=0,d=t.length;0<=d?pd;_=0<=d?++p:--p)v=1.1*a.measureText(t[_]).width,u=.9*a.measureText(t[_]).ascent,(m=\"above\"===n||\"below\"===n?v*f+u/c*s:v*s+u/c*f)>l&&(l=m);return l>0&&(l+=i),l},e}(s.RendererView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_labels=function(t){var e,n,i,r;for(i=this.formatter.doFormat(t,this),e=n=0,r=t.length;0<=r?nr;e=0<=r?++n:--n)t[e]in this.major_label_overrides&&(i[e]=this.major_label_overrides[t[e]]);return i},e.prototype.label_info=function(t){var e;return e=this.major_label_orientation,{dim:this.dimension,coords:t,side:this.panel_side,orient:e,standoff:this.major_label_standoff}},e.prototype.add_panel=function(t){return this.panel=new r.SidePanel({side:t}),this.panel.attach_document(this.document),this.panel_side=t},e.prototype._offsets=function(){var t,e,n,i;switch(e=this.panel_side,r=[0,0],n=r[0],i=r[1],t=this.plot.plot_canvas.frame,e){case\"below\":i=Math.abs(this.panel._top.value-t._bottom.value);break;case\"above\":i=Math.abs(this.panel._bottom.value-t._top.value);break;case\"right\":n=Math.abs(this.panel._left.value-t._right.value);break;case\"left\":n=Math.abs(this.panel._right.value-t._left.value)}return[n,i];var r},e.prototype._ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype._computed_bounds=function(){var t,e,n,i,r,o;return s=this.ranges,e=s[0],s[1],o=null!=(i=this.bounds)?i:\"auto\",n=[e.min,e.max],\"auto\"===o?n:h.isArray(o)?(Math.abs(o[0]-o[1])>Math.abs(n[0]-n[1])?(r=Math.max(Math.min(o[0],o[1]),n[0]),t=Math.min(Math.max(o[0],o[1]),n[1])):(r=Math.min(o[0],o[1]),t=Math.max(o[0],o[1])),[r,t]):(a.logger.error(\"user bounds '\"+o+\"' not understood\"),null);var s},e.prototype._rule_coords=function(){var t,e,n,i,r,o,s,a;return n=this.dimension,i=(n+1)%2,l=this.ranges,r=l[0],l[1],u=this.computed_bounds,o=u[0],e=u[1],s=new Array(2),a=new Array(2),t=[s,a],t[n][0]=Math.max(o,r.min),t[n][1]=Math.min(e,r.max),t[n][0]>t[n][1]&&(t[n][0]=t[n][1]=NaN),t[i][0]=this.loc,t[i][1]=this.loc,t;var l,u},e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m;for(n=this.dimension,r=(n+1)%2,v=this.ranges,h=v[0],v[1],g=this.computed_bounds,f=g[0],e=g[1],m=this.ticker.get_ticks(f,e,h,this.loc,{}),a=m.major,u=m.minor,t=[[],[]],l=[[],[]],y=[h.min,h.max],_=y[0],c=y[1],i=o=0,p=a.length;0<=p?op;i=0<=p?++o:--o)a[i]<_||a[i]>c||(t[n].push(a[i]),t[r].push(this.loc));for(i=s=0,d=u.length;0<=d?sd;i=0<=d?++s:--s)u[i]<_||u[i]>c||(l[n].push(u[i]),l[r].push(this.loc));return{major:t,minor:l};var v,g,y},e.prototype._get_loc=function(){var t;switch(e=this.ranges,e[0],t=e[1],t.start,t.end,this.panel_side){case\"left\":case\"below\":return t.start;case\"right\":case\"above\":return t.end}var e},e}(o.GuideRenderer);n.Axis=c,c.prototype.default_view=n.AxisView,c.prototype.type=\"Axis\",c.mixins([\"line:axis_\",\"line:major_tick_\",\"line:minor_tick_\",\"text:major_label_\",\"text:axis_label_\"]),c.define({bounds:[l.Any,\"auto\"],ticker:[l.Instance,null],formatter:[l.Instance,null],x_range_name:[l.String,\"default\"],y_range_name:[l.String,\"default\"],axis_label:[l.String,\"\"],axis_label_standoff:[l.Int,5],major_label_standoff:[l.Int,5],major_label_orientation:[l.Any,\"horizontal\"],major_label_overrides:[l.Any,{}],major_tick_in:[l.Number,2],major_tick_out:[l.Number,6],minor_tick_in:[l.Number,0],minor_tick_out:[l.Number,4]}),c.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\"}),c.internal({panel_side:[l.Any]}),c.getters({computed_bounds:function(){return this._computed_bounds()},rule_coords:function(){return this._rule_coords()},tick_coords:function(){return this._tick_coords()},ranges:function(){return this._ranges()},normals:function(){return this.panel._normals},dimension:function(){return this.panel._dim},offsets:function(){return this._offsets()},loc:function(){return this._get_loc()}})},function(t,e,n){var i=t(364),r=t(69),o=t(92),s=t(181);n.CategoricalAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){return this._draw_group_separators(t,e,n)},e.prototype._draw_group_separators=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;if(w=this.model.ranges,m=w[0],w[1],k=this.model.computed_bounds,b=k[0],s=k[1],d=this.model.loc,this.model.ticker.get_ticks(b,s,m,d,{}),S=this.model.ranges,m=S[0],S[1],m.tops&&!(m.tops.length<2)&&this.visuals.separator_line.doit){for(o=this.model.dimension,i=(o+1)%2,r=[[],[]],u=0,l=c=0,v=m.tops.length-1;0<=v?cv;l=0<=v?++c:--c){for(h=_=g=u,y=m.factors.length;g<=y?_y;h=g<=y?++_:--_)if(m.factors[h][0]===m.tops[l+1]){T=[m.factors[h-1],m.factors[h]],a=T[0],p=T[1],u=h;break}(f=(m.synthetic(a)+m.synthetic(p))/2)>b&&fh;o=0<=h?++a:--a)p=s[o],l=p[0],i=p[1],u=p[2],_=p[3],this._draw_oriented_labels(t,l,i,u,this.model.panel_side,c,_),c+=e.tick_label[o];var p},e.prototype._tick_label_extents=function(){var t,e,n,i,r,o,s,a;for(n=this._get_factor_info(),e=[],i=0,o=n.length;i1&&(t.tops[n]=s.tops,t.tops[i]=function(){var t,e,n,i;for(n=s.tops,i=[],t=0,e=n.length;ti;e=0<=i?++n:--n)r.push(this[e]=t[e]);return r});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(u.div({class:\"bk-canvas-map\"})):null,this.model.output_backend){case\"canvas\":case\"webgl\":this.canvas_el=this.el.appendChild(u.canvas({class:\"bk-canvas\"})),this._ctx=this.canvas_el.getContext(\"2d\");break;case\"svg\":this._ctx=new c,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}return this.overlays_el=this.el.appendChild(u.div({class:\"bk-canvas-overlays\"})),this.events_el=this.el.appendChild(u.div({class:\"bk-canvas-events\"})),this.ctx=this.get_ctx(),h.fixup_ctx(this.ctx),a.logger.debug(\"CanvasView initialized\")},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,e,n;return n=this.model._width.value,t=this.model._height.value,this.el.style.width=n+\"px\",this.el.style.height=t+\"px\",e=h.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend),this.model.pixel_ratio=e,this.canvas_el.style.width=n+\"px\",this.canvas_el.style.height=t+\"px\",this.canvas_el.setAttribute(\"width\",n*e),this.canvas_el.setAttribute(\"height\",t*e),a.logger.debug(\"Rendering CanvasView with width: \"+n+\", height: \"+t+\", pixel ratio: \"+e)},e.prototype.set_dims=function(t){var e=t[0],n=t[1];if(0!==e&&0!==n)return 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)),n!==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,-n),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables()},e}(o.DOMView);n.CanvasView=_,_.prototype.className=\"bk-canvas-wrapper\";var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LayoutCanvas);n.Canvas=p,p.prototype.type=\"Canvas\",p.prototype.default_view=_,p.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,\"canvas\"]}),p.getters({panel:function(){return this}})},function(t,e,n){var i=t(364),r=t(166),o=t(168),s=t(169),a=t(160),l=t(156),u=t(157),h=t(11),c=t(15),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){var i=this;return t.prototype.initialize.call(this,e,n),this._configure_scales(),this.connect(this.change,function(){return i._configure_scales()})},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,n,i){void 0===n&&(n=\"default\"),void 0===i&&(i=\"default\");var r,o;return r=this.xscales[n].v_compute(t),o=this.yscales[i].v_compute(e),[r,o]},e.prototype._get_ranges=function(t,e){var n,i,r;if(r={},r.default=t,null!=e)for(i in e)n=e[i],r[i]=n;return r},e.prototype._get_scales=function(t,e,n){var i,h,c,_;_={};for(i in e){if((h=e[i])instanceof l.DataRange1d||h instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error(\"Range \"+h.type+\" is incompatible is Scale \"+t.type);if(t instanceof r.CategoricalScale)throw new Error(\"Range \"+h.type+\" is incompatible is Scale \"+t.type)}if(h instanceof u.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error(\"Range \"+h.type+\" is incompatible is Scale \"+t.type);t instanceof s.LogScale&&h instanceof l.DataRange1d&&(h.scale_hint=\"log\"),(c=t.clone()).setv({source_range:h,target_range:n}),_[i]=c}return _},e.prototype._configure_frame_ranges=function(){return 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(){return 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(){var t,e,n;this._configure_frame_ranges(),e=this._xscales;for(t in e)e[t].target_range=this._h_target;n=this._yscales;for(t in n)n[t].target_range=this._v_target;return null},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}(h.LayoutCanvas);n.CartesianFrame=_,_.prototype.type=\"CartesianFrame\",_.getters({panel:function(){return this}}),_.internal({extra_x_ranges:[c.Any,{}],extra_y_ranges:[c.Any,{}],x_range:[c.Instance],y_range:[c.Instance],x_scale:[c.Instance],y_scale:[c.Instance]})},function(t,e,n){var i=t(79);n.Canvas=i.Canvas;var r=t(80);n.CartesianFrame=r.CartesianFrame},function(t,e,n){var i=t(364),r=t(50);n.Expression=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._connected={},this._result={}},e.prototype._v_compute=function(t){return null==this._connected[t.id]&&(this.connect(t.change,function(){return this._result[t.id]=null}),this._connected[t.id]=!0),null!=this._result[t.id]?this._result[t.id]:(this._result[t.id]=this.v_compute(t),this._result[t.id])},e}(r.Model)},function(t,e,n){var i=t(82);n.Expression=i.Expression;var r=t(84);n.Stack=r.Stack},function(t,e,n){var i=t(364),r=t(82),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h;for(u=new Float64Array(t.get_length()),a=this.fields,i=0,o=a.length;i0?a.all(this.booleans,l.isBoolean)?(this.booleans.length!==t.get_length()&&s.logger.warn(\"BooleanFilter \"+this.id+\": length of booleans doesn't match data source\"),function(){var t,n,i,r;for(i=a.range(0,this.booleans.length),r=[],t=0,n=i.length;t=0?a.all(this.filter,s.isBoolean)?function(){var e,n,i,r;for(i=a.range(0,this.filter.length),r=[],e=0,n=i.length;er;n=0<=r?++i:--i)e[n]===this.group&&o.push(n);return o}.call(this),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);n.GroupFilter=a,a.prototype.type=\"GroupFilter\",a.define({column_name:[o.String],group:[o.String]})},function(t,e,n){var i=t(85);n.BooleanFilter=i.BooleanFilter;var r=t(86);n.CustomJSFilter=r.CustomJSFilter;var o=t(87);n.Filter=o.Filter;var s=t(88);n.GroupFilter=s.GroupFilter;var a=t(90);n.IndexFilter=a.IndexFilter},function(t,e,n){var i=t(364),r=t(87),o=t(15),s=t(14),a=t(42),l=t(22),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e;return(null!=(e=this.indices)?e.length:void 0)>=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);n.IndexFilter=u,u.prototype.type=\"IndexFilter\",u.define({indices:[o.Array,null]})},function(t,e,n){var i=t(364),r=t(100),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.last_precision=3},e.prototype.doFormat=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(0===t.length)return[];if(k=0,t.length>=2&&(k=Math.abs(t[1]-t[0])/1e4),_=!1,this.use_scientific)for(r=0,u=t.length;rk&&(x>=this.scientific_limit_high||x<=this.scientific_limit_low)){_=!0;break}if(null==(d=this.precision)||s.isNumber(d)){if(l=new Array(t.length),_)for(n=o=0,f=t.length;0<=f?of;n=0<=f?++o:--o)l[n]=t[n].toExponential(d||void 0);else for(n=a=0,m=t.length;0<=m?am;n=0<=m?++a:--a)l[n]=t[n].toFixed(d||void 0).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\");return l}if(\"auto\"===d)for(l=new Array(t.length),w=h=v=this.last_precision;v<=15?h<=15:h>=15;w=v<=15?++h:--h){if(i=!0,_){for(n=c=0,g=t.length;0<=g?cg;n=0<=g?++c:--c)if(l[n]=t[n].toExponential(w),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}else{for(n=p=0,y=t.length;0<=y?py;n=0<=y?++p:--p)if(l[n]=t[n].toFixed(w).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\"),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}if(i)return this.last_precision=w,l}return l},e}(r.TickFormatter);n.BasicTickFormatter=a,a.prototype.type=\"BasicTickFormatter\",a.define({precision:[o.Any,\"auto\"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]}),a.getters({scientific_limit_low:function(){return Math.pow(10,this.power_limit_low)},scientific_limit_high:function(){return Math.pow(10,this.power_limit_high)}})},function(t,e,n){var i=t(364),r=t(100),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){return t},e}(r.TickFormatter);n.CategoricalTickFormatter=o,o.prototype.type=\"CategoricalTickFormatter\"},function(t,e,n){var i,r,o,s=t(364),a=t(362),l=t(363),u=t(100),h=t(14),c=t(15),_=t(22),p=t(42);o=function(t){return Math.round(t/1e3%1*1e6)},i=function(t){return l(t,\"%Y %m %d %H %M %S\").split(/\\s+/).map(function(t){return parseInt(t,10)})},r=function(t,e){var n;return p.isFunction(e)?e(t):(n=a.sprintf(\"$1%06d\",o(t)),-1===(e=e.replace(/((^|[^%])(%%)*)%f/,n)).indexOf(\"%\")?e:l(t,e))};var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e;return e=l(new Date),t=function(t){var n,i,o;return i=function(){var i,o,s;for(s=[],i=0,o=t.length;i=60?\"minsec\":\"seconds\";case!(n<3600):return e>=3600?\"hourmin\":\"minutes\";case!(n<86400):return\"hours\";case!(n<2678400):return\"days\";case!(n<31536e3):return\"months\";default:return\"years\"}},e.prototype.doFormat=function(t,e,n,o,s,a){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=.3),void 0===a&&(a=null);var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j,P,D;if(0===t.length)return[];if(C=Math.abs(t[t.length-1]-t[0])/1e3,S=a?a.resolution:C/(t.length-1),A=this._get_resolution_str(S,C),F=this._width_formats[A],D=F[0],_=F[1],c=_[0],o){for(p=[],f=m=0,T=D.length;0<=T?mT;f=0<=T?++m:--m)D[f]*t.length0&&(c=p[p.length-1])}for(y=[],E=this.format_order.indexOf(A),j={},M=this.format_order,v=0,b=M.length;vs;i=0<=s?++r:--r)if(o[i]=n+\"^\"+Math.round(Math.log(t[i])/Math.log(n)),i>0&&o[i]===o[i-1]){a=!0;break}return a&&(o=this.basic_formatter.doFormat(t)),o},e}(o.TickFormatter);n.LogTickFormatter=l,l.prototype.type=\"LogTickFormatter\",l.define({ticker:[a.Instance,null]})},function(t,e,n){var i=t(364),r=t(91),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(e,n){var i,r,o,a,l,u,h,c;if(null==this.dimension)throw new Error(\"MercatorTickFormatter.dimension not configured\");if(0===e.length)return[];if(u=new Array(e.length),\"lon\"===this.dimension)for(i=r=0,h=e.length;0<=h?rh;i=0<=h?++r:--r)_=s.proj4(s.mercator).inverse([e[i],n.loc]),l=_[0],a=_[1],u[i]=l;else for(i=o=0,c=e.length;0<=c?oc;i=0<=c?++o:--o)p=s.proj4(s.mercator).inverse([n.loc,e[i]]),l=p[0],a=p[1],u[i]=a;return t.prototype.doFormat.call(this,u,n);var _,p},e}(r.BasicTickFormatter);n.MercatorTickFormatter=a,a.prototype.type=\"MercatorTickFormatter\",a.define({dimension:[o.LatLon]})},function(t,e,n){var i=t(364),r=t(332),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i,o,s;return n=this.format,i=this.language,o=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}}.call(this),function(){var e,a,l;for(l=[],e=0,a=t.length;en;t=0<=n?++e:--e)i.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return i},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._start_angle,c=n._angle,_=n.sinner_radius,p=n.souter_radius;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o=h&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],_=0,d=i.length;_=0||navigator.userAgent.indexOf(\"Trident\")>0||navigator.userAgent.indexOf(\"Edge\")>0,this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,r),t.beginPath(),o)for(a=0,u=(h=[!1,!0]).length;a=s&&i.push([r,n]);return o.create_1d_hit_test_result(i);var k,S},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_;return a=[o],c={},c[o]=(e+n)/2,_={},_[o]=(i+r)/2,l=.5*Math.min(Math.abs(n-e),Math.abs(r-i)),u={},u[o]=.4*l,h={},h[o]=.8*l,s={sx:c,sy:_,sinner_radius:u,souter_radius:h},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Annulus=a,a.prototype.default_view=n.AnnulusView,a.prototype.type=\"Annulus\",a.mixins([\"line\",\"fill\"]),a.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.ArcView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return\"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,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;if(this.visuals.line.doit){for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;or;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx0[t]+this._cy0[t]+this._cx1[t]+this._cy1[t])||(h=i(this._x0[t],this._y0[t],this._x1[t],this._y1[t],this._cx0[t],this._cy0[t],this._cx1[t],this._cy1[t]),s=h[0],l=h[1],a=h[2],u=h[3],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=(n.scx,n.scx0),_=n.scy0,p=n.scx1,d=n.scy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;rl;n=0<=l?++i:--i)h=this._lrtb(n),o=h[0],a=h[1],u=h[2],e=h[3],!isNaN(o+a+u+e)&&isFinite(o+a+u+e)&&s.push({minX:o,minY:e,maxX:a,maxY:u,i:n});return new r.RBush(s);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sleft,l=n.sright,u=n.stop,h=n.sbottom;for(s=[],r=0,o=e.length;re;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?sa;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l[\"1d\"].indices=n,l},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h;return a=[o],u={},u[o]=(e+n)/2,h={},h[o]=(i+r)/2,l={},l[o]=.2*Math.min(Math.abs(n-e),Math.abs(r-i)),s={sx:u,sy:h,sradius:l},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.properties.radius.optional=!0},e}(r.XYGlyph);n.Circle=a,a.prototype.default_view=n.CircleView,a.prototype.type=\"Circle\",a.mixins([\"line\",\"fill\"]),a.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:\"screen\",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,\"x\"]})},function(t,e,n){var i=t(364),r=t(128),o=t(15);n.EllipseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(){if(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)return this.max_h2=this.max_height/2},e.prototype._map_data=function(){return\"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,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ellipse=s,s.prototype.default_view=n.EllipseView,s.prototype.type=\"Ellipse\",s.mixins([\"line\",\"fill\"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(9),o=t(15),s=t(23),a=t(32),l=t(45),u=t(50),h=t(46),c=t(14),_=t(30),p=t(42),d=t(114);n.GlyphView=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.initialize=function(n){var i,r,o,s;if(e.prototype.initialize.call(this,n),this._nohit_warned={},this.renderer=n.renderer,this.visuals=new h.Visuals(this.model),null!=(r=this.renderer.plot_view.canvas_view.ctx).glcanvas){try{s=t(425)}catch(t){if(\"MODULE_NOT_FOUND\"!==(o=t).code)throw o;c.logger.warn(\"WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering.\"),s=null}if(null!=s&&null!=(i=s[this.model.type+\"GLGlyph\"]))return this.glglyph=new i(r.glcanvas.gl,this)}},n.prototype.set_visuals=function(t){if(this.visuals.warm_cache(t),null!=this.glglyph)return this.glglyph.set_visuals_changed()},n.prototype.render=function(t,e,n){if(t.beginPath(),null==this.glglyph||!this.glglyph.render(t,e,n))return this._render(t,e,n)},n.prototype.has_finished=function(){return!0},n.prototype.notify_finished=function(){return this.renderer.notify_finished()},n.prototype.bounds=function(){return null==this.index?s.empty():this._bounds(this.index.bbox)},n.prototype.log_bounds=function(){var t,e,n,i,r,o,a,l,u;if(null==this.index)return s.empty();for(t=s.empty(),o=this.index.search(s.positive_x()),a=this.index.search(s.positive_y()),e=0,i=o.length;et.maxX&&(t.maxX=l.maxX);for(n=0,r=a.length;nt.maxY&&(t.maxY=u.maxY);return this._bounds(t)},n.prototype.max_wh2_bounds=function(t){return{minX:t.minX-this.max_w2,maxX:t.maxX+this.max_w2,minY:t.minY-this.max_h2,maxY:t.maxY+this.max_h2}},n.prototype.get_anchor_point=function(t,e,n){var i=n[0],r=n[1];switch(t){case\"center\":return{x:this.scx(e,i,r),y:this.scy(e,i,r)};default:return null}},n.prototype.scx=function(t){return this.sx[t]},n.prototype.scy=function(t){return this.sy[t]},n.prototype.sdist=function(t,e,n,i,r){void 0===i&&(i=\"edge\"),void 0===r&&(r=!1);var o,s,a,l,u,h,c;return null!=t.source_range.v_synthetic&&(e=t.source_range.v_synthetic(e)),\"center\"===i?(s=function(){var t,e,i;for(i=[],t=0,e=n.length;tn;a=0<=n?++t:--t)i.push(e[a]-s[a]);return i}(),u=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?tn;a=0<=n?++t:--t)i.push(e[a]+s[a]);return i}()):(l=e,u=function(){var t,e,i;for(i=[],a=t=0,e=l.length;0<=e?te;a=0<=e?++t:--t)i.push(l[a]+n[a]);return i}()),h=t.v_compute(l),c=t.v_compute(u),r?function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?te;a=0<=e?++t:--t)n.push(Math.ceil(Math.abs(c[a]-h[a])));return n}():function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?te;a=0<=e?++t:--t)n.push(Math.abs(c[a]-h[a]));return n}()},n.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return null},n.prototype._generic_line_legend=function(t,e,n,i,r,o){return t.save(),t.beginPath(),t.moveTo(e,(i+r)/2),t.lineTo(n,(i+r)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,o),t.stroke()),t.restore()},n.prototype._generic_area_legend=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p;if([o],p=Math.abs(n-e),a=.1*p,l=Math.abs(r-i),s=.1*l,u=e+a,h=n-a,c=i+s,_=r-s,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,o),t.fillRect(u,c,h-u,_-c)),this.visuals.line.doit)return t.beginPath(),t.rect(u,c,h-u,_-c),this.visuals.line.set_vectorize(t,o),t.stroke()},n.prototype.hit_test=function(t){var e,n;return n=null,e=\"_hit_\"+t.type,null!=this[e]?n=this[e](t):null==this._nohit_warned[t.type]&&(c.logger.debug(\"'\"+t.type+\"' selection not available for \"+this.model.type),this._nohit_warned[t.type]=!0),n},n.prototype._hit_rect_against_index=function(t){var e,n,i,o,s,a,l,u,h,c;return i=t.sx0,o=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,o),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=r.validate_bbox_coords([l,u],[h,c]),n=r.create_hit_test_result(),n[\"1d\"].indices=this.index.indices(e),n;var _,p},n.prototype.set_data=function(t,e,n){var i,r,o,s,l,u,h,c,p,f,m,v;if(i=this.model.materialize_dataspecs(t),this.visuals.set_all_indices(e),e&&!(this instanceof d.LineView)){r={};for(l in i)c=i[l],\"_\"===l.charAt(0)?r[l]=function(){var t,n,i;for(i=[],t=0,n=e.length;tl;t=0<=l?++n:--n)g=this.map_to_screen(this[d][t],this[f][t]),u=g[0],c=g[1],this[h].push(u),this[_].push(c);else y=this.map_to_screen(this[d],this[f]),this[h]=y[0],this[_]=y[1];return this._map_data();var m,v,g,y},n.prototype._map_data=function(){},n.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)},n}(l.View);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.coords=function(t){var e,n,i,r,s,a;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,r={},n=0,i=t.length;nn;t=0<=n?++e:--e)this.stop.push(this.sy[t]-this.sh[t]/2),this.sbottom.push(this.sy[t]+this.sh[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.HBar=s,s.prototype.default_view=n.HBarView,s.prototype.type=\"HBar\",s.coords([[\"left\",\"y\"]]),s.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),s.override({left:0})},function(t,e,n){var i=t(364),r=t(128),o=t(146),s=t(15),a=t(22);n.ImageView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return this._update_image()})},e.prototype._update_image=function(){if(null!=this.image_data)return this._set_data(),this.renderer.plot_view.request_render()},e.prototype._set_data=function(){var t,e,n,i,r,o,s,l,u,h,c,_;for(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)),c=[],o=u=0,h=this._image.length;0<=h?uh;o=0<=h?++u:--u)_=[],null!=this._image_shape&&(_=this._image_shape[o]),_.length>0?(l=this._image[o],this._height[o]=_[0],this._width[o]=_[1]):(l=a.concat(this._image[o]),this._height[o]=this._image[o].length,this._width[o]=this._image[o][0].length),null!=this.image_data[o]&&this.image_data[o].width===this._width[o]&&this.image_data[o].height===this._height[o]?n=this.image_data[o]:((n=document.createElement(\"canvas\")).width=this._width[o],n.height=this._height[o]),r=n.getContext(\"2d\"),s=r.getImageData(0,0,this._width[o],this._height[o]),i=this.model.color_mapper,t=i.v_map_screen(l,!0),e=new Uint8Array(t),s.data.set(e),r.putImageData(s,0,0),this.image_data[o]=n,this.max_dw=0,\"data\"===this._dw.units&&(this.max_dw=a.max(this._dw)),this.max_dh=0,\"data\"===this._dh.units?c.push(this.max_dh=a.max(this._dh)):c.push(void 0);return c},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\":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);case\"screen\":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;rd;u=0<=d?++_:--_)if(!(null!=e&&e.indexOf(u)<0)){if(v=[],null!=this._image_shape&&(v=this._image_shape[u]),v.length>0)n=this._image[u].buffer,this._height[u]=v[0],this._width[u]=v[1];else{for(l=s.concat(this._image[u]),n=new ArrayBuffer(4*l.length),o=new Uint32Array(n),c=p=0,f=l.length;0<=f?pf;c=0<=f?++p:--p)o[c]=l[c];this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length}null!=this.image_data[u]&&this.image_data[u].width===this._width[u]&&this.image_data[u].height===this._height[u]?r=this.image_data[u]:((r=document.createElement(\"canvas\")).width=this._width[u],r.height=this._height[u]),a=r.getContext(\"2d\"),h=a.getImageData(0,0,this._width[u],this._height[u]),i=new Uint8Array(n),h.data.set(i),a.putImageData(h,0,0),this.image_data[u]=r,this.max_dw=0,\"data\"===this._dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,\"data\"===this._dh.units?m.push(this.max_dh=s.max(this._dh)):m.push(void 0)}return m},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\":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);case\"screen\":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;ri;t=0<=i?++n:--n)null!=this._url[t]&&((e=new Image).onerror=function(t,e){return function(){return l.retries[t]>0?(o.logger.trace(\"ImageURL failed to load \"+l._url[t]+\" image, retrying in \"+a+\" ms\"),setTimeout(function(){return e.src=l._url[t]},a)):o.logger.warn(\"ImageURL unable to load \"+l._url[t]+\" image after \"+s+\" retries\"),l.retries[t]-=1}}(t,e),e.onload=function(t,e){return function(){return l.image[e]=t,l.renderer.request_render()}}(e,t),r.push(e.src=this._url[t]));return r},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&!0===this._images_rendered},e.prototype._map_data=function(){var t,e,n;switch(e=function(){var t,e,i,r;if(null!=this.model.w)return this._w;for(i=this._x,r=[],t=0,e=i.length;t1&&(t.stroke(),i=!1)}i?t.lineTo(l[r],u[r]):(t.beginPath(),t.moveTo(l[r],u[r]),i=!0),s=r}if(i)return t.stroke()},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c;for(u=o.create_hit_test_result(),a={x:t.sx,y:t.sy},h=9999,c=Math.max(2,this.visuals.line.line_width.value()/2),n=i=0,l=this.sx.length-1;0<=l?il;n=0<=l?++i:--i)_=[{x:this.sx[n],y:this.sy[n]},{x:this.sx[n+1],y:this.sy[n+1]}],r=_[0],s=_[1],(e=o.dist_to_segment(a,r,s))i;e=0<=i?++n:--n)(u[e]<=l&&l<=u[e+1]||u[e+1]<=l&&l<=u[e])&&(r[\"0d\"].glyph=this.model,r[\"0d\"].get_view=function(){return this}.bind(this),r[\"0d\"].flag=!0,r[\"0d\"].indices.push(e));return r},e.prototype.get_interpolation_hit=function(t,e){var n,i,r,s,a,l,u,h,c,_,p;return i=e.sx,r=e.sy,d=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],l=d[0],_=d[1],u=d[2],p=d[3],\"point\"===e.type?(f=this.renderer.yscale.r_invert(r-1,r+1),h=f[0],c=f[1],m=this.renderer.xscale.r_invert(i-1,i+1),s=m[0],a=m[1]):\"v\"===e.direction?(v=this.renderer.yscale.r_invert(r,r),h=v[0],c=v[1],s=(g=[l,u])[0],a=g[1]):(y=this.renderer.xscale.r_invert(i,i),s=y[0],a=y[1],h=(b=[_,p])[0],c=b[1]),n=o.check_2_segments_intersect(s,h,a,c,l,_,u,p),[n.x,n.y];var d,f,m,v,g,y,b},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Line=s,s.prototype.default_view=n.LineView,s.prototype.type=\"Line\",s.mixins([\"line\"])},function(t,e,n){var i=t(364),r=t(36),o=t(9),s=t(22),a=t(42),l=t(108);n.MultiLineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,l,u,h;for(n=[],t=e=0,i=this._xs.length;0<=i?ei;t=0<=i?++e:--e)null!==this._xs[t]&&0!==this._xs[t].length&&(l=function(){var e,n,i,r;for(i=this._xs[t],r=[],e=0,n=i.length;el;r=0<=l?++s:--s)0!==r?isNaN(h[r])||isNaN(c[r])?(t.stroke(),t.beginPath()):t.lineTo(h[r],c[r]):(t.beginPath(),t.moveTo(h[r],c[r]));u.push(t.stroke())}return u;var d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m;for(d=o.create_hit_test_result(),h={x:t.sx,y:t.sy},f=9999,n={},i=s=0,_=this.sxs.length;0<=_?s<_:s>_;i=0<=_?++s:--s){for(m=Math.max(2,this.visuals.line.cache_select(\"line_width\",i)/2),c=null,r=a=0,p=this.sxs[i].length-1;0<=p?ap;r=0<=p?++a:--a)v=[{x:this.sxs[i][r],y:this.sys[i][r]},{x:this.sxs[i][r+1],y:this.sys[i][r+1]}],l=v[0],u=v[1],(e=o.dist_to_segment(h,l,u))l;n=0<=l?++r:--r){for(a=[],i=s=0,u=d[n].length-1;0<=u?su;i=0<=u?++s:--s)d[n][i]<=p&&p<=d[n][i+1]&&a.push(i);a.length>0&&(e[n]=a)}return h[\"1d\"].indices=function(){var t,i,r,o;for(r=Object.keys(e),o=[],i=0,t=r.length;i1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Oval=s,s.prototype.default_view=n.OvalView,s.prototype.type=\"Oval\",s.mixins([\"line\",\"fill\"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){var i=t(364),r=t(128);n.PatchView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;if(this.visuals.fill.doit){for(this.visuals.fill.set_value(t),r=0,s=e.length;rc;i=0<=c?++r:--r)for(n[i]=[],u=s.copy(t[i]);u.length>0;)(o=s.findLastIndex(u,function(t){return a.isStrictNaN(t)}))>=0?h=u.splice(o):(h=u,u=[]),e=function(){var t,e,n;for(n=[],t=0,e=h.length;ta;t=0<=a?++n:--n)for(e=i=0,l=h[t].length;0<=l?il;e=0<=l?++i:--i)u=h[t][e],c=_[t][e],0!==u.length&&o.push({minX:s.min(u),minY:s.min(c),maxX:s.max(u),maxY:s.max(c),i:t});return new r.RBush(o)},e.prototype._mask_data=function(t){var e,n,i,r,o,s,a;return r=this.renderer.plot_view.frame.x_ranges.default,u=[r.min,r.max],n=u[0],i=u[1],a=this.renderer.plot_view.frame.y_ranges.default,h=[a.min,a.max],o=h[0],s=h[1],e=l.validate_bbox_coords([n,i],[o,s]),this.index.indices(e).sort(function(t,e){return t-e});var u,h},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d=n.sxs,f=n.sys;for(this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(f),c=[],o=0,a=e.length;ou;r=0<=u?++s:--s)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,i),r=l=0,h=_.length;0<=h?lh;r=0<=h?++l:--l)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),c.push(t.stroke())}else c.push(void 0)}return c;var m},e.prototype._hit_point=function(t){var e,n,i,r,o,s,a,u,h,c,_,p,d,f,m,v;for(_=t.sx,d=t.sy,m=this.renderer.xscale.invert(_),v=this.renderer.yscale.invert(d),e=this.index.indices({minX:m,minY:v,maxX:m,maxY:v}),n=[],i=s=0,u=e.length;0<=u?su;i=0<=u?++s:--s)for(r=e[i],p=this.renderer.sxss[r],f=this.renderer.syss[r],o=a=0,h=p.length;0<=h?ah;o=0<=h?++a:--a)l.point_in_poly(_,d,p[o],f[o])&&n.push(r);return c=l.create_hit_test_result(),c[\"1d\"].indices=n,c},e.prototype._get_snap_coord=function(t){var e,n,i,r;for(r=0,e=0,n=t.length;eo;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(s[i]);return null},e.prototype.scy=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.syss[t].length)return this._get_snap_coord(this.sys[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?ro;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(a[i])},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Patches=u,u.prototype.default_view=n.PatchesView,u.prototype.type=\"Patches\",u.coords([[\"xs\",\"ys\"]]),u.mixins([\"line\",\"fill\"])},function(t,e,n){var i=t(364),r=t(105);n.QuadView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_anchor_point=function(t,e,n){var i,r,o,s;switch(r=Math.min(this.sleft[e],this.sright[e]),o=Math.max(this.sright[e],this.sleft[e]),s=Math.min(this.stop[e],this.sbottom[e]),i=Math.max(this.sbottom[e],this.stop[e]),t){case\"top_left\":return{x:r,y:s};case\"top_center\":return{x:(r+o)/2,y:s};case\"top_right\":return{x:o,y:s};case\"center_right\":return{x:o,y:(s+i)/2};case\"bottom_right\":return{x:o,y:i};case\"bottom_center\":return{x:(r+o)/2,y:i};case\"bottom_left\":return{x:r,y:i};case\"center_left\":return{x:r,y:(s+i)/2};case\"center\":return{x:(r+o)/2,y:(s+i)/2}}},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scy=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,n,i,r;return n=this._left[t],i=this._right[t],r=this._top[t],e=this._bottom[t],[n,i,r,e]},e}(r.BoxView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.Quad=o,o.prototype.default_view=n.QuadView,o.prototype.type=\"Quad\",o.coords([[\"right\",\"bottom\"],[\"left\",\"top\"]])},function(t,e,n){var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n){var i,r;return e===(t+n)/2?[t,n]:(r=(t-e)/(t-2*e+n),i=t*Math.pow(1-r,2)+2*e*(1-r)*r+n*Math.pow(r,2),[Math.min(t,n,i),Math.max(t,n,i)])},n.QuadraticView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?er;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx[t]+this._cy[t])||(h=i(this._x0[t],this._cx[t],this._x1[t]),s=h[0],a=h[1],c=i(this._y0[t],this._cy[t],this._y1[t]),l=c[0],u=c[1],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=n.scx,_=n.scy;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;ru;r=0<=u?++s:--s)0===d[r]&&(d[r]=o);for(h=[],a=0,l=e.length;an;t=0<=n?++e:--e)i.push(this.sx[t]-this.sw[t]/2);return i}.call(this)),\"data\"===this.model.properties.height.units?(n=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale,1),this.sh=n[0],this.sy1=n[1]):(this.sh=this._height,this.sy1=function(){var e,n,i;for(i=[],t=e=0,n=this.sy.length;0<=n?en;t=0<=n?++e:--e)i.push(this.sy[t]-this.sh[t]/2);return i}.call(this)),this.ssemi_diag=function(){var e,n,i;for(i=[],t=e=0,n=this.sw.length;0<=n?en;t=0<=n?++e:--e)i.push(Math.sqrt(this.sw[t]/2*this.sw[t]/2+this.sh[t]/2*this.sh[t]/2));return i}.call(this);var e,n},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sx0,c=n.sy1,_=n.sw,p=n.sh,d=n._angle;if(this.visuals.fill.doit)for(r=0,s=e.length;re;s=0<=e?++t:--t)n.push(this.sx0[s]+this.sw[s]/2);return n}.call(this),g=function(){var t,e,n;for(n=[],s=t=0,e=this.sy1.length;0<=e?te;s=0<=e?++t:--t)n.push(this.sy1[s]+this.sh[s]/2);return n}.call(this),h=a.max(this._ddist(0,v,this.ssemi_diag)),c=a.max(this._ddist(1,g,this.ssemi_diag)),k=w-h,S=w+h,M=T-c,A=T+c,r=[],e=o.validate_bbox_coords([k,S],[M,A]),d=this.index.indices(e),l=0,u=d.length;l=0,i=b-this.sy1[s]<=this.sh[s]&&b-this.sy1[s]>=0),i&&x&&r.push(s);return f=o.create_hit_test_result(),f[\"1d\"].indices=r,f},e.prototype._map_dist_corner_for_data_side_length=function(t,e,n,i){var r,o,s,a,l,u,h,c,_,p,d,f;if(this.renderer.plot_view.frame,null!=n.source_range.synthetic&&(t=function(){var e,i,r;for(r=[],e=0,i=t.length;ei;r=0<=i?++n:--n)o.push(Number(t[r])-e[r]/2);return o}(),l=function(){var n,i,o;for(o=[],r=n=0,i=t.length;0<=i?ni;r=0<=i?++n:--n)o.push(Number(t[r])+e[r]/2);return o}(),c=n.v_compute(a),_=n.v_compute(l),d=this.sdist(n,a,e,\"edge\",this.model.dilate),0===i){for(p=c,r=o=0,u=c.length;0<=u?ou;r=0<=u?++o:--o)if(c[r]!==_[r]){p=c[r]<_[r]?c:_;break}return[d,p]}if(1===i){for(p=c,r=s=0,h=c.length;0<=h?sh;r=0<=h?++s:--s)if(c[r]!==_[r]){p=c[r]<_[r]?c:_;break}return[d,p]}},e.prototype._ddist=function(t,e,n){var i,r,o,s,a,l;return s=0===t?this.renderer.xscale:this.renderer.yscale,a=e,l=function(){var t,e,r;for(r=[],i=t=0,e=a.length;0<=e?te;i=0<=e?++t:--t)r.push(a[i]+n[i]);return r}(),r=s.v_invert(a),o=s.v_invert(l),function(){var t,e,n;for(n=[],i=t=0,e=r.length;0<=e?te;i=0<=e?++t:--t)n.push(Math.abs(o[i]-r[i]));return n}()},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Rect=l,l.prototype.default_view=n.RectView,l.prototype.type=\"Rect\",l.mixins([\"line\",\"fill\"]),l.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec],dilate:[s.Bool,!1]})},function(t,e,n){var i=t(364),r=t(9),o=t(36),s=t(108);n.SegmentView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i;for(n=[],t=e=0,i=this._x0.length;0<=i?ei;t=0<=i?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||n.push({minX:Math.min(this._x0[t],this._x1[t]),minY:Math.min(this._y0[t],this._y1[t]),maxX:Math.max(this._x0[t],this._x1[t]),maxY:Math.max(this._y0[t],this._y1[t]),i:t});return new o.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;rs;r=1<=s?++o:--o){switch(this.model.mode){case\"before\":d=[_[r-1],p[r]],a=d[0],h=d[1],f=[_[r],p[r]],l=f[0],c=f[1];break;case\"after\":m=[_[r],p[r-1]],a=m[0],h=m[1],v=[_[r],p[r]],l=v[0],c=v[1];break;case\"center\":u=(_[r-1]+_[r])/2,g=[u,p[r-1]],a=g[0],h=g[1],y=[u,p[r]],l=y[0],c=y[1]}t.lineTo(a,h),t.lineTo(l,c)}return t.lineTo(_[i-1],p[i-1]),t.stroke();var d,f,m,v,g,y}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Step=s,s.prototype.default_view=n.StepView,s.prototype.type=\"Step\",s.mixins([\"line\"]),s.define({mode:[o.StepMode,\"before\"]})},function(t,e,n){var i=t(364),r=t(128),o=t(15),s=t(40);n.TextView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y=n.sx,b=n.sy,x=n._x_offset,w=n._y_offset,k=n._angle,S=n._text;for(m=[],u=0,c=e.length;un;t=0<=n?++e:--e)this.sleft.push(this.sx[t]-this.sw[t]/2),this.sright.push(this.sx[t]+this.sw[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.VBar=s,s.prototype.default_view=n.VBarView,s.prototype.type=\"VBar\",s.coords([[\"x\",\"bottom\"]]),s.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),s.override({bottom:0})},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.WedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return\"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,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;oi;t=0<=i?++e:--e)o=this._x[t],s=this._y[t],!isNaN(o+s)&&isFinite(o+s)&&n.push({minX:o,minY:s,maxX:o,maxY:s,i:t});return new r.RBush(n)},e}(o.GlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.XYGlyph=s,s.prototype.type=\"XYGlyph\",s.prototype.default_view=n.XYGlyphView,s.coords([[\"x\",\"y\"]])},function(t,e,n){var i=t(364),r=t(50),o=t(22),s=t(9);n.GraphHitTestPolicy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.do_selection=function(t,e,n,i){return!1},e.prototype.do_inspection=function(t,e,n,i){return!1},e}(r.Model);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,o;return o=e.node_view,null!==(r=o.glyph.hit_test(t))&&(this._node_selector.update(r,n,i),!this._node_selector.indices.is_empty())},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.model.get_selection_manager().get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesOnly=a,a.prototype.type=\"NodesOnly\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f,m,v;if(g=[e.node_view,e.edge_view],m=g[0],l=g[1],null===(u=m.glyph.hit_test(t)))return!1;for(this._node_selector.update(u,n,i),f=function(){var t,e,n,i;for(n=u[\"1d\"].indices,i=[],t=0,e=n.length;tv;h=0<=v?++c:--c)(o.contains(f,a.data.start[h])||o.contains(f,a.data.end[h]))&&r.push(h);for(d=s.create_hit_test_result(),_=0,p=r.length;_a;r=0<=a?++s:--s)o=null!=this.graph_layout[u[r]]&&null!=this.graph_layout[n[r]],i&&o?(h.push(t.data.xs[r]),c.push(t.data.ys[r])):(o?(p=[this.graph_layout[u[r]],this.graph_layout[n[r]]],l=p[0],e=p[1]):(l=(d=[[NaN,NaN],[NaN,NaN]])[0],e=d[1]),h.push([l[0],e[0]]),c.push([l[1],e[1]]));return[h,c];var _,p,d},e}(r.LayoutProvider);n.StaticLayoutProvider=s,s.prototype.type=\"StaticLayoutProvider\",s.define({graph_layout:[o.Any,{}]})},function(t,e,n){var i=t(364),r=t(163),o=t(165),s=t(15),a=t(42);n.GridView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_range_name=this.model.x_range_name,this._y_range_name=this.model.y_range_name},e.prototype.render=function(){var t;if(!1!==this.model.visible)return(t=this.plot_view.canvas_view.ctx).save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype._draw_regions=function(t){var e,n,i,r,o,s,a,l,u;if(this.visuals.band_fill.doit){for(h=this.model.grid_coords(\"major\",!1),l=h[0],u=h[1],this.visuals.band_fill.set_value(t),e=n=0,i=l.length-1;0<=i?ni;e=0<=i?++n:--n)e%2==1&&(c=this.plot_view.map_to_screen(l[e],u[e],this._x_range_name,this._y_range_name),r=c[0],s=c[1],_=this.plot_view.map_to_screen(l[e+1],u[e+1],this._x_range_name,this._y_range_name),o=_[0],a=_[1],t.fillRect(r[0],s[0],o[1]-r[0],a[1]-s[0]),t.fill());var h,c,_}},e.prototype._draw_grids=function(t){var e,n;if(this.visuals.grid_line.doit){return i=this.model.grid_coords(\"major\"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.grid_line,e,n);var i}},e.prototype._draw_minor_grids=function(t){var e,n;if(this.visuals.minor_grid_line.doit){return i=this.model.grid_coords(\"minor\"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,e,n);var i}},e.prototype._draw_grid_helper=function(t,e,n,i){var r,o,s,a,l,u,h;for(e.set_value(t),r=o=0,a=n.length;0<=a?oa;r=0<=a?++o:--o){for(c=this.plot_view.map_to_screen(n[r],i[r],this._x_range_name,this._y_range_name),u=c[0],h=c[1],t.beginPath(),t.moveTo(Math.round(u[0]),Math.round(h[0])),r=s=1,l=u.length;1<=l?sl;r=1<=l?++s:--s)t.lineTo(Math.round(u[r]),Math.round(h[r]));t.stroke()}var c},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype.computed_bounds=function(){var t,e,n,i,r;return o=this.ranges(),e=o[0],o[1],r=this.bounds,n=[e.min,e.max],a.isArray(r)?(i=Math.min(r[0],r[1]),t=Math.max(r[0],r[1]),in[1]&&(i=null),t>n[1]?t=n[1]:tb;c=0<=b?++p:--p)if(k[c]!==v&&k[c]!==m||!e){for(a=[],l=[],g=d=0,x=n=2;0<=x?dx;g=0<=x?++d:--d)f=r+(i-r)/(n-1)*g,a.push(k[c]),l.push(f);o[h].push(a),o[_].push(l)}return o;var T,M},e}(r.GuideRenderer);n.Grid=l,l.prototype.default_view=n.GridView,l.prototype.type=\"Grid\",l.mixins([\"line:grid_\",\"line:minor_grid_\",\"fill:band_\"]),l.define({bounds:[s.Any,\"auto\"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),l.override({level:\"underlay\",band_fill_color:null,band_fill_alpha:0,grid_line_color:\"#e5e5e5\",minor_grid_line_color:null})},function(t,e,n){var i=t(133);n.Grid=i.Grid},function(t,e,n){var i=t(364);i.__exportStar(t(57),n),i.__exportStar(t(73),n),i.__exportStar(t(77),n),i.__exportStar(t(81),n),i.__exportStar(t(83),n),i.__exportStar(t(89),n),i.__exportStar(t(95),n),i.__exportStar(t(113),n),i.__exportStar(t(130),n),i.__exportStar(t(134),n),i.__exportStar(t(138),n),i.__exportStar(t(145),n),i.__exportStar(t(238),n),i.__exportStar(t(148),n),i.__exportStar(t(152),n),i.__exportStar(t(158),n),i.__exportStar(t(164),n),i.__exportStar(t(167),n),i.__exportStar(t(177),n),i.__exportStar(t(187),n),i.__exportStar(t(199),n),i.__exportStar(t(226),n)},function(t,e,n){var i=t(364),r=[].indexOf,o=t(13),s=t(15),a=t(22),l=t(30),u=t(139),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.get_height=function(){var t,e;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._height.value}),this.model._horizontal?a.max(t):a.sum(t)},e.prototype.get_width=function(){var t,e;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._width.value}),this.model._horizontal?a.sum(t):a.max(t)},e}(u.LayoutDOMView);n.BoxView=h,h.prototype.className=\"bk-grid\";var c=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._child_equal_size_width=new o.Variable(i.toString()+\".child_equal_size_width\"),i._child_equal_size_height=new o.Variable(i.toString()+\".child_equal_size_height\"),i._box_equal_size_top=new o.Variable(i.toString()+\".box_equal_size_top\"),i._box_equal_size_bottom=new o.Variable(i.toString()+\".box_equal_size_bottom\"),i._box_equal_size_left=new o.Variable(i.toString()+\".box_equal_size_left\"),i._box_equal_size_right=new o.Variable(i.toString()+\".box_equal_size_right\"),i._box_cell_align_top=new o.Variable(i.toString()+\".box_cell_align_top\"),i._box_cell_align_bottom=new o.Variable(i.toString()+\".box_cell_align_bottom\"),i._box_cell_align_left=new o.Variable(i.toString()+\".box_cell_align_left\"),i._box_cell_align_right=new o.Variable(i.toString()+\".box_cell_align_right\"),i}return i.__extends(e,t),e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return l.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,n,i,r,s,a,l,u,h,c,_,p,d;if(r=t.prototype.get_constraints.call(this),e=function(){for(var t=[],e=0;ep;s=1<=p?++l:--l)c=this._info(i[s].get_constrained_variables()),u.span.size&&e(o.EQ(u.span.start,u.span.size,[-1,c.span.start])),e(o.WEAK_EQ(u.whitespace.after,c.whitespace.before,0-this.spacing)),e(o.GE(u.whitespace.after,c.whitespace.before,0-this.spacing)),u=c;return this._horizontal?null!=d.width&&e(o.EQ(u.span.start,u.span.size,[-1,this._width])):null!=d.height&&e(o.EQ(u.span.start,u.span.size,[-1,this._height])),r=r.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,n;return n=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom},e=this._span(this._child_rect(t)),{span:e,whitespace:n}},e.prototype._flatten_cell_edge_variables=function(t){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,n=t!==this._horizontal,l=this.get_layoutable_children(),r=l.length,h={},o=0,c=0,f=l.length;c1?y[1]:\"\",u=this._horizontal?\"row\":\"col\",g=d+\" \"+u+\"-\"+r+\"-\"+o+\"-\"+b):g=p,h[g]=g in h?h[g].concat(w):w;o+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,n,i,s,a,l,u;if(t=[],null!=this.document&&r.call(this.document.roots(),this)>=0){e=this._flatten_cell_edge_variables(this._horizontal);for(s in e)if((u=e[s]).length>1)for(a=u[0],n=i=1,l=u.length;1<=l?il;n=1<=l?++i:--i)t.push(o.EQ(u[n],[-1,a]))}return t},e.prototype._find_edge_leaves=function(t){var n,i,r,o,s,a,l,u;if(r=this.get_layoutable_children(),a=[[],[]],r.length>0)if(this._horizontal===t)u=r[0],o=r[r.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),o instanceof e?a[1]=a[1].concat(o._find_edge_leaves(t)[1]):a[1].push(o);else for(s=0,l=r.length;s1){for(n=t[0],i=r=1,s=t.length;1<=s?rs;i=1<=s?++r:--r)e=t[i],a.push(o.EQ([-1,n],e));return null}})(l),e(i),a;var c},e.prototype._box_insets_from_child_insets=function(t,e,n,i){var r,s,a,l,u,h,c,_;return p=this._find_edge_leaves(t),c=p[0],s=p[1],t?(_=e+\"_left\",a=e+\"_right\",u=this[n+\"_left\"],l=this[n+\"_right\"]):(_=e+\"_top\",a=e+\"_bottom\",u=this[n+\"_top\"],l=this[n+\"_bottom\"]),h=[],(r=function(t,e,n){var r,s,a,l;for([],r=0,a=e.length;r0;)(n=i.shift())instanceof e&&i.push.apply(i,n.get_layoutable_children()),t[n.toString()]=n.layout_bbox;return console.table(t)},e.prototype.get_all_constraints=function(){var t,e,n,i,r;for(e=this.get_constraints(),r=this.get_layoutable_children(),n=0,i=r.length;n0?this.model._width.value-20+\"px\":\"100%\",this.el.style.width=t)},e.prototype.get_height=function(){var t,e,n,i,o,s,a,l;n=0,a=this.child_views;for(i in a)r.call(a,i)&&(t=a[i],e=t.el,l=getComputedStyle(e),s=parseInt(l.marginTop)||0,o=parseInt(l.marginBottom)||0,n+=e.offsetHeight+s+o);return n+20},e.prototype.get_width=function(){var t,e,n,i,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,i=this.child_views;for(n in i)r.call(i,n)&&(t=i[n],(e=t.el.scrollWidth)>o&&(o=e));return o},e}(l.LayoutDOMView);n.WidgetBoxView=u,u.prototype.className=\"bk-widget-box\";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),\"fixed\"===this.sizing_mode&&null===this.width&&(this.width=300,o.logger.info(\"WidgetBox mode is fixed, but no width specified. Using default of 300.\")),\"scale_height\"===this.sizing_mode)return o.logger.warn(\"sizing_mode `scale_height` is not experimental for WidgetBox. Please report your results to the bokeh dev team so we can improve.\")},e.prototype.get_constrained_variables=function(){var e;return e=a.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}),\"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}(l.LayoutDOM);n.WidgetBox=h,h.prototype.type=\"WidgetBox\",h.prototype.default_view=u,h.define({children:[s.Array,[]]})},function(t,e,n){var i,r=t(364),o=t(144),s=t(15),a=t(22),l=t(42);i=function(t,e){var n,i,r;if(t.length!==e.length)return!1;for(n=i=0,r=t.length;0<=r?ir;n=0<=r?++i:--i)if(t[n]!==e[n])return!1;return!0};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._get_values=function(t,e){var n,r,o,s,u,h;for(h=[],o=0,u=t.length;o=e.length?this.nan_color:e[s],h.push(n);return h},e}(o.ColorMapper);n.CategoricalColorMapper=u,u.prototype.type=\"CategoricalColorMapper\",u.define({factors:[s.Array],start:[s.Number,0],end:[s.Number]})},function(t,e,n){var i=t(364),r=t(15),o=t(243),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._little_endian=this._is_little_endian(),this._palette=this._build_palette(this.palette),this.connect(this.change,function(){return this._palette=this._build_palette(this.palette)})},e.prototype.v_map_screen=function(t,e){void 0===e&&(e=!1);var n,i,r,o,s,a,l,u,h,c;if(c=this._get_values(t,this._palette,e),n=new ArrayBuffer(4*t.length),this._little_endian)for(i=new Uint8Array(n),r=s=0,l=t.length;0<=l?sl;r=0<=l?++s:--s)h=c[r],i[o=4*r]=Math.floor(h/4278190080*255),i[o+1]=(16711680&h)>>16,i[o+2]=(65280&h)>>8,i[o+3]=255&h;else for(i=new Uint32Array(n),r=a=0,u=t.length;0<=u?au;r=0<=u?++a:--a)h=c[r],i[r]=h<<8|255;return n},e.prototype.compute=function(t){return null},e.prototype.v_compute=function(t){return this._get_values(t,this.palette)},e.prototype._get_values=function(t,e,n){return void 0===n&&(n=!1),[]},e.prototype._is_little_endian=function(){var t,e,n,i;return t=new ArrayBuffer(4),n=new Uint8Array(t),e=new Uint32Array(t),e[1]=168496141,i=!0,10===n[4]&&11===n[5]&&12===n[6]&&13===n[7]&&(i=!1),i},e.prototype._build_palette=function(t){var e,n,i,r,o;for(r=new Uint32Array(t.length),e=function(t){return s.isNumber(t)?t:(9!==t.length&&(t+=\"ff\"),parseInt(t.slice(1),16))},n=i=0,o=t.length;0<=o?io;n=0<=o?++i:--i)r[n]=e(t[n]);return r},e}(o.Transform);n.ColorMapper=a,a.prototype.type=\"ColorMapper\",a.define({palette:[r.Any],nan_color:[r.Color,\"gray\"]})},function(t,e,n){var i=t(143);n.CategoricalColorMapper=i.CategoricalColorMapper;var r=t(144);n.ColorMapper=r.ColorMapper;var o=t(146);n.LinearColorMapper=o.LinearColorMapper;var s=t(147);n.LogColorMapper=s.LogColorMapper},function(t,e,n){var i=t(364),r=t(15),o=t(26),s=t(22),a=t(144),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([o.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([o.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([o.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=null!=(v=this.low)?v:s.min(t),r=null!=(g=this.high)?g:s.max(t),_=e.length-1,y=[],p=n?this._nan_color:this.nan_color,c=n?this._low_color:this.low_color,o=n?this._high_color:this.high_color,d=1/(r-h),m=1/e.length,a=0,u=t.length;a_?null!=this.high_color?y.push(o):y.push(e[_]):y.push(e[l])):y.push(e[_]);return y},e}(a.ColorMapper);n.LinearColorMapper=l,l.prototype.type=\"LinearColorMapper\",l.define({high:[r.Number],low:[r.Number],high_color:[r.Color],low_color:[r.Color]})},function(t,e,n){var i,r,o=t(364),s=t(15),a=t(26),l=t(22),u=t(144);i=null!=(r=Math.log1p)?r:function(t){return Math.log(1+t)};var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([a.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([a.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([a.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b;for(f=e.length,_=null!=(v=this.low)?v:l.min(t),o=null!=(g=this.high)?g:l.max(t),y=f/(i(o)-i(_)),d=e.length-1,b=[],m=n?this._nan_color:this.nan_color,s=n?this._high_color:this.high_color,p=n?this._low_color:this.low_color,a=0,h=t.length;ao?null!=this.high_color?b.push(s):b.push(e[d]):r!==o?r<_?null!=this.low_color?b.push(p):b.push(e[0]):(c=i(r)-i(_),(u=Math.floor(c*y))>d&&(u=d),b.push(e[u])):b.push(e[d]);return b},e}(u.ColorMapper);n.LogColorMapper=h,h.prototype.type=\"LogColorMapper\",h.define({high:[s.Number],low:[s.Number],high_color:[s.Color],low_color:[s.Color]})},function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t(364),w=t(149);i=Math.sqrt(3),l=function(t,e){return t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)},o=function(t,e){return t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)},s=function(t,e){return t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()},a=function(t,e){var n,r;return r=e*i,n=r/3,t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-r),t.closePath()},u=function(t,e,n,i,r,s,a){var u;u=.65*r,o(t,r),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},h=function(t,e,n,i,r,s,a){t.arc(0,0,r,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},c=function(t,e,n,i,r,o,s){t.arc(0,0,r,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},_=function(t,e,n,i,r,s,a){o(t,r),s.doit&&(s.set_vectorize(t,e),t.stroke())},p=function(t,e,n,i,r,o,a){s(t,r),a.doit&&(a.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},d=function(t,e,n,i,r,a,l){s(t,r),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),o(t,r),t.stroke())},f=function(t,e,n,i,r,o,s){t.rotate(Math.PI),a(t,r),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},m=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},v=function(t,e,n,i,r,s,a){var l;l=2*r,t.rect(-r,-r,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},g=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},y=function(t,e,n,i,r,o,s){a(t,r),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},b=function(t,e,n,i,r,o,s){l(t,r),o.doit&&(o.set_vectorize(t,e),t.stroke())},r=function(t,e){var n;return n=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.MarkerView);return t.prototype._render_one=e,t}(),function(){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.Marker);return e.prototype.default_view=n,e.prototype.type=t,e}()},n.Asterisk=r(\"Asterisk\",u),n.CircleCross=r(\"CircleCross\",h),n.CircleX=r(\"CircleX\",c),n.Cross=r(\"Cross\",_),n.Diamond=r(\"Diamond\",p),n.DiamondCross=r(\"DiamondCross\",d),n.InvertedTriangle=r(\"InvertedTriangle\",f),n.Square=r(\"Square\",m),n.SquareCross=r(\"SquareCross\",v),n.SquareX=r(\"SquareX\",g),n.Triangle=r(\"Triangle\",y),n.X=r(\"X\",b)},function(t,e,n){var i=t(364),r=t(128),o=t(9),s=t(15);n.MarkerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c;return l=[o],h={},h[o]=(e+n)/2,c={},c[o]=(i+r)/2,u={},u[o]=.4*Math.min(Math.abs(n-e),Math.abs(r-i)),s={},s[o]=this._angle[o],a={sx:h,sy:c,_size:u,_angle:s},this._render(t,l,a)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._size,c=n._angle;for(a=[],r=0,o=e.length;re;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?sa;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l[\"1d\"].indices=n,l},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Marker=a,a.mixins([\"line\",\"fill\"]),a.define({size:[s.DistanceSpec,{units:\"screen\",value:4}],angle:[s.AngleSpec,0]})},function(t,e,n){var i=t(364),r=t(14),o=t(151),s=t(153),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Model);n.MapOptions=u,u.prototype.type=\"MapOptions\",u.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u);n.GMapOptions=h,h.prototype.type=\"GMapOptions\",h.define({map_type:[a.String,\"roadmap\"],scale_control:[a.Bool,!1],styles:[a.String]}),n.GMapPlotView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.PlotView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),!this.api_key)return 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);n.GMapPlot=c,c.prototype.type=\"GMapPlot\",c.prototype.default_view=n.GMapPlotView,c.define({map_options:[a.Instance],api_key:[a.String]})},function(t,e,n){var i,r,o=t(364),s=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},a=t(31),l=t(154),u=t(20);i=new u.Signal(this,\"gmaps_ready\"),r=function(t){var e;return window._bokeh_gmaps_callback=function(){return i.emit()},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)},n.GMapPlotCanvasView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._get_latlon_bounds=e._get_latlon_bounds.bind(e),e._get_projected_bounds=e._get_projected_bounds.bind(e),e._set_bokeh_ranges=e._set_bokeh_ranges.bind(e),e}return o.__extends(e,t),e.prototype.initialize=function(e){var n,o,s=this;return this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0,n=this.model.plot.map_options,this.initial_zoom=n.zoom,this.initial_lat=n.lat,this.initial_lng=n.lng,this.canvas_view.map_el.style.position=\"absolute\",null==(null!=(o=window.google)?o.maps:void 0)&&(null==window._bokeh_gmaps_callback&&r(this.model.plot.api_key),i.connect(function(){return s.request_render()})),this.unpause()},e.prototype.update_range=function(e){var n,i,r,o,s;if(null==e)this.model.plot.map_options,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,e.sdy),t.prototype.update_range.call(this,e);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),s=e.factor<0?-1:1,i=this.map.getZoom(),(n=i+s)>=2&&(this.map.setZoom(n),a=this._get_projected_bounds(),o=a[0],r=a[1],a[2],a[3],r-o<0&&this.map.setZoom(i)),this.unpause()}return this._set_bokeh_ranges();var a},e.prototype._build_map=function(){var t,e,n,i=this;return e=window.google.maps,this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID},n=this.model.plot.map_options,t={center:new e.LatLng(n.lat,n.lng),zoom:n.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[n.map_type],scaleControl:n.scale_control},null!=n.styles&&(t.styles=JSON.parse(n.styles)),this.map=new e.Map(this.canvas_view.map_el,t),e.event.addListener(this.map,\"idle\",function(){return i._set_bokeh_ranges()}),e.event.addListener(this.map,\"bounds_changed\",function(){return i._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,\"tilesloaded\",function(){return i._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return i._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return i._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return i._update_center(\"lat\")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return i._update_center(\"lng\")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return i._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return i._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return i._update_scale_control()})},e.prototype._render_finished=function(){return 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,n,i,r,o,a,l;return s(this,e),n=this.map.getBounds(),i=n.getNorthEast(),t=n.getSouthWest(),o=t.lng(),r=i.lng(),l=t.lat(),a=i.lat(),[o,r,l,a]},e.prototype._get_projected_bounds=function(){var t,n,i,r,o,l,u,h;return s(this,e),c=this._get_latlon_bounds(),l=c[0],o=c[1],h=c[2],u=c[3],_=a.proj4(a.mercator,[l,h]),n=_[0],r=_[1],p=a.proj4(a.mercator,[o,u]),t=p[0],i=p[1],[n,t,r,i];var c,_,p},e.prototype._set_bokeh_ranges=function(){var t,n,i,r;return s(this,e),o=this._get_projected_bounds(),n=o[0],t=o[1],r=o[2],i=o[3],this.frame.x_range.setv({start:n,end:t}),this.frame.y_range.setv({start:r,end:i});var o},e.prototype._update_center=function(t){var e;return 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(){return window.google.maps,this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){return window.google.maps,this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){return this._update_styles(),this._update_center(\"lat\"),this._update_center(\"lng\"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){return this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){return this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var n,i,r,o,s;if(i=e[0],o=e[1],s=e[2],n=e[3],this.canvas_view.map_el.style.top=o+\"px\",this.canvas_view.map_el.style.left=i+\"px\",this.canvas_view.map_el.style.width=s+\"px\",this.canvas_view.map_el.style.height=n+\"px\",null==this.map&&null!=(null!=(r=window.google)?r.maps:void 0))return this._build_map()},e.prototype._paint_empty=function(t,e){var n,i,r,o,s,a;return s=this.canvas._width.value,o=this.canvas._height.value,r=e[0],a=e[1],i=e[2],n=e[3],t.clearRect(0,0,s,o),t.beginPath(),t.moveTo(0,0),t.lineTo(0,o),t.lineTo(s,o),t.lineTo(s,0),t.lineTo(0,0),t.moveTo(r,a),t.lineTo(r+i,a),t.lineTo(r+i,a+n),t.lineTo(r,a+n),t.lineTo(r,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(l.PlotCanvasView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return this.use_map=!0,t.prototype.initialize.call(this,e,n)},e}(l.PlotCanvas);n.GMapPlotCanvas=h,h.prototype.type=\"GMapPlotCanvas\",h.prototype.default_view=n.GMapPlotCanvasView},function(t,e,n){var i=t(150);n.MapOptions=i.MapOptions;var r=t(150);n.GMapOptions=r.GMapOptions;var o=t(150);n.GMapPlot=o.GMapPlot;var s=t(151);n.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(153);n.Plot=a.Plot;var l=t(154);n.PlotCanvas=l.PlotCanvas},function(t,e,n){var i=t(364),r=t(13),o=t(14),s=t(15),a=t(22),l=t(30),u=t(42),h=t(139),c=t(65),_=t(168),p=t(233),d=t(66),f=t(154),m=t(173),v=t(161),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e;return t.prototype.connect_signals.call(this),e=\"Title object cannot be replaced. Try changing properties on title to update it after initialization.\",this.connect(this.model.properties.title.change,function(){return o.logger.warn(e)})},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){return this.plot_canvas_view.save(t)},e}(h.LayoutDOMView);n.PlotView=y,y.prototype.className=\"bk-plot-layout\",y.getters({plot_canvas_view:function(){return this.child_views[this.model._plot_canvas.id]}});var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r,o,s,a,h,c,_,p,d,f,m,v,g,y;for(t.prototype.initialize.call(this,e),_=l.values(this.extra_x_ranges).concat(this.x_range),n=0,s=_.length;n=0},e.prototype.can_redo=function(){return this.state.index=0?a.push(e.selected=t[s.id]):a.push(void 0)):a.push(e.selection_manager.clear()));return a},e.prototype.reset_selection=function(){return this.update_selection(null)},e.prototype._update_ranges_together=function(t){var e,n,i,r,o,s,a,l;for(l=1,e=0,i=t.length;ed.end,n||(f=this._get_weight_to_constrain_interval(d,_))<1&&(_.start=f*_.start+(1-f)*d.start,_.end=f*_.end+(1-f)*d.end),null!=d.bounds&&(h=d.bounds[0],u=d.bounds[1],c=Math.abs(_.end-_.start),r?(null!=h&&h>=_.end&&(i=!0,_.end=h,null==e&&null==n||(_.start=h+c)),null!=u&&u<=_.start&&(i=!0,_.start=u,null==e&&null==n||(_.end=u-c))):(null!=h&&h>=_.start&&(i=!0,_.start=h,null==e&&null==n||(_.end=h+c)),null!=u&&u<=_.end&&(i=!0,_.end=u,null==e&&null==n||(_.start=u-c))));if(!n||!i){for(p=[],s=0,l=t.length;s0&&a0&&a>i&&(u=(i-l)/(a-l)),u=Math.max(0,Math.min(1,u))),u;var h},e.prototype.update_range=function(t,e,n){var i,r,o,s,a,l,u;if(this.pause(),null==t){o=this.frame.x_ranges;for(i in o)(u=o[i]).reset();s=this.frame.y_ranges;for(i in s)(u=s[i]).reset();this.update_dataranges()}else{r=[],a=this.frame.x_ranges;for(i in a)u=a[i],r.push([u,t.xrs[i]]);l=this.frame.y_ranges;for(i in l)u=l[i],r.push([u,t.yrs[i]]);n&&this._update_ranges_together(r),this._update_ranges_individually(r,e,n)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,n,i,r,o,s,a,l,u,h;for(l=this.model.plot.all_renderers,a=Object.keys(this.renderer_views),s=m.build_views(this.renderer_views,l,this.view_options()),u=E.difference(a,function(){var t,e,n;for(n=[],t=0,e=l.length;t=0&&io&&_.model.document.interactive_stop(_.model.plot),_.request_render()},o)):this.model.document.interactive_stop(this.model.plot)),a=this.renderer_views;for(r in a)if(l=a[r],null==this.range_update_timestamp||l.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}return this.model.frame._update_scales(),t=this.canvas_view.ctx,t.pixel_ratio=s=this.canvas.pixel_ratio,t.save(),t.scale(s,s),t.translate(.5,.5),e=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value],this._map_hook(t,e),this._paint_empty(t,e),this.prepare_webgl(s,e),t.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(t),c=e[1],n=e[3],(h=e[0])+(u=e[2])===this.canvas._width.value&&(u-=1),c+n===this.canvas._height.value&&(n-=1),t.strokeRect(h,c,u,n)),t.restore(),this._paint_levels(t,[\"image\",\"underlay\",\"glyph\"],e),this.blit_webgl(s),this._paint_levels(t,[\"annotation\"],e),this._paint_levels(t,[\"overlay\"]),null==this.initial_range_info&&this.set_initial_range(),t.restore(),this._has_finished?void 0:(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f;for(t.save(),null!=n&&\"canvas\"===this.model.plot.output_backend&&(t.beginPath(),t.rect.apply(t,n),t.clip()),r={},_=this.model.plot.renderers,i=o=0,a=_.length;o0&&(c=function(){var t,e,n;for(n=[],t=0,e=c.length;t=0&&n.push(u);return n}()),s.logger.debug(\"computed \"+c.length+\" renderers for DataRange1d \"+this.id),n=0,r=c.length;nr&&(\"start\"===this.follow?i=_+o*r:\"end\"===this.follow&&(_=i-o*r)),[_,i];var p,d,f},e.prototype.update=function(t,e,n){var i,r,o,s,a,l,u,h;if(!this.have_updated_interactively){return u=this.computed_renderers(),this.plot_bounds[n]=this._compute_plot_bounds(u,t),c=this._compute_min_max(this.plot_bounds,e),a=c[0],s=c[1],_=this._compute_range(a,s),h=_[0],o=_[1],null!=this._initial_start&&(\"log\"===this.scale_hint?this._initial_start>0&&(h=this._initial_start):h=this._initial_start),null!=this._initial_end&&(\"log\"===this.scale_hint?this._initial_end>0&&(o=this._initial_end):o=this._initial_end),p=[this.start,this.end],r=p[0],i=p[1],h===r&&o===i||(l={},h!==r&&(l.start=h),o!==i&&(l.end=o),this.setv(l)),\"auto\"===this.bounds&&this.setv({bounds:[h,o]},{silent:!0}),this.change.emit();var c,_,p}},e.prototype.reset=function(){return 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);n.DataRange1d=u,u.prototype.type=\"DataRange1d\",u.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],bounds:[a.Any],min_interval:[a.Any],max_interval:[a.Any]}),u.internal({scale_hint:[a.String,\"auto\"]}),u.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}})},function(t,e,n){var i=t(364),r=t(159),o=t(15),s=t(22),a=t(42);n.map_one_level=function(t,e,n){void 0===n&&(n=0);var i,r,o,s,a;for(a={},r=o=0,s=t.length;othis.end},enumerable:!0,configurable:!0}),e.prototype.reset=function(){return 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);n.Range1d=s,s.prototype.type=\"Range1d\",s.define({start:[o.Number,0],end:[o.Number,1],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]})},function(t,e,n){var i=t(364),r=[].indexOf,o=t(165),s=t(114),a=t(178),l=t(172),u=t(14),h=t(15),c=t(22),_=t(30);n.GlyphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,o,s,l,u,h,c,p,d;if(t.prototype.initialize.call(this,e),n=this.model.glyph,s=r.call(n.mixins,\"fill\")>=0,l=r.call(n.mixins,\"line\")>=0,o=_.clone(n.attributes),delete o.id,h=function(t){var e;return e=_.clone(o),s&&_.extend(e,t.fill),l&&_.extend(e,t.line),new n.constructor(e)},this.glyph=this.build_glyph_view(n),null==(d=this.model.selection_glyph)?d=h({fill:{},line:{}}):\"auto\"===d&&(d=h(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(d),null==(p=this.model.nonselection_glyph)?p=h({fill:{},line:{}}):\"auto\"===p&&(p=h(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(p),null!=(u=this.model.hover_glyph)&&(this.hover_glyph=this.build_glyph_view(u)),null!=(c=this.model.muted_glyph)&&(this.muted_glyph=this.build_glyph_view(c)),i=h(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(i),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 a.RemoteDataSource)return 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(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()}),this.connect(this.model.glyph.change,function(){return this.set_data()}),this.connect(this.model.data_source.change,function(){return this.set_data()}),this.connect(this.model.data_source.streaming,function(){return this.set_data()}),this.connect(this.model.data_source.patching,function(t){return this.set_data(!0,t)}),this.connect(this.model.data_source.select,function(){return this.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return this.request_render()}),this.connect(this.model.properties.view.change,function(){return this.set_data()}),this.connect(this.model.view.change,function(){return this.set_data()}),this.connect(this.model.glyph.transformchange,function(){return this.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);var n,i,r,o,s,a,l;for(l=Date.now(),a=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(a,this.all_indices,e),this.glyph.set_visuals(a),this.decimated_glyph.set_visuals(a),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(a),this.nonselection_glyph.set_visuals(a)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(a),null!=this.muted_glyph&&this.muted_glyph.set_visuals(a),o=this.plot_model.plot.lod_factor,this.decimated=[],i=r=0,s=Math.floor(this.all_indices.length/o);0<=s?rs;i=0<=s?++r:--r)this.decimated.push(i*o);if(n=Date.now()-l,u.logger.debug(this.glyph.model.type+\" GlyphRenderer (\"+this.model.id+\"): set_data finished in \"+n+\"ms\"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,n,i,o,a,l,h,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C,O,N,j;if(this.model.visible){if(C=Date.now(),l=this.glyph.glglyph,Date.now(),this.glyph.map_data(),e=Date.now()-C,O=Date.now(),(p=this.glyph.mask_data(this.all_indices)).length===this.all_indices.length&&(p=function(){M=[];for(var t=0,e=this.all_indices.length;0<=e?te;0<=e?t++:t--)M.push(t);return M}.apply(this)),n=Date.now()-O,(t=this.plot_view.canvas_view.ctx).save(),A=this.model.data_source.selected,A=A&&0!==A.length?A[\"0d\"].glyph?this.model.view.convert_indices_from_subset(p):A[\"1d\"].indices.length>0?A[\"1d\"].indices:function(){var t,e,n,i;for(n=Object.keys(A[\"2d\"].indices),i=[],t=0,e=n.length;t0?d[\"1d\"].indices:function(){var t,e,n,i;for(n=Object.keys(d[\"2d\"].indices),i=[],t=0,e=n.length;t=0&&i.push(_);return i}.call(this),b=this.plot_model.plot.lod_threshold,(null!=(S=this.model.document)?S.interactive_duration():void 0)>0&&!l&&null!=b&&this.all_indices.length>b?(p=this.decimated,h=this.decimated_glyph,k=this.decimated_glyph,z=this.selection_glyph):(h=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,k=this.nonselection_glyph,z=this.selection_glyph),null!=this.hover_glyph&&d.length&&(p=c.difference(p,d)),A.length&&this.have_selection_glyphs()){for(j=Date.now(),E={},f=0,v=A.length;f0&&(r=i),r},e.prototype.hit_test_helper=function(t,e,n,i,r){var o,s,a,l;return!!this.visible&&(null!==(o=e.glyph.hit_test(t))&&(s=this.view.convert_selection_from_subset(o),\"select\"===r?((l=this.data_source.selection_manager.selector).update(s,n,i),this.data_source.selected=l.indices,this.data_source.select.emit()):((a=this.data_source.selection_manager.get_or_create_inspector(this)).update(s,!0,!1,!0),this.data_source.setv({inspected:a.indices},{silent:!0}),this.data_source.inspect.emit([e,{geometry:t}])),!s.is_empty()))},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(o.Renderer);n.GlyphRenderer=p,p.prototype.default_view=n.GlyphRendererView,p.prototype.type=\"GlyphRenderer\",p.define({x_range_name:[h.String,\"default\"],y_range_name:[h.String,\"default\"],data_source:[h.Instance],view:[h.Instance,function(){return new l.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]}),p.override({level:\"glyph\"}),p.prototype.selection_defaults={fill:{},line:{}},p.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:\"grey\"},line:{line_alpha:.3,line_color:\"grey\"}},p.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}}},function(t,e,n){var i=t(364),r=t(165),o=t(129),s=t(15),a=t(4);n.GraphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales.default,this.yscale=this.plot_view.frame.yscales.default,this._renderer_views={},n=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=n[0],this.edge_view=n[1],this.set_data();var n},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return this.set_data()})},e.prototype.set_data=function(t){if(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}),e=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),this.node_view.glyph._x=e[0],this.node_view.glyph._y=e[1],n=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),this.edge_view.glyph._xs=n[0],this.edge_view.glyph._ys=n[1],this.node_view.glyph.index=this.node_view.glyph._index_data(),this.edge_view.glyph.index=this.edge_view.glyph._index_data(),t)return this.request_render();var e,n},e.prototype.render=function(){return this.edge_view.render(),this.node_view.render()},e.prototype.hit_test=function(t,e,n,i){void 0===i&&(i=\"select\");var r,o;return!!this.model.visible&&(!1,\"select\"===i?null!=(r=this.model.selection_policy)?r.do_selection(t,this,e,n):void 0:null!=(o=this.model.inspection_policy)?o.do_inspection(t,this,e,n):void 0)},e}(r.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);n.GraphRenderer=l,l.prototype.default_view=n.GraphRendererView,l.prototype.type=\"GraphRenderer\",l.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}]}),l.override({level:\"glyph\"})},function(t,e,n){var i=t(364),r=t(165),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Renderer);n.GuideRenderer=s,s.prototype.type=\"GuideRenderer\",s.define({plot:[o.Instance]}),s.override({level:\"overlay\"})},function(t,e,n){var i=t(161);n.GlyphRenderer=i.GlyphRenderer;var r=t(162);n.GraphRenderer=r.GraphRenderer;var o=t(163);n.GuideRenderer=o.GuideRenderer;var s=t(165);n.Renderer=s.Renderer},function(t,e,n){var i=t(364),r=t(6),o=t(46),s=t(15),a=t(32),l=t(30),u=t(50),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.set_data=function(t){var e;if(e=this.model.materialize_dataspecs(t),l.extend(this,e),this.plot_model.use_map&&(null!=this._x&&(n=a.project_xy(this._x,this._y),this._x=n[0],this._y=n[1]),null!=this._xs))return i=a.project_xsys(this._xs,this._ys),this._xs=i[0],this._ys=i[1],i;var n,i},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);n.RendererView=h,h.getters({plot_model:function(){return this.plot_view.model}});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u.Model);n.Renderer=c,c.prototype.type=\"Renderer\",c.define({level:[s.RenderLevel,null],visible:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(168),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),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);n.CategoricalScale=o,o.prototype.type=\"CategoricalScale\"},function(t,e,n){var i=t(166);n.CategoricalScale=i.CategoricalScale;var r=t(168);n.LinearScale=r.LinearScale;var o=t(169);n.LogScale=o.LogScale;var s=t(170);n.Scale=s.Scale},function(t,e,n){var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],e*t+n;var i},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;nu;i=0<=u?++s:--s)c[i]=0;else for(i=a=0,h=t.length;0<=h?ah;i=0<=h?++a:--a)e=(Math.log(t[i])-o)/r,_=isFinite(e)?e*n+l:NaN,c[i]=_;return c;var p},e.prototype.invert=function(t){var e,n,i,r,o;return s=this._compute_state(),e=s[0],r=s[1],n=s[2],i=s[3],o=(t-r)/e,Math.exp(n*o+i);var s},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a,l,u;for(h=this._compute_state(),e=h[0],s=h[1],i=h[2],r=h[3],l=new Float64Array(t.length),n=o=0,a=t.length;0<=a?oa;n=0<=a?++o:--o)u=(t[n]-s)/e,l[n]=Math.exp(i*u+r);return l;var h},e.prototype._get_safe_factor=function(t,e){var n,i,r;return r=t<0?0:t,n=e<0?0:e,r===n&&(0===r?(r=(o=[1,10])[0],n=o[1]):(i=Math.log(r)/Math.log(10),r=Math.pow(10,Math.floor(i)),n=Math.ceil(i)!==Math.floor(i)?Math.pow(10,Math.ceil(i)):Math.pow(10,Math.ceil(i)+1))),[r,n];var o},e.prototype._compute_state=function(){var t,e,n,i,r,o,s,a,l,u,h;return a=this.source_range.start,s=this.source_range.end,h=this.target_range.start,u=this.target_range.end,o=u-h,c=this._get_safe_factor(a,s),l=c[0],t=c[1],0===l?(n=Math.log(t),i=0):(n=Math.log(t)-Math.log(l),i=Math.log(l)),e=o,r=h,[e,r,n,i];var c},e}(r.Scale);n.LogScale=o,o.prototype.type=\"LogScale\"},function(t,e,n){var i=t(364),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),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);n.Scale=s,s.prototype.type=\"Scale\",s.internal({source_range:[o.Any],target_range:[o.Any]})},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},o=t(178),s=t(14),a=t(15),l=function(t){function e(){var e=t.apply(this,arguments)||this;return e.destroy=e.destroy.bind(e),e.setup=e.setup.bind(e),e.get_data=e.get_data.bind(e),e}return i.__extends(e,t),e.prototype.destroy=function(){if(r(this,e),null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(){if(r(this,e),null==this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval))return this.interval=setInterval(this.get_data,this.polling_interval,this.mode,this.max_size,this.if_modified)},e.prototype.get_data=function(t,n,i){var o=this;void 0===n&&(n=0),void 0===i&&(i=!1);var a,l,u,h;r(this,e),(h=new XMLHttpRequest).open(this.method,this.data_url,!0),h.withCredentials=!1,h.setRequestHeader(\"Content-Type\",this.content_type),l=this.http_headers;for(a in l)u=l[a],h.setRequestHeader(a,u);return h.addEventListener(\"load\",function(){var e,i,r,s,a,l;if(200===h.status)switch(i=JSON.parse(h.responseText),t){case\"replace\":return o.data=i;case\"append\":for(a=o.data,l=o.columns(),r=0,s=l.length;r0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=null!=(i=this.source)?i.get_indices():void 0),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){var t,e,n,i;for(this.indices_map={},i=[],t=e=0,n=this.indices.length;0<=n?en;t=0<=n?++e:--e)i.push(this.indices_map[this.indices[t]]=t);return i},e.prototype.convert_selection_from_subset=function(t){var e,n,i;return(i=s.create_hit_test_result()).update_through_union(t),n=function(){var n,i,r,o;for(r=t[\"1d\"].indices,o=[],n=0,i=r.length;ni&&(t=t.slice(-i)),t;if(p=t.length+e.length,null!=i&&p>i){for(c=p-i,r=t.length,t.lengthu;o=l<=u?++s:--s)t[o-c]=t[o];for(o=a=0,h=e.length;0<=h?ah;o=0<=h?++a:--a)t[o+(r-c)]=e[o];return t}return _=new t.constructor(e),n.concat_typed_arrays(t,_)},n.slice=function(t,e){var n,i,r;return h.isObject(t)?[null!=(n=t.start)?n:0,null!=(i=t.stop)?i:e,null!=(r=t.step)?r:1]:(o=[t,t+1,1],o[0],o[1],o[2],o);var o},n.patch_to_column=function(t,e,i){var r,o,s,a,u,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E;for(x=new l.Set,w=!1,v=0,g=e.length;v0?yk;o=y+=S)for(p=b=d,T=m,M=f;M>0?bT;p=b+=M)w&&x.push(p),_[o*A[1]+p]=E[r],r++;return x;var z,C,O};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),n=u.decode_column_data(this.data),this.data=n[0],this._shapes=n[1],n;var n},e.prototype.attributes_as_json=function(t,n){void 0===t&&(t=!0),void 0===n&&(n=e._value_to_json);var i,o,s,a;i={},s=this.serializable_attributes();for(o in s)r.call(s,o)&&(a=s[o],\"data\"===o&&(a=u.encode_column_data(a,this._shapes)),t?i[o]=a:o in this._set_after_defaults&&(i[o]=a));return n(\"attributes\",i,this)},e._value_to_json=function(t,e,n){return h.isObject(e)&&\"data\"===t?u.encode_column_data(e,n._shapes):s.HasProps._value_to_json(t,e,n)},e.prototype.stream=function(t,e){var i,r;i=this.data;for(r in t)t[r],i[r]=n.stream_to_column(i[r],t[r],e);return this.setv({data:i},{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e,i,r,o;e=this.data,o=new l.Set;for(i in t)r=t[i],o=o.union(n.patch_to_column(e[i],r,this._shapes[i]));return this.setv({data:e},{silent:!0}),this.patching.emit(o.values)},e}(o.ColumnarDataSource);n.ColumnDataSource=c,c.prototype.type=\"ColumnDataSource\",c.define({data:[a.Any,{}]})},function(t,e,n){var i=t(364),r=t(175),o=t(20),s=t(14),a=t(17),l=t(15),u=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.select=new o.Signal(this,\"select\"),this.inspect=new o.Signal(this,\"inspect\"),this.streaming=new o.Signal(this,\"streaming\"),this.patching=new o.Signal(this,\"patching\")},e.prototype.get_column=function(t){var e;return null!=(e=this.data[t])?e:null},e.prototype.columns=function(){return Object.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e,n,i,r;switch((n=u.uniq(function(){var t,n;t=this.data,n=[];for(e in t)r=t[e],n.push(r.length);return n}.call(this))).length){case 0:return null;case 1:return n[0];default:if(i=\"data source has columns of inconsistent lengths\",t)return s.logger.warn(i),n.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t,e;return null==(t=this.get_length())&&(t=1),function(){e=[];for(var n=0;0<=t?nt;0<=t?n++:n--)e.push(n);return e}.apply(this)},e}(r.DataSource);n.ColumnarDataSource=h,h.prototype.type=\"ColumnarDataSource\",h.define({column_names:[l.Array,[]]}),h.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Any],_shapes:[l.Any,{}]})},function(t,e,n){var i=t(364),r=t(50),o=t(9),s=t(15),a=t(42),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.properties.selected.change,function(){var t;if(null!=(t=n.callback))return a.isFunction(t)?t(n):t.execute(n)})},e}(r.Model);n.DataSource=l,l.prototype.type=\"DataSource\",l.define({selected:[s.Any,o.create_hit_test_result()],callback:[s.Any]})},function(t,e,n){var i=t(364),r=t(174),o=t(14),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this._update_data(),this.connect(this.properties.geojson.change,function(){return n._update_data()})},e.prototype._update_data=function(){return this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){var e,n,i;for(i=[],e=0,n=t;0<=n?en;0<=n?++e:--e)i.push([]);return i},e.prototype._get_new_nan_array=function(t){var e,n,i;for(i=[],e=0,n=t;0<=n?en;0<=n?++e:--e)i.push(NaN);return i},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,n,i){var r,o;o=[];for(r in t.properties)e.hasOwnProperty(r)||(e[r]=this._get_new_nan_array(i)),o.push(e[r][n]=t.properties[r]);return o},e.prototype._add_geometry=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T,M,A,E,z,C;switch(t.type){case\"Point\":return r=t.coordinates,e.x[n]=r[0],e.y[n]=r[1],e.z[n]=null!=(x=r[2])?x:NaN;case\"LineString\":for(i=t.coordinates,A=[],u=h=0,_=i.length;h<_;u=++h)r=i[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],A.push(e.zs[n][u]=null!=(w=r[2])?w:NaN);return A;case\"Polygon\":for(t.coordinates.length>1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),s=t.coordinates[0],E=[],u=c=0,p=s.length;c1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),a.push(b[0]);for(l=a.reduce(this._flatten_function),C=[],u=y=0,m=l.length;yn&&l0&&u.length>0){for(var _=r/h,p=s.range(0,h).map(function(t){return t*_}),d=0,f=p.slice(1);d1?this.interval=(i[1]-i[0])*o.ONE_DAY:this.interval=31*o.ONE_DAY},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_month_no_later_than(new Date(t)),i=o.last_month_no_later_than(new Date(e));i.setUTCMonth(i.getUTCMonth()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCMonth(s.getUTCMonth()+1),!(s>i););return r}(t,e),s=this.days,l=this.interval,u=a.concat(r.map(function(t){return function(t,e){for(var n=[],i=0,r=s;i0&&o.length>0){for(var f=_/s,m=r.range(0,s).map(function(t){return t*f}),v=0,g=m.slice(1);v0&&o.length>0){for(var E=Math.pow(l,A)/s,m=r.range(1,s+1).map(function(t){return t*E}),z=0,C=m;z1?this.interval=(i[1]-i[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=function(t,e){var n=o.last_year_no_later_than(new Date(t)),i=o.last_year_no_later_than(new Date(e));i.setUTCFullYear(i.getUTCFullYear()+1);var r=[],s=n;for(;r.push(o.copy_date(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>i););return r}(t,e),s=this.months,l=a.concat(r.map(function(t){return s.map(function(e){var n=o.copy_date(t);return n.setUTCMonth(e),n})})),u=l.map(function(t){return t.getTime()}),h=u.filter(function(n){return t<=n&&n<=e});return{major:h,minor:[]}},e}(r.SingleIntervalTicker);n.MonthsTicker=l,l.prototype.type=\"MonthsTicker\",l.define({months:[s.Array,[]]})},function(t,e,n){var i=t(364),r=t(183),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_interval=function(t,e,n){return this.interval},Object.defineProperty(e.prototype,\"min_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),e}(r.ContinuousTicker);n.SingleIntervalTicker=s,s.prototype.type=\"SingleIntervalTicker\",s.define({interval:[o.Number]})},function(t,e,n){var i=t(364),r=t(50),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Model);n.Ticker=o,o.prototype.type=\"Ticker\"},function(t,e,n){function i(t){return new Date(t.getTime())}function r(t){var e=i(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}n.ONE_MILLI=1,n.ONE_SECOND=1e3,n.ONE_MINUTE=60*n.ONE_SECOND,n.ONE_HOUR=60*n.ONE_MINUTE,n.ONE_DAY=24*n.ONE_HOUR,n.ONE_MONTH=30*n.ONE_DAY,n.ONE_YEAR=365*n.ONE_DAY,n.copy_date=i,n.last_month_no_later_than=r,n.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,n){var i=t(364),r=t(180),o=t(191),s=t(193),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.interval=s.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var r=s.last_year_no_later_than(new Date(t)).getUTCFullYear(),o=s.last_year_no_later_than(new Date(e)).getUTCFullYear(),a=this.basic_ticker.get_ticks_no_defaults(r,o,n,i).major,l=a.map(function(t){return Date.UTC(t,0,1)}),u=l.filter(function(n){return t<=n&&n<=e});return{major:u,minor:[]}},e}(o.SingleIntervalTicker);n.YearsTicker=a,a.prototype.type=\"YearsTicker\"},function(t,e,n){var i=t(364),r=t(200),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r,o,s,a;return i=this.string_lookup_replace(this.url,this.extra_url_vars),this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,n),o=l[0],a=l[1],r=l[2],s=l[3]):(u=this.get_tile_meter_bounds(t,e,n),o=u[0],a=u[1],r=u[2],s=u[3]),i.replace(\"{XMIN}\",o).replace(\"{YMIN}\",a).replace(\"{XMAX}\",r).replace(\"{YMAX}\",s);var l,u},e}(r.MercatorTileSource);n.BBoxTileSource=s,s.prototype.type=\"BBoxTileSource\",s.define({use_latlon:[o.Bool,!1]})},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},o=t(165),s=t(14),a=t(15);n.DynamicImageView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_image_load=e._on_image_load.bind(e),e._on_image_error=e._on_image_error.bind(e),e}return i.__extends(e,t),e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.map_plot=this.plot_view.model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_view.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.lastImage=void 0,this.extent=this.get_extent()},e.prototype._map_data=function(){return this.initial_extent=this.get_extent()},e.prototype._on_image_load=function(t){var n;if(r(this,e),n=t.target.image_data,n.img=t.target,n.loaded=!0,this.lastImage=n,this.get_extent().join(\":\")===n.cache_key)return this.request_render()},e.prototype._on_image_error=function(t){var n;return r(this,e),s.logger.error(\"Error loading image: \"+t.target.src),n=t.target.image_data,this.model.image_source.remove_image(n)},e.prototype._create_image=function(t){var e;return e=new Image,e.onload=this._on_image_load,e.onerror=this._on_image_error,e.alt=\"\",e.image_data={bounds:t,loaded:!1,cache_key:t.join(\":\")},this.model.image_source.add_image(e.image_data),e.src=this.model.image_source.get_image_url(t[0],t[1],t[2],t[3],Math.ceil(this.map_frame._height.value),Math.ceil(this.map_frame._width.value)),e},e.prototype.render=function(t,e,n){var i,r,o=this;if(null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),i=this.get_extent(),this.render_timer&&clearTimeout(this.render_timer),null==(r=this.model.image_source.images[i.join(\":\")])||!r.loaded)return null!=this.lastImage&&this._draw_image(this.lastImage.cache_key),null==r?this.render_timer=setTimeout(function(){return o._create_image(i)},125):void 0;this._draw_image(i.join(\":\"))},e.prototype._draw_image=function(t){var e,n,i,r,o,s,a,l,u;if(null!=(e=this.model.image_source.images[t]))return this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha,h=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),s=h[0],u=h[1],c=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),o=c[0],l=c[1],s=s[0],u=u[0],o=o[0],l=l[0],i=o-s,n=l-u,r=s,a=u,this.map_canvas.drawImage(e.img,r,a,i,n),this.map_canvas.restore();var h,c},e.prototype._set_rect=function(){var t,e,n,i,r;return n=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+n/2,i=this.map_frame._top.value+n/2,r=this.map_frame._width.value-n,t=this.map_frame._height.value-n,this.map_canvas.rect(e,i,r,t),this.map_canvas.clip()},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Renderer);n.DynamicImageRenderer=l,l.prototype.default_view=n.DynamicImageView,l.prototype.type=\"DynamicImageRenderer\",l.define({alpha:[a.Number,1],image_source:[a.Instance],render_parents:[a.Bool,!0]}),l.override({level:\"underlay\"})},function(t,e,n){n.ImagePool=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t;return null!=(t=this.images.pop())?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50))return t.constructor===Array?Array.prototype.push.apply(this.images,t):this.images.push(t)},t}()},function(t,e,n){var i=t(364),r=t(15),o=t(50),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.images={},this.normalize_case()},e.prototype.normalize_case=function(){\"Note: should probably be refactored into subclasses.\";var t;return t=this.url,t=t.replace(\"{xmin}\",\"{XMIN}\"),t=t.replace(\"{ymin}\",\"{YMIN}\"),t=t.replace(\"{xmax}\",\"{XMAX}\"),t=t.replace(\"{ymax}\",\"{YMAX}\"),t=t.replace(\"{height}\",\"{HEIGHT}\"),t=t.replace(\"{width}\",\"{WIDTH}\"),this.url=t},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace(\"{\"+n+\"}\",r.toString());return i},e.prototype.add_image=function(t){return this.images[t.cache_key]=t},e.prototype.remove_image=function(t){return delete this.images[t.cache_key]},e.prototype.get_image_url=function(t,e,n,i,r,o){return this.string_lookup_replace(this.url,this.extra_url_vars).replace(\"{XMIN}\",t).replace(\"{YMIN}\",e).replace(\"{XMAX}\",n).replace(\"{YMAX}\",i).replace(\"{WIDTH}\",o).replace(\"{HEIGHT}\",r)},e}(o.Model);n.ImageSource=s,s.prototype.type=\"ImageSource\",s.define({url:[r.String,\"\"],extra_url_vars:[r.Any,{}]})},function(t,e,n){var i=t(195);n.BBoxTileSource=i.BBoxTileSource;var r=t(196);n.DynamicImageRenderer=r.DynamicImageRenderer;var o=t(198);n.ImageSource=o.ImageSource;var s=t(200);n.MercatorTileSource=s.MercatorTileSource;var a=t(201);n.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(202);n.TileRenderer=l.TileRenderer;var u=t(203);n.TileSource=u.TileSource;var h=t(205);n.TMSTileSource=h.TMSTileSource;var c=t(206);n.WMTSTileSource=c.WMTSTileSource},function(t,e,n){var i=t(364),r=[].indexOf,o=t(203),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n;return t.prototype.initialize.call(this,e),this._resolutions=function(){var t,e,i,r;for(r=[],n=t=e=this.min_zoom,i=this.max_zoom;e<=i?t<=i:t>=i;n=e<=i?++t:--t)r.push(this.get_resolution(n));return r}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,n){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,n)))&&!(e<0||e>=Math.pow(2,n))},e.prototype.retain_children=function(t){var e,n,i,r,o,s,a;r=t.quadkey,i=r.length,n=i+3,o=this.tiles,s=[];for(e in o)0===(a=o[e]).quadkey.indexOf(r)&&a.quadkey.length>i&&a.quadkey.length<=n?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d;f=t.tile_coords,h=f[0],c=f[1],_=f[2],n=function(){var t,e,n,i;for(i=[],p=t=e=h-4,n=h+4;e<=n?t<=n:t>=n;p=e<=n?++t:--t)i.push(p);return i}(),i=function(){var t,e,n,i;for(i=[],d=t=e=c-4,n=c+4;e<=n?t<=n:t>=n;d=e<=n?++t:--t)i.push(d);return i}(),o=this.tiles,l=[];for(e in o)(u=o[e]).tile_coords[2]===_&&(s=u.tile_coords[0],r.call(n,s)>=0)&&(a=u.tile_coords[1],r.call(i,a)>=0)?l.push(u.retain=!0):l.push(void 0);return l;var f},e.prototype.retain_parents=function(t){var e,n,i,r,o;n=t.quadkey,i=this.tiles,r=[];for(e in i)o=i[e],r.push(o.retain=0===n.indexOf(o.quadkey));return r},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a,l;for(0!==(l=this.calculate_world_x_by_tile_xyz(t,e,n))&&(u=this.normalize_xyz(t,e,n),t=u[0],e=u[1],n=u[2]),a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)h=this.quadkey_to_tile_xyz(a+o.toString()),t=h[0],e=h[1],n=h[2],0!==l&&(c=this.denormalize_xyz(t,e,n,l),t=c[0],e=c[1],n=c[2]),null!=(i=this.get_tile_meter_bounds(t,e,n))&&r.push([t,e,n,i]);return r;var u,h,c},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,n){var i,r;return i=(t[2]-t[0])/n,r=(t[3]-t[1])/e,[i,r]},e.prototype.get_level_by_extent=function(t,e,n){var i,r,o,s,a,l,u,h;for(u=(t[2]-t[0])/n,h=(t[3]-t[1])/e,l=Math.max(u,h),i=0,a=this._resolutions,r=0,o=a.length;rs){if(0===i)return 0;if(i>0)return i-1}i+=1}},e.prototype.get_closest_level_by_extent=function(t,e,n){var i,r,o,s;return o=(t[2]-t[0])/n,s=(t[3]-t[1])/e,r=Math.max(o,s),this._resolutions,i=this._resolutions.reduce(function(t,e){return Math.abs(e-r)=o;c=i+=-1)for(l=r=h,s=u;r<=s;l=r+=1)this.is_valid_tile(l,c,e)&&a.push([l,c,e,this.get_tile_meter_bounds(l,c,e)]);return a=this.sort_tiles_from_center(a,[h,p,u,_]);var g,y},e.prototype.quadkey_to_tile_xyz=function(t){\"Computes tile x, y and z values based on quadKey.\";var e,n,i,r,o,s,a;for(r=0,o=0,s=t.length,e=n=s;n>0;e=n+=-1)switch(a=t.charAt(s-e),i=1<0;r=o+=-1)i=0,0!=(t&(s=1<0;)if(i=i.substring(0,i.length-1),s=this.quadkey_to_tile_xyz(i),t=s[0],e=s[1],n=s[2],a=this.denormalize_xyz(t,e,n,r),t=a[0],e=a[1],n=a[2],this.tile_xyz_to_key(t,e,n)in this.tiles)return[t,e,n];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,n){var i;return this.wrap_around?(i=Math.pow(2,n),[(t%i+i)%i,e,n]):[t,e,n]},e.prototype.denormalize_xyz=function(t,e,n,i){return[t+i*Math.pow(2,n),e,n]},e.prototype.denormalize_meters=function(t,e,n,i){return[t+2*i*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,n){return Math.floor(t/Math.pow(2,n))},e}(o.TileSource);n.MercatorTileSource=a,a.prototype.type=\"MercatorTileSource\",a.define({wrap_around:[s.Bool,!0]}),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(t,e,n){var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r;return i=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,n),t=o[0],e=o[1],n=o[2],r=this.tile_xyz_to_quadkey(t,e,n),i.replace(\"{Q}\",r);var o},e}(r.MercatorTileSource);n.QUADKEYTileSource=o,o.prototype.type=\"QUADKEYTileSource\"},function(t,e,n){var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")},o=[].indexOf,s=t(197),a=t(206),l=t(165),u=t(5),h=t(15),c=t(42);n.TileRendererView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._add_attribution=e._add_attribution.bind(e),e._on_tile_load=e._on_tile_load.bind(e),e._on_tile_cache_load=e._on_tile_cache_load.bind(e),e._on_tile_error=e._on_tile_error.bind(e),e._prefetch_tiles=e._prefetch_tiles.bind(e),e._update=e._update.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.pool=new s.ImagePool,this.map_plot=this.plot_model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_model.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,n,i,o;if(r(this,e),t=this.model.tile_source.attribution,c.isString(t)&&t.length>0)return null==this.attributionEl&&(o=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,n=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,i=this.map_frame._width.value,this.attributionEl=u.div({class:\"bk-tile-attribution\",style:{position:\"absolute\",bottom:n+\"px\",right:o+\"px\",\"max-width\":i+\"px\",padding:\"2px\",\"background-color\":\"rgba(255,255,255,0.8)\",\"font-size\":\"9pt\",\"font-family\":\"sans-serif\"}}),this.plot_view.canvas_view.events_el.appendChild(this.attributionEl)),this.attributionEl.innerHTML=t},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),t=this.model.tile_source.snap_to_zoom(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,e),this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this._add_attribution()},e.prototype._on_tile_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.current=!0,n.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.loaded=!0,n.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var n;return r(this,e),n=t.target.tile_data,n.finished=!0},e.prototype._create_tile=function(t,e,n,i,r){void 0===r&&(r=!1);var o,s;return o=this.model.tile_source.normalize_xyz(t,e,n),s=this.pool.pop(),s.onload=r?this._on_tile_cache_load:this._on_tile_load,s.onerror=this._on_tile_error,s.alt=\"\",s.tile_data={tile_coords:[t,e,n],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,n),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,n),bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]},this.model.tile_source.tiles[s.tile_data.cache_key]=s.tile_data,s.src=(a=this.model.tile_source).get_image_url.apply(a,o),this._tiles.push(s),s;var a},e.prototype._enforce_aspect_ratio=function(){var t,e,n;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),n=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom(t,this.map_frame._height.value,this.map_frame._width.value,n),this.x_range.setv({start:e[0],end:e[2]}),this.y_range.setv({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0)},e.prototype.has_finished=function(){var e,n,i;if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(i=this._tiles,e=0,n=i.length;ey&&(h=this.extent,I=y,E=!0),E&&(this.x_range.setv({x_range:{start:h[0],end:h[2]}}),this.y_range.setv({start:h[1],end:h[3]}),this.extent=h),this.extent=h,N=O.get_tiles_by_extent(h,I),S=[],x=[],n=[],s=[],_=0,m=N.length;_=i?(c=(_=[1,l/i])[0],_[1]):(c=(p=[i/l,1])[0],p[1]),t[0]<=e[0]?(o=t[0],(s=t[0]+h*c)>hend&&(s=hend)):(s=t[0],(o=t[0]-h*c)vend&&(a=vend)):(a=t[1],(r=t[1]-h/i)n.end)&&(this.v_axis_only=!0),(os.end)&&(this.h_axis_only=!0)),null!=(i=this.model.document)?i.interactive_start(this.plot_model.plot):void 0;var a},e.prototype._pan=function(t){var e;return this._update(t.deltaX,t.deltaY),null!=(e=this.model.document)?e.interactive_start(this.plot_model.plot):void 0},e.prototype._pan_end=function(t){if(this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info)return this.plot_view.push_state(\"pan\",{range:this.pan_info})},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,S,T;r=this.plot_view.frame,a=t-this.last_dx,l=e-this.last_dy,o=r.bbox.h_range,g=o.start-a,v=o.end-a,k=r.bbox.v_range,w=k.start-l,x=k.end-l,\"width\"!==(n=this.model.dimensions)&&\"both\"!==n||this.v_axis_only?(f=o.start,m=o.end,_=0):(f=g,m=v,_=-a),\"height\"!==n&&\"both\"!==n||this.h_axis_only?(y=k.start,b=k.end,p=0):(y=w,b=x,p=-l),this.last_dx=t,this.last_dy=e,S={},u=r.xscales;for(s in u)c=u[s],M=c.r_invert(f,m),d=M[0],i=M[1],S[s]={start:d,end:i};T={},h=r.yscales;for(s in h)c=h[s],A=c.r_invert(y,b),d=A[0],i=A[1],T[s]={start:d,end:i};return this.pan_info={xrs:S,yrs:T,sdx:_,sdy:p},this.plot_view.update_range(this.pan_info,!0),null;var M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.PanTool=s,s.prototype.default_view=n.PanToolView,s.prototype.type=\"PanTool\",s.prototype.tool_name=\"Pan\",s.prototype.event_type=\"pan\",s.prototype.default_order=10,s.define({dimensions:[o.Dimensions,\"both\"]}),s.getters({tooltip:function(){return this._get_dim_tooltip(\"Pan\",this.dimensions)},icon:function(){return\"bk-tool-icon-\"+function(){switch(this.dimensions){case\"both\":return\"pan\";case\"width\":return\"xpan\";case\"height\":return\"ypan\"}}.call(this)}})},function(t,e,n){var i,r=t(364),o=t(222),s=t(62),a=t(15),l=t(22);n.PolySelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={sx:[],sy:[]}},e.prototype._active_change=function(){if(!this.model.active)return this._clear_data()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_data()},e.prototype._doubletap=function(t){var e,n;return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"poly_select\",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){return this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,n;if(i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)){return this.data.sx.push(e),this.data.sy.push(n),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)});var i}},e.prototype._do_select=function(t,e,n,i){var r;return r={type:\"poly\",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=i.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.PolySelectTool=u,u.prototype.default_view=n.PolySelectToolView,u.prototype.type=\"PolySelectTool\",u.prototype.tool_name=\"Poly Select\",u.prototype.icon=\"bk-tool-icon-polygon-select\",u.prototype.event_type=\"tap\",u.prototype.default_order=11,u.define({callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){var i=t(364),r=t(218),o=t(161),s=t(162),a=t(14),l=t(15),u=t(30),h=t(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._computed_renderers_by_data_source=function(){var t,e,n,i,r,a;for(r={},i=this.computed_renderers,t=0,e=i.length;to;i=0<=o?++r:--r)n.x[i]=s.invert(n.sx[i]),n.y[i]=l.invert(n.sy[i]);break;default:a.logger.debug(\"Unrecognized selection geometry type: '\"+n.type+\"'\")}return this.plot_model.plot.trigger_event(new h.SelectionGeometry({geometry:n,final:e}));var c,_},e}(r.GestureToolView);n.SelectToolView=c,c.getters({computed_renderers:function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.SelectTool=_,_.define({renderers:[l.Array,[]],names:[l.Array,[]]}),_.internal({multi_select_modifier:[l.String,\"shift\"]})},function(t,e,n){var i=t(364),r=t(222),o=t(15),s=t(42);n.TapToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tap=function(t){var e,n,i,r;return o=t.bokeh,i=o.sx,r=o.sy,e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,r,!0,e);var o},e.prototype._select=function(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m;if(l={type:\"point\",sx:t,sy:e},o=this.model.callback,a={geometries:l},\"select\"===this.model.behavior){f=this._computed_renderers_by_data_source();for(r in f)d=f[r],m=d[0].get_selection_manager(),_=function(){var t,e,n;for(n=[],t=0,e=d.length;t.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;switch(n=this.plot_model.frame,i=n.bbox.h_range,x=n.bbox.v_range,S=[i.start,i.end],d=S[0],p=S[1],T=[x.start,x.end],y=T[0],g=T[1],this.model.dimension){case\"height\":b=Math.abs(g-y),c=d,_=p,m=y-b*t,v=g-b*t;break;case\"width\":f=Math.abs(p-d),c=d-f*t,_=p-f*t,m=y,v=g}w={},s=n.xscales;for(r in s)u=s[r],M=u.r_invert(c,_),h=M[0],e=M[1],w[r]={start:h,end:e};k={},a=n.yscales;for(r in a)u=a[r],A=u.r_invert(m,v),h=A[0],e=A[1],k[r]={start:h,end:e};return o={xrs:w,yrs:k,factor:t},this.plot_view.push_state(\"wheel_pan\",{range:o}),this.plot_view.update_range(o,!1,!0),null!=(l=this.model.document)&&l.interactive_start(this.plot_model.plot),null;var S,T,M,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelPanTool=s,s.prototype.type=\"WheelPanTool\",s.prototype.default_view=n.WheelPanToolView,s.prototype.tool_name=\"Wheel Pan\",s.prototype.icon=\"bk-tool-icon-wheel-pan\",s.prototype.event_type=\"scroll\",s.prototype.default_order=12,s.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),s.define({dimension:[o.Dimension,\"width\"]}),s.internal({speed:[o.Number,.001]})},function(t,e,n){var i=t(364),r=t(218),o=t(44),s=t(15);n.WheelZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pinch=function(t){var e;return e=t.scale>=1?20*(t.scale-1):-20/t.scale,t.bokeh.delta=e,this._scroll(t)},e.prototype._scroll=function(t){var e,n,i,r,s,a,l,u,h,c,_;return i=this.plot_model.frame,s=i.bbox.h_range,c=i.bbox.v_range,p=t.bokeh,l=p.sx,u=p.sy,e=this.model.dimensions,r=(\"width\"===e||\"both\"===e)&&s.start0?\"pinch\":\"scroll\",a.prototype.default_order=10,a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({dimensions:[s.Dimensions,\"both\"]}),a.internal({speed:[s.Number,1/600]})},function(t,e,n){var i=t(207);n.ActionTool=i.ActionTool;var r=t(208);n.HelpTool=r.HelpTool;var o=t(209);n.RedoTool=o.RedoTool;var s=t(210);n.ResetTool=s.ResetTool;var a=t(211);n.SaveTool=a.SaveTool;var l=t(212);n.UndoTool=l.UndoTool;var u=t(213);n.ZoomInTool=u.ZoomInTool;var h=t(214);n.ZoomOutTool=h.ZoomOutTool;var c=t(215);n.ButtonTool=c.ButtonTool;var _=t(216);n.BoxSelectTool=_.BoxSelectTool;var p=t(217);n.BoxZoomTool=p.BoxZoomTool;var d=t(218);n.GestureTool=d.GestureTool;var f=t(219);n.LassoSelectTool=f.LassoSelectTool;var m=t(220);n.PanTool=m.PanTool;var v=t(221);n.PolySelectTool=v.PolySelectTool;var g=t(222);n.SelectTool=g.SelectTool;var y=t(223);n.TapTool=y.TapTool;var b=t(224);n.WheelPanTool=b.WheelPanTool;var x=t(225);n.WheelZoomTool=x.WheelZoomTool;var w=t(227);n.CrosshairTool=w.CrosshairTool;var k=t(228);n.HoverTool=k.HoverTool;var S=t(229);n.InspectTool=S.InspectTool;var T=t(231);n.Tool=T.Tool;var M=t(232);n.ToolProxy=M.ToolProxy;var A=t(233);n.Toolbar=A.Toolbar;var E=t(234);n.ToolbarBase=E.ToolbarBase;var z=t(235);n.ProxyToolbar=z.ProxyToolbar;var C=t(235);n.ToolbarBox=C.ToolbarBox},function(t,e,n){var i=t(364),r=t(229),o=t(63),s=t(15),a=t(30);n.CrosshairToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)||(e=n=null),this._update_spans(e,n);var i}},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var n;if(\"width\"!==(n=this.model.dimensions)&&\"both\"!==n||(this.model.spans.width.computed_location=e),\"height\"===n||\"both\"===n)return this.model.spans.height.computed_location=t},e}(r.InspectToolView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.spans={width:new o.Span({for_hover:!0,dimension:\"width\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:\"height\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);n.CrosshairTool=l,l.prototype.default_view=n.CrosshairToolView,l.prototype.type=\"CrosshairTool\",l.prototype.tool_name=\"Crosshair\",l.prototype.icon=\"bk-tool-icon-crosshair\",l.define({dimensions:[s.Dimensions,\"both\"],line_color:[s.Color,\"black\"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),l.internal({location_units:[s.SpatialUnits,\"screen\"],render_mode:[s.RenderMode,\"css\"],spans:[s.Any]}),l.getters({tooltip:function(){return this._get_dim_tooltip(\"Crosshair\",this.dimensions)},synthetic_renderers:function(){return a.values(this.spans)}})},function(t,e,n){var i=t(364),r=t(229),o=t(67),s=t(161),a=t(162),l=t(9),u=t(39),h=t(5),c=t(15),_=t(26),p=t(30),d=t(42),f=t(4);n._nearest_line_hit=function(t,e,n,i,r,o){var s,a,u,h,c,_;if(s=r[t],a=o[t],u=r[t+1],h=o[t+1],\"span\"===e.type)switch(e.direction){case\"h\":c=Math.abs(s-n),_=Math.abs(u-n);break;case\"v\":c=Math.abs(a-i),_=Math.abs(h-i)}else c=l.dist_2_pts(s,a,n,i),_=l.dist_2_pts(u,h,n,i);return c<_?[[s,a],t]:[[u,h],t+1]},n._line_hit=function(t,e,n){return[[t[n],e[n]],n]};var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){return f.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e,n,i,r;for(t.prototype.connect_signals.call(this),r=this.computed_renderers,e=0,n=r.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i},e.prototype._compute_ttmodels=function(){var t,e,n,i,r,l,u;if(u={},null!=(l=this.model.tooltips))for(i=this.computed_renderers,t=0,e=i.length;t=0){if(k=x.match(/\\$color(\\[.*\\])?:(\\w*)/),k[0],m=k[1],r=k[2],null==(s=t.get_column(r))){a=h.span({},r+\" unknown\"),i.appendChild(a);continue}if(l=(null!=m?m.indexOf(\"hex\"):void 0)>=0,y=(null!=m?m.indexOf(\"swatch\"):void 0)>=0,null==(o=s[e])){a=h.span({},\"(null)\"),i.appendChild(a);continue}l&&(o=_.color2hex(o)),a=h.span({},o),i.appendChild(a),y&&(a=h.span({class:\"bk-tooltip-color-block\",style:{backgroundColor:o}},\" \"),i.appendChild(a))}else x=x.replace(\"$~\",\"$data_\"),(a=h.span()).innerHTML=u.replace_placeholders(x,t,e,this.model.formatters,n),i.appendChild(a);return g;var w,k},e}(r.InspectToolView);n.HoverToolView=m,m.getters({computed_renderers:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},ttmodels:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels}});var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InspectTool);n.HoverTool=v,v.prototype.default_view=m,v.prototype.type=\"HoverTool\",v.prototype.tool_name=\"Hover\",v.prototype.icon=\"bk-tool-icon-hover\",v.define({tooltips:[c.Any,[[\"index\",\"$index\"],[\"data (x, y)\",\"($x, $y)\"],[\"screen (x, y)\",\"($sx, $sy)\"]]],formatters:[c.Any,{}],renderers:[c.Array,[]],names:[c.Array,[]],mode:[c.String,\"mouse\"],point_policy:[c.String,\"snap_to_data\"],line_policy:[c.String,\"nearest\"],show_arrow:[c.Boolean,!0],anchor:[c.String,\"center\"],attachment:[c.String,\"horizontal\"],callback:[c.Any]})},function(t,e,n){var i=t(364),r=t(15),o=t(215),s=t(230);n.InspectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonTool);n.InspectTool=a,a.prototype.button_view=s.OnOffButtonView,a.prototype.event_type=\"move\",a.define({toggleable:[r.Bool,!0]}),a.override({active:!0})},function(t,e,n){var i=t(364),r=t(215);n.OnOffButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active?this.el.classList.add(\"bk-active\"):this.el.classList.remove(\"bk-active\")},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(r.ButtonToolButtonView)},function(t,e,n){var i=t(364),r=t(15),o=t(45),s=t(22),a=t(50),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);n.ToolView=l,l.getters({plot_model:function(){return this.plot_view.model}});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_dim_tooltip=function(t,e){switch(e){case\"width\":return t+\" (x-axis)\";case\"height\":return t+\" (y-axis)\";case\"both\":return t}},e.prototype._get_dim_limits=function(t,e,n,i){var r,o,a,l,u=t[0],h=t[1],c=e[0],_=e[1];return r=n.bbox.h_range,\"width\"===i||\"both\"===i?(o=[s.min([u,c]),s.max([u,c])],o=[s.max([o[0],r.start]),s.min([o[1],r.end])]):o=[r.start,r.end],l=n.bbox.v_range,\"height\"===i||\"both\"===i?(a=[s.min([h,_]),s.max([h,_])],a=[s.max([a[0],l.start]),s.min([a[1],l.end])]):a=[l.start,l.end],[o,a]},e}(a.Model);n.Tool=u,u.getters({synthetic_renderers:function(){return[]}}),u.internal({active:[r.Boolean,!1]})},function(t,e,n){var i=t(364),r=t(15),o=t(20),s=t(50),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.do=new o.Signal(this,\"do\"),this.connect(this.do,function(){return this.doit()}),this.connect(this.properties.active.change,function(){return this.set_active()})},e.prototype.doit=function(){var t,e,n;for(n=this.tools,t=0,e=n.length;t0&&(x=g(N),this.gestures[n].tools.push(x),this.connect(x.properties.active.change,this._active_change.bind(this,x)))}this.actions=[];for(O in t)(N=t[O]).length>0&&this.actions.push(g(N));this.inspectors=[];for(O in u)(N=u[O]).length>0&&this.inspectors.push(g(N,!0));z=[];for(e in this.gestures)0!==(N=this.gestures[e].tools).length&&(this.gestures[e].tools=a.sortBy(N,function(t){return t.default_order}),\"pinch\"!==e&&\"scroll\"!==e?z.push(this.gestures[e].tools[0].active=!0):z.push(void 0));return z;var P},e}(_.ToolbarBase);n.ProxyToolbar=m,m.prototype.type=\"ProxyToolbar\";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},f.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return f.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e;return t.prototype.render.call(this),(e=this._toolbar_views[this.model.toolbar.id]).render(),s.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(d.LayoutDOMView);n.ToolbarBoxView=v,v.prototype.className=\"bk-toolbar-box\";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(d.LayoutDOM);n.ToolbarBox=g,g.prototype.type=\"ToolbarBox\",g.prototype.default_view=v,g.define({toolbar:[o.Instance],toolbar_location:[o.Location,\"right\"]}),g.getters({sizing_mode:function(){switch(this.toolbar_location){case\"above\":case\"below\":return\"scale_width\";case\"left\":case\"right\":return\"scale_height\"}}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(30),a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(r,e),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,n]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,n]))},r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),[t,\"require\",\"exports\",e])))},r.prototype._make_values=function(){return s.values(this.args)},r}(r.Transform);n.CustomJSTransform=a,a.prototype.type=\"CustomJSTransform\",a.define({args:[o.Any,{}],func:[o.String,\"\"],v_func:[o.String,\"\"]}),a.getters({values:function(){return this._make_values()},scalar_transform:function(){return this._make_transform(\"x\",this.func)},vector_transform:function(){return this._make_transform(\"xs\",this.v_func)}})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(r.Transform);n.Dodge=s,s.define({value:[o.Number,0],range:[o.Instance]})},function(t,e,n){var i=t(236);n.CustomJSTransform=i.CustomJSTransform;var r=t(237);n.Dodge=r.Dodge;var o=t(239);n.Interpolator=o.Interpolator;var s=t(240);n.Jitter=s.Jitter;var a=t(241);n.LinearInterpolator=a.LinearInterpolator;var l=t(242);n.StepInterpolator=l.StepInterpolator;var u=t(243);n.Transform=u.Transform},function(t,e,n){var i=t(364),r=[].indexOf,o=t(243),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.prototype.sort=function(t){void 0===t&&(t=!1);var e,n,i,o,s,a,l,u,h,c,_;if(typeof this.x!=typeof this.y)throw new Error(\"The parameters for x and y must be of the same type, either both strings which define a column in the data source or both arrays of the same length\");if(\"string\"==typeof this.x&&null===this.data)throw new Error(\"If the x and y parameters are not specified as an array, the data parameter is reqired.\");if(!1!==this._sorted_dirty){if(c=[],_=[],\"string\"==typeof this.x){if(n=this.data,e=n.columns(),l=this.x,r.call(e,l)<0)throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");if(u=this.y,r.call(e,u)<0)throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");c=n.get_column(this.x),_=n.get_column(this.y)}else c=this.x,_=this.y;if(c.length!==_.length)throw new Error(\"The length for x and y do not match\");if(c.length<2)throw new Error(\"x and y must have at least two elements to support interpolation\");a=[];for(o in c)a.push({x:c[o],y:_[o]});for(!0===t?a.sort(function(t,e){var n,i;return null!=(n=t.xe.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}),s=i=0,h=a.length;0<=h?ih;s=0<=h?++i:--i)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(o.Transform);n.Interpolator=a,a.define({x:[s.Any],y:[s.Any],data:[s.Any],clip:[s.Bool,!0]})},function(t,e,n){var i=t(364),r=t(243),o=t(15),s=t(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),\"uniform\"===this.distribution?t+this.mean+(s.random()-.5)*this.width:\"normal\"===this.distribution?t+s.rnorm(this.mean,this.width):void 0},e}(r.Transform);n.Jitter=a,a.define({mean:[o.Number,0],width:[o.Number,1],distribution:[o.Distribution,\"uniform\"],range:[o.Instance]})},function(t,e,n){var i=t(364),r=t(22),o=t(239);n.LinearInterpolator=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,o,s;if(this.sort(!1),!0===this.clip){if(tthis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return t===this._x_sorted[0]?this._y_sorted[0]:(e=r.findLastIndex(this._x_sorted,function(e){return ethis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return n=-1,\"after\"===this.mode&&(n=s.findLastIndex(this._x_sorted,function(e){return t>=e})),\"before\"===this.mode&&(n=s.findIndex(this._x_sorted,function(e){return t<=e})),\"center\"===this.mode&&(e=function(){var e,n,i,o;for(i=this._x_sorted,o=[],e=0,n=i.length;e=1<<28)throw new RangeError(\"repeat count must not overflow maximum string size\");for(var n=\"\";1==(1&t)&&(n+=e),0!=(t>>>=1);)e+=e;return n})},function(t,e,n){var i=t(37),r=function(){function t(t,e,n){this.header=t,this.metadata=e,this.content=n,this.buffers=[]}return t.assemble=function(e,n,i){var r=JSON.parse(e),o=JSON.parse(n),s=JSON.parse(i);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.length)throw new Error(\"too many buffers received, expecting #{nb}\");this.buffers.push([t,e])},t.create=function(e,n,i){void 0===i&&(i={});var r=t.create_header(e);return new t(r,n,i)},t.create_header=function(t){return{msgid:i.uniqueId(),msgtype:t}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!(\"num_buffers\"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error(\"BokehJS only supports receiving buffers, not sending\");var n=JSON.stringify(this.header),i=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(n),t.send(i),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return\"msgid\"in this.header?\"msgtype\"in this.header?null:\"No msgtype in header\":\"No msgid in header\"},t}();n.Message=r},function(t,e,n){var i=t(245),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),n=e[0],r=e[1],o=e[2];this._partial=i.Message.assemble(n,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error(\"Expected text fragment but received binary fragment\")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error(\"Expected binary fragment but received text fragment\")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();n.Receiver=r},function(t,e,n){n.safely=function(t,e){void 0===e&&(e=!1);try{return t()}catch(t){if(function(t){var e=document.createElement(\"div\");e.style.backgroundColor=\"#f2dede\",e.style.border=\"1px solid #a94442\",e.style.borderRadius=\"4px\",e.style.display=\"inline-block\",e.style.fontFamily=\"sans-serif\",e.style.marginTop=\"5px\",e.style.minWidth=\"200px\",e.style.padding=\"5px 5px 5px 10px\";var n=document.createElement(\"span\");n.style.backgroundColor=\"#a94442\",n.style.borderRadius=\"0px 4px 0px 0px\",n.style.color=\"white\",n.style.cursor=\"pointer\",n.style.cssFloat=\"right\",n.style.fontSize=\"0.8em\",n.style.margin=\"-6px -6px 0px 0px\",n.style.padding=\"2px 5px 4px 5px\",n.title=\"close\",n.setAttribute(\"aria-label\",\"close\"),n.appendChild(document.createTextNode(\"x\")),n.addEventListener(\"click\",function(){return o.removeChild(e)});var i=document.createElement(\"h3\");i.style.color=\"#a94442\",i.style.margin=\"8px 0px 0px 0px\",i.style.padding=\"0px\",i.appendChild(document.createTextNode(\"Bokeh Error\"));var r=document.createElement(\"pre\");r.style.whiteSpace=\"unset\",r.style.overflowX=\"auto\",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(n),e.appendChild(i),e.appendChild(r);var o=document.getElementsByTagName(\"body\")[0];o.insertBefore(e,o.firstChild)}(t),e)return;throw t}}},function(t,e,n){n.version=\"0.12.13\"},/*!!\n", " * Canvas 2 Svg v1.0.21\n", " * A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.\n", " *\n", " * Licensed under the MIT license:\n", " * http://www.opensource.org/licenses/mit-license.php\n", " *\n", " * Author:\n", " * Kerry Liu\n", " *\n", " * Copyright (c) 2014 Gliffy Inc.\n", " */\n", " function(t,e,n){!function(){\"use strict\";function t(t,e){var n,i=Object.keys(e);for(n=0;n1?((e=n).width=arguments[0],e.height=arguments[1]):e=t||n,!(this instanceof r))return new r(e);this.width=e.width||n.width,this.height=e.height||n.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement(\"canvas\"),this.__ctx=this.__canvas.getContext(\"2d\")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),this.__root.setAttribute(\"version\",1.1),this.__root.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\",\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),this.__root.setAttribute(\"width\",this.width),this.__root.setAttribute(\"height\",this.height),this.__ids={},this.__defs=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"),this.__root.appendChild(this.__currentElement)}).prototype.__createElement=function(t,e,n){void 0===e&&(e={});var i,r,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",t),s=Object.keys(e);for(n&&(o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"none\")),i=0;i0){\"path\"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var n=this.__createElement(\"g\");e.appendChild(n),this.__currentElement=n}var i=this.__currentElement.getAttribute(\"transform\");i?i+=\" \":i=\"\",i+=t,this.__currentElement.setAttribute(\"transform\",i)},r.prototype.scale=function(e,n){void 0===n&&(n=e),this.__addTransform(t(\"scale({x},{y})\",{x:e,y:n}))},r.prototype.rotate=function(e){var n=180*e/Math.PI;this.__addTransform(t(\"rotate({angle},{cx},{cy})\",{angle:n,cx:0,cy:0}))},r.prototype.translate=function(e,n){this.__addTransform(t(\"translate({x},{y})\",{x:e,y:n}))},r.prototype.transform=function(e,n,i,r,o,s){this.__addTransform(t(\"matrix({a},{b},{c},{d},{e},{f})\",{a:e,b:n,c:i,d:r,e:o,f:s}))},r.prototype.beginPath=function(){var t;this.__currentDefaultPath=\"\",this.__currentPosition={},t=this.__createElement(\"path\",{},!0),this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t},r.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;\"path\"===t.nodeName?t.setAttribute(\"d\",this.__currentDefaultPath):console.error(\"Attempted to apply path command to node\",t.nodeName)},r.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=\" \",this.__currentDefaultPath+=t},r.prototype.moveTo=function(e,n){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:n}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand(\"Z\")},r.prototype.lineTo=function(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf(\"M\")>-1?this.__addPathCommand(t(\"L {x} {y}\",{x:e,y:n})):this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:n}))},r.prototype.bezierCurveTo=function(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))},r.prototype.quadraticCurveTo=function(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(t(\"Q {cpx} {cpy} {x} {y}\",{cpx:e,cpy:n,x:i,y:r}))};var l=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};r.prototype.arcTo=function(t,e,n,i,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if(void 0!==o&&void 0!==s){if(r<0)throw new Error(\"IndexSizeError: The radius provided (\"+r+\") is negative.\");if(o===t&&s===e||t===n&&e===i||0===r)this.lineTo(t,e);else{var a=l([o-t,s-e]),u=l([n-t,i-e]);if(a[0]*u[1]!=a[1]*u[0]){var h=a[0]*u[0]+a[1]*u[1],c=Math.acos(Math.abs(h)),_=l([a[0]+u[0],a[1]+u[1]]),p=r/Math.sin(c/2),d=t+p*_[0],f=e+p*_[1],m=[-a[1],a[0]],v=[u[1],-u[0]],g=function(t){var e=t[0],n=t[1];return n>=0?Math.acos(e):-Math.acos(e)},y=g(m),b=g(v);this.lineTo(d+m[0]*r,f+m[1]*r),this.arc(d,f,r,y,b)}else this.lineTo(t,e)}}},r.prototype.stroke=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"fill stroke markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.fill=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"stroke fill markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"fill\")},r.prototype.rect=function(t,e,n,i){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()},r.prototype.fillRect=function(t,e,n,i){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"fill\")},r.prototype.strokeRect=function(t,e,n,i){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute(\"transform\"),n=this.__root.childNodes[1],i=n.childNodes,r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)},r.prototype.clearRect=function(t,e,n,i){if(0!==t||0!==e||n!==this.width||i!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement(\"rect\",{x:t,y:e,width:n,height:i,fill:\"#FFFFFF\"},!0),o.appendChild(r)}else this.__clearCanvas()},r.prototype.createLinearGradient=function(t,e,i,r){var s=this.__createElement(\"linearGradient\",{id:n(this.__ids),x1:t+\"px\",x2:i+\"px\",y1:e+\"px\",y2:r+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(s),new o(s,this)},r.prototype.createRadialGradient=function(t,e,i,r,s,a){var l=this.__createElement(\"radialGradient\",{id:n(this.__ids),cx:r+\"px\",cy:s+\"px\",r:a+\"px\",fx:t+\"px\",fy:e+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(l),new o(l,this)},r.prototype.__parseFont=function(){var t=/^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\'\\\"\\sa-z0-9]+?)\\s*$/i.exec(this.font),e={style:t[1]||\"normal\",size:t[4]||\"10px\",family:t[6]||\"sans-serif\",weight:t[3]||\"normal\",decoration:t[2]||\"normal\",href:null};return\"underline\"===this.__fontUnderline&&(e.decoration=\"underline\"),this.__fontHref&&(e.href=this.__fontHref),e},r.prototype.__wrapTextLink=function(t,e){if(t.href){var n=this.__createElement(\"a\");return n.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",t.href),n.appendChild(e),n}return e},r.prototype.__applyText=function(t,e,n,i){var r=this.__parseFont(),o=this.__closestGroupOrSvg(),s=this.__createElement(\"text\",{\"font-family\":r.family,\"font-size\":r.size,\"font-style\":r.style,\"font-weight\":r.weight,\"text-decoration\":r.decoration,x:e,y:n,\"text-anchor\":function(t){var e={left:\"start\",right:\"end\",center:\"middle\",start:\"start\",end:\"end\"};return e[t]||e.start}(this.textAlign),\"dominant-baseline\":function(t){var e={alphabetic:\"alphabetic\",hanging:\"hanging\",top:\"text-before-edge\",bottom:\"text-after-edge\",middle:\"central\"};return e[t]||e.alphabetic}(this.textBaseline)},!0);s.appendChild(this.__document.createTextNode(t)),this.__currentElement=s,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,s))},r.prototype.fillText=function(t,e,n){this.__applyText(t,e,n,\"fill\")},r.prototype.strokeText=function(t,e,n){this.__applyText(t,e,n,\"stroke\")},r.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},r.prototype.arc=function(e,n,i,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+i*Math.cos(o),l=n+i*Math.sin(o),u=e+i*Math.cos(r),h=n+i*Math.sin(r),c=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,h),this.__addPathCommand(t(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:_,sweepFlag:c,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),i=this.__createElement(\"clipPath\"),r=n(this.__ids),o=this.__createElement(\"g\");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),i.setAttribute(\"id\",r),i.appendChild(this.__currentElement),this.__defs.appendChild(i),e.setAttribute(\"clip-path\",t(\"url(#{id})\",{id:r})),e.appendChild(o),this.__currentElement=o},r.prototype.drawImage=function(){var t,e,n,i,o,s,a,l,u,h,c,_,p,d,f=Array.prototype.slice.call(arguments),m=f[0],v=0,g=0;if(3===f.length)t=f[1],e=f[2],o=m.width,s=m.height,n=o,i=s;else if(5===f.length)t=f[1],e=f[2],n=f[3],i=f[4],o=m.width,s=m.height;else{if(9!==f.length)throw new Error(\"Inavlid number of arguments passed to drawImage: \"+arguments.length);v=f[1],g=f[2],o=f[3],s=f[4],t=f[5],e=f[6],n=f[7],i=f[8]}a=this.__closestGroupOrSvg(),this.__currentElement;var y=\"translate(\"+t+\", \"+e+\")\";if(m instanceof r){if((l=m.getSvg().cloneNode(!0)).childNodes&&l.childNodes.length>1){for(u=l.childNodes[0];u.childNodes.length;)d=u.childNodes[0].getAttribute(\"id\"),this.__ids[d]=d,this.__defs.appendChild(u.childNodes[0]);if(h=l.childNodes[1]){var b,x=h.getAttribute(\"transform\");b=x?x+\" \"+y:y,h.setAttribute(\"transform\",b),a.appendChild(h)}}}else\"IMG\"===m.nodeName?((c=this.__createElement(\"image\")).setAttribute(\"width\",n),c.setAttribute(\"height\",i),c.setAttribute(\"preserveAspectRatio\",\"none\"),(v||g||o!==m.width||s!==m.height)&&((_=this.__document.createElement(\"canvas\")).width=n,_.height=i,(p=_.getContext(\"2d\")).drawImage(m,v,g,o,s,0,0,n,i),m=_),c.setAttribute(\"transform\",y),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===m.nodeName?m.toDataURL():m.getAttribute(\"src\")),a.appendChild(c)):\"CANVAS\"===m.nodeName&&((c=this.__createElement(\"image\")).setAttribute(\"width\",n),c.setAttribute(\"height\",i),c.setAttribute(\"preserveAspectRatio\",\"none\"),(_=this.__document.createElement(\"canvas\")).width=n,_.height=i,(p=_.getContext(\"2d\")).imageSmoothingEnabled=!1,p.mozImageSmoothingEnabled=!1,p.oImageSmoothingEnabled=!1,p.webkitImageSmoothingEnabled=!1,p.drawImage(m,v,g,o,s,0,0,n,i),m=_,c.setAttribute(\"transform\",y),c.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",m.toDataURL()),a.appendChild(c))},r.prototype.createPattern=function(t,e){var i,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"pattern\"),a=n(this.__ids);return o.setAttribute(\"id\",a),o.setAttribute(\"width\",t.width),o.setAttribute(\"height\",t.height),\"CANVAS\"===t.nodeName||\"IMG\"===t.nodeName?((i=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"image\")).setAttribute(\"width\",t.width),i.setAttribute(\"height\",t.height),i.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===t.nodeName?t.toDataURL():t.getAttribute(\"src\")),o.appendChild(i),this.__defs.appendChild(o)):t instanceof r&&(o.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(o)),new s(o,this)},r.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(\",\"):this.lineDash=null},r.prototype.drawFocusRing=function(){},r.prototype.createImageData=function(){},r.prototype.getImageData=function(){},r.prototype.putImageData=function(){},r.prototype.globalCompositeOperation=function(){},r.prototype.setTransform=function(){},\"object\"==typeof window&&(window.C2S=r),\"object\"==typeof e&&\"object\"==typeof e.exports&&(e.exports=r)}()},function(t,e,n){var i,r=t(273),o=t(283),s=t(287),a=t(282),l=t(287),u=t(289),h=Function.prototype.bind,c=Object.defineProperty,_=Object.prototype.hasOwnProperty;i=function(t,e,n){var i,o=u(e)&&l(e.value);return i=r(e),delete i.writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&_.call(this,t)?o:(e.value=h.call(o,n.resolveContext?n.resolveContext(this):this),c(this,t,e),this[t])},i},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,n){return i(n,t,e)})}},function(t,e,n){var i=t(270),r=t(283),o=t(276),s=t(290);(e.exports=function(t,e){var n,o,a,l,u;return arguments.length<2||\"string\"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=a=!0,o=!1):(n=s.call(t,\"c\"),o=s.call(t,\"e\"),a=s.call(t,\"w\")),u={value:e,configurable:n,enumerable:o,writable:a},l?i(r(l),u):u}).gs=function(t,e,n){var a,l,u,h;return\"string\"!=typeof t?(u=n,n=e,e=t,t=null):u=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=e,e=n=void 0),null==t?(a=!0,l=!1):(a=s.call(t,\"c\"),l=s.call(t,\"e\")),h={get:e,set:n,configurable:a,enumerable:l},u?i(r(u),h):h}},function(t,e,n){var i=t(289);e.exports=function(){return i(this).length=0,this}},function(t,e,n){var i=t(264),r=t(268),o=t(289),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,n,h,c;if(!i(t))return s.apply(this,arguments);for(n=r(o(this).length),h=arguments[1],h=isNaN(h)?0:h>=0?u(h):r(this.length)-u(l(h)),e=h;e=55296&&g<=56319&&(w+=t[++n]),w=k?_.call(k,S,w,f):w,e?(p.value=w,d(m,f,p)):m[f]=w,++f;v=f}if(void 0===v)for(v=s(t.length),e&&(m=new e(v)),n=0;n0?1:-1}},function(t,e,n){e.exports=t(265)()?Number.isNaN:t(266)},function(t,e,n){e.exports=function(){var t=Number.isNaN;return\"function\"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){e.exports=function(t){return t!=t}},function(t,e,n){var i=t(261),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?i(t)*o(r(t)):t}},function(t,e,n){var i=t(267),r=Math.max;e.exports=function(t){return r(0,i(t))}},function(t,e,n){var i=t(287),r=t(289),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(n,u){var h,c=arguments[2],_=arguments[3];return n=Object(r(n)),i(u),h=a(n),_&&h.sort(\"function\"==typeof _?o.call(_,n):void 0),\"function\"!=typeof t&&(t=h[t]),s.call(t,h,function(t,i){return l.call(n,t)?s.call(u,c,n[t],t,n,i):e})}}},function(t,e,n){e.exports=t(271)()?Object.assign:t(272)},function(t,e,n){e.exports=function(){var t,e=Object.assign;return\"function\"==typeof e&&(t={foo:\"raz\"},e(t,{bar:\"dwa\"},{trzy:\"trzy\"}),t.foo+t.bar+t.trzy===\"razdwatrzy\")}},function(t,e,n){var i=t(279),r=t(289),o=Math.max;e.exports=function(t,e){var n,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(i){try{t[i]=e[i]}catch(t){n||(n=t)}},s=1;s-1}},function(t,e,n){var i=Object.prototype.toString,r=i.call(\"\");e.exports=function(t){return\"string\"==typeof t||t&&\"object\"==typeof t&&(t instanceof String||i.call(t)===r)||!1}},function(t,e,n){var i=Object.create(null),r=Math.random;e.exports=function(){var t;do{t=r().toString(36).slice(2)}while(i[t]);return t}},function(t,e,n){var i,r=t(284),o=t(290),s=t(251),a=t(308),l=t(298),u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");l.call(this,t),e=e?o.call(e,\"key+value\")?\"key+value\":o.call(e,\"key\")?\"key\":\"value\":\"value\",u(this,\"__kind__\",s(\"\",e))},r&&r(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:\"key+value\"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,a.toStringTag,s(\"c\",\"Array Iterator\"))},function(t,e,n){var i=t(257),r=t(287),o=t(293),s=t(297),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var n,h,c,_,p,d,f,m,v=arguments[2];if(a(t)||i(t)?n=\"array\":o(t)?n=\"string\":t=s(t),r(e),c=function(){_=!0},\"array\"!==n)if(\"string\"!==n)for(h=t.next();!h.done;){if(l.call(e,v,h.value,c),_)return;h=t.next()}else for(d=t.length,p=0;p=55296&&m<=56319&&(f+=t[++p]),l.call(e,v,f,c),!_);++p);else u.call(t,function(t){return l.call(e,v,t,c),_})}},function(t,e,n){var i=t(257),r=t(293),o=t(295),s=t(300),a=t(301),l=t(308).iterator;e.exports=function(t){return\"function\"==typeof a(t)[l]?t[l]():i(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,n){var i,r=t(252),o=t(270),s=t(287),a=t(289),l=t(251),u=t(250),h=t(308),c=Object.defineProperty,_=Object.defineProperties;e.exports=i=function(t,e){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");_(this,{__list__:l(\"w\",a(t)),__context__:l(\"w\",e),__nextIndex__:l(\"w\",0)}),e&&(s(e.on),e.on(\"_add\",this._onAdd),e.on(\"_delete\",this._onDelete),e.on(\"_clear\",this._onClear))},delete i.prototype.constructor,_(i.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)):c(this,\"__redo__\",l(\"c\",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),c(i.prototype,h.iterator,l(function(){return this}))},function(t,e,n){var i=t(257),r=t(278),o=t(293),s=t(308).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!i(t)||\"function\"==typeof t[s])))}},function(t,e,n){var i,r=t(284),o=t(251),s=t(308),a=t(298),l=Object.defineProperty;i=e.exports=function(t){if(!(this instanceof i))throw new TypeError(\"Constructor requires 'new'\");t=String(t),a.call(this,t),l(this,\"__length__\",o(\"\",t.length))},r&&r(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n})}),l(i.prototype,s.toStringTag,o(\"c\",\"String Iterator\"))},function(t,e,n){var i=t(299);e.exports=function(t){if(!i(t))throw new TypeError(t+\" is not iterable\");return t}},/*!\n", " * @overview es6-promise - a tiny implementation of Promises/A+.\n", " * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n", " * @license Licensed under MIT license\n", " * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE\n", " * @version 3.0.2\n", " */\n", " function(t,e,n){(function(){\"use strict\";function n(t){return\"function\"==typeof t}function i(){return function(){setTimeout(r,1)}}function r(){for(var t=0;t\\s*\\(/gm,\"{anonymous}()@\"):\"Unknown Stack Trace\",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,i),e.apply(this,arguments)}}function u(t,e,n){var i,r=e.prototype;(i=t.prototype=Object.create(r)).constructor=t,i._super=r,n&&Z(i,n)}function h(t,e){return function(){return t.apply(e,arguments)}}function c(t,e){return typeof t==et?t.apply(e?e[0]||r:r,e):t}function _(t,e){return t===r?e:t}function p(t,e,n){a(v(e),function(e){t.addEventListener(e,n,!1)})}function d(t,e,n){a(v(e),function(e){t.removeEventListener(e,n,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function x(t,e){for(var n,i,o=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=T(e):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,u=e.center=M(i);e.timeStamp=rt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=C(l,u),e.distance=z(l,u),function(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==_t&&o.eventType!==dt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y});e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}(n,e),e.offsetDirection=E(e.deltaX,e.deltaY);var h=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=it(h.x)>it(h.y)?h.x:h.y,e.scale=a?function(t,e){return z(e[0],e[1],Tt)/z(t[0],t[1],Tt)}(a.pointers,i):1,e.rotation=a?function(t,e){return C(e[1],e[0],Tt)+C(t[1],t[0],Tt)}(a.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,i,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=ft&&(l>ct||a.velocity===r)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=A(l,u,h);i=c.x,o=c.y,n=it(c.x)>it(c.y)?c.x:c.y,s=E(u,h),t.lastInterval=e}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=o,e.direction=s}(n,e);var c=t.element;f(e.srcEvent.target,c)&&(c=e.srcEvent.target);e.target=c}(t,n),t.emit(\"hammer.input\",n),t.recognize(n),t.session.prevInput=n}function T(t){for(var e=[],n=0;n=it(e)?t<0?vt:gt:e<0?yt:bt}function z(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function C(t,e,n){n||(n=St);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function O(){this.evEl=At,this.evWin=Et,this.pressed=!1,k.apply(this,arguments)}function N(){this.evEl=Ot,this.evWin=Nt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function j(){this.evTarget=Pt,this.evWin=Dt,this.started=!1,k.apply(this,arguments)}function P(){this.evTarget=It,this.targetIds={},k.apply(this,arguments)}function D(){k.apply(this,arguments);var t=h(this.handler,this);this.touch=new P(this.manager,t),this.mouse=new O(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function F(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var t=i.indexOf(n);t>-1&&i.splice(t,1)};setTimeout(r,Bt)}}function I(t,e){this.manager=t,this.set(e)}function B(t){this.options=Z({},this.defaults,t||{}),this.id=at++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Ht,this.simultaneous={},this.requireFail=[]}function R(t){return t&Kt?\"cancel\":t&$t?\"end\":t&Qt?\"move\":t&Jt?\"start\":\"\"}function L(t){return t==bt?\"down\":t==yt?\"up\":t==vt?\"left\":t==gt?\"right\":\"\"}function V(t,e){var n=e.manager;return n?n.get(t):t}function G(){B.apply(this,arguments)}function U(){G.apply(this,arguments),this.pX=null,this.pY=null}function Y(){G.apply(this,arguments)}function q(){B.apply(this,arguments),this._timer=null,this._input=null}function X(){G.apply(this,arguments)}function W(){G.apply(this,arguments)}function H(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function J(t,e){return e=e||{},e.recognizers=_(e.recognizers,J.defaults.preset),new Q(t,e)}function Q(t,e){this.options=Z({},J.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){var e,n=t.options.inputClass;e=n||(ut?N:ht?P:lt?D:O);return new e(t,S)}(this),this.touchAction=new I(this,this.options.touchAction),$(this,!0),a(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function $(t,e){var n=t.element;if(n.style){var i;a(t.options.cssProps,function(r,o){i=x(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||\"\"}),e||(t.oldCssProps={})}}var Z,K=[\"\",\"webkit\",\"Moz\",\"MS\",\"ms\",\"o\"],tt=n.createElement(\"div\"),et=\"function\",nt=Math.round,it=Math.abs,rt=Date.now;Z=\"function\"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var e=Object(t),n=1;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i<$t&&e(n.options.event+R(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=$t&&e(n.options.event+R(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return G.prototype.attrTest.call(this,t)&&(this.state&Jt||!(this.state&Jt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=L(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(Y,G,{defaults:{event:\"pinch\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Jt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?\"in\":\"out\";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(q,B,{defaults:{event:\"press\",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||t.eventType&(dt|ft)&&!r)this.reset();else if(t.eventType&_t)this.reset(),this._timer=o(function(){this.state=Zt,this.tryEmit()},e.time,this);else if(t.eventType&dt)return Zt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Zt&&(t&&t.eventType&dt?this.manager.emit(this.options.event+\"up\",t):(this._input.timeStamp=rt(),this.manager.emit(this.options.event,this._input)))}}),u(X,G,{defaults:{event:\"rotate\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Jt)}}),u(W,G,{defaults:{event:\"swipe\",threshold:10,velocity:.3,direction:xt|wt,pointers:1},getTouchAction:function(){return U.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(xt|wt)?e=t.overallVelocity:n&xt?e=t.overallVelocityX:n&wt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&it(e)>this.options.velocity&&t.eventType&dt},emit:function(t){var e=L(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(H,B,{defaults:{event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ut]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance=\";case i.Eq:return\"==\"}}()+\" 0\"},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"expression\",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"op\",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"strength\",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();n.Constraint=o;var s=0},function(t,e,n){var i=t(328),r=t(331),o=t(322),s=function(){function t(){var t=function(t){for(var e=0,n=function(){return 0},i=o.createMap(r.Variable.Compare),s=0,a=t.length;s=0?\" + \"+l+a:\" - \"+-l+a}var u=this.constant;return u<0?n+=\" - \"+-u:u>0&&(n+=\" + \"+u),n},Object.defineProperty(t.prototype,\"terms\",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"constant\",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"value\",{get:function(){var t=this._constant;return i.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();n.Expression=s},function(t,e,n){/*-----------------------------------------------------------------------------\n", " | Copyright (c) 2014, Nucleic Development Team.\n", " |\n", " | Distributed under the terms of the Modified BSD License.\n", " |\n", " | The full license is in the file COPYING.txt, distributed with this software.\n", " |----------------------------------------------------------------------------*/\n", " function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}i(t(331)),i(t(320)),i(t(319)),i(t(324)),i(t(323))},function(t,e,n){var i=t(328);n.createMap=function(t){return new i.AssociativeArray(t)}},function(t,e,n){function i(t){return t<0?-t<1e-8:t<1e-8}var r=t(331),o=t(320),s=t(319),a=t(324),l=t(322),u=t(328),h=function(){function t(){this._cnMap=l.createMap(s.Constraint.Compare),this._rowMap=l.createMap(_.Compare),this._varMap=l.createMap(r.Variable.Compare),this._editMap=l.createMap(r.Variable.Compare),this._infeasibleRows=[],this._objective=new d,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error(\"duplicate constraint\");var n=this._createRow(t),r=n.row,o=n.tag,s=this._chooseSubject(r,o);if(s.type()===c.Invalid&&r.allDummies()){if(!i(r.constant())){for(var a=[],l=0,u=t.expression.terms._array;l0&&a.type()!==c.Dummy){var u=this._objective.coefficientFor(a),h=u/l;h0;)n(t[r=o+(i=s>>1)],e)<0?(o=r+1,s-=i+1):s=i;return o}var r=t(329);n.lowerBound=i,n.binarySearch=function(t,e,n){var r=i(t,e,n);if(r===t.length)return-1;var o=t[r];if(0!==n(o,e))return-1;return r},n.binaryFind=function(t,e,n){var r=i(t,e,n);if(r===t.length)return;var o=t[r];if(0!==n(o,e))return;return o},n.asSet=function(t,e){var n=r.asArray(t),i=n.length;if(i<=1)return n;n.sort(e);for(var o=[n[0]],s=1,a=0;s0))return!1;++r}}return!0},n.setIsSubset=function(t,e,n){var i=t.length,r=e.length;if(i>r)return!1;var o=0,s=0;for(;o0?++s:(++o,++s)}if(o0?(a.push(u),++r):(a.push(l),++i,++r)}for(;i0?++r:(a.push(l),++i,++r)}return a},n.setDifference=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i0?++r:(++i,++r)}for(;i0?(a.push(u),++r):(++i,++r)}for(;i=0},e.prototype.find=function(t){return s.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e());return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e());return n.splice(i,0,o),o}return a},e.prototype.insert=function(t,e){var n=this._array,i=s.lowerBound(n,t,this._wrapped);if(i===n.length){var o=new r.Pair(t,e);return n.push(o),o}var a=n[i];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e);return n.splice(i,0,o),o}return a.second=e,a},e.prototype.update=function(t){var n=this;t instanceof e?this._array=function(t,e,n){var i=0,r=0,o=t.length,s=e.length,a=[];for(;i0?(a.push(u.copy()),++r):(a.push(u.copy()),++i,++r)}for(;i-1?function(t,e){var n,i,o,s,a;a=t.toString(),n=a.split(\"e\")[0],s=a.split(\"e\")[1],i=n.split(\".\")[0],o=n.split(\".\")[1]||\"\",a=i+o+r(s-o.length),e>0&&(a+=\".\"+r(e));return a}(t,e):(n(t*a)/a).toFixed(e),i&&(o=new RegExp(\"0{1,\"+i+\"}$\"),s=s.replace(o,\"\")),s}function s(t,e,n){return e.indexOf(\"$\")>-1?function(t,e,n){var i,r,o=e,s=o.indexOf(\"$\"),l=o.indexOf(\"(\"),u=o.indexOf(\"+\"),h=o.indexOf(\"-\"),_=\"\",d=\"\";-1===o.indexOf(\"$\")?\"infix\"===c[p].currency.position?(d=c[p].currency.symbol,c[p].currency.spaceSeparated&&(d=\" \"+d+\" \")):c[p].currency.spaceSeparated&&(_=\" \"):o.indexOf(\" $\")>-1?(_=\" \",o=o.replace(\" $\",\"\")):o.indexOf(\"$ \")>-1?(_=\" \",o=o.replace(\"$ \",\"\")):o=o.replace(\"$\",\"\");if(r=a(t,o,n,d),-1===e.indexOf(\"$\"))switch(c[p].currency.position){case\"postfix\":r.indexOf(\")\")>-1?((r=r.split(\"\")).splice(-1,0,_+c[p].currency.symbol),r=r.join(\"\")):r=r+_+c[p].currency.symbol;break;case\"infix\":break;case\"prefix\":r.indexOf(\"(\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),i=Math.max(l,h)+1,r.splice(i,0,c[p].currency.symbol+_),r=r.join(\"\")):r=c[p].currency.symbol+_+r;break;default:throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]')}else s<=1?r.indexOf(\"(\")>-1||r.indexOf(\"+\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),i=1,(s-1?((r=r.split(\"\")).splice(-1,0,_+c[p].currency.symbol),r=r.join(\"\")):r=r+_+c[p].currency.symbol;return r}(t,e,n):e.indexOf(\"%\")>-1?function(t,e,n){var i,r=\"\";t*=100,e.indexOf(\" %\")>-1?(r=\" \",e=e.replace(\" %\",\"\")):e=e.replace(\"%\",\"\");(i=a(t,e,n)).indexOf(\")\")>-1?((i=i.split(\"\")).splice(-1,0,r+\"%\"),i=i.join(\"\")):i=i+r+\"%\";return i}(t,e,n):e.indexOf(\":\")>-1?function(t){var e=Math.floor(t/60/60),n=Math.floor((t-60*e*60)/60),i=Math.round(t-60*e*60-60*n);return e+\":\"+(n<10?\"0\"+n:n)+\":\"+(i<10?\"0\"+i:i)}(t):a(t,e,n)}function a(t,e,n,i){var r,s,a,l,u,h,_,f,m,v,g,y,b,x,w,k,S,T,M=!1,A=!1,E=!1,z=\"\",C=!1,O=!1,N=!1,j=!1,P=!1,D=\"\",F=\"\",I=Math.abs(t),B=[\"B\",\"KiB\",\"MiB\",\"GiB\",\"TiB\",\"PiB\",\"EiB\",\"ZiB\",\"YiB\"],R=[\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\"],L=\"\",V=!1,G=!1,U=\"\";if(0===t&&null!==d)return d;if(!isFinite(t))return\"\"+t;if(0===e.indexOf(\"{\")){var Y=e.indexOf(\"}\");if(-1===Y)throw Error('Format should also contain a \"}\"');y=e.slice(1,Y),e=e.slice(Y+1)}else y=\"\";if(e.indexOf(\"}\")===e.length-1){var q=e.indexOf(\"{\");if(-1===q)throw Error('Format should also contain a \"{\"');b=e.slice(q+1,-1),e=e.slice(0,q+1)}else b=\"\";var X;if(X=-1===e.indexOf(\".\")?e.match(/([0-9]+).*/):e.match(/([0-9]+)\\..*/),T=null===X?-1:X[1].length,-1!==e.indexOf(\"-\")&&(V=!0),e.indexOf(\"(\")>-1?(M=!0,e=e.slice(1,-1)):e.indexOf(\"+\")>-1&&(A=!0,e=e.replace(/\\+/g,\"\")),e.indexOf(\"a\")>-1){if(v=e.split(\".\")[0].match(/[0-9]+/g)||[\"0\"],v=parseInt(v[0],10),C=e.indexOf(\"aK\")>=0,O=e.indexOf(\"aM\")>=0,N=e.indexOf(\"aB\")>=0,j=e.indexOf(\"aT\")>=0,P=C||O||N||j,e.indexOf(\" a\")>-1?(z=\" \",e=e.replace(\" a\",\"\")):e=e.replace(\"a\",\"\"),u=Math.floor(Math.log(I)/Math.LN10)+1,_=u%3,_=0===_?3:_,v&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-v,f=3*~~((Math.min(v,u)-_)/3),I/=Math.pow(10,f),-1===e.indexOf(\".\")&&v>3))for(e+=\"[.]\",k=(k=0===h?0:3*~~(h/3)-h)<0?k+3:k,r=0;r=Math.pow(10,12)&&!P||j?(z+=c[p].abbreviations.trillion,t/=Math.pow(10,12)):I=Math.pow(10,9)&&!P||N?(z+=c[p].abbreviations.billion,t/=Math.pow(10,9)):I=Math.pow(10,6)&&!P||O?(z+=c[p].abbreviations.million,t/=Math.pow(10,6)):(I=Math.pow(10,3)&&!P||C)&&(z+=c[p].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf(\"b\")>-1)for(e.indexOf(\" b\")>-1?(D=\" \",e=e.replace(\" b\",\"\")):e=e.replace(\"b\",\"\"),l=0;l<=B.length;l++)if(s=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=s&&t0&&(t/=s);break}if(e.indexOf(\"d\")>-1)for(e.indexOf(\" d\")>-1?(D=\" \",e=e.replace(\" d\",\"\")):e=e.replace(\"d\",\"\"),l=0;l<=R.length;l++)if(s=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=s&&t0&&(t/=s);break}if(e.indexOf(\"o\")>-1&&(e.indexOf(\" o\")>-1?(F=\" \",e=e.replace(\" o\",\"\")):e=e.replace(\"o\",\"\"),c[p].ordinal&&(F+=c[p].ordinal(t))),e.indexOf(\"[.]\")>-1&&(E=!0,e=e.replace(\"[.]\",\".\")),m=t.toString().split(\".\")[0],g=e.split(\".\")[1],x=e.indexOf(\",\"),g){if(-1!==g.indexOf(\"*\")?L=o(t,t.toString().split(\".\")[1].length,n):g.indexOf(\"[\")>-1?(g=(g=g.replace(\"]\",\"\")).split(\"[\"),L=o(t,g[0].length+g[1].length,n,g[1].length)):L=o(t,g.length,n),m=L.split(\".\")[0],L.split(\".\")[1].length){var W=i?z+i:c[p].delimiters.decimal;L=W+L.split(\".\")[1]}else L=\"\";E&&0===Number(L.slice(1))&&(L=\"\")}else m=o(t,null,n);return m.indexOf(\"-\")>-1&&(m=m.slice(1),G=!0),m.length-1&&(m=m.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1\"+c[p].delimiters.thousands)),0===e.indexOf(\".\")&&(m=\"\"),w=e.indexOf(\"(\"),S=e.indexOf(\"-\"),U=w2||(o.length<2?!o[0].match(/^\\d+.*\\d$/)||o[0].match(a):1===o[0].length?!o[0].match(/^\\d+$/)||o[0].match(a)||!o[1].match(/^\\d+$/):!o[0].match(/^\\d+.*\\d$/)||o[0].match(a)||!o[1].match(/^\\d+$/)))))},e.exports={format:function(t,e,n,i){null!=n&&n!==h.culture()&&h.setCulture(n);return s(Number(t),null!=e?e:f,null==i?Math.round:i)}}},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var n=r(t);if(\"object\"==typeof n){var s=i.projections.get(n.projName);if(s){if(n.datumCode&&\"none\"!==n.datumCode){var h=l[n.datumCode];h&&(n.datum_params=h.towgs84?h.towgs84.split(\",\"):null,n.ellps=h.ellipse,n.datumName=h.datumName?h.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||\"enu\";var c=a.sphere(n.a,n.b,n.rf,n.ellps,n.sphere),_=a.eccentricity(c.a,c.b,c.rf,n.R_A),p=n.datum||u(n.datumCode,n.datum_params,c.a,c.b,_.es,_.ep2);o(this,n),o(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}var r=t(353),o=t(351),s=t(355),a=t(350),l=t(341),u=t(346);(i.projections=s).start(),e.exports=i},function(t,e,n){e.exports=function(t,e,n){var i,r,o,s=n.x,a=n.y,l=n.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(i=s,r=\"x\"):1===o?(i=a,r=\"y\"):(i=l,r=\"z\"),t.axis[o]){case\"e\":u[r]=i;break;case\"w\":u[r]=-i;break;case\"n\":u[r]=i;break;case\"s\":u[r]=-i;break;case\"u\":void 0!==n[r]&&(u.z=i);break;case\"d\":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(t,e,n){var i=2*Math.PI,r=t(338);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*i}},function(t,e,n){e.exports=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,n){e.exports=function(t){return t<0?-1:1}},function(t,e,n){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r}},function(t,e,n){n.wgs84={towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"},n.ch1903={towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"},n.ggrs87={towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"},n.nad83={towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"},n.nad27={nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"},n.potsdam={towgs84:\"606.0,23.0,413.0\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"},n.carthage={towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"},n.hermannskogel={towgs84:\"653.0,-212.0,449.0\",ellipse:\"bessel\",datumName:\"Hermannskogel\"},n.ire65={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"},n.rassadiran={towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"},n.nzgd49={towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"},n.osgb36={towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Airy 1830\"},n.s_jtsk={towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"},n.beduaram={towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"},n.gunung_segara={towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"},n.rnb72={towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"}},function(t,e,n){n.MERIT={a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"},n.SGS85={a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"},n.IAU76={a:6378140,rf:298.257,ellipseName:\"IAU 1976\"},n.airy={a:6377563.396,b:6356256.91,ellipseName:\"Airy 1830\"},n.APL4={a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"},n.NWL9D={a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:\"Modified Airy\"},n.andrae={a:6377104.43,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"},n.aust_SA={a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:\"Bessel 1841\"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:\"Clarke 1866\"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:\"Clarke 1858\"},n.CPM={a:6375738.7,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"},n.delmbr={a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:\"Engelis 1985\"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:\"Everest 1830\"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:\"Everest 1948\"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:\"Everest 1956\"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:\"Everest 1969\"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"},n.fschr60={a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"},n.fschr60m={a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"},n.fschr68={a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"},n.helmert={a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"},n.hough={a:6378270,rf:297,ellipseName:\"Hough\"},n.intl={a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"},n.kaula={a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"},n.lerch={a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"},n.mprts={a:6397300,rf:191,ellipseName:\"Maupertius 1738\"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:\"New International 1967\"},n.plessis={a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"},n.krass={a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:\"Southeast Asia\"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:\"Walbeck\"},n.WGS60={a:6378165,rf:298.3,ellipseName:\"WGS 60\"},n.WGS66={a:6378145,rf:298.25,ellipseName:\"WGS 66\"},n.WGS7={a:6378135,rf:298.26,ellipseName:\"WGS 72\"},n.WGS84={a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"},n.sphere={a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"}},function(t,e,n){n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,n){n.ft={to_meter:.3048},n[\"us-ft\"]={to_meter:1200/3937}},function(t,e,n){function i(t,e,n){var i;return Array.isArray(n)?(i=s(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):s(t,e,n)}function r(t){return t instanceof o?t:t.oProj?t.oProj:o(t)}var o=t(333),s=t(358),a=o(\"WGS84\");e.exports=function(t,e,n){t=r(t);var o,s=!1;void 0===e?(e=t,t=a,s=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=a,s=!0);return e=r(e),n?i(t,e,n):(o={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},s&&(o.oProj=e),o)}},function(t,e,n){var i=1,r=2,o=4,s=5,a=484813681109536e-20;e.exports=function(t,e,n,l,u,h){var c={};c.datum_type=o,t&&\"none\"===t&&(c.datum_type=s);e&&(c.datum_params=e.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=i),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=r,c.datum_params[3]*=a,c.datum_params[4]*=a,c.datum_params[5]*=a,c.datum_params[6]=c.datum_params[6]/1e6+1)));return c.a=n,c.b=l,c.es=u,c.ep2=h,c}},function(t,e,n){var i=Math.PI/2;n.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(1===t.datum_type?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},n.geodeticToGeocentric=function(t,e,n){var r,o,s,a,l=t.x,u=t.y,h=t.z?t.z:0;if(u<-i&&u>-1.001*i)u=-i;else if(u>i&&u<1.001*i)u=i;else if(u<-i||u>i)return null;return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(u),a=Math.cos(u),s=o*o,r=n/Math.sqrt(1-e*s),{x:(r+h)*a*Math.cos(l),y:(r+h)*a*Math.sin(l),z:(r*(1-e)+h)*o}},n.geocentricToGeodetic=function(t,e,n,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t.x,w=t.y,k=t.z?t.z:0;if(o=Math.sqrt(x*x+w*w),s=Math.sqrt(x*x+w*w+k*k),o/n<1e-12){if(g=0,s/n<1e-12)return y=i,b=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(w,x);a=k/s,l=o/s,u=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*u,p=a*u,v=0;do{v++,c=n/Math.sqrt(1-e*p*p),h=e*c/(c+(b=o*_+k*p-c*(1-e*p*p))),u=1/Math.sqrt(1-h*(2-h)*l*l),m=(f=a*u)*_-(d=l*(1-h)*u)*p,_=d,p=f}while(m*m>1e-24&&v<30);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},n.geocentricToWgs84=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6];return{x:u*(t.x-l*t.y+a*t.z)+i,y:u*(l*t.x+t.y-s*t.z)+r,z:u*(-a*t.x+s*t.y+t.z)+o}}},n.geocentricFromWgs84=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],l=n[5],u=n[6],h=(t.x-i)/u,c=(t.y-r)/u,_=(t.z-o)/u;return{x:h+l*c-a*_,y:-l*h+c+s*_,z:a*h-s*c+_}}}},function(t,e,n){function i(t){return t===r||t===o}var r=1,o=2,s=t(347);e.exports=function(t,e,n){return s.compareDatums(t,e)?n:5===t.datum_type||5===e.datum_type?n:t.es!==e.es||t.a!==e.a||i(t.datum_type)||i(e.datum_type)?(n=s.geodeticToGeocentric(n,t.es,t.a),i(t.datum_type)&&(n=s.geocentricToWgs84(n,t.datum_type,t.datum_params)),i(e.datum_type)&&(n=s.geocentricFromWgs84(n,e.datum_type,e.datum_params)),s.geocentricToGeodetic(n,e.es,e.a,e.b)):n}},function(t,e,n){function i(t){var e=this;if(2===arguments.length){var n=arguments[1];i[t]=\"string\"==typeof n?\"+\"===n.charAt(0)?o(arguments[1]):s(arguments[1]):n}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?i.apply(e,t):i(t)});if(\"string\"==typeof t){if(t in i)return i[t]}else\"EPSG\"in t?i[\"EPSG:\"+t.EPSG]=t:\"ESRI\"in t?i[\"ESRI:\"+t.ESRI]=t:\"IAU2000\"in t?i[\"IAU2000:\"+t.IAU2000]=t:console.log(t);return}}var r=t(352),o=t(354),s=t(359);r(i),e.exports=i},function(t,e,n){var i=t(342);n.eccentricity=function(t,e,n,i){var r=t*t,o=e*e,s=(r-o)/r,a=0;i?(r=(t*=1-s*(.16666666666666666+s*(.04722222222222222+.022156084656084655*s)))*t,s=0):a=Math.sqrt(s);var l=(r-o)/o;return{es:s,e:a,ep2:l}},n.sphere=function(t,e,n,r,o){if(!t){var s=i[r];s||(s=i.WGS84),t=s.a,e=s.b,n=s.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<1e-10)&&(o=!0,e=t),{a:t,b:e,rf:n,sphere:o}}},function(t,e,n){e.exports=function(t,e){t=t||{};var n,i;if(!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t}},function(t,e,n){e.exports=function(t){t(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),t(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),t(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\"),t.WGS84=t[\"EPSG:4326\"],t[\"EPSG:3785\"]=t[\"EPSG:3857\"],t.GOOGLE=t[\"EPSG:3857\"],t[\"EPSG:900913\"]=t[\"EPSG:3857\"],t[\"EPSG:102113\"]=t[\"EPSG:3857\"]}},function(t,e,n){var i=t(349),r=t(359),o=t(354),s=[\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\"];e.exports=function(t){if(!function(t){return\"string\"==typeof t}(t))return t;if(function(t){return t in i}(t))return i[t];if(function(t){return s.some(function(e){return t.indexOf(e)>-1})}(t))return r(t);if(function(t){return\"+\"===t[0]}(t))return o(t)}},function(t,e,n){var i=.017453292519943295,r=t(343),o=t(344);e.exports=function(t){var e,n,s,a={},l=t.split(\"+\").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split(\"=\");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),u={proj:\"projName\",datum:\"datumCode\",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*i},lat_1:function(t){a.lat1=t*i},lat_2:function(t){a.lat2=t*i},lat_ts:function(t){a.lat_ts=t*i},lon_0:function(t){a.long0=t*i},lon_1:function(t){a.long1=t*i},lon_2:function(t){a.long2=t*i},alpha:function(t){a.alpha=parseFloat(t)*i},lonc:function(t){a.longc=t*i},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(\",\").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*i},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*i},nadgrids:function(t){\"@null\"===t?a.datumCode=\"none\":a.nadgrids=t},axis:function(t){3===t.length&&-1!==\"ewnsud\".indexOf(t.substr(0,1))&&-1!==\"ewnsud\".indexOf(t.substr(1,1))&&-1!==\"ewnsud\".indexOf(t.substr(2,1))&&(a.axis=t)}};for(e in l)n=l[e],e in u?\"function\"==typeof(s=u[e])?s(n):a[s]=n:a[e]=n;return\"string\"==typeof a.datumCode&&\"WGS84\"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,n){function i(t,e){var n=s.length;return t.names?(s[n]=t,t.names.forEach(function(t){o[t.toLowerCase()]=n}),this):(console.log(e),!0)}var r=[t(357),t(356)],o={},s=[];n.add=i,n.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==o[e]&&s[o[e]]?s[o[e]]:void 0},n.start=function(){r.forEach(i)}},function(t,e,n){function i(t){return t}n.init=function(){},n.forward=i,n.inverse=i,n.names=[\"longlat\",\"identity\"]},function(t,e,n){var i=t(336),r=Math.PI/2,o=57.29577951308232,s=t(335),a=Math.PI/4,l=t(340),u=t(337);n.init=function(){var t=this.b/this.a;this.es=1-t*t,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},n.forward=function(t){var e=t.x,n=t.y;if(n*o>90&&n*o<-90&&e*o>180&&e*o<-180)return null;var i,u;if(Math.abs(Math.abs(n)-r)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*n));else{var h=Math.sin(n),c=l(this.e,n,h);i=this.x0+this.a*this.k0*s(e-this.long0),u=this.y0-this.a*this.k0*Math.log(c)}return t.x=i,t.y=u,t},n.inverse=function(t){var e,n,i=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(n=u(this.e,a)))return null}return e=s(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},n.names=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"merc\"]},function(t,e,n){var i=1,r=2,o=t(348),s=t(334),a=t(333),l=t(339);e.exports=function t(e,n,u){var h;return Array.isArray(u)&&(u=l(u)),e.datum&&n.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===r)&&\"WGS84\"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===r)&&\"WGS84\"!==t.datumCode}(e,n)&&(h=new a(\"WGS84\"),u=t(e,h,u),e=h),\"enu\"!==e.axis&&(u=s(e,!1,u)),\"longlat\"===e.projName?u={x:.017453292519943295*u.x,y:.017453292519943295*u.y}:(e.to_meter&&(u={x:u.x*e.to_meter,y:u.y*e.to_meter}),u=e.inverse(u)),e.from_greenwich&&(u.x+=e.from_greenwich),u=o(e.datum,n.datum,u),n.from_greenwich&&(u={x:u.x-n.grom_greenwich,y:u.y}),\"longlat\"===n.projName?u={x:57.29577951308232*u.x,y:57.29577951308232*u.y}:(u=n.forward(u),n.to_meter&&(u={x:u.x/n.to_meter,y:u.y/n.to_meter})),\"enu\"!==n.axis?s(n,!0,u):u}},function(t,e,n){function i(t,e,n){t[e]=n.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return a(t,e)},{})}function r(t,e){var n;Array.isArray(t)?(\"PARAMETER\"===(n=t.shift())&&(n=t.shift()),1===t.length?Array.isArray(t[0])?(e[n]={},r(t[0],e[n])):e[n]=t[0]:t.length?\"TOWGS84\"===n?e[n]=t:(e[n]={},[\"UNIT\",\"PRIMEM\",\"VERT_DATUM\"].indexOf(n)>-1?(e[n]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[n].auth=t[2])):\"SPHEROID\"===n?(e[n]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[n].auth=t[3])):[\"GEOGCS\",\"GEOCCS\",\"DATUM\",\"VERT_CS\",\"COMPD_CS\",\"LOCAL_CS\",\"FITTED_CS\",\"LOCAL_DATUM\"].indexOf(n)>-1?(t[0]=[\"name\",t[0]],i(e,n,t)):t.every(function(t){return Array.isArray(t)})?i(e,n,t):r(t,e[n])):e[n]=!0):e[t]=!0}function o(t){return t*s}var s=.017453292519943295,a=t(351);e.exports=function(t,e){var n=JSON.parse((\",\"+t).replace(/\\s*\\,\\s*([A-Z_0-9]+?)(\\[)/g,',[\"$1\",').slice(1).replace(/\\s*\\,\\s*([A-Z_0-9]+?)\\]/g,',\"$1\"]').replace(/,\\[\"VERTCS\".+/,\"\")),i=n.shift(),s=n.shift();n.unshift([\"name\",s]),n.unshift([\"type\",i]),n.unshift(\"output\");var l={};return r(n,l),function(t){function e(e){var n=t.to_meter||1;return parseFloat(e,10)*n}\"GEOGCS\"===t.type?t.projName=\"longlat\":\"LOCAL_CS\"===t.type?(t.projName=\"identity\",t.local=!0):\"object\"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION;t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),\"metre\"===t.units&&(t.units=\"meter\"),t.UNIT.convert&&(\"GEOGCS\"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10)));t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),\"d_\"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),\"new_zealand_geodetic_datum_1949\"!==t.datumCode&&\"new_zealand_1949\"!==t.datumCode||(t.datumCode=\"nzgd49\"),\"wgs_1984\"===t.datumCode&&(\"Mercator_Auxiliary_Sphere\"===t.PROJECTION&&(t.sphere=!0),t.datumCode=\"wgs84\"),\"_ferro\"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),\"_jakarta\"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf(\"belge\")&&(t.datumCode=\"rnb72\"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),\"international\"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps=\"intl\"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf(\"osgb_1936\")&&(t.datumCode=\"osgb36\"));t.b&&!isFinite(t.b)&&(t.b=t.a);[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"false_easting\",\"False_Easting\"],[\"false_northing\",\"False_Northing\"],[\"central_meridian\",\"Central_Meridian\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",o],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longc\",\"longitude_of_center\",o],[\"x0\",\"false_easting\",e],[\"y0\",\"false_northing\",e],[\"long0\",\"central_meridian\",o],[\"lat0\",\"latitude_of_origin\",o],[\"lat0\",\"standard_parallel_1\",o],[\"lat1\",\"standard_parallel_1\",o],[\"lat2\",\"standard_parallel_2\",o],[\"alpha\",\"azimuth\",o],[\"srsCode\",\"name\"]].forEach(function(e){return function(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}(t,e)}),t.long0||!t.longc||\"Albers_Conic_Equal_Area\"!==t.projName&&\"Lambert_Azimuthal_Equal_Area\"!==t.projName||(t.long0=t.longc);t.lat_ts||!t.lat1||\"Stereographic_South_Pole\"!==t.projName&&\"Polar Stereographic (variant B)\"!==t.projName||(t.lat0=o(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(l.output),a(e,l.output)}},function(t,e,n){function i(t,e,n,o,s){for(n=n||0,o=o||t.length-1,s=s||function(t,e){return te?1:0};o>n;){if(o-n>600){var a=o-n+1,l=e-n+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1),_=Math.max(n,Math.floor(e-l*h/a+c)),p=Math.min(o,Math.floor(e+(a-l)*h/a+c));i(t,e,_,p,s)}var d=t[e],f=n,m=o;for(r(t,n,e),s(t[o],d)>0&&r(t,n,o);f0;)m--}0===s(t[n],d)?r(t,n,m):r(t,++m,o),m<=e&&(n=m+1),e<=m&&(o=m-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}e.exports=i},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(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,n,i,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=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,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,f(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var f=t(360);i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!_(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);var s=this._chooseSplitIndex(n,o,i),a=p(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,r(n,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,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,n){var i,r,s,a,l,h,c,_;for(h=c=1/0,i=e;i<=n-e;i++)r=o(t,0,i,this.toBBox),s=o(t,i,n,this.toBBox),a=function(t,e){var n=Math.max(t.minX,e.minX),i=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-n)*Math.max(0,o-i)}(r,s),l=u(r)+u(s),a=e;r--)a=t.children[r],s(c,t.leaf?l(a):a),_+=h(c);return _},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)s(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():r(t[n],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,n){!function(){\"use strict\";function t(e){return function(e,n){var r,o,s,a,l,u,h,c,_,p=1,d=e.length,f=\"\";for(o=0;o=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()}i.json.test(a[8])?f+=r:(!i.number.test(a[8])||c&&!a[3]?_=\"\":(_=c?\"+\":\"-\",r=r.toString().replace(i.sign,\"\")),u=a[4]?\"0\"===a[4]?\"0\":a[4].charAt(1):\" \",h=a[6]-(_+r).length,l=a[6]&&h>0?u.repeat(h):\"\",f+=a[5]?_+r+l:\"0\"===u?_+l+r:l+_+r)}return f}(function(t){if(r[t])return r[t];var e,n=t,o=[],s=0;for(;n;){if(null!==(e=i.text.exec(n)))o.push(e[0]);else if(null!==(e=i.modulo.exec(n)))o.push(\"%\");else{if(null===(e=i.placeholder.exec(n)))throw new SyntaxError(\"[sprintf] unexpected placeholder\");if(e[2]){s|=1;var a=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");for(a.push(u[1]);\"\"!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))a.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");a.push(u[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)}n=n.substring(e[0].length)}return r[t]=o}(e),arguments)}function e(e,n){return t.apply(null,[e].concat(n||[]))}var i={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!==n&&(n.sprintf=t,n.vsprintf=e),\"undefined\"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},function(t,e,n){!function(t){\"object\"==typeof e&&e.exports?e.exports=t():this.tz=t()}(function(){function t(t,e,n){var i,r=e.day[1];do{i=new Date(Date.UTC(n,e.month,Math.abs(r++)))}while(e.day[0]<7&&i.getUTCDay()!=e.day[0]);return i={clock:e.clock,sort:i.getTime(),rule:e,save:6e4*e.save,offset:t.offset},i[i.clock]=i.sort+6e4*e.time,i.posix?i.wallclock=i[i.clock]+(t.offset+e.saved):i.posix=i[i.clock]-(t.offset+e.saved),i}function e(e,n,i){var r,o,s,a,l,u,h,c=e[e.zone],_=[],p=new Date(i).getUTCFullYear(),d=1;for(r=1,o=c.length;r=p-d;--h)for(r=0,o=u.length;r=_[r][n]&&_[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 n(t,n){return\"UTC\"==t.zone?n:(t.entry=e(t,\"posix\",n),n+t.entry.offset+t.entry.save)}function i(t,n){if(\"UTC\"==t.zone)return n;var i,r;return t.entry=i=e(t,\"wallclock\",n),0<(r=n-i.wallclock)&&r9)e+=a*h[u-10];else{if(o=new Date(n(t,e)),u<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==u&&(a-=s);else 7==u?o.setUTCFullYear(o.getUTCFullYear()+a):8==u?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=i(t,o.getTime()))&&(e=i(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t,e){var n,i,r;return i=new Date(Date.UTC(t.getUTCFullYear(),0)),n=Math.floor((t.getTime()-i.getTime())/864e5),i.getUTCDay()==e?r=0:8==(r=7-i.getUTCDay()+e)&&(r=1),n>=r?Math.floor((n-r)/7)+1:0}function s(t){var e,n,i;return n=t.getUTCFullYear(),e=new Date(Date.UTC(n,0)).getUTCDay(),(i=o(t,1)+(e>1&&e<=4?1:0))?53!=i||4==e||3==e&&29==new Date(n,1,29).getDate()?[i,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(n=t.getUTCFullYear()-1,e=new Date(Date.UTC(n,0)).getUTCDay(),i=4==e||3==e&&29==new Date(n,1,29).getDate()?53:52,[i,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,n,i){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(r=0;r<3;r++)l.push((\"0\"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return\"^\"!=n||s?(\"^\"==n&&(i=3),3==i?(o=(o=l.join(\":\")).replace(/:00$/,\"\"),\"^\"!=n&&(o=o.replace(/:00$/,\"\"))):i?(o=l.slice(0,i+1).join(\":\"),\"^\"==n&&(o=o.replace(/:00$/,\"\"))):o=l.slice(0,2).join(\"\"),o=(s<0?\"-\":\"+\")+o,o=o.replace(/([-+])(0)/,{_:\" $1\",\"-\":\"$1\"}[n]||\"$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,h=Object.create(this),c=[];for(e=0;e=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},a=function(t,e){return function(n,i){e(n,i,t)}},l=function(t,e){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(s,a)}l((i=i.apply(t,e||[])).next())})},h=function(t,e){function n(n){return function(s){return function(n){if(i)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(i=1,r&&(o=r[2&n[0]?\"return\":n[0]?\"throw\":\"next\"])&&!(o=o.call(r,n[1])).done)return o;switch(r=0,o&&(n=[0,o.value]),n[0]){case 0:case 1:o=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}},p=function(t,e){var n=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},d=function(){for(var t=[],e=0;e1||r(t,e)})})}function r(t,e){try{!function(t){t.value instanceof f?Promise.resolve(t.value.v).then(o,s):a(h[0][2],t)}(u[t](e))}catch(t){a(h[0][3],t)}}function o(t){r(\"next\",t)}function s(t){r(\"throw\",t)}function a(t,e){t(e),h.shift(),h.length&&r(h[0][0],h[0][1])}if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var l,u=n.apply(t,e||[]),h=[];return l={},i(\"next\"),i(\"throw\"),i(\"return\"),l[Symbol.asyncIterator]=function(){return this},l},v=function(t){function e(e,r){t[e]&&(n[e]=function(n){return(i=!i)?{value:f(t[e](n)),done:\"return\"===e}:r?r(n):n})}var n,i;return n={},e(\"next\"),e(\"throw\",function(t){throw t}),e(\"return\"),n[Symbol.iterator]=function(){return this},n},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\",i),t(\"__assign\",r),t(\"__rest\",o),t(\"__decorate\",s),t(\"__param\",a),t(\"__metadata\",l),t(\"__awaiter\",u),t(\"__generator\",h),t(\"__exportStar\",c),t(\"__values\",_),t(\"__read\",p),t(\"__spread\",d),t(\"__await\",f),t(\"__asyncGenerator\",m),t(\"__asyncDelegator\",v),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/selector\":18,\"core/settings\":19,\"core/signaling\":20,\"core/ui_events\":21,\"core/util/array\":22,\"core/util/bbox\":23,\"core/util/callback\":24,\"core/util/canvas\":25,\"core/util/color\":26,\"core/util/data_structures\":27,\"core/util/eq\":28,\"core/util/math\":29,\"core/util/object\":30,\"core/util/proj4\":31,\"core/util/projections\":32,\"core/util/refs\":33,\"core/util/selection\":34,\"core/util/serialization\":35,\"core/util/spatial\":36,\"core/util/string\":37,\"core/util/svg_colors\":38,\"core/util/templating\":39,\"core/util/text\":40,\"core/util/throttle\":41,\"core/util/types\":42,\"core/util/wheel\":43,\"core/util/zoom\":44,\"core/view\":45,\"core/visuals\":46,document:47,embed:48,main:49,model:50,\"models/annotations/annotation\":51,\"models/annotations/arrow\":52,\"models/annotations/arrow_head\":53,\"models/annotations/band\":54,\"models/annotations/box_annotation\":55,\"models/annotations/color_bar\":56,\"models/annotations/index\":57,\"models/annotations/label\":58,\"models/annotations/label_set\":59,\"models/annotations/legend\":60,\"models/annotations/legend_item\":61,\"models/annotations/poly_annotation\":62,\"models/annotations/span\":63,\"models/annotations/text_annotation\":64,\"models/annotations/title\":65,\"models/annotations/toolbar_panel\":66,\"models/annotations/tooltip\":67,\"models/annotations/whisker\":68,\"models/axes/axis\":69,\"models/axes/categorical_axis\":70,\"models/axes/continuous_axis\":71,\"models/axes/datetime_axis\":72,\"models/axes/index\":73,\"models/axes/linear_axis\":74,\"models/axes/log_axis\":75,\"models/callbacks/customjs\":76,\"models/callbacks/index\":77,\"models/callbacks/open_url\":78,\"models/canvas/canvas\":79,\"models/canvas/cartesian_frame\":80,\"models/canvas/index\":81,\"models/expressions/expression\":82,\"models/expressions/index\":83,\"models/expressions/stack\":84,\"models/filters/boolean_filter\":85,\"models/filters/customjs_filter\":86,\"models/filters/filter\":87,\"models/filters/group_filter\":88,\"models/filters/index\":89,\"models/filters/index_filter\":90,\"models/formatters/basic_tick_formatter\":91,\"models/formatters/categorical_tick_formatter\":92,\"models/formatters/datetime_tick_formatter\":93,\"models/formatters/func_tick_formatter\":94,\"models/formatters/index\":95,\"models/formatters/log_tick_formatter\":96,\"models/formatters/mercator_tick_formatter\":97,\"models/formatters/numeral_tick_formatter\":98,\"models/formatters/printf_tick_formatter\":99,\"models/formatters/tick_formatter\":100,\"models/glyphs/annular_wedge\":101,\"models/glyphs/annulus\":102,\"models/glyphs/arc\":103,\"models/glyphs/bezier\":104,\"models/glyphs/box\":105,\"models/glyphs/circle\":106,\"models/glyphs/ellipse\":107,\"models/glyphs/glyph\":108,\"models/glyphs/hbar\":109,\"models/glyphs/image\":110,\"models/glyphs/image_rgba\":111,\"models/glyphs/image_url\":112,\"models/glyphs/index\":113,\"models/glyphs/line\":114,\"models/glyphs/multi_line\":115,\"models/glyphs/oval\":116,\"models/glyphs/patch\":117,\"models/glyphs/patches\":118,\"models/glyphs/quad\":119,\"models/glyphs/quadratic\":120,\"models/glyphs/ray\":121,\"models/glyphs/rect\":122,\"models/glyphs/segment\":123,\"models/glyphs/step\":124,\"models/glyphs/text\":125,\"models/glyphs/vbar\":126,\"models/glyphs/wedge\":127,\"models/glyphs/xy_glyph\":128,\"models/graphs/graph_hit_test_policy\":129,\"models/graphs/index\":130,\"models/graphs/layout_provider\":131,\"models/graphs/static_layout_provider\":132,\"models/grids/grid\":133,\"models/grids/index\":134,\"models/index\":135,\"models/layouts/box\":136,\"models/layouts/column\":137,\"models/layouts/index\":138,\"models/layouts/layout_dom\":139,\"models/layouts/row\":140,\"models/layouts/spacer\":141,\"models/layouts/widget_box\":142,\"models/mappers/categorical_color_mapper\":143,\"models/mappers/color_mapper\":144,\"models/mappers/index\":145,\"models/mappers/linear_color_mapper\":146,\"models/mappers/log_color_mapper\":147,\"models/markers/index\":148,\"models/markers/marker\":149,\"models/plots/gmap_plot\":150,\"models/plots/gmap_plot_canvas\":151,\"models/plots/index\":152,\"models/plots/plot\":153,\"models/plots/plot_canvas\":154,\"models/ranges/data_range\":155,\"models/ranges/data_range1d\":156,\"models/ranges/factor_range\":157,\"models/ranges/index\":158,\"models/ranges/range\":159,\"models/ranges/range1d\":160,\"models/renderers/glyph_renderer\":161,\"models/renderers/graph_renderer\":162,\"models/renderers/guide_renderer\":163,\"models/renderers/index\":164,\"models/renderers/renderer\":165,\"models/scales/categorical_scale\":166,\"models/scales/index\":167,\"models/scales/linear_scale\":168,\"models/scales/log_scale\":169,\"models/scales/scale\":170,\"models/sources/ajax_data_source\":171,\"models/sources/cds_view\":172,\"models/sources/column_data_source\":173,\"models/sources/columnar_data_source\":174,\"models/sources/data_source\":175,\"models/sources/geojson_data_source\":176,\"models/sources/index\":177,\"models/sources/remote_data_source\":178,\"models/tickers/adaptive_ticker\":179,\"models/tickers/basic_ticker\":180,\"models/tickers/categorical_ticker\":181,\"models/tickers/composite_ticker\":182,\"models/tickers/continuous_ticker\":183,\"models/tickers/datetime_ticker\":184,\"models/tickers/days_ticker\":185,\"models/tickers/fixed_ticker\":186,\"models/tickers/index\":187,\"models/tickers/log_ticker\":188,\"models/tickers/mercator_ticker\":189,\"models/tickers/months_ticker\":190,\"models/tickers/single_interval_ticker\":191,\"models/tickers/ticker\":192,\"models/tickers/util\":193,\"models/tickers/years_ticker\":194,\"models/tiles/bbox_tile_source\":195,\"models/tiles/dynamic_image_renderer\":196,\"models/tiles/image_pool\":197,\"models/tiles/image_source\":198,\"models/tiles/index\":199,\"models/tiles/mercator_tile_source\":200,\"models/tiles/quadkey_tile_source\":201,\"models/tiles/tile_renderer\":202,\"models/tiles/tile_source\":203,\"models/tiles/tile_utils\":204,\"models/tiles/tms_tile_source\":205,\"models/tiles/wmts_tile_source\":206,\"models/tools/actions/action_tool\":207,\"models/tools/actions/help_tool\":208,\"models/tools/actions/redo_tool\":209,\"models/tools/actions/reset_tool\":210,\"models/tools/actions/save_tool\":211,\"models/tools/actions/undo_tool\":212,\"models/tools/actions/zoom_in_tool\":213,\"models/tools/actions/zoom_out_tool\":214,\"models/tools/button_tool\":215,\"models/tools/gestures/box_select_tool\":216,\"models/tools/gestures/box_zoom_tool\":217,\"models/tools/gestures/gesture_tool\":218,\"models/tools/gestures/lasso_select_tool\":219,\"models/tools/gestures/pan_tool\":220,\"models/tools/gestures/poly_select_tool\":221,\"models/tools/gestures/select_tool\":222,\"models/tools/gestures/tap_tool\":223,\"models/tools/gestures/wheel_pan_tool\":224,\"models/tools/gestures/wheel_zoom_tool\":225,\"models/tools/index\":226,\"models/tools/inspectors/crosshair_tool\":227,\"models/tools/inspectors/hover_tool\":228,\"models/tools/inspectors/inspect_tool\":229,\"models/tools/on_off_button\":230,\"models/tools/tool\":231,\"models/tools/tool_proxy\":232,\"models/tools/toolbar\":233,\"models/tools/toolbar_base\":234,\"models/tools/toolbar_box\":235,\"models/transforms/customjs_transform\":236,\"models/transforms/dodge\":237,\"models/transforms/index\":238,\"models/transforms/interpolator\":239,\"models/transforms/jitter\":240,\"models/transforms/linear_interpolator\":241,\"models/transforms/step_interpolator\":242,\"models/transforms/transform\":243,polyfill:244,\"protocol/message\":245,\"protocol/receiver\":246,safely:247,version:248})}(this);/*!\n", " Copyright (c) 2012, Anaconda, Inc.\n", " All rights reserved.\n", "\n", " Redistribution and use in source and binary forms, with or without modification,\n", " are permitted provided that the following conditions are met:\n", "\n", " Redistributions of source code must retain the above copyright notice,\n", " this list of conditions and the following disclaimer.\n", "\n", " Redistributions in binary form must reproduce the above copyright notice,\n", " this list of conditions and the following disclaimer in the documentation\n", " and/or other materials provided with the distribution.\n", "\n", " Neither the name of Anaconda nor the names of any contributors\n", " may be used to endorse or promote products derived from this software\n", " without specific prior written permission.\n", "\n", " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n", " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n", " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n", " ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n", " LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n", " CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n", " SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n", " INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n", " CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n", " ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n", " THE POSSIBILITY OF SUCH DAMAGE.\n", " */\n", "\n", " //# sourceMappingURL=bokeh.min.js.map\n", "\n", " /* END bokeh.min.js */\n", " },\n", " \n", " function(Bokeh) {\n", " /* BEGIN bokeh-widgets.min.js */\n", " !function(t,e){!function(t){(function(e,n,i){if(null!=t)return t.register_plugin(e,n,387);throw new Error(\"Cannot find Bokeh. You have to load it prior to loading plugins.\")})({372:function(t,e,n){var i=t(364),r=t(15),o=t(5),s=t(4),a=t(412);n.AbstractButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.icon_views={},this.render()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.render()})},e.prototype.remove=function(){return s.remove_views(this.icon_views),t.prototype.remove.call(this)},e.prototype._render_button=function(){for(var t=[],e=0;ee;u=0<=e?++t:--t)n.push(i);return n}()):g=!1,this.el.classList.add(\"bk-slider\"),null==this.sliderEl?(this.sliderEl=s.div(),this.el.appendChild(this.sliderEl),r.create(this.sliderEl,{cssPrefix:d,range:{min:h,max:n},start:y,step:f,behaviour:this.model.behaviour,connect:this.model.connected,tooltips:g,orientation:this.model.orientation,direction:this.model.direction}),this.sliderEl.noUiSlider.on(\"slide\",function(t,e,n){return b._slide(n)}),this.sliderEl.noUiSlider.on(\"change\",function(t,e,n){return b._change(n)}),c=function(t){var e;switch(y=Number(b.sliderEl.noUiSlider.get()),t.which){case 37:y-=f;break;case 39:y+=f;break;default:return}return e=b.model.pretty(y),a.logger.debug(\"[slider keypress] value = \"+e),b.model.value=y,b.sliderEl.noUiSlider.set(y),null!=b.valueEl&&(b.valueEl.textContent=e),\"function\"==typeof b.callback_wrapper?b.callback_wrapper():void 0},(o=this.sliderEl.querySelector(\".bk-noUi-handle\")).setAttribute(\"tabindex\",0),o.addEventListener(\"click\",this.focus),o.addEventListener(\"keydown\",c),m=function(t,e){var n;return o=b.sliderEl.querySelectorAll(\".bk-noUi-handle\")[t],n=o.querySelector(\".bk-noUi-tooltip\"),n.style.display=e?\"block\":\"\"},this.sliderEl.noUiSlider.on(\"start\",function(t,e){return m(e,!0)}),this.sliderEl.noUiSlider.on(\"end\",function(t,e){return m(e,!1)})):this.sliderEl.noUiSlider.updateOptions({range:{min:h,max:n},start:y,step:f}),null!=this.titleEl&&this.el.removeChild(this.titleEl),null!=this.valueEl&&this.el.removeChild(this.valueEl),null!=this.model.title&&(0!==this.model.title.length&&(this.titleEl=s.label({},this.model.title+\":\"),this.el.insertBefore(this.titleEl,this.sliderEl)),this.model.show_value&&(p=function(){var t,e,n;for(n=[],t=0,e=y.length;t=0})).addEventListener(\"change\",function(){return p.change_input()}),l=o.label({class:[\"bk-bs-btn\",\"bk-bs-btn-\"+this.model.button_type]},s,d),r.call(e,i)>=0&&l.classList.add(\"bk-bs-active\"),n.appendChild(l);return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll(\"input\"),o=[],n=t=0,i=r.length;t=0&&(s.checked=!0),l=o.label({},s,d),this.model.inline?(l.classList.add(\"bk-bs-checkbox-inline\"),this.el.appendChild(l)):(n=o.div({class:\"bk-bs-checkbox\"},l),this.el.appendChild(n));return this},e.prototype.change_input=function(){var t,e,n,i;return t=function(){var t,i,r,o;for(r=this.el.querySelectorAll(\"input\"),o=[],n=t=0,i=r.length;ta||this._o.position.indexOf(\"right\")>-1&&i-l+e.offsetWidth>0)&&(i=i-l+e.offsetWidth),(this._o.reposition&&o+n>s+r||this._o.position.indexOf(\"top\")>-1&&o-n-e.offsetHeight>0)&&(o=o-n-e.offsetHeight),this.el.style.left=i+\"px\",this.el.style.top=o+\"px\"};var l=function(t){function e(){var e=t.apply(this,arguments)||this;return e._on_select=e._on_select.bind(e),e}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),null!=this._picker&&this._picker.destroy(),o.empty(this.el),this.labelEl=o.label({},this.model.title),this.el.appendChild(this.labelEl),this.inputEl=o.input({type:\"text\",class:\"bk-widget-form-input\",disabled:this.model.disabled}),this.el.appendChild(this.inputEl),this._picker=new a({field:this.inputEl,defaultDate:new Date(this.model.value),setDefaultDate:!0,minDate:null!=this.model.min_date?new Date(this.model.min_date):null,maxDate:null!=this.model.max_date?new Date(this.model.max_date):null,onSelect:this._on_select}),this._root_element.appendChild(this._picker.el),this},e.prototype._on_select=function(t){return function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")}(this,e),this.model.value=t.toDateString(),this.change_input()},e}(r.InputWidgetView);n.DatePickerView=l,l.prototype.className=\"bk-widget-form-group\";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InputWidget);n.DatePicker=u,u.prototype.type=\"DatePicker\",u.prototype.default_view=l,u.define({value:[s.Any,Date.now()],min_date:[s.Any],max_date:[s.Any]})},381:function(t,e,n){var i=t(364),r=t(363),o=t(374);n.DateRangeSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:this.model.value,step:this.model.step}},e.prototype._calc_from=function(t){return t},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.DateRangeSlider=s,s.prototype.type=\"DateRangeSlider\",s.prototype.default_view=n.DateRangeSliderView,s.prototype.behaviour=\"drag\",s.prototype.connected=[!1,!0,!1],s.prototype._formatter=r,s.override({format:\"%d %b %Y\"})},382:function(t,e,n){var i=t(364),r=t(363),o=t(374);n.DateSliderView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._calc_to=function(){return{start:this.model.start,end:this.model.end,value:[this.model.value],step:this.model.step}},e.prototype._calc_from=function(t){var e=t[0];return e},e}(o.AbstractSliderView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.AbstractSlider);n.DateSlider=s,s.prototype.type=\"DateSlider\",s.prototype.default_view=n.DateSliderView,s.prototype.behaviour=\"tap\",s.prototype.connected=[!0,!1],s.prototype._formatter=r,s.override({format:\"%d %b %Y\"})},383:function(t,e,n){var i=t(364),r=t(388),o=t(5),s=t(15);n.DivView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var e;return t.prototype.render.call(this),e=o.div(),this.model.render_as_text?e.textContent=this.model.text:e.innerHTML=this.model.text,this.markupEl.appendChild(e),this},e}(r.MarkupView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Markup);n.Div=a,a.prototype.type=\"Div\",a.prototype.default_view=n.DivView,a.define({render_as_text:[s.Bool,!1]})},384:function(t,e,n){var i=t(364),r=t(5),o=t(15),s=t(372),a=t(379);n.DropdownView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),a.clear_menus.connect(function(){return e._clear_menu()})},e.prototype.render=function(){var e,n,i,o,s,a,l,u,c,d,p,h=this;for(t.prototype.render.call(this),this.model.is_split_button?(this.el.classList.add(\"bk-bs-btn-group\"),(e=this._render_button(r.span({class:\"bk-bs-caret\"}))).classList.add(\"bk-bs-dropdown-toggle\"),e.addEventListener(\"click\",function(t){return h._caret_click(t)}),this.el.appendChild(e)):(this.el.classList.add(\"bk-bs-dropdown\"),this.buttonEl.classList.add(\"bk-bs-dropdown-toggle\"),this.buttonEl.appendChild(r.span({class:\"bk-bs-caret\"}))),this.model.active&&this.el.classList.add(\"bk-bs-open\"),s=[],d=this.model.menu,n=0,l=d.length;n=0,o.option({selected:n,value:a},e)}),this.selectEl=o.select({multiple:!0,class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,size:this.model.size,disabled:this.model.disabled},n),this.selectEl.addEventListener(\"change\",function(){return i.change_input()}),this.el.appendChild(this.selectEl),this},e.prototype.render_selection=function(){var t,n,i,r,o,s,a,l,u;for(function(t,e){if(!(t instanceof e))throw new Error(\"Bound instance method accessed before binding\")}(this,e),l={},s=this.model.value,n=0,r=s.length;n=i&&(this.model.active=i-1),(c=this.model.tabs.map(function(t,e){return r.li({},r.span({data:{index:e}},t.title))}))[this.model.active].classList.add(\"bk-bs-active\"),d=r.ul({class:[\"bk-bs-nav\",\"bk-bs-nav-tabs\"]},c),this.el.appendChild(d),(a=this.model.tabs.map(function(t){return r.div({class:\"bk-bs-tab-pane\"})}))[this.model.active].classList.add(\"bk-bs-active\"),l=r.div({class:\"bk-bs-tab-content\"},a),this.el.appendChild(l),d.addEventListener(\"click\",function(t){var e,n,i,r;if(t.preventDefault(),t.target!==t.currentTarget&&(e=t.target,i=p.model.active,n=parseInt(e.dataset.index),i!==n))return c[i].classList.remove(\"bk-bs-active\"),a[i].classList.remove(\"bk-bs-active\"),c[n].classList.add(\"bk-bs-active\"),a[n].classList.add(\"bk-bs-active\"),p.model.active=n,null!=(r=p.model.callback)?r.execute(p.model):void 0}),u=o.zip(this.model.children,a),n=0,s=u.length;n0&&(o(t,e),setTimeout(function(){s(t,e)},n))}function i(t){return Array.isArray(t)?t:[t]}function r(t){var e=(t=String(t)).split(\".\");return e.length>1?e[1].length:0}function o(t,e){t.classList?t.classList.add(e):t.className+=\" \"+e}function s(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(\"(^|\\\\b)\"+e.split(\" \").join(\"|\")+\"(\\\\b|$)\",\"gi\"),\" \")}function a(t){var e=void 0!==window.pageXOffset,n=\"CSS1Compat\"===(t.compatMode||\"\"),i=e?window.pageXOffset:n?t.documentElement.scrollLeft:t.body.scrollLeft,r=e?window.pageYOffset:n?t.documentElement.scrollTop:t.body.scrollTop;return{x:i,y:r}}function l(t,e){return 100/(e-t)}function u(t,e){return 100*e/(t[1]-t[0])}function c(t,e){for(var n=1;t>=e[n];)n+=1;return n}function d(t,e,n){if(n>=t.slice(-1)[0])return 100;var i,r,o,s,a=c(n,t);return i=t[a-1],r=t[a],o=e[a-1],s=e[a],o+function(t,e){return u(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}([i,r],n)/l(o,s)}function p(t,e,n,i){if(100===i)return i;var r,o,s=c(i,t);return n?(r=t[s-1],o=t[s],i-r>(o-r)/2?o:r):e[s-1]?t[s-1]+function(t,e){return Math.round(t/e)*e}(i-t[s-1],e[s-1]):i}function h(t,n,i){var r;if(\"number\"==typeof n&&(n=[n]),\"[object Array]\"!==Object.prototype.toString.call(n))throw new Error(\"noUiSlider (\"+B+\"): 'range' contains invalid value.\");if(r=\"min\"===t?0:\"max\"===t?100:parseFloat(t),!e(r)||!e(n[0]))throw new Error(\"noUiSlider (\"+B+\"): 'range' value isn't numeric.\");i.xPct.push(r),i.xVal.push(n[0]),r?i.xSteps.push(!isNaN(n[1])&&n[1]):isNaN(n[1])||(i.xSteps[0]=n[1]),i.xHighestCompleteStep.push(0)}function f(t,e,n){if(!e)return!0;n.xSteps[t]=u([n.xVal[t],n.xVal[t+1]],e)/l(n.xPct[t],n.xPct[t+1]);var i=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],r=Math.ceil(Number(i.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*r;n.xHighestCompleteStep[t]=o}function m(t,e,n){this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i,r=[];for(i in t)t.hasOwnProperty(i)&&r.push([t[i],i]);for(r.length&&\"object\"==typeof r[0][0]?r.sort(function(t,e){return t[0][0]-e[0][0]}):r.sort(function(t,e){return t[0]-e[0]}),i=0;i=50)throw new Error(\"noUiSlider (\"+B+\"): 'padding' option must be less than half the range.\")}}function M(t,e){switch(e){case\"ltr\":t.dir=0;break;case\"rtl\":t.dir=1;break;default:throw new Error(\"noUiSlider (\"+B+\"): 'direction' option was not recognized.\")}}function A(t,e){if(\"string\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'behaviour' must be a string containing options.\");var n=e.indexOf(\"tap\")>=0,i=e.indexOf(\"drag\")>=0,r=e.indexOf(\"fixed\")>=0,o=e.indexOf(\"snap\")>=0,s=e.indexOf(\"hover\")>=0;if(r){if(2!==t.handles)throw new Error(\"noUiSlider (\"+B+\"): 'fixed' behaviour must be used with 2 handles\");E(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:i,fixed:r,snap:o,hover:s}}function V(t,e){if(t.multitouch=e,\"boolean\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'multitouch' option must be a boolean.\")}function N(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n-1?1:\"steps\"===e?2:0,!s&&a&&(m=0),d===_&&l||(r[h.toFixed(5)]=[d,m]),u=h}}),r}(n,e,s),l=t.format||{to:Math.round};return j=q.appendChild(h(a,i,l))}function g(){var t=T.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||T[e]:t.height||T[e]}function v(t,e,n,i){var o=function(o){return!q.hasAttribute(\"disabled\")&&(!function(t,e){return t.classList?t.classList.contains(e):new RegExp(\"\\\\b\"+e+\"\\\\b\").test(t.className)}(q,r.cssClasses.tap)&&(!!(o=function(t,e,n){var i,o,s=0===t.type.indexOf(\"touch\"),l=0===t.type.indexOf(\"mouse\"),u=0===t.type.indexOf(\"pointer\");0===t.type.indexOf(\"MSPointer\")&&(u=!0);if(s&&r.multitouch){var c=function(t){return t.target===n||n.contains(t.target)};if(\"touchstart\"===t.type){var d=Array.prototype.filter.call(t.touches,c);if(d.length>1)return!1;i=d[0].pageX,o=d[0].pageY}else{var p=Array.prototype.find.call(t.changedTouches,c);if(!p)return!1;i=p.pageX,o=p.pageY}}else if(s){if(t.touches.length>1)return!1;i=t.changedTouches[0].pageX,o=t.changedTouches[0].pageY}e=e||a(Z),(l||u)&&(i=t.clientX+e.x,o=t.clientY+e.y);return t.pageOffset=e,t.points=[i,o],t.cursor=l||u,t}(o,i.pageOffset,i.target||e))&&(!(t===F.start&&void 0!==o.buttons&&o.buttons>1)&&((!i.hover||!o.buttons)&&(H||o.preventDefault(),o.calcPoint=o.points[r.ort],void n(o,i))))))},s=[];return t.split(\" \").forEach(function(t){e.addEventListener(t,o,!!H&&{passive:!0}),s.push([t,o])}),s}function y(t){var e=t-function(t,e){var n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.documentElement,o=a(i);/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0);return e?n.top+o.y-r.clientTop:n.left+o.x-r.clientLeft}(T,r.ort),n=100*e/g();return r.dir?100-n:n}function b(t,e,n,i){var r=n.slice(),o=[!t,t],s=[t,!t];i=i.slice(),t&&i.reverse(),i.length>1?i.forEach(function(t,n){var i=C(r,t,r[t]+e,o[n],s[n],!1);!1===i?e=0:(e=i-r[t],r[t]=i)}):o=s=[!0];var a=!1;i.forEach(function(t,i){a=V(t,n[t]+e,o[i],s[i])||a}),a&&i.forEach(function(t){_(\"update\",t),_(\"slide\",t)})}function _(t,e,n){Object.keys(Q).forEach(function(i){var o=i.split(\".\")[0];t===o&&Q[i].forEach(function(t){t.call(z,$.map(r.format.to),e,$.slice(),n||!1,G.slice())})})}function w(t,e){\"mouseout\"===t.type&&\"HTML\"===t.target.nodeName&&null===t.relatedTarget&&k(t,e)}function x(t,e){if(-1===navigator.appVersion.indexOf(\"MSIE 9\")&&0===t.buttons&&0!==e.buttonsProperty)return k(t,e);var n=(r.dir?-1:1)*(t.calcPoint-e.startCalcPoint),i=100*n/e.baseSize;b(n>0,i,e.locations,e.handleNumbers)}function k(e,n){n.handle&&(s(n.handle,r.cssClasses.active),K-=1),n.listeners.forEach(function(t){tt.removeEventListener(t[0],t[1])}),0===K&&(s(q,r.cssClasses.drag),A(),e.cursor&&(et.style.cursor=\"\",et.removeEventListener(\"selectstart\",t))),n.handleNumbers.forEach(function(t){_(\"change\",t),_(\"set\",t),_(\"end\",t)})}function S(e,n){var i;if(1===n.handleNumbers.length){var s=W[n.handleNumbers[0]];if(s.hasAttribute(\"disabled\"))return!1;i=s.children[0],K+=1,o(i,r.cssClasses.active)}e.stopPropagation();var a=[],l=v(F.move,tt,x,{target:e.target,handle:i,listeners:a,startCalcPoint:e.calcPoint,baseSize:g(),pageOffset:e.pageOffset,handleNumbers:n.handleNumbers,buttonsProperty:e.buttons,locations:G.slice()}),u=v(F.end,tt,k,{target:e.target,handle:i,listeners:a,handleNumbers:n.handleNumbers}),c=v(\"mouseout\",tt,w,{target:e.target,handle:i,listeners:a,handleNumbers:n.handleNumbers});a.push.apply(a,l.concat(u,c)),e.cursor&&(et.style.cursor=getComputedStyle(e.target).cursor,W.length>1&&o(q,r.cssClasses.drag),et.addEventListener(\"selectstart\",t,!1)),n.handleNumbers.forEach(function(t){_(\"start\",t)})}function E(t){t.stopPropagation();var e=y(t.calcPoint),i=function(t){var e=100,n=!1;return W.forEach(function(i,r){if(!i.hasAttribute(\"disabled\")){var o=Math.abs(G[r]-t);o1&&(i&&e>0&&(n=Math.max(n,t[e-1]+r.margin)),o&&e1&&r.limit&&(i&&e>0&&(n=Math.min(n,t[e-1]+r.limit)),o&&e50?-1:1,n=3+(W.length+e*t);W[t].childNodes[0].style.zIndex=n})}function V(t,e,n,i){return!1!==(e=C(G,t,e,n,i,!1))&&(function(t,e){G[t]=e,$[t]=J.fromStepping(e);var n=function(){W[t].style[r.style]=M(e),N(t),N(t+1)};window.requestAnimationFrame&&r.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function N(t){if(U[t]){var e=0,n=100;0!==t&&(e=G[t-1]),t!==U.length-1&&(n=G[t]),U[t].style[r.style]=M(e),U[t].style[r.styleOposite]=M(100-n)}}function I(t,e){null!==t&&!1!==t&&(\"number\"==typeof t&&(t=String(t)),!1===(t=r.format.from(t))||isNaN(t)||V(e,J.toStepping(t),!1,!1))}function P(t,e){var o=i(t),s=void 0===G[0];e=void 0===e||!!e,o.forEach(I),r.animate&&!s&&n(q,r.cssClasses.tap,r.animationDuration),X.forEach(function(t){V(t,G[t],!0,!1)}),A(),X.forEach(function(t){_(\"update\",t),null!==o[t]&&e&&_(\"set\",t)})}function R(){var t=$.map(r.format.to);return 1===t.length?t[0]:t}function L(t,e){Q[t]=Q[t]||[],Q[t].push(e),\"update\"===t.split(\".\")[0]&&W.forEach(function(t,e){_(\"update\",e)})}var T,W,U,z,j,F=window.navigator.pointerEnabled?{start:\"pointerdown\",move:\"pointermove\",end:\"pointerup\"}:window.navigator.msPointerEnabled?{start:\"MSPointerDown\",move:\"MSPointerMove\",end:\"MSPointerUp\"}:{start:\"mousedown touchstart\",move:\"mousemove touchmove\",end:\"mouseup touchend\"},Y=window.CSS&&CSS.supports&&CSS.supports(\"touch-action\",\"none\"),H=Y&&function(){var t=!1;try{var e=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,e)}catch(t){}return t}(),q=e,G=[],X=[],K=0,J=r.spectrum,$=[],Q={},Z=e.ownerDocument,tt=Z.documentElement,et=Z.body;if(q.noUiSlider)throw new Error(\"noUiSlider (\"+B+\"): Slider was already initialized.\");return function(t){o(t,r.cssClasses.target),0===r.dir?o(t,r.cssClasses.ltr):o(t,r.cssClasses.rtl);0===r.ort?o(t,r.cssClasses.horizontal):o(t,r.cssClasses.vertical);T=u(t,r.cssClasses.base)}(q),function(t,e){W=[],(U=[]).push(d(e,t[0]));for(var n=0;nn.stepAfter.startValue&&(r=n.stepAfter.startValue-i),o=i>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&i-n.stepBefore.highestStep,100===t?r=null:0===t&&(o=null);var s=J.countStepDecimals();return null!==r&&!1!==r&&(r=Number(r.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,r]})},on:L,off:function(t){var e=t&&t.split(\".\")[0],n=e&&t.substring(e.length);Object.keys(Q).forEach(function(t){var i=t.split(\".\")[0],r=t.substring(i.length);e&&e!==i||n&&n!==r||delete Q[t]})},get:R,set:P,reset:function(t){P(r.start,t)},__moveHandles:function(t,e,n){b(t,e,G,n)},options:l,updateOptions:function(t,e){var n=R(),i=[\"margin\",\"limit\",\"padding\",\"range\",\"animate\",\"snap\",\"step\",\"format\"];i.forEach(function(e){void 0!==t[e]&&(l[e]=t[e])});var o=O(l);i.forEach(function(e){void 0!==t[e]&&(r[e]=o[e])}),J=o.spectrum,r.margin=o.margin,r.limit=o.limit,r.padding=o.padding,r.pips&&m(r.pips);G=[],P(t.start||n,e)},target:q,removePips:f,pips:m},function(t){t.fixed||W.forEach(function(t,e){v(F.start,t.children[0],S,{handleNumbers:[e]})});t.tap&&v(F.start,T,E,{});t.hover&&v(F.move,T,D,{hover:!0});t.drag&&U.forEach(function(e,n){if(!1!==e&&0!==n&&n!==U.length-1){var i=W[n-1],s=W[n],a=[e];o(e,r.cssClasses.draggable),t.fixed&&(a.push(i.children[0]),a.push(s.children[0])),a.forEach(function(t){v(F.start,t,S,{handles:[i,s],handleNumbers:[n-1,n]})})}})}(r.events),P(r.start),r.pips&&m(r.pips),r.tooltips&&function(){var t=W.map(p);L(\"update\",function(e,n,i){if(t[n]){var o=e[n];!0!==r.tooltips[n]&&(o=r.tooltips[n].to(i[n])),t[n].innerHTML=o}})}(),L(\"update\",function(t,e,n,i,o){X.forEach(function(t){var e=W[t],i=C(G,t,0,!0,!0,!0),s=C(G,t,100,!0,!0,!0),a=o[t],l=r.ariaFormat.to(n[t]);e.children[0].setAttribute(\"aria-valuemin\",i.toFixed(1)),e.children[0].setAttribute(\"aria-valuemax\",s.toFixed(1)),e.children[0].setAttribute(\"aria-valuenow\",a.toFixed(1)),e.children[0].setAttribute(\"aria-valuetext\",l)})}),z}var B=\"10.1.0\";m.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error(\"noUiSlider (\"+B+\"): 'limit', 'margin' and 'padding' must be divisible by step.\");return 2===this.xPct.length&&u(this.xVal,t)},m.prototype.toStepping=function(t){return t=d(this.xVal,this.xPct,t)},m.prototype.fromStepping=function(t){return function(t,e,n){if(n>=100)return t.slice(-1)[0];var i,r,o,s,a=c(n,e);return i=t[a-1],r=t[a],o=e[a-1],s=e[a],function(t,e){return e*(t[1]-t[0])/100+t[0]}([i,r],(n-o)*l(o,s))}(this.xVal,this.xPct,t)},m.prototype.getStep=function(t){return t=p(this.xPct,this.xSteps,this.snap,t)},m.prototype.getNearbySteps=function(t){var e=c(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},m.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(r);return Math.max.apply(null,t)},m.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var U={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{version:B,create:function(t,e){if(!t||!t.nodeName)throw new Error(\"noUiSlider (\"+B+\"): create requires a single element, got: \"+t);var n=O(e),i=W(t,n,e);return t.noUiSlider=i,i}}})},404:/*!\n", " * Pikaday\n", " *\n", " * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday\n", " */\n", " function(t,e,n){!function(i,r){\"use strict\";var o;if(\"object\"==typeof n){try{o=t(\"moment\")}catch(t){}e.exports=r(o)}else i.Pikaday=r(i.moment)}(this,function(t){\"use strict\";var e=\"function\"==typeof t,n=!!window.addEventListener,i=window.document,r=window.setTimeout,o=function(t,e,i,r){n?t.addEventListener(e,i,!!r):t.attachEvent(\"on\"+e,i)},s=function(t,e,i,r){n?t.removeEventListener(e,i,!!r):t.detachEvent(\"on\"+e,i)},a=function(t,e){return-1!==(\" \"+t.className+\" \").indexOf(\" \"+e+\" \")},l=function(t){return/Array/.test(Object.prototype.toString.call(t))},u=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},c=function(t){var e=t.getDay();return 0===e||6===e},d=function(t,e){return[31,function(t){return t%4==0&&t%100!=0||t%400==0}(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},p=function(t){u(t)&&t.setHours(0,0,0,0)},h=function(t,e){return t.getTime()===e.getTime()},f=function(t,e,n){var i,r;for(i in e)(r=void 0!==t[i])&&\"object\"==typeof e[i]&&null!==e[i]&&void 0===e[i].nodeName?u(e[i])?n&&(t[i]=new Date(e[i].getTime())):l(e[i])?n&&(t[i]=e[i].slice(0)):t[i]=f({},e[i],n):!n&&r||(t[i]=e[i]);return t},m=function(t,e,n){var r;i.createEvent?((r=i.createEvent(\"HTMLEvents\")).initEvent(e,!0,!1),r=f(r,n),t.dispatchEvent(r)):i.createEventObject&&(r=i.createEventObject(),r=f(r,n),t.fireEvent(\"on\"+e,r))},g=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},v={field:null,bound:void 0,position:\"bottom left\",reposition:!0,format:\"YYYY-MM-DD\",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:\"\",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:\"left\",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:\"Previous Month\",nextMonth:\"Next Month\",months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],weekdays:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],weekdaysShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},y=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},b=function(t){var e=[],n=\"false\";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'';e.push(\"is-outside-current-month\"),t.enableSelectionDaysInNextAndPreviousMonths||e.push(\"is-selection-disabled\")}return t.isDisabled&&e.push(\"is-disabled\"),t.isToday&&e.push(\"is-today\"),t.isSelected&&(e.push(\"is-selected\"),n=\"true\"),t.hasEvent&&e.push(\"has-event\"),t.isInRange&&e.push(\"is-inrange\"),t.isStartRange&&e.push(\"is-startrange\"),t.isEndRange&&e.push(\"is-endrange\"),'\"},_=function(t,e,n){var i=new Date(n,0,1),r=Math.ceil(((new Date(n,e,t)-i)/864e5+i.getDay()+1)/7);return''+r+\"\"},w=function(t,e,n,i){return''+(e?t.reverse():t).join(\"\")+\"\"},x=function(t,e,n,i,r,o){var s,a,u,c,d,p=t._o,h=n===p.minYear,f=n===p.maxYear,m='
',g=!0,v=!0;for(u=[],s=0;s<12;s++)u.push('\");for(c='
'+p.i18n.months[i]+'
\",l(p.yearRange)?(s=p.yearRange[0],a=p.yearRange[1]+1):(s=n-p.yearRange,a=1+n+p.yearRange),u=[];s=p.minYear&&u.push('\");return d='
'+n+p.yearSuffix+'
\",p.showMonthAfterYear?m+=d+c:m+=c+d,h&&(0===i||p.minMonth>=i)&&(g=!1),f&&(11===i||p.maxMonth<=i)&&(v=!1),0===e&&(m+='\"),e===t._o.numberOfMonths-1&&(m+='\"),m+=\"
\"},k=function(t,e,n){return''+function(t){var e,n=[];t.showWeekNumber&&n.push(\"\");for(e=0;e<7;e++)n.push('\");return\"\"+(t.isRTL?n.reverse():n).join(\"\")+\"\"}(t)+function(t){return\"\"+t.join(\"\")+\"\"}(e)+\"
'+y(t,e,!0)+\"
\"},S=function(s){var l=this,c=l.config(s);l._onMouseDown=function(t){if(l._v){var e=(t=t||window.event).target||t.srcElement;if(e)if(a(e,\"is-disabled\")||(!a(e,\"pika-button\")||a(e,\"is-empty\")||a(e.parentNode,\"is-disabled\")?a(e,\"pika-prev\")?l.prevMonth():a(e,\"pika-next\")&&l.nextMonth():(l.setDate(new Date(e.getAttribute(\"data-pika-year\"),e.getAttribute(\"data-pika-month\"),e.getAttribute(\"data-pika-day\"))),c.bound&&r(function(){l.hide(),c.blurFieldOnSelect&&c.field&&c.field.blur()},100))),a(e,\"pika-select\"))l._c=!0;else{if(!t.preventDefault)return t.returnValue=!1,!1;t.preventDefault()}}},l._onChange=function(t){var e=(t=t||window.event).target||t.srcElement;e&&(a(e,\"pika-select-month\")?l.gotoMonth(e.value):a(e,\"pika-select-year\")&&l.gotoYear(e.value))},l._onKeyChange=function(t){if(t=t||window.event,l.isVisible())switch(t.keyCode){case 13:case 27:c.field&&c.field.blur();break;case 37:t.preventDefault(),l.adjustDate(\"subtract\",1);break;case 38:l.adjustDate(\"subtract\",7);break;case 39:l.adjustDate(\"add\",1);break;case 40:l.adjustDate(\"add\",7)}},l._onInputChange=function(n){var i;n.firedBy!==l&&(i=c.parse?c.parse(c.field.value,c.format):e?(i=t(c.field.value,c.format,c.formatStrict))&&i.isValid()?i.toDate():null:new Date(Date.parse(c.field.value)),u(i)&&l.setDate(i),l._v||l.show())},l._onInputFocus=function(){l.show()},l._onInputClick=function(){l.show()},l._onInputBlur=function(){var t=i.activeElement;do{if(a(t,\"pika-single\"))return}while(t=t.parentNode);l._c||(l._b=r(function(){l.hide()},50)),l._c=!1},l._onClick=function(t){var e=(t=t||window.event).target||t.srcElement,i=e;if(e){!n&&a(e,\"pika-select\")&&(e.onchange||(e.setAttribute(\"onchange\",\"return;\"),o(e,\"change\",l._onChange)));do{if(a(i,\"pika-single\")||i===c.trigger)return}while(i=i.parentNode);l._v&&e!==c.trigger&&i!==c.trigger&&l.hide()}},l.el=i.createElement(\"div\"),l.el.className=\"pika-single\"+(c.isRTL?\" is-rtl\":\"\")+(c.theme?\" \"+c.theme:\"\"),o(l.el,\"mousedown\",l._onMouseDown,!0),o(l.el,\"touchend\",l._onMouseDown,!0),o(l.el,\"change\",l._onChange),o(i,\"keydown\",l._onKeyChange),c.field&&(c.container?c.container.appendChild(l.el):c.bound?i.body.appendChild(l.el):c.field.parentNode.insertBefore(l.el,c.field.nextSibling),o(c.field,\"change\",l._onInputChange),c.defaultDate||(e&&c.field.value?c.defaultDate=t(c.field.value,c.format).toDate():c.defaultDate=new Date(Date.parse(c.field.value)),c.setDefaultDate=!0));var d=c.defaultDate;u(d)?c.setDefaultDate?l.setDate(d,!0):l.gotoDate(d):l.gotoDate(new Date),c.bound?(this.hide(),l.el.className+=\" is-bound\",o(c.trigger,\"click\",l._onInputClick),o(c.trigger,\"focus\",l._onInputFocus),o(c.trigger,\"blur\",l._onInputBlur)):this.show()};return S.prototype={config:function(t){this._o||(this._o=f({},v,!0));var e=f(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=\"string\"==typeof e.theme&&e.theme?e.theme:null,e.bound=!!(void 0!==e.bound?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=\"function\"==typeof e.disableDayFn?e.disableDayFn:null;var n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,u(e.minDate)||(e.minDate=!1),u(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate100&&(e.yearRange=100);return e},toString:function(n){return n=n||this._o.format,u(this._d)?this._o.toString?this._o.toString(this._d,n):e?t(this._d).format(n):this._d.toDateString():\"\"},getMoment:function(){return e?t(this._d):null},setMoment:function(n,i){e&&t.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return u(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value=\"\",m(this._o.field,\"change\",{firedBy:this})),this.draw();if(\"string\"==typeof t&&(t=new Date(Date.parse(t))),u(t)){var n=this._o.minDate,i=this._o.maxDate;u(n)&&ti&&(t=i),this._d=new Date(t.getTime()),p(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),m(this._o.field,\"change\",{firedBy:this})),e||\"function\"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(t){var e=!0;if(u(t)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=r=o&&(this._y=o,!isNaN(a)&&this._m>a&&(this._m=a)),e=\"pika-title-\"+Math.random().toString(36).replace(/[^a-z]+/g,\"\").substr(0,2);for(var u=0;u'+x(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,e)+this.render(this.calendars[u].year,this.calendars[u].month,e)+\"\";this.el.innerHTML=l,n.bound&&\"hidden\"!==n.field.type&&r(function(){n.trigger.focus()},1),\"function\"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute(\"aria-label\",\"Use the arrow keys to pick a date\")}},adjustPosition:function(){var t,e,n,r,o,s,a,l,u,c;if(!this._o.container){if(this.el.style.position=\"absolute\",t=this._o.trigger,e=t,n=this.el.offsetWidth,r=this.el.offsetHeight,o=window.innerWidth||i.documentElement.clientWidth,s=window.innerHeight||i.documentElement.clientHeight,a=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,\"function\"==typeof t.getBoundingClientRect)c=t.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=e.offsetLeft,u=e.offsetTop+e.offsetHeight;e=e.offsetParent;)l+=e.offsetLeft,u+=e.offsetTop;(this._o.reposition&&l+n>o||this._o.position.indexOf(\"right\")>-1&&l-n+t.offsetWidth>0)&&(l=l-n+t.offsetWidth),(this._o.reposition&&u+r>s+a||this._o.position.indexOf(\"top\")>-1&&u-r-t.offsetHeight>0)&&(u=u-r-t.offsetHeight),this.el.style.left=l+\"px\",this.el.style.top=u+\"px\"}},render:function(t,e,n){var i=this._o,r=new Date,o=d(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];p(r),i.firstDay>0&&(s-=i.firstDay)<0&&(s+=7);for(var f=0===e?11:e-1,m=11===e?0:e+1,g=0===e?t-1:t,v=11===e?t+1:t,y=d(g,f),x=o+s,S=x;S>7;)S-=7;x+=7-S;for(var E=!1,D=0,C=0;D=o+s,P=D-s+1,R=e,L=t,T=i.startRange&&h(i.startRange,M),O=i.endRange&&h(i.endRange,M),W=i.startRange&&i.endRange&&i.startRangei.maxDate||i.disableWeekends&&c(M)||i.disableDayFn&&i.disableDayFn(M);I&&(D/g,\">\")},t}(d.Model);var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){var i,l,a,u;switch(i=this.font_style,a=this.text_align,u=this.text_color,l=s.span({},null==n?\"\":\"\"+n),i){case\"bold\":l.style.fontWeight=\"bold\";break;case\"italic\":l.style.fontStyle=\"italic\"}return null!=a&&(l.style.textAlign=a),null!=u&&(l.style.color=u),l=l.outerHTML},t}(n.CellFormatter);n.StringFormatter=p,p.prototype.type=\"StringFormatter\",p.define({font_style:[a.FontStyle,\"normal\"],text_align:[a.TextAlign,\"left\"],text_color:[a.Color]});var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(t,n,o,i,l){var a,s,u;return a=this.format,s=this.language,u=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}}.call(this),o=r.format(o,a,s,u),e.prototype.doFormat.call(this,t,n,o,i,l)},t}(p);n.NumberFormatter=f,f.prototype.type=\"NumberFormatter\",f.define({format:[a.String,\"0,0\"],language:[a.String,\"en\"],rounding:[a.String,\"round\"]});var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){return n?s.i({class:this.icon}).outerHTML:\"\"},t}(n.CellFormatter);n.BooleanFormatter=h,h.prototype.type=\"BooleanFormatter\",h.define({icon:[a.String,\"check\"]});var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.getFormat=function(){var e;return\"__CUSTOM__\"===(e=function(){switch(this.format){case\"ATOM\":case\"W3C\":case\"RFC-3339\":case\"ISO-8601\":return\"%Y-%m-%d\";case\"COOKIE\":return\"%a, %d %b %Y\";case\"RFC-850\":return\"%A, %d-%b-%y\";case\"RFC-1123\":case\"RFC-2822\":return\"%a, %e %b %Y\";case\"RSS\":case\"RFC-822\":case\"RFC-1036\":return\"%a, %e %b %y\";case\"TIMESTAMP\":return null;default:return\"__CUSTOM__\"}}.call(this))?this.format:e},t.prototype.doFormat=function(t,n,o,r,i){var a;return o=c.isString(o)?parseInt(o,10):o,a=l(o,this.getFormat()),e.prototype.doFormat.call(this,t,n,a,r,i)},t}(n.CellFormatter);n.DateFormatter=g,g.prototype.type=\"DateFormatter\",g.define({format:[a.String,\"ISO-8601\"]});var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.doFormat=function(e,t,n,o,r){var l;return l=this.template,null===n?\"\":(r=u.extend({},r,{value:n}),i(l)(r))},t}(n.CellFormatter);n.HTMLTemplateFormatter=m,m.prototype.type=\"HTMLTemplateFormatter\",m.define({template:[a.String,\"<%= value %>\"]})},407:function(e,t,n){var o=e(364),r=e(419),i=e(417),l=e(416),a=e(9),s=e(15),u=e(37),c=e(22),d=e(14),p=e(411),f=e(412);n.DTINDEX_NAME=\"__bkdt_internal_index__\",n.DataProvider=function(){function e(e,t){if(this.source=e,this.view=t,n.DTINDEX_NAME in this.source.data)throw new Error(\"special name \"+n.DTINDEX_NAME+\" cannot be used as a data table column\");this.index=this.view.indices}return e.prototype.getLength=function(){return this.index.length},e.prototype.getItem=function(e){var t,o,r,i,l;for(o={},l=Object.keys(this.source.data),r=0,i=l.length;rn;e=0<=n?++t:--t)o.push(this.getItem(e));return o}.call(this)},e.prototype.sort=function(e){var t,o,r,i;return 0===(t=function(){var t,n,r;for(r=[],t=0,n=e.length;td?u:-u))return s;return 0;var p})},e.prototype._update_source_inplace=function(){this.source.properties.data.change.emit(this,this.source.attributes.data)},e}();var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.initialize=function(t){return e.prototype.initialize.call(this,t),this.in_selection_update=!1},t.prototype.connect_signals=function(){var t=this;return e.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return t.render()}),this.connect(this.model.source.properties.data.change,function(){return t.updateGrid()}),this.connect(this.model.source.streaming,function(){return t.updateGrid()}),this.connect(this.model.source.patching,function(){return t.updateGrid()}),this.connect(this.model.source.change,function(){return t.updateSelection()})},t.prototype.updateGrid=function(){return this.model.view.compute_indices(),this.data.constructor(this.model.source,this.model.view),this.grid.invalidate(),this.grid.render(),this.model.source.data=this.model.source.data,this.model.source.change.emit()},t.prototype.updateSelection=function(){var e,t,n,o,r,i;if(!this.in_selection_update)return o=this.model.source.selected,r=o[\"1d\"].indices,n=function(){var e,t,n;for(n=[],e=0,t=r.length;e0&&t-1 in e)}function r(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function i(e,t,n){return ae.isFunction(t)?ae.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?ae.grep(e,function(e){return e===t!==n}):\"string\"!=typeof t?ae.grep(e,function(e){return ee.call(t,e)>-1!==n}):ve.test(t)?ae.filter(t,e,n):(t=ae.filter(t,e),ae.grep(e,function(e){return ee.call(t,e)>-1!==n&&1===e.nodeType}))}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){return e}function s(e){throw e}function u(e,t,n,o){var r;try{e&&ae.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&ae.isFunction(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}function c(){G.removeEventListener(\"DOMContentLoaded\",c),e.removeEventListener(\"load\",c),ae.ready()}function d(){this.expando=ae.expando+d.uid++}function p(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o=\"data-\"+t.replace(Ae,\"-$&\").toLowerCase(),\"string\"==typeof(n=e.getAttribute(o))){try{n=function(e){if(\"true\"===e)return!0;if(\"false\"===e)return!1;if(\"null\"===e)return null;if(e===+e+\"\")return+e;if(Ne.test(e))return JSON.parse(e);return e}(n)}catch(e){}De.set(e,t,n)}else n=void 0;return n}function f(e,t,n,o){var r,i=1,l=20,a=o?function(){return o.cur()}:function(){return ae.css(e,t,\"\")},s=a(),u=n&&n[3]||(ae.cssNumber[t]?\"\":\"px\"),c=(ae.cssNumber[t]||\"px\"!==u&&+s)&&He.exec(ae.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+s||1;do{c/=i=i||\".5\",ae.style(e,t,c+u)}while(i!==(i=a()/s)&&1!==i&&--l)}return n&&(c=+c||+s||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=r)),r}function h(e){var t,n=e.ownerDocument,o=e.nodeName,r=_e[o];return r||(t=n.body.appendChild(n.createElement(o)),r=ae.css(t,\"display\"),t.parentNode.removeChild(t),\"none\"===r&&(r=\"block\"),_e[o]=r,r)}function g(e,t){for(var n,o,r=[],i=0,l=e.length;i-1)r&&r.push(i);else if(u=ae.contains(i.ownerDocument,i),l=m(d.appendChild(i),\"script\"),u&&v(l),n)for(c=0;i=l[c++];)je.test(i.type||\"\")&&n.push(i);return d}function y(){return!0}function C(){return!1}function b(){try{return G.activeElement}catch(e){}}function x(e,t,n,o,r,i){var l,a;if(\"object\"==typeof t){\"string\"!=typeof n&&(o=o||n,n=void 0);for(a in t)x(e,a,n,o,t[a],i);return e}if(null==o&&null==r?(r=n,o=n=void 0):null==r&&(\"string\"==typeof n?(r=o,o=void 0):(r=o,o=n,n=void 0)),!1===r)r=C;else if(!r)return e;return 1===i&&(l=r,(r=function(e){return ae().off(e),l.apply(this,arguments)}).guid=l.guid||(l.guid=ae.guid++)),e.each(function(){ae.event.add(this,t,r,o,n)})}function R(e,t){return r(e,\"table\")&&r(11!==t.nodeType?t:t.firstChild,\"tr\")?ae(\">tbody\",e)[0]||e:e}function S(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function E(e){var t=Ye.exec(e.type);return t?e.type=t[1]:e.removeAttribute(\"type\"),e}function k(e,t){var n,o,r,i,l,a,s,u;if(1===t.nodeType){if(Pe.hasData(e)&&(i=Pe.access(e),l=Pe.set(t,i),u=i.events)){delete l.handle,l.events={};for(r in u)for(n=0,o=u[r].length;n1&&\"string\"==typeof h&&!le.checkClone&&Ge.test(h))return e.each(function(n){var i=e.eq(n);g&&(t[0]=h.call(this,n,i.html())),P(i,t,o,r)});if(p&&(i=w(t,e[0].ownerDocument,!1,e,r),l=i.firstChild,1===i.childNodes.length&&(i=l),l||r)){for(a=ae.map(m(i,\"script\"),S),s=a.length;d=0&&nb.cacheLength&&delete e[t.shift()],e[n+\" \"]=o}var t=[];return e}function o(e){return e[M]=!0,e}function r(e){var t=A.createElement(\"fieldset\");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split(\"|\"),o=n.length;o--;)b.attrHandle[n[o]]=t}function l(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return\"input\"===n&&t.type===e}}function s(e){return function(t){var n=t.nodeName.toLowerCase();return(\"input\"===n||\"button\"===n)&&t.type===e}}function u(e){return function(t){return\"form\"in t?t.parentNode&&!1===t.disabled?\"label\"in t?\"label\"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&xe(t)===e:t.disabled===e:\"label\"in t&&t.disabled===e}}function c(e){return o(function(t){return t=+t,o(function(n,o){for(var r,i=e([],n.length,t),l=i.length;l--;)n[r=i[l]]&&(n[r]=!(o[r]=n[r]))})})}function d(e){return e&&void 0!==e.getElementsByTagName&&e}function p(){}function f(e){for(var t=0,n=e.length,o=\"\";t1?function(t,n,o){for(var r=e.length;r--;)if(!e[r](t,n,o))return!1;return!0}:e[0]}function m(e,t,n,o,r){for(var i,l=[],a=0,s=e.length,u=null!=t;a-1&&(o[c]=!(a[c]=p))}}else y=m(y===a?y.splice(g,y.length):y),l?l(null,a,y,u):Y.apply(a,y)})}function w(e){for(var t,n,o,r=e.length,i=b.relative[e[0].type],l=i||b.relative[\" \"],a=i?1:0,s=h(function(e){return e===t},l,!0),u=h(function(e){return J(t,e)>-1},l,!0),c=[function(e,n,o){var r=!i&&(o||n!==T)||((t=n).nodeType?s(e,n,o):u(e,n,o));return t=null,r}];a1&&g(c),a>1&&f(e.slice(0,a-1).concat({value:\" \"===e[a-2].type?\"*\":\"\"})).replace(ie,\"$1\"),n,a+~]|\"+ee+\")\"+ee+\"*\"),se=new RegExp(\"=\"+ee+\"*([^\\\\]'\\\"]*?)\"+ee+\"*\\\\]\",\"g\"),ue=new RegExp(oe),ce=new RegExp(\"^\"+te+\"$\"),de={ID:new RegExp(\"^#(\"+te+\")\"),CLASS:new RegExp(\"^\\\\.(\"+te+\")\"),TAG:new RegExp(\"^(\"+te+\"|[*])\"),ATTR:new RegExp(\"^\"+ne),PSEUDO:new RegExp(\"^\"+oe),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+ee+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+ee+\"*(?:([+-]|)\"+ee+\"*(\\\\d+)|))\"+ee+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+Z+\")$\",\"i\"),needsContext:new RegExp(\"^\"+ee+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+ee+\"*((?:-\\\\d)?\\\\d*)\"+ee+\"*\\\\)|)(?=[^-]|$)\",\"i\")},pe=/^(?:input|select|textarea|button)$/i,fe=/^h\\d$/i,he=/^[^{]+\\{\\s*\\[native \\w/,ge=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,me=/[+~]/,ve=new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\"+ee+\"?|(\"+ee+\")|.)\",\"ig\"),we=function(e,t,n){var o=\"0x\"+t-65536;return o!=o||n?t:o<0?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},ye=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,Ce=function(e,t){return t?\"\\0\"===e?\"�\":e.slice(0,-1)+\"\\\\\"+e.charCodeAt(e.length-1).toString(16)+\" \":\"\\\\\"+e},be=function(){N()},xe=h(function(e){return!0===e.disabled&&(\"form\"in e||\"label\"in e)},{dir:\"parentNode\",next:\"legend\"});try{Y.apply(U=Q.call(W.childNodes),W.childNodes),U[W.childNodes.length].nodeType}catch(e){Y={apply:U.length?function(e,t){G.apply(e,Q.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}C=t.support={},R=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&\"HTML\"!==t.nodeName},N=t.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:W;return o!==A&&9===o.nodeType&&o.documentElement?(A=o,$=A.documentElement,H=!R(A),W!==A&&(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener(\"unload\",be,!1):n.attachEvent&&n.attachEvent(\"onunload\",be)),C.attributes=r(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),C.getElementsByTagName=r(function(e){return e.appendChild(A.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),C.getElementsByClassName=he.test(A.getElementsByClassName),C.getById=r(function(e){return $.appendChild(e).id=M,!A.getElementsByName||!A.getElementsByName(M).length}),C.getById?(b.filter.ID=function(e){var t=e.replace(ve,we);return function(e){return e.getAttribute(\"id\")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&H){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var t=e.replace(ve,we);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode(\"id\");return n&&n.value===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&H){var n,o,r,i=t.getElementById(e);if(i){if((n=i.getAttributeNode(\"id\"))&&n.value===e)return[i];for(r=t.getElementsByName(e),o=0;i=r[o++];)if((n=i.getAttributeNode(\"id\"))&&n.value===e)return[i]}return[]}}),b.find.TAG=C.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):C.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],r=0,i=t.getElementsByTagName(e);if(\"*\"===e){for(;n=i[r++];)1===n.nodeType&&o.push(n);return o}return i},b.find.CLASS=C.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&H)return t.getElementsByClassName(e)},F=[],L=[],(C.qsa=he.test(A.querySelectorAll))&&(r(function(e){$.appendChild(e).innerHTML=\"\",e.querySelectorAll(\"[msallowcapture^='']\").length&&L.push(\"[*^$]=\"+ee+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||L.push(\"\\\\[\"+ee+\"*(?:value|\"+Z+\")\"),e.querySelectorAll(\"[id~=\"+M+\"-]\").length||L.push(\"~=\"),e.querySelectorAll(\":checked\").length||L.push(\":checked\"),e.querySelectorAll(\"a#\"+M+\"+*\").length||L.push(\".#.+[+~]\")}),r(function(e){e.innerHTML=\"\";var t=A.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"name\",\"D\"),e.querySelectorAll(\"[name=d]\").length&&L.push(\"name\"+ee+\"*[*^$|!~]?=\"),2!==e.querySelectorAll(\":enabled\").length&&L.push(\":enabled\",\":disabled\"),$.appendChild(e).disabled=!0,2!==e.querySelectorAll(\":disabled\").length&&L.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),L.push(\",.*:\")})),(C.matchesSelector=he.test(I=$.matches||$.webkitMatchesSelector||$.mozMatchesSelector||$.oMatchesSelector||$.msMatchesSelector))&&r(function(e){C.disconnectedMatch=I.call(e,\"*\"),I.call(e,\"[s!='']:x\"),F.push(\"!=\",oe)}),L=L.length&&new RegExp(L.join(\"|\")),F=F.length&&new RegExp(F.join(\"|\")),t=he.test($.compareDocumentPosition),_=t||he.test($.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!C.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===W&&_(W,e)?-1:t===A||t.ownerDocument===W&&_(W,t)?1:P?J(P,e)-J(P,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,o=0,r=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!r||!i)return e===A?-1:t===A?1:r?-1:i?1:P?J(P,e)-J(P,t):0;if(r===i)return l(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[o]===s[o];)o++;return o?l(a[o],s[o]):a[o]===W?-1:s[o]===W?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&N(e),n=n.replace(se,\"='$1']\"),C.matchesSelector&&H&&!O[n+\" \"]&&(!F||!F.test(n))&&(!L||!L.test(n)))try{var o=I.call(e,n);if(o||C.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&N(e),_(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&N(e);var n=b.attrHandle[t.toLowerCase()],o=n&&X.call(b.attrHandle,t.toLowerCase())?n(e,t,!H):void 0;return void 0!==o?o:C.attributes||!H?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},t.escape=function(e){return(e+\"\").replace(ye,Ce)},t.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},t.uniqueSort=function(e){var t,n=[],o=0,r=0;if(D=!C.detectDuplicates,P=!C.sortStable&&e.slice(0),e.sort(z),D){for(;t=e[r++];)t===e[r]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return P=null,e},x=t.getText=function(e){var t,n=\"\",o=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[o++];)n+=x(t);return n},(b=t.selectors={cacheLength:50,createPseudo:o,match:de,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,we),e[3]=(e[3]||e[4]||e[5]||\"\").replace(ve,we),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return de.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||\"\":n&&ue.test(n)&&(t=S(n,!0))&&(t=n.indexOf(\")\",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,we).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+\" \"];return t||(t=new RegExp(\"(^|\"+ee+\")\"+e+\"(\"+ee+\"|$)\"))&&B(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute(\"class\")||\"\")})},ATTR:function(e,n,o){return function(r){var i=t.attr(r,e);return null==i?\"!=\"===n:!n||(i+=\"\",\"=\"===n?i===o:\"!=\"===n?i!==o:\"^=\"===n?o&&0===i.indexOf(o):\"*=\"===n?o&&i.indexOf(o)>-1:\"$=\"===n?o&&i.slice(-o.length)===o:\"~=\"===n?(\" \"+i.replace(re,\" \")+\" \").indexOf(o)>-1:\"|=\"===n&&(i===o||i.slice(0,o.length+1)===o+\"-\"))}},CHILD:function(e,t,n,o,r){var i=\"nth\"!==e.slice(0,3),l=\"last\"!==e.slice(-4),a=\"of-type\"===t;return 1===o&&0===r?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,h,g=i!==l?\"nextSibling\":\"previousSibling\",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),w=!s&&!a,y=!1;if(m){if(i){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g=\"only\"===e&&!h&&\"nextSibling\"}return!0}if(h=[l?m.firstChild:m.lastChild],l&&w){for(d=(p=m)[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],f=u[0]===j&&u[1],y=f&&u[2],p=f&&m.childNodes[f];p=++f&&p&&p[g]||(y=f=0)||h.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[j,f,y];break}}else if(w&&(d=(p=t)[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),u=c[e]||[],f=u[0]===j&&u[1],y=f),!1===y)for(;(p=++f&&p&&p[g]||(y=f=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++y||(w&&(d=p[M]||(p[M]={}),(c=d[p.uniqueID]||(d[p.uniqueID]={}))[e]=[j,y]),p!==t)););return(y-=r)===o||y%o==0&&y/o>=0}}},PSEUDO:function(e,n){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||t.error(\"unsupported pseudo: \"+e);return i[M]?i(n):i.length>1?(r=[e,e,\"\",n],b.setFilters.hasOwnProperty(e.toLowerCase())?o(function(e,t){for(var o,r=i(e,n),l=r.length;l--;)o=J(e,r[l]),e[o]=!(t[o]=r[l])}):function(e){return i(e,0,r)}):i}},pseudos:{not:o(function(e){var t=[],n=[],r=E(e.replace(ie,\"$1\"));return r[M]?o(function(e,t,n,o){for(var i,l=r(e,null,o,[]),a=e.length;a--;)(i=l[a])&&(e[a]=!(t[a]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:o(function(e){return function(n){return t(e,n).length>0}}),contains:o(function(e){return e=e.replace(ve,we),function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),lang:o(function(e){return ce.test(e||\"\")||t.error(\"unsupported lang: \"+e),e=e.replace(ve,we).toLowerCase(),function(t){var n;do{if(n=H?t.lang:t.getAttribute(\"xml:lang\")||t.getAttribute(\"lang\"))return(n=n.toLowerCase())===e||0===n.indexOf(e+\"-\")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===$},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:u(!1),disabled:u(!0),checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||\"text\"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n=0;)e.push(o);return e}),gt:c(function(e,t,n){for(var o=n<0?n+t:n;++o0,i=e.length>0,l=function(o,l,a,s,u){var c,d,p,f=0,h=\"0\",g=o&&[],v=[],w=T,y=o||i&&b.find.TAG(\"*\",u),C=j+=null==w?1:Math.random()||.1,x=y.length;for(u&&(T=l===A||l||u);h!==x&&null!=(c=y[h]);h++){if(i&&c){for(d=0,l||c.ownerDocument===A||(N(c),a=!H);p=e[d++];)if(p(c,l||A,a)){s.push(c);break}u&&(j=C)}r&&((c=!p&&c)&&f--,o&&g.push(c))}if(f+=h,r&&h!==f){for(d=0;p=n[d++];)p(g,v,l,a);if(o){if(f>0)for(;h--;)g[h]||v[h]||(v[h]=K.call(s));v=m(v)}Y.apply(s,v),u&&!o&&v.length>0&&f+n.length>1&&t.uniqueSort(s)}return u&&(j=C,T=w),g};return r?o(l):l}(l,i))).selector=e}return a},k=t.select=function(e,t,n,o){var r,i,l,a,s,u=\"function\"==typeof e&&e,c=!o&&S(e=u.selector||e);if(n=n||[],1===c.length){if((i=c[0]=c[0].slice(0)).length>2&&\"ID\"===(l=i[0]).type&&9===t.nodeType&&H&&b.relative[i[1].type]){if(!(t=(b.find.ID(l.matches[0].replace(ve,we),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(r=de.needsContext.test(e)?0:i.length;r--&&(l=i[r],!b.relative[a=l.type]);)if((s=b.find[a])&&(o=s(l.matches[0].replace(ve,we),me.test(i[0].type)&&d(t.parentNode)||t))){if(i.splice(r,1),!(e=o.length&&f(i)))return Y.apply(n,o),n;break}}return(u||E(e,c))(o,t,!H,n,!t||me.test(e)&&d(t.parentNode)||t),n},C.sortStable=M.split(\"\").sort(z).join(\"\")===M,C.detectDuplicates=!!D,N(),C.sortDetached=r(function(e){return 1&e.compareDocumentPosition(A.createElement(\"fieldset\"))}),r(function(e){return e.innerHTML=\"\",\"#\"===e.firstChild.getAttribute(\"href\")})||i(\"type|href|height|width\",function(e,t,n){if(!n)return e.getAttribute(t,\"type\"===t.toLowerCase()?1:2)}),C.attributes&&r(function(e){return e.innerHTML=\"\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||i(\"value\",function(e,t,n){if(!n&&\"input\"===e.nodeName.toLowerCase())return e.defaultValue}),r(function(e){return null==e.getAttribute(\"disabled\")})||i(Z,function(e,t,n){var o;if(!n)return!0===e[t]?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),t}(e);ae.find=pe,ae.expr=pe.selectors,ae.expr[\":\"]=ae.expr.pseudos,ae.uniqueSort=ae.unique=pe.uniqueSort,ae.text=pe.getText,ae.isXMLDoc=pe.isXML,ae.contains=pe.contains,ae.escapeSelector=pe.escape;var fe=function(e,t,n){for(var o=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&ae(e).is(n))break;o.push(e)}return o},he=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},ge=ae.expr.match.needsContext,me=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i,ve=/^.[^:#\\[\\.,]*$/;ae.filter=function(e,t,n){var o=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===o.nodeType?ae.find.matchesSelector(o,e)?[o]:[]:ae.find.matches(e,ae.grep(t,function(e){return 1===e.nodeType}))},ae.fn.extend({find:function(e){var t,n,o=this.length,r=this;if(\"string\"!=typeof e)return this.pushStack(ae(e).filter(function(){for(t=0;t1?ae.uniqueSort(n):n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,\"string\"==typeof e&&ge.test(e)?ae(e):e||[],!1).length}});var we,ye=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,Ce=ae.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||we,\"string\"==typeof e){if(!(o=\"<\"===e[0]&&\">\"===e[e.length-1]&&e.length>=3?[null,e,null]:ye.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof ae?t[0]:t,ae.merge(this,ae.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:G,!0)),me.test(o[1])&&ae.isPlainObject(t))for(o in t)ae.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=G.getElementById(o[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ae.isFunction(e)?void 0!==n.ready?n.ready(e):e(ae):ae.makeArray(e,this)};Ce.prototype=ae.fn,we=ae(G);var be=/^(?:parents|prev(?:Until|All))/,xe={children:!0,contents:!0,next:!0,prev:!0};ae.fn.extend({has:function(e){var t=ae(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&ae.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?ae.uniqueSort(i):i)},index:function(e){return e?\"string\"==typeof e?ee.call(ae(e),this[0]):ee.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ae.uniqueSort(ae.merge(this.get(),ae(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ae.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return fe(e,\"parentNode\")},parentsUntil:function(e,t,n){return fe(e,\"parentNode\",n)},next:function(e){return l(e,\"nextSibling\")},prev:function(e){return l(e,\"previousSibling\")},nextAll:function(e){return fe(e,\"nextSibling\")},prevAll:function(e){return fe(e,\"previousSibling\")},nextUntil:function(e,t,n){return fe(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return fe(e,\"previousSibling\",n)},siblings:function(e){return he((e.parentNode||{}).firstChild,e)},children:function(e){return he(e.firstChild)},contents:function(e){return r(e,\"iframe\")?e.contentDocument:(r(e,\"template\")&&(e=e.content||e),ae.merge([],e.childNodes))}},function(e,t){ae.fn[e]=function(n,o){var r=ae.map(this,t,n);return\"Until\"!==e.slice(-5)&&(o=n),o&&\"string\"==typeof o&&(r=ae.filter(o,r)),this.length>1&&(xe[e]||ae.uniqueSort(r),be.test(e)&&r.reverse()),this.pushStack(r)}});var Re=/[^\\x20\\t\\r\\n\\f]+/g;ae.Callbacks=function(e){e=\"string\"==typeof e?function(e){var t={};return ae.each(e.match(Re)||[],function(e,n){t[n]=!0}),t}(e):ae.extend({},e);var t,n,o,r,i=[],l=[],a=-1,s=function(){for(r=r||e.once,o=t=!0;l.length;a=-1)for(n=l.shift();++a-1;)i.splice(n,1),n<=a&&a--}),this},has:function(e){return e?ae.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return r=l=[],i=n=\"\",this},disabled:function(){return!i},lock:function(){return r=l=[],n||t||(i=n=\"\"),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],l.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!o}};return u},ae.extend({Deferred:function(t){var n=[[\"notify\",\"progress\",ae.Callbacks(\"memory\"),ae.Callbacks(\"memory\"),2],[\"resolve\",\"done\",ae.Callbacks(\"once memory\"),ae.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",ae.Callbacks(\"once memory\"),ae.Callbacks(\"once memory\"),1,\"rejected\"]],o=\"pending\",r={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return ae.Deferred(function(t){ae.each(n,function(n,o){var r=ae.isFunction(e[o[4]])&&e[o[4]];i[o[1]](function(){var e=r&&r.apply(this,arguments);e&&ae.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[o[0]+\"With\"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(t,o,r){function i(t,n,o,r){return function(){var u=this,c=arguments,d=function(){var e,d;if(!(t=l&&(o!==s&&(u=void 0,c=[e]),n.rejectWith(u,c))}};t?p():(ae.Deferred.getStackHook&&(p.stackTrace=ae.Deferred.getStackHook()),e.setTimeout(p))}}var l=0;return ae.Deferred(function(e){n[0][3].add(i(0,e,ae.isFunction(r)?r:a,e.notifyWith)),n[1][3].add(i(0,e,ae.isFunction(t)?t:a)),n[2][3].add(i(0,e,ae.isFunction(o)?o:s))}).promise()},promise:function(e){return null!=e?ae.extend(e,r):r}},i={};return ae.each(n,function(e,t){var l=t[2],a=t[5];r[t[1]]=l.add,a&&l.add(function(){o=a},n[3-e][2].disable,n[0][2].lock),l.add(t[3].fire),i[t[0]]=function(){return i[t[0]+\"With\"](this===i?void 0:this,arguments),this},i[t[0]+\"With\"]=l.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,o=Array(n),r=Q.call(arguments),i=ae.Deferred(),l=function(e){return function(n){o[e]=this,r[e]=arguments.length>1?Q.call(arguments):n,--t||i.resolveWith(o,r)}};if(t<=1&&(u(e,i.done(l(n)).resolve,i.reject,!t),\"pending\"===i.state()||ae.isFunction(r[n]&&r[n].then)))return i.then();for(;n--;)u(r[n],l(n),i.reject);return i.promise()}});var Se=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ae.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Se.test(t.name)&&e.console.warn(\"jQuery.Deferred exception: \"+t.message,t.stack,n)},ae.readyException=function(t){e.setTimeout(function(){throw t})};var Ee=ae.Deferred();ae.fn.ready=function(e){return Ee.then(e).catch(function(e){ae.readyException(e)}),this},ae.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ae.readyWait:ae.isReady)||(ae.isReady=!0,!0!==e&&--ae.readyWait>0||Ee.resolveWith(G,[ae]))}}),ae.ready.then=Ee.then,\"complete\"===G.readyState||\"loading\"!==G.readyState&&!G.documentElement.doScroll?e.setTimeout(ae.ready):(G.addEventListener(\"DOMContentLoaded\",c),e.addEventListener(\"load\",c));var ke=function(e,t,n,o,r,i,l){var a=0,s=e.length,u=null==n;if(\"object\"===ae.type(n)){r=!0;for(a in n)ke(e,t,a,n[a],!0,i,l)}else if(void 0!==o&&(r=!0,ae.isFunction(o)||(l=!0),u&&(l?(t.call(e,o),t=null):(u=t,t=function(e,t,n){return u.call(ae(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){De.remove(this,e)})}}),ae.extend({queue:function(e,t,n){var o;if(e)return t=(t||\"fx\")+\"queue\",o=Pe.get(e,t),n&&(!o||Array.isArray(n)?o=Pe.access(e,t,ae.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||\"fx\";var n=ae.queue(e,t),o=n.length,r=n.shift(),i=ae._queueHooks(e,t),l=function(){ae.dequeue(e,t)};\"inprogress\"===r&&(r=n.shift(),o--),r&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete i.stop,r.call(e,l,i)),!o&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return Pe.get(e,n)||Pe.access(e,n,{empty:ae.Callbacks(\"once memory\").add(function(){Pe.remove(e,[t+\"queue\",n])})})}}),ae.fn.extend({queue:function(e,t){var n=2;return\"string\"!=typeof e&&(t=e,e=\"fx\",n--),arguments.length\\x20\\t\\r\\n\\f]+)/i,je=/^$|\\/(?:java|ecma)script/i,Ve={option:[1,\"\"],thead:[1,\"\",\"
\"],col:[2,\"\",\"
\"],tr:[2,\"\",\"
\"],td:[3,\"\",\"
\"],_default:[0,\"\",\"\"]};Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td;var Be=/<|&#?\\w+;/;!function(){var e=G.createDocumentFragment(),t=e.appendChild(G.createElement(\"div\")),n=G.createElement(\"input\");n.setAttribute(\"type\",\"radio\"),n.setAttribute(\"checked\",\"checked\"),n.setAttribute(\"name\",\"t\"),t.appendChild(n),le.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML=\"\",le.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var qe=G.documentElement,Oe=/^key/,ze=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Xe=/^([^.]*)(?:\\.(.+)|)/;ae.event={global:{},add:function(e,t,n,o,r){var i,l,a,s,u,c,d,p,f,h,g,m=Pe.get(e);if(m)for(n.handler&&(n=(i=n).handler,r=i.selector),r&&ae.find.matchesSelector(qe,r),n.guid||(n.guid=ae.guid++),(s=m.events)||(s=m.events={}),(l=m.handle)||(l=m.handle=function(t){return void 0!==ae&&ae.event.triggered!==t.type?ae.event.dispatch.apply(e,arguments):void 0}),t=(t||\"\").match(Re)||[\"\"],u=t.length;u--;)a=Xe.exec(t[u])||[],f=g=a[1],h=(a[2]||\"\").split(\".\").sort(),f&&(d=ae.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=ae.event.special[f]||{},c=ae.extend({type:f,origType:g,data:o,handler:n,guid:n.guid,selector:r,needsContext:r&&ae.expr.match.needsContext.test(r),namespace:h.join(\".\")},i),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,o,h,l)||e.addEventListener&&e.addEventListener(f,l)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,c):p.push(c),ae.event.global[f]=!0)},remove:function(e,t,n,o,r){var i,l,a,s,u,c,d,p,f,h,g,m=Pe.hasData(e)&&Pe.get(e);if(m&&(s=m.events)){for(t=(t||\"\").match(Re)||[\"\"],u=t.length;u--;)if(a=Xe.exec(t[u])||[],f=g=a[1],h=(a[2]||\"\").split(\".\").sort(),f){for(d=ae.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,p=s[f]||[],a=a[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),l=i=p.length;i--;)c=p[i],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||o&&o!==c.selector&&(\"**\"!==o||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||ae.removeEvent(e,f,m.handle),delete s[f])}else for(f in s)ae.event.remove(e,f+t[u],n,o,!0);ae.isEmptyObject(s)&&Pe.remove(e,\"handle events\")}},dispatch:function(e){var t,n,o,r,i,l,a=ae.event.fix(e),s=new Array(arguments.length),u=(Pe.get(this,\"events\")||{})[a.type]||[],c=ae.event.special[a.type]||{};for(s[0]=a,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(\"click\"!==e.type||!0!==u.disabled)){for(i=[],l={},n=0;n-1:ae.find(r,this,null,[u]).length),l[r]&&i.push(o);i.length&&a.push({elem:u,handlers:i})}return u=this,s\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,Ke=/\\s*$/g;ae.extend({htmlPrefilter:function(e){return e.replace(Ue,\"<$1>\")},clone:function(e,t,n){var o,r,i,l,a=e.cloneNode(!0),s=ae.contains(e.ownerDocument,e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ae.isXMLDoc(e)))for(l=m(a),i=m(e),o=0,r=i.length;o0&&v(l,!s&&m(e,\"script\")),a},cleanData:function(e){for(var t,n,o,r=ae.event.special,i=0;void 0!==(n=e[i]);i++)if(Te(n)){if(t=n[Pe.expando]){if(t.events)for(o in t.events)r[o]?ae.event.remove(n,o):ae.removeEvent(n,o,t.handle);n[Pe.expando]=void 0}n[De.expando]&&(n[De.expando]=void 0)}}}),ae.fn.extend({detach:function(e){return D(this,e,!0)},remove:function(e){return D(this,e)},text:function(e){return ke(this,function(e){return void 0===e?ae.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return P(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=R(this,e);t.appendChild(e)}})},prepend:function(){return P(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=R(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return P(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return P(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ae.cleanData(m(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ae.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if(\"string\"==typeof e&&!Ke.test(e)&&!Ve[(We.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=ae.htmlPrefilter(e);try{for(;n1)}}),ae.Tween=I,(I.prototype={constructor:I,init:function(e,t,n,o,r,i){this.elem=e,this.prop=n,this.easing=r||ae.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=i||(ae.cssNumber[n]?\"\":\"px\")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(e){var t,n=I.propHooks[this.prop];return this.options.duration?this.pos=t=ae.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}}).init.prototype=I.prototype,(I.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ae.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){ae.fx.step[e.prop]?ae.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ae.cssProps[e.prop]]&&!ae.cssHooks[e.prop]?e.elem[e.prop]=e.now:ae.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=I.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ae.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},ae.fx=I.prototype.init,ae.fx.step={};var at,st,ut=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;ae.Animation=ae.extend(V,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return f(n.elem,e,He.exec(t),n),n}]},tweener:function(e,t){ae.isFunction(e)?(t=e,e=[\"*\"]):e=e.match(Re);for(var n,o=0,r=e.length;o1)},removeAttr:function(e){return this.each(function(){ae.removeAttr(this,e)})}}),ae.extend({attr:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?ae.prop(e,t,n):(1===i&&ae.isXMLDoc(e)||(r=ae.attrHooks[t.toLowerCase()]||(ae.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void ae.removeAttr(e,t):r&&\"set\"in r&&void 0!==(o=r.set(e,n,t))?o:(e.setAttribute(t,n+\"\"),n):r&&\"get\"in r&&null!==(o=r.get(e,t))?o:null==(o=ae.find.attr(e,t))?void 0:o)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&\"radio\"===t&&r(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o=0,r=t&&t.match(Re);if(r&&1===e.nodeType)for(;n=r[o++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?ae.removeAttr(e,n):e.setAttribute(n,n),n}},ae.each(ae.expr.match.bool.source.match(/\\w+/g),function(e,t){var n=pt[t]||ae.find.attr;pt[t]=function(e,t,o){var r,i,l=t.toLowerCase();return o||(i=pt[l],pt[l]=r,r=null!=n(e,t,o)?l:null,pt[l]=i),r}});var ft=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;ae.fn.extend({prop:function(e,t){return ke(this,ae.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ae.propFix[e]||e]})}}),ae.extend({prop:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&ae.isXMLDoc(e)||(t=ae.propFix[t]||t,r=ae.propHooks[t]),void 0!==n?r&&\"set\"in r&&void 0!==(o=r.set(e,n,t))?o:e[t]=n:r&&\"get\"in r&&null!==(o=r.get(e,t))?o:e[t]},propHooks:{tabIndex:{get:function(e){var t=ae.find.attr(e,\"tabindex\");return t?parseInt(t,10):ft.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:\"htmlFor\",class:\"className\"}}),le.optSelected||(ae.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ae.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){ae.propFix[this.toLowerCase()]=this}),ae.fn.extend({addClass:function(e){var t,n,o,r,i,l,a,s=0;if(ae.isFunction(e))return this.each(function(t){ae(this).addClass(e.call(this,t,q(this)))});if(\"string\"==typeof e&&e)for(t=e.match(Re)||[];n=this[s++];)if(r=q(n),o=1===n.nodeType&&\" \"+B(r)+\" \"){for(l=0;i=t[l++];)o.indexOf(\" \"+i+\" \")<0&&(o+=i+\" \");a=B(o),r!==a&&n.setAttribute(\"class\",a)}return this},removeClass:function(e){var t,n,o,r,i,l,a,s=0;if(ae.isFunction(e))return this.each(function(t){ae(this).removeClass(e.call(this,t,q(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if(\"string\"==typeof e&&e)for(t=e.match(Re)||[];n=this[s++];)if(r=q(n),o=1===n.nodeType&&\" \"+B(r)+\" \"){for(l=0;i=t[l++];)for(;o.indexOf(\" \"+i+\" \")>-1;)o=o.replace(\" \"+i+\" \",\" \");a=B(o),r!==a&&n.setAttribute(\"class\",a)}return this},toggleClass:function(e,t){var n=typeof e;return\"boolean\"==typeof t&&\"string\"===n?t?this.addClass(e):this.removeClass(e):ae.isFunction(e)?this.each(function(n){ae(this).toggleClass(e.call(this,n,q(this),t),t)}):this.each(function(){var t,o,r,i;if(\"string\"===n)for(o=0,r=ae(this),i=e.match(Re)||[];t=i[o++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&\"boolean\"!==n||((t=q(this))&&Pe.set(this,\"__className__\",t),this.setAttribute&&this.setAttribute(\"class\",t||!1===e?\"\":Pe.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,o=0;for(t=\" \"+e+\" \";n=this[o++];)if(1===n.nodeType&&(\" \"+B(q(n))+\" \").indexOf(t)>-1)return!0;return!1}});var gt=/\\r/g;ae.fn.extend({val:function(e){var t,n,o,r=this[0];if(arguments.length)return o=ae.isFunction(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=o?e.call(this,n,ae(this).val()):e)?r=\"\":\"number\"==typeof r?r+=\"\":Array.isArray(r)&&(r=ae.map(r,function(e){return null==e?\"\":e+\"\"})),(t=ae.valHooks[this.type]||ae.valHooks[this.nodeName.toLowerCase()])&&\"set\"in t&&void 0!==t.set(this,r,\"value\")||(this.value=r))});if(r)return(t=ae.valHooks[r.type]||ae.valHooks[r.nodeName.toLowerCase()])&&\"get\"in t&&void 0!==(n=t.get(r,\"value\"))?n:\"string\"==typeof(n=r.value)?n.replace(gt,\"\"):null==n?\"\":n}}),ae.extend({valHooks:{option:{get:function(e){var t=ae.find.attr(e,\"value\");return null!=t?t:B(ae.text(e))}},select:{get:function(e){var t,n,o,i=e.options,l=e.selectedIndex,a=\"select-one\"===e.type,s=a?null:[],u=a?l+1:i.length;for(o=l<0?u:a?l:0;o-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),ae.each([\"radio\",\"checkbox\"],function(){ae.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=ae.inArray(ae(e).val(),t)>-1}},le.checkOn||(ae.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})});var mt=/^(?:focusinfocus|focusoutblur)$/;ae.extend(ae.event,{trigger:function(t,n,o,r){var i,l,a,s,u,c,d,p=[o||G],f=oe.call(t,\"type\")?t.type:t,h=oe.call(t,\"namespace\")?t.namespace.split(\".\"):[];if(l=a=o=o||G,3!==o.nodeType&&8!==o.nodeType&&!mt.test(f+ae.event.triggered)&&(f.indexOf(\".\")>-1&&(h=f.split(\".\"),f=h.shift(),h.sort()),u=f.indexOf(\":\")<0&&\"on\"+f,t=t[ae.expando]?t:new ae.Event(f,\"object\"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=h.join(\".\"),t.rnamespace=t.namespace?new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:ae.makeArray(n,[t]),d=ae.event.special[f]||{},r||!d.trigger||!1!==d.trigger.apply(o,n))){if(!r&&!d.noBubble&&!ae.isWindow(o)){for(s=d.delegateType||f,mt.test(s+f)||(l=l.parentNode);l;l=l.parentNode)p.push(l),a=l;a===(o.ownerDocument||G)&&p.push(a.defaultView||a.parentWindow||e)}for(i=0;(l=p[i++])&&!t.isPropagationStopped();)t.type=i>1?s:d.bindType||f,(c=(Pe.get(l,\"events\")||{})[t.type]&&Pe.get(l,\"handle\"))&&c.apply(l,n),(c=u&&l[u])&&c.apply&&Te(l)&&(t.result=c.apply(l,n),!1===t.result&&t.preventDefault());return t.type=f,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),n)||!Te(o)||u&&ae.isFunction(o[f])&&!ae.isWindow(o)&&((a=o[u])&&(o[u]=null),ae.event.triggered=f,o[f](),ae.event.triggered=void 0,a&&(o[u]=a)),t.result}},simulate:function(e,t,n){var o=ae.extend(new ae.Event,n,{type:e,isSimulated:!0});ae.event.trigger(o,null,t)}}),ae.fn.extend({trigger:function(e,t){return this.each(function(){ae.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ae.event.trigger(e,t,n,!0)}}),ae.each(\"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu\".split(\" \"),function(e,t){ae.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ae.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),le.focusin=\"onfocusin\"in e,le.focusin||ae.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){var n=function(e){ae.event.simulate(t,e.target,ae.event.fix(e))};ae.event.special[t]={setup:function(){var o=this.ownerDocument||this,r=Pe.access(o,t);r||o.addEventListener(e,n,!0),Pe.access(o,t,(r||0)+1)},teardown:function(){var o=this.ownerDocument||this,r=Pe.access(o,t)-1;r?Pe.access(o,t,r):(o.removeEventListener(e,n,!0),Pe.remove(o,t))}}});var vt=e.location,wt=ae.now(),yt=/\\?/;ae.parseXML=function(t){var n;if(!t||\"string\"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,\"text/xml\")}catch(e){n=void 0}return n&&!n.getElementsByTagName(\"parsererror\").length||ae.error(\"Invalid XML: \"+t),n};var Ct=/\\[\\]$/,bt=/\\r?\\n/g,xt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;ae.param=function(e,t){var n,o=[],r=function(e,t){var n=ae.isFunction(t)?t():t;o[o.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(Array.isArray(e)||e.jquery&&!ae.isPlainObject(e))ae.each(e,function(){r(this.name,this.value)});else for(n in e)O(n,e[n],t,r);return o.join(\"&\")},ae.fn.extend({serialize:function(){return ae.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ae.prop(this,\"elements\");return e?ae.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ae(this).is(\":disabled\")&&Rt.test(this.nodeName)&&!xt.test(e)&&(this.checked||!Me.test(e))}).map(function(e,t){var n=ae(this).val();return null==n?null:Array.isArray(n)?ae.map(n,function(e){return{name:t.name,value:e.replace(bt,\"\\r\\n\")}}):{name:t.name,value:n.replace(bt,\"\\r\\n\")}}).get()}});var St=/%20/g,Et=/#.*$/,kt=/([?&])_=[^&]*/,Tt=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,Pt=/^(?:GET|HEAD)$/,Dt=/^\\/\\//,Nt={},At={},$t=\"*/\".concat(\"*\"),Ht=G.createElement(\"a\");Ht.href=vt.href,ae.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:vt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(vt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":$t,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":JSON.parse,\"text xml\":ae.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?U(U(e,ae.ajaxSettings),t):U(ae.ajaxSettings,e)},ajaxPrefilter:z(Nt),ajaxTransport:z(At),ajax:function(t,n){function o(t,n,o,a){var u,p,f,C,b,x=n;c||(c=!0,s&&e.clearTimeout(s),r=void 0,l=a||\"\",R.readyState=t>0?4:0,u=t>=200&&t<300||304===t,o&&(C=function(e,t,n){var o,r,i,l,a=e.contents,s=e.dataTypes;for(;\"*\"===s[0];)s.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(o)for(r in a)if(a[r]&&a[r].test(o)){s.unshift(r);break}if(s[0]in n)i=s[0];else{for(r in n){if(!s[0]||e.converters[r+\" \"+s[0]]){i=r;break}l||(l=r)}i=i||l}if(i)return i!==s[0]&&s.unshift(i),n[i]}(h,R,o)),C=function(e,t,n,o){var r,i,l,a,s,u={},c=e.dataTypes.slice();if(c[1])for(l in e.converters)u[l.toLowerCase()]=e.converters[l];i=c.shift();for(;i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=c.shift())if(\"*\"===i)i=s;else if(\"*\"!==s&&s!==i){if(!(l=u[s+\" \"+i]||u[\"* \"+i]))for(r in u)if((a=r.split(\" \"))[1]===i&&(l=u[s+\" \"+a[0]]||u[\"* \"+a[0]])){!0===l?l=u[r]:!0!==u[r]&&(i=a[0],c.unshift(a[1]));break}if(!0!==l)if(l&&e.throws)t=l(t);else try{t=l(t)}catch(e){return{state:\"parsererror\",error:l?e:\"No conversion from \"+s+\" to \"+i}}}return{state:\"success\",data:t}}(h,C,R,u),u?(h.ifModified&&((b=R.getResponseHeader(\"Last-Modified\"))&&(ae.lastModified[i]=b),(b=R.getResponseHeader(\"etag\"))&&(ae.etag[i]=b)),204===t||\"HEAD\"===h.type?x=\"nocontent\":304===t?x=\"notmodified\":(x=C.state,p=C.data,f=C.error,u=!f)):(f=x,!t&&x||(x=\"error\",t<0&&(t=0))),R.status=t,R.statusText=(n||x)+\"\",u?v.resolveWith(g,[p,x,R]):v.rejectWith(g,[R,x,f]),R.statusCode(y),y=void 0,d&&m.trigger(u?\"ajaxSuccess\":\"ajaxError\",[R,h,u?p:f]),w.fireWith(g,[R,x]),d&&(m.trigger(\"ajaxComplete\",[R,h]),--ae.active||ae.event.trigger(\"ajaxStop\")))}\"object\"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,l,a,s,u,c,d,p,f,h=ae.ajaxSetup({},n),g=h.context||h,m=h.context&&(g.nodeType||g.jquery)?ae(g):ae.event,v=ae.Deferred(),w=ae.Callbacks(\"once memory\"),y=h.statusCode||{},C={},b={},x=\"canceled\",R={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Tt.exec(l);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?l:null},setRequestHeader:function(e,t){return null==c&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,C[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)R.always(e[R.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||x;return r&&r.abort(t),o(0,t),this}};if(v.promise(R),h.url=((t||h.url||vt.href)+\"\").replace(Dt,vt.protocol+\"//\"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||\"*\").toLowerCase().match(Re)||[\"\"],null==h.crossDomain){u=G.createElement(\"a\");try{u.href=h.url,u.href=u.href,h.crossDomain=Ht.protocol+\"//\"+Ht.host!=u.protocol+\"//\"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&\"string\"!=typeof h.data&&(h.data=ae.param(h.data,h.traditional)),X(Nt,h,n,R),c)return R;(d=ae.event&&h.global)&&0==ae.active++&&ae.event.trigger(\"ajaxStart\"),h.type=h.type.toUpperCase(),h.hasContent=!Pt.test(h.type),i=h.url.replace(Et,\"\"),h.hasContent?h.data&&h.processData&&0===(h.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(h.data=h.data.replace(St,\"+\")):(f=h.url.slice(i.length),h.data&&(i+=(yt.test(i)?\"&\":\"?\")+h.data,delete h.data),!1===h.cache&&(i=i.replace(kt,\"$1\"),f=(yt.test(i)?\"&\":\"?\")+\"_=\"+wt+++f),h.url=i+f),h.ifModified&&(ae.lastModified[i]&&R.setRequestHeader(\"If-Modified-Since\",ae.lastModified[i]),ae.etag[i]&&R.setRequestHeader(\"If-None-Match\",ae.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&R.setRequestHeader(\"Content-Type\",h.contentType),R.setRequestHeader(\"Accept\",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+(\"*\"!==h.dataTypes[0]?\", \"+$t+\"; q=0.01\":\"\"):h.accepts[\"*\"]);for(p in h.headers)R.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,R,h)||c))return R.abort();if(x=\"abort\",w.add(h.complete),R.done(h.success),R.fail(h.error),r=X(At,h,n,R)){if(R.readyState=1,d&&m.trigger(\"ajaxSend\",[R,h]),c)return R;h.async&&h.timeout>0&&(s=e.setTimeout(function(){R.abort(\"timeout\")},h.timeout));try{c=!1,r.send(C,o)}catch(e){if(c)throw e;o(-1,e)}}else o(-1,\"No Transport\");return R},getJSON:function(e,t,n){return ae.get(e,t,n,\"json\")},getScript:function(e,t){return ae.get(e,void 0,t,\"script\")}}),ae.each([\"get\",\"post\"],function(e,t){ae[t]=function(e,n,o,r){return ae.isFunction(n)&&(r=r||o,o=n,n=void 0),ae.ajax(ae.extend({url:e,type:t,dataType:r,data:n,success:o},ae.isPlainObject(e)&&e))}}),ae._evalUrl=function(e){return ae.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,throws:!0})},ae.fn.extend({wrapAll:function(e){var t;return this[0]&&(ae.isFunction(e)&&(e=e.call(this[0])),t=ae(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ae.isFunction(e)?this.each(function(t){ae(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ae(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ae.isFunction(e);return this.each(function(n){ae(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){ae(this).replaceWith(this.childNodes)}),this}}),ae.expr.pseudos.hidden=function(e){return!ae.expr.pseudos.visible(e)},ae.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ae.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Lt={0:200,1223:204},Ft=ae.ajaxSettings.xhr();le.cors=!!Ft&&\"withCredentials\"in Ft,le.ajax=Ft=!!Ft,ae.ajaxTransport(function(t){var n,o;if(le.cors||Ft&&!t.crossDomain)return{send:function(r,i){var l,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(l in t.xhrFields)a[l]=t.xhrFields[l];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r[\"X-Requested-With\"]||(r[\"X-Requested-With\"]=\"XMLHttpRequest\");for(l in r)a.setRequestHeader(l,r[l]);n=function(e){return function(){n&&(n=o=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,\"abort\"===e?a.abort():\"error\"===e?\"number\"!=typeof a.status?i(0,\"error\"):i(a.status,a.statusText):i(Lt[a.status]||a.status,a.statusText,\"text\"!==(a.responseType||\"text\")||\"string\"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),o=a.onerror=n(\"error\"),void 0!==a.onabort?a.onabort=o:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&o()})},n=n(\"abort\");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),ae.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ae.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(e){return ae.globalEval(e),e}}}),ae.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),ae.ajaxTransport(\"script\",function(e){if(e.crossDomain){var t,n;return{send:function(o,r){t=ae(\"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", " \n", " \n", "\n", "\n", "\n", "\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "import pandas as pd\n", "import scipy\n", "import xarray as xr\n", "\n", "import pymc3 as pm\n", "import theano.tensor as ttens\n", "import sklearn \n", "\n", "import bokeh\n", "import holoviews as hv\n", "import matplotlib.pyplot as plt\n", "\n", "hv.notebook_extension('bokeh')\n", "%matplotlib inline\n", "\n", "import warnings\n", "warnings.simplefilter(action='ignore', category=FutureWarning)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create some fake data." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "N = 100 # Number of data points in our idealised dataset\n", "means = np.array([ 0 , 0]) # Mean values for our bivariate normal distribution\n", "variances = np.array([1, 1]) # Variances for our bivariate normal distribution\n", "\n", "# We will generate datasets with correlation - which we call rho - that ranges from -1 to 1\n", "rho = 0.5\n", "\n", "covariances = np.array( [[variances[0]**2,rho*variances[0]*variances[1]],[rho*variances[0]*variances[1], variances[1]**2]])\n", "data = np.random.multivariate_normal( means, covariances, N)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Specify and compile a Stan model. This step make take a couple of minutes. You can go ahead and run the following cells while you wait so that you know when the compilation has finished." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "def correlation(x, y, \n", " mu_prior = {'mean': 0, 'sd': 1}, sigma_prior = {'sd':3}, \n", " rho_prior = {'lower':-1,'upper':1}):\n", " \"\"\"Get the correlation between x and y\n", " Inputs:\n", " x,y - numpy arrays/pandas series of same length\n", " priors for the parameters\n", " Ouputs:\n", " trace - PyMC3 output with results of inference\n", " rho_range - dictionary setting out mean rho and 95% range\n", " simulate_data - data simulated under the model\n", " output trace and summary dictionary\"\"\"\n", " # Check inputs are appropriate\n", " assert (len(x.shape)) & (len(y.shape)) == 1, \"x and y should be 1D arrays, but x has shape {} and y has shape {}\".format(x.shape, y.shape)\n", " assert len(x) == len(y), \"x and y should be same length but x is {} and y is {}\".format(len(x), len(y))\n", " assert ('mean' in mu_prior) and ('sd' in mu_prior), \"mu_prior should have keys 'mean' and 'sd' but has {}\".format(mu_prior.keys())\n", " assert 'sd' in sigma_prior, \"sigma_prior should have key 'sd' but has {}\".format(sigma_prior.keys())\n", " assert ('lower' in rho_prior) and ('upper' in rho_prior), \"mu_prior should have keys 'mean' and 'sd' but has {}\".format(mu_prior.keys())\n", " \n", " def covariance(sigma, rho):\n", " \"\"\"Create the covariance matrix from the array sigma and scalar rho\"\"\"\n", " C = ttens.alloc(rho, 2, 2)\n", " C = ttens.fill_diagonal(C, 1.)\n", " S = ttens.diag(sigma)\n", " return ttens.nlinalg.matrix_dot(S, C, S)\n", "\n", " data = np.array([x,y]) # Create a single array with the observed dataset\n", " with pm.Model() as model:\n", " # Specify the priors for the means\n", " mu = pm.Normal('mu', mu = mu_prior['mean'], sd = mu_prior['sd'], shape = 2) \n", " # Specify the priors for the variances\n", " sigma = pm.HalfNormal('sigma', sd = sigma_prior['sd'], shape = 2) \n", " # Specify the priors for rho\n", " BoundedNormal = pm.Bound(pm.Normal, lower=np.array(-1.0), upper = np.array(1.0))\n", " rho = BoundedNormal('rho', mu=0.0, sd=1.0, testval = 0.5)\n", " #rho = Uniform('rho', lower = rho_prior['lower'], upper = rho_prior['upper']) \n", " # Create the covariance matrix\n", " cov = pm.Deterministic('cov', covariance(sigma, rho)) \n", " # Specify the likelihood as a multi-variate normal distribution\n", " mult_n = pm.MvNormal('mult_n', mu = mu, cov = cov, observed = data.T) \n", " # Perform the inference and extract 1000 samples from the posterior distributions\n", " trace = pm.sample(draws = 1000) \n", " # Save some summary statistics for each value of rho\n", " rho_range = {'mean':trace.get_values('rho').mean(),\n", " '2.5':pm.stats.quantiles(trace)['rho'][2.5],\n", " '97.5':pm.stats.quantiles(trace)['rho'][97.5]}\n", " # Simulate data from the model\n", " simulate_data = pm.sample_ppc(trace=trace,model=model)\n", " return trace, rho_range, simulate_data\n" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Auto-assigning NUTS sampler...\n", "INFO:pymc3:Auto-assigning NUTS sampler...\n", "Initializing NUTS using jitter+adapt_diag...\n", "INFO:pymc3:Initializing NUTS using jitter+adapt_diag...\n", "100%|██████████| 1500/1500 [00:22<00:00, 67.59it/s]\n", "100%|██████████| 1000/1000 [00:01<00:00, 766.35it/s]\n" ] } ], "source": [ "trace,out_dict, ppc = correlation(data[:,0],data[:,1]) " ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1000, 2)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ppc['mult_n'].shape" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "
\n", "
\n", "
\n", "\n", "
" ], "text/plain": [ ":AdjointLayout\n", " :Overlay\n", " .Scatter.Simulated_data :Scatter [x] (y)\n", " .Scatter.Real_data :Scatter [x] (y)\n", " :Overlay\n", " .Histogram.Simulated_data :Histogram [y] (y_frequency)\n", " .Histogram.Real_data :Histogram [y] (y_frequency)\n", " :Overlay\n", " .Histogram.Simulated_data :Histogram [x] (x_frequency)\n", " .Histogram.Real_data :Histogram [x] (x_frequency)" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%%output size=120\n", "%%opts Scatter (size=7,alpha=0.2) \n", "%%opts Histogram (alpha=0.5) \n", "\n", "# Set legend position\n", "opts = {'Overlay': {'plot': dict(legend_position='top_left')}}\n", "# Plot simulated model data\n", "model_scatter = hv.Scatter(ppc['mult_n'],kdims=['x'], vdims=['y'], label = 'Simulated data')\n", "# Plot real data\n", "data_scatter = hv.Scatter((data[:,0],data[:,1]),kdims=['x'], vdims=['y'], label = 'Real data')\n", "# Combine simulated and real data\n", "overlay = model_scatter.hist(dimension=['x','y'])*data_scatter.hist(dimension=['x','y'])\n", "# Output plot\n", "overlay(opts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You should see a scatter plot with two histograms" ] } ], "metadata": { "kernelspec": { "display_name": "pbayes", "language": "python", "name": "pbayes" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }