Skip to content

Instantly share code, notes, and snippets.

@crstn
Created May 2, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crstn/9d38a10e46b4b5251aae927b6b6b5753 to your computer and use it in GitHub Desktop.
Save crstn/9d38a10e46b4b5251aae927b6b6b5753 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Testing Bokeh/Datashader with our population simulations, based on [this tutorial](http://datashader.org/topics/landsat.html)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"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[toinsert.length - 1].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[toinsert.length - 1].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[toinsert.length - 1]);\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",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\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",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\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,i){var n={},r=function(i){var o=null!=e[i]?e[i]:i;if(!n[o]){if(!t[o]){var s=new Error(\"Cannot find module '\"+i+\"'\");throw s.code=\"MODULE_NOT_FOUND\",s}var a=n[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return n[o].exports},o=r(52);return o.require=r,o.register_plugin=function(i,n,s){for(var a in i)t[a]=i[a];for(var a in n)e[a]=n[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,i){var n=t(142),r=t(32);i.overrides={};var o=r.clone(n);i.Models=function(t){var e=i.overrides[t]||o[t];if(null==e)throw new Error(\"Model '\"+t+\"' does not exist. This could be due to a widget\\n or a custom model not being registered before first usage.\");return e},i.Models.register=function(t,e){i.overrides[t]=e},i.Models.unregister=function(t){delete i.overrides[t]},i.Models.register_models=function(t,e,i){if(void 0===e&&(e=!1),null!=t)for(var n in t){var r=t[n];e||!o.hasOwnProperty(n)?o[n]=r:null!=i?i(n):console.warn(\"Model '\"+n+\"' was already registered\")}},i.register_models=i.Models.register_models,i.Models.registered_names=function(){return Object.keys(o)},i.index={}},function(t,e,i){var n=t(317),r=t(14),o=t(50),s=t(260),a=t(261),l=t(2);i.DEFAULT_SERVER_WEBSOCKET_URL=\"ws://localhost:5006/ws\",i.DEFAULT_SESSION_ID=\"default\";var h=0,c=function(){function t(t,e,n,o,s){void 0===t&&(t=i.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=i.DEFAULT_SESSION_ID),void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=n,this._on_have_session_hook=o,this._on_closed_permanently_hook=s,this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new a.Receiver,r.logger.debug(\"Creating websocket \"+this._number+\" to '\"+this.url+\"' session '\"+this.id+\"'\")}return t.prototype.connect=function(){var t=this;if(this.closed_permanently)return n.Promise.reject(new Error(\"Cannot connect() a closed ClientConnection\"));if(null!=this.socket)return n.Promise.reject(new Error(\"Already connected\"));this._pending_replies={},this._current_handler=null;try{var e=this.url+\"?bokeh-protocol-version=1.0&bokeh-session-id=\"+this.id;return null!=this.args_string&&this.args_string.length>0&&(e+=\"&\"+this.args_string),this.socket=new WebSocket(e),new n.Promise(function(e,i){t.socket.binaryType=\"arraybuffer\",t.socket.onopen=function(){return t._on_open(e,i)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(i)}})}catch(t){return r.logger.error(\"websocket creation failed to url: \"+this.url),r.logger.error(\" - \"+t),n.Promise.reject(t)}},t.prototype.close=function(){this.closed_permanently||(r.logger.debug(\"Permanently closing websocket connection \"+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,\"close method called on ClientConnection \"+this._number),this.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this;setTimeout(function(){e.closed_permanently||r.logger.info(\"Websocket connection \"+e._number+\" disconnected, will not attempt to reconnect\");return},t)},t.prototype.send=function(t){if(null==this.socket)throw new Error(\"not connected so cannot send \"+t);t.send(this.socket)},t.prototype.send_with_reply=function(t){var e=this,i=new n.Promise(function(i,n){e._pending_replies[t.msgid()]=[i,n],e.send(t)});return i.then(function(t){if(\"ERROR\"===t.msgtype())throw new Error(\"Error reply \"+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t=s.Message.create(\"PULL-DOC-REQ\",{}),e=this.send_with_reply(t);return e.then(function(t){if(!(\"doc\"in t.content))throw new Error(\"No 'doc' field in PULL-DOC-REPLY\");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){var t=this;null==this.session?r.logger.debug(\"Pulling session for first time\"):r.logger.debug(\"Repulling session\"),this._pull_doc_json().then(function(e){if(null==t.session)if(t.closed_permanently)r.logger.debug(\"Got new document after connection was already closed\");else{var i=o.Document.from_json(e),n=o.Document._compute_patch_since_json(e,i);if(n.events.length>0){r.logger.debug(\"Sending \"+n.events.length+\" changes from model construction back to server\");var a=s.Message.create(\"PATCH-DOC\",{},n);t.send(a)}t.session=new l.ClientSession(t,i,t.id),r.logger.debug(\"Created a new session from new pulled doc\"),null!=t._on_have_session_hook&&(t._on_have_session_hook(t.session),t._on_have_session_hook=null)}else t.session.document.replace_with_json(e),r.logger.debug(\"Updated existing session with new pulled doc\")},function(t){throw t}).catch(function(t){null!=console.trace&&console.trace(t),r.logger.error(\"Failed to repull session \"+t)})},t.prototype._on_open=function(t,e){var i=this;r.logger.info(\"Websocket connection \"+this._number+\" is now open\"),this._pending_ack=[t,e],this._current_handler=function(t){i._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&r.logger.error(\"Got a message with no current handler set\");try{this._receiver.consume(t.data)}catch(t){this._close_bad_protocol(t.toString())}if(null!=this._receiver.message){var e=this._receiver.message,i=e.problem();null!=i&&this._close_bad_protocol(i),this._current_handler(e)}},t.prototype._on_close=function(t){var e=this;r.logger.info(\"Lost websocket \"+this._number+\" connection, \"+t.code+\" (\"+t.reason+\")\"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error(\"Lost websocket connection, \"+t.code+\" (\"+t.reason+\")\")),this._pending_ack=null);for(var i=function(){for(var t in e._pending_replies){var i=e._pending_replies[t];return delete e._pending_replies[t],i}return null},n=i();null!=n;)n[1](\"Disconnected\"),n=i();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){r.logger.debug(\"Websocket error on socket \"+this._number),t(new Error(\"Could not open websocket\"))},t.prototype._close_bad_protocol=function(t){r.logger.error(\"Closing connection: \"+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;\"ACK\"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol(\"First message was not an ACK\")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();i.ClientConnection=c,i.pull_session=function(t,e,i){return new n.Promise(function(n,o){return new c(t,e,i,function(t){try{n(t)}catch(e){throw r.logger.error(\"Promise handler threw an error, closing session \"+e),t.close(),e}},function(){o(new Error(\"Connection was closed before we successfully pulled a session\"))}).connect().then(function(t){},function(t){throw r.logger.error(\"Failed to connect to Bokeh server \"+t),t})})}},function(t,e,i){var n=t(14),r=t(50),o=t(260),s=function(){function t(t,e,i){var n=this;this._connection=t,this.document=e,this.id=i,this._document_listener=function(t){return n._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();\"PATCH-DOC\"===e?this._handle_patch(t):\"OK\"===e?this._handle_ok(t):\"ERROR\"===e?this._handle_error(t):n.logger.debug(\"Doing nothing with message \"+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create(\"EVENT\",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create(\"SERVER-INFO-REQ\",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create(\"PATCH-DOC\",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){n.logger.trace(\"Unhandled OK reply to \"+t.reqid())},t.prototype._handle_error=function(t){n.logger.error(\"Unhandled ERROR reply to \"+t.reqid()+\": \"+t.content.text)},t}();i.ClientSession=s},function(t,e,i){function n(t){return function(e){e.prototype.event_name=t,a[t]=e}}var r=t(379),o=t(14),s=t(32),a={};i.register_event_class=n,i.register_with_event=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=t.prototype.applicable_models.concat(e);t.prototype.applicable_models=n};var l=function(){function t(t){void 0===t&&(t={}),this.model_id=null,this._options=t,t.model_id&&(this.model_id=t.model_id)}return t.prototype.set_model_id=function(t){return this._options.model_id=t,this.model_id=t,this},t.prototype.is_applicable_to=function(t){return this.applicable_models.some(function(e){return t instanceof e})},t.event_class=function(t){if(t.type)return a[t.type];o.logger.warn(\"BokehEvent.event_class required events with a string type attribute\")},t.prototype.toJSON=function(){return{event_name:this.event_name,event_values:s.clone(this._options)}},t.prototype._customize_event=function(t){return this},t}();i.BokehEvent=l,l.prototype.applicable_models=[];var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"button_click\")],e)}(l);i.ButtonClick=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(l);i.UIEvent=c;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"lodstart\")],e)}(c);i.LODStart=u;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"lodend\")],e)}(c);i.LODEnd=_;var p=function(t){function e(e){var i=t.call(this,e)||this;return i.geometry=e.geometry,i.final=e.final,i}return r.__extends(e,t),e=r.__decorate([n(\"selectiongeometry\")],e)}(c);i.SelectionGeometry=p;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"reset\")],e)}(c);i.Reset=d;var f=function(t){function e(e){var i=t.call(this,e)||this;return i.sx=e.sx,i.sy=e.sy,i.x=null,i.y=null,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,model_id:e})},e.prototype._customize_event=function(t){var e=t.plot_canvas.frame.xscales.default,i=t.plot_canvas.frame.yscales.default;return this.x=e.invert(this.sx),this.y=i.invert(this.sy),this._options.x=this.x,this._options.y=this.y,this},e}(c);i.PointEvent=f;var v=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.delta_x=e.delta_x,i.delta_y=e.delta_y,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta_x:t.deltaX,delta_y:t.deltaY,direction:t.direction,model_id:e})},e=r.__decorate([n(\"pan\")],e)}(f);i.Pan=v;var m=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.scale=e.scale,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,scale:t.scale,model_id:e})},e=r.__decorate([n(\"pinch\")],e)}(f);i.Pinch=m;var g=function(t){function e(e){void 0===e&&(e={});var i=t.call(this,e)||this;return i.delta=e.delta,i}return r.__extends(e,t),e.from_event=function(t,e){return void 0===e&&(e=null),new this({sx:t.sx,sy:t.sy,delta:t.delta,model_id:e})},e=r.__decorate([n(\"wheel\")],e)}(f);i.MouseWheel=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"mousemove\")],e)}(f);i.MouseMove=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"mouseenter\")],e)}(f);i.MouseEnter=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"mouseleave\")],e)}(f);i.MouseLeave=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"tap\")],e)}(f);i.Tap=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"doubletap\")],e)}(f);i.DoubleTap=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"press\")],e)}(f);i.Press=S;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"panstart\")],e)}(f);i.PanStart=C;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"panend\")],e)}(f);i.PanEnd=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"pinchstart\")],e)}(f);i.PinchStart=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e=r.__decorate([n(\"pinchend\")],e)}(f);i.PinchEnd=E},function(t,e,i){var n=t(21),r=t(32);i.build_views=function(t,e,i,o){void 0===o&&(o=function(t){return t.default_view});for(var s=0,a=n.difference(Object.keys(t),e.map(function(t){return t.id}));s<a.length;s++){var l=a[s];t[l].remove(),delete t[l]}for(var h=[],c=0,u=e.filter(function(e){return null==t[e.id]});c<u.length;c++){var _=u[c],p=o(_),d=r.extend({},i,{model:_,connect_signals:!1}),f=new p(d);t[_.id]=f,h.push(f)}for(var v=0,m=h;v<m.length;v++){var f=m[v];f.connect_signals()}return h},i.remove_views=function(t){for(var e in t)t[e].remove(),delete t[e]}},function(t,e,i){function n(t,e){var i=Element.prototype,n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;return n.call(t,e)}var r=t(44),o=function(t){return function(e){function i(t){if(t instanceof HTMLElement)s.appendChild(t);else if(r.isString(t))s.appendChild(document.createTextNode(t));else if(null!=t&&!1!==t)throw new Error(\"expected an HTMLElement, string, false or null, got \"+JSON.stringify(t))}void 0===e&&(e={});for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var s=document.createElement(t);for(var a in e){var l=e[a];if(null!=l&&(!r.isBoolean(l)||l))if(\"class\"===a&&r.isArray(l))for(var h=0,c=l;h<c.length;h++){var u=c[h];null!=u&&s.classList.add(u)}else if(\"style\"===a&&r.isObject(l))for(var _ in l)s.style[_]=l[_];else if(\"data\"===a&&r.isObject(l))for(var p in l)s.dataset[p]=l[p];else s.setAttribute(a,l)}for(var d=0,f=n;d<f.length;d++){var v=f[d];if(r.isArray(v))for(var m=0,g=v;m<g.length;m++){var y=g[m];i(y)}else i(v)}return s}};i.createElement=function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return o(t).apply(void 0,[e].concat(i))},i.div=o(\"div\"),i.span=o(\"span\"),i.link=o(\"link\"),i.style=o(\"style\"),i.a=o(\"a\"),i.p=o(\"p\"),i.i=o(\"i\"),i.pre=o(\"pre\"),i.button=o(\"button\"),i.label=o(\"label\"),i.input=o(\"input\"),i.select=o(\"select\"),i.option=o(\"option\"),i.optgroup=o(\"optgroup\"),i.textarea=o(\"textarea\"),i.canvas=o(\"canvas\"),i.ul=o(\"ul\"),i.ol=o(\"ol\"),i.li=o(\"li\"),i.nbsp=document.createTextNode(\" \"),i.removeElement=function(t){var e=t.parentNode;null!=e&&e.removeChild(t)},i.replaceWith=function(t,e){var i=t.parentNode;null!=i&&i.replaceChild(e,t)},i.prepend=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.firstChild,r=0,o=e;r<o.length;r++){var s=o[r];t.insertBefore(s,n)}},i.empty=function(t){var e;for(;e=t.firstChild;)t.removeChild(e)},i.show=function(t){t.style.display=\"\"},i.hide=function(t){t.style.display=\"none\"},i.position=function(t){return{top:t.offsetTop,left:t.offsetLeft}},i.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},i.matches=n,i.parent=function(t,e){var i=t;for(;i=i.parentElement;)if(n(i,e))return i;return null},i.margin=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.marginTop)||0,bottom:parseFloat(e.marginBottom)||0,left:parseFloat(e.marginLeft)||0,right:parseFloat(e.marginRight)||0}},i.padding=function(t){var e=getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0,right:parseFloat(e.paddingRight)||0}};!function(t){t[t.Backspace=8]=\"Backspace\",t[t.Tab=9]=\"Tab\",t[t.Enter=13]=\"Enter\",t[t.Esc=27]=\"Esc\",t[t.PageUp=33]=\"PageUp\",t[t.PageDown=34]=\"PageDown\",t[t.Left=37]=\"Left\",t[t.Up=38]=\"Up\",t[t.Right=39]=\"Right\",t[t.Down=40]=\"Down\",t[t.Delete=46]=\"Delete\"}(i.Keys||(i.Keys={}))},function(t,e,i){var n=t(379),r=t(48),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._has_finished=!1,this.el=this._createElement()},e.prototype.remove=function(){o.removeElement(this.el),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return[]},Object.defineProperty(e.prototype,\"cursor\",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.layout=function(){},e.prototype.render=function(){},e.prototype.renderTo=function(t,e){void 0===e&&(e=!1),e?o.replaceWith(t,this.el):t.appendChild(this.el),this.layout()},e.prototype.has_finished=function(){return this._has_finished},Object.defineProperty(e.prototype,\"_root_element\",{get:function(){return o.parent(this.el,\".bk-root\")||document.body},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"solver\",{get:function(){return this.is_root?this._solver:this.parent.solver},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_idle\",{get:function(){return this.has_finished()},enumerable:!0,configurable:!0}),e.prototype._createElement=function(){return o.createElement(this.tagName,{id:this.id,class:this.css_classes()})},e}(r.View);i.DOMView=s,s.prototype.tagName=\"div\"},function(t,e,i){i.AngleUnits=[\"deg\",\"rad\"],i.Dimension=[\"width\",\"height\"],i.Dimensions=[\"width\",\"height\",\"both\"],i.Direction=[\"clock\",\"anticlock\"],i.FontStyle=[\"normal\",\"italic\",\"bold\"],i.LatLon=[\"lat\",\"lon\"],i.LineCap=[\"butt\",\"round\",\"square\"],i.LineJoin=[\"miter\",\"round\",\"bevel\"],i.Location=[\"above\",\"below\",\"left\",\"right\"],i.LegendClickPolicy=[\"none\",\"hide\",\"mute\"],i.LegendLocation=[\"top_left\",\"top_center\",\"top_right\",\"center_left\",\"center\",\"center_right\",\"bottom_left\",\"bottom_center\",\"bottom_right\"],i.Anchor=i.LegendLocation,i.Orientation=[\"vertical\",\"horizontal\"],i.OutputBackend=[\"canvas\",\"svg\",\"webgl\"],i.RenderLevel=[\"image\",\"underlay\",\"glyph\",\"annotation\",\"overlay\"],i.RenderMode=[\"canvas\",\"css\"],i.Side=[\"above\",\"below\",\"left\",\"right\"],i.Place=[\"above\",\"below\",\"left\",\"right\",\"center\"],i.SpatialUnits=[\"screen\",\"data\"],i.StartEnd=[\"start\",\"end\"],i.VerticalAlign=[\"top\",\"middle\",\"bottom\"],i.TextAlign=[\"left\",\"right\",\"center\"],i.TextBaseline=[\"top\",\"middle\",\"bottom\",\"alphabetic\",\"hanging\",\"ideographic\"],i.TooltipAttachment=[\"horizontal\",\"vertical\",\"left\",\"right\",\"above\",\"below\"],i.Distribution=[\"uniform\",\"normal\"],i.StepMode=[\"after\",\"before\",\"center\"],i.SizingMode=[\"stretch_both\",\"scale_width\",\"scale_height\",\"scale_both\",\"fixed\"],i.PaddingUnits=[\"percent\",\"absolute\"],i.SliderCallbackPolicy=[\"continuous\",\"throttle\",\"mouseup\"],i.RoundingFunction=[\"round\",\"nearest\",\"floor\",\"rounddown\",\"ceil\",\"roundup\"],i.UpdateMode=[\"replace\",\"append\"],i.HTTPMethod=[\"POST\",\"GET\"],i.Logo=[\"normal\",\"grey\"]},function(t,e,i){var n=t(379),r=t(19),o=t(16),s=t(34),a=t(15),l=t(38),h=t(21),c=t(32),u=t(44),_=t(30),p=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;i._subtype=void 0,i.document=null,i.destroyed=new r.Signal0(i,\"destroyed\"),i.change=new r.Signal0(i,\"change\"),i.transformchange=new r.Signal0(i,\"transformchange\"),i.attributes={},i.properties={},i._set_after_defaults={},i._pending=!1,i._changing=!1;for(var n in i.props){var o=i.props[n],s=o.type,a=o.default_value;if(null==s)throw new Error(\"undefined property type for \"+i.type+\".\"+n);i.properties[n]=new s(i,n,a)}null==e.id&&i.setv({id:l.uniqueId()},{silent:!0});var h=e.__deferred__||!1;return h&&delete(e=c.clone(e)).__deferred__,i.setv(e,{silent:!0}),h||i.finalize(),i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"HasProps\",this.prototype.props={},this.prototype.mixins=[],this.define({id:[a.Any]})},e._fix_default=function(t,e){return void 0===t?void 0:u.isFunction(t)?t:u.isObject(t)?u.isArray(t)?function(){return h.copy(t)}:function(){return c.clone(t)}:function(){return t}},e.define=function(t){var e=function(e){var n=t[e];if(null!=i.prototype.props[e])throw new Error(\"attempted to redefine property '\"+i.prototype.type+\".\"+e+\"'\");if(null!=i.prototype[e])throw new Error(\"attempted to redefine attribute '\"+i.prototype.type+\".\"+e+\"'\");Object.defineProperty(i.prototype,e,{get:function(){var t=this.getv(e);return t},set:function(t){return this.setv((i={},i[e]=t,i)),this;var i},configurable:!1,enumerable:!0});var r=n[0],o=n[1],s=n[2],a={type:r,default_value:i._fix_default(o,e),internal:s||!1},l=c.clone(i.prototype.props);l[e]=a,i.prototype.props=l},i=this;for(var n in t)e(n)},e.internal=function(t){var e={};for(var i in t){var n=t[i],r=n[0],o=n[1];e[i]=[r,o,!0]}this.define(e)},e.mixin=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.define(o.create(t));var i=this.prototype.mixins.concat(t);this.prototype.mixins=i},e.mixins=function(t){this.mixin.apply(this,t)},e.override=function(t){for(var e in t){var i=this._fix_default(t[e],e),n=this.prototype.props[e];if(null==n)throw new Error(\"attempted to override nonexistent '\"+this.prototype.type+\".\"+e+\"'\");var r=c.clone(this.prototype.props);r[e]=c.extend({},n,{default_value:i}),this.prototype.props=r}},e.prototype.toString=function(){return this.type+\"(\"+this.id+\")\"},e.prototype.finalize=function(){var t=this;for(var e in this.properties){var i=this.properties[e];i.update(),null!=i.spec.transform&&this.connect(i.spec.transform.change,function(){return t.transformchange.emit()})}this.initialize(),this.connect_signals()},e.prototype.initialize=function(){},e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.destroy=function(){this.disconnect_signals(),this.destroyed.emit()},e.prototype.clone=function(){return new this.constructor(this.attributes)},e.prototype._setv=function(t,e){var i=e.check_eq,n=e.silent,r=[],o=this._changing;this._changing=!0;var s=this.attributes;for(var a in t){var l=t[a];!1!==i?_.isEqual(s[a],l)||r.push(a):r.push(a),s[a]=l}if(!n){r.length>0&&(this._pending=!0);for(var h=0;h<r.length;h++)this.properties[r[h]].change.emit()}if(!o){if(!n&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}},e.prototype.setv=function(t,e){void 0===e&&(e={});for(var i in t)if(t.hasOwnProperty(i)){var n=i;if(null==this.props[n])throw new Error(\"property \"+this.type+\".\"+n+\" wasn't declared\");null!=e&&e.defaults||(this._set_after_defaults[i]=!0)}if(!c.isEmpty(t)){var r={};for(var i in t)r[i]=this.getv(i);this._setv(t,e);var o=e.silent;if(null==o||!o)for(var i in t)this._tell_document_about_change(i,r[i],this.getv(i),e)}},e.prototype.getv=function(t){if(null==this.props[t])throw new Error(\"property \"+this.type+\".\"+t+\" wasn't declared\");return this.attributes[t]},e.prototype.ref=function(){return s.create_ref(this)},e.prototype.set_subtype=function(t){this._subtype=t},e.prototype.attribute_is_serializable=function(t){var e=this.props[t];if(null==e)throw new Error(this.type+\".attribute_is_serializable('\"+t+\"'): \"+t+\" wasn't declared\");return!e.internal},e.prototype.serializable_attributes=function(){var t={};for(var e in this.attributes){var i=this.attributes[e];this.attribute_is_serializable(e)&&(t[e]=i)}return t},e._value_to_json=function(t,i,n){if(i instanceof e)return i.ref();if(u.isArray(i)){for(var r=[],o=0;o<i.length;o++){var s=i[o];r.push(e._value_to_json(o.toString(),s,i))}return r}if(u.isObject(i)){var a={};for(var l in i)i.hasOwnProperty(l)&&(a[l]=e._value_to_json(l,i[l],i));return a}return i},e.prototype.attributes_as_json=function(t,i){void 0===t&&(t=!0),void 0===i&&(i=e._value_to_json);var n=this.serializable_attributes(),r={};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o];t?r[o]=s:o in this._set_after_defaults&&(r[o]=s)}return i(\"attributes\",r,this)},e._json_record_references=function(t,i,n,r){if(null==i);else if(s.is_ref(i)){if(!(i.id in n)){var o=t.get_model_by_id(i.id);e._value_record_references(o,n,r)}}else if(u.isArray(i))for(var a=0,l=i;a<l.length;a++){var h=l[a];e._json_record_references(t,h,n,r)}else if(u.isObject(i))for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];e._json_record_references(t,h,n,r)}},e._value_record_references=function(t,i,n){if(null==t);else if(t instanceof e){if(!(t.id in i)&&(i[t.id]=t,n))for(var r=t._immediate_references(),o=0,s=r;o<s.length;o++){var a=s[o];e._value_record_references(a,i,!0)}}else if(t.buffer instanceof ArrayBuffer);else if(u.isArray(t))for(var l=0,h=t;l<h.length;l++){var c=h[l];e._value_record_references(c,i,n)}else if(u.isObject(t))for(var _ in t)if(t.hasOwnProperty(_)){var c=t[_];e._value_record_references(c,i,n)}},e.prototype._immediate_references=function(){var t={},i=this.serializable_attributes();for(var n in i){var r=i[n];e._value_record_references(r,t,!1)}return c.values(t)},e.prototype.references=function(){var t={};return e._value_record_references(this,t,!0),c.values(t)},e.prototype._doc_attached=function(){},e.prototype.attach_document=function(t){if(null!=this.document&&this.document!=t)throw new Error(\"models must be owned by only a single document\");this.document=t,this._doc_attached()},e.prototype.detach_document=function(){this.document=null},e.prototype._tell_document_about_change=function(t,i,n,r){if(this.attribute_is_serializable(t)&&null!=this.document){var o={};e._value_record_references(n,o,!1);var s={};e._value_record_references(i,s,!1);var a=!1;for(var l in o)if(!(l in s)){a=!0;break}if(!a)for(var h in s)if(!(h in o)){a=!0;break}a&&this.document._invalidate_all_models(),this.document._notify_change(this,t,i,n,r)}},e.prototype.materialize_dataspecs=function(t){var e={};for(var i in this.properties){var n=this.properties[i];n.dataspec&&((!n.optional||null!=n.spec.value||i in this._set_after_defaults)&&(e[\"_\"+i]=n.array(t),null!=n.spec.field&&n.spec.field in t._shapes&&(e[\"_\"+i+\"_shape\"]=t._shapes[n.spec.field]),n instanceof a.Distance&&(e[\"max_\"+i]=h.max(e[\"_\"+i]))))}return e},e}(r.Signalable());i.HasProps=p,p.initClass()},function(t,e,i){function n(t){return t*t}function r(t,e){return n(t.x-e.x)+n(t.y-e.y)}function o(t,e,i){var n=r(e,i);if(0==n)return r(t,e);var o=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;if(o<0)return r(t,e);if(o>1)return r(t,i);var s={x:e.x+o*(i.x-e.x),y:e.y+o*(i.y-e.y)};return r(t,s)}var s=t(21),a=t(181);i.point_in_poly=function(t,e,i,n){for(var r=!1,o=i[i.length-1],s=n[n.length-1],a=0;a<i.length;a++){var l=i[a],h=n[a];s<e!=h<e&&o+(e-s)/(h-s)*(l-o)<t&&(r=!r),o=l,s=h}return r},i.create_empty_hit_test_result=function(){return new a.Selection},i.create_hit_test_result_from_hits=function(t){var e=new a.Selection;return e.indices=s.sortBy(t,function(t){return t[0],t[1]}).map(function(t){var e=t[0];return t[1],e}),e},i.validate_bbox_coords=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1];i>n&&(s=[n,i],i=s[0],n=s[1]);r>o&&(a=[o,r],r=a[0],o=a[1]);return{minX:i,minY:r,maxX:n,maxY:o};var s,a},i.dist_2_pts=r,i.dist_to_segment_squared=o,i.dist_to_segment=function(t,e,i){return Math.sqrt(o(t,e,i))},i.check_2_segments_intersect=function(t,e,i,n,r,o,s,a){var l=(a-o)*(i-t)-(s-r)*(n-e);if(0==l)return{hit:!1,x:null,y:null};var h=e-o,c=t-r,u=(s-r)*h-(a-o)*c,_=(i-t)*h-(n-e)*c;c=_/l;var p=t+(h=u/l)*(i-t),d=e+h*(n-e);return{hit:h>0&&h<1&&c>0&&c<1,x:p,y:d}}},function(t,e,i){var n=t(13),r=t(21);i.vstack=function(t,e){var i=[];if(e.length>0){i.push(n.EQ(r.head(e)._bottom,[-1,t._bottom])),i.push(n.EQ(r.tail(e)._top,[-1,t._top])),i.push.apply(i,r.pairwise(e,function(t,e){return n.EQ(t._top,[-1,e._bottom])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];i.push(n.EQ(a._left,[-1,t._left])),i.push(n.EQ(a._right,[-1,t._right]))}}return i},i.hstack=function(t,e){var i=[];if(e.length>0){i.push(n.EQ(r.head(e)._right,[-1,t._right])),i.push(n.EQ(r.tail(e)._left,[-1,t._left])),i.push.apply(i,r.pairwise(e,function(t,e){return n.EQ(t._left,[-1,e._right])}));for(var o=0,s=e;o<s.length;o++){var a=s[o];i.push(n.EQ(a._top,[-1,t._top])),i.push(n.EQ(a._bottom,[-1,t._bottom]))}}return i}},function(t,e,i){var n=t(379),r=t(13),o=t(8),s=t(24),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LayoutCanvas\"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._top=new r.Variable(this.toString()+\".top\"),this._left=new r.Variable(this.toString()+\".left\"),this._width=new r.Variable(this.toString()+\".width\"),this._height=new r.Variable(this.toString()+\".height\"),this._right=new r.Variable(this.toString()+\".right\"),this._bottom=new r.Variable(this.toString()+\".bottom\"),this._hcenter=new r.Variable(this.toString()+\".hcenter\"),this._vcenter=new r.Variable(this.toString()+\".vcenter\")},e.prototype.get_editables=function(){return[]},e.prototype.get_constraints=function(){return[r.GE(this._top),r.GE(this._bottom),r.GE(this._left),r.GE(this._right),r.GE(this._width),r.GE(this._height),r.EQ(this._left,this._width,[-1,this._right]),r.EQ(this._top,this._height,[-1,this._bottom]),r.EQ([2,this._hcenter],[-1,this._left],[-1,this._right]),r.EQ([2,this._vcenter],[-1,this._top],[-1,this._bottom])]},e.prototype.get_layoutable_children=function(){return[]},Object.defineProperty(e.prototype,\"bbox\",{get:function(){return new s.BBox({x0:this._left.value,y0:this._top.value,x1:this._right.value,y1:this._bottom.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"layout_bbox\",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,hcenter:this._hcenter.value,vcenter:this._vcenter.value}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"xview\",{get:function(){var t=this;return{compute:function(e){return t._left.value+e},v_compute:function(e){for(var i=new Float64Array(e.length),n=t._left.value,r=0;r<e.length;r++)i[r]=n+e[r];return i}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"yview\",{get:function(){var t=this;return{compute:function(e){return t._bottom.value-e},v_compute:function(e){for(var i=new Float64Array(e.length),n=t._bottom.value,r=0;r<e.length;r++)i[r]=n-e[r];return i}}},enumerable:!0,configurable:!0}),e}(o.HasProps);i.LayoutCanvas=a,a.initClass()},function(t,e,i){function n(t){return\"panel\"in t}var r=t(379),o=t(13),s=t(11),a=t(15),l=t(14),h=t(44),c=Math.PI/2,u=\"alphabetic\",_=\"center\",p={above:{parallel:0,normal:-c,horizontal:0,vertical:-c},below:{parallel:0,normal:c,horizontal:0,vertical:c},left:{parallel:-c,normal:0,horizontal:0,vertical:-c},right:{parallel:c,normal:0,horizontal:0,vertical:c}},d={above:{justified:\"top\",parallel:u,normal:\"middle\",horizontal:u,vertical:\"middle\"},below:{justified:\"bottom\",parallel:\"hanging\",normal:\"middle\",horizontal:\"hanging\",vertical:\"middle\"},left:{justified:\"top\",parallel:u,normal:\"middle\",horizontal:\"middle\",vertical:u},right:{justified:\"top\",parallel:u,normal:\"middle\",horizontal:\"middle\",vertical:u}},f={above:{justified:_,parallel:_,normal:\"left\",horizontal:_,vertical:\"left\"},below:{justified:_,parallel:_,normal:\"left\",horizontal:_,vertical:\"left\"},left:{justified:_,parallel:_,normal:\"right\",horizontal:\"right\",vertical:_},right:{justified:_,parallel:_,normal:\"left\",horizontal:\"left\",vertical:_}},v={above:\"right\",below:\"left\",left:\"right\",right:\"left\"},m={above:\"left\",below:\"right\",left:\"right\",right:\"left\"};i.isSizeable=n,i.isSizeableView=function(t){return n(t.model)&&\"get_size\"in t},i._view_sizes=new WeakMap,i._view_constraints=new WeakMap,i.update_panel_constraints=function(t){var e=t.solver,n=t.get_size(),r=i._view_constraints.get(t);if(null!=r&&e.has_constraint(r)){if(i._view_sizes.get(t)===n)return;e.remove_constraint(r)}r=o.GE(t.model.panel._size,-n),e.add_constraint(r),i._view_sizes.set(t,n),i._view_constraints.set(t,r)};var g=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type=\"SidePanel\",this.internal({side:[a.String]})},e.prototype.toString=function(){return this.type+\"(\"+this.id+\", \"+this.side+\")\"},e.prototype.initialize=function(){switch(t.prototype.initialize.call(this),this.side){case\"above\":this._dim=0,this._normals=[0,-1],this._size=this._height;break;case\"below\":this._dim=0,this._normals=[0,1],this._size=this._height;break;case\"left\":this._dim=1,this._normals=[-1,0],this._size=this._width;break;case\"right\":this._dim=1,this._normals=[1,0],this._size=this._width;break;default:l.logger.error(\"unrecognized side: '\"+this.side+\"'\")}},Object.defineProperty(e.prototype,\"dimension\",{get:function(){return this._dim},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"normals\",{get:function(){return this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_horizontal\",{get:function(){return\"above\"==this.side||\"below\"==this.side},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_vertical\",{get:function(){return\"left\"==this.side||\"right\"==this.side},enumerable:!0,configurable:!0}),e.prototype.apply_label_text_heuristics=function(t,e){var i,n,r=this.side;h.isString(e)?(i=d[r][e],n=f[r][e]):0===e?(i=\"whatever\",n=\"whatever\"):e<0?(i=\"middle\",n=v[r]):(i=\"middle\",n=m[r]),t.textBaseline=i,t.textAlign=n},e.prototype.get_label_angle_heuristic=function(t){return p[this.side][t]},e}(s.LayoutCanvas);i.SidePanel=g,g.initClass()},function(t,e,i){function n(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t)}}function r(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return new o.Constraint(new(o.Expression.bind.apply(o.Expression,[void 0].concat(e))),t,o.Strength.weak)}}var o=t(336);i.Variable=o.Variable,i.Expression=o.Expression,i.Constraint=o.Constraint,i.Operator=o.Operator,i.Strength=o.Strength,i.EQ=n(o.Operator.Eq),i.LE=n(o.Operator.Le),i.GE=n(o.Operator.Ge),i.WEAK_EQ=r(o.Operator.Eq),i.WEAK_LE=r(o.Operator.Le),i.WEAK_GE=r(o.Operator.Ge);var s=function(){function t(){this.solver=new o.Solver}return t.prototype.clear=function(){this.solver=new o.Solver},t.prototype.toString=function(){return\"Solver(num_constraints=\"+this.num_constraints+\", num_editables=\"+this.num_editables+\")\"},Object.defineProperty(t.prototype,\"num_constraints\",{get:function(){return this.solver.numConstraints},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"num_editables\",{get:function(){return this.solver.numEditVariables},enumerable:!0,configurable:!0}),t.prototype.get_constraints=function(){return this.solver.getConstraints()},t.prototype.update_variables=function(){this.solver.updateVariables()},t.prototype.has_constraint=function(t){return this.solver.hasConstraint(t)},t.prototype.add_constraint=function(t){try{this.solver.addConstraint(t)}catch(e){throw new Error(e.message+\": \"+t.toString())}},t.prototype.remove_constraint=function(t){this.solver.removeConstraint(t)},t.prototype.add_edit_variable=function(t,e){this.solver.addEditVariable(t,e)},t.prototype.remove_edit_variable=function(t){this.solver.removeEditVariable(t)},t.prototype.suggest_value=function(t,e){this.solver.suggestValue(t,e)},t}();i.Solver=s},function(t,e,i){var n=t(44),r={},o=function(){return function(t,e){this.name=t,this.level=e}}();i.LogLevel=o;var s=function(){function t(e,i){void 0===i&&(i=t.INFO),this._name=e,this.set_level(i)}return Object.defineProperty(t,\"levels\",{get:function(){return Object.keys(t.log_levels)},enumerable:!0,configurable:!0}),t.get=function(e,i){if(void 0===i&&(i=t.INFO),e.length>0){var n=r[e];return null==n&&(r[e]=n=new t(e,i)),n}throw new TypeError(\"Logger.get() expects a non-empty string name and an optional log-level\")},Object.defineProperty(t.prototype,\"level\",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){if(e instanceof o)this._log_level=e;else{if(!n.isString(e)||null==t.log_levels[e])throw new Error(\"Logger.set_level() expects a log-level object or a string name of a log-level\");this._log_level=t.log_levels[e]}var i=\"[\"+this._name+\"]\";for(var r in t.log_levels){var s=t.log_levels[r];s.level<this._log_level.level||this._log_level.level===t.OFF.level?this[r]=function(){}:this[r]=function(t,e){return null!=console[t]?console[t].bind(console,e):null!=console.log?console.log.bind(console,e):function(){}}(r,i)}},t.prototype.trace=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.TRACE=new o(\"trace\",0),t.DEBUG=new o(\"debug\",1),t.INFO=new o(\"info\",2),t.WARN=new o(\"warn\",6),t.ERROR=new o(\"error\",7),t.FATAL=new o(\"fatal\",8),t.OFF=new o(\"off\",9),t.log_levels={trace:t.TRACE,debug:t.DEBUG,info:t.INFO,warn:t.WARN,error:t.ERROR,fatal:t.FATAL,off:t.OFF},t}();i.Logger=s,i.logger=s.get(\"bokeh\"),i.set_log_level=function(t){null==s.log_levels[t]?(console.log(\"[bokeh] unrecognized logging level '\"+t+\"' passed to Bokeh.set_log_level(), ignoring\"),console.log(\"[bokeh] valid log levels are: \"+s.levels.join(\", \"))):(console.log(\"[bokeh] setting log level to: '\"+t+\"'\"),i.logger.set_level(t))}},function(t,e,i){function n(t){try{return JSON.stringify(t)}catch(e){return t.toString()}}function r(t,e){return function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return a.__extends(r,i),r.prototype.validate=function(i){if(!e(i))throw new Error(t+\" property '\"+this.attr+\"' given invalid value: \"+n(i))},r}(f)}function o(t,e){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(t,function(t){return _.includes(e,t)}))}function s(t,e,i){return function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return a.__extends(r,n),r.prototype.init=function(){null==this.spec.units&&(this.spec.units=i);var n=this.spec.units;if(!_.includes(e,n))throw new Error(t+\" units must be one of \"+e+\", given invalid value: \"+n)},Object.defineProperty(r.prototype,\"units\",{get:function(){return this.spec.units},set:function(t){this.spec.units=t},enumerable:!0,configurable:!0}),r}(x)}var a=t(379),l=t(19),h=t(7),c=t(39),u=t(27),_=t(21),p=t(22),d=t(44);l.Signal;var f=function(t){function e(e,i,n){var r=t.call(this)||this;return r.optional=!1,r.obj=e,r.attr=i,r.default_value=n,r.change=new l.Signal0(r.obj,\"change\"),r._init(),r.connect(r.change,function(){return r._init()}),r}return a.__extends(e,t),e.prototype.update=function(){this._init()},e.prototype.init=function(){},e.prototype.transform=function(t){return t},e.prototype.validate=function(t){},e.prototype.value=function(t){if(void 0===t&&(t=!0),void 0===this.spec.value)throw new Error(\"attempted to retrieve property value for property without value specification\");var e=this.transform([this.spec.value])[0];return null!=this.spec.transform&&t&&(e=this.spec.transform.compute(e)),e},e.prototype.array=function(t){if(!this.dataspec)throw new Error(\"attempted to retrieve property array for non-dataspec property\");var e,i=t.data;if(null!=this.spec.field){if(!(this.spec.field in i))throw new Error(\"attempted to retrieve property array for nonexistent field '\"+this.spec.field+\"'\");e=this.transform(t.get_column(this.spec.field))}else if(null!=this.spec.expr)e=this.transform(this.spec.expr._v_compute(t));else{var n=t.get_length();null==n&&(n=1);var r=this.value(!1);e=_.repeat(r,n)}return null!=this.spec.transform&&(e=this.spec.transform.v_compute(e)),e},e.prototype._init=function(){var t=this.obj,e=this.attr,i=t.getv(e);if(void 0===i){var n=this.default_value;i=void 0!==n?n(t):null,t.setv((r={},r[e]=i,r),{silent:!0,defaults:!0})}if(d.isArray(i)?this.spec={value:i}:d.isObject(i)&&(void 0===i.value?0:1)+(void 0===i.field?0:1)+(void 0===i.expr?0:1)==1?this.spec=i:this.spec={value:i},null!=this.spec.field&&!d.isString(this.spec.field))throw new Error(\"field value for property '\"+e+\"' is not a string\");null!=this.spec.value&&this.validate(this.spec.value),this.init();var r},e.prototype.toString=function(){return\"Prop(\"+this.obj+\".\"+this.attr+\", spec: \"+n(this.spec)+\")\"},e}(l.Signalable());i.Property=f,f.prototype.dataspec=!1,i.simple_prop=r;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Any\",function(t){return!0}));i.Any=v;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Array\",function(t){return d.isArray(t)||t instanceof Float64Array}));i.Array=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Bool\",d.isBoolean));i.Bool=g,i.Boolean=g;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Color\",function(t){return c.is_svg_color(t.toLowerCase())||\"#\"==t.substring(0,1)||u.valid_rgb(t)}));i.Color=y;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Instance\",function(t){return null!=t.properties}));i.Instance=b;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Number\",function(t){return d.isNumber(t)||d.isBoolean(t)}));i.Number=x,i.Int=x;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"Number\",function(t){return(d.isNumber(t)||d.isBoolean(t))&&0<=t&&t<=1}));i.Percent=w;var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(r(\"String\",d.isString));i.String=k;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.Font=S,i.enum_prop=o;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Anchor\",h.LegendLocation));i.Anchor=C;var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"AngleUnits\",h.AngleUnits));i.AngleUnits=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;i++)switch(t[i]){case\"clock\":e[i]=0;break;case\"anticlock\":e[i]=1}return e},e}(o(\"Direction\",h.Direction));i.Direction=A;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Dimension\",h.Dimension));i.Dimension=E;var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Dimensions\",h.Dimensions));i.Dimensions=M;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"FontStyle\",h.FontStyle));i.FontStyle=O;var z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"LatLon\",h.LatLon));i.LatLon=z;var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"LineCap\",h.LineCap));i.LineCap=P;var j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"LineJoin\",h.LineJoin));i.LineJoin=j;var N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"LegendLocation\",h.LegendLocation));i.LegendLocation=N;var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Location\",h.Location));i.Location=F;var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"OutputBackend\",h.OutputBackend));i.OutputBackend=D;var I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Orientation\",h.Orientation));i.Orientation=I;var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"VerticalAlign\",h.VerticalAlign));i.VerticalAlign=B;var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"TextAlign\",h.TextAlign));i.TextAlign=R;var L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"TextBaseline\",h.TextBaseline));i.TextBaseline=L;var V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"RenderLevel\",h.RenderLevel));i.RenderLevel=V;var G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"RenderMode\",h.RenderMode));i.RenderMode=G;var U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"SizingMode\",h.SizingMode));i.SizingMode=U;var Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"SpatialUnits\",h.SpatialUnits));i.SpatialUnits=Y;var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"Distribution\",h.Distribution));i.Distribution=q;var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"StepMode\",h.StepMode));i.StepMode=X;var W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"PaddingUnits\",h.PaddingUnits));i.PaddingUnits=W;var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(o(\"StartEnd\",h.StartEnd));i.StartEnd=H,i.units_prop=s;var J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.transform=function(e){return\"deg\"==this.spec.units&&(e=p.map(e,function(t){return t*Math.PI/180})),e=p.map(e,function(t){return-t}),t.prototype.transform.call(this,e)},e}(s(\"Angle\",h.AngleUnits,\"rad\"));i.Angle=J;var Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(s(\"Distance\",h.SpatialUnits,\"data\"));i.Distance=Q;var $=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(J);i.AngleSpec=$,$.prototype.dataspec=!0;var K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(y);i.ColorSpec=K,K.prototype.dataspec=!0;var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(Q);i.DistanceSpec=Z,Z.prototype.dataspec=!0;var tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.FontSizeSpec=tt,tt.prototype.dataspec=!0;var et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(x);i.NumberSpec=et,et.prototype.dataspec=!0;var it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(k);i.StringSpec=it,it.prototype.dataspec=!0},function(t,e,i){function n(t,e){var i={};for(var n in t){var r=t[n];i[e+n]=r}return i}var r=t(15),o=t(32),s={line_color:[r.ColorSpec,\"black\"],line_width:[r.NumberSpec,1],line_alpha:[r.NumberSpec,1],line_join:[r.LineJoin,\"miter\"],line_cap:[r.LineCap,\"butt\"],line_dash:[r.Array,[]],line_dash_offset:[r.Number,0]};i.line=function(t){return void 0===t&&(t=\"\"),n(s,t)};var a={fill_color:[r.ColorSpec,\"gray\"],fill_alpha:[r.NumberSpec,1]};i.fill=function(t){return void 0===t&&(t=\"\"),n(a,t)};var l={text_font:[r.Font,\"helvetica\"],text_font_size:[r.FontSizeSpec,\"12pt\"],text_font_style:[r.FontStyle,\"normal\"],text_color:[r.ColorSpec,\"#444444\"],text_alpha:[r.NumberSpec,1],text_align:[r.TextAlign,\"left\"],text_baseline:[r.TextBaseline,\"bottom\"],text_line_height:[r.Number,1.2]};i.text=function(t){return void 0===t&&(t=\"\"),n(l,t)},i.create=function(t){for(var e={},n=0,r=t;n<r.length;n++){var s=r[n],a=s.split(\":\"),l=a[0],h=a[1],c=void 0;switch(l){case\"line\":c=i.line;break;case\"fill\":c=i.fill;break;case\"text\":c=i.text;break;default:throw new Error(\"Unknown property mixin kind '\"+l+\"'\")}o.extend(e,c(h))}return e}},function(t,e,i){var n=t(379),r=t(8),o=t(181),s=t(170),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"SelectionManager\",this.internal({source:[a.Any]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.inspectors={}},e.prototype.select=function(t,e,i,n){void 0===n&&(n=!1);for(var r=[],o=[],a=0,l=t;a<l.length;a++){var h=l[a];\"GlyphRenderer\"==h.model.type?r.push(h):h.model instanceof s.GraphRenderer&&o.push(h)}for(var c=!1,u=0,_=o;u<_.length;u++){var h=_[u],p=h.model.selection_policy.hit_test(e,h);c=c||h.model.selection_policy.do_selection(p,h.model,i,n)}if(r.length>0){var p=this.source.selection_policy.hit_test(e,t);c=c||this.source.selection_policy.do_selection(p,this.source,i,n)}return c},e.prototype.inspect=function(t,e){var i=!1;if(\"GlyphRenderer\"==t.model.type){var n=t.hit_test(e);i=!n.is_empty();var r=this.get_or_create_inspector(t.model);r.update(n,!0,!1),this.source.setv({inspected:r},{silent:!0}),this.source.inspect.emit([t,{geometry:e}])}else if(t.model instanceof s.GraphRenderer){var n=t.model.inspection_policy.hit_test(e,t);i=i||t.model.inspection_policy.do_inspection(n,e,t,!1,!1)}return i},e.prototype.clear=function(t){this.source.selected.clear(),null!=t&&this.get_or_create_inspector(t.model).clear()},e.prototype.get_or_create_inspector=function(t){return null==this.inspectors[t.id]&&(this.inspectors[t.id]=new o.Selection),this.inspectors[t.id]},e}(r.HasProps);i.SelectionManager=l,l.initClass()},function(t,e,i){var n=function(){function t(){this._dev=!1}return Object.defineProperty(t.prototype,\"dev\",{get:function(){return this._dev},set:function(t){this._dev=t},enumerable:!0,configurable:!0}),t}();i.Settings=n,i.settings=new n},function(t,e,i){function n(t,e,i,n){return l.find(t,function(t){return t.signal===e&&t.slot===i&&t.context===n})}function r(t){0===p.size&&a.defer(o),p.add(t)}function o(){p.forEach(function(t){l.removeBy(t,function(t){return null==t.signal})}),p.clear()}var s=t(379),a=t(25),l=t(21),h=function(){function t(t,e){this.sender=t,this.name=e}return t.prototype.connect=function(t,e){void 0===e&&(e=null),u.has(this.sender)||u.set(this.sender,[]);var i=u.get(this.sender);if(null!=n(i,this,t,e))return!1;var r=e||t;_.has(r)||_.set(r,[]);var o=_.get(r),s={signal:this,slot:t,context:e};return i.push(s),o.push(s),!0},t.prototype.disconnect=function(t,e){void 0===e&&(e=null);var i=u.get(this.sender);if(null==i||0===i.length)return!1;var o=n(i,this,t,e);if(null==o)return!1;var s=e||t,a=_.get(s);return o.signal=null,r(i),r(a),!0},t.prototype.emit=function(t){for(var e=u.get(this.sender)||[],i=0,n=e;i<n.length;i++){var r=n[i],o=r.signal,s=r.slot,a=r.context;o===this&&s.call(a,t,this.sender)}},t}();i.Signal=h;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.emit=function(){t.prototype.emit.call(this,void 0)},e}(h);i.Signal0=c,function(t){t.disconnectBetween=function(t,e){var i=u.get(t);if(null==i||0===i.length)return;var n=_.get(e);if(null==n||0===n.length)return;for(var o=0,s=n;o<s.length;o++){var a=s[o];if(null==a.signal)return;a.signal.sender===t&&(a.signal=null)}r(i),r(n)},t.disconnectSender=function(t){var e=u.get(t);if(null==e||0===e.length)return;for(var i=0,n=e;i<n.length;i++){var o=n[i];if(null==o.signal)return;var s=o.context||o.slot;o.signal=null,r(_.get(s))}r(e)},t.disconnectReceiver=function(t){var e=_.get(t);if(null==e||0===e.length)return;for(var i=0,n=e;i<n.length;i++){var o=n[i];if(null==o.signal)return;var s=o.signal.sender;o.signal=null,r(u.get(s))}r(e)},t.disconnectAll=function(t){var e=u.get(t);if(null!=e&&0!==e.length){for(var i=0,n=e;i<n.length;i++){var o=n[i];o.signal=null}r(e)}var s=_.get(t);if(null!=s&&0!==s.length){for(var a=0,l=s;a<l.length;a++){var o=l[a];o.signal=null}r(s)}}}(h=i.Signal||(i.Signal={})),i.Signal=h,i.Signalable=function(t){return null!=t?function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.connect=function(t,e){return t.connect(e,this)},e}(t):function(){function t(){}return t.prototype.connect=function(t,e){return t.connect(e,this)},t}()};!function(t){t.connect=function(t,e){return t.connect(e,this)}}(i._Signalable||(i._Signalable={}));var u=new WeakMap,_=new WeakMap,p=new Set},function(t,e,i){var n=t(379),r=t(333),o=t(19),s=t(14),a=t(5),l=t(45),h=t(21),c=t(32),u=t(44),_=t(3);i.is_mobile=\"ontouchstart\"in window||navigator.maxTouchPoints>0;var p=function(){function t(t,e,i,n){this.plot_view=t,this.toolbar=e,this.hit_area=i,this.plot=n,this.pan_start=new o.Signal(this,\"pan:start\"),this.pan=new o.Signal(this,\"pan\"),this.pan_end=new o.Signal(this,\"pan:end\"),this.pinch_start=new o.Signal(this,\"pinch:start\"),this.pinch=new o.Signal(this,\"pinch\"),this.pinch_end=new o.Signal(this,\"pinch:end\"),this.rotate_start=new o.Signal(this,\"rotate:start\"),this.rotate=new o.Signal(this,\"rotate\"),this.rotate_end=new o.Signal(this,\"rotate:end\"),this.tap=new o.Signal(this,\"tap\"),this.doubletap=new o.Signal(this,\"doubletap\"),this.press=new o.Signal(this,\"press\"),this.move_enter=new o.Signal(this,\"move:enter\"),this.move=new o.Signal(this,\"move\"),this.move_exit=new o.Signal(this,\"move:exit\"),this.scroll=new o.Signal(this,\"scroll\"),this.keydown=new o.Signal(this,\"keydown\"),this.keyup=new o.Signal(this,\"keyup\"),this.hammer=new r(this.hit_area),this._configure_hammerjs()}return t.prototype._configure_hammerjs=function(){var t=this;this.hammer.get(\"doubletap\").recognizeWith(\"tap\"),this.hammer.get(\"tap\").requireFailure(\"doubletap\"),this.hammer.get(\"doubletap\").dropRequireFailure(\"tap\"),this.hammer.on(\"doubletap\",function(e){return t._doubletap(e)}),this.hammer.on(\"tap\",function(e){return t._tap(e)}),this.hammer.on(\"press\",function(e){return t._press(e)}),this.hammer.get(\"pan\").set({direction:r.DIRECTION_ALL}),this.hammer.on(\"panstart\",function(e){return t._pan_start(e)}),this.hammer.on(\"pan\",function(e){return t._pan(e)}),this.hammer.on(\"panend\",function(e){return t._pan_end(e)}),this.hammer.get(\"pinch\").set({enable:!0}),this.hammer.on(\"pinchstart\",function(e){return t._pinch_start(e)}),this.hammer.on(\"pinch\",function(e){return t._pinch(e)}),this.hammer.on(\"pinchend\",function(e){return t._pinch_end(e)}),this.hammer.get(\"rotate\").set({enable:!0}),this.hammer.on(\"rotatestart\",function(e){return t._rotate_start(e)}),this.hammer.on(\"rotate\",function(e){return t._rotate(e)}),this.hammer.on(\"rotateend\",function(e){return t._rotate_end(e)}),this.hit_area.addEventListener(\"mousemove\",function(e){return t._mouse_move(e)}),this.hit_area.addEventListener(\"mouseenter\",function(e){return t._mouse_enter(e)}),this.hit_area.addEventListener(\"mouseleave\",function(e){return t._mouse_exit(e)}),this.hit_area.addEventListener(\"wheel\",function(e){return t._mouse_wheel(e)}),document.addEventListener(\"keydown\",function(e){return t._key_down(e)}),document.addEventListener(\"keyup\",function(e){return t._key_up(e)})},t.prototype.register_tool=function(t){var e=this,i=t.model.event_type;null!=i&&(u.isString(i)?this._register_tool(t,i):i.forEach(function(i,n){return e._register_tool(t,i,n<1)}))},t.prototype._register_tool=function(t,e,n){void 0===n&&(n=!0);var r=t,o=r.model.id,a=function(t){return function(e){e.id==o&&t(e.e)}},l=function(t){return function(e){t(e.e)}};switch(e){case\"pan\":null!=r._pan_start&&r.connect(this.pan_start,a(r._pan_start.bind(r))),null!=r._pan&&r.connect(this.pan,a(r._pan.bind(r))),null!=r._pan_end&&r.connect(this.pan_end,a(r._pan_end.bind(r)));break;case\"pinch\":null!=r._pinch_start&&r.connect(this.pinch_start,a(r._pinch_start.bind(r))),null!=r._pinch&&r.connect(this.pinch,a(r._pinch.bind(r))),null!=r._pinch_end&&r.connect(this.pinch_end,a(r._pinch_end.bind(r)));break;case\"rotate\":null!=r._rotate_start&&r.connect(this.rotate_start,a(r._rotate_start.bind(r))),null!=r._rotate&&r.connect(this.rotate,a(r._rotate.bind(r))),null!=r._rotate_end&&r.connect(this.rotate_end,a(r._rotate_end.bind(r)));break;case\"move\":null!=r._move_enter&&r.connect(this.move_enter,a(r._move_enter.bind(r))),null!=r._move&&r.connect(this.move,a(r._move.bind(r))),null!=r._move_exit&&r.connect(this.move_exit,a(r._move_exit.bind(r)));break;case\"tap\":null!=r._tap&&r.connect(this.tap,a(r._tap.bind(r)));break;case\"press\":null!=r._press&&r.connect(this.press,a(r._press.bind(r)));break;case\"scroll\":null!=r._scroll&&r.connect(this.scroll,a(r._scroll.bind(r)));break;default:throw new Error(\"unsupported event_type: \"+e)}n&&(null!=r._doubletap&&r.connect(this.doubletap,l(r._doubletap.bind(r))),null!=r._keydown&&r.connect(this.keydown,l(r._keydown.bind(r))),null!=r._keyup&&r.connect(this.keyup,l(r._keyup.bind(r))),i.is_mobile&&null!=r._scroll&&\"pinch\"==e&&(s.logger.debug(\"Registering scroll on touch screen\"),r.connect(this.scroll,a(r._scroll.bind(r)))))},t.prototype._hit_test_renderers=function(t,e){for(var i=this.plot_view.get_renderer_views(),n=0,r=h.reversed(i);n<r.length;n++){var o=r[n],s=o.model.level;if((\"annotation\"==s||\"overlay\"==s)&&null!=o.bbox&&o.bbox().contains(t,e))return o}return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(t,e,n){var r=this;this._trigger_bokeh_event(e);var o=this.toolbar.gestures,s=t.name,a=s.split(\":\")[0],l=this._hit_test_renderers(e.sx,e.sy);switch(a){case\"move\":var h=o[a].active;null!=h&&this.trigger(t,e,h.id);var u=this.toolbar.inspectors.filter(function(t){return t.active}),_=\"default\";null!=l?(_=l.cursor||_,c.isEmpty(u)||(t=this.move_exit,s=t.name)):this._hit_test_frame(e.sx,e.sy)&&(c.isEmpty(u)||(_=\"crosshair\")),this.plot_view.set_cursor(_),u.map(function(i){return r.trigger(t,e,i.id)});break;case\"tap\":null!=l&&null!=l.on_hit&&l.on_hit(e.sx,e.sy);var h=o[a].active;null!=h&&this.trigger(t,e,h.id);break;case\"scroll\":var p=i.is_mobile?\"pinch\":\"scroll\",h=o[p].active;null!=h&&(n.preventDefault(),n.stopPropagation(),this.trigger(t,e,h.id));break;default:var h=o[a].active;null!=h&&this.trigger(t,e,h.id)}},t.prototype.trigger=function(t,e,i){void 0===i&&(i=null),t.emit({id:i,e:e})},t.prototype._trigger_bokeh_event=function(t){var e=_.BokehEvent.event_class(t);null!=e?this.plot.trigger_event(e.from_event(t)):s.logger.debug(\"Unhandled event of type \"+t.type)},t.prototype._get_sxy=function(t){var e=function(t){return\"undefined\"!=typeof TouchEvent&&t instanceof TouchEvent}(t)?t.touches[0]:t,i=e.pageX,n=e.pageY,r=a.offset(this.hit_area),o=r.left,s=r.top;return{sx:i-o,sy:n-s}},t.prototype._gesture_event=function(t){return n.__assign({type:t.type},this._get_sxy(t.srcEvent),{deltaX:t.deltaX,deltaY:t.deltaY,scale:t.scale,shiftKey:t.srcEvent.shiftKey})},t.prototype._tap_event=function(t){return n.__assign({type:t.type},this._get_sxy(t.srcEvent),{shiftKey:t.srcEvent.shiftKey})},t.prototype._move_event=function(t){return n.__assign({type:t.type},this._get_sxy(t))},t.prototype._scroll_event=function(t){return n.__assign({type:t.type},this._get_sxy(t),{delta:l.getDeltaY(t)})},t.prototype._key_event=function(t){return{type:t.type,keyCode:t.keyCode}},t.prototype._pan_start=function(t){var e=this._gesture_event(t);e.sx-=t.deltaX,e.sy-=t.deltaY,this._trigger(this.pan_start,e)},t.prototype._pan=function(t){this._trigger(this.pan,this._gesture_event(t))},t.prototype._pan_end=function(t){this._trigger(this.pan_end,this._gesture_event(t))},t.prototype._pinch_start=function(t){this._trigger(this.pinch_start,this._gesture_event(t))},t.prototype._pinch=function(t){this._trigger(this.pinch,this._gesture_event(t))},t.prototype._pinch_end=function(t){this._trigger(this.pinch_end,this._gesture_event(t))},t.prototype._rotate_start=function(t){this._trigger(this.rotate_start,this._gesture_event(t))},t.prototype._rotate=function(t){this._trigger(this.rotate,this._gesture_event(t))},t.prototype._rotate_end=function(t){this._trigger(this.rotate_end,this._gesture_event(t))},t.prototype._tap=function(t){this._trigger(this.tap,this._tap_event(t))},t.prototype._doubletap=function(t){var e=this._tap_event(t);this._trigger_bokeh_event(e),this.trigger(this.doubletap,e)},t.prototype._press=function(t){this._trigger(this.press,this._tap_event(t))},t.prototype._mouse_enter=function(t){this._trigger(this.move_enter,this._move_event(t))},t.prototype._mouse_move=function(t){this._trigger(this.move,this._move_event(t))},t.prototype._mouse_exit=function(t){this._trigger(this.move_exit,this._move_event(t))},t.prototype._mouse_wheel=function(t){this._trigger(this.scroll,this._scroll_event(t),t)},t.prototype._key_down=function(t){this.trigger(this.keydown,this._key_event(t))},t.prototype._key_up=function(t){this.trigger(this.keyup,this._key_event(t))},t}();i.UIEvents=p},function(t,e,i){function n(t){return(e=[]).concat.apply(e,t);var e}function r(t,e){return-1!==t.indexOf(e)}function o(t,e,i){void 0===i&&(i=1),h.assert(i>0,\"'step' must be a positive number\"),null==e&&(e=t,t=0);for(var n=Math.max,r=Math.ceil,o=Math.abs,s=t<=e?i:-i,a=n(r(o(e-t)/i),0),l=Array(a),c=0;c<a;c++,t+=s)l[c]=t;return l}function s(t){return function(e,i){for(var n=e.length,r=t>0?0:n-1;r>=0&&r<n;r+=t)if(i(e[r]))return r;return-1}}function a(t){for(var e=[],i=0,n=t;i<n.length;i++){var o=n[i];r(e,o)||e.push(o)}return e}var l=t(31),h=t(23),c=t(22);i.min=c.min,i.minBy=c.minBy,i.max=c.max,i.maxBy=c.maxBy,i.sum=c.sum;var u=Array.prototype.slice;i.head=function(t){return t[0]},i.tail=function(t){return t[t.length-1]},i.last=function(t){return t[t.length-1]},i.copy=function(t){return u.call(t)},i.concat=n,i.includes=r,i.contains=r,i.nth=function(t,e){return t[e>=0?e:t.length+e]},i.zip=function(t,e){for(var i=Math.min(t.length,e.length),n=new Array(i),r=0;r<i;r++)n[r]=[t[r],e[r]];return n},i.unzip=function(t){for(var e=t.length,i=new Array(e),n=new Array(e),r=0;r<e;r++)o=t[r],i[r]=o[0],n[r]=o[1];return[i,n];var o},i.range=o,i.linspace=function(t,e,i){void 0===i&&(i=100);for(var n=(e-t)/(i-1),r=new Array(i),o=0;o<i;o++)r[o]=t+n*o;return r},i.transpose=function(t){for(var e=t.length,i=t[0].length,n=[],r=0;r<i;r++){n[r]=[];for(var o=0;o<e;o++)n[r][o]=t[o][r]}return n},i.cumsum=function(t){var e=[];return t.reduce(function(t,i,n){return e[n]=t+i},0),e},i.argmin=function(t){return c.minBy(o(t.length),function(e){return t[e]})},i.argmax=function(t){return c.maxBy(o(t.length),function(e){return t[e]})},i.all=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!e(r))return!1}return!0},i.any=function(t,e){for(var i=0,n=t;i<n.length;i++){var r=n[i];if(e(r))return!0}return!1},i.findIndex=s(1),i.findLastIndex=s(-1),i.find=function(t,e){var n=i.findIndex(t,e);return-1==n?void 0:t[n]},i.findLast=function(t,e){var n=i.findLastIndex(t,e);return-1==n?void 0:t[n]},i.sortedIndex=function(t,e){var i=0,n=t.length;for(;i<n;){var r=Math.floor((i+n)/2);t[r]<e?i=r+1:n=r}return i},i.sortBy=function(t,e){var i=t.map(function(t,i){return{value:t,index:i,key:e(t)}});return i.sort(function(t,e){var i=t.key,n=e.key;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return t.index-e.index}),i.map(function(t){return t.value})},i.uniq=a,i.uniqBy=function(t,e){for(var i=[],n=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e(a);r(n,l)||(n.push(l),i.push(a))}return i},i.union=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a(n(t))},i.intersection=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=[];t:for(var o=0,s=t;o<s.length;o++){var a=s[o];if(!r(n,a)){for(var l=0,h=e;l<h.length;l++){var c=h[l];if(!r(c,a))continue t}n.push(a)}}return n},i.difference=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=n(e);return t.filter(function(t){return!r(o,t)})},i.removeBy=function(t,e){for(var i=0;i<t.length;)e(t[i])?t.splice(i,1):i++},i.shuffle=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++){var r=l.randomIn(0,n);r!==n&&(i[n]=i[r]),i[r]=t[n]}return i},i.pairwise=function(t,e){for(var i=t.length,n=new Array(i-1),r=0;r<i-1;r++)n[r]=e(t[r],t[r+1]);return n},i.reversed=function(t){for(var e=t.length,i=new Array(e),n=0;n<e;n++)i[e-n-1]=t[n];return i},i.repeat=function(t,e){for(var i=new Array(e),n=0;n<e;n++)i[n]=t;return i}},function(t,e,i){function n(t,e,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];var o=t.length;e<0&&(e+=o),e<0?e=0:e>o&&(e=o),null==i||i>o-e?i=o-e:i<0&&(i=0);for(var s=o-i+n.length,a=new t.constructor(s),l=0;l<e;l++)a[l]=t[l];for(var h=0,c=n;h<c.length;h++){var u=c[h];a[l++]=u}for(var _=e+i;_<o;_++)a[l++]=t[_];return a}i.splice=n,i.insert=function(t,e,i){return n(t,i,0,e)},i.append=function(t,e){return n(t,t.length,0,e)},i.prepend=function(t,e){return n(t,0,0,e)},i.indexOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){for(var i=t.length,n=new t.constructor(i),r=0;r<i;r++)n[r]=e(t[r],r,t);return n},i.min=function(t){for(var e,i=1/0,n=0,r=t.length;n<r;n++)(e=t[n])<i&&(i=e);return i},i.minBy=function(t,e){if(0==t.length)throw new Error(\"minBy() called with an empty array\");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a<n&&(i=s,n=a)}return i},i.max=function(t){for(var e,i=-1/0,n=0,r=t.length;n<r;n++)(e=t[n])>i&&(i=e);return i},i.maxBy=function(t,e){if(0==t.length)throw new Error(\"maxBy() called with an empty array\");for(var i=t[0],n=e(i),r=1,o=t.length;r<o;r++){var s=t[r],a=e(s);a>n&&(i=s,n=a)}return i},i.sum=function(t){for(var e=0,i=0,n=t.length;i<n;i++)e+=t[i];return e}},function(t,e,i){var n=t(379),r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(Error);i.AssertionError=r,i.assert=function(t,e){if(!0===t||!1!==t&&t())return;throw new r(e||\"Assertion failed\")}},function(t,e,i){var n=Math.min,r=Math.max;i.empty=function(){return{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},i.positive_x=function(){return{minX:Number.MIN_VALUE,minY:-1/0,maxX:1/0,maxY:1/0}},i.positive_y=function(){return{minX:-1/0,minY:Number.MIN_VALUE,maxX:1/0,maxY:1/0}},i.union=function(t,e){return{minX:n(t.minX,e.minX),maxX:r(t.maxX,e.maxX),minY:n(t.minY,e.minY),maxY:r(t.maxY,e.maxY)}};var o=function(){function t(t){if(\"x0\"in t&&\"y0\"in t&&\"x1\"in t&&\"y1\"in t){var e=t,i=e.x0,n=e.y0,r=e.x1,o=e.y1;if(!(i<=r&&n<=o))throw new Error(\"invalid bbox {x0: \"+i+\", y0: \"+n+\", x1: \"+r+\", y1: \"+o+\"}\");this.x0=i,this.y0=n,this.x1=r,this.y1=o}else{var s=t,a=s.x,l=s.y,h=s.width,c=s.height;if(!(h>=0&&c>=0))throw new Error(\"invalid bbox {x: \"+a+\", y: \"+l+\", width: \"+h+\", height: \"+c+\"}\");this.x0=a,this.y0=l,this.x1=a+h,this.y1=l+c}}return Object.defineProperty(t.prototype,\"minX\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"minY\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"maxX\",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"maxY\",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"left\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"top\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"right\",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"bottom\",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"p0\",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"p1\",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"x\",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"y\",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"width\",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"height\",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"rect\",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"h_range\",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"v_range\",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"ranges\",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"aspect\",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.clip=function(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:n(this.x0,e.x0),y0:n(this.y0,e.y0),x1:r(this.x1,e.x1),y1:r(this.y1,e.y1)})},t}();i.BBox=o},function(t,e,i){i.delay=function(t,e){return setTimeout(t,e)};var n=\"function\"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;i.defer=function(t){return n(t)},i.throttle=function(t,e,i){void 0===i&&(i={});var n,r,o,s=null,a=0,l=function(){a=!1===i.leading?0:Date.now(),s=null,o=t.apply(n,r),s||(n=r=null)};return function(){var h=Date.now();a||!1!==i.leading||(a=h);var c=e-(h-a);return n=this,r=arguments,c<=0||c>e?(s&&(clearTimeout(s),s=null),a=h,o=t.apply(n,r),s||(n=r=null)):s||!1===i.trailing||(s=setTimeout(l,c)),o}},i.once=function(t){var e,i=!1;return function(){return i||(i=!0,e=t()),e}}},function(t,e,i){i.fixup_ctx=function(t){(function(t){t.setLineDash||(t.setLineDash=function(e){t.mozDash=e,t.webkitLineDash=e});t.getLineDash||(t.getLineDash=function(){return t.mozDash})})(t),function(t){t.setLineDashOffset=function(e){t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}}(t),function(t){t.setImageSmoothingEnabled=function(e){t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e=t.imageSmoothingEnabled;return null==e||e}}(t),function(t){t.measureText&&null==t.html5MeasureText&&(t.html5MeasureText=t.measureText,t.measureText=function(e){var i=t.html5MeasureText(e);return i.ascent=1.6*t.html5MeasureText(\"m\").width,i})}(t),function(t){t.ellipse||(t.ellipse=function(e,i,n,r,o,s,a,l){void 0===l&&(l=!1);t.translate(e,i),t.rotate(o);var h=n,c=r;l&&(h=-n,c=-r);t.moveTo(-h,0),t.bezierCurveTo(-h,.551784*c,.551784*-h,c,0,c),t.bezierCurveTo(.551784*h,c,h,.551784*c,h,0),t.bezierCurveTo(h,.551784*-c,.551784*h,-c,0,-c),t.bezierCurveTo(.551784*-h,-c,-h,.551784*-c,-h,0),t.rotate(-o),t.translate(-e,-i)})}(t)},i.get_scale_ratio=function(t,e,i){if(\"svg\"==i)return 1;if(e){var n=window.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}return 1}},function(t,e,i){function n(t){var e=Number(t).toString(16);return 1==e.length?\"0\"+e:e}function r(t){if(0==(t+=\"\").indexOf(\"#\"))return t;if(o.is_svg_color(t))return o.svg_colors[t];if(0==t.indexOf(\"rgb\")){var e=t.replace(/^rgba?\\(|\\s+|\\)$/g,\"\").split(\",\"),i=e.slice(0,3).map(n).join(\"\");return 4==e.length&&(i+=n(Math.floor(255*parseFloat(e[3])))),\"#\"+i.slice(0,8)}return t}var o=t(39),s=t(21);i.color2hex=r,i.color2rgba=function(t,e){void 0===e&&(e=1);if(!t)return[0,0,0,0];var i=r(t);(i=i.replace(/ |#/g,\"\")).length<=4&&(i=i.replace(/(.)/g,\"$1$1\"));var n=i.match(/../g).map(function(t){return parseInt(t,16)/255});for(;n.length<3;)n.push(0);n.length<4&&n.push(e);return n.slice(0,4)},i.valid_rgb=function(t){var e;switch(t.substring(0,4)){case\"rgba\":e={start:\"rgba(\",len:4,alpha:!0};break;case\"rgb(\":e={start:\"rgb(\",len:3,alpha:!1};break;default:return!1}if(new RegExp(\".*?(\\\\.).*(,)\").test(t))throw new Error(\"color expects integers for rgb in rgb/rgba tuple, received \"+t);var i=t.replace(e.start,\"\").replace(\")\",\"\").split(\",\").map(parseFloat);if(i.length!=e.len)throw new Error(\"color expects rgba \"+e.len+\"-tuple, received \"+t);if(e.alpha&&!(0<=i[3]&&i[3]<=1))throw new Error(\"color expects rgba 4-tuple to have alpha value between 0 and 1\");if(s.includes(i.slice(0,3).map(function(t){return 0<=t&&t<=255}),!1))throw new Error(\"color expects rgb to have value between 0 and 255\");return!0}},function(t,e,i){i.is_ie=navigator.userAgent.indexOf(\"MSIE\")>=0||navigator.userAgent.indexOf(\"Trident\")>0||navigator.userAgent.indexOf(\"Edge\")>0,i.is_little_endian=function(){var t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t);i[1]=168496141;var n=!0;return 10==e[4]&&11==e[5]&&12==e[6]&&13==e[7]&&(n=!1),n}()},function(t,e,i){var n=t(21),r=t(30),o=t(44),s=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var i=this._existing(t);null==i?this._dict[t]=e:o.isArray(i)?i.push(e):this._dict[t]=[i,e]},t.prototype.remove_value=function(t,e){var i=this._existing(t);if(o.isArray(i)){var s=n.difference(i,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(i,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var i=this._existing(t);if(o.isArray(i)){if(1===i.length)return i[0];throw new Error(e)}return i},t}();i.MultiDict=s;var a=function(){function t(e){this.values=null==e?[]:e instanceof t?n.copy(e.values):this._compact(e)}return t.prototype._compact=function(t){for(var e=[],i=0,n=t;i<n.length;i++){var r=n[i];-1===e.indexOf(r)&&e.push(r)}return e},t.prototype.push=function(t){this.missing(t)&&this.values.push(t)},t.prototype.remove=function(t){var e=this.values.indexOf(t);this.values=this.values.slice(0,e).concat(this.values.slice(e+1))},t.prototype.length=function(){return this.values.length},t.prototype.includes=function(t){return-1!=this.values.indexOf(t)},t.prototype.missing=function(t){return!this.includes(t)},t.prototype.slice=function(t,e){return this.values.slice(t,e)},t.prototype.join=function(t){return this.values.join(t)},t.prototype.toString=function(){return this.join(\", \")},t.prototype.union=function(e){return e=new t(e),new t(this.values.concat(e.values))},t.prototype.intersect=function(e){e=new t(e);for(var i=new t,n=0,r=e.values;n<r.length;n++){var o=r[n];this.includes(o)&&e.includes(o)&&i.push(o)}return i},t.prototype.diff=function(e){e=new t(e);for(var i=new t,n=0,r=this.values;n<r.length;n++){var o=r[n];e.missing(o)&&i.push(o)}return i},t}();i.Set=a},function(t,e,i){function n(t,e,i,s){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;var a=o.call(t);if(a!==o.call(e))return!1;switch(a){case\"[object RegExp]\":case\"[object String]\":return\"\"+t==\"\"+e;case\"[object Number]\":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case\"[object Date]\":case\"[object Boolean]\":return+t==+e}var l=\"[object Array]\"===a;if(!l){if(\"object\"!=typeof t||\"object\"!=typeof e)return!1;var h=t.constructor,c=e.constructor;if(h!==c&&!(r.isFunction(h)&&h instanceof h&&r.isFunction(c)&&c instanceof c)&&\"constructor\"in t&&\"constructor\"in e)return!1}i=i||[],s=s||[];for(var u=i.length;u--;)if(i[u]===t)return s[u]===e;if(i.push(t),s.push(e),l){if((u=t.length)!==e.length)return!1;for(;u--;)if(!n(t[u],e[u],i,s))return!1}else{var _=Object.keys(t),p=void 0;if(u=_.length,Object.keys(e).length!==u)return!1;for(;u--;)if(p=_[u],!e.hasOwnProperty(p)||!n(t[p],e[p],i,s))return!1}return i.pop(),s.pop(),!0}var r=t(44),o=Object.prototype.toString;i.isEqual=function(t,e){return n(t,e)}},function(t,e,i){function n(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(n(t-e))}function o(){return Math.random()}i.angle_norm=n,i.angle_dist=r,i.angle_between=function(t,e,i,o){var s=n(t),a=r(e,i),l=r(e,s)<=a&&r(s,i)<=a;return\"anticlock\"==o?l:!l},i.random=o,i.randomIn=function(t,e){null==e&&(e=t,t=0);return t+Math.floor(Math.random()*(e-t+1))},i.atan2=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])},i.rnorm=function(t,e){var i,n;for(;i=o(),n=o(),n=(2*n-1)*Math.sqrt(1/Math.E*2),!(-4*i*i*Math.log(i)>=n*n););var r=n/i;return r=t+e*r},i.clamp=function(t,e,i){return t>i?i:t<e?e:t}},function(t,e,i){function n(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,r=e;n<r.length;n++){var o=r[n];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function r(t){return Object.keys(t).length}var o=t(21);i.keys=Object.keys,i.values=function(t){for(var e=Object.keys(t),i=e.length,n=new Array(i),r=0;r<i;r++)n[r]=t[e[r]];return n},i.extend=n,i.clone=function(t){return n({},t)},i.merge=function(t,e){for(var i=Object.create(Object.prototype),n=0,r=o.concat([Object.keys(t),Object.keys(e)]);n<r.length;n++){var s=r[n],a=t.hasOwnProperty(s)?t[s]:[],l=e.hasOwnProperty(s)?e[s]:[];i[s]=o.union(a,l)}return i},i.size=r,i.isEmpty=function(t){return 0===r(t)}},function(t,e,i){function n(t,e){for(var n=Math.min(t.length,e.length),r=new Array(n),o=new Array(n),s=0;s<n;s++){var a=i.wgs84_mercator.forward([t[s],e[s]]),l=a[0],h=a[1];r[s]=l,o[s]=h}return[r,o]}var r=t(360),o=t(348),s=new o(\"GOOGLE\"),a=new o(\"WGS84\");i.wgs84_mercator=r(a,s);var l={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},h={lon:[-180,180],lat:[-85.06,85.06]};i.clip_mercator=function(t,e,i){var n=l[i],r=n[0],o=n[1];return[Math.max(t,r),Math.min(e,o)]},i.in_bounds=function(t,e){return t>h[e][0]&&t<h[e][1]},i.project_xy=n,i.project_xsys=function(t,e){for(var i=Math.min(t.length,e.length),r=new Array(i),o=new Array(i),s=0;s<i;s++){var a=n(t[s],e[s]),l=a[0],h=a[1];r[s]=l,o[s]=h}return[r,o]}},function(t,e,i){var n=t(44);i.create_ref=function(t){var e={type:t.type,id:t.id};null!=t._subtype&&(e.subtype=t._subtype);return e},i.is_ref=function(t){if(n.isObject(t)){var e=Object.keys(t).sort();if(2==e.length)return\"id\"==e[0]&&\"type\"==e[1];if(3==e.length)return\"id\"==e[0]&&\"subtype\"==e[1]&&\"type\"==e[2]}return!1}},function(t,e,i){i.get_indices=function(t){var e=t.selected;return e[\"0d\"].glyph?e[\"0d\"].indices:e[\"1d\"].indices.length>0?e[\"1d\"].indices:e[\"2d\"].indices.length>0?e[\"2d\"].indices:[]}},function(t,e,i){function n(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,2*t.length),i=0,n=e.length;i<n;i+=2){var r=e[i];e[i]=e[i+1],e[i+1]=r}}function r(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,4*t.length),i=0,n=e.length;i<n;i+=4){var r=e[i];e[i]=e[i+3],e[i+3]=r,r=e[i+1],e[i+1]=e[i+2],e[i+2]=r}}function o(t){for(var e=new Uint8Array(t.buffer,t.byteOffset,8*t.length),i=0,n=e.length;i<n;i+=8){var r=e[i];e[i]=e[i+7],e[i+7]=r,r=e[i+1],e[i+1]=e[i+6],e[i+6]=r,r=e[i+2],e[i+2]=e[i+5],e[i+5]=r,r=e[i+3],e[i+3]=e[i+4],e[i+4]=r}}function s(t,e){for(var s=t.order!==i.BYTE_ORDER,a=t.shape,l=null,h=0,c=e;h<c.length;h++){var u=c[h],_=JSON.parse(u[0]);if(_.id===t.__buffer__){l=u[1];break}}var p=new i.ARRAY_TYPES[t.dtype](l);return s&&(2===p.BYTES_PER_ELEMENT?n(p):4===p.BYTES_PER_ELEMENT?r(p):8===p.BYTES_PER_ELEMENT&&o(p)),[p,a]}function a(t,e){return _.isObject(t)&&\"__ndarray__\"in t?c(t):_.isObject(t)&&\"__buffer__\"in t?s(t,e):_.isArray(t)?[t,[]]:void 0}function l(t){var e=new Uint8Array(t),i=Array.from(e).map(function(t){return String.fromCharCode(t)});return btoa(i.join(\"\"))}function h(t){for(var e=atob(t),i=e.length,n=new Uint8Array(i),r=0,o=i;r<o;r++)n[r]=e.charCodeAt(r);return n.buffer}function c(t){var e,n=h(t.__ndarray__),r=t.dtype,o=t.shape;if(!(r in i.ARRAY_TYPES))throw new Error(\"unknown dtype: \"+r);return e=new i.ARRAY_TYPES[r](n),[e,o]}function u(t,e){var n,r=l(t.buffer),o=function(t){if(\"name\"in t.constructor)return t.constructor.name;switch(!0){case t instanceof Uint8Array:return\"Uint8Array\";case t instanceof Int8Array:return\"Int8Array\";case t instanceof Uint16Array:return\"Uint16Array\";case t instanceof Int16Array:return\"Int16Array\";case t instanceof Uint32Array:return\"Uint32Array\";case t instanceof Int32Array:return\"Int32Array\";case t instanceof Float32Array:return\"Float32Array\";case t instanceof Float64Array:return\"Float64Array\";default:throw new Error(\"unsupported typed array\")}}(t);if(!(o in i.DTYPES))throw new Error(\"unknown array type: \"+o);n=i.DTYPES[o];var s={__ndarray__:r,shape:e,dtype:n};return s}var _=t(44),p=t(28);i.ARRAY_TYPES={uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array,float32:Float32Array,float64:Float64Array},i.DTYPES={Uint8Array:\"uint8\",Int8Array:\"int8\",Uint16Array:\"uint16\",Int16Array:\"int16\",Uint32Array:\"uint32\",Int32Array:\"int32\",Float32Array:\"float32\",Float64Array:\"float64\"},i.BYTE_ORDER=p.is_little_endian?\"little\":\"big\",i.swap16=n,i.swap32=r,i.swap64=o,i.process_buffer=s,i.process_array=a,i.arrayBufferToBase64=l,i.base64ToArrayBuffer=h,i.decode_base64=c,i.encode_base64=u,i.decode_column_data=function(t,e){void 0===e&&(e=[]);var i={},n={};for(var r in t){var o=t[r];if(_.isArray(o)){if(0==o.length||!_.isObject(o[0])&&!_.isArray(o[0])){i[r]=o;continue}for(var s=[],l=[],h=0,c=o;h<c.length;h++){var u=c[h],p=a(u,e),d=p[0],f=p[1];s.push(d),l.push(f)}i[r]=s,n[r]=l}else{var v=a(o,e),d=v[0],f=v[1];i[r]=d,n[r]=f}}return[i,n]},i.encode_column_data=function(t,e){var i={};for(var n in t){var r=t[n],o=void 0;if(_.isTypedArray(r))o=u(r,null!=e?e[n]:void 0);else if(_.isArray(r)){for(var s=[],a=0,l=r.length;a<l;a++){var h=r[a];if(_.isTypedArray(h)){var c=null!=e&&null!=e[n]?e[n][a]:void 0;s.push(u(h,c))}else s.push(h)}o=s}else o=r;i[n]=o}return i}},function(t,e,i){var n=t(379),r=t(376),o=function(){return function(){}}();i.SpatialIndex=o;var s=function(t){function e(e){var i=t.call(this)||this;return i.index=r(),i.index.load(e),i}return n.__extends(e,t),Object.defineProperty(e.prototype,\"bbox\",{get:function(){var t=this.index.toJSON(),e=t.minX,i=t.minY,n=t.maxX,r=t.maxY;return{minX:e,minY:i,maxX:n,maxY:r}},enumerable:!0,configurable:!0}),e.prototype.search=function(t){return this.index.search(t)},e.prototype.indices=function(t){for(var e=this.search(t),i=e.length,n=new Array(i),r=0;r<i;r++)n[r]=e[r].i;return n},e}(o);i.RBush=s},function(t,e,i){function n(){for(var t=new Array(32),e=0;e<32;e++)t[e]=\"0123456789ABCDEF\".substr(Math.floor(16*Math.random()),1);return t[12]=\"4\",t[16]=\"0123456789ABCDEF\".substr(3&t[16].charCodeAt(0)|8,1),t.join(\"\")}var r=t(18);i.startsWith=function(t,e,i){void 0===i&&(i=0);return t.substr(i,e.length)==e},i.uuid4=n;var o=1e3;i.uniqueId=function(t){var e=r.settings.dev?\"j\"+o++:n();return null!=t?t+\"-\"+e:e},i.escape=function(t){return t.replace(/(?:[&<>\"'`])/g,function(t){switch(t){case\"&\":return\"&amp;\";case\"<\":return\"&lt;\";case\">\":return\"&gt;\";case'\"':return\"&quot;\";case\"'\":return\"&#x27;\";case\"`\":return\"&#x60;\";default:return t}})},i.unescape=function(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case\"amp\":return\"&\";case\"lt\":return\"<\";case\"gt\":return\">\";case\"quot\":return'\"';case\"#x27\":return\"'\";case\"#x60\":return\"`\";default:return e}})}},function(t,e,i){i.svg_colors={indianred:\"#CD5C5C\",lightcoral:\"#F08080\",salmon:\"#FA8072\",darksalmon:\"#E9967A\",lightsalmon:\"#FFA07A\",crimson:\"#DC143C\",red:\"#FF0000\",firebrick:\"#B22222\",darkred:\"#8B0000\",pink:\"#FFC0CB\",lightpink:\"#FFB6C1\",hotpink:\"#FF69B4\",deeppink:\"#FF1493\",mediumvioletred:\"#C71585\",palevioletred:\"#DB7093\",coral:\"#FF7F50\",tomato:\"#FF6347\",orangered:\"#FF4500\",darkorange:\"#FF8C00\",orange:\"#FFA500\",gold:\"#FFD700\",yellow:\"#FFFF00\",lightyellow:\"#FFFFE0\",lemonchiffon:\"#FFFACD\",lightgoldenrodyellow:\"#FAFAD2\",papayawhip:\"#FFEFD5\",moccasin:\"#FFE4B5\",peachpuff:\"#FFDAB9\",palegoldenrod:\"#EEE8AA\",khaki:\"#F0E68C\",darkkhaki:\"#BDB76B\",lavender:\"#E6E6FA\",thistle:\"#D8BFD8\",plum:\"#DDA0DD\",violet:\"#EE82EE\",orchid:\"#DA70D6\",fuchsia:\"#FF00FF\",magenta:\"#FF00FF\",mediumorchid:\"#BA55D3\",mediumpurple:\"#9370DB\",blueviolet:\"#8A2BE2\",darkviolet:\"#9400D3\",darkorchid:\"#9932CC\",darkmagenta:\"#8B008B\",purple:\"#800080\",indigo:\"#4B0082\",slateblue:\"#6A5ACD\",darkslateblue:\"#483D8B\",mediumslateblue:\"#7B68EE\",greenyellow:\"#ADFF2F\",chartreuse:\"#7FFF00\",lawngreen:\"#7CFC00\",lime:\"#00FF00\",limegreen:\"#32CD32\",palegreen:\"#98FB98\",lightgreen:\"#90EE90\",mediumspringgreen:\"#00FA9A\",springgreen:\"#00FF7F\",mediumseagreen:\"#3CB371\",seagreen:\"#2E8B57\",forestgreen:\"#228B22\",green:\"#008000\",darkgreen:\"#006400\",yellowgreen:\"#9ACD32\",olivedrab:\"#6B8E23\",olive:\"#808000\",darkolivegreen:\"#556B2F\",mediumaquamarine:\"#66CDAA\",darkseagreen:\"#8FBC8F\",lightseagreen:\"#20B2AA\",darkcyan:\"#008B8B\",teal:\"#008080\",aqua:\"#00FFFF\",cyan:\"#00FFFF\",lightcyan:\"#E0FFFF\",paleturquoise:\"#AFEEEE\",aquamarine:\"#7FFFD4\",turquoise:\"#40E0D0\",mediumturquoise:\"#48D1CC\",darkturquoise:\"#00CED1\",cadetblue:\"#5F9EA0\",steelblue:\"#4682B4\",lightsteelblue:\"#B0C4DE\",powderblue:\"#B0E0E6\",lightblue:\"#ADD8E6\",skyblue:\"#87CEEB\",lightskyblue:\"#87CEFA\",deepskyblue:\"#00BFFF\",dodgerblue:\"#1E90FF\",cornflowerblue:\"#6495ED\",royalblue:\"#4169E1\",blue:\"#0000FF\",mediumblue:\"#0000CD\",darkblue:\"#00008B\",navy:\"#000080\",midnightblue:\"#191970\",cornsilk:\"#FFF8DC\",blanchedalmond:\"#FFEBCD\",bisque:\"#FFE4C4\",navajowhite:\"#FFDEAD\",wheat:\"#F5DEB3\",burlywood:\"#DEB887\",tan:\"#D2B48C\",rosybrown:\"#BC8F8F\",sandybrown:\"#F4A460\",goldenrod:\"#DAA520\",darkgoldenrod:\"#B8860B\",peru:\"#CD853F\",chocolate:\"#D2691E\",saddlebrown:\"#8B4513\",sienna:\"#A0522D\",brown:\"#A52A2A\",maroon:\"#800000\",white:\"#FFFFFF\",snow:\"#FFFAFA\",honeydew:\"#F0FFF0\",mintcream:\"#F5FFFA\",azure:\"#F0FFFF\",aliceblue:\"#F0F8FF\",ghostwhite:\"#F8F8FF\",whitesmoke:\"#F5F5F5\",seashell:\"#FFF5EE\",beige:\"#F5F5DC\",oldlace:\"#FDF5E6\",floralwhite:\"#FFFAF0\",ivory:\"#FFFFF0\",antiquewhite:\"#FAEBD7\",linen:\"#FAF0E6\",lavenderblush:\"#FFF0F5\",mistyrose:\"#FFE4E1\",gainsboro:\"#DCDCDC\",lightgray:\"#D3D3D3\",lightgrey:\"#D3D3D3\",silver:\"#C0C0C0\",darkgray:\"#A9A9A9\",darkgrey:\"#A9A9A9\",gray:\"#808080\",grey:\"#808080\",dimgray:\"#696969\",dimgrey:\"#696969\",lightslategray:\"#778899\",lightslategrey:\"#778899\",slategray:\"#708090\",slategrey:\"#708090\",darkslategray:\"#2F4F4F\",darkslategrey:\"#2F4F4F\",black:\"#000000\"},i.is_svg_color=function(t){return t in i.svg_colors}},function(t,e,i){var n=t(377),r=t(347),o=t(378),s=t(38),a=t(44);i.replace_placeholders=function(t,e,i,l,h){void 0===l&&(l=null);void 0===h&&(h={});return t=t.replace(/(^|[^\\$])\\$(\\w+)/g,function(t,e,i){return e+\"@$\"+i}),t=t.replace(/(^|[^@])@(?:(\\$?\\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,c,u,_,p){var d;if(\"$\"==(u=null!=_?_:u)[0])d=h[u.substring(1)];else{var f=e.get_column(u);null!=f&&(d=f[i])}var v=null;if(null==d)v=\"???\";else{if(\"safe\"==p)return\"\"+c+d;if(null!=p)if(null!=l&&u in l){var m=l[u];switch(m){case\"numeral\":v=r.format(d,p);break;case\"datetime\":v=o(d,p);break;case\"printf\":v=n.sprintf(p,d);break;default:throw new Error(\"Unknown tooltip field formatter type '\"+m+\"'\")}}else v=r.format(d,p);else v=function(t){if(a.isNumber(t)){var e=function(){switch(!1){case Math.floor(t)!=t:return\"%d\";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return\"%0.3f\";default:return\"%0.3e\"}}();return n.sprintf(e,t)}return\"\"+t}(d)}return\"\"+c+s.escape(v)})}},function(t,e,i){var n=t(5),r={};i.get_text_height=function(t){if(null!=r[t])return r[t];var e=n.span({style:{font:t}},\"Hg\"),i=n.div({style:{display:\"inline-block\",width:\"1px\",height:\"0px\"}}),o=n.div({},e,i);document.body.appendChild(o);try{i.style.verticalAlign=\"baseline\";var s=n.offset(i).top-n.offset(e).top;i.style.verticalAlign=\"bottom\";var a=n.offset(i).top-n.offset(e).top,l={height:a,ascent:s,descent:a-s};return r[t]=l,l}finally{document.body.removeChild(o)}}},function(t,e,i){var n=(\"undefined\"!=typeof window?window.requestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.webkitRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.mozRequestAnimationFrame:void 0)||(\"undefined\"!=typeof window?window.msRequestAnimationFrame:void 0)||function(t){return t(Date.now()),-1};i.throttle=function(t,e){var i=null,r=0,o=!1,s=function(){r=Date.now(),i=null,o=!1,t()};return function(){var t=Date.now(),a=e-(t-r);a<=0&&!o?(null!=i&&clearTimeout(i),o=!0,n(s)):i||o||(i=setTimeout(function(){return n(s)},a))}}},function(t,e,i){i.concat=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=t.length,r=0,o=e;r<o.length;r++){var s=o[r];n+=s.length}var a=new t.constructor(n);a.set(t,0);for(var l=t.length,h=0,c=e;h<c.length;h++){var s=c[h];a.set(s,l),l+=s.length}return a}},function(t,e,i){function n(t){return\"[object Number]\"===o.call(t)}var r=t(21),o=Object.prototype.toString;i.isBoolean=function(t){return!0===t||!1===t||\"[object Boolean]\"===o.call(t)},i.isNumber=n,i.isInteger=function(t){return n(t)&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return\"[object String]\"===o.call(t)},i.isStrictNaN=function(t){return n(t)&&t!==+t},i.isFunction=function(t){return\"[object Function]\"===o.call(t)},i.isArray=function(t){return Array.isArray(t)},i.isArrayOf=function(t,e){return r.all(t,e)},i.isArrayableOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(!e(t[i]))return!1;return!0},i.isTypedArray=function(t){return null!=t&&null!=t.buffer&&t.buffer instanceof ArrayBuffer},i.isObject=function(t){var e=typeof t;return\"function\"===e||\"object\"===e&&!!t}},function(t,e,i){function n(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}i.getDeltaY=function(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=function(t){return n(t.offsetParent||document.body)||n(t)||16}(t.target);break;case t.DOM_DELTA_PAGE:e*=function(t){return t.clientHeight}(t.target)}return e}},function(t,e,i){function n(t,e,i){var n=[t.start,t.end],r=n[0],o=n[1],s=null!=i?i:(o+r)/2,a=r-(r-s)*e,l=o-(o-s)*e;return[a,l]}function r(t,e){var i=e[0],n=e[1],r={};for(var o in t){var s=t[o],a=s.r_invert(i,n),l=a[0],h=a[1];r[o]={start:l,end:h}}return r}var o=t(31);i.scale_highlow=n,i.get_info=r,i.scale_range=function(t,e,i,s,a){void 0===i&&(i=!0);void 0===s&&(s=!0);e=o.clamp(e,-.9,.9);var l=i?e:0,h=n(t.bbox.h_range,l,null!=a?a.x:void 0),c=h[0],u=h[1],_=r(t.xscales,[c,u]),p=s?e:0,d=n(t.bbox.v_range,p,null!=a?a.y:void 0),f=d[0],v=d[1],m=r(t.yscales,[f,v]);return{xrs:_,yrs:m,factor:e}}},function(t,e,i){var n=t(44);i.isValue=function(t){return n.isObject(t)&&\"value\"in t},i.isField=function(t){return n.isObject(t)&&\"field\"in t}},function(t,e,i){var n=t(379),r=t(19),o=t(38),s=function(t){function e(e){var i=t.call(this)||this;if(i.removed=new r.Signal0(i,\"removed\"),null==e.model)throw new Error(\"model of a view wasn't configured\");return i.model=e.model,i._parent=e.parent,i.id=e.id||o.uniqueId(),i.initialize(e),!1!==e.connect_signals&&i.connect_signals(),i}return n.__extends(e,t),e.prototype.initialize=function(t){},e.prototype.remove=function(){this._parent=void 0,this.disconnect_signals(),this.removed.emit()},e.prototype.toString=function(){return this.model.type+\"View(\"+this.id+\")\"},Object.defineProperty(e.prototype,\"parent\",{get:function(){if(void 0!==this._parent)return this._parent;throw new Error(\"parent of a view wasn't configured\")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_root\",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"root\",{get:function(){return this.is_root?this:this.parent.root},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){},e.prototype.disconnect_signals=function(){r.Signal.disconnectReceiver(this)},e.prototype.notify_finished=function(){this.root.notify_finished()},e}(r.Signalable());i.View=s},function(t,e,i){var n=t(379),r=t(16),o=t(27),s=function(){function t(t,e){void 0===e&&(e=\"\"),this.obj=t,this.prefix=e,this.cache={};var i=t.properties[e+this.do_attr].spec;this.doit=null!==i.value;for(var n=0,r=this.attrs;n<r.length;n++){var o=r[n];this[o]=t.properties[e+o]}}return t.prototype.warm_cache=function(t){for(var e=0,i=this.attrs;e<i.length;e++){var n=i[e],r=this.obj.properties[this.prefix+n];if(void 0!==r.spec.value)this.cache[n]=r.spec.value;else{if(null==t)throw new Error(\"source is required with a vectorized visual property\");this.cache[n+\"_array\"]=r.array(t)}}},t.prototype.cache_select=function(t,e){var i,n=this.obj.properties[this.prefix+t];return void 0!==n.spec.value?this.cache[t]=i=n.spec.value:this.cache[t]=i=this.cache[t+\"_array\"][e],i},t.prototype.set_vectorize=function(t,e){null!=this.all_indices?this._set_vectorize(t,this.all_indices[e]):this._set_vectorize(t,e)},t}();i.ContextProperties=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.strokeStyle=this.line_color.value(),t.globalAlpha=this.line_alpha.value(),t.lineWidth=this.line_width.value(),t.lineJoin=this.line_join.value(),t.lineCap=this.line_cap.value(),t.setLineDash(this.line_dash.value()),t.setLineDashOffset(this.line_dash_offset.value())},e.prototype._set_vectorize=function(t,e){this.cache_select(\"line_color\",e),t.strokeStyle!==this.cache.line_color&&(t.strokeStyle=this.cache.line_color),this.cache_select(\"line_alpha\",e),t.globalAlpha!==this.cache.line_alpha&&(t.globalAlpha=this.cache.line_alpha),this.cache_select(\"line_width\",e),t.lineWidth!==this.cache.line_width&&(t.lineWidth=this.cache.line_width),this.cache_select(\"line_join\",e),t.lineJoin!==this.cache.line_join&&(t.lineJoin=this.cache.line_join),this.cache_select(\"line_cap\",e),t.lineCap!==this.cache.line_cap&&(t.lineCap=this.cache.line_cap),this.cache_select(\"line_dash\",e),t.getLineDash()!==this.cache.line_dash&&t.setLineDash(this.cache.line_dash),this.cache_select(\"line_dash_offset\",e),t.getLineDashOffset()!==this.cache.line_dash_offset&&t.setLineDashOffset(this.cache.line_dash_offset)},e.prototype.color_value=function(){var t=o.color2rgba(this.line_color.value(),this.line_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},e}(s);i.Line=a,a.prototype.attrs=Object.keys(r.line()),a.prototype.do_attr=\"line_color\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.set_value=function(t){t.fillStyle=this.fill_color.value(),t.globalAlpha=this.fill_alpha.value()},e.prototype._set_vectorize=function(t,e){this.cache_select(\"fill_color\",e),t.fillStyle!==this.cache.fill_color&&(t.fillStyle=this.cache.fill_color),this.cache_select(\"fill_alpha\",e),t.globalAlpha!==this.cache.fill_alpha&&(t.globalAlpha=this.cache.fill_alpha)},e.prototype.color_value=function(){var t=o.color2rgba(this.fill_color.value(),this.fill_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},e}(s);i.Fill=l,l.prototype.attrs=Object.keys(r.fill()),l.prototype.do_attr=\"fill_color\";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.cache_select=function(e,i){var n;if(\"font\"==e){t.prototype.cache_select.call(this,\"text_font_style\",i),t.prototype.cache_select.call(this,\"text_font_size\",i),t.prototype.cache_select.call(this,\"text_font\",i);var r=this.cache,o=r.text_font_style,s=r.text_font_size,a=r.text_font;this.cache.font=n=o+\" \"+s+\" \"+a}else n=t.prototype.cache_select.call(this,e,i);return n},e.prototype.font_value=function(){var t=this.text_font.value(),e=this.text_font_size.value(),i=this.text_font_style.value();return i+\" \"+e+\" \"+t},e.prototype.color_value=function(){var t=o.color2rgba(this.text_color.value(),this.text_alpha.value()),e=t[0],i=t[1],n=t[2],r=t[3];return\"rgba(\"+255*e+\",\"+255*i+\",\"+255*n+\",\"+r+\")\"},e.prototype.set_value=function(t){t.font=this.font_value(),t.fillStyle=this.text_color.value(),t.globalAlpha=this.text_alpha.value(),t.textAlign=this.text_align.value(),t.textBaseline=this.text_baseline.value()},e.prototype._set_vectorize=function(t,e){this.cache_select(\"font\",e),t.font!==this.cache.font&&(t.font=this.cache.font),this.cache_select(\"text_color\",e),t.fillStyle!==this.cache.text_color&&(t.fillStyle=this.cache.text_color),this.cache_select(\"text_alpha\",e),t.globalAlpha!==this.cache.text_alpha&&(t.globalAlpha=this.cache.text_alpha),this.cache_select(\"text_align\",e),t.textAlign!==this.cache.text_align&&(t.textAlign=this.cache.text_align),this.cache_select(\"text_baseline\",e),t.textBaseline!==this.cache.text_baseline&&(t.textBaseline=this.cache.text_baseline)},e}(s);i.Text=h,h.prototype.attrs=Object.keys(r.text()),h.prototype.do_attr=\"text_color\";var c=function(){function t(t){for(var e=0,i=t.mixins;e<i.length;e++){var n=i[e],r=n.split(\":\"),o=r[0],s=r[1],c=void 0===s?\"\":s,u=void 0;switch(o){case\"line\":u=a;break;case\"fill\":u=l;break;case\"text\":u=h;break;default:throw new Error(\"unknown visual: \"+o)}this[c+o]=new u(t,c)}}return t.prototype.warm_cache=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&i.warm_cache(t)}},t.prototype.set_all_indices=function(t){for(var e in this)if(this.hasOwnProperty(e)){var i=this[e];i instanceof s&&(i.all_indices=t)}},t}();i.Visuals=c},function(t,e,i){var n=t(379),r=t(0),o=t(263),s=t(14),a=t(3),l=t(8),h=t(19),c=t(34),u=t(36),_=t(29),p=t(21),d=t(32),f=t(30),v=t(44),m=t(146),g=t(184),y=t(53),b=function(){function t(t){this.document=t,this.session=null,this.subscribed_models=new _.Set}return t.prototype.send_event=function(t){null!=this.session&&this.session.send_event(t)},t.prototype.trigger=function(t){for(var e=0,i=this.subscribed_models.values;e<i.length;e++){var n=i[e];if(null==t.model_id||t.model_id===n){var r=this.document._all_models[n];null!=r&&r._process_event(t)}}},t}();i.EventManager=b;var x=function(){return function(t){this.document=t}}();i.DocumentChangedEvent=x;var w=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e)||this;return a.model=i,a.attr=n,a.old=r,a.new_=o,a.setter_id=s,a}return n.__extends(e,t),e.prototype.json=function(t){if(\"id\"===this.attr)throw new Error(\"'id' field should never change, whatever code just set it is wrong\");var e=this.new_,i=l.HasProps._value_to_json(this.attr,e,this.model),n={};l.HasProps._value_record_references(e,n,!0),this.model.id in n&&this.model!==e&&delete n[this.model.id];for(var r in n)t[r]=n[r];return{kind:\"ModelChanged\",model:this.model.ref(),attr:this.attr,new:i}},e}(x);i.ModelChangedEvent=w;var k=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.title=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return{kind:\"TitleChanged\",title:this.title}},e}(x);i.TitleChangedEvent=k;var S=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.model=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return l.HasProps._value_record_references(this.model,t,!0),{kind:\"RootAdded\",model:this.model.ref()}},e}(x);i.RootAddedEvent=S;var C=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.model=i,r.setter_id=n,r}return n.__extends(e,t),e.prototype.json=function(t){return{kind:\"RootRemoved\",model:this.model.ref()}},e}(x);i.RootRemovedEvent=C,i.documents=[],i.DEFAULT_TITLE=\"Bokeh Application\";var T=function(){function t(){i.documents.push(this),this._init_timestamp=Date.now(),this._title=i.DEFAULT_TITLE,this._roots=[],this._all_models={},this._all_models_by_name=new _.MultiDict,this._all_models_freeze_count=0,this._callbacks=[],this.event_manager=new b(this),this.idle=new h.Signal0(this,\"idle\"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}return Object.defineProperty(t.prototype,\"layoutables\",{get:function(){return this._roots.filter(function(t){return t instanceof m.LayoutDOM})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"is_idle\",{get:function(){for(var t=0,e=this.layoutables;t<e.length;t++){var i=e[t];if(!this._idle_roots.has(i))return!1}return!0},enumerable:!0,configurable:!0}),t.prototype.notify_idle=function(t){this._idle_roots.set(t,!0),this.is_idle&&(s.logger.info(\"document idle at \"+(Date.now()-this._init_timestamp)+\" ms\"),this.idle.emit())},t.prototype.clear=function(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}},t.prototype.interactive_start=function(t){null==this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new a.LODStart({}))),this._interactive_timestamp=Date.now()},t.prototype.interactive_stop=function(t){null!=this._interactive_plot&&this._interactive_plot.id===t.id&&this._interactive_plot.trigger_event(new a.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},t.prototype.interactive_duration=function(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},t.prototype.destructively_move=function(t){if(t===this)throw new Error(\"Attempted to overwrite a document with itself\");t.clear();var e=p.copy(this._roots);this.clear();for(var i=0,n=e;i<n.length;i++){var r=n[i];if(null!=r.document)throw new Error(\"Somehow we didn't detach \"+r)}if(0!==Object.keys(this._all_models).length)throw new Error(\"this._all_models still had stuff in it: \"+this._all_models);for(var o=0,s=e;o<s.length;o++){var r=s[o];t.add_root(r)}t.set_title(this._title)},t.prototype._push_all_models_freeze=function(){this._all_models_freeze_count+=1},t.prototype._pop_all_models_freeze=function(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._invalidate_all_models=function(){s.logger.debug(\"invalidating document models\"),0===this._all_models_freeze_count&&this._recompute_all_models()},t.prototype._recompute_all_models=function(){for(var t=new _.Set,e=0,i=this._roots;e<i.length;e++){var n=i[e];t=t.union(n.references())}for(var r=new _.Set(d.values(this._all_models)),o=r.diff(t),s=t.diff(r),a={},l=0,h=t.values;l<h.length;l++){var c=h[l];a[c.id]=c}for(var u=0,p=o.values;u<p.length;u++){var f=p[u];f.detach_document(),f instanceof y.Model&&null!=f.name&&this._all_models_by_name.remove_value(f.name,f)}for(var v=0,m=s.values;v<m.length;v++){var g=m[v];g.attach_document(this),g instanceof y.Model&&null!=g.name&&this._all_models_by_name.add_value(g.name,g)}this._all_models=a},t.prototype.roots=function(){return this._roots},t.prototype.add_root=function(t,e){if(s.logger.debug(\"Adding root: \"+t),!p.includes(this._roots,t)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new S(this,t,e))}},t.prototype.remove_root=function(t,e){var i=this._roots.indexOf(t);if(!(i<0)){this._push_all_models_freeze();try{this._roots.splice(i,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new C(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){t!==this._title&&(this._title=t,this._trigger_on_change(new k(this,t,e)))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,\"Multiple models are named '\"+t+\"'\")},t.prototype.on_change=function(t){p.includes(this._callbacks,t)||this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e=this._callbacks.indexOf(t);e>=0&&this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){for(var e=0,i=this._callbacks;e<i.length;e++){var n=i[e];n(t)}},t.prototype._notify_change=function(t,e,i,n,r){\"name\"===e&&(this._all_models_by_name.remove_value(i,t),null!=n&&this._all_models_by_name.add_value(n,t));var o=null!=r?r.setter_id:void 0;this._trigger_on_change(new w(this,t,e,i,n,o))},t._references_json=function(t,e){void 0===e&&(e=!0);for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.ref();s.attributes=o.attributes_as_json(e),delete s.attributes.id,i.push(s)}return i},t._instantiate_object=function(t,e,i){var n=d.extend({},i,{id:t,__deferred__:!0}),o=r.Models(e);return new o(n)},t._instantiate_references_json=function(e,i){for(var n={},r=0,o=e;r<o.length;r++){var s=o[r],a=s.id,l=s.type,h=s.attributes||{},c=void 0;a in i?c=i[a]:(c=t._instantiate_object(a,l,h),null!=s.subtype&&c.set_subtype(s.subtype)),n[c.id]=c}return n},t._resolve_refs=function(t,e,i){function n(t){if(c.is_ref(t)){if(t.id in e)return e[t.id];if(t.id in i)return i[t.id];throw new Error(\"reference \"+JSON.stringify(t)+\" isn't known (not in Document?)\")}return v.isArray(t)?function(t){for(var e=[],i=0,r=t;i<r.length;i++){var o=r[i];e.push(n(o))}return e}(t):v.isObject(t)?function(t){var e={};for(var i in t){var r=t[i];e[i]=n(r)}return e}(t):t}return n(t)},t._initialize_references_json=function(e,i,n){function r(t,e){function i(r){if(r instanceof l.HasProps){if(!(r.id in n)&&r.id in t){n[r.id]=!0;var o=t[r.id],s=o[1],a=o[2];for(var h in s){var c=s[h];i(c)}e(r,s,a)}}else if(v.isArray(r))for(var u=0,_=r;u<_.length;u++){var c=_[u];i(c)}else if(v.isObject(r))for(var p in r){var c=r[p];i(c)}}var n={};for(var r in t){var o=t[r],s=o[0];i(s)}}for(var o={},s=0,a=e;s<a.length;s++){var h=a[s],c=h.id,u=h.attributes,_=!(c in i),p=_?n[c]:i[c],d=t._resolve_refs(u,i,n);o[p.id]=[p,d,_]}r(o,function(t,e,i){i&&t.setv(e,{silent:!0})}),r(o,function(t,e,i){i&&t.finalize()})},t._event_for_attribute_change=function(t,e,i,n,r){var o=n.get_model_by_id(t.id);if(o.attribute_is_serializable(e)){var s={kind:\"ModelChanged\",model:{id:t.id,type:t.type},attr:e,new:i};return l.HasProps._json_record_references(n,i,r,!0),s}return null},t._events_to_sync_objects=function(e,i,n,r){for(var o=Object.keys(e.attributes),a=Object.keys(i.attributes),l=p.difference(o,a),h=p.difference(a,o),c=p.intersection(o,a),u=[],_=0,d=l;_<d.length;_++){var v=d[_];s.logger.warn(\"Server sent key \"+v+\" but we don't seem to have it in our JSON\")}for(var m=0,g=h;m<g.length;m++){var v=g[m],y=i.attributes[v];u.push(t._event_for_attribute_change(e,v,y,n,r))}for(var b=0,x=c;b<x.length;b++){var v=x[b],w=e.attributes[v],y=i.attributes[v];null==w&&null==y||(null==w||null==y?u.push(t._event_for_attribute_change(e,v,y,n,r)):f.isEqual(w,y)||u.push(t._event_for_attribute_change(e,v,y,n,r)))}return u.filter(function(t){return null!=t})},t._compute_patch_since_json=function(e,i){function n(t){for(var e={},i=0,n=t.roots.references;i<n.length;i++){var r=n[i];e[r.id]=r}return e}for(var r=i.to_json(!1),o=n(e),s={},a=[],l=0,h=e.roots.root_ids;l<h.length;l++){var c=h[l];s[c]=o[c],a.push(c)}for(var u=n(r),_={},f=[],v=0,m=r.roots.root_ids;v<m.length;v++){var c=m[v];_[c]=u[c],f.push(c)}if(a.sort(),f.sort(),p.difference(a,f).length>0||p.difference(f,a).length>0)throw new Error(\"Not implemented: computing add/remove of document roots\");var g={},y=[];for(var b in i._all_models)if(b in o){var x=t._events_to_sync_objects(o[b],u[b],i,g);y=y.concat(x)}return{references:t._references_json(d.values(g),!1),events:y}},t.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){void 0===e&&(e=!0);var i=this._roots.map(function(t){return t.id}),n=d.values(this._all_models);return{title:this._title,roots:{root_ids:i,references:t._references_json(n,e)}}},t.from_json_string=function(e){var i=JSON.parse(e);return t.from_json(i)},t.from_json=function(e){s.logger.debug(\"Creating Document from JSON\");var i=e.version,n=-1!==i.indexOf(\"+\")||-1!==i.indexOf(\"-\"),r=\"Library versions: JS (\"+o.version+\") / Python (\"+i+\")\";n||o.version===i?s.logger.debug(r):(s.logger.warn(\"JS/Python version mismatch\"),s.logger.warn(r));var a=e.roots,l=a.root_ids,h=a.references,c=t._instantiate_references_json(h,{});t._initialize_references_json(h,{},c);for(var u=new t,_=0,p=l;_<p.length;_++){var d=p[_];u.add_root(c[d])}return u.set_title(e.title),u},t.prototype.replace_with_json=function(e){var i=t.from_json(e);i.destructively_move(this)},t.prototype.create_json_patch_string=function(t){return JSON.stringify(this.create_json_patch(t))},t.prototype.create_json_patch=function(e){for(var i={},n=[],r=0,o=e;r<o.length;r++){var a=o[r];if(a.document!==this)throw s.logger.warn(\"Cannot create a patch using events from a different document, event had \",a.document,\" we are \",this),new Error(\"Cannot create a patch using events from a different document\");n.push(a.json(i))}return{events:n,references:t._references_json(d.values(i))}},t.prototype.apply_json_patch=function(e,i,n){for(var r=e.references,o=e.events,a=t._instantiate_references_json(r,this._all_models),l=0,h=o;l<h.length;l++){var c=h[l];switch(c.kind){case\"RootAdded\":case\"RootRemoved\":case\"ModelChanged\":var _=c.model.id;if(_ in this._all_models)a[_]=this._all_models[_];else if(!(_ in a))throw s.logger.warn(\"Got an event for unknown model \",c.model),new Error(\"event model wasn't known\")}}var p={},d={};for(var f in a){var v=a[f];f in this._all_models?p[f]=v:d[f]=v}t._initialize_references_json(r,p,d);for(var m=0,y=o;m<y.length;m++){var c=y[m];switch(c.kind){case\"ModelChanged\":var b=c.model.id;if(!(b in this._all_models))throw new Error(\"Cannot apply patch to \"+b+\" which is not in the document\");var x=this._all_models[b],w=c.attr,k=c.model.type;if(\"data\"===w&&\"ColumnDataSource\"===k){var S=u.decode_column_data(c.new,i),C=S[0],T=S[1];x.setv({_shapes:T,data:C},{setter_id:n})}else{var v=t._resolve_refs(c.new,p,d);x.setv((F={},F[w]=v,F),{setter_id:n})}break;case\"ColumnDataChanged\":var A=c.column_source.id;if(!(A in this._all_models))throw new Error(\"Cannot stream to \"+A+\" which is not in the document\");var E=this._all_models[A],M=u.decode_column_data(c.new,i),C=M[0],T=M[1];if(null!=c.cols){for(var O in E.data)O in C||(C[O]=E.data[O]);for(var O in E._shapes)O in T||(T[O]=E._shapes[O])}E.setv({_shapes:T,data:C},{setter_id:n,check_eq:!1});break;case\"ColumnsStreamed\":var A=c.column_source.id;if(!(A in this._all_models))throw new Error(\"Cannot stream to \"+A+\" which is not in the document\");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error(\"Cannot stream to non-ColumnDataSource\");var C=c.data,z=c.rollover;E.stream(C,z);break;case\"ColumnsPatched\":var A=c.column_source.id;if(!(A in this._all_models))throw new Error(\"Cannot patch \"+A+\" which is not in the document\");var E=this._all_models[A];if(!(E instanceof g.ColumnDataSource))throw new Error(\"Cannot patch non-ColumnDataSource\");var P=c.patches;E.patch(P);break;case\"RootAdded\":var j=c.model.id,N=a[j];this.add_root(N,n);break;case\"RootRemoved\":var j=c.model.id,N=a[j];this.remove_root(N,n);break;case\"TitleChanged\":this.set_title(c.title,n);break;default:throw new Error(\"Unknown patch event \"+JSON.stringify(c))}}var F},t}();i.Document=T},function(t,e,i){function n(t,e){e.buffers.length>0?t.consume(e.buffers[0].buffer):t.consume(e.content.data);var i=t.message;null!=i&&this.apply_json_patch(i.content,i.buffers)}function r(t,e){if(\"undefined\"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){d.logger.info(\"Registering Jupyter comms for target \"+t);var r=Jupyter.notebook.kernel.comm_manager;try{r.register_target(t,function(i){d.logger.info(\"Registering Jupyter comms for target \"+t);var r=new x.Receiver;i.on_msg(n.bind(e,r))})}catch(t){d.logger.warn(\"Jupyter comms failed to register. push_notebook() will not function. (exception reported: \"+t+\")\")}}else if(e.roots()[0].id in i.kernels){d.logger.info(\"Registering JupyterLab comms for target \"+t);var o=i.kernels[e.roots()[0].id];try{o.registerCommTarget(t,function(i){d.logger.info(\"Registering JupyterLab comms for target \"+t);var r=new x.Receiver;i.onMsg=n.bind(e,r)})}catch(t){d.logger.warn(\"Jupyter comms failed to register. push_notebook() will not function. (exception reported: \"+t+\")\")}}else console.warn(\"Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest jupyterlab_bokeh extension is installed. In an exported notebook this warning is expected.\")}function o(t){var e=new t.default_view({model:t,parent:null});return p.index[t.id]=e,e}function s(t){var e=t.elementid,n=document.getElementById(e);if(null==n)throw new Error(\"Error rendering Bokeh model: could not find tag with id: \"+e);if(!document.body.contains(n))throw new Error(\"Error rendering Bokeh model: element with id '\"+e+\"' must be under <body>\");if(\"SCRIPT\"==n.tagName){!function(t,e){var i=t.dataset,n=i.bokehLogLevel,r=i.bokehDocId,o=i.bokehModelId,s=i.bokehSessionId;null!=n&&n.length>0&&d.set_log_level(n);null!=r&&r.length>0&&(e.docid=r);null!=o&&o.length>0&&(e.modelid=o);null!=s&&s.length>0&&(e.sessionid=s);d.logger.info(\"Will inject Bokeh script tag with params \"+JSON.stringify(e))}(n,t);var r=v.div({class:i.BOKEH_ROOT});v.replaceWith(n,r);var o=v.div();r.appendChild(o),n=o}return n}function a(t,e,i){var n=i.get_model_by_id(t);if(null==n)throw new Error(\"Model \"+t+\" was not in document \"+i);var r=o(n);return r.renderTo(e,!0),r}function l(t,e,i){function n(t){var i=o(t);i.renderTo(e),r[t.id]=i}void 0===i&&(i=!1);for(var r={},s=0,a=t.roots();s<a.length;s++){var l=a[s];n(l)}return i&&(window.document.title=t.title()),t.on_change(function(t){t instanceof f.RootAddedEvent?n(t.model):t instanceof f.RootRemovedEvent?function(t){if(t.id in r){var i=r[t.id];e.removeChild(i.el),delete r[t.id],delete p.index[t.id]}}(t.model):i&&t instanceof f.TitleChangedEvent&&(window.document.title=t.title)}),r}function h(t,e,i){t in k||(k[t]={});var n=k[t];return e in n||(n[e]=w.pull_session(t,e,i)),n[e]}function c(t,e,i,n){var r=window.location.search.substr(1),o=h(e,i,r);return o.then(function(e){return l(e.document,t,n)},function(t){throw d.logger.error(\"Failed to load Bokeh session \"+i+\": \"+t),t})}function u(t,e,i,n){var r=window.location.search.substr(1),s=h(e,n,r);return s.then(function(e){var n=e.document.get_model_by_id(i);if(null==n)throw new Error(\"Did not find model \"+i+\" in session\");var r=o(n);return r.renderTo(t,!0),r},function(t){throw d.logger.error(\"Failed to load Bokeh session \"+n+\": \"+t),t})}function _(t,e){var i=\"ws:\";\"https:\"==window.location.protocol&&(i=\"wss:\");var n;return null!=e?(n=document.createElement(\"a\")).href=e:n=window.location,null!=t?\"/\"==t&&(t=\"\"):t=n.pathname.replace(/\\/+$/,\"\"),i+\"//\"+n.host+t+\"/ws\"}var p=t(0),d=t(14),f=t(50),v=t(5),m=t(25),g=t(38),y=t(32),b=t(44),x=t(261),w=t(1);i.kernels={},i.BOKEH_ROOT=\"bk-root\",i.add_model_standalone=a,i.add_document_standalone=l;var k={};i.add_document_from_session=c,i.add_model_from_session=u,i.inject_css=function(t){var e=v.link({href:t,rel:\"stylesheet\",type:\"text/css\"});document.body.appendChild(e)},i.inject_raw_css=function(t){var e=v.style({},t);document.body.appendChild(e)},i.embed_items_notebook=function(t,e){if(1!=y.size(t))throw new Error(\"embed_items_notebook expects exactly one document in docs_json\");for(var i=f.Document.from_json(y.values(t)[0]),n=0,o=e;n<o.length;n++){var h=o[n];null!=h.notebook_comms_target&&r(h.notebook_comms_target,i);var c=s(h);null!=h.modelid?a(h.modelid,c,i):l(i,c,!1)}},i.embed_items=function(t,e,i,n){m.defer(function(){return function(t,e,i,n){b.isString(t)&&(t=JSON.parse(g.unescape(t)));var r={};for(var o in t){var h=t[o];r[o]=f.Document.from_json(h)}for(var p=0,v=e;p<v.length;p++){var m=v[p],y=s(m),x=null!=m.use_for_title&&m.use_for_title;if(null!=m.sessionid){var w=_(i,n);d.logger.debug(\"embed: computed ws url: \"+w);(null!=m.modelid?u(y,w,m.modelid,m.sessionid):c(y,w,m.sessionid,x)).then(function(){console.log(\"Bokeh items were rendered successfully\")},function(t){console.log(\"Error rendering Bokeh items \",t)})}else{if(null==m.docid)throw new Error(\"Error rendering Bokeh items to element \"+m.elementid+\": no document ID or session ID specified\");null!=m.modelid?a(m.modelid,y,r[m.docid]):l(r[m.docid],y,x)}}}(t,e,i,n)})}},function(t,e,i){t(258);var n=t(263);i.version=n.version;var r=t(51);i.embed=r;var o=t(259);i.protocol=o;var s=t(14);i.logger=s.logger,i.set_log_level=s.set_log_level;var a=t(18);i.settings=a.settings;var l=t(0);i.Models=l.Models,i.index=l.index;var h=t(50);i.documents=h.documents;var c=t(262);i.safely=c.safely},function(t,e,i){var n=t(379),r=t(8),o=t(15),s=t(44),a=t(32),l=t(14),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Model\",this.define({tags:[o.Array,[]],name:[o.String],js_property_callbacks:[o.Any,{}],js_event_callbacks:[o.Any,{}],subscribed_events:[o.Array,[]]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this);for(var i in this.js_property_callbacks)for(var n=this.js_property_callbacks[i],r=i.split(\":\"),o=r[0],s=r[1],a=void 0===s?null:s,l=function(t){var i=null!=a?h.properties[a][o]:h[o];h.connect(i,function(){return t.execute(e,{})})},h=this,c=0,u=n;c<u.length;c++){var _=u[c];l(_)}this.connect(this.properties.js_event_callbacks.change,function(){return e._update_event_callbacks}),this.connect(this.properties.subscribed_events.change,function(){return e._update_event_callbacks})},e.prototype._process_event=function(t){if(t.is_applicable_to(this)){t=t._customize_event(this);for(var e=0,i=this.js_event_callbacks[t.event_name]||[];e<i.length;e++){var n=i[e];n.execute(t,{})}null!=this.document&&this.subscribed_events.some(function(e){return e==t.event_name})&&this.document.event_manager.send_event(t)}},e.prototype.trigger_event=function(t){null!=this.document&&this.document.event_manager.trigger(t.set_model_id(this.id))},e.prototype._update_event_callbacks=function(){null!=this.document?this.document.event_manager.subscribed_models.push(this.id):l.logger.warn(\"WARNING: Document not defined for updating event callbacks\")},e.prototype._doc_attached=function(){a.isEmpty(this.js_event_callbacks)&&a.isEmpty(this.subscribed_events)||this._update_event_callbacks()},e.prototype.select=function(t){if(s.isString(t))return this.references().filter(function(i){return i instanceof e&&i.name===t});if(t.prototype instanceof r.HasProps)return this.references().filter(function(e){return e instanceof t});throw new Error(\"invalid selector\")},e.prototype.select_one=function(t){var e=this.select(t);switch(e.length){case 0:return null;case 1:return e[0];default:throw new Error(\"found more than one object matching given selector\")}},e}(r.HasProps);i.Model=h,h.initClass()},function(t,e,i){var n=t(379),r=t(12),o=t(15),s=t(33),a=t(32),l=t(173),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._get_size=function(){throw new Error(\"not implemented\")},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype.set_data=function(t){var e=this.model.materialize_dataspecs(t);if(a.extend(this,e),this.plot_model.use_map){null!=this._x&&(i=s.project_xy(this._x,this._y),this._x=i[0],this._y=i[1]),null!=this._xs&&(n=s.project_xsys(this._xs,this._ys),this._xs=n[0],this._ys=n[1])}var i,n},e}(l.RendererView);i.AnnotationView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Annotation\",this.define({plot:[o.Instance]}),this.override({level:\"annotation\"})},e.prototype.add_panel=function(t){if(null==this.panel||t!==this.panel.side){var e=new r.SidePanel({side:t});e.attach_document(this.document),this.set_panel(e)}},e.prototype.set_panel=function(t){this.panel=t,this.level=\"overlay\"},e}(l.Renderer);i.Annotation=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(56),s=t(184),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),null==this.model.source&&(this.model.source=new s.ColumnDataSource),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,i=this.plot_view.frame;\"data\"==this.model.start_units?(t=i.xscales[this.model.x_range_name].v_compute(this._x_start),e=i.yscales[this.model.y_range_name].v_compute(this._y_start)):(t=i.xview.v_compute(this._x_start),e=i.yview.v_compute(this._y_start));var n,r;return\"data\"==this.model.end_units?(n=i.xscales[this.model.x_range_name].v_compute(this._x_end),r=i.yscales[this.model.y_range_name].v_compute(this._y_end)):(n=i.xview.v_compute(this._x_end),r=i.yview.v_compute(this._y_end)),[[t,e],[n,r]]},e.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save();var e=this._map_data(),i=e[0],n=e[1];null!=this.model.end&&this._arrow_head(t,\"render\",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,\"render\",this.model.start,n,i),t.beginPath();var r=this.plot_model.canvas.bbox.rect,o=r.x,s=r.y,a=r.width,l=r.height;t.rect(o,s,a,l),null!=this.model.end&&this._arrow_head(t,\"clip\",this.model.end,i,n),null!=this.model.start&&this._arrow_head(t,\"clip\",this.model.start,n,i),t.closePath(),t.clip(),this._arrow_body(t,i,n),t.restore()}},e.prototype._arrow_head=function(t,e,i,n,r){for(var o=0,s=this._x_start.length;o<s;o++){var a=Math.PI/2+l.atan2([n[0][o],n[1][o]],[r[0][o],r[1][o]]);t.save(),t.translate(r[0][o],r[1][o]),t.rotate(a),\"render\"==e?i.render(t,o):\"clip\"==e&&i.clip(t,o),t.restore()}},e.prototype._arrow_body=function(t,e,i){if(this.visuals.line.doit)for(var n=0,r=this._x_start.length;n<r;n++)this.visuals.line.set_vectorize(t,n),t.beginPath(),t.moveTo(e[0][n],e[1][n]),t.lineTo(i[0][n],i[1][n]),t.stroke()},e}(r.AnnotationView);i.ArrowView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Arrow\",this.prototype.default_view=h,this.mixins([\"line\"]),this.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,\"data\"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,\"data\"],end:[a.Instance,function(){return new o.OpenHead({})}],source:[a.Instance],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"]})},e}(r.Annotation);i.Arrow=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(49),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ArrowHead\",this.define({size:[s.Number,25]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.visuals=new o.Visuals(this)},e}(r.Annotation);i.ArrowHead=a,a.initClass();var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"OpenHead\",this.mixins([\"line\"])},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke())},e}(a);i.OpenHead=l,l.initClass();var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"NormalHead\",this.mixins([\"line\",\"fill\"]),this.override({fill_color:\"black\"})},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke())},e.prototype._normal=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);i.NormalHead=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"VeeHead\",this.mixins([\"line\",\"fill\"]),this.override({fill_color:\"black\"})},e.prototype.clip=function(t,e){this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke())},e.prototype._vee=function(t,e){t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},e}(a);i.VeeHead=c,c.initClass();var u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TeeHead\",this.mixins([\"line\"])},e.prototype.render=function(t,e){this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke())},e.prototype.clip=function(t,e){},e}(a);i.TeeHead=u,u.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(184),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e=this.plot_view.frame,i=this.model.dimension,n=e.xscales[this.model.x_range_name],r=e.yscales[this.model.y_range_name],o=\"height\"==i?r:n,s=\"height\"==i?n:r,a=\"height\"==i?e.yview:e.xview,l=\"height\"==i?e.xview:e.yview;t=\"data\"==this.model.lower.units?o.v_compute(this._lower):a.v_compute(this._lower);var h;h=\"data\"==this.model.upper.units?o.v_compute(this._upper):a.v_compute(this._upper);var c;c=\"data\"==this.model.base.units?s.v_compute(this._base):l.v_compute(this._base);var u=\"height\"==i?[1,0]:[0,1],_=u[0],p=u[1],d=[t,c],f=[h,c];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},e.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(var n=this._upper_sx.length-1,e=n;e>=0;e--)t.lineTo(this._upper_sx[e],this._upper_sy[e]);t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]);for(var e=0,i=this._lower_sx.length;e<i;e++)t.lineTo(this._lower_sx[e],this._lower_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]);for(var e=0,i=this._upper_sx.length;e<i;e++)t.lineTo(this._upper_sx[e],this._upper_sy[e]);this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke())}},e}(r.AnnotationView);i.BandView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Band\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,\"height\"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},e}(r.Annotation);i.Band=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(19),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add(\"bk-shading\"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?(this.connect(this.model.change,function(){return e.render()}),this.connect(this.model.data_update,function(){return e.render()})):(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()}))},e.prototype.render=function(){var t=this;if(this.model.visible||\"css\"!=this.model.render_mode||s.hide(this.el),this.model.visible)if(null!=this.model.left||null!=this.model.right||null!=this.model.top||null!=this.model.bottom){var e=this.plot_model.frame,i=e.xscales[this.model.x_range_name],n=e.yscales[this.model.y_range_name],r=function(e,i,n,r,o){return null!=e?t.model.screen?e:\"data\"==i?n.compute(e):r.compute(e):o},o=r(this.model.left,this.model.left_units,i,e.xview,e._left.value),a=r(this.model.right,this.model.right_units,i,e.xview,e._right.value),l=r(this.model.top,this.model.top_units,n,e.yview,e._top.value),h=r(this.model.bottom,this.model.bottom_units,n,e.yview,e._bottom.value),c=\"css\"==this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this);c(o,a,h,l)}else s.hide(this.el)},e.prototype._css_box=function(t,e,i,n){var r=Math.abs(e-t),o=Math.abs(i-n);this.el.style.left=t+\"px\",this.el.style.width=r+\"px\",this.el.style.top=n+\"px\",this.el.style.height=o+\"px\",this.el.style.borderWidth=this.model.properties.line_width.value()+\"px\",this.el.style.borderColor=this.model.properties.line_color.value(),this.el.style.backgroundColor=this.model.properties.fill_color.value(),this.el.style.opacity=this.model.properties.fill_alpha.value();var a=this.model.properties.line_dash.value().length<2?\"solid\":\"dashed\";this.el.style.borderStyle=a,s.show(this.el)},e.prototype._canvas_box=function(t,e,i,n){var r=this.plot_view.canvas_view.ctx;r.save(),r.beginPath(),r.rect(t,n,e-t,i-n),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);i.BoxAnnotationView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BoxAnnotation\",this.prototype.default_view=l,this.mixins([\"line\",\"fill\"]),this.define({render_mode:[a.RenderMode,\"canvas\"],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"],top:[a.Number,null],top_units:[a.SpatialUnits,\"data\"],bottom:[a.Number,null],bottom_units:[a.SpatialUnits,\"data\"],left:[a.Number,null],left_units:[a.SpatialUnits,\"data\"],right:[a.Number,null],right_units:[a.SpatialUnits,\"data\"]}),this.internal({screen:[a.Boolean,!1]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.data_update=new o.Signal0(this,\"data_update\")},e.prototype.update=function(t){var e=t.left,i=t.right,n=t.top,r=t.bottom;this.setv({left:e,right:i,top:n,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);i.BoxAnnotation=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(191),s=t(96),a=t(154),l=t(176),h=t(177),c=t(168),u=t(15),_=t(41),p=t(21),d=t(22),f=t(32),v=t(44),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return e.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return e.plot_view.request_render()}),null!=this.model.color_mapper&&this.connect(this.model.color_mapper.change,function(){e._set_canvas_image(),e.plot_view.request_render()})},e.prototype._get_size=function(){if(null==this.model.color_mapper)return 0;var t=this.compute_legend_dimensions(),e=this.model.panel.side;switch(e){case\"above\":case\"below\":return t.height;case\"left\":case\"right\":return t.width;default:throw new Error(\"unreachable code\")}},e.prototype._set_canvas_image=function(){if(null!=this.model.color_mapper){var t=this.model.color_mapper.palette;\"vertical\"==this.model.orientation&&(t=p.reversed(t));var e,i;switch(this.model.orientation){case\"vertical\":h=[1,t.length],e=h[0],i=h[1];break;case\"horizontal\":c=[t.length,1],e=c[0],i=c[1];break;default:throw new Error(\"unreachable code\")}var n=document.createElement(\"canvas\");n.width=e,n.height=i;var r=n.getContext(\"2d\"),o=r.getImageData(0,0,e,i),s=new a.LinearColorMapper({palette:t}).rgba_mapper,l=s.v_compute(p.range(0,t.length));o.data.set(l),r.putImageData(o,0,0),this.image=n;var h,c}},e.prototype.compute_legend_dimensions=function(){var t,e,i=this.model._computed_image_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this._get_label_extent(),a=this.model._title_extent(),l=this.model._tick_extent(),h=this.model.padding;switch(this.model.orientation){case\"vertical\":t=r+a+2*h,e=o+l+s+2*h;break;case\"horizontal\":t=r+a+l+s+2*h,e=o+2*h;break;default:throw new Error(\"unreachable code\")}return{width:e,height:t}},e.prototype.compute_legend_location=function(){var t,e,i=this.compute_legend_dimensions(),n=[i.height,i.width],r=n[0],o=n[1],s=this.model.margin,a=null!=this.model.panel?this.model.panel:this.plot_view.frame,l=a.bbox.ranges,h=l[0],c=l[1],u=this.model.location;if(v.isString(u))switch(u){case\"top_left\":t=h.start+s,e=c.start+s;break;case\"top_center\":t=(h.end+h.start)/2-o/2,e=c.start+s;break;case\"top_right\":t=h.end-s-o,e=c.start+s;break;case\"bottom_right\":t=h.end-s-o,e=c.end-s-r;break;case\"bottom_center\":t=(h.end+h.start)/2-o/2,e=c.end-s-r;break;case\"bottom_left\":t=h.start+s,e=c.end-s-r;break;case\"center_left\":t=h.start+s,e=(c.end+c.start)/2-r/2;break;case\"center\":t=(h.end+h.start)/2-o/2,e=(c.end+c.start)/2-r/2;break;case\"center_right\":t=h.end-s-o,e=(c.end+c.start)/2-r/2;break;default:throw new Error(\"unreachable code\")}else{if(!v.isArray(u)||2!=u.length)throw new Error(\"unreachable code\");var _=u[0],p=u[1];t=a.xview.compute(_),e=a.yview.compute(p)-r}return{sx:t,sy:e}},e.prototype.render=function(){if(this.model.visible&&null!=this.model.color_mapper){var t=this.plot_view.canvas_view.ctx;t.save();var e=this.compute_legend_location(),i=e.sx,n=e.sy;t.translate(i,n),this._draw_bbox(t);var r=this._get_image_offset();if(t.translate(r.x,r.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high){var o=this.model.tick_info();this._draw_major_ticks(t,o),this._draw_minor_ticks(t,o),this._draw_major_labels(t,o)}this.model.title&&this._draw_title(t),t.restore()}},e.prototype._draw_bbox=function(t){var e=this.compute_legend_dimensions();t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_image=function(t){var e=this.model._computed_image_dimensions();t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_major_ticks=function(t,e){if(this.visuals.major_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.major,c=h[0],u=h[1],_=this.model.major_tick_in,p=this.model.major_tick_out;t.save(),t.translate(a,l),this.visuals.major_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},e.prototype._draw_minor_ticks=function(t,e){if(this.visuals.minor_tick_line.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=e.coords.minor,c=h[0],u=h[1],_=this.model.minor_tick_in,p=this.model.minor_tick_out;t.save(),t.translate(a,l),this.visuals.minor_tick_line.set_value(t);for(var d=0,f=c.length;d<f;d++)t.beginPath(),t.moveTo(Math.round(c[d]+n*p),Math.round(u[d]+r*p)),t.lineTo(Math.round(c[d]-n*_),Math.round(u[d]-r*_)),t.stroke();t.restore()}},e.prototype._draw_major_labels=function(t,e){if(this.visuals.major_label_text.doit){var i=this.model._normals(),n=i[0],r=i[1],o=this.model._computed_image_dimensions(),s=[o.width*n,o.height*r],a=s[0],l=s[1],h=this.model.label_standoff+this.model._tick_extent(),c=[h*n,h*r],u=c[0],_=c[1],p=e.coords.major,d=p[0],f=p[1],v=e.labels.major;this.visuals.major_label_text.set_value(t),t.save(),t.translate(a+u,l+_);for(var m=0,g=d.length;m<g;m++)t.fillText(v[m],Math.round(d[m]+n*this.model.label_standoff),Math.round(f[m]+r*this.model.label_standoff));t.restore()}},e.prototype._draw_title=function(t){this.visuals.title_text.doit&&(t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore())},e.prototype._get_label_extent=function(){var t,e=this.model.tick_info().labels.major;if(null==this.model.color_mapper.low||null==this.model.color_mapper.high||f.isEmpty(e))t=0;else{var i=this.plot_view.canvas_view.ctx;switch(i.save(),this.visuals.major_label_text.set_value(i),this.model.orientation){case\"vertical\":t=p.max(e.map(function(t){return i.measureText(t.toString()).width}));break;case\"horizontal\":t=_.get_text_height(this.visuals.major_label_text.font_value()).height;break;default:throw new Error(\"unreachable code\")}t+=this.model.label_standoff,i.restore()}return t},e.prototype._get_image_offset=function(){var t=this.model.padding,e=this.model.padding+this.model._title_extent();return{x:t,y:e}},e}(r.AnnotationView);i.ColorBarView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ColorBar\",this.prototype.default_view=m,this.mixins([\"text:major_label_\",\"text:title_\",\"line:major_tick_\",\"line:minor_tick_\",\"line:border_\",\"line:bar_\",\"fill:background_\"]),this.define({location:[u.Any,\"top_right\"],orientation:[u.Orientation,\"vertical\"],title:[u.String],title_standoff:[u.Number,2],width:[u.Any,\"auto\"],height:[u.Any,\"auto\"],scale_alpha:[u.Number,1],ticker:[u.Instance,function(){return new o.BasicTicker}],formatter:[u.Instance,function(){return new s.BasicTickFormatter}],major_label_overrides:[u.Any,{}],color_mapper:[u.Instance],label_standoff:[u.Number,5],margin:[u.Number,30],padding:[u.Number,10],major_tick_in:[u.Number,5],major_tick_out:[u.Number,0],minor_tick_in:[u.Number,0],minor_tick_out:[u.Number,0]}),this.override({background_fill_color:\"#ffffff\",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_align:\"center\",major_label_text_baseline:\"middle\",major_label_text_font_size:\"8pt\",major_tick_line_color:\"#ffffff\",minor_tick_line_color:null,title_text_font_size:\"10pt\",title_text_font_style:\"italic\"})},e.prototype._normals=function(){return\"vertical\"==this.orientation?[1,0]:[0,1]},e.prototype._title_extent=function(){var t=this.title_text_font+\" \"+this.title_text_font_size+\" \"+this.title_text_font_style,e=this.title?_.get_text_height(t).height+this.title_standoff:0;return e},e.prototype._tick_extent=function(){return null!=this.color_mapper.low&&null!=this.color_mapper.high?p.max([this.major_tick_out,this.minor_tick_out]):0},e.prototype._computed_image_dimensions=function(){var t,e,i=this.plot.plot_canvas.frame._height.value,n=this.plot.plot_canvas.frame._width.value,r=this._title_extent();switch(this.orientation){case\"vertical\":\"auto\"==this.height?null!=this.panel?t=i-2*this.padding-r:(t=p.max([25*this.color_mapper.palette.length,.3*i]),t=p.min([t,.8*i-2*this.padding-r])):t=this.height,e=\"auto\"==this.width?25:this.width;break;case\"horizontal\":t=\"auto\"==this.height?25:this.height,\"auto\"==this.width?null!=this.panel?e=n-2*this.padding:(e=p.max([25*this.color_mapper.palette.length,.3*n]),e=p.min([e,.8*n-2*this.padding])):e=this.width;break;default:throw new Error(\"unreachable code\")}return{width:e,height:t}},e.prototype._tick_coordinate_scale=function(t){var e={source_range:new c.Range1d({start:this.color_mapper.low,end:this.color_mapper.high}),target_range:new c.Range1d({start:0,end:t})};switch(this.color_mapper.type){case\"LinearColorMapper\":return new l.LinearScale(e);case\"LogColorMapper\":return new h.LogScale(e);default:throw new Error(\"unreachable code\")}},e.prototype._format_major_labels=function(t,e){for(var i=this.formatter.doFormat(t,null),n=0,r=e.length;n<r;n++)e[n]in this.major_label_overrides&&(i[n]=this.major_label_overrides[e[n]]);return i},e.prototype.tick_info=function(){var t,e=this._computed_image_dimensions();switch(this.orientation){case\"vertical\":t=e.height;break;case\"horizontal\":t=e.width;break;default:throw new Error(\"unreachable code\")}for(var i=this._tick_coordinate_scale(t),n=this._normals(),r=n[0],o=n[1],s=[this.color_mapper.low,this.color_mapper.high],a=s[0],l=s[1],h=this.ticker.get_ticks(a,l,null,null,this.ticker.desired_num_ticks),c=h.major,u=h.minor,_=[[],[]],p=[[],[]],f=0,v=c.length;f<v;f++)c[f]<a||c[f]>l||(_[r].push(c[f]),_[o].push(0));for(var f=0,v=u.length;f<v;f++)u[f]<a||u[f]>l||(p[r].push(u[f]),p[o].push(0));var m={major:this._format_major_labels(_[r],c)},g={major:[[],[]],minor:[[],[]]};return g.major[r]=i.v_compute(_[r]),g.minor[r]=i.v_compute(p[r]),g.major[o]=_[o],g.minor[o]=p[o],\"vertical\"==this.orientation&&(g.major[r]=d.map(g.major[r],function(e){return t-e}),g.minor[r]=d.map(g.minor[r],function(e){return t-e})),{coords:g,labels:m}},e}(r.Annotation);i.ColorBar=g,g.initClass()},function(t,e,i){var n=t(54);i.Annotation=n.Annotation;var r=t(55);i.Arrow=r.Arrow;var o=t(56);i.ArrowHead=o.ArrowHead;var s=t(56);i.OpenHead=s.OpenHead;var a=t(56);i.NormalHead=a.NormalHead;var l=t(56);i.TeeHead=l.TeeHead;var h=t(56);i.VeeHead=h.VeeHead;var c=t(57);i.Band=c.Band;var u=t(58);i.BoxAnnotation=u.BoxAnnotation;var _=t(59);i.ColorBar=_.ColorBar;var p=t(61);i.Label=p.Label;var d=t(62);i.LabelSet=d.LabelSet;var f=t(63);i.Legend=f.Legend;var v=t(64);i.LegendItem=v.LegendItem;var m=t(65);i.PolyAnnotation=m.PolyAnnotation;var g=t(66);i.Span=g.Span;var y=t(67);i.TextAnnotation=y.TextAnnotation;var b=t(68);i.Title=b.Title;var x=t(69);i.ToolbarPanel=x.ToolbarPanel;var w=t(70);i.Tooltip=w.Tooltip;var k=t(71);i.Whisker=k.Whisker},function(t,e,i){var n=t(379),r=t(67),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.visuals.warm_cache()},e.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;if(this.visuals.text.set_value(t),this.model.panel.is_horizontal){var e=t.measureText(this.model.text).ascent;return e}var i=t.measureText(this.model.text).width;return i},e.prototype.render=function(){if(this.model.visible||\"css\"!=this.model.render_mode||o.hide(this.el),this.model.visible){var t;switch(this.model.angle_units){case\"rad\":t=-this.model.angle;break;case\"deg\":t=-this.model.angle*Math.PI/180;break;default:throw new Error(\"unreachable code\")}var e=null!=this.model.panel?this.model.panel:this.plot_view.frame,i=this.plot_view.frame.xscales[this.model.x_range_name],n=this.plot_view.frame.yscales[this.model.y_range_name],r=\"data\"==this.model.x_units?i.compute(this.model.x):e.xview.compute(this.model.x),s=\"data\"==this.model.y_units?n.compute(this.model.y):e.yview.compute(this.model.y);r+=this.model.x_offset,s-=this.model.y_offset;var a=\"canvas\"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);a(this.plot_view.canvas_view.ctx,this.model.text,r,s,t)}},e}(r.TextAnnotationView);i.LabelView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Label\",this.prototype.default_view=a,this.mixins([\"text\",\"line:border_\",\"fill:background_\"]),this.define({x:[s.Number],x_units:[s.SpatialUnits,\"data\"],y:[s.Number],y_units:[s.SpatialUnits,\"data\"],text:[s.String],angle:[s.Angle,0],angle_units:[s.AngleUnits,\"rad\"],x_offset:[s.Number,0],y_offset:[s.Number,0],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.override({background_fill_color:null,border_line_color:null})},e}(r.TextAnnotation);i.Label=l,l.initClass()},function(t,e,i){var n=t(379),r=t(67),o=t(184),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),this.set_data(this.model.source),\"css\"==this.model.render_mode)for(var i=0,n=this._text.length;i<n;i++){var r=s.div({class:\"bk-annotation-child\",style:{display:\"none\"}});this.el.appendChild(r)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?(this.connect(this.model.change,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.streaming,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.patching,function(){e.set_data(e.model.source),e.render()}),this.connect(this.model.source.change,function(){e.set_data(e.model.source),e.render()})):(this.connect(this.model.change,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.patching,function(){e.set_data(e.model.source),e.plot_view.request_render()}),this.connect(this.model.source.change,function(){e.set_data(e.model.source),e.plot_view.request_render()}))},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t=this.plot_view.frame.xscales[this.model.x_range_name],e=this.plot_view.frame.yscales[this.model.y_range_name],i=null!=this.model.panel?this.model.panel:this.plot_view.frame,n=\"data\"==this.model.x_units?t.v_compute(this._x):i.xview.v_compute(this._x),r=\"data\"==this.model.y_units?e.v_compute(this._y):i.yview.v_compute(this._y);return[n,r]},e.prototype.render=function(){if(this.model.visible||\"css\"!=this.model.render_mode||s.hide(this.el),this.model.visible)for(var t=\"canvas\"==this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),e=this.plot_view.canvas_view.ctx,i=this._map_data(),n=i[0],r=i[1],o=0,a=this._text.length;o<a;o++)t(e,o,this._text[o],n[o]+this._x_offset[o],r[o]-this._y_offset[o],this._angle[o])},e.prototype._get_size=function(){var t=this.plot_view.canvas_view.ctx;switch(this.visuals.text.set_value(t),this.model.panel.side){case\"above\":case\"below\":var e=t.measureText(this._text[0]).ascent;return e;case\"left\":case\"right\":var i=t.measureText(this._text[0]).width;return i;default:throw new Error(\"unreachable code\")}},e.prototype._v_canvas_text=function(t,e,i,n,r,o){this.visuals.text.set_vectorize(t,e);var s=this._calculate_bounding_box_dimensions(t,i);t.save(),t.beginPath(),t.translate(n,r),t.rotate(o),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(i,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,i,n,r,o){var a=this.el.children[e];a.textContent=i,this.visuals.text.set_vectorize(t,e);var l=this._calculate_bounding_box_dimensions(t,i),h=this.visuals.border_line.line_dash.value(),c=h.length<2?\"solid\":\"dashed\";this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),a.style.position=\"absolute\",a.style.left=n+l[0]+\"px\",a.style.top=r+l[1]+\"px\",a.style.color=\"\"+this.visuals.text.text_color.value(),a.style.opacity=\"\"+this.visuals.text.text_alpha.value(),a.style.font=\"\"+this.visuals.text.font_value(),a.style.lineHeight=\"normal\",o&&(a.style.transform=\"rotate(\"+o+\"rad)\"),this.visuals.background_fill.doit&&(a.style.backgroundColor=\"\"+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(a.style.borderStyle=\"\"+c,a.style.borderWidth=this.visuals.border_line.line_width.value()+\"px\",a.style.borderColor=\"\"+this.visuals.border_line.color_value()),s.show(a)},e}(r.TextAnnotationView);i.LabelSetView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LabelSet\",this.prototype.default_view=l,this.mixins([\"text\",\"line:border_\",\"fill:background_\"]),this.define({x:[a.NumberSpec],y:[a.NumberSpec],x_units:[a.SpatialUnits,\"data\"],y_units:[a.SpatialUnits,\"data\"],text:[a.StringSpec,{field:\"text\"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,{value:0}],y_offset:[a.NumberSpec,{value:0}],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"]}),this.override({background_fill_color:null,border_line_color:null})},e}(r.TextAnnotation);i.LabelSet=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(15),s=t(41),a=t(24),l=t(21),h=t(32),c=t(44),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,\"cursor\",{get:function(){return\"none\"==this.model.click_policy?null:\"pointer\"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"legend_padding\",{get:function(){return null!=this.visuals.border_line.line_color.value()?this.model.padding:0},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()})},e.prototype.compute_legend_bbox=function(){var t=this.model.get_legend_names(),e=this.model,i=e.glyph_height,n=e.glyph_width,r=this.model,o=r.label_height,a=r.label_width;this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,i]);var u=this.plot_view.canvas_view.ctx;u.save(),this.visuals.label_text.set_value(u),this.text_widths={};for(var _=0,p=t;_<p.length;_++){var d=p[_];this.text_widths[d]=l.max([u.measureText(d).width,a])}u.restore();var f,v,m=Math.max(l.max(h.values(this.text_widths)),0),g=this.model.margin,y=this.legend_padding,b=this.model.spacing,x=this.model.label_standoff;if(\"vertical\"==this.model.orientation)f=t.length*this.max_label_height+Math.max(t.length-1,0)*b+2*y,v=m+n+x+2*y;else{v=2*y+Math.max(t.length-1,0)*b;for(var w in this.text_widths){var k=this.text_widths[w];v+=l.max([k,a])+n+x}f=this.max_label_height+2*y}var S,C,T=null!=this.model.panel?this.model.panel:this.plot_view.frame,A=T.bbox.ranges,E=A[0],M=A[1],O=this.model.location;if(c.isString(O))switch(O){case\"top_left\":S=E.start+g,C=M.start+g;break;case\"top_center\":S=(E.end+E.start)/2-v/2,C=M.start+g;break;case\"top_right\":S=E.end-g-v,C=M.start+g;break;case\"bottom_right\":S=E.end-g-v,C=M.end-g-f;break;case\"bottom_center\":S=(E.end+E.start)/2-v/2,C=M.end-g-f;break;case\"bottom_left\":S=E.start+g,C=M.end-g-f;break;case\"center_left\":S=E.start+g,C=(M.end+M.start)/2-f/2;break;case\"center\":S=(E.end+E.start)/2-v/2,C=(M.end+M.start)/2-f/2;break;case\"center_right\":S=E.end-g-v,C=(M.end+M.start)/2-f/2;break;default:throw new Error(\"unreachable code\")}else{if(!c.isArray(O)||2!=O.length)throw new Error(\"unreachable code\");var z=O[0],P=O[1];S=T.xview.compute(z),C=T.yview.compute(P)-f}return{x:S,y:C,width:v,height:f}},e.prototype.bbox=function(){var t=this.compute_legend_bbox(),e=t.x,i=t.y,n=t.width,r=t.height;return new a.BBox({x:e,y:i,width:n,height:r})},e.prototype.on_hit=function(t,e){for(var i,n=this.model.glyph_width,r=this.legend_padding,o=this.model.spacing,s=this.model.label_standoff,l=i=r,h=this.compute_legend_bbox(),c=\"vertical\"==this.model.orientation,u=0,_=this.model.items;u<_.length;u++)for(var p=_[u],d=p.get_labels_list_from_label_prop(),f=0,v=d;f<v.length;f++){var m=v[f],g=h.x+l,y=h.y+i,b=void 0,x=void 0;c?(E=[h.width-2*r,this.max_label_height],b=E[0],x=E[1]):(M=[this.text_widths[m]+n+s,this.max_label_height],b=M[0],x=M[1]);var w=new a.BBox({x:g,y:y,width:b,height:x});if(w.contains(t,e)){switch(this.model.click_policy){case\"hide\":for(var k=0,S=p.renderers;k<S.length;k++){var C=S[k];C.visible=!C.visible}break;case\"mute\":for(var T=0,A=p.renderers;T<A.length;T++){var C=A[T];C.muted=!C.muted}}return!0}c?i+=this.max_label_height+o:l+=this.text_widths[m]+n+s+o}return!1;var E,M},e.prototype.render=function(){if(this.model.visible&&0!=this.model.items.length){var t=this.plot_view.canvas_view.ctx,e=this.compute_legend_bbox();t.save(),this._draw_legend_box(t,e),this._draw_legend_items(t,e),t.restore()}},e.prototype._draw_legend_box=function(t,e){t.beginPath(),t.rect(e.x,e.y,e.width,e.height),this.visuals.background_fill.set_value(t),t.fill(),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke())},e.prototype._draw_legend_items=function(t,e){for(var i=this,n=this.model,r=n.glyph_width,o=n.glyph_height,s=this.legend_padding,a=this.model.spacing,h=this.model.label_standoff,c=s,u=s,_=\"vertical\"==this.model.orientation,p=function(n){var p=n.get_labels_list_from_label_prop(),f=n.get_field_from_label_prop();if(0==p.length)return\"continue\";for(var v=function(){switch(i.model.click_policy){case\"none\":return!0;case\"hide\":return l.all(n.renderers,function(t){return t.visible});case\"mute\":return l.all(n.renderers,function(t){return!t.muted})}}(),m=0,g=p;m<g.length;m++){var y=g[m],b=e.x+c,x=e.y+u,w=b+r,k=x+o;_?u+=d.max_label_height+a:c+=d.text_widths[y]+r+h+a,d.visuals.label_text.set_value(t),t.fillText(y,w+h,x+d.max_label_height/2);for(var S=0,C=n.renderers;S<C.length;S++){var T=C[S],A=d.plot_view.renderer_views[T.id];A.draw_legend(t,b,w,x,k,f,y)}if(!v){var E=void 0,M=void 0;_?(O=[e.width-2*s,d.max_label_height],E=O[0],M=O[1]):(z=[d.text_widths[y]+r+h,d.max_label_height],E=z[0],M=z[1]),t.beginPath(),t.rect(b,x,E,M),d.visuals.inactive_fill.set_value(t),t.fill()}}var O,z},d=this,f=0,v=this.model.items;f<v.length;f++){var m=v[f];p(m)}},e.prototype._get_size=function(){var t=this.compute_legend_bbox();switch(this.model.panel.side){case\"above\":case\"below\":return t.height+2*this.model.margin;case\"left\":case\"right\":return t.width+2*this.model.margin}},e}(r.AnnotationView);i.LegendView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Legend\",this.prototype.default_view=u,this.mixins([\"text:label_\",\"fill:inactive_\",\"line:border_\",\"fill:background_\"]),this.define({orientation:[o.Orientation,\"vertical\"],location:[o.Any,\"top_right\"],label_standoff:[o.Number,5],glyph_height:[o.Number,20],glyph_width:[o.Number,20],label_height:[o.Number,20],label_width:[o.Number,20],margin:[o.Number,10],padding:[o.Number,10],spacing:[o.Number,3],items:[o.Array,[]],click_policy:[o.Any,\"none\"]}),this.override({border_line_color:\"#e5e5e5\",border_line_alpha:.5,border_line_width:1,background_fill_color:\"#ffffff\",background_fill_alpha:.95,inactive_fill_color:\"white\",inactive_fill_alpha:.7,label_text_font_size:\"10pt\",label_text_baseline:\"middle\"})},e.prototype.get_legend_names=function(){for(var t=[],e=0,i=this.items;e<i.length;e++){var n=i[e],r=n.get_labels_list_from_label_prop();t.push.apply(t,r)}return t},e}(r.Annotation);i.Legend=_,_.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(185),s=t(47),a=t(15),l=t(14),h=t(21),c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LegendItem\",this.define({label:[a.StringSpec,null],renderers:[a.Array,[]]})},e.prototype._check_data_sources_on_renderers=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e)for(var i=0,n=this.renderers;i<n.length;i++){var r=n[i];if(r.data_source!=e)return!1}}return!0},e.prototype._check_field_label_on_data_source=function(){var t=this.get_field_from_label_prop();if(null!=t){if(this.renderers.length<1)return!1;var e=this.renderers[0].data_source;if(null!=e&&!h.includes(e.columns(),t))return!1}return!0},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this._check_data_sources_on_renderers();e||l.logger.error(\"Non matching data sources on legend item renderers\");var i=this._check_field_label_on_data_source();i||l.logger.error(\"Bad column name on label: \"+this.label)},e.prototype.get_field_from_label_prop=function(){var t=this.label;return s.isField(t)?t.field:null},e.prototype.get_labels_list_from_label_prop=function(){if(s.isValue(this.label))return[this.label.value];var t=this.get_field_from_label_prop();if(null!=t){var e=void 0;if(!this.renderers[0]||null==this.renderers[0].data_source)return[\"No source found\"];if((e=this.renderers[0].data_source)instanceof o.ColumnarDataSource){var i=e.get_column(t);return null!=i?h.uniq(Array.from(i)):[\"Invalid field\"]}}return[]},e}(r.Model);i.LegendItem=c,c.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(19),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()})},e.prototype.render=function(){if(this.model.visible){var t=this.model,e=t.xs,i=t.ys;if(e.length==i.length&&!(e.length<3||i.length<3)){for(var n=this.plot_view.frame,r=this.plot_view.canvas_view.ctx,o=0,s=e.length;o<s;o++){var a=void 0;if(\"screen\"!=this.model.xs_units)throw new Error(\"not implemented\");a=this.model.screen?e[o]:n.xview.compute(e[o]);var l=void 0;if(\"screen\"!=this.model.ys_units)throw new Error(\"not implemented\");l=this.model.screen?i[o]:n.yview.compute(i[o]),0==o?(r.beginPath(),r.moveTo(a,l)):r.lineTo(a,l)}r.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(r),r.stroke()),this.visuals.fill.doit&&(this.visuals.fill.set_value(r),r.fill())}}},e}(r.AnnotationView);i.PolyAnnotationView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PolyAnnotation\",this.prototype.default_view=a,this.mixins([\"line\",\"fill\"]),this.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,\"data\"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,\"data\"],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.internal({screen:[s.Boolean,!1]}),this.override({fill_color:\"#fff9ba\",fill_alpha:.4,line_color:\"#cccccc\",line_alpha:.3})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.data_update=new o.Signal0(this,\"data_update\")},e.prototype.update=function(t){var e=t.xs,i=t.ys;this.setv({xs:e,ys:i,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);i.PolyAnnotation=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position=\"absolute\",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return e._draw_span()}):\"canvas\"==this.model.render_mode?(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return e.plot_view.request_render()})):(this.connect(this.model.change,function(){return e.render()}),this.connect(this.model.properties.location.change,function(){return e._draw_span()}))},e.prototype.render=function(){this.model.visible||\"css\"!=this.model.render_mode||o.hide(this.el),this.model.visible&&this._draw_span()},e.prototype._draw_span=function(){var t=this,e=this.model.for_hover?this.model.computed_location:this.model.location;if(null!=e){var i,n,r,s,a=this.plot_view.frame,l=a.xscales[this.model.x_range_name],h=a.yscales[this.model.y_range_name],c=function(i,n){return t.model.for_hover?t.model.computed_location:\"data\"==t.model.location_units?i.compute(e):n.compute(e)};if(\"width\"==this.model.dimension?(r=c(h,a.yview),n=a._left.value,s=a._width.value,i=this.model.properties.line_width.value()):(r=a._top.value,n=c(l,a.xview),s=this.model.properties.line_width.value(),i=a._height.value),\"css\"==this.model.render_mode)this.el.style.top=r+\"px\",this.el.style.left=n+\"px\",this.el.style.width=s+\"px\",this.el.style.height=i+\"px\",this.el.style.zIndex=\"1000\",this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el);else if(\"canvas\"==this.model.render_mode){var u=this.plot_view.canvas_view.ctx;u.save(),u.beginPath(),this.visuals.line.set_value(u),u.moveTo(n,r),\"width\"==this.model.dimension?u.lineTo(n+s,r):u.lineTo(n,r+i),u.stroke(),u.restore()}}else o.hide(this.el)},e}(r.AnnotationView);i.SpanView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Span\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({render_mode:[s.RenderMode,\"canvas\"],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"],location:[s.Number,null],location_units:[s.SpatialUnits,\"data\"],dimension:[s.Dimension,\"width\"]}),this.override({line_color:\"black\"}),this.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},e}(r.Annotation);i.Span=l,l.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(5),s=t(15),a=t(41),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),\"css\"==this.model.render_mode&&(this.el.classList.add(\"bk-annotation\"),this.plot_view.canvas_overlays.appendChild(this.el))},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),\"css\"==this.model.render_mode?this.connect(this.model.change,function(){return e.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height;return[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var i,n=this._calculate_text_dimensions(t,e),r=n[0],o=n[1];switch(t.textAlign){case\"left\":i=0;break;case\"center\":i=-r/2;break;case\"right\":i=-r;break;default:throw new Error(\"unreachable code\")}var s;switch(t.textBaseline){case\"top\":s=0;break;case\"middle\":s=-.5*o;break;case\"bottom\":s=-1*o;break;case\"alphabetic\":s=-.8*o;break;case\"hanging\":s=-.17*o;break;case\"ideographic\":s=-.83*o;break;default:throw new Error(\"unreachable code\")}return[i,s,r,o]},e.prototype._canvas_text=function(t,e,i,n,r){this.visuals.text.set_value(t);var o=this._calculate_bounding_box_dimensions(t,e);t.save(),t.beginPath(),t.translate(i,n),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},e.prototype._css_text=function(t,e,i,n,r){o.hide(this.el),this.visuals.text.set_value(t);var s=this._calculate_bounding_box_dimensions(t,e),a=this.visuals.border_line.line_dash.value(),l=a.length<2?\"solid\":\"dashed\";this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position=\"absolute\",this.el.style.left=i+s[0]+\"px\",this.el.style.top=n+s[1]+\"px\",this.el.style.color=\"\"+this.visuals.text.text_color.value(),this.el.style.opacity=\"\"+this.visuals.text.text_alpha.value(),this.el.style.font=\"\"+this.visuals.text.font_value(),this.el.style.lineHeight=\"normal\",r&&(this.el.style.transform=\"rotate(\"+r+\"rad)\"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=\"\"+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=\"\"+l,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+\"px\",this.el.style.borderColor=\"\"+this.visuals.border_line.color_value()),this.el.textContent=e,o.show(this.el)},e}(r.AnnotationView);i.TextAnnotationView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TextAnnotation\",this.define({render_mode:[s.RenderMode,\"canvas\"]})},e}(r.Annotation);i.TextAnnotation=h,h.initClass()},function(t,e,i){var n=t(379),r=t(67),o=t(5),s=t(15),a=t(49),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,i=this.model.panel,n=this.model.offset;switch(i.side){case\"above\":case\"below\":switch(this.model.vertical_align){case\"top\":e=i._top.value+5;break;case\"middle\":e=i._vcenter.value;break;case\"bottom\":e=i._bottom.value-5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":t=i._left.value+n;break;case\"center\":t=i._hcenter.value;break;case\"right\":t=i._right.value-n;break;default:throw new Error(\"unreachable code\")}break;case\"left\":switch(this.model.vertical_align){case\"top\":t=i._left.value-5;break;case\"middle\":t=i._hcenter.value;break;case\"bottom\":t=i._right.value+5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":e=i._bottom.value-n;break;case\"center\":e=i._vcenter.value;break;case\"right\":e=i._top.value+n;break;default:throw new Error(\"unreachable code\")}break;case\"right\":switch(this.model.vertical_align){case\"top\":t=i._right.value-5;break;case\"middle\":t=i._hcenter.value;break;case\"bottom\":t=i._left.value+5;break;default:throw new Error(\"unreachable code\")}switch(this.model.align){case\"left\":e=i._top.value+n;break;case\"center\":e=i._vcenter.value;break;case\"right\":e=i._bottom.value-n;break;default:throw new Error(\"unreachable code\")}break;default:throw new Error(\"unreachable code\")}return[t,e]},e.prototype.render=function(){if(this.model.visible){var t=this.model.text;if(null!=t&&0!=t.length){this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;var e=this._get_location(),i=e[0],n=e[1],r=this.model.panel.get_label_angle_heuristic(\"parallel\"),s=\"canvas\"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this);s(this.plot_view.canvas_view.ctx,t,i,n,r)}}else\"css\"==this.model.render_mode&&o.hide(this.el)},e.prototype._get_size=function(){var t=this.model.text;if(null==t||0==t.length)return 0;var e=this.plot_view.canvas_view.ctx;return this.visuals.text.set_value(e),e.measureText(t).ascent+10},e}(r.TextAnnotationView);i.TitleView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Title\",this.prototype.default_view=l,this.mixins([\"line:border_\",\"fill:background_\"]),this.define({text:[s.String],text_font:[s.Font,\"helvetica\"],text_font_size:[s.FontSizeSpec,\"10pt\"],text_font_style:[s.FontStyle,\"bold\"],text_color:[s.ColorSpec,\"#444444\"],text_alpha:[s.NumberSpec,1],vertical_align:[s.VerticalAlign,\"bottom\"],align:[s.TextAlign,\"left\"],offset:[s.Number,0]}),this.override({background_fill_color:null,border_line_color:null}),this.internal({text_align:[s.TextAlign,\"left\"],text_baseline:[s.TextBaseline,\"bottom\"]})},e}(r.TextAnnotation);i.Title=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(4),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){if(t.prototype.render.call(this),this.model.visible){var e=this.model.panel;this.el.style.position=\"absolute\",this.el.style.left=e._left.value+\"px\",this.el.style.top=e._top.value+\"px\",this.el.style.width=e._width.value+\"px\",this.el.style.height=e._height.value+\"px\",this.el.style.overflow=\"hidden\";var i=this._toolbar_views[this.model.toolbar.id];i.render(),s.empty(this.el),this.el.appendChild(i.el),s.show(this.el)}else s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);i.ToolbarPanelView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ToolbarPanel\",this.prototype.default_view=l,this.define({toolbar:[a.Instance]})},e}(r.Annotation);i.ToolbarPanel=h,h.initClass()},function(t,e,i){function n(t,e,i,n,r){var o;switch(t){case\"horizontal\":o=e<n?\"right\":\"left\";break;case\"vertical\":o=i<r?\"below\":\"above\";break;default:o=t}return o}var r=t(379),o=t(54),s=t(5),a=t(15);i.compute_side=n;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=\"1010\",s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return e._draw_tips()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-tooltip\")},e.prototype.render=function(){this.model.visible&&this._draw_tips()},e.prototype._draw_tips=function(){var t=this.model.data;if(s.empty(this.el),s.hide(this.el),this.model.custom?this.el.classList.add(\"bk-tooltip-custom\"):this.el.classList.remove(\"bk-tooltip-custom\"),0!=t.length){for(var e=this.plot_view.frame,i=0,r=t;i<r.length;i++){var o=r[i],a=o[0],l=o[1],h=o[2];if(!this.model.inner_only||e.bbox.contains(a,l)){var c=s.div({},h);this.el.appendChild(c)}}var u=t[t.length-1],_=u[0],p=u[1],d=n(this.model.attachment,_,p,e._hcenter.value,e._vcenter.value);this.el.classList.remove(\"bk-right\"),this.el.classList.remove(\"bk-left\"),this.el.classList.remove(\"bk-above\"),this.el.classList.remove(\"bk-below\");s.show(this.el);var f,v;switch(d){case\"right\":this.el.classList.add(\"bk-left\"),f=_+(this.el.offsetWidth-this.el.clientWidth)+10,v=p-this.el.offsetHeight/2;break;case\"left\":this.el.classList.add(\"bk-right\"),f=_-this.el.offsetWidth-10,v=p-this.el.offsetHeight/2;break;case\"below\":this.el.classList.add(\"bk-above\"),v=p+(this.el.offsetHeight-this.el.clientHeight)+10,f=Math.round(_-this.el.offsetWidth/2);break;case\"above\":this.el.classList.add(\"bk-below\"),v=p-this.el.offsetHeight-10,f=Math.round(_-this.el.offsetWidth/2);break;default:throw new Error(\"unreachable code\")}this.model.show_arrow&&this.el.classList.add(\"bk-tooltip-arrow\"),this.el.childNodes.length>0?(this.el.style.top=v+\"px\",this.el.style.left=f+\"px\"):s.hide(this.el)}},e}(o.AnnotationView);i.TooltipView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type=\"Tooltip\",this.prototype.default_view=l,this.define({attachment:[a.String,\"horizontal\"],inner_only:[a.Bool,!0],show_arrow:[a.Bool,!0]}),this.override({level:\"overlay\"}),this.internal({data:[a.Any,[]],custom:[a.Any]})},e.prototype.clear=function(){this.data=[]},e.prototype.add=function(t,e,i){this.data=this.data.concat([[t,e,i]])},e}(o.Annotation);i.Tooltip=h,h.initClass()},function(t,e,i){var n=t(379),r=t(54),o=t(184),s=t(56),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.patching,function(){return e.set_data(e.model.source)}),this.connect(this.model.source.change,function(){return e.set_data(e.model.source)})},e.prototype.set_data=function(e){t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e=this.plot_model.frame,i=this.model.dimension,n=e.xscales[this.model.x_range_name],r=e.yscales[this.model.y_range_name],o=\"height\"==i?r:n,s=\"height\"==i?n:r,a=\"height\"==i?e.yview:e.xview,l=\"height\"==i?e.xview:e.yview;t=\"data\"==this.model.lower.units?o.v_compute(this._lower):a.v_compute(this._lower);var h;h=\"data\"==this.model.upper.units?o.v_compute(this._upper):a.v_compute(this._upper);var c;c=\"data\"==this.model.base.units?s.v_compute(this._base):l.v_compute(this._base);var u=\"height\"==i?[1,0]:[0,1],_=u[0],p=u[1],d=[t,c],f=[h,c];this._lower_sx=d[_],this._lower_sy=d[p],this._upper_sx=f[_],this._upper_sy=f[p]},e.prototype.render=function(){if(this.model.visible){this._map_data();var t=this.plot_view.canvas_view.ctx;if(this.visuals.line.doit)for(var e=0,i=this._lower_sx.length;e<i;e++)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this._lower_sx[e],this._lower_sy[e]),t.lineTo(this._upper_sx[e],this._upper_sy[e]),t.stroke();var n=\"height\"==this.model.dimension?0:Math.PI/2;if(null!=this.model.lower_head)for(var e=0,i=this._lower_sx.length;e<i;e++)t.save(),t.translate(this._lower_sx[e],this._lower_sy[e]),t.rotate(n+Math.PI),this.model.lower_head.render(t,e),t.restore();if(null!=this.model.upper_head)for(var e=0,i=this._upper_sx.length;e<i;e++)t.save(),t.translate(this._upper_sx[e],this._upper_sy[e]),t.rotate(n),this.model.upper_head.render(t,e),t.restore()}},e}(r.AnnotationView);i.WhiskerView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Whisker\",this.prototype.default_view=l,this.mixins([\"line\"]),this.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:\"underlay\",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:\"underlay\",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,\"height\"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,\"default\"],y_range_name:[a.String,\"default\"]}),this.override({level:\"underlay\"})},e}(r.Annotation);i.Whisker=h,h.initClass()},function(t,e,i){var n=t(379),r=t(171),o=t(15),s=t(12),a=t(21),l=t(44),h=Math.abs,c=Math.min,u=Math.max,_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){if(this.model.visible){var t={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},e=this.model.tick_coords,i=this.plot_view.canvas_view.ctx;i.save(),this._draw_rule(i,t),this._draw_major_ticks(i,t,e),this._draw_minor_ticks(i,t,e),this._draw_major_labels(i,t,e),this._draw_axis_label(i,t,e),null!=this._render&&this._render(i,t,e),i.restore()}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype._draw_rule=function(t,e){if(this.visuals.axis_line.doit){var i=this.model.rule_coords,n=i[0],r=i[1],o=this.plot_view.map_to_screen(n,r,this.model.x_range_name,this.model.y_range_name),s=o[0],a=o[1],l=this.model.normals,h=l[0],c=l[1],u=this.model.offsets,_=u[0],p=u[1];this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(s[0]+h*_),Math.round(a[0]+c*p));for(var d=1;d<s.length;d++){var f=Math.round(s[d]+h*_),v=Math.round(a[d]+c*p);t.lineTo(f,v)}t.stroke()}},e.prototype._draw_major_ticks=function(t,e,i){var n=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line;this._draw_ticks(t,i.major,n,r,o)},e.prototype._draw_minor_ticks=function(t,e,i){var n=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line;this._draw_ticks(t,i.minor,n,r,o)},e.prototype._draw_major_labels=function(t,e,i){var n=i.major,r=this.model.compute_labels(n[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text;this._draw_oriented_labels(t,r,n,o,this.model.panel.side,s,a)},e.prototype._draw_axis_label=function(t,e,i){if(null!=this.model.axis_label&&0!=this.model.axis_label.length){var n,r;switch(this.model.panel.side){case\"above\":n=this.model.panel._hcenter.value,r=this.model.panel._bottom.value;break;case\"below\":n=this.model.panel._hcenter.value,r=this.model.panel._top.value;break;case\"left\":n=this.model.panel._right.value,r=this.model.panel._vcenter.value;break;case\"right\":n=this.model.panel._left.value,r=this.model.panel._vcenter.value;break;default:throw new Error(\"unknown side: \"+this.model.panel.side)}var o=[[n],[r]],s=e.tick+a.sum(e.tick_label)+this.model.axis_label_standoff,l=this.visuals.axis_label_text;this._draw_oriented_labels(t,[this.model.axis_label],o,\"parallel\",this.model.panel.side,s,l,\"screen\")}},e.prototype._draw_ticks=function(t,e,i,n,r){if(r.doit){var o=e[0],s=e[1],a=this.plot_view.map_to_screen(o,s,this.model.x_range_name,this.model.y_range_name),l=a[0],h=a[1],c=this.model.normals,u=c[0],_=c[1],p=this.model.offsets,d=p[0],f=p[1],v=[u*(d-i),_*(f-i)],m=v[0],g=v[1],y=[u*(d+n),_*(f+n)],b=y[0],x=y[1];r.set_value(t);for(var w=0;w<l.length;w++){var k=Math.round(l[w]+b),S=Math.round(h[w]+x),C=Math.round(l[w]+m),T=Math.round(h[w]+g);t.beginPath(),t.moveTo(k,S),t.lineTo(C,T),t.stroke()}}},e.prototype._draw_oriented_labels=function(t,e,i,n,r,o,s,a){if(void 0===a&&(a=\"data\"),s.doit&&0!=e.length){var h,c,u,_;if(\"screen\"==a)h=i[0],c=i[1],u=(S=[0,0])[0],_=S[1];else{var p=i[0],d=i[1];C=this.plot_view.map_to_screen(p,d,this.model.x_range_name,this.model.y_range_name),h=C[0],c=C[1],T=this.model.offsets,u=T[0],_=T[1]}var f=this.model.normals,v=f[0],m=f[1],g=v*(u+o),y=m*(_+o);s.set_value(t),this.model.panel.apply_label_text_heuristics(t,n);var b;b=l.isString(n)?this.model.panel.get_label_angle_heuristic(n):-n;for(var x=0;x<h.length;x++){var w=Math.round(h[x]+g),k=Math.round(c[x]+y);t.translate(w,k),t.rotate(b),t.fillText(e[x],0,0),t.rotate(-b),t.translate(-w,-k)}var S,C,T}},e.prototype._axis_label_extent=function(){if(null==this.model.axis_label||\"\"==this.model.axis_label)return 0;var t=this.model.axis_label_standoff,e=this.visuals.axis_label_text;return this._oriented_labels_extent([this.model.axis_label],\"parallel\",this.model.panel.side,t,e)},e.prototype._tick_extent=function(){return this.model.major_tick_out},e.prototype._tick_label_extent=function(){return a.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),i=this.model.major_label_orientation,n=this.model.major_label_standoff,r=this.visuals.major_label_text;return[this._oriented_labels_extent(e,i,this.model.panel.side,n,r)]},e.prototype._oriented_labels_extent=function(t,e,i,n,r){if(0==t.length)return 0;var o=this.plot_view.canvas_view.ctx;r.set_value(o);var s,a;l.isString(e)?(s=1,a=this.model.panel.get_label_angle_heuristic(e)):(s=2,a=-e),a=Math.abs(a);for(var h=Math.cos(a),c=Math.sin(a),u=0,_=0;_<t.length;_++){var p=1.1*o.measureText(t[_]).width,d=.9*o.measureText(t[_]).ascent,f=void 0;(f=\"above\"==i||\"below\"==i?p*c+d/s*h:p*h+d/s*c)>u&&(u=f)}return u>0&&(u+=n),u},e}(r.GuideRendererView);i.AxisView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Axis\",this.prototype.default_view=_,this.mixins([\"line:axis_\",\"line:major_tick_\",\"line:minor_tick_\",\"text:major_label_\",\"text:axis_label_\"]),this.define({bounds:[o.Any,\"auto\"],ticker:[o.Instance,null],formatter:[o.Instance,null],x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"],axis_label:[o.String,\"\"],axis_label_standoff:[o.Int,5],major_label_standoff:[o.Int,5],major_label_orientation:[o.Any,\"horizontal\"],major_label_overrides:[o.Any,{}],major_tick_in:[o.Number,2],major_tick_out:[o.Number,6],minor_tick_in:[o.Number,0],minor_tick_out:[o.Number,4]}),this.override({axis_line_color:\"black\",major_tick_line_color:\"black\",minor_tick_line_color:\"black\",major_label_text_font_size:\"8pt\",major_label_text_align:\"center\",major_label_text_baseline:\"alphabetic\",axis_label_text_font_size:\"10pt\",axis_label_text_font_style:\"italic\"})},e.prototype.add_panel=function(t){this.panel=new s.SidePanel({side:t}),this.panel.attach_document(this.document)},Object.defineProperty(e.prototype,\"normals\",{get:function(){return this.panel.normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"dimension\",{get:function(){return this.panel.dimension},enumerable:!0,configurable:!0}),e.prototype.compute_labels=function(t){for(var e=this.formatter.doFormat(t,this),i=0;i<t.length;i++)t[i]in this.major_label_overrides&&(e[i]=this.major_label_overrides[t[i]]);return e},e.prototype.label_info=function(t){return{dim:this.dimension,coords:t,side:this.panel.side,orient:this.major_label_orientation,standoff:this.major_label_standoff}},Object.defineProperty(e.prototype,\"offsets\",{get:function(){var t=this.plot.plot_canvas.frame,e=[0,0],i=e[0],n=e[1];switch(this.panel.side){case\"below\":n=h(this.panel._top.value-t._bottom.value);break;case\"above\":n=h(this.panel._bottom.value-t._top.value);break;case\"right\":i=h(this.panel._left.value-t._right.value);break;case\"left\":i=h(this.panel._right.value-t._left.value)}return[i,n]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"ranges\",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"computed_bounds\",{get:function(){var t=this.ranges[0],e=this.bounds,i=[t.min,t.max];if(\"auto\"==e)return[t.min,t.max];if(l.isArray(e)){var n=void 0,r=void 0,o=e[0],s=e[1],a=i[0],_=i[1];return h(o-s)>h(a-_)?(n=u(c(o,s),a),r=c(u(o,s),_)):(n=c(o,s),r=u(o,s)),[n,r]}throw new Error(\"user bounds '\"+e+\"' not understood\")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"rule_coords\",{get:function(){var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=new Array(2),a=new Array(2),l=[s,a];return l[t][0]=Math.max(r,i.min),l[t][1]=Math.min(o,i.max),l[t][0]>l[t][1]&&(l[t][0]=l[t][1]=NaN),l[e][0]=this.loc,l[e][1]=this.loc,l},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"tick_coords\",{get:function(){for(var t=this.dimension,e=(t+1)%2,i=this.ranges[0],n=this.computed_bounds,r=n[0],o=n[1],s=this.ticker.get_ticks(r,o,i,this.loc,{}),a=s.major,l=s.minor,h=[[],[]],c=[[],[]],u=[i.min,i.max],_=u[0],p=u[1],d=0;d<a.length;d++)a[d]<_||a[d]>p||(h[t].push(a[d]),h[e].push(this.loc));for(var d=0;d<l.length;d++)l[d]<_||l[d]>p||(c[t].push(l[d]),c[e].push(this.loc));return{major:h,minor:c}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"loc\",{get:function(){var t=this.ranges,e=t[1];switch(this.panel.side){case\"left\":case\"below\":return e.start;case\"right\":case\"above\":return e.end}},enumerable:!0,configurable:!0}),e}(r.GuideRenderer);i.Axis=p,p.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(192),s=t(97),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){this._draw_group_separators(t,e,i)},e.prototype._draw_group_separators=function(t,e,i){var n=this.model.ranges[0],r=this.model.computed_bounds,o=r[0],s=r[1];if(n.tops&&!(n.tops.length<2)&&this.visuals.separator_line.doit){for(var a=this.model.dimension,l=(a+1)%2,h=[[],[]],c=0,u=0;u<n.tops.length-1;u++){for(var _=void 0,p=void 0,d=c;d<n.factors.length;d++)if(n.factors[d][0]==n.tops[u+1]){m=[n.factors[d-1],n.factors[d]],_=m[0],p=m[1],c=d;break}var f=(n.synthetic(_)+n.synthetic(p))/2;f>o&&f<s&&(h[a].push(f),h[l].push(this.model.loc))}var v=this._tick_label_extent();this._draw_ticks(t,h,-3,v-6,this.visuals.separator_line);var m}},e.prototype._draw_major_labels=function(t,e,i){for(var n=this._get_factor_info(),r=e.tick+this.model.major_label_standoff,o=0;o<n.length;o++){var s=n[o],a=s[0],l=s[1],h=s[2],c=s[3];this._draw_oriented_labels(t,a,l,h,this.model.panel.side,r,c),r+=e.tick_label[o]}},e.prototype._tick_label_extents=function(){for(var t=this._get_factor_info(),e=[],i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[2],a=r[3],l=this._oriented_labels_extent(o,s,this.model.panel.side,this.model.major_label_standoff,a);e.push(l)}return e},e.prototype._get_factor_info=function(){var t=this.model.ranges[0],e=this.model.computed_bounds,i=e[0],n=e[1],r=this.model.loc,o=this.model.ticker.get_ticks(i,n,t,r,{}),s=this.model.tick_coords,a=[];if(1==t.levels){var l=this.model.formatter.doFormat(o.major,this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[1]}),this.model);a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([o.tops,s.tops,\"parallel\",this.visuals.group_text])}else if(3==t.levels){var l=this.model.formatter.doFormat(o.major.map(function(t){return t[2]}),this.model),h=o.mids.map(function(t){return t[1]});a.push([l,s.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([h,s.mids,\"parallel\",this.visuals.subgroup_text]),a.push([o.tops,s.tops,\"parallel\",this.visuals.group_text])}return a},e}(r.AxisView);i.CategoricalAxisView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CategoricalAxis\",this.prototype.default_view=a,this.mixins([\"line:separator_\",\"text:group_\",\"text:subgroup_\"]),this.override({ticker:function(){return new o.CategoricalTicker},formatter:function(){return new s.CategoricalTickFormatter},separator_line_color:\"lightgrey\",separator_line_width:2,group_text_font_style:\"bold\",group_text_font_size:\"8pt\",group_text_color:\"grey\",subgroup_text_font_style:\"bold\",subgroup_text_font_size:\"8pt\"})},Object.defineProperty(e.prototype,\"tick_coords\",{get:function(){var t=this,e=this.dimension,i=(e+1)%2,n=this.ranges[0],r=this.computed_bounds,o=r[0],s=r[1],a=this.ticker.get_ticks(o,s,n,this.loc,{}),l={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return l.major[e]=a.major,l.major[i]=a.major.map(function(e){return t.loc}),3==n.levels&&(l.mids[e]=a.mids),l.mids[i]=a.mids.map(function(e){return t.loc}),n.levels>1&&(l.tops[e]=a.tops),l.tops[i]=a.tops.map(function(e){return t.loc}),l},enumerable:!0,configurable:!0}),e}(r.Axis);i.CategoricalAxis=l,l.initClass()},function(t,e,i){var n=t(379),r=t(72),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ContinuousAxis\"},e}(r.Axis);i.ContinuousAxis=o,o.initClass()},function(t,e,i){var n=t(379),r=t(77),o=t(98),s=t(195),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.LinearAxisView);i.DatetimeAxisView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DatetimeAxis\",this.prototype.default_view=a,this.override({ticker:function(){return new s.DatetimeTicker},formatter:function(){return new o.DatetimeTickFormatter}})},e}(r.LinearAxis);i.DatetimeAxis=l,l.initClass()},function(t,e,i){var n=t(72);i.Axis=n.Axis;var r=t(73);i.CategoricalAxis=r.CategoricalAxis;var o=t(74);i.ContinuousAxis=o.ContinuousAxis;var s=t(75);i.DatetimeAxis=s.DatetimeAxis;var a=t(77);i.LinearAxis=a.LinearAxis;var l=t(78);i.LogAxis=l.LogAxis;var h=t(79);i.MercatorAxis=h.MercatorAxis},function(t,e,i){var n=t(379),r=t(72),o=t(74),s=t(96),a=t(191),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LinearAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LinearAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.BasicTicker},formatter:function(){return new s.BasicTickFormatter}})},e}(o.ContinuousAxis);i.LinearAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(74),s=t(101),a=t(199),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.LogAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LogAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.LogTicker},formatter:function(){return new s.LogTickFormatter}})},e}(o.ContinuousAxis);i.LogAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(77),s=t(102),a=t(200),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.AxisView);i.MercatorAxisView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MercatorAxis\",this.prototype.default_view=l,this.override({ticker:function(){return new a.MercatorTicker},formatter:function(){return new s.MercatorTickFormatter}})},e}(o.LinearAxis);i.MercatorAxis=h,h.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Callback\"},e}(r.Model);i.Callback=o,o.initClass()},function(t,e,i){var n=t(379),r=t(80),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type=\"CustomJS\",this.define({args:[o.Any,{}],code:[o.String,\"\"]})},Object.defineProperty(i.prototype,\"names\",{get:function(){return s.keys(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,\"func\",{get:function(){return new(Function.bind.apply(Function,[void 0].concat(this.names,[\"cb_obj\",\"cb_data\",\"require\",\"exports\",this.code])))},enumerable:!0,configurable:!0}),i.prototype.execute=function(e,i){return this.func.apply(e,this.values.concat(e,i,t,{}))},i}(r.Callback);i.CustomJS=a,a.initClass()},function(t,e,i){var n=t(81);i.CustomJS=n.CustomJS;var r=t(83);i.OpenURL=r.OpenURL},function(t,e,i){var n=t(379),r=t(80),o=t(15),s=t(35),a=t(40),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"OpenURL\",this.define({url:[o.String,\"http://\"]})},e.prototype.execute=function(t,e){for(var i=0,n=s.get_indices(e.source);i<n.length;i++){var r=n[i],o=a.replace_placeholders(this.url,e.source,r);window.open(o)}return null},e}(r.Callback);i.OpenURL=l,l.initClass()},function(t,e,i){var n=t(379),r=t(11),o=t(6),s=t(13),a=t(14),l=t(15),h=t(5),c=t(26),u=t(264);null!=window.CanvasPixelArray&&(window.CanvasPixelArray.prototype.set=function(t){for(var e=0;e<this.length;e++)this[e]=t[e]});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(h.div({class:\"bk-canvas-map\"})):null,this.model.output_backend){case\"canvas\":case\"webgl\":this.canvas_el=this.el.appendChild(h.canvas({class:\"bk-canvas\"})),this._ctx=this.canvas_el.getContext(\"2d\");break;case\"svg\":this._ctx=new u,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}this.overlays_el=this.el.appendChild(h.div({class:\"bk-canvas-overlays\"})),this.events_el=this.el.appendChild(h.div({class:\"bk-canvas-events\"})),this.ctx=this.get_ctx(),c.fixup_ctx(this.ctx),a.logger.debug(\"CanvasView initialized\")},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-canvas-wrapper\")},e.prototype.get_ctx=function(){return this._ctx},e.prototype.get_canvas_element=function(){return this.canvas_el},e.prototype.prepare_canvas=function(){var t=this.model._width.value,e=this.model._height.value;this.el.style.width=t+\"px\",this.el.style.height=e+\"px\";var i=c.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend);this.model.pixel_ratio=i,this.canvas_el.style.width=t+\"px\",this.canvas_el.style.height=e+\"px\",this.canvas_el.setAttribute(\"width\",\"\"+t*i),this.canvas_el.setAttribute(\"height\",\"\"+e*i),a.logger.debug(\"Rendering CanvasView with width: \"+t+\", height: \"+e+\", pixel ratio: \"+i)},e.prototype.set_dims=function(t){var e=t[0],i=t[1];0!=e&&0!=i&&(e!=this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),i!=this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-i),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables())},e}(o.DOMView);i.CanvasView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Canvas\",this.prototype.default_view=_,this.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,\"canvas\"]})},Object.defineProperty(e.prototype,\"panel\",{get:function(){return this},enumerable:!0,configurable:!0}),e}(r.LayoutCanvas);i.Canvas=p,p.initClass()},function(t,e,i){var n=t(379),r=t(174),o=t(176),s=t(177),a=t(168),l=t(164),h=t(165),c=t(11),u=t(15),_=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CartesianFrame\",this.internal({extra_x_ranges:[u.Any,{}],extra_y_ranges:[u.Any,{}],x_range:[u.Instance],y_range:[u.Instance],x_scale:[u.Instance],y_scale:[u.Instance]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._configure_scales()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._configure_scales()})},Object.defineProperty(e.prototype,\"panel\",{get:function(){return this},enumerable:!0,configurable:!0}),e.prototype.get_editables=function(){return t.prototype.get_editables.call(this).concat([this._width,this._height])},e.prototype.map_to_screen=function(t,e,i,n){void 0===i&&(i=\"default\"),void 0===n&&(n=\"default\");var r=this.xscales[i].v_compute(t),o=this.yscales[n].v_compute(e);return[r,o]},e.prototype._get_ranges=function(t,e){var i={};if(i.default=t,null!=e)for(var n in e)i[n]=e[n];return i},e.prototype._get_scales=function(t,e,i){var n={};for(var c in e){var u=e[c];if(u instanceof l.DataRange1d||u instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error(\"Range \"+u.type+\" is incompatible is Scale \"+t.type);if(t instanceof r.CategoricalScale)throw new Error(\"Range \"+u.type+\" is incompatible is Scale \"+t.type)}if(u instanceof h.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error(\"Range \"+u.type+\" is incompatible is Scale \"+t.type);t instanceof s.LogScale&&u instanceof l.DataRange1d&&(u.scale_hint=\"log\");var _=t.clone();_.setv({source_range:u,target_range:i}),n[c]=_}return n},e.prototype._configure_frame_ranges=function(){this._h_target=new a.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new a.Range1d({start:this._bottom.value,end:this._top.value})},e.prototype._configure_scales=function(){this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},e.prototype.update_scales=function(){this._configure_frame_ranges();for(var t in this._xscales){var e=this._xscales[t];e.target_range=this._h_target}for(var i in this._yscales){var e=this._yscales[i];e.target_range=this._v_target}},Object.defineProperty(e.prototype,\"x_ranges\",{get:function(){return this._x_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"y_ranges\",{get:function(){return this._y_ranges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"xscales\",{get:function(){return this._xscales},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"yscales\",{get:function(){return this._yscales},enumerable:!0,configurable:!0}),e}(c.LayoutCanvas);i.CartesianFrame=_,_.initClass()},function(t,e,i){var n=t(84);i.Canvas=n.Canvas;var r=t(85);i.CartesianFrame=r.CartesianFrame},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){var i=t.call(this,e)||this;return i._connected={},i._result={},i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Expression\"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._connected={},this._result={}},e.prototype._v_compute=function(t){var e=this;null==this._connected[t.id]&&(this.connect(t.change,function(){return delete e._result[t.id]}),this._connected[t.id]=!0);var i=this._result[t.id];return null==i&&(this._result[t.id]=i=this.v_compute(t)),i},e}(r.Model);i.Expression=o,o.initClass()},function(t,e,i){var n=t(87);i.Expression=n.Expression;var r=t(89);i.Stack=r.Stack},function(t,e,i){var n=t(379),r=t(87),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Stack\",this.define({fields:[o.Array,[]]})},e.prototype.v_compute=function(t){for(var e=new Float64Array(t.get_length()||0),i=0,n=this.fields;i<n.length;i++)for(var r=n[i],o=0;o<t.data[r].length;o++){var s=t.data[r][o];e[o]+=s}return e},e}(r.Expression);i.Stack=s,s.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(21),l=t(44),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BooleanFilter\",this.define({booleans:[o.Array,null]})},e.prototype.compute_indices=function(t){var e=this.booleans;return null!=e&&e.length>0?a.all(e,l.isBoolean)?(e.length!==t.get_length()&&s.logger.warn(\"BooleanFilter \"+this.id+\": length of booleans doesn't match data source\"),a.range(0,e.length).filter(function(t){return!0===e[t]})):(s.logger.warn(\"BooleanFilter \"+this.id+\": booleans should be array of booleans, defaulting to no filtering\"),null):(null!=e&&0==e.length?s.logger.warn(\"BooleanFilter \"+this.id+\": booleans is empty, defaulting to no filtering\"):s.logger.warn(\"BooleanFilter \"+this.id+\": booleans was not set, defaulting to no filtering\"),null)},e}(r.Filter);i.BooleanFilter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type=\"CustomJSFilter\",this.define({args:[o.Any,{}],code:[o.String,\"\"]})},Object.defineProperty(i.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,\"func\",{get:function(){return new(Function.bind.apply(Function,[void 0].concat(s.keys(this.args),[\"source\",\"require\",\"exports\",this.code])))},enumerable:!0,configurable:!0}),i.prototype.compute_indices=function(i){return this.filter=this.func.apply(this,this.values.concat([i,t,{}])),e.prototype.compute_indices.call(this,i)},i}(r.Filter);i.CustomJSFilter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=t(21),l=t(14),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Filter\",this.define({filter:[o.Array,null]})},e.prototype.compute_indices=function(t){var e=this.filter;return null!=e&&e.length>=0?s.isArrayOf(e,s.isBoolean)?a.range(0,e.length).filter(function(t){return!0===e[t]}):s.isArrayOf(e,s.isInteger)?e:(l.logger.warn(\"Filter \"+this.id+\": filter should either be array of only booleans or only integers, defaulting to no filtering\"),null):(l.logger.warn(\"Filter \"+this.id+\": filter was not set to be an array, defaulting to no filtering\"),null)},e}(r.Model);i.Filter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(21),l=function(t){function e(e){var i=t.call(this,e)||this;return i.indices=null,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GroupFilter\",this.define({column_name:[o.String],group:[o.String]})},e.prototype.compute_indices=function(t){var e=this,i=t.get_column(this.column_name);return null==i?(s.logger.warn(\"group filter: groupby column not found in data source\"),null):(this.indices=a.range(0,t.get_length()||0).filter(function(t){return i[t]===e.group}),0===this.indices.length&&s.logger.warn(\"group filter: group '\"+this.group+\"' did not match any values in column '\"+this.column_name+\"'\"),this.indices)},e}(r.Filter);i.GroupFilter=l,l.initClass()},function(t,e,i){var n=t(90);i.BooleanFilter=n.BooleanFilter;var r=t(91);i.CustomJSFilter=r.CustomJSFilter;var o=t(92);i.Filter=o.Filter;var s=t(93);i.GroupFilter=s.GroupFilter;var a=t(95);i.IndexFilter=a.IndexFilter},function(t,e,i){var n=t(379),r=t(92),o=t(15),s=t(14),a=t(44),l=t(21),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"IndexFilter\",this.define({indices:[o.Array,null]})},e.prototype.compute_indices=function(t){return null!=this.indices&&this.indices.length>=0?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn(\"IndexFilter \"+this.id+\": indices should be array of integers, defaulting to no filtering\"),null):(s.logger.warn(\"IndexFilter \"+this.id+\": indices was not set, defaulting to no filtering\"),null)},e}(r.Filter);i.IndexFilter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(15),s=t(44),a=function(t){function e(e){var i=t.call(this,e)||this;return i.last_precision=3,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BasicTickFormatter\",this.define({precision:[o.Any,\"auto\"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]})},Object.defineProperty(e.prototype,\"scientific_limit_low\",{get:function(){return Math.pow(10,this.power_limit_low)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"scientific_limit_high\",{get:function(){return Math.pow(10,this.power_limit_high)},enumerable:!0,configurable:!0}),e.prototype.doFormat=function(t,e){if(0==t.length)return[];var i=0;t.length>=2&&(i=Math.abs(t[1]-t[0])/1e4);var n=!1;if(this.use_scientific)for(var r=0,o=t;r<o.length;r++){var a=o[r],l=Math.abs(a);if(l>i&&(l>=this.scientific_limit_high||l<=this.scientific_limit_low)){n=!0;break}}var h=new Array(t.length),c=this.precision;if(null==c||s.isNumber(c))if(n)for(var u=0,_=t.length;u<_;u++)h[u]=t[u].toExponential(c||void 0);else for(var u=0,_=t.length;u<_;u++)h[u]=t[u].toFixed(c||void 0).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\");else for(var p=this.last_precision,d=this.last_precision<=15;d?p<=15:p>=15;d?p++:p--){var f=!0;if(n){for(var u=0,_=t.length;u<_;u++)if(h[u]=t[u].toExponential(p),u>0&&h[u]===h[u-1]){f=!1;break}if(f)break}else{for(var u=0,_=t.length;u<_;u++)if(h[u]=t[u].toFixed(p).replace(/(\\.[0-9]*?)0+$/,\"$1\").replace(/\\.$/,\"\"),u>0&&h[u]==h[u-1]){f=!1;break}if(f)break}if(f){this.last_precision=p;break}}return h},e}(r.TickFormatter);i.BasicTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(21),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CategoricalTickFormatter\"},e.prototype.doFormat=function(t,e){return o.copy(t)},e}(r.TickFormatter);i.CategoricalTickFormatter=s,s.initClass()},function(t,e,i){function n(t){return a(t,\"%Y %m %d %H %M %S\").split(/\\s+/).map(function(t){return parseInt(t,10)})}function r(t,e){if(_.isFunction(e))return e(t);var i=s.sprintf(\"$1%06d\",function(t){return Math.round(t/1e3%1*1e6)}(t));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,i)).indexOf(\"%\")?e:a(t,e)}var o=t(379),s=t(377),a=t(378),l=t(105),h=t(14),c=t(15),u=t(21),_=t(44),p=[\"microseconds\",\"milliseconds\",\"seconds\",\"minsec\",\"minutes\",\"hourmin\",\"hours\",\"days\",\"months\",\"years\"],d=function(t){function e(e){var i=t.call(this,e)||this;return i.strip_leading_zeros=!0,i}return o.__extends(e,t),e.initClass=function(){this.prototype.type=\"DatetimeTickFormatter\",this.define({microseconds:[c.Array,[\"%fus\"]],milliseconds:[c.Array,[\"%3Nms\",\"%S.%3Ns\"]],seconds:[c.Array,[\"%Ss\"]],minsec:[c.Array,[\":%M:%S\"]],minutes:[c.Array,[\":%M\",\"%Mm\"]],hourmin:[c.Array,[\"%H:%M\"]],hours:[c.Array,[\"%Hh\",\"%H:%M\"]],days:[c.Array,[\"%m/%d\",\"%a%d\"]],months:[c.Array,[\"%m/%Y\",\"%b%y\"]],years:[c.Array,[\"%Y\"]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._update_width_formats()},e.prototype._update_width_formats=function(){var t=+a(new Date),e=function(e){var i=e.map(function(e){return r(t,e).length}),n=u.sortBy(u.zip(i,e),function(t){var e=t[0];return e});return u.unzip(n)};this._width_formats={microseconds:e(this.microseconds),milliseconds:e(this.milliseconds),seconds:e(this.seconds),minsec:e(this.minsec),minutes:e(this.minutes),hourmin:e(this.hourmin),hours:e(this.hours),days:e(this.days),months:e(this.months),years:e(this.years)}},e.prototype._get_resolution_str=function(t,e){var i=1.1*t;switch(!1){case!(i<.001):return\"microseconds\";case!(i<1):return\"milliseconds\";case!(i<60):return e>=60?\"minsec\":\"seconds\";case!(i<3600):return e>=3600?\"hourmin\":\"minutes\";case!(i<86400):return\"hours\";case!(i<2678400):return\"days\";case!(i<31536e3):return\"months\";default:return\"years\"}},e.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=Math.abs(t[t.length-1]-t[0])/1e3,o=i/(t.length-1),s=this._get_resolution_str(o,i),a=this._width_formats[s],l=a[1],c=l[0],u=[],_=p.indexOf(s),d={},f=0,v=p;f<v.length;f++){var m=v[f];d[m]=0}d.seconds=5,d.minsec=4,d.minutes=4,d.hourmin=3,d.hours=3;for(var g=0,y=t;g<y.length;g++){var b=y[g],x=void 0,w=void 0;try{w=n(b),x=r(b,c)}catch(t){h.logger.warn(\"unable to format tick for timestamp value \"+b),h.logger.warn(\" - \"+t),u.push(\"ERR\");continue}for(var k=!1,S=_;0==w[d[p[S]]];){var C=void 0;if((S+=1)==p.length)break;if((\"minsec\"==s||\"hourmin\"==s)&&!k){if(\"minsec\"==s&&0==w[4]&&0!=w[5]||\"hourmin\"==s&&0==w[3]&&0!=w[4]){C=this._width_formats[p[_-1]][1][0],x=r(b,C);break}k=!0}C=this._width_formats[p[S]][1][0],x=r(b,C)}if(this.strip_leading_zeros){var T=x.replace(/^0+/g,\"\");T!=x&&isNaN(parseInt(T))&&(T=\"0\"+T),u.push(T)}else u.push(x)}return u},e}(l.TickFormatter);i.DatetimeTickFormatter=d,d.initClass()},function(t,e,i){var n=t(379),r=t(105),o=t(15),s=t(32),a=function(e){function i(t){return e.call(this,t)||this}return n.__extends(i,e),i.initClass=function(){this.prototype.type=\"FuncTickFormatter\",this.define({args:[o.Any,{}],code:[o.String,\"\"]})},i.prototype._make_func=function(){return new(Function.bind.apply(Function,[void 0,\"tick\",\"index\",\"ticks\"].concat(s.keys(this.args),[\"require\",this.code])))},i.prototype.doFormat=function(e,i){var n=this,r=this._make_func().bind({});return e.map(function(e,i,o){return r.apply(void 0,[e,i,o].concat(s.values(n.args),[t]))})},i}(r.TickFormatter);i.FuncTickFormatter=a,a.initClass()},function(t,e,i){var n=t(96);i.BasicTickFormatter=n.BasicTickFormatter;var r=t(97);i.CategoricalTickFormatter=r.CategoricalTickFormatter;var o=t(98);i.DatetimeTickFormatter=o.DatetimeTickFormatter;var s=t(99);i.FuncTickFormatter=s.FuncTickFormatter;var a=t(101);i.LogTickFormatter=a.LogTickFormatter;var l=t(102);i.MercatorTickFormatter=l.MercatorTickFormatter;var h=t(103);i.NumeralTickFormatter=h.NumeralTickFormatter;var c=t(104);i.PrintfTickFormatter=c.PrintfTickFormatter;var u=t(105);i.TickFormatter=u.TickFormatter},function(t,e,i){var n=t(379),r=t(105),o=t(96),s=t(14),a=t(15),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LogTickFormatter\",this.define({ticker:[a.Instance,null]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.basic_formatter=new o.BasicTickFormatter,null==this.ticker&&s.logger.warn(\"LogTickFormatter not configured with a ticker, using default base of 10 (labels will be incorrect if ticker base is not 10)\")},e.prototype.doFormat=function(t,e){if(0==t.length)return[];for(var i=null!=this.ticker?this.ticker.base:10,n=!1,r=new Array(t.length),o=0,s=t.length;o<s;o++)if(r[o]=i+\"^\"+Math.round(Math.log(t[o])/Math.log(i)),o>0&&r[o]==r[o-1]){n=!0;break}return n?this.basic_formatter.doFormat(t,e):r},e}(r.TickFormatter);i.LogTickFormatter=l,l.initClass()},function(t,e,i){var n=t(379),r=t(96),o=t(15),s=t(33),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MercatorTickFormatter\",this.define({dimension:[o.LatLon]})},e.prototype.doFormat=function(e,i){if(null==this.dimension)throw new Error(\"MercatorTickFormatter.dimension not configured\");if(0==e.length)return[];var n=e.length,r=new Array(n);if(\"lon\"==this.dimension)for(var o=0;o<n;o++){var a=s.wgs84_mercator.inverse([e[o],i.loc])[0];r[o]=a}else for(var o=0;o<n;o++){var l=s.wgs84_mercator.inverse([i.loc,e[o]]),h=l[1];r[o]=h}return t.prototype.doFormat.call(this,r,i)},e}(r.BasicTickFormatter);i.MercatorTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(347),o=t(105),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"NumeralTickFormatter\",this.define({format:[s.String,\"0,0\"],language:[s.String,\"en\"],rounding:[s.String,\"round\"]})},Object.defineProperty(e.prototype,\"_rounding_fn\",{get:function(){switch(this.rounding){case\"round\":case\"nearest\":return Math.round;case\"floor\":case\"rounddown\":return Math.floor;case\"ceil\":case\"roundup\":return Math.ceil}},enumerable:!0,configurable:!0}),e.prototype.doFormat=function(t,e){var i=this.format,n=this.language,o=this._rounding_fn;return t.map(function(t){return r.format(t,i,n,o)})},e}(o.TickFormatter);i.NumeralTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(377),o=t(105),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PrintfTickFormatter\",this.define({format:[s.String,\"%s\"]})},e.prototype.doFormat=function(t,e){var i=this;return t.map(function(t){return r.sprintf(i.format,t)})},e}(o.TickFormatter);i.PrintfTickFormatter=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TickFormatter\"},e}(r.Model);i.TickFormatter=o,o.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,\"data\"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius,this._angle=new Float32Array(this._start_angle.length);for(var t=0,e=this._start_angle.length;t<e;t++)this._angle[t]=this._end_angle[t]-this._start_angle[t]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._start_angle,s=i._angle,a=i.sinner_radius,l=i.souter_radius,h=this.model.properties.direction.value(),c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+a[_]+l[_]+o[_]+s[_])||(t.translate(n[_],r[_]),t.rotate(o[_]),t.moveTo(l[_],0),t.beginPath(),t.arc(0,0,l[_],0,s[_],h),t.rotate(s[_]),t.lineTo(a[_],0),t.arc(0,0,a[_],0,-s[_],!h),t.closePath(),t.rotate(-s[_]-o[_]),t.translate(-n[_],-r[_]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,_),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,_),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o=t.sx,a=t.sy,h=this.renderer.xscale.invert(o),c=this.renderer.yscale.invert(a);if(\"data\"==this.model.properties.outer_radius.units)e=h-this.max_outer_radius,n=h+this.max_outer_radius,i=c-this.max_outer_radius,r=c+this.max_outer_radius;else{var u=o-this.max_outer_radius,_=o+this.max_outer_radius;z=this.renderer.xscale.r_invert(u,_),e=z[0],n=z[1];var p=a-this.max_outer_radius,d=a+this.max_outer_radius;P=this.renderer.yscale.r_invert(p,d),i=P[0],r=P[1]}for(var f=[],v=s.validate_bbox_coords([e,n],[i,r]),m=0,g=this.index.indices(v);m<g.length;m++){var y=g[m],b=Math.pow(this.souter_radius[y],2),x=Math.pow(this.sinner_radius[y],2),w=this.renderer.xscale.r_compute(h,this._x[y]),u=w[0],_=w[1],k=this.renderer.yscale.r_compute(c,this._y[y]),p=k[0],d=k[1],S=Math.pow(u-_,2)+Math.pow(p-d,2);S<=b&&S>=x&&f.push([y,S])}for(var C=this.model.properties.direction.value(),T=[],A=0,E=f;A<E.length;A++){var M=E[A],y=M[0],S=M[1],O=Math.atan2(a-this.sy[y],o-this.sx[y]);l.angle_between(-O,-this._start_angle[y],-this._end_angle[y],C)&&T.push([y,S])}return s.create_hit_test_result_from_hits(T);var z,P},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._scenterxy=function(t){var e=(this.sinner_radius[t]+this.souter_radius[t])/2,i=(this._start_angle[t]+this._end_angle[t])/2;return{x:this.sx[t]+e*Math.cos(i),y:this.sy[t]+e*Math.sin(i)}},e.prototype.scenterx=function(t){return this._scenterxy(t).x},e.prototype.scentery=function(t){return this._scenterxy(t).y},e}(r.XYGlyphView);i.AnnularWedgeView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"AnnularWedge\",this.prototype.default_view=h,this.mixins([\"line\",\"fill\"]),this.define({direction:[a.Direction,\"anticlock\"],inner_radius:[a.DistanceSpec],outer_radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]})},e}(r.XYGlyph);i.AnnularWedge=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(28),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this._inner_radius):this.sinner_radius=this._inner_radius,\"data\"==this.model.properties.outer_radius.units?this.souter_radius=this.sdist(this.renderer.xscale,this._x,this._outer_radius):this.souter_radius=this._outer_radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sinner_radius,s=i.souter_radius,l=0,h=e;l<h.length;l++){var c=h[l];if(!isNaN(n[c]+r[c]+o[c]+s[c])){if(this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,c),t.beginPath(),a.is_ie)for(var u=0,_=[!1,!0];u<_.length;u++){var p=_[u];t.arc(n[c],r[c],o[c],0,Math.PI,p),t.arc(n[c],r[c],s[c],Math.PI,0,!p)}else t.arc(n[c],r[c],o[c],0,2*Math.PI,!0),t.arc(n[c],r[c],s[c],2*Math.PI,0,!1);t.fill()}this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.beginPath(),t.arc(n[c],r[c],o[c],0,2*Math.PI),t.moveTo(n[c]+s[c],r[c]),t.arc(n[c],r[c],s[c],0,2*Math.PI),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=n-this.max_outer_radius,s=n+this.max_outer_radius,a=this.renderer.yscale.invert(i),l=a-this.max_outer_radius,h=a+this.max_outer_radius,c=[],u=o.validate_bbox_coords([r,s],[l,h]),_=0,p=this.index.indices(u);_<p.length;_++){var d=p[_],f=Math.pow(this.souter_radius[d],2),v=Math.pow(this.sinner_radius[d],2),m=this.renderer.xscale.r_compute(n,this._x[d]),g=m[0],y=m[1],b=this.renderer.yscale.r_compute(a,this._y[d]),x=b[0],w=b[1],k=Math.pow(g-y,2)+Math.pow(x-w,2);k<=f&&k>=v&&c.push([d,k])}return o.create_hit_test_result_from_hits(c)},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=.5*Math.min(Math.abs(o-n),Math.abs(s-r)),u=new Array(a);u[i]=.4*c;var _=new Array(a);_[i]=.8*c,this._render(t,[i],{sx:l,sy:h,sinner_radius:u,souter_radius:_})},e}(r.XYGlyphView);i.AnnulusView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Annulus\",this.prototype.default_view=l,this.mixins([\"line\",\"fill\"]),this.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},e}(r.XYGlyph);i.Annulus=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle;if(this.visuals.line.doit)for(var l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.ArcView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Arc\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({direction:[s.Direction,\"anticlock\"],radius:[s.DistanceSpec],start_angle:[s.AngleSpec],end_angle:[s.AngleSpec]})},e}(r.XYGlyph);i.Arc=l,l.initClass()},function(t,e,i){function n(t,e,i,n,r,o,s,a){for(var l=[],h=[[],[]],c=0;c<=2;c++){var u=void 0,_=void 0,p=void 0;if(0===c?(_=6*t-12*i+6*r,u=-3*t+9*i-9*r+3*s,p=3*i-3*t):(_=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*a,p=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(_)<1e-12)continue;var d=-p/_;0<d&&d<1&&l.push(d)}else{var f=_*_-4*p*u,v=Math.sqrt(f);if(!(f<0)){var m=(-_+v)/(2*u);0<m&&m<1&&l.push(m);var g=(-_-v)/(2*u);0<g&&g<1&&l.push(g)}}}for(var y=l.length,b=y;y--;){var d=l[y],x=1-d,w=x*x*x*t+3*x*x*d*i+3*x*d*d*r+d*d*d*s;h[0][y]=w;var k=x*x*x*e+3*x*x*d*n+3*x*d*d*o+d*d*d*a;h[1][y]=k}return h[0][b]=t,h[1][b]=e,h[0][b+1]=s,h[1][b+1]=a,[Math.min.apply(Math,h[0]),Math.max.apply(Math,h[1]),Math.max.apply(Math,h[0]),Math.min.apply(Math,h[1])]}var r=t(379),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx0[e]+this._cy0[e]+this._cx1[e]+this._cy1[e])){var r=n(this._x0[e],this._y0[e],this._x1[e],this._y1[e],this._cx0[e],this._cy0[e],this._cx1[e],this._cy1[e]),s=r[0],a=r[1],l=r[2],h=r[3];t.push({minX:s,minY:a,maxX:l,maxY:h,i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx0,l=i.scy0,h=i.scx1,c=i.scy1;if(this.visuals.line.doit)for(var u=0,_=e;u<_.length;u++){var p=_[u];isNaN(n[p]+r[p]+o[p]+s[p]+a[p]+l[p]+h[p]+c[p])||(t.beginPath(),t.moveTo(n[p],r[p]),t.bezierCurveTo(a[p],l[p],h[p],c[p],o[p],s[p]),this.visuals.line.set_vectorize(t,p),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(s.GlyphView);i.BezierView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type=\"Bezier\",this.prototype.default_view=l,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"],[\"cx0\",\"cy0\"],[\"cx1\",\"cy1\"]]),this.mixins([\"line\"])},e}(s.Glyph);i.Bezier=h,h.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=t(132),a=t(9),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_box=function(t){for(var e=[],i=0;i<t;i++){var n=this._lrtb(i),o=n[0],s=n[1],a=n[2],l=n[3];!isNaN(o+s+a+l)&&isFinite(o+s+a+l)&&e.push({minX:o,minY:l,maxX:s,maxY:a,i:i})}return new r.RBush(e)},e.prototype._render=function(t,e,i){for(var n=i.sleft,r=i.sright,o=i.stop,s=i.sbottom,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+o[h]+r[h]+s[h])||(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fillRect(n[h],o[h],r[h]-n[h],s[h]-o[h])),this.visuals.line.doit&&(t.beginPath(),t.rect(n[h],o[h],r[h]-n[h],s[h]-o[h]),this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=a.create_empty_hit_test_result();return s.indices=o,s},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if(\"v\"==t.direction){var r=this.renderer.yscale.invert(n),o=this.renderer.plot_view.frame.bbox.h_range,s=this.renderer.xscale.r_invert(o.start,o.end),l=s[0],h=s[1];e=this.index.indices({minX:l,minY:r,maxX:h,maxY:r})}else{var c=this.renderer.xscale.invert(i),u=this.renderer.plot_view.frame.bbox.v_range,_=this.renderer.yscale.r_invert(u.start,u.end),p=_[0],d=_[1];e=this.index.indices({minX:c,minY:p,maxX:c,maxY:d})}var f=a.create_empty_hit_test_result();return f.indices=e,f},e.prototype.draw_legend_for_index=function(t,e,i){s.generic_area_legend(this.visuals,t,e,i)},e}(o.GlyphView);i.BoxView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Box\",this.mixins([\"line\",\"fill\"])},e}(o.Glyph);i.Box=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(21),l=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){if(null!=this._radius)if(\"data\"==this.model.properties.radius.spec.units){var t=this.model.properties.radius_dimension.spec.value;switch(t){case\"x\":this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius);break;case\"y\":this.sradius=this.sdist(this.renderer.yscale,this._y,this._radius)}}else this.sradius=this._radius,this.max_size=2*this.max_radius;else this.sradius=l.map(this._size,function(t){return t/2})},e.prototype._mask_data=function(){var t,e,i,n,r=this.renderer.plot_view.frame.bbox.ranges,s=r[0],a=r[1];if(null!=this._radius&&\"data\"==this.model.properties.radius.units){var l=s.start,h=s.end;p=this.renderer.xscale.r_invert(l,h),t=p[0],i=p[1],t-=this.max_radius,i+=this.max_radius;var c=a.start,u=a.end;d=this.renderer.yscale.r_invert(c,u),e=d[0],n=d[1],e-=this.max_radius,n+=this.max_radius}else{var l=s.start-this.max_size,h=s.end+this.max_size;f=this.renderer.xscale.r_invert(l,h),t=f[0],i=f[1];var c=a.start-this.max_size,u=a.end+this.max_size;v=this.renderer.yscale.r_invert(c,u),e=v[0],n=v[1]}var _=o.validate_bbox_coords([t,i],[e,n]);return this.index.indices(_);var p,d,f,v},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=0,a=e;s<a.length;s++){var l=a[s];isNaN(n[l]+r[l]+o[l])||(t.beginPath(),t.arc(n[l],r[l],o[l],0,2*Math.PI,!1),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,l),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,l),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,s,a,l,h,c,u,_=t.sx,p=t.sy,d=this.renderer.xscale.invert(_),f=this.renderer.yscale.invert(p);null!=this._radius&&\"data\"==this.model.properties.radius.units?(l=d-this.max_radius,h=d+this.max_radius,c=f-this.max_radius,u=f+this.max_radius):(n=_-this.max_size,r=_+this.max_size,S=this.renderer.xscale.r_invert(n,r),l=S[0],h=S[1],C=[Math.min(l,h),Math.max(l,h)],l=C[0],h=C[1],s=p-this.max_size,a=p+this.max_size,T=this.renderer.yscale.r_invert(s,a),c=T[0],u=T[1],A=[Math.min(c,u),Math.max(c,u)],c=A[0],u=A[1]);var v=o.validate_bbox_coords([l,h],[c,u]),m=this.index.indices(v),g=[];if(null!=this._radius&&\"data\"==this.model.properties.radius.units)for(var y=0,b=m;y<b.length;y++){var x=b[y];i=Math.pow(this.sradius[x],2),E=this.renderer.xscale.r_compute(d,this._x[x]),n=E[0],r=E[1],M=this.renderer.yscale.r_compute(f,this._y[x]),s=M[0],a=M[1],(e=Math.pow(n-r,2)+Math.pow(s-a,2))<=i&&g.push([x,e])}else for(var w=0,k=m;w<k.length;w++){var x=k[w];i=Math.pow(this.sradius[x],2),(e=Math.pow(this.sx[x]-_,2)+Math.pow(this.sy[x]-p,2))<=i&&g.push([x,e])}return o.create_hit_test_result_from_hits(g);var S,C,T,A,E,M},e.prototype._hit_span=function(t){var e,i,n,r,s,a=t.sx,l=t.sy,h=this.bounds(),c=h.minX,u=h.minY,_=h.maxX,p=h.maxY,d=o.create_empty_hit_test_result();if(\"h\"==t.direction){var f=void 0,v=void 0;r=u,s=p,null!=this._radius&&\"data\"==this.model.properties.radius.units?(f=a-this.max_radius,v=a+this.max_radius,x=this.renderer.xscale.r_invert(f,v),i=x[0],n=x[1]):(e=this.max_size/2,f=a-e,v=a+e,w=this.renderer.xscale.r_invert(f,v),i=w[0],n=w[1])}else{var m=void 0,g=void 0;i=c,n=_,null!=this._radius&&\"data\"==this.model.properties.radius.units?(m=l-this.max_radius,g=l+this.max_radius,k=this.renderer.yscale.r_invert(m,g),r=k[0],s=k[1]):(e=this.max_size/2,m=l-e,g=l+e,S=this.renderer.yscale.r_invert(m,g),r=S[0],s=S[1])}var y=o.validate_bbox_coords([i,n],[r,s]),b=this.index.indices(y);return d.indices=b,d;var x,w,k,S},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=a.range(0,this.sx.length),r=[],s=0,l=n.length;s<l;s++){var h=n[s];o.point_in_poly(this.sx[s],this.sy[s],e,i)&&r.push(h)}var c=o.create_empty_hit_test_result();return c.indices=r,c},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=new Array(a);c[i]=.2*Math.min(Math.abs(o-n),Math.abs(s-r)),this._render(t,[i],{sx:l,sy:h,sradius:c})},e}(r.XYGlyphView);i.CircleView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Circle\",this.prototype.default_view=h,this.mixins([\"line\",\"fill\"]),this.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:\"screen\",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,\"x\"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.properties.radius.optional=!0},e}(r.XYGlyph);i.Circle=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){\"data\"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"):this.sw=this._width,\"data\"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h]+this._angle[h])||(t.beginPath(),t.ellipse(n[h],r[h],o[h]/2,s[h]/2,this._angle[h],0,2*Math.PI),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,h),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,h),t.stroke()))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);c>1?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.EllipseView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Ellipse\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},e}(r.XYGlyph);i.Ellipse=a,a.initClass()},function(t,e,i){var n=t(379),r=t(9),o=t(15),s=t(24),a=t(33),l=t(49),h=t(48),c=t(53),u=t(14),_=t(22),p=t(32),d=t(44),f=t(120),v=t(165),m=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._nohit_warned={},t}return n.__extends(i,e),i.prototype.initialize=function(i){e.prototype.initialize.call(this,i),this._nohit_warned={},this.renderer=i.renderer,this.visuals=new l.Visuals(this.model);var n=this.renderer.plot_view.gl;if(null!=n){var r=null;try{r=t(440)}catch(t){if(\"MODULE_NOT_FOUND\"!==t.code)throw t;u.logger.warn(\"WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering.\")}if(null!=r){var o=r[this.model.type+\"GLGlyph\"];null!=o&&(this.glglyph=new o(n.ctx,this))}}},i.prototype.set_visuals=function(t){this.visuals.warm_cache(t),null!=this.glglyph&&this.glglyph.set_visuals_changed()},i.prototype.render=function(t,e,i){t.beginPath(),null!=this.glglyph&&this.glglyph.render(t,e,i)||this._render(t,e,i)},i.prototype.has_finished=function(){return!0},i.prototype.notify_finished=function(){this.renderer.notify_finished()},i.prototype._bounds=function(t){return t},i.prototype.bounds=function(){return this._bounds(this.index.bbox)},i.prototype.log_bounds=function(){for(var t=s.empty(),e=this.index.search(s.positive_x()),i=0,n=e;i<n.length;i++){var r=n[i];r.minX<t.minX&&(t.minX=r.minX),r.maxX>t.maxX&&(t.maxX=r.maxX)}for(var o=this.index.search(s.positive_y()),a=0,l=o;a<l.length;a++){var h=l[a];h.minY<t.minY&&(t.minY=h.minY),h.maxY>t.maxY&&(t.maxY=h.maxY)}return this._bounds(t)},i.prototype.get_anchor_point=function(t,e,i){var n=i[0],r=i[1];switch(t){case\"center\":return{x:this.scenterx(e,n,r),y:this.scentery(e,n,r)};default:return null}},i.prototype.sdist=function(t,e,i,n,r){void 0===n&&(n=\"edge\"),void 0===r&&(r=!1);var o,s,a=e.length;if(\"center\"==n){var l=_.map(i,function(t){return t/2});o=new Float64Array(a);for(var h=0;h<a;h++)o[h]=e[h]-l[h];s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=e[h]+l[h]}else{o=e,s=new Float64Array(a);for(var h=0;h<a;h++)s[h]=o[h]+i[h]}var c=t.v_compute(o),u=t.v_compute(s);return r?_.map(c,function(t,e){return Math.ceil(Math.abs(u[e]-c[e]))}):_.map(c,function(t,e){return Math.abs(u[e]-c[e])})},i.prototype.draw_legend_for_index=function(t,e,i){},i.prototype.hit_test=function(t){var e=null,i=\"_hit_\"+t.type;return null!=this[i]?e=this[i](t):null==this._nohit_warned[t.type]&&(u.logger.debug(\"'\"+t.type+\"' selection not available for \"+this.model.type),this._nohit_warned[t.type]=!0),e},i.prototype._hit_rect_against_index=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,o=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,o),c=h[0],u=h[1],_=r.validate_bbox_coords([a,l],[c,u]),p=r.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},i.prototype.set_data=function(t,e,i){var n=this.model.materialize_dataspecs(t);if(this.visuals.set_all_indices(e),e&&!(this instanceof f.LineView)){var r={},o=function(t){var i=n[t];\"_\"===t.charAt(0)?r[t]=e.map(function(t){return i[t]}):r[t]=i};for(var s in n)o(s);n=r}if(p.extend(this,n),this.renderer.plot_view.model.use_map&&(null!=this._x&&(g=a.project_xy(this._x,this._y),this._x=g[0],this._y=g[1]),null!=this._xs&&(y=a.project_xsys(this._xs,this._ys),this._xs=y[0],this._ys=y[1])),null!=this.renderer.plot_view.frame.x_ranges)for(var l=this.renderer.plot_view.frame.x_ranges[this.model.x_range_name],h=this.renderer.plot_view.frame.y_ranges[this.model.y_range_name],c=0,u=this.model._coords;c<u.length;c++){var _=u[c],d=_[0],m=_[1];d=\"_\"+d,m=\"_\"+m,l instanceof v.FactorRange&&(this[d]=l.v_synthetic(this[d])),h instanceof v.FactorRange&&(this[m]=h.v_synthetic(this[m]))}null!=this.glglyph&&this.glglyph.set_data_changed(this._x.length),this._set_data(i),this.index_data();var g,y},i.prototype._set_data=function(t){},i.prototype.index_data=function(){this.index=this._index_data()},i.prototype.mask_data=function(t){return null!=this.glglyph||null==this._mask_data?t:this._mask_data()},i.prototype.map_data=function(){for(var t=0,e=this.model._coords;t<e.length;t++){var i=e[t],n=i[0],r=i[1],o=\"s\"+n,s=\"s\"+r;if(n=\"_\"+n,r=\"_\"+r,null!=this[n]&&(d.isArray(this[n][0])||d.isTypedArray(this[n][0]))){var a=this[n].length;this[o]=new Array(a),this[s]=new Array(a);for(var l=0;l<a;l++){var h=this.map_to_screen(this[n][l],this[r][l]),c=h[0],u=h[1];this[o][l]=c,this[s][l]=u}}else _=this.map_to_screen(this[n],this[r]),this[o]=_[0],this[s]=_[1]}this._map_data();var _},i.prototype._map_data=function(){},i.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},i}(h.View);i.GlyphView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Glyph\",this.prototype._coords=[],this.internal({x_range_name:[o.String,\"default\"],y_range_name:[o.String,\"default\"]})},e.coords=function(t){var e=this.prototype._coords.concat(t);this.prototype._coords=e;for(var i={},n=0,r=t;n<r.length;n++){var s=r[n],a=s[0],l=s[1];i[a]=[o.NumberSpec],i[l]=[o.NumberSpec]}this.define(i)},e}(c.Model);i.Glyph=g,g.initClass()},function(t,e,i){var n=t(379),r=t(110),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._index_data=function(){return this._index_box(this._y.length)},e.prototype._lrtb=function(t){var e=Math.min(this._left[t],this._right[t]),i=Math.max(this._left[t],this._right[t]),n=this._y[t]+.5*this._height[t],r=this._y[t]-.5*this._height[t];return[e,i,n,r]},e.prototype._map_data=function(){this.sy=this.renderer.yscale.v_compute(this._y),this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"),this.sleft=this.renderer.xscale.v_compute(this._left),this.sright=this.renderer.xscale.v_compute(this._right);var t=this.sy.length;this.stop=new Float64Array(t),this.sbottom=new Float64Array(t);for(var e=0;e<t;e++)this.stop[e]=this.sy[e]-this.sh[e]/2,this.sbottom[e]=this.sy[e]+this.sh[e]/2},e}(r.BoxView);i.HBarView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"HBar\",this.prototype.default_view=s,this.coords([[\"left\",\"y\"]]),this.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),this.override({left:0})},e}(r.Box);i.HBar=a,a.initClass()},function(t,e,i){var n=t(379),r=t(113),o=t(9),s=t(15),a=t(37),l=t(132),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e.prototype._set_data=function(){var t=this._q.length,e=this.model.size,i=this.model.aspect_scale;if(this._x=new Float64Array(t),this._y=new Float64Array(t),\"pointytop\"==this.model.orientation)for(var n=0;n<t;n++)this._x[n]=e*Math.sqrt(3)*(this._q[n]+this._r[n]/2)/i,this._y[n]=3*-e/2*this._r[n];else for(var n=0;n<t;n++)this._x[n]=3*e/2*this._q[n],this._y[n]=-e*Math.sqrt(3)*(this._r[n]+this._q[n]/2)*i},e.prototype._index_data=function(){var t=this.model.size,e=Math.sqrt(3)*t/2;\"flattop\"==this.model.orientation?(e=(s=[t,e])[0],t=s[1],t*=this.model.aspect_scale):e/=this.model.aspect_scale;for(var i=[],n=0;n<this._x.length;n++){var r=this._x[n],o=this._y[n];!isNaN(r+o)&&isFinite(r+o)&&i.push({minX:r-e,minY:o-t,maxX:r+e,maxY:o+t,i:n})}return new a.RBush(i);var s},e.prototype.map_data=function(){t=this.map_to_screen(this._x,this._y),this.sx=t[0],this.sy=t[1],e=this._get_unscaled_vertices(),this.svx=e[0],this.svy=e[1];var t,e},e.prototype._get_unscaled_vertices=function(){var t=this.model.size,e=this.model.aspect_scale;if(\"pointytop\"==this.model.orientation){var i=this.renderer.yscale,n=this.renderer.xscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))/e,s=r/2,a=[0,-o,-o,0,o,o],l=[r,s,-s,-r,-s,s];return[a,l]}var i=this.renderer.xscale,n=this.renderer.yscale,r=Math.abs(i.compute(0)-i.compute(t)),o=Math.sqrt(3)/2*Math.abs(n.compute(0)-n.compute(t))*e,s=r/2,a=[r,s,-s,-r,-s,s],l=[0,-o,-o,0,o,o];return[a,l]},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.svx,s=i.svy,a=i._scale,l=0,h=e;l<h.length;l++){var c=h[l];if(!isNaN(n[c]+r[c]+a[c])){t.translate(n[c],r[c]),t.beginPath();for(var u=0;u<6;u++)t.lineTo(o[u]*a[c],s[u]*a[c]);t.closePath(),t.translate(-n[c],-r[c]),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke())}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),s=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),a=[],l=0,h=s;l<h.length;l++){var c=h[l];o.point_in_poly(e-this.sx[c],i-this.sy[c],this.svx,this.svy)&&a.push(c)}var u=o.create_empty_hit_test_result();return u.indices=a,u},e.prototype._hit_span=function(t){var e,i=t.sx,n=t.sy;if(\"v\"==t.direction){var r=this.renderer.yscale.invert(n),s=this.renderer.plot_view.frame.bbox.h_range,a=this.renderer.xscale.r_invert(s.start,s.end),l=a[0],h=a[1];e=this.index.indices({minX:l,minY:r,maxX:h,maxY:r})}else{var c=this.renderer.xscale.invert(i),u=this.renderer.plot_view.frame.bbox.v_range,_=this.renderer.yscale.r_invert(u.start,u.end),p=_[0],d=_[1];e=this.index.indices({minX:c,minY:p,maxX:c,maxY:d})}var f=o.create_empty_hit_test_result();return f.indices=e,f},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype.draw_legend_for_index=function(t,e,i){l.generic_area_legend(this.visuals,t,e,i)},e}(r.GlyphView);i.HexTileView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"HexTile\",this.prototype.default_view=h,this.coords([[\"r\",\"q\"]]),this.mixins([\"line\",\"fill\"]),this.define({size:[s.Number,1],aspect_scale:[s.Number,1],scale:[s.NumberSpec,1],orientation:[s.String,\"pointytop\"]}),this.override({line_color:null})},e}(r.Glyph);i.HexTile=c,c.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(154),s=t(15),a=t(21),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return i._update_image()}),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._update_image=function(){null!=this.image_data&&(this._set_data(),this.renderer.plot_view.request_render())},e.prototype._set_data=function(){null!=this.image_data&&this.image_data.length==this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length==this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length==this._image.length||(this._height=new Array(this._image.length));for(var t=this.model.color_mapper.rgba_mapper,e=0,i=this._image.length;e<i;e++){var n=void 0;if(null!=this._image_shape&&this._image_shape[e].length>0){n=this._image[e];var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e];n=a.concat(o),this._height[e]=o.length,this._width[e]=o[0].length}var s=this.image_data[e],l=void 0;null!=s&&s.width==this._width[e]&&s.height==this._height[e]?l=s:((l=document.createElement(\"canvas\")).width=this._width[e],l.height=this._height[e]);var h=l.getContext(\"2d\"),c=h.getImageData(0,0,this._width[e],this._height[e]),u=t.v_compute(n);c.data.set(u),h.putImageData(c,0,0),this.image_data[e]=l,this.max_dw=0,\"data\"==this.model.properties.dw.units&&(this.max_dw=a.max(this._dw)),this.max_dh=0,\"data\"==this.model.properties.dh.units&&(this.max_dh=a.max(this._dh))}},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,\"edge\",this.model.dilate);break;case\"screen\":this.sw=this._dw}switch(this.model.properties.dh.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);break;case\"screen\":this.sh=this._dh}},e.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(null!=n[u]&&!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},e.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);i.ImageView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Image\",this.prototype.default_view=l,this.define({image:[s.NumberSpec],dw:[s.DistanceSpec],dh:[s.DistanceSpec],dilate:[s.Bool,!1],global_alpha:[s.Number,1],color_mapper:[s.Instance,function(){return new o.LinearColorMapper({palette:[\"#000000\",\"#252525\",\"#525252\",\"#737373\",\"#969696\",\"#bdbdbd\",\"#d9d9d9\",\"#f0f0f0\",\"#ffffff\"]})}]})},e}(r.XYGlyph);i.Image=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=t(21),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._set_data=function(t){null!=this.image_data&&this.image_data.length==this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length==this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length==this._image.length||(this._height=new Array(this._image.length));for(var e=0,i=this._image.length;e<i;e++)if(!(null!=t&&t.indexOf(e)<0)){var n=void 0;if(null!=this._image_shape&&this._image_shape[e].length>0){n=this._image[e].buffer;var r=this._image_shape[e];this._height[e]=r[0],this._width[e]=r[1]}else{var o=this._image[e],a=s.concat(o);n=new ArrayBuffer(4*a.length);for(var l=new Uint32Array(n),h=0,c=a.length;h<c;h++)l[h]=a[h];this._height[e]=o.length,this._width[e]=o[0].length}var u=this.image_data[e],_=void 0;null!=u&&u.width==this._width[e]&&u.height==this._height[e]?_=u:((_=document.createElement(\"canvas\")).width=this._width[e],_.height=this._height[e]);var p=_.getContext(\"2d\"),d=p.getImageData(0,0,this._width[e],this._height[e]),f=new Uint8Array(n);d.data.set(f),p.putImageData(d,0,0),this.image_data[e]=_,this.max_dw=0,\"data\"==this.model.properties.dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,\"data\"==this.model.properties.dh.units&&(this.max_dh=s.max(this._dh))}},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,\"edge\",this.model.dilate);break;case\"screen\":this.sw=this._dw}switch(this.model.properties.dh.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,\"edge\",this.model.dilate);break;case\"screen\":this.sh=this._dh}},e.prototype._render=function(t,e,i){var n=i.image_data,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=t.getImageSmoothingEnabled();t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.global_alpha;for(var h=0,c=e;h<c.length;h++){var u=c[h];if(!isNaN(r[u]+o[u]+s[u]+a[u])){var _=o[u];t.translate(0,_),t.scale(1,-1),t.translate(0,-_),t.drawImage(n[u],0|r[u],0|o[u],s[u],a[u]),t.translate(0,_),t.scale(1,-1),t.translate(0,-_)}}t.setImageSmoothingEnabled(l)},e.prototype.bounds=function(){var t=this.index.bbox;return t.maxX+=this.max_dw,t.maxY+=this.max_dh,t},e}(r.XYGlyphView);i.ImageRGBAView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ImageRGBA\",this.prototype.default_view=a,this.define({image:[o.NumberSpec],dw:[o.DistanceSpec],dh:[o.DistanceSpec],global_alpha:[o.Number,1],dilate:[o.Bool,!1]})},e}(r.XYGlyph);i.ImageRGBA=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(14),s=t(15),a=t(22),l=t(37);i.CanvasImage=Image;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._images_rendered=!1,e}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.properties.global_alpha.change,function(){return i.renderer.request_render()})},e.prototype._index_data=function(){return new l.RBush([])},e.prototype._set_data=function(){var t=this;null!=this.image&&this.image.length==this._url.length||(this.image=a.map(this._url,function(){return null}));var e=this.model,n=e.retry_attempts,r=e.retry_timeout;this.retries=a.map(this._url,function(){return n});for(var s=function(e,s){if(null==l._url[e])return\"continue\";var a=new i.CanvasImage;a.onerror=function(){t.retries[e]>0?(o.logger.trace(\"ImageURL failed to load \"+t._url[e]+\" image, retrying in \"+r+\" ms\"),setTimeout(function(){return a.src=t._url[e]},r)):o.logger.warn(\"ImageURL unable to load \"+t._url[e]+\" image after \"+n+\" retries\"),t.retries[e]-=1},a.onload=function(){t.image[e]=a,t.renderer.request_render()},a.src=l._url[e]},l=this,h=0,c=this._url.length;h<c;h++)s(h,c)},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&1==this._images_rendered},e.prototype._map_data=function(){var t=null!=this.model.w?this._w:a.map(this._x,function(){return NaN}),e=null!=this.model.h?this._h:a.map(this._x,function(){return NaN});switch(this.model.properties.w.units){case\"data\":this.sw=this.sdist(this.renderer.xscale,this._x,t,\"edge\",this.model.dilate);break;case\"screen\":this.sw=t}switch(this.model.properties.h.units){case\"data\":this.sh=this.sdist(this.renderer.yscale,this._y,e,\"edge\",this.model.dilate);break;case\"screen\":this.sh=e}},e.prototype._render=function(t,e,i){i._url;var n=i.image,r=i.sx,o=i.sy,s=i.sw,a=i.sh,l=i._angle,h=this.renderer.plot_view.frame;t.rect(h._left.value+1,h._top.value+1,h._width.value-2,h._height.value-2),t.clip();for(var c=!0,u=0,_=e;u<_.length;u++){var p=_[u];if(!isNaN(r[p]+o[p]+l[p])&&-1!=this.retries[p]){var d=n[p];null!=d?this._render_image(t,p,d,r,o,s,a,l):c=!1}}c&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())},e.prototype._final_sx_sy=function(t,e,i,n,r){switch(t){case\"top_left\":return[e,i];case\"top_center\":return[e-n/2,i];case\"top_right\":return[e-n,i];case\"center_right\":return[e-n,i-r/2];case\"bottom_right\":return[e-n,i-r];case\"bottom_center\":return[e-n/2,i-r];case\"bottom_left\":return[e,i-r];case\"center_left\":return[e,i-r/2];case\"center\":return[e-n/2,i-r/2]}},e.prototype._render_image=function(t,e,i,n,r,o,s,a){isNaN(o[e])&&(o[e]=i.width),isNaN(s[e])&&(s[e]=i.height);var l=this.model.anchor,h=this._final_sx_sy(l,n[e],r[e],o[e],s[e]),c=h[0],u=h[1];t.save(),t.globalAlpha=this.model.global_alpha,a[e]?(t.translate(c,u),t.rotate(a[e]),t.drawImage(i,0,0,o[e],s[e]),t.rotate(-a[e]),t.translate(-c,-u)):t.drawImage(i,c,u,o[e],s[e]),t.restore()},e}(r.XYGlyphView);i.ImageURLView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ImageURL\",this.prototype.default_view=h,this.define({url:[s.StringSpec],anchor:[s.Anchor,\"top_left\"],global_alpha:[s.Number,1],angle:[s.AngleSpec,0],w:[s.DistanceSpec],h:[s.DistanceSpec],dilate:[s.Bool,!1],retry_attempts:[s.Number,0],retry_timeout:[s.Number,0]})},e}(r.XYGlyph);i.ImageURL=c,c.initClass()},function(t,e,i){var n=t(106);i.AnnularWedge=n.AnnularWedge;var r=t(107);i.Annulus=r.Annulus;var o=t(108);i.Arc=o.Arc;var s=t(109);i.Bezier=s.Bezier;var a=t(111);i.Circle=a.Circle;var l=t(112);i.Ellipse=l.Ellipse;var h=t(113);i.Glyph=h.Glyph;var c=t(114);i.HBar=c.HBar;var u=t(115);i.HexTile=u.HexTile;var _=t(116);i.Image=_.Image;var p=t(117);i.ImageRGBA=p.ImageRGBA;var d=t(118);i.ImageURL=d.ImageURL;var f=t(120);i.Line=f.Line;var v=t(121);i.MultiLine=v.MultiLine;var m=t(122);i.Oval=m.Oval;var g=t(123);i.Patch=g.Patch;var y=t(124);i.Patches=y.Patches;var b=t(125);i.Quad=b.Quad;var x=t(126);i.Quadratic=x.Quadratic;var w=t(127);i.Ray=w.Ray;var k=t(128);i.Rect=k.Rect;var S=t(129);i.Segment=S.Segment;var C=t(130);i.Step=C.Step;var T=t(131);i.Text=T.Text;var A=t(133);i.VBar=A.VBar;var E=t(134);i.Wedge=E.Wedge;var M=t(135);i.XYGlyph=M.XYGlyph},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=!1,s=null;this.visuals.line.set_value(t);for(var a=0,l=e;a<l.length;a++){var h=l[a];if(o){if(!isFinite(n[h]+r[h])){t.stroke(),t.beginPath(),o=!1,s=h;continue}null!=s&&h-s>1&&(t.stroke(),o=!1)}o?t.lineTo(n[h],r[h]):(t.beginPath(),t.moveTo(n[h],r[h]),o=!0),s=h}o&&t.stroke()},e.prototype._hit_point=function(t){for(var e=this,i=s.create_empty_hit_test_result(),n={x:t.sx,y:t.sy},r=9999,o=Math.max(2,this.visuals.line.line_width.value()/2),a=0,l=this.sx.length-1;a<l;a++){var h={x:this.sx[a],y:this.sy[a]},c={x:this.sx[a+1],y:this.sy[a+1]},u=s.dist_to_segment(n,h,c);u<o&&u<r&&(r=u,i.add_to_selected_glyphs(this.model),i.get_view=function(){return e},i.line_indices=[a])}return i},e.prototype._hit_span=function(t){var e,i,n=this,r=t.sx,o=t.sy,a=s.create_empty_hit_test_result();\"v\"==t.direction?(e=this.renderer.yscale.invert(o),i=this._y):(e=this.renderer.xscale.invert(r),i=this._x);for(var l=0,h=i.length-1;l<h;l++)(i[l]<=e&&e<=i[l+1]||i[l+1]<=e&&e<=i[l])&&(a.add_to_selected_glyphs(this.model),a.get_view=function(){return n},a.line_indices.push(l));return a},e.prototype.get_interpolation_hit=function(t,e){var i,n,r,o,a=e.sx,l=e.sy,h=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],c=h[0],u=h[1],_=h[2],p=h[3];\"point\"==e.type?(m=this.renderer.yscale.r_invert(l-1,l+1),r=m[0],o=m[1],g=this.renderer.xscale.r_invert(a-1,a+1),i=g[0],n=g[1]):\"v\"==e.direction?(y=this.renderer.yscale.r_invert(l,l),r=y[0],o=y[1],i=(b=[c,_])[0],n=b[1]):(x=this.renderer.xscale.r_invert(a,a),i=x[0],n=x[1],r=(w=[u,p])[0],o=w[1]);var d=s.check_2_segments_intersect(i,r,n,o,c,u,_,p),f=d.x,v=d.y;return[f,v];var m,g,y,b,x,w},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.LineView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Line\",this.prototype.default_view=a,this.mixins([\"line\"])},e}(r.XYGlyph);i.Line=l,l.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(9),s=t(32),a=t(21),l=t(44),h=t(113),c=t(132),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._xs.length;e<i;e++)if(null!=this._xs[e]&&0!==this._xs[e].length){for(var n=this._xs[e],o=[],s=0,h=n.length;s<h;s++){var c=n[s];l.isStrictNaN(c)||o.push(c)}for(var u=this._ys[e],_=[],s=0,h=u.length;s<h;s++){var p=u[s];l.isStrictNaN(p)||_.push(p)}var d=[a.min(o),a.max(o)],f=d[0],v=d[1],m=[a.min(_),a.max(_)],g=m[0],y=m[1];t.push({minX:f,minY:g,maxX:v,maxY:y,i:e})}return new r.RBush(t)},e.prototype._render=function(t,e,i){for(var n=i.sxs,r=i.sys,o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u])||isNaN(c[u])?(t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.stroke()}},e.prototype._hit_point=function(t){for(var e=o.create_empty_hit_test_result(),i={x:t.sx,y:t.sy},n=9999,r={},a=0,l=this.sxs.length;a<l;a++){for(var h=Math.max(2,this.visuals.line.cache_select(\"line_width\",a)/2),c=null,u=0,_=this.sxs[a].length-1;u<_;u++){var p={x:this.sxs[a][u],y:this.sys[a][u]},d={x:this.sxs[a][u+1],y:this.sys[a][u+1]},f=o.dist_to_segment(i,p,d);f<h&&f<n&&(n=f,c=[u])}c&&(r[a]=c)}return e.indices=s.keys(r).map(function(t){return parseInt(t,10)}),e.multiline_indices=r,e},e.prototype._hit_span=function(t){var e,i,n=t.sx,r=t.sy,a=o.create_empty_hit_test_result();\"v\"===t.direction?(e=this.renderer.yscale.invert(r),i=this._ys):(e=this.renderer.xscale.invert(n),i=this._xs);for(var l={},h=0,c=i.length;h<c;h++){for(var u=[],_=0,p=i[h].length-1;_<p;_++)i[h][_]<=e&&e<=i[h][_+1]&&u.push(_);u.length>0&&(l[h]=u)}return a.indices=s.keys(l).map(function(t){return parseInt(t,10)}),a.multiline_indices=l,a},e.prototype.get_interpolation_hit=function(t,e,i){var n,r,s,a,l=i.sx,h=i.sy,c=this._xs[t][e],u=this._ys[t][e],_=this._xs[t][e+1],p=this._ys[t][e+1];\"point\"==i.type?(m=this.renderer.yscale.r_invert(h-1,h+1),s=m[0],a=m[1],g=this.renderer.xscale.r_invert(l-1,l+1),n=g[0],r=g[1]):\"v\"==i.direction?(y=this.renderer.yscale.r_invert(h,h),s=y[0],a=y[1],n=(b=[c,_])[0],r=b[1]):(x=this.renderer.xscale.r_invert(l,l),n=x[0],r=x[1],s=(w=[u,p])[0],a=w[1]);var d=o.check_2_segments_intersect(n,s,r,a,c,u,_,p),f=d.x,v=d.y;return[f,v];var m,g,y,b,x,w},e.prototype.draw_legend_for_index=function(t,e,i){c.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(h.GlyphView);i.MultiLineView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MultiLine\",this.prototype.default_view=u,this.coords([[\"xs\",\"ys\"]]),this.mixins([\"line\"])},e}(h.Glyph);i.MultiLine=_,_.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){\"data\"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"):this.sw=this._width,\"data\"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,\"center\"):this.sh=this._height},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sw,s=i.sh,a=i._angle,l=0,h=e;l<h.length;l++){var c=h[l];isNaN(n[c]+r[c]+o[c]+s[c]+a[c])||(t.translate(n[c],r[c]),t.rotate(a[c]),t.beginPath(),t.moveTo(0,-s[c]/2),t.bezierCurveTo(o[c]/2,-s[c]/2,o[c]/2,s[c]/2,0,s[c]/2),t.bezierCurveTo(-o[c]/2,s[c]/2,-o[c]/2,-s[c]/2,0,-s[c]/2),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,c),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,c),t.stroke()),t.rotate(-a[c]),t.translate(-n[c],-r[c]))}},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.y0,o=e.x1,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+o)/2;var h=new Array(a);h[i]=(r+s)/2;var c=this.sw[i]/this.sh[i],u=.8*Math.min(Math.abs(o-n),Math.abs(s-r)),_=new Array(a),p=new Array(a);c>1?(_[i]=u,p[i]=u/c):(_[i]=u*c,p[i]=u),this._render(t,[i],{sx:l,sy:h,sw:_,sh:p})},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.OvalView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Oval\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"]),this.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},e}(r.XYGlyph);i.Oval=a,a.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy;if(this.visuals.fill.doit){this.visuals.fill.set_value(t);for(var o=0,s=e;o<s.length;o++){var a=s[o];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_value(t);for(var l=0,h=e;l<h.length;l++){var a=h[l];0!=a?isNaN(n[a]+r[a])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(n[a],r[a]):(t.beginPath(),t.moveTo(n[a],r[a]))}return t.closePath(),t.stroke()}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.PatchView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Patch\",this.prototype.default_view=s,this.mixins([\"line\",\"fill\"])},e}(r.XYGlyph);i.Patch=a,a.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=t(132),a=t(21),l=t(22),h=t(44),c=t(9),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._build_discontinuous_object=function(t){for(var e=[],i=0,n=t.length;i<n;i++){e[i]=[];for(var r=a.copy(t[i]);r.length>0;){var o=a.findLastIndex(r,function(t){return h.isStrictNaN(t)}),s=void 0;o>=0?s=r.splice(o):(s=r,r=[]);var l=s.filter(function(t){return!h.isStrictNaN(t)});e[i].push(l)}}return e},e.prototype._index_data=function(){for(var t=this._build_discontinuous_object(this._xs),e=this._build_discontinuous_object(this._ys),i=[],n=0,o=this._xs.length;n<o;n++)for(var s=0,l=t[n].length;s<l;s++){var h=t[n][s],c=e[n][s];0!=h.length&&i.push({minX:a.min(h),minY:a.min(c),maxX:a.max(h),maxY:a.max(c),i:n})}return new r.RBush(i)},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.x_ranges.default,e=[t.min,t.max],i=e[0],n=e[1],r=this.renderer.plot_view.frame.y_ranges.default,o=[r.min,r.max],s=o[0],a=o[1],l=c.validate_bbox_coords([i,n],[s,a]),h=this.index.indices(l);return h.sort(function(t,e){return t-e})},e.prototype._render=function(t,e,i){var n=i.sxs,r=i.sys;this.sxss=this._build_discontinuous_object(n),this.syss=this._build_discontinuous_object(r);for(var o=0,s=e;o<s.length;o++){var a=s[o],l=[n[a],r[a]],h=l[0],c=l[1];if(this.visuals.fill.doit){this.visuals.fill.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.fill()}if(this.visuals.line.doit){this.visuals.line.set_vectorize(t,a);for(var u=0,_=h.length;u<_;u++)0!=u?isNaN(h[u]+c[u])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(h[u],c[u]):(t.beginPath(),t.moveTo(h[u],c[u]));t.closePath(),t.stroke()}}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=this.index.indices({minX:n,minY:r,maxX:n,maxY:r}),s=[],a=0,l=o.length;a<l;a++)for(var h=o[a],u=this.sxss[h],_=this.syss[h],p=0,d=u.length;p<d;p++)c.point_in_poly(e,i,u[p],_[p])&&s.push(h);var f=c.create_empty_hit_test_result();return f.indices=s,f},e.prototype._get_snap_coord=function(t){return l.sum(t)/t.length},e.prototype.scenterx=function(t,e,i){if(1==this.sxss[t].length)return this._get_snap_coord(this.sxs[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(c.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(n[o]);throw new Error(\"unreachable code\")},e.prototype.scentery=function(t,e,i){if(1==this.syss[t].length)return this._get_snap_coord(this.sys[t]);for(var n=this.sxss[t],r=this.syss[t],o=0,s=n.length;o<s;o++)if(c.point_in_poly(e,i,n[o],r[o]))return this._get_snap_coord(r[o]);throw new Error(\"unreachable code\")},e.prototype.draw_legend_for_index=function(t,e,i){s.generic_area_legend(this.visuals,t,e,i)},e}(o.GlyphView);i.PatchesView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Patches\",this.prototype.default_view=u,this.coords([[\"xs\",\"ys\"]]),this.mixins([\"line\",\"fill\"])},e}(o.Glyph);i.Patches=_,_.initClass()},function(t,e,i){var n=t(379),r=t(110),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.get_anchor_point=function(t,e,i){var n=Math.min(this.sleft[e],this.sright[e]),r=Math.max(this.sright[e],this.sleft[e]),o=Math.min(this.stop[e],this.sbottom[e]),s=Math.max(this.sbottom[e],this.stop[e]);switch(t){case\"top_left\":return{x:n,y:o};case\"top_center\":return{x:(n+r)/2,y:o};case\"top_right\":return{x:r,y:o};case\"center_right\":return{x:r,y:(o+s)/2};case\"bottom_right\":return{x:r,y:s};case\"bottom_center\":return{x:(n+r)/2,y:s};case\"bottom_left\":return{x:n,y:s};case\"center_left\":return{x:n,y:(o+s)/2};case\"center\":return{x:(n+r)/2,y:(o+s)/2};default:return null}},e.prototype.scenterx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e=this._left[t],i=this._right[t],n=this._top[t],r=this._bottom[t];return[e,i,n,r]},e}(r.BoxView);i.QuadView=o;var s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Quad\",this.prototype.default_view=o,this.coords([[\"right\",\"bottom\"],[\"left\",\"top\"]])},e}(r.Box);i.Quad=s,s.initClass()},function(t,e,i){function n(t,e,i){if(e==(t+i)/2)return[t,i];var n=(t-e)/(t-2*e+i),r=t*Math.pow(1-n,2)+2*e*(1-n)*n+i*Math.pow(n,2);return[Math.min(t,i,r),Math.max(t,i,r)]}var r=t(379),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++)if(!isNaN(this._x0[e]+this._x1[e]+this._y0[e]+this._y1[e]+this._cx[e]+this._cy[e])){var r=n(this._x0[e],this._cx[e],this._x1[e]),s=r[0],a=r[1],l=n(this._y0[e],this._cy[e],this._y1[e]),h=l[0],c=l[1];t.push({minX:s,minY:h,maxX:a,maxY:c,i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1,a=i.scx,l=i.scy;if(this.visuals.line.doit)for(var h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u]+l[u])||(t.beginPath(),t.moveTo(n[u],r[u]),t.quadraticCurveTo(a[u],l[u],o[u],s[u]),this.visuals.line.set_vectorize(t,u),t.stroke())}},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e.prototype.scenterx=function(){throw new Error(\"not implemented\")},e.prototype.scentery=function(){throw new Error(\"not implemented\")},e}(s.GlyphView);i.QuadraticView=l;var h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.initClass=function(){this.prototype.type=\"Quadratic\",this.prototype.default_view=l,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"],[\"cx\",\"cy\"]]),this.mixins([\"line\"])},e}(s.Glyph);i.Quadratic=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this._length):this.slength=this._length},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.slength,s=i._angle;if(this.visuals.line.doit){for(var a=this.renderer.plot_view.frame._width.value,l=this.renderer.plot_view.frame._height.value,h=2*(a+l),c=0,u=o.length;c<u;c++)0==o[c]&&(o[c]=h);for(var _=0,p=e;_<p.length;_++){var c=p[_];isNaN(n[c]+r[c]+s[c]+o[c])||(t.translate(n[c],r[c]),t.rotate(s[c]),t.beginPath(),t.moveTo(0,0),t.lineTo(o[c],0),this.visuals.line.set_vectorize(t,c),t.stroke(),t.rotate(-s[c]),t.translate(-n[c],-r[c]))}}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.RayView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Ray\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({length:[s.DistanceSpec],angle:[s.AngleSpec]})},e}(r.XYGlyph);i.Ray=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._set_data=function(){this.max_w2=0,\"data\"==this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,\"data\"==this.model.properties.height.units&&(this.max_h2=this.max_height/2)},e.prototype._map_data=function(){if(\"data\"==this.model.properties.width.units)r=this._map_dist_corner_for_data_side_length(this._x,this._width,this.renderer.xscale),this.sw=r[0],this.sx0=r[1];else{this.sw=this._width;var t=this.sx.length;this.sx0=new Float64Array(t);for(var e=0;e<t;e++)this.sx0[e]=this.sx[e]-this.sw[e]/2}if(\"data\"==this.model.properties.height.units)o=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale),this.sh=o[0],this.sy1=o[1];else{this.sh=this._height;var i=this.sy.length;this.sy1=new Float64Array(i);for(var e=0;e<i;e++)this.sy1[e]=this.sy[e]-this.sh[e]/2}var n=this.sw.length;this.ssemi_diag=new Float64Array(n);for(var e=0;e<n;e++)this.ssemi_diag[e]=Math.sqrt(this.sw[e]/2*this.sw[e]/2+this.sh[e]/2*this.sh[e]/2);var r,o},e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy,o=i.sx0,s=i.sy1,a=i.sw,l=i.sh,h=i._angle;if(this.visuals.fill.doit)for(var c=0,u=e;c<u.length;c++){var _=u[c];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||(this.visuals.fill.set_vectorize(t,_),h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.fillRect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.fillRect(o[_],s[_],a[_],l[_]))}if(this.visuals.line.doit){t.beginPath();for(var p=0,d=e;p<d.length;p++){var _=d[p];isNaN(n[_]+r[_]+o[_]+s[_]+a[_]+l[_]+h[_])||0!=a[_]&&0!=l[_]&&(h[_]?(t.translate(n[_],r[_]),t.rotate(h[_]),t.rect(-a[_]/2,-l[_]/2,a[_],l[_]),t.rotate(-h[_]),t.translate(-n[_],-r[_])):t.rect(o[_],s[_],a[_],l[_]),this.visuals.line.set_vectorize(t,_),t.stroke(),t.beginPath())}t.stroke()}},e.prototype._hit_rect=function(t){return this._hit_rect_against_index(t)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=this.renderer.xscale.invert(e),r=this.renderer.yscale.invert(i),o=[],a=0,h=this.sx0.length;a<h;a++)o.push(this.sx0[a]+this.sw[a]/2);for(var c=[],a=0,h=this.sy1.length;a<h;a++)c.push(this.sy1[a]+this.sh[a]/2);for(var u=l.max(this._ddist(0,o,this.ssemi_diag)),_=l.max(this._ddist(1,c,this.ssemi_diag)),p=n-u,d=n+u,f=r-_,v=r+_,m=[],g=s.validate_bbox_coords([p,d],[f,v]),y=0,b=this.index.indices(g);y<b.length;y++){var a=b[y],x=void 0,w=void 0;if(this._angle[a]){var k=Math.sin(-this._angle[a]),S=Math.cos(-this._angle[a]),C=S*(e-this.sx[a])-k*(i-this.sy[a])+this.sx[a],T=k*(e-this.sx[a])+S*(i-this.sy[a])+this.sy[a];e=C,i=T,w=Math.abs(this.sx[a]-e)<=this.sw[a]/2,x=Math.abs(this.sy[a]-i)<=this.sh[a]/2}else w=e-this.sx0[a]<=this.sw[a]&&e-this.sx0[a]>=0,x=i-this.sy1[a]<=this.sh[a]&&i-this.sy1[a]>=0;x&&w&&m.push(a)}var A=s.create_empty_hit_test_result();return A.indices=m,A},e.prototype._map_dist_corner_for_data_side_length=function(t,e,i){for(var n=t.length,r=new Float64Array(n),o=new Float64Array(n),s=0;s<n;s++)r[s]=Number(t[s])-e[s]/2,o[s]=Number(t[s])+e[s]/2;for(var a=i.v_compute(r),l=i.v_compute(o),h=this.sdist(i,r,e,\"edge\",this.model.dilate),c=a,s=0,u=a.length;s<u;s++)if(a[s]!=l[s]){c=a[s]<l[s]?a:l;break}return[h,c]},e.prototype._ddist=function(t,e,i){for(var n=0==t?this.renderer.xscale:this.renderer.yscale,r=e,o=r.length,s=new Float64Array(o),a=0;a<o;a++)s[a]=r[a]+i[a];for(var l=n.v_invert(r),h=n.v_invert(s),c=l.length,u=new Float64Array(c),a=0;a<c;a++)u[a]=Math.abs(h[a]-l[a]);return u},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e.prototype._bounds=function(t){var e=t.minX,i=t.maxX,n=t.minY,r=t.maxY;return{minX:e-this.max_w2,maxX:i+this.max_w2,minY:n-this.max_h2,maxY:r+this.max_h2}},e}(r.XYGlyphView);i.RectView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Rect\",this.prototype.default_view=h,this.mixins([\"line\",\"fill\"]),this.define({angle:[a.AngleSpec,0],width:[a.DistanceSpec],height:[a.DistanceSpec],dilate:[a.Bool,!1]})},e}(r.XYGlyph);i.Rect=c,c.initClass()},function(t,e,i){var n=t(379),r=t(9),o=t(37),s=t(113),a=t(132),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x0.length;e<i;e++){var n=this._x0[e],r=this._x1[e],s=this._y0[e],a=this._y1[e];isNaN(n+r+s+a)||t.push({minX:Math.min(n,r),minY:Math.min(s,a),maxX:Math.max(n,r),maxY:Math.max(s,a),i:e})}return new o.RBush(t)},e.prototype._render=function(t,e,i){var n=i.sx0,r=i.sy0,o=i.sx1,s=i.sy1;if(this.visuals.line.doit)for(var a=0,l=e;a<l.length;a++){var h=l[a];isNaN(n[h]+r[h]+o[h]+s[h])||(t.beginPath(),t.moveTo(n[h],r[h]),t.lineTo(o[h],s[h]),this.visuals.line.set_vectorize(t,h),t.stroke())}},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n={x:e,y:i},o=[],s=this.renderer.xscale.r_invert(e-2,e+2),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(i-2,i+2),c=h[0],u=h[1],_=this.index.indices({minX:a,minY:c,maxX:l,maxY:u}),p=0,d=_;p<d.length;p++){var f=d[p],v=Math.pow(Math.max(2,this.visuals.line.cache_select(\"line_width\",f)/2),2),m={x:this.sx0[f],y:this.sy0[f]},g={x:this.sx1[f],y:this.sy1[f]},y=r.dist_to_segment_squared(n,m,g);y<v&&o.push(f)}var b=r.create_empty_hit_test_result();return b.indices=o,b},e.prototype._hit_span=function(t){var e,i,n,o=this.renderer.plot_view.frame.bbox.ranges,s=o[0],a=o[1],l=t.sx,h=t.sy;\"v\"==t.direction?(n=this.renderer.yscale.invert(h),w=[this._y0,this._y1],e=w[0],i=w[1]):(n=this.renderer.xscale.invert(l),k=[this._x0,this._x1],e=k[0],i=k[1]);for(var c=[],u=this.renderer.xscale.r_invert(s.start,s.end),_=u[0],p=u[1],d=this.renderer.yscale.r_invert(a.start,a.end),f=d[0],v=d[1],m=this.index.indices({minX:_,minY:f,maxX:p,maxY:v}),g=0,y=m;g<y.length;g++){var b=y[g];(e[b]<=n&&n<=i[b]||i[b]<=n&&n<=e[b])&&c.push(b)}var x=r.create_empty_hit_test_result();return x.indices=c,x;var w,k},e.prototype.scenterx=function(t){return(this.sx0[t]+this.sx1[t])/2},e.prototype.scentery=function(t){return(this.sy0[t]+this.sy1[t])/2},e.prototype.draw_legend_for_index=function(t,e,i){a.generic_line_legend(this.visuals,t,e,i)},e}(s.GlyphView);i.SegmentView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Segment\",this.prototype.default_view=l,this.coords([[\"x0\",\"y0\"],[\"x1\",\"y1\"]]),this.mixins([\"line\"])},e}(s.Glyph);i.Segment=h,h.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){var n=i.sx,r=i.sy;this.visuals.line.set_value(t);var o=e.length;if(!(o<2)){t.beginPath(),t.moveTo(n[0],r[0]);for(var s=1;s<o;s++){var a=void 0,l=void 0,h=void 0,c=void 0;switch(this.model.mode){case\"before\":_=[n[s-1],r[s]],a=_[0],h=_[1],p=[n[s],r[s]],l=p[0],c=p[1];break;case\"after\":d=[n[s],r[s-1]],a=d[0],h=d[1],f=[n[s],r[s]],l=f[0],c=f[1];break;case\"center\":var u=(n[s-1]+n[s])/2;v=[u,r[s-1]],a=v[0],h=v[1],m=[u,r[s]],l=m[0],c=m[1];break;default:throw new Error(\"unexpected\")}t.lineTo(a,h),t.lineTo(l,c)}t.lineTo(n[o-1],r[o-1]),t.stroke();var _,p,d,f,v,m}},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_line_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.StepView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Step\",this.prototype.default_view=a,this.mixins([\"line\"]),this.define({mode:[s.StepMode,\"before\"]})},e}(r.XYGlyph);i.Step=l,l.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(15),s=t(41),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._x_offset,a=i._y_offset,l=i._angle,h=i._text,c=0,u=e;c<u.length;c++){var _=u[c];if(!isNaN(n[_]+r[_]+o[_]+a[_]+l[_])&&null!=h[_]&&this.visuals.text.doit){var p=\"\"+h[_];if(t.save(),t.translate(n[_]+o[_],r[_]+a[_]),t.rotate(l[_]),this.visuals.text.set_vectorize(t,_),-1==p.indexOf(\"\\n\"))t.fillText(p,0,0);else{var d=p.split(\"\\n\"),f=this.visuals.text.cache_select(\"font\",_),v=s.get_text_height(f).height,m=this.visuals.text.text_line_height.value()*v,g=m*d.length,y=this.visuals.text.cache_select(\"text_baseline\",_),b=void 0;switch(y){case\"top\":b=0;break;case\"middle\":b=-g/2+m/2;break;case\"bottom\":b=-g+m;break;default:b=0,console.warn(\"'\"+y+\"' baseline not supported with multi line text\")}for(var x=0,w=d;x<w.length;x++){var k=w[x];t.fillText(k,0,b),b+=m}}t.restore()}}},e}(r.XYGlyphView);i.TextView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Text\",this.prototype.default_view=a,this.mixins([\"text\"]),this.define({text:[o.StringSpec,{field:\"text\"}],angle:[o.AngleSpec,0],x_offset:[o.NumberSpec,0],y_offset:[o.NumberSpec,0]})},e}(r.XYGlyph);i.Text=l,l.initClass()},function(t,e,i){i.generic_line_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1;e.save(),e.beginPath(),e.moveTo(r,(s+a)/2),e.lineTo(o,(s+a)/2),t.line.doit&&(t.line.set_vectorize(e,n),e.stroke());e.restore()},i.generic_area_legend=function(t,e,i,n){var r=i.x0,o=i.x1,s=i.y0,a=i.y1,l=.1*Math.abs(o-r),h=.1*Math.abs(a-s),c=r+l,u=o-l,_=s+h,p=a-h;t.fill.doit&&(t.fill.set_vectorize(e,n),e.fillRect(c,_,u-c,p-_));t.line.doit&&(e.beginPath(),e.rect(c,_,u-c,p-_),t.line.set_vectorize(e,n),e.stroke())}},function(t,e,i){var n=t(379),r=t(110),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._x.length)},e.prototype._lrtb=function(t){var e=this._x[t]-this._width[t]/2,i=this._x[t]+this._width[t]/2,n=Math.max(this._top[t],this._bottom[t]),r=Math.min(this._top[t],this._bottom[t]);return[e,i,n,r]},e.prototype._map_data=function(){this.sx=this.renderer.xscale.v_compute(this._x),this.sw=this.sdist(this.renderer.xscale,this._x,this._width,\"center\"),this.stop=this.renderer.yscale.v_compute(this._top),this.sbottom=this.renderer.yscale.v_compute(this._bottom);var t=this.sx.length;this.sleft=new Float64Array(t),this.sright=new Float64Array(t);for(var e=0;e<t;e++)this.sleft[e]=this.sx[e]-this.sw[e]/2,this.sright[e]=this.sx[e]+this.sw[e]/2},e}(r.BoxView);i.VBarView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"VBar\",this.prototype.default_view=s,this.coords([[\"x\",\"bottom\"]]),this.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),this.override({bottom:0})},e}(r.Box);i.VBar=a,a.initClass()},function(t,e,i){var n=t(379),r=t(135),o=t(132),s=t(9),a=t(15),l=t(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._map_data=function(){\"data\"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i.sradius,s=i._start_angle,a=i._end_angle,l=this.model.properties.direction.value(),h=0,c=e;h<c.length;h++){var u=c[h];isNaN(n[u]+r[u]+o[u]+s[u]+a[u])||(t.beginPath(),t.arc(n[u],r[u],o[u],s[u],a[u],l),t.lineTo(n[u],r[u]),t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,u),t.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,u),t.stroke()))}},e.prototype._hit_point=function(t){var e,i,n,r,o,a,h,c,u,_=t.sx,p=t.sy,d=this.renderer.xscale.invert(_),f=this.renderer.yscale.invert(p);\"data\"===this.model.properties.radius.units?(a=d-this.max_radius,h=d+this.max_radius,c=f-this.max_radius,u=f+this.max_radius):(i=_-this.max_radius,n=_+this.max_radius,M=this.renderer.xscale.r_invert(i,n),a=M[0],h=M[1],r=p-this.max_radius,o=p+this.max_radius,O=this.renderer.yscale.r_invert(r,o),c=O[0],u=O[1]);for(var v=[],m=s.validate_bbox_coords([a,h],[c,u]),g=0,y=this.index.indices(m);g<y.length;g++){var b=y[g],x=Math.pow(this.sradius[b],2);z=this.renderer.xscale.r_compute(d,this._x[b]),i=z[0],n=z[1],P=this.renderer.yscale.r_compute(f,this._y[b]),r=P[0],o=P[1],(e=Math.pow(i-n,2)+Math.pow(r-o,2))<=x&&v.push([b,e])}for(var w=this.model.properties.direction.value(),k=[],S=0,C=v;S<C.length;S++){var T=C[S],b=T[0],A=T[1],E=Math.atan2(p-this.sy[b],_-this.sx[b]);l.angle_between(-E,-this._start_angle[b],-this._end_angle[b],w)&&k.push([b,A])}return s.create_hit_test_result_from_hits(k);var M,O,z,P},e.prototype.draw_legend_for_index=function(t,e,i){o.generic_area_legend(this.visuals,t,e,i)},e}(r.XYGlyphView);i.WedgeView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Wedge\",this.prototype.default_view=h,this.mixins([\"line\",\"fill\"]),this.define({direction:[a.Direction,\"anticlock\"],radius:[a.DistanceSpec],start_angle:[a.AngleSpec],end_angle:[a.AngleSpec]})},e}(r.XYGlyph);i.Wedge=c,c.initClass()},function(t,e,i){var n=t(379),r=t(37),o=t(113),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._index_data=function(){for(var t=[],e=0,i=this._x.length;e<i;e++){var n=this._x[e],o=this._y[e];!isNaN(n+o)&&isFinite(n+o)&&t.push({minX:n,minY:o,maxX:n,maxY:o,i:e})}return new r.RBush(t)},e.prototype.scenterx=function(t){return this.sx[t]},e.prototype.scentery=function(t){return this.sy[t]},e}(o.GlyphView);i.XYGlyphView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"XYGlyph\",this.coords([[\"x\",\"y\"]])},e}(o.Glyph);i.XYGlyph=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(22),s=t(21),a=t(9),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GraphHitTestPolicy\"},e.prototype._hit_test_nodes=function(t,e){if(!e.model.visible)return null;var i=e.node_view.glyph.hit_test(t);return null==i?null:e.node_view.model.view.convert_selection_from_subset(i)},e.prototype._hit_test_edges=function(t,e){if(!e.model.visible)return null;var i=e.edge_view.glyph.hit_test(t);return null==i?null:e.edge_view.model.view.convert_selection_from_subset(i)},e}(r.Model);i.GraphHitTestPolicy=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"NodesOnly\"},e.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;return r.update(t,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.model.get_selection_manager().get_or_create_inspector(i.node_view.model);return o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},e}(l);i.NodesOnly=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"NodesAndLinkedEdges\"},e.prototype.hit_test=function(t,e){return this._hit_test_nodes(t,e)},e.prototype.get_linked_edges=function(t,e,i){var n=[];\"selection\"==i?n=t.selected.indices.map(function(e){return t.data.index[e]}):\"inspection\"==i&&(n=t.inspected.indices.map(function(e){return t.data.index[e]}));for(var r=[],o=0;o<e.data.start.length;o++)(s.contains(n,e.data.start[o])||s.contains(n,e.data.end[o]))&&r.push(o);for(var l=a.create_empty_hit_test_result(),h=0,c=r;h<c.length;h++){var o=c[h];l.multiline_indices[o]=[0]}return l.indices=r,l},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.node_renderer.data_source.selected;r.update(t,i,n);var o=e.edge_renderer.data_source.selected,s=this.get_linked_edges(e.node_renderer.data_source,e.edge_renderer.data_source,\"selection\");return o.update(s,i,n),e.node_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model);o.update(t,n,r),i.node_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model),a=this.get_linked_edges(i.node_view.model.data_source,i.edge_view.model.data_source,\"inspection\");return s.update(a,n,r),i.edge_view.model.data_source.setv({inspected:s},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view,{geometry:e}]),!o.is_empty()},e}(l);i.NodesAndLinkedEdges=c,c.initClass();var u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"EdgesAndLinkedNodes\"},e.prototype.hit_test=function(t,e){return this._hit_test_edges(t,e)},e.prototype.get_linked_nodes=function(t,e,i){var n=[];\"selection\"==i?n=e.selected.indices:\"inspection\"==i&&(n=e.inspected.indices);for(var r=[],l=0,h=n;l<h.length;l++){var c=h[l];r.push(e.data.start[c]),r.push(e.data.end[c])}var u=s.uniq(r).map(function(e){return o.indexOf(t.data.index,e)}),_=a.create_empty_hit_test_result();return _.indices=u,_},e.prototype.do_selection=function(t,e,i,n){if(null==t)return!1;var r=e.edge_renderer.data_source.selected;r.update(t,i,n);var o=e.node_renderer.data_source.selected,s=this.get_linked_nodes(e.node_renderer.data_source,e.edge_renderer.data_source,\"selection\");return o.update(s,i,n),e.edge_renderer.data_source._select.emit(),!r.is_empty()},e.prototype.do_inspection=function(t,e,i,n,r){if(null==t)return!1;var o=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model);o.update(t,n,r),i.edge_view.model.data_source.setv({inspected:o},{silent:!0});var s=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model),a=this.get_linked_nodes(i.node_view.model.data_source,i.edge_view.model.data_source,\"inspection\");return s.update(a,n,r),i.node_view.model.data_source.setv({inspected:s},{silent:!0}),i.edge_view.model.data_source.inspect.emit([i.edge_view,{geometry:e}]),!o.is_empty()},e}(l);i.EdgesAndLinkedNodes=u,u.initClass()},function(t,e,i){var n=t(379);n.__exportStar(t(136),i),n.__exportStar(t(138),i),n.__exportStar(t(139),i)},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LayoutProvider\"},e}(r.Model);i.LayoutProvider=o,o.initClass()},function(t,e,i){var n=t(379),r=t(138),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"StaticLayoutProvider\",this.define({graph_layout:[o.Any,{}]})},e.prototype.get_node_coordinates=function(t){for(var e=[],i=[],n=t.data.index,r=0,o=n.length;r<o;r++){var s=this.graph_layout[n[r]],a=null!=s?s:[NaN,NaN],l=a[0],h=a[1];e.push(l),i.push(h)}return[e,i]},e.prototype.get_edge_coordinates=function(t){for(var e=[],i=[],n=t.data.start,r=t.data.end,o=null!=t.data.xs&&null!=t.data.ys,s=0,a=n.length;s<a;s++){var l=null!=this.graph_layout[n[s]]&&null!=this.graph_layout[r[s]];if(o&&l)e.push(t.data.xs[s]),i.push(t.data.ys[s]);else{var h=void 0,c=void 0;l?(u=[this.graph_layout[n[s]],this.graph_layout[r[s]]],c=u[0],h=u[1]):(_=[[NaN,NaN],[NaN,NaN]],c=_[0],h=_[1]),e.push([c[0],h[0]]),i.push([c[1],h[1]])}}return[e,i];var u,_},e}(r.LayoutProvider);i.StaticLayoutProvider=s,s.initClass()},function(t,e,i){var n=t(379),r=t(72),o=t(171),s=t(15),a=t(44),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,\"_x_range_name\",{get:function(){return this.model.x_range_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"_y_range_name\",{get:function(){return this.model.y_range_name},enumerable:!0,configurable:!0}),e.prototype.render=function(){if(this.model.visible){var t=this.plot_view.canvas_view.ctx;t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()})},e.prototype._draw_regions=function(t){if(this.visuals.band_fill.doit){var e=this.model.grid_coords(\"major\",!1),i=e[0],n=e[1];this.visuals.band_fill.set_value(t);for(var r=0;r<i.length-1;r++)if(r%2==1){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1],l=this.plot_view.map_to_screen(i[r+1],n[r+1],this._x_range_name,this._y_range_name),h=l[0],c=l[1];t.fillRect(s[0],a[0],h[1]-s[0],c[1]-a[0]),t.fill()}}},e.prototype._draw_grids=function(t){if(this.visuals.grid_line.doit){var e=this.model.grid_coords(\"major\"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.grid_line,i,n)}},e.prototype._draw_minor_grids=function(t){if(this.visuals.minor_grid_line.doit){var e=this.model.grid_coords(\"minor\"),i=e[0],n=e[1];this._draw_grid_helper(t,this.visuals.minor_grid_line,i,n)}},e.prototype._draw_grid_helper=function(t,e,i,n){e.set_value(t);for(var r=0;r<i.length;r++){var o=this.plot_view.map_to_screen(i[r],n[r],this._x_range_name,this._y_range_name),s=o[0],a=o[1];t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(a[0]));for(var l=1;l<s.length;l++)t.lineTo(Math.round(s[l]),Math.round(a[l]));t.stroke()}},e}(o.GuideRendererView);i.GridView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Grid\",this.prototype.default_view=l,this.mixins([\"line:grid_\",\"line:minor_grid_\",\"fill:band_\"]),this.define({bounds:[s.Any,\"auto\"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"]}),this.override({level:\"underlay\",band_fill_color:null,band_fill_alpha:0,grid_line_color:\"#e5e5e5\",minor_grid_line_color:null})},e.prototype.ranges=function(){var t=this.dimension,e=(t+1)%2,i=this.plot.plot_canvas.frame,n=[i.x_ranges[this.x_range_name],i.y_ranges[this.y_range_name]];return[n[t],n[e]]},e.prototype.computed_bounds=function(){var t,e,i=this.ranges()[0],n=this.bounds,o=[i.min,i.max];if(a.isArray(n))t=Math.min(n[0],n[1]),e=Math.max(n[0],n[1]),t<o[0]&&(t=o[0]),e>o[1]&&(e=o[1]);else{t=o[0],e=o[1];for(var s=0,l=this.plot.select(r.Axis);s<l.length;s++){var h=l[s];h.dimension==this.dimension&&h.x_range_name==this.x_range_name&&h.y_range_name==this.y_range_name&&(c=h.computed_bounds,t=c[0],e=c[1])}}return[t,e];var c},e.prototype.grid_coords=function(t,e){void 0===e&&(e=!0);var i=this.dimension,n=(i+1)%2,r=this.ranges(),o=r[0],s=r[1],a=this.computed_bounds(),l=a[0],h=a[1];x=[Math.min(l,h),Math.max(l,h)],l=x[0],h=x[1];for(var c=this.ticker.get_ticks(l,h,o,s.min,{})[t],u=o.min,_=o.max,p=s.min,d=s.max,f=[[],[]],v=0;v<c.length;v++)if(c[v]!=u&&c[v]!=_||!e){for(var m=[],g=[],y=0;y<2;y++){var b=p+(d-p)/1*y;m.push(c[v]),g.push(b)}f[i].push(m),f[n].push(g)}return f;var x},e}(o.GuideRenderer);i.Grid=h,h.initClass()},function(t,e,i){var n=t(140);i.Grid=n.Grid},function(t,e,i){var n=t(379);n.__exportStar(t(60),i),n.__exportStar(t(76),i),n.__exportStar(t(82),i),n.__exportStar(t(86),i),n.__exportStar(t(88),i),n.__exportStar(t(94),i),n.__exportStar(t(100),i),n.__exportStar(t(119),i),n.__exportStar(t(137),i),n.__exportStar(t(141),i),n.__exportStar(t(145),i),n.__exportStar(t(153),i),n.__exportStar(t(252),i),n.__exportStar(t(156),i),n.__exportStar(t(160),i),n.__exportStar(t(166),i),n.__exportStar(t(172),i),n.__exportStar(t(175),i),n.__exportStar(t(179),i),n.__exportStar(t(188),i),n.__exportStar(t(198),i),n.__exportStar(t(208),i),n.__exportStar(t(240),i)},function(t,e,i){var n=t(379),r=t(13),o=t(15),s=t(21),a=t(32),l=t(146),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-grid\")},e.prototype.get_height=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._height.value});return this.model._horizontal?s.max(e):s.sum(e)},e.prototype.get_width=function(){var t=this.model.get_layoutable_children(),e=t.map(function(t){return t._width.value});return this.model._horizontal?s.sum(e):s.max(e)},e}(l.LayoutDOMView);i.BoxView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Box\",this.prototype.default_view=h,this.define({children:[o.Array,[]]}),this.internal({spacing:[o.Number,6]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._child_equal_size_width=new r.Variable(this.toString()+\".child_equal_size_width\"),this._child_equal_size_height=new r.Variable(this.toString()+\".child_equal_size_height\"),this._box_equal_size_top=new r.Variable(this.toString()+\".box_equal_size_top\"),this._box_equal_size_bottom=new r.Variable(this.toString()+\".box_equal_size_bottom\"),this._box_equal_size_left=new r.Variable(this.toString()+\".box_equal_size_left\"),this._box_equal_size_right=new r.Variable(this.toString()+\".box_equal_size_right\"),this._box_cell_align_top=new r.Variable(this.toString()+\".box_cell_align_top\"),this._box_cell_align_bottom=new r.Variable(this.toString()+\".box_cell_align_bottom\"),this._box_cell_align_left=new r.Variable(this.toString()+\".box_cell_align_left\"),this._box_cell_align_right=new r.Variable(this.toString()+\".box_cell_align_right\")},e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return a.extend({},t.prototype.get_constrained_variables.call(this),{box_equal_size_top:this._box_equal_size_top,box_equal_size_bottom:this._box_equal_size_bottom,box_equal_size_left:this._box_equal_size_left,box_equal_size_right:this._box_equal_size_right,box_cell_align_top:this._box_cell_align_top,box_cell_align_bottom:this._box_cell_align_bottom,box_cell_align_left:this._box_cell_align_left,box_cell_align_right:this._box_cell_align_right})},e.prototype.get_constraints=function(){var e=t.prototype.get_constraints.call(this),i=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.push.apply(e,t)},n=this.get_layoutable_children();if(0==n.length)return e;for(var o=0,s=n;o<s.length;o++){var a=s[o],l=a.get_constrained_variables(),h=this._child_rect(l);this._horizontal?null!=l.height&&i(r.EQ(h.height,[-1,this._height])):null!=l.width&&i(r.EQ(h.width,[-1,this._width])),this._horizontal?null!=l.box_equal_size_left&&null!=l.box_equal_size_right&&null!=l.width&&i(r.EQ([-1,l.box_equal_size_left],[-1,l.box_equal_size_right],l.width,this._child_equal_size_width)):null!=l.box_equal_size_top&&null!=l.box_equal_size_bottom&&null!=l.height&&i(r.EQ([-1,l.box_equal_size_top],[-1,l.box_equal_size_bottom],l.height,this._child_equal_size_height))}var c=this._info(n[0].get_constrained_variables());i(r.EQ(c.span.start,0));for(var u=1;u<n.length;u++){var _=this._info(n[u].get_constrained_variables());c.span.size&&i(r.EQ(c.span.start,c.span.size,[-1,_.span.start])),i(r.WEAK_EQ(c.whitespace.after,_.whitespace.before,0-this.spacing)),i(r.GE(c.whitespace.after,_.whitespace.before,0-this.spacing)),c=_}var p=n[n.length-1].get_constrained_variables();return this._horizontal?null!=p.width&&i(r.EQ(c.span.start,c.span.size,[-1,this._width])):null!=p.height&&i(r.EQ(c.span.start,c.span.size,[-1,this._height])),e=e.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},e.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e;e=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom};var i=this._span(this._child_rect(t));return{span:i,whitespace:e}},e.prototype._flatten_cell_edge_variables=function(t){var i;i=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables;for(var n=t!=this._horizontal,r=this.get_layoutable_children(),o=r.length,s={},a=0,l=0,h=r;l<h.length;l++){var c=h[l],u=void 0;u=c instanceof e?c._flatten_cell_edge_variables(t):{};for(var _=c.get_constrained_variables(),p=0,d=i;p<d.length;p++){var f=d[p];f in _&&(u[f]=[_[f]])}for(var v in u){var m=u[v],g=void 0;if(n){var y=v.split(\" \"),b=y[0],x=y.length>1?y[1]:\"\",w=this._horizontal?\"row\":\"col\";g=b+\" \"+w+\"-\"+o+\"-\"+a+\"-\"+x}else g=v;s[g]=g in s?s[g].concat(m):m}a++}return s},e.prototype._align_inner_cell_edges_constraints=function(){var t=[];if(null!=this.document&&s.includes(this.document.roots(),this)){var e=this._flatten_cell_edge_variables(this._horizontal);for(var i in e){var n=e[i];if(n.length>1)for(var o=n[0],a=1;a<n.length;a++)t.push(r.EQ(n[a],[-1,o]))}}return t},e.prototype._find_edge_leaves=function(t){var i=this.get_layoutable_children(),n=[[],[]];if(i.length>0)if(this._horizontal==t){var r=i[0],o=i[i.length-1];r instanceof e?n[0]=n[0].concat(r._find_edge_leaves(t)[0]):n[0].push(r),o instanceof e?n[1]=n[1].concat(o._find_edge_leaves(t)[1]):n[1].push(o)}else for(var s=0,a=i;s<a.length;s++){var l=a[s];if(l instanceof e){var h=l._find_edge_leaves(t);n[0]=n[0].concat(h[0]),n[1]=n[1].concat(h[1])}else n[0].push(l),n[1].push(l)}return n},e.prototype._align_outer_edges_constraints=function(t){var e,i,n=this._find_edge_leaves(t),o=n[0],s=n[1];t?(e=\"on_edge_align_left\",i=\"on_edge_align_right\"):(e=\"on_edge_align_top\",i=\"on_edge_align_bottom\");var a=function(t,e){for(var i=[],n=0,r=t;n<r.length;n++){var o=r[n],s=o.get_constrained_variables();e in s&&i.push(s[e])}return i},l=a(o,e),h=a(s,i),c=[],u=function(t){if(t.length>1)for(var e=t[0],i=1;i<t.length;i++){var n=t[i];c.push(r.EQ([-1,e],n))}};return u(l),u(h),c},e.prototype._box_insets_from_child_insets=function(t,e,i,n){var o,s,a,l,h=this._find_edge_leaves(t),c=h[0],u=h[1];t?(o=e+\"_left\",s=e+\"_right\",a=this[i+\"_left\"],l=this[i+\"_right\"]):(o=e+\"_top\",s=e+\"_bottom\",a=this[i+\"_top\"],l=this[i+\"_bottom\"]);var _=[],p=function(t,e,i){for(var o=0,s=e;o<s.length;o++){var a=s[o],l=a.get_constrained_variables();i in l&&(n?_.push(r.GE([-1,t],l[i])):_.push(r.EQ([-1,t],l[i])))}};return p(a,c,o),p(l,u,s),_},e.prototype._box_equal_size_bounds=function(t){return this._box_insets_from_child_insets(t,\"box_equal_size\",\"_box_equal_size\",!1)},e.prototype._box_cell_align_bounds=function(t){return this._box_insets_from_child_insets(t,\"box_cell_align\",\"_box_cell_align\",!1)},e.prototype._box_whitespace=function(t){return this._box_insets_from_child_insets(t,\"whitespace\",\"_whitespace\",!0)},e._left_right_inner_cell_edge_variables=[\"box_cell_align_left\",\"box_cell_align_right\"],e._top_bottom_inner_cell_edge_variables=[\"box_cell_align_top\",\"box_cell_align_bottom\"],e}(l.LayoutDOM);i.Box=c,c.initClass()},function(t,e,i){var n=t(379),r=t(143),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-grid-column\")},e}(r.BoxView);i.ColumnView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i._horizontal=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Column\",this.prototype.default_view=o},e}(r.Box);i.Column=s,s.initClass()},function(t,e,i){var n=t(143);i.Box=n.Box;var r=t(144);i.Column=r.Column;var o=t(146);i.LayoutDOM=o.LayoutDOM;var s=t(147);i.Row=s.Row;var a=t(148);i.Spacer=a.Spacer;var l=t(149);i.WidgetBox=l.WidgetBox},function(t,e,i){var n=t(379),r=t(53),o=t(5),s=t(15),a=t(11),l=t(13),h=t(4),c=t(6),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._solver_inited=!1,e._idle_notified=!1,e}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.is_root&&(this._solver=new l.Solver),this.child_views={},this.build_child_views()},e.prototype.remove=function(){for(var e in this.child_views){var i=this.child_views[e];i.remove()}this.child_views={},t.prototype.remove.call(this)},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;for(var e in this.child_views){var i=this.child_views[e];if(!i.has_finished())return!1}return!0},e.prototype.notify_finished=function(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):t.prototype.notify_finished.call(this)},e.prototype._calc_width_height=function(){for(var t=this.el;t=t.parentElement;)if(!t.classList.contains(\"bk-root\")){if(t==document.body){var e=o.margin(document.body),i=e.left,n=e.right,r=e.top,s=e.bottom,a=document.documentElement.clientWidth-i-n,l=document.documentElement.clientHeight-r-s;return[a,l]}var h=o.padding(t),c=h.left,u=h.right,_=h.top,p=h.bottom,d=t.getBoundingClientRect(),f=d.width-c-u,v=d.height-_-p;if(0!=f&&0!=v)return[f,v]}return[null,null]},e.prototype._init_solver=function(){this._root_width=new l.Variable(this.toString()+\".root_width\"),this._root_height=new l.Variable(this.toString()+\".root_height\"),this._solver.add_edit_variable(this._root_width,NaN),this._solver.add_edit_variable(this._root_height,NaN);for(var t=this.model.get_all_editables(),e=0,i=t;e<i.length;e++){var n=i[e];this._solver.add_edit_variable(n,l.Strength.strong)}for(var r=this.model.get_all_constraints(),o=0,s=r;o<s.length;o++){var a=s[o];this._solver.add_constraint(a)}var h=this.model.get_constrained_variables();null!=h.width&&this._solver.add_constraint(l.EQ(h.width,this._root_width)),null!=h.height&&this._solver.add_constraint(l.EQ(h.height,this._root_height)),this._solver.update_variables(),this._solver_inited=!0},e.prototype._suggest_dims=function(t,e){var i=this.model.get_constrained_variables();null==i.width&&null==i.height||(null!=t&&null!=e||(n=this._calc_width_height(),t=n[0],e=n[1]),null!=i.width&&null!=t&&this._solver.suggest_value(this._root_width,t),null!=i.height&&null!=e&&this._solver.suggest_value(this._root_height,e),this._solver.update_variables());var n},e.prototype.resize=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.is_root?this._do_layout(!1,t,e):this.root.resize(t,e)},e.prototype.partial_layout=function(){this.is_root?this._do_layout(!1):this.root.partial_layout()},e.prototype.layout=function(){this.is_root?this._do_layout(!0):this.root.layout()},e.prototype._do_layout=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this._solver_inited&&!t||(this._solver.clear(),this._init_solver()),this._suggest_dims(e,i),this._layout(),this._layout(),this._layout(!0),this.notify_finished()},e.prototype._layout=function(t){void 0===t&&(t=!1);for(var e=0,i=this.model.get_layoutable_children();e<i.length;e++){var n=i[e],r=this.child_views[n.id];null!=r._layout&&r._layout(t)}this.render(),t&&(this._has_finished=!0)},e.prototype.rebuild_child_views=function(){this.solver.clear(),this.build_child_views(),this.layout()},e.prototype.build_child_views=function(){var t=this.model.get_layoutable_children();h.build_views(this.child_views,t,{parent:this}),o.empty(this.el);for(var e=0,i=t;e<i.length;e++){var n=i[e],r=this.child_views[n.id];this.el.appendChild(r.el)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.is_root&&window.addEventListener(\"resize\",function(){return e.resize()}),this.connect(this.model.properties.sizing_mode.change,function(){return e.layout()})},e.prototype._render_classes=function(){this.el.className=\"\";for(var t=0,e=this.css_classes();t<e.length;t++){var i=e[t];this.el.classList.add(i)}this.el.classList.add(\"bk-layout-\"+this.model.sizing_mode);for(var n=0,r=this.model.css_classes;n<r.length;n++){var o=r[n];this.el.classList.add(o)}},e.prototype.render=function(){switch(this._render_classes(),this.model.sizing_mode){case\"fixed\":var t=void 0;t=null!=this.model.width?this.model.width:this.get_width(),this.model.setv({width:t},{silent:!0});var e=void 0;e=null!=this.model.height?this.model.height:this.get_height(),this.model.setv({height:e},{silent:!0}),this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e);break;case\"scale_width\":var e=this.get_height();this.solver.suggest_value(this.model._height,e);break;case\"scale_height\":var t=this.get_width();this.solver.suggest_value(this.model._width,t);break;case\"scale_both\":var i=this.get_width_height(),t=i[0],e=i[1];this.solver.suggest_value(this.model._width,t),this.solver.suggest_value(this.model._height,e)}this.solver.update_variables(),this.position()},e.prototype.position=function(){switch(this.model.sizing_mode){case\"fixed\":case\"scale_width\":case\"scale_height\":this.el.style.position=\"relative\",this.el.style.left=\"\",this.el.style.top=\"\";break;case\"scale_both\":case\"stretch_both\":this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\"}this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\"},e.prototype.get_width_height=function(){var t=this.el.parentElement;if(null==t)throw new Error(\"detached element\");var e,i,n=t.clientHeight,r=t.clientWidth,o=this.model.get_aspect_ratio(),s=r,a=r/o,l=n*o,h=n;return s<l?(e=s,i=a):(e=l,i=h),[e,i]},e}(c.DOMView);i.LayoutDOMView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LayoutDOM\",this.define({height:[s.Number],width:[s.Number],disabled:[s.Bool,!1],sizing_mode:[s.SizingMode,\"fixed\"],css_classes:[s.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._width=new l.Variable(this.toString()+\".width\"),this._height=new l.Variable(this.toString()+\".height\"),this._left=new l.Variable(this.toString()+\".left\"),this._right=new l.Variable(this.toString()+\".right\"),this._top=new l.Variable(this.toString()+\".top\"),this._bottom=new l.Variable(this.toString()+\".bottom\"),this._dom_top=new l.Variable(this.toString()+\".dom_top\"),this._dom_left=new l.Variable(this.toString()+\".dom_left\"),this._width_minus_right=new l.Variable(this.toString()+\".width_minus_right\"),this._height_minus_bottom=new l.Variable(this.toString()+\".height_minus_bottom\"),this._whitespace_top=new l.Variable(this.toString()+\".whitespace_top\"),this._whitespace_bottom=new l.Variable(this.toString()+\".whitespace_bottom\"),this._whitespace_left=new l.Variable(this.toString()+\".whitespace_left\"),this._whitespace_right=new l.Variable(this.toString()+\".whitespace_right\")},Object.defineProperty(e.prototype,\"layout_bbox\",{get:function(){return{top:this._top.value,left:this._left.value,width:this._width.value,height:this._height.value,right:this._right.value,bottom:this._bottom.value,dom_top:this._dom_top.value,dom_left:this._dom_left.value}},enumerable:!0,configurable:!0}),e.prototype.dump_layout=function(){for(var t,e={},i=[this];t=i.shift();)i.push.apply(i,t.get_layoutable_children()),e[t.toString()]=t.layout_bbox;console.table(e)},e.prototype.get_all_constraints=function(){for(var t=this.get_constraints(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof a.LayoutCanvas?t.concat(n.get_constraints()):t.concat(n.get_all_constraints())}return t},e.prototype.get_all_editables=function(){for(var t=this.get_editables(),e=0,i=this.get_layoutable_children();e<i.length;e++){var n=i[e];t=n instanceof a.LayoutCanvas?t.concat(n.get_editables()):t.concat(n.get_all_editables())}return t},e.prototype.get_constraints=function(){return[l.GE(this._dom_left),l.GE(this._dom_top),l.GE(this._left),l.GE(this._width,[-1,this._right]),l.GE(this._top),l.GE(this._height,[-1,this._bottom]),l.EQ(this._width_minus_right,[-1,this._width],this._right),l.EQ(this._height_minus_bottom,[-1,this._height],this._bottom)]},e.prototype.get_layoutable_children=function(){return[]},e.prototype.get_editables=function(){switch(this.sizing_mode){case\"fixed\":return[this._height,this._width];case\"scale_width\":return[this._height];case\"scale_height\":return[this._width];case\"scale_both\":return[this._width,this._height];default:return[]}},e.prototype.get_constrained_variables=function(){var t={origin_x:this._dom_left,origin_y:this._dom_top,whitespace_top:this._whitespace_top,whitespace_bottom:this._whitespace_bottom,whitespace_left:this._whitespace_left,whitespace_right:this._whitespace_right};switch(this.sizing_mode){case\"stretch_both\":t.width=this._width,t.height=this._height;break;case\"scale_width\":t.width=this._width;break;case\"scale_height\":t.height=this._height}return t},e.prototype.get_aspect_ratio=function(){return this.width/this.height},e}(r.Model);i.LayoutDOM=_,_.initClass()},function(t,e,i){var n=t(379),r=t(143),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-grid-row\")},e}(r.BoxView);i.RowView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i._horizontal=!0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Row\",this.prototype.default_view=o},e}(r.Box);i.Row=s,s.initClass()},function(t,e,i){var n=t(379),r=t(146),o=t(32),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),\"fixed\"==this.model.sizing_mode&&(this.el.style.width=this.model.width+\"px\",this.el.style.height=this.model.height+\"px\")},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-spacer-box\")},e.prototype.get_width=function(){return 1},e.prototype.get_height=function(){return 1},e}(r.LayoutDOMView);i.SpacerView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Spacer\",this.prototype.default_view=s},e.prototype.get_constrained_variables=function(){return o.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom,box_equal_size_left:this._left,box_equal_size_right:this._width_minus_right})},e}(r.LayoutDOM);i.Spacer=a,a.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(15),s=t(32),a=t(146),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget-box\")},e.prototype.render=function(){if(this._render_classes(),\"fixed\"==this.model.sizing_mode||\"scale_height\"==this.model.sizing_mode){var t=this.get_width();this.model._width.value!=t&&this.solver.suggest_value(this.model._width,t)}if(\"fixed\"==this.model.sizing_mode||\"scale_width\"==this.model.sizing_mode){var e=this.get_height();this.model._height.value!=e&&this.solver.suggest_value(this.model._height,e)}if(this.solver.update_variables(),\"stretch_both\"==this.model.sizing_mode)this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\",this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\";else{var i=void 0;i=this.model._width.value-20>0?this.model._width.value-20+\"px\":\"100%\",this.el.style.width=i}},e.prototype.get_height=function(){var t=0;for(var e in this.child_views){var i=this.child_views[e],n=i.el,r=getComputedStyle(n),o=parseInt(r.marginTop)||0,s=parseInt(r.marginBottom)||0;t+=n.offsetHeight+o+s}return t+20},e.prototype.get_width=function(){if(null!=this.model.width)return this.model.width;var t=this.el.scrollWidth+20;for(var e in this.child_views){var i=this.child_views[e],n=i.el.scrollWidth;n>t&&(t=n)}return t},e}(a.LayoutDOMView);i.WidgetBoxView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"WidgetBox\",this.prototype.default_view=l,this.define({children:[o.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),\"fixed\"==this.sizing_mode&&null==this.width&&(this.width=300,r.logger.info(\"WidgetBox mode is fixed, but no width specified. Using default of 300.\"))},e.prototype.get_constrained_variables=function(){var e=s.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom});return\"fixed\"!=this.sizing_mode&&(e.box_equal_size_left=this._left,e.box_equal_size_right=this._width_minus_right),e},e.prototype.get_layoutable_children=function(){return this.children},e}(a.LayoutDOM);i.WidgetBox=h,h.initClass()},function(t,e,i){var n=t(379),r=t(151),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CategoricalColorMapper\",this.define({factors:[o.Array],start:[o.Number,0],end:[o.Number]})},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,o=function(n,o){var h=t[n],c=void 0;a.isString(h)?c=l.factors.indexOf(h):(null!=l.start?h=null!=l.end?h.slice(l.start,l.end):h.slice(l.start):null!=l.end&&(h=h.slice(0,l.end)),c=1==h.length?l.factors.indexOf(h[0]):s.findIndex(l.factors,function(t){return function(t,e){if(t.length!=e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}(t,h)}));var u=void 0;u=c<0||c>=i.length?r:i[c],e[n]=u},l=this,h=0,c=t.length;h<c;h++)o(h,c)},e}(r.ColorMapper);i.CategoricalColorMapper=l,l.initClass()},function(t,e,i){function n(t){return\"#\"!=t[0]&&(t=h.color2hex(t)),9!=t.length&&(t+=\"ff\"),parseInt(t.slice(1),16)}function r(t){for(var e=new Uint32Array(t.length),i=0,r=t.length;i<r;i++)e[i]=n(t[i]);return e}function o(t){if(c.is_little_endian)for(var e=new DataView(t.buffer),i=0,n=t.length;i<n;i++)e.setUint32(4*i,t[i]);return new Uint8Array(t.buffer)}var s=t(379),a=t(257),l=t(15),h=t(27),c=t(28);i._convert_color=n,i._convert_palette=r,i._uint32_to_rgba=o;var u=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type=\"ColorMapper\",this.define({palette:[l.Any],nan_color:[l.Color,\"gray\"]})},e.prototype.compute=function(t){throw new Error(\"not supported\")},e.prototype.v_compute=function(t){var e=new Array(t.length);return this._v_compute(t,e,this.palette,this._colors(function(t){return t})),e},Object.defineProperty(e.prototype,\"rgba_mapper\",{get:function(){var t=this,e=r(this.palette),i=this._colors(n);return{v_compute:function(n){var r=new Uint32Array(n.length);return t._v_compute(n,r,e,i),o(r)}}},enumerable:!0,configurable:!0}),e.prototype._colors=function(t){return{nan_color:t(this.nan_color)}},e}(a.Transform);i.ColorMapper=u,u.initClass()},function(t,e,i){var n=t(379),r=t(151),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ContinuousColorMapper\",this.define({high:[o.Number],low:[o.Number],high_color:[o.Color],low_color:[o.Color]})},e.prototype._colors=function(e){return n.__assign({},t.prototype._colors.call(this,e),{low_color:null!=this.low_color?e(this.low_color):void 0,high_color:null!=this.high_color?e(this.high_color):void 0})},e}(r.ColorMapper);i.ContinuousColorMapper=s,s.initClass()},function(t,e,i){var n=t(150);i.CategoricalColorMapper=n.CategoricalColorMapper;var r=t(152);i.ContinuousColorMapper=r.ContinuousColorMapper;var o=t(151);i.ColorMapper=o.ColorMapper;var s=t(154);i.LinearColorMapper=s.LinearColorMapper;var a=t(155);i.LogColorMapper=a.LogColorMapper},function(t,e,i){var n=t(379),r=t(152),o=t(22),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LinearColorMapper\"},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,s=n.low_color,a=n.high_color,l=null!=this.low?this.low:o.min(t),h=null!=this.high?this.high:o.max(t),c=i.length-1,u=1/(h-l),_=1/i.length,p=0,d=t.length;p<d;p++){var f=t[p];if(isNaN(f))e[p]=r;else if(f!=h){var v=(f-l)*u,m=Math.floor(v/_);e[p]=m<0?null!=s?s:i[0]:m>c?null!=a?a:i[c]:i[m]}else e[p]=i[c]}},e}(r.ContinuousColorMapper);i.LinearColorMapper=s,s.initClass()},function(t,e,i){var n=t(379),r=t(152),o=t(22),s=null!=Math.log1p?Math.log1p:function(t){return Math.log(1+t)},a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LogColorMapper\"},e.prototype._v_compute=function(t,e,i,n){for(var r=n.nan_color,a=n.low_color,l=n.high_color,h=i.length,c=null!=this.low?this.low:o.min(t),u=null!=this.high?this.high:o.max(t),_=h/(s(u)-s(c)),p=i.length-1,d=0,f=t.length;d<f;d++){var v=t[d];if(isNaN(v))e[d]=r;else if(v>u)e[d]=null!=l?l:i[p];else if(v!=u)if(v<c)e[d]=null!=a?a:i[0];else{var m=s(v)-s(c),g=Math.floor(m*_);g>p&&(g=p),e[d]=i[g]}else e[d]=i[p]}},e}(r.ContinuousColorMapper);i.LogColorMapper=a,a.initClass()},function(t,e,i){function n(t,e){t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)}function r(t,e){t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)}function o(t,e){t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()}function s(t,e){var i=e*c,n=i/3;t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-i),t.closePath()}function a(t,e){var i=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return l.__extends(i,t),i.initClass=function(){this.prototype._render_one=e},i}(h.MarkerView);i.initClass();var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l.__extends(n,e),n.initClass=function(){this.prototype.default_view=i,this.prototype.type=t},n}(h.Marker);return n.initClass(),n}var l=t(379),h=t(157),c=Math.sqrt(3);i.Asterisk=a(\"Asterisk\",function(t,e,i,o,s){var a=.65*i;r(t,i),n(t,a),o.doit&&(o.set_vectorize(t,e),t.stroke())}),i.CircleCross=a(\"CircleCross\",function(t,e,i,n,o){t.arc(0,0,i,0,2*Math.PI,!1),o.doit&&(o.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.CircleX=a(\"CircleX\",function(t,e,i,r,o){t.arc(0,0,i,0,2*Math.PI,!1),o.doit&&(o.set_vectorize(t,e),t.fill());r.doit&&(r.set_vectorize(t,e),n(t,i),t.stroke())}),i.Cross=a(\"Cross\",function(t,e,i,n,o){r(t,i),n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Diamond=a(\"Diamond\",function(t,e,i,n,r){o(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.DiamondCross=a(\"DiamondCross\",function(t,e,i,n,s){o(t,i),s.doit&&(s.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.Hex=a(\"Hex\",function(t,e,i,n,r){(function(t,e){var i=e/2,n=c*i;t.moveTo(e,0),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-e,0),t.lineTo(-i,n),t.lineTo(i,n),t.closePath()})(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.InvertedTriangle=a(\"InvertedTriangle\",function(t,e,i,n,r){t.rotate(Math.PI),s(t,i),t.rotate(-Math.PI),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.Square=a(\"Square\",function(t,e,i,n,r){var o=2*i;t.rect(-i,-i,o,o),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.SquareCross=a(\"SquareCross\",function(t,e,i,n,o){var s=2*i;t.rect(-i,-i,s,s),o.doit&&(o.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),r(t,i),t.stroke())}),i.SquareX=a(\"SquareX\",function(t,e,i,r,o){var s=2*i;t.rect(-i,-i,s,s),o.doit&&(o.set_vectorize(t,e),t.fill());r.doit&&(r.set_vectorize(t,e),n(t,i),t.stroke())}),i.Triangle=a(\"Triangle\",function(t,e,i,n,r){s(t,i),r.doit&&(r.set_vectorize(t,e),t.fill());n.doit&&(n.set_vectorize(t,e),t.stroke())}),i.X=a(\"X\",function(t,e,i,r,o){n(t,i),r.doit&&(r.set_vectorize(t,e),t.stroke())})},function(t,e,i){var n=t(379),r=t(135),o=t(9),s=t(15),a=t(21),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._render=function(t,e,i){for(var n=i.sx,r=i.sy,o=i._size,s=i._angle,a=0,l=e;a<l.length;a++){var h=l[a];if(!isNaN(n[h]+r[h]+o[h]+s[h])){var c=o[h]/2;t.beginPath(),t.translate(n[h],r[h]),s[h]&&t.rotate(s[h]),this._render_one(t,h,c,this.visuals.line,this.visuals.fill),s[h]&&t.rotate(-s[h]),t.translate(-n[h],-r[h])}}},e.prototype._mask_data=function(){var t=this.renderer.plot_view.frame.bbox.h_range,e=t.start-this.max_size,i=t.end+this.max_size,n=this.renderer.xscale.r_invert(e,i),r=n[0],s=n[1],a=this.renderer.plot_view.frame.bbox.v_range,l=a.start-this.max_size,h=a.end+this.max_size,c=this.renderer.yscale.r_invert(l,h),u=c[0],_=c[1],p=o.validate_bbox_coords([r,s],[u,_]);return this.index.indices(p)},e.prototype._hit_point=function(t){for(var e=t.sx,i=t.sy,n=e-this.max_size,r=e+this.max_size,s=this.renderer.xscale.r_invert(n,r),a=s[0],l=s[1],h=i-this.max_size,c=i+this.max_size,u=this.renderer.yscale.r_invert(h,c),_=u[0],p=u[1],d=o.validate_bbox_coords([a,l],[_,p]),f=this.index.indices(d),v=[],m=0,g=f;m<g.length;m++){var y=g[m],b=this._size[y]/2,x=Math.abs(this.sx[y]-e)+Math.abs(this.sy[y]-i);Math.abs(this.sx[y]-e)<=b&&Math.abs(this.sy[y]-i)<=b&&v.push([y,x])}return o.create_hit_test_result_from_hits(v)},e.prototype._hit_span=function(t){var e,i,n,r,s=t.sx,a=t.sy,l=this.bounds(),h=l.minX,c=l.minY,u=l.maxX,_=l.maxY,p=o.create_empty_hit_test_result();if(\"h\"==t.direction){n=c,r=_;var d=this.max_size/2,f=s-d,v=s+d;x=this.renderer.xscale.r_invert(f,v),e=x[0],i=x[1]}else{e=h,i=u;var d=this.max_size/2,m=a-d,g=a+d;w=this.renderer.yscale.r_invert(m,g),n=w[0],r=w[1]}var y=o.validate_bbox_coords([e,i],[n,r]),b=this.index.indices(y);return p.indices=b,p;var x,w},e.prototype._hit_rect=function(t){var e=t.sx0,i=t.sx1,n=t.sy0,r=t.sy1,s=this.renderer.xscale.r_invert(e,i),a=s[0],l=s[1],h=this.renderer.yscale.r_invert(n,r),c=h[0],u=h[1],_=o.validate_bbox_coords([a,l],[c,u]),p=o.create_empty_hit_test_result();return p.indices=this.index.indices(_),p},e.prototype._hit_poly=function(t){for(var e=t.sx,i=t.sy,n=a.range(0,this.sx.length),r=[],s=0,l=n.length;s<l;s++){var h=n[s];o.point_in_poly(this.sx[s],this.sy[s],e,i)&&r.push(h)}var c=o.create_empty_hit_test_result();return c.indices=r,c},e.prototype.draw_legend_for_index=function(t,e,i){var n=e.x0,r=e.x1,o=e.y0,s=e.y1,a=i+1,l=new Array(a);l[i]=(n+r)/2;var h=new Array(a);h[i]=(o+s)/2;var c=new Array(a);c[i]=.4*Math.min(Math.abs(r-n),Math.abs(s-o));var u=new Array(a);u[i]=this._angle[i],this._render(t,[i],{sx:l,sy:h,_size:c,_angle:u})},e}(r.XYGlyphView);i.MarkerView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.mixins([\"line\",\"fill\"]),this.define({size:[s.DistanceSpec,{units:\"screen\",value:4}],angle:[s.AngleSpec,0]})},e}(r.XYGlyph);i.Marker=h,h.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(159),s=t(161),a=t(15),l=t(53),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MapOptions\",this.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]})},e}(l.Model);i.MapOptions=h,h.initClass();var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GMapOptions\",this.define({map_type:[a.String,\"roadmap\"],scale_control:[a.Bool,!1],styles:[a.String]})},e}(h);i.GMapOptions=c,c.initClass();var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(s.PlotView);i.GMapPlotView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GMapPlot\",this.prototype.default_view=u,this.define({map_options:[a.Instance],api_key:[a.String]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.api_key||r.logger.error(\"api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.\")},e.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},e}(s.Plot);i.GMapPlot=_,_.initClass()},function(t,e,i){var n=t(379),r=t(19),o=t(33),s=t(162),a=new r.Signal0({},\"gmaps_ready\"),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0;var n=this.model.plot.map_options,r=n.zoom,o=n.lat,s=n.lng;this.initial_zoom=r,this.initial_lat=o,this.initial_lng=s,this.canvas_view.map_el.style.position=\"absolute\",\"undefined\"!=typeof google&&null!=google.maps||(\"undefined\"==typeof _bokeh_gmaps_callback&&function(t){_bokeh_gmaps_callback=function(){return a.emit()};var e=document.createElement(\"script\");e.type=\"text/javascript\",e.src=\"https://maps.googleapis.com/maps/api/js?key=\"+t+\"&callback=_bokeh_gmaps_callback\",document.body.appendChild(e)}(this.model.plot.api_key),a.connect(function(){return i.request_render()})),this.unpause()},e.prototype.update_range=function(e){if(null==e)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),t.prototype.update_range.call(this,null);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(e.sdx||0,e.sdy||0),t.prototype.update_range.call(this,e);else if(null!=e.factor){var i=void 0;if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),i=e.factor<0?-1:1;var n=this.map.getZoom(),r=n+i;if(r>=2){this.map.setZoom(r);var o=this._get_projected_bounds(),s=o[0],a=o[1];a-s<0&&this.map.setZoom(n)}this.unpause()}this._set_bokeh_ranges()},e.prototype._build_map=function(){var t=this,e=google.maps;this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID};var i=this.model.plot.map_options,n={center:new e.LatLng(i.lat,i.lng),zoom:i.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[i.map_type],scaleControl:i.scale_control};null!=i.styles&&(n.styles=JSON.parse(i.styles)),this.map=new e.Map(this.canvas_view.map_el,n),e.event.addListener(this.map,\"idle\",function(){return t._set_bokeh_ranges()}),e.event.addListener(this.map,\"bounds_changed\",function(){return t._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,\"tilesloaded\",function(){return t._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return t._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return t._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return t._update_center(\"lat\")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return t._update_center(\"lng\")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return t._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return t._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return t._update_scale_control()})},e.prototype._render_finished=function(){this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&!0===this._tiles_loaded},e.prototype._get_latlon_bounds=function(){var t=this.map.getBounds(),e=t.getNorthEast(),i=t.getSouthWest(),n=i.lng(),r=e.lng(),o=i.lat(),s=e.lat();return[n,r,o,s]},e.prototype._get_projected_bounds=function(){var t=this._get_latlon_bounds(),e=t[0],i=t[1],n=t[2],r=t[3],s=o.wgs84_mercator.forward([e,n]),a=s[0],l=s[1],h=o.wgs84_mercator.forward([i,r]),c=h[0],u=h[1];return[a,c,l,u]},e.prototype._set_bokeh_ranges=function(){var t=this._get_projected_bounds(),e=t[0],i=t[1],n=t[2],r=t[3];this.frame.x_range.setv({start:e,end:i}),this.frame.y_range.setv({start:n,end:r})},e.prototype._update_center=function(t){var e=this.map.getCenter().toJSON();e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},e.prototype._update_map_type=function(){this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){this._update_styles(),this._update_center(\"lat\"),this._update_center(\"lng\"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3];this.canvas_view.map_el.style.top=n+\"px\",this.canvas_view.map_el.style.left=i+\"px\",this.canvas_view.map_el.style.width=r+\"px\",this.canvas_view.map_el.style.height=o+\"px\",null==this.map&&\"undefined\"!=typeof google&&null!=google.maps&&this._build_map()},e.prototype._paint_empty=function(t,e){var i=this.canvas._width.value,n=this.canvas._height.value,r=e[0],o=e[1],s=e[2],a=e[3];t.clearRect(0,0,i,n),t.beginPath(),t.moveTo(0,0),t.lineTo(0,n),t.lineTo(i,n),t.lineTo(i,0),t.lineTo(0,0),t.moveTo(r,o),t.lineTo(r+s,o),t.lineTo(r+s,o+a),t.lineTo(r,o+a),t.lineTo(r,o),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(s.PlotCanvasView);i.GMapPlotCanvasView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GMapPlotCanvas\",this.prototype.default_view=l},e.prototype.initialize=function(){this.use_map=!0,t.prototype.initialize.call(this)},e}(s.PlotCanvas);i.GMapPlotCanvas=h,h.initClass()},function(t,e,i){var n=t(158);i.MapOptions=n.MapOptions;var r=t(158);i.GMapOptions=r.GMapOptions;var o=t(158);i.GMapPlot=o.GMapPlot;var s=t(159);i.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(161);i.Plot=a.Plot;var l=t(162);i.PlotCanvas=l.PlotCanvas},function(t,e,i){var n=t(379),r=t(13),o=t(14),s=t(15),a=t(21),l=t(32),h=t(44),c=t(146),u=t(68),_=t(176),p=t(247),d=t(69),f=t(162),v=t(184),m=t(169),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){t.prototype.connect_signals.call(this);this.connect(this.model.properties.title.change,function(){return o.logger.warn(\"Title object cannot be replaced. Try changing properties on title to update it after initialization.\")})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-plot-layout\")},e.prototype.get_height=function(){return this.model._width.value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height.value*this.model.get_aspect_ratio()},e.prototype.save=function(t){this.plot_canvas_view.save(t)},Object.defineProperty(e.prototype,\"plot_canvas_view\",{get:function(){return this.child_views[this.model.plot_canvas.id]},enumerable:!0,configurable:!0}),e}(c.LayoutDOMView);i.PlotView=y;var b=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Plot\",this.prototype.default_view=y,this.mixins([\"line:outline_\",\"fill:background_\",\"fill:border_\"]),this.define({toolbar:[s.Instance,function(){return new p.Toolbar}],toolbar_location:[s.Location,\"right\"],toolbar_sticky:[s.Boolean,!0],plot_width:[s.Number,600],plot_height:[s.Number,600],title:[s.Any,function(){return new u.Title({text:\"\"})}],title_location:[s.Location,\"above\"],h_symmetry:[s.Bool,!0],v_symmetry:[s.Bool,!1],above:[s.Array,[]],below:[s.Array,[]],left:[s.Array,[]],right:[s.Array,[]],renderers:[s.Array,[]],x_range:[s.Instance],extra_x_ranges:[s.Any,{}],y_range:[s.Instance],extra_y_ranges:[s.Any,{}],x_scale:[s.Instance,function(){return new _.LinearScale}],y_scale:[s.Instance,function(){return new _.LinearScale}],lod_factor:[s.Number,10],lod_interval:[s.Number,300],lod_threshold:[s.Number,2e3],lod_timeout:[s.Number,500],hidpi:[s.Bool,!0],output_backend:[s.OutputBackend,\"canvas\"],min_border:[s.Number,5],min_border_top:[s.Number,null],min_border_left:[s.Number,null],min_border_bottom:[s.Number,null],min_border_right:[s.Number,null],inner_width:[s.Number],inner_height:[s.Number],layout_width:[s.Number],layout_height:[s.Number],match_aspect:[s.Bool,!1],aspect_scale:[s.Number,1]}),this.override({outline_line_color:\"#e5e5e5\",border_fill_color:\"#ffffff\",background_fill_color:\"#ffffff\"}),g.register_with_event(g.UIEvent,this)},e.prototype.initialize=function(){t.prototype.initialize.call(this);for(var e=0,i=l.values(this.extra_x_ranges).concat(this.x_range);e<i.length;e++){var n=i[e],r=n.plots;h.isArray(r)&&(r=r.concat(this),n.setv({plots:r},{silent:!0}))}for(var o=0,s=l.values(this.extra_y_ranges).concat(this.y_range);o<s.length;o++){var a=s[o],r=a.plots;h.isArray(r)&&(r=r.concat(this),a.setv({plots:r},{silent:!0}))}null!=this.min_border&&(null==this.min_border_top&&(this.min_border_top=this.min_border),null==this.min_border_bottom&&(this.min_border_bottom=this.min_border),null==this.min_border_left&&(this.min_border_left=this.min_border),null==this.min_border_right&&(this.min_border_right=this.min_border));for(var c=0,u=[\"above\",\"below\",\"left\",\"right\"];c<u.length;c++)for(var _=u[c],p=this.getv(_),d=0,f=p;d<f.length;d++){var v=f[d];v.add_panel(_)}this._init_title_panel(),this._init_toolbar_panel(),this._plot_canvas=this._init_plot_canvas(),this.plot_canvas.toolbar=this.toolbar,null==this.width&&(this.width=this.plot_width),null==this.height&&(this.height=this.plot_height)},e.prototype._init_plot_canvas=function(){return new f.PlotCanvas({plot:this})},e.prototype._init_title_panel=function(){if(null!=this.title){var t=h.isString(this.title)?new u.Title({text:this.title}):this.title;this.add_layout(t,this.title_location)}},e.prototype._init_toolbar_panel=function(){var t=this,e=a.find(this.renderers,function(e){return e instanceof d.ToolbarPanel&&a.includes(e.tags,t.id)});switch(null!=e&&this.remove_layout(e),this.toolbar_location){case\"left\":case\"right\":case\"above\":case\"below\":if(e=new d.ToolbarPanel({toolbar:this.toolbar,tags:[this.id]}),this.toolbar.toolbar_location=this.toolbar_location,this.toolbar_sticky){var i=this.getv(this.toolbar_location),n=a.find(i,function(t){return t instanceof u.Title});if(null!=n)return e.set_panel(n.panel),void this.add_renderers(e)}this.add_layout(e,this.toolbar_location)}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.toolbar_location.change,function(){return e._init_toolbar_panel()})},Object.defineProperty(e.prototype,\"plot_canvas\",{get:function(){return this._plot_canvas},enumerable:!0,configurable:!0}),e.prototype._doc_attached=function(){this.plot_canvas.attach_document(this.document),t.prototype._doc_attached.call(this)},e.prototype.add_renderers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this.renderers;i=i.concat(t),this.renderers=i},e.prototype.add_layout=function(t,e){if(void 0===e&&(e=\"center\"),null!=t.props.plot&&(t.plot=this),\"center\"!=e){var i=this.getv(e);i.push(t),t.add_panel(e)}this.add_renderers(t)},e.prototype.remove_layout=function(t){var e=function(e){a.removeBy(e,function(e){return e==t})};e(this.left),e(this.right),e(this.above),e(this.below),e(this.renderers)},e.prototype.add_glyph=function(t,e,i){void 0===e&&(e=new v.ColumnDataSource),void 0===i&&(i={});var n=l.extend({},i,{data_source:e,glyph:t}),r=new m.GlyphRenderer(n);return this.add_renderers(r),r},e.prototype.add_tools=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t;i<n.length;i++){var r=n[i];null!=r.overlay&&this.add_renderers(r.overlay)}this.toolbar.tools=this.toolbar.tools.concat(t)},e.prototype.get_layoutable_children=function(){return[this.plot_canvas]},e.prototype.get_constraints=function(){var e=t.prototype.get_constraints.call(this);return e.push(r.EQ(this._width,[-1,this.plot_canvas._width])),e.push(r.EQ(this._height,[-1,this.plot_canvas._height])),e},e.prototype.get_constrained_variables=function(){var e=l.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this.plot_canvas._top,on_edge_align_bottom:this.plot_canvas._height_minus_bottom,on_edge_align_left:this.plot_canvas._left,on_edge_align_right:this.plot_canvas._width_minus_right,box_cell_align_top:this.plot_canvas._top,box_cell_align_bottom:this.plot_canvas._height_minus_bottom,box_cell_align_left:this.plot_canvas._left,box_cell_align_right:this.plot_canvas._width_minus_right,box_equal_size_top:this.plot_canvas._top,box_equal_size_bottom:this.plot_canvas._height_minus_bottom});return\"fixed\"!=this.sizing_mode&&(e.box_equal_size_left=this.plot_canvas._left,e.box_equal_size_right=this.plot_canvas._width_minus_right),e},Object.defineProperty(e.prototype,\"all_renderers\",{get:function(){for(var t=this.renderers,e=0,i=this.toolbar.tools;e<i.length;e++){var n=i[e];t=t.concat(n.synthetic_renderers)}return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"webgl\",{get:function(){return o.logger.warn(\"webgl attr is deprecated, use output_backend\"),\"webgl\"==this.output_backend},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"tool_events\",{get:function(){return o.logger.warn(\"tool_events attr is deprecated, use SelectionGeometry Event\"),null},enumerable:!0,configurable:!0}),e}(c.LayoutDOM);i.Plot=b,b.initClass()},function(t,e,i){var n=t(379),r=t(84),o=t(85),s=t(164),a=t(169),l=t(146),h=t(19),c=t(4),u=t(20),_=t(49),p=t(6),d=t(11),f=t(10),v=t(13),m=t(14),g=t(7),y=t(15),b=t(42),x=t(44),w=t(21),k=t(32),S=t(12),C=null,T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,\"frame\",{get:function(){return this.model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"canvas\",{get:function(){return this.model.canvas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"canvas_overlays\",{get:function(){return this.canvas_view.overlays_el},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"canvas_events\",{get:function(){return this.canvas_view.events_el},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_paused\",{get:function(){return null!=this._is_paused&&0!==this._is_paused},enumerable:!0,configurable:!0}),e.prototype.view_options=function(){return{plot_view:this,parent:this}},e.prototype.pause=function(){null==this._is_paused?this._is_paused=1:this._is_paused+=1},e.prototype.unpause=function(t){if(void 0===t&&(t=!1),null==this._is_paused)throw new Error(\"wasn't paused\");this._is_paused-=1,0!=this._is_paused||t||this.request_render()},e.prototype.request_render=function(){this.request_paint()},e.prototype.request_paint=function(){this.is_paused||this.throttled_paint()},e.prototype.remove=function(){c.remove_views(this.renderer_views),c.remove_views(this.tool_views),this.canvas_view.remove(),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-plot-wrapper\")},e.prototype.initialize=function(e){var i=this;this.pause(),t.prototype.initialize.call(this,e),this.force_paint=new h.Signal0(this,\"force_paint\"),this.state_changed=new h.Signal0(this,\"state_changed\"),this.lod_started=!1,this.visuals=new _.Visuals(this.model.plot),this._initial_state_info={selection:{},dimensions:{width:this.model.canvas._width.value,height:this.model.canvas._height.value}},this.state={history:[],index:-1},this.canvas_view=new this.canvas.default_view({model:this.canvas,parent:this}),this.el.appendChild(this.canvas_view.el),this.canvas_view.render(),\"webgl\"==this.model.plot.output_backend&&this.init_webgl(),this.throttled_paint=b.throttle(function(){return i.force_paint.emit()},15),this.ui_event_bus=new u.UIEvents(this,this.model.toolbar,this.canvas_view.el,this.model.plot),this.levels={};for(var n=0,r=g.RenderLevel;n<r.length;n++){var o=r[n];this.levels[o]={}}this.renderer_views={},this.tool_views={},this.build_levels(),this.build_tools(),this.update_dataranges(),this.unpause(!0),m.logger.debug(\"PlotView initialized\")},e.prototype.set_cursor=function(t){void 0===t&&(t=\"default\"),this.canvas_view.el.style.cursor=t},e.prototype.init_webgl=function(){if(null==C){var t=document.createElement(\"canvas\"),e={premultipliedAlpha:!0},i=t.getContext(\"webgl\",e)||t.getContext(\"experimental-webgl\",e);null!=i&&(C={canvas:t,ctx:i})}null!=C?this.gl=C:m.logger.warn(\"WebGL is not supported, falling back to 2D canvas.\")},e.prototype.prepare_webgl=function(t,e){if(null!=this.gl){var i=this.canvas_view.get_canvas_element();this.gl.canvas.width=i.width,this.gl.canvas.height=i.height;var n=this.gl.ctx;n.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT||n.DEPTH_BUFFER_BIT),n.enable(n.SCISSOR_TEST);var r=e[0],o=e[1],s=e[2],a=e[3],l=this.model.canvas,h=l.xview,c=l.yview,u=h.compute(r),_=c.compute(o+a);n.scissor(t*u,t*_,t*s,t*a),n.enable(n.BLEND),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_DST_ALPHA,n.ONE)}},e.prototype.blit_webgl=function(t){var e=this.canvas_view.ctx;null!=this.gl&&(m.logger.debug(\"drawing with WebGL\"),e.restore(),e.drawImage(this.gl.canvas,0,0),e.save(),e.scale(t,t),e.translate(.5,.5))},e.prototype.update_dataranges=function(){for(var t=this.model.frame,e={},i={},n=!1,r=0,o=k.values(t.x_ranges).concat(k.values(t.y_ranges));r<o.length;r++){var l=o[r];l instanceof s.DataRange1d&&\"log\"==l.scale_hint&&(n=!0)}for(var h in this.renderer_views){var c=this.renderer_views[h];if(c instanceof a.GlyphRendererView){var u=c.glyph.bounds();if(null!=u&&(e[h]=u),n){var _=c.glyph.log_bounds();null!=_&&(i[h]=_)}}}var p,d=!1,f=!1;!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&(p=1/this.model.plot.aspect_scale*(this.frame._width.value/this.frame._height.value));for(var v=0,g=k.values(t.x_ranges);v<g.length;v++){var y=g[v];if(y instanceof s.DataRange1d){var b=\"log\"==y.scale_hint?i:e;y.update(b,0,this.model.id,p),y.follow&&(d=!0)}null!=y.bounds&&(f=!0)}for(var x=0,w=k.values(t.y_ranges);x<w.length;x++){var S=w[x];if(S instanceof s.DataRange1d){var b=\"log\"==S.scale_hint?i:e;S.update(b,1,this.model.id,p),S.follow&&(d=!0)}null!=S.bounds&&(f=!0)}if(d&&f){m.logger.warn(\"Follow enabled so bounds are unset.\");for(var C=0,T=k.values(t.x_ranges);C<T.length;C++){var y=T[C];y.bounds=null}for(var A=0,E=k.values(t.y_ranges);A<E.length;A++){var S=E[A];S.bounds=null}}this.range_update_timestamp=Date.now()},e.prototype.map_to_screen=function(t,e,i,n){return void 0===i&&(i=\"default\"),void 0===n&&(n=\"default\"),this.frame.map_to_screen(t,e,i,n)},e.prototype.push_state=function(t,e){var i=this.state,n=i.history,r=i.index,o=null!=n[r]?n[r].info:{},s=k.extend({},this._initial_state_info,o,e);this.state.history=this.state.history.slice(0,this.state.index+1),this.state.history.push({type:t,info:s}),this.state.index=this.state.history.length-1,this.state_changed.emit()},e.prototype.clear_state=function(){this.state={history:[],index:-1},this.state_changed.emit()},e.prototype.can_undo=function(){this.state.index},e.prototype.can_redo=function(){this.state.index,this.state.history.length},e.prototype.undo=function(){this.can_undo()&&(this.state.index-=1,this._do_state_change(this.state.index),this.state_changed.emit())},e.prototype.redo=function(){this.can_redo()&&(this.state.index+=1,this._do_state_change(this.state.index),this.state_changed.emit())},e.prototype._do_state_change=function(t){var e=null!=this.state.history[t]?this.state.history[t].info:this._initial_state_info;null!=e.range&&this.update_range(e.range),null!=e.selection&&this.update_selection(e.selection)},e.prototype.get_selection=function(){for(var t={},e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof a.GlyphRenderer){var r=n.data_source.selected;t[n.id]=r}}return t},e.prototype.update_selection=function(t){for(var e=0,i=this.model.plot.renderers;e<i.length;e++){var n=i[e];if(n instanceof a.GlyphRenderer){var r=n.data_source;null!=t?null!=t[n.id]&&(r.selected=t[n.id]):r.selection_manager.clear()}}},e.prototype.reset_selection=function(){this.update_selection(null)},e.prototype._update_ranges_together=function(t){for(var e=1,i=0,n=t;i<n.length;i++){var r=n[i],o=r[0],s=r[1];e=Math.min(e,this._get_weight_to_constrain_interval(o,s))}if(e<1)for(var a=0,l=t;a<l.length;a++){var h=l[a],o=h[0],s=h[1];s.start=e*s.start+(1-e)*o.start,s.end=e*s.end+(1-e)*o.end}},e.prototype._update_ranges_individually=function(t,e,i,n){for(var r=!1,o=0,s=t;o<s.length;o++){var a=s[o],l=a[0],h=a[1],c=l.start>l.end;if(!i){var u=this._get_weight_to_constrain_interval(l,h);u<1&&(h.start=u*h.start+(1-u)*l.start,h.end=u*h.end+(1-u)*l.end)}if(null!=l.bounds&&\"auto\"!=l.bounds){var _=l.bounds,p=_[0],d=_[1],f=Math.abs(h.end-h.start);c?(null!=p&&p>=h.end&&(r=!0,h.end=p,(e||i)&&(h.start=p+f)),null!=d&&d<=h.start&&(r=!0,h.start=d,(e||i)&&(h.end=d-f))):(null!=p&&p>=h.start&&(r=!0,h.start=p,(e||i)&&(h.end=p+f)),null!=d&&d<=h.end&&(r=!0,h.end=d,(e||i)&&(h.start=d-f)))}}if(!(i&&r&&n))for(var v=0,m=t;v<m.length;v++){var g=m[v],l=g[0],h=g[1];l.have_updated_interactively=!0,l.start==h.start&&l.end==h.end||l.setv(h)}},e.prototype._get_weight_to_constrain_interval=function(t,e){var i=t.min_interval,n=t.max_interval;if(null!=t.bounds&&\"auto\"!=t.bounds){var r=t.bounds,o=r[0],s=r[1];if(null!=o&&null!=s){var a=Math.abs(s-o);n=null!=n?Math.min(n,a):a}}var l=1;if(null!=i||null!=n){var h=Math.abs(t.end-t.start),c=Math.abs(e.end-e.start);i>0&&c<i&&(l=(h-i)/(h-c)),n>0&&c>n&&(l=(n-h)/(c-h)),l=Math.max(0,Math.min(1,l))}return l},e.prototype.update_range=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!0),this.pause();var r=this.frame,o=r.x_ranges,s=r.y_ranges;if(null==t){for(var a in o){var l=o[a];l.reset()}for(var h in s){var l=s[h];l.reset()}this.update_dataranges()}else{var c=[];for(var u in o){var l=o[u];c.push([l,t.xrs[u]])}for(var _ in s){var l=s[_];c.push([l,t.yrs[_]])}i&&this._update_ranges_together(c),this._update_ranges_individually(c,e,i,n)}this.unpause()},e.prototype.reset_range=function(){this.update_range(null)},e.prototype.build_levels=function(){for(var t=this.model.plot.all_renderers,e=k.keys(this.renderer_views),i=c.build_views(this.renderer_views,t,this.view_options()),n=w.difference(e,t.map(function(t){return t.id})),r=0,o=n;r<o.length;r++){var s=o[r];delete this.levels.glyph[s]}for(var a=0,l=i;a<l.length;a++){var h=l[a];this.levels[h.model.level][h.model.id]=h}},e.prototype.get_renderer_views=function(){var t=this;return this.model.plot.renderers.map(function(e){return t.levels[e.level][e.id]})},e.prototype.build_tools=function(){var t=this,e=this.model.plot.toolbar.tools,i=c.build_views(this.tool_views,e,this.view_options());i.map(function(e){return t.ui_event_bus.register_tool(e)})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.force_paint,function(){return e.repaint()});var i=this.model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];this.connect(s.change,function(){return e.request_render()})}for(var a in r){var s=r[a];this.connect(s.change,function(){return e.request_render()})}this.connect(this.model.plot.properties.renderers.change,function(){return e.build_levels()}),this.connect(this.model.plot.toolbar.properties.tools.change,function(){e.build_levels(),e.build_tools()}),this.connect(this.model.plot.change,function(){return e.request_render()})},e.prototype.set_initial_range=function(){var t=!0,e=this.frame,i=e.x_ranges,n=e.y_ranges,r={},o={};for(var s in i){var a=i[s],l=a.start,h=a.end;if(null==l||null==h||x.isStrictNaN(l+h)){t=!1;break}r[s]={start:l,end:h}}if(t)for(var c in n){var u=n[c],l=u.start,h=u.end;if(null==l||null==h||x.isStrictNaN(l+h)){t=!1;break}o[c]={start:l,end:h}}t?(this._initial_state_info.range={xrs:r,yrs:o},m.logger.debug(\"initial ranges set\")):m.logger.warn(\"could not set initial ranges\")},e.prototype.update_constraints=function(){this.solver.suggest_value(this.frame._width,this.canvas._width.value),this.solver.suggest_value(this.frame._height,this.canvas._height.value);for(var t in this.renderer_views){var e=this.renderer_views[t];S.isSizeableView(e)&&null!=e.model.panel&&S.update_panel_constraints(e)}this.solver.update_variables()},e.prototype._layout=function(t){void 0===t&&(t=!1),this.render(),t&&(this.model.plot.setv({inner_width:Math.round(this.frame._width.value),inner_height:Math.round(this.frame._height.value),layout_width:Math.round(this.canvas._width.value),layout_height:Math.round(this.canvas._height.value)},{no_change:!0}),this.paint())},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;for(var e in this.levels){var i=this.levels[e];for(var n in i){var r=i[n];if(!r.has_finished())return!1}}return!0},e.prototype.render=function(){var t=this.model._width.value,e=this.model._height.value;this.canvas_view.set_dims([t,e]),this.update_constraints(),!1!==this.model.plot.match_aspect&&0!=this.frame._width.value&&0!=this.frame._height.value&&this.update_dataranges(),this.el.style.position=\"absolute\",this.el.style.left=this.model._dom_left.value+\"px\",this.el.style.top=this.model._dom_top.value+\"px\",this.el.style.width=this.model._width.value+\"px\",this.el.style.height=this.model._height.value+\"px\"},e.prototype._needs_layout=function(){for(var t in this.renderer_views){var e=this.renderer_views[t];if(S.isSizeableView(e)&&null!=e.model.panel&&S._view_sizes.get(e)!=e.get_size())return!0}return!1},e.prototype.repaint=function(){this._needs_layout()?this.parent.partial_layout():this.paint()},e.prototype.paint=function(){var t=this;if(!this.is_paused){m.logger.trace(\"PlotCanvas.render() for \"+this.model.id),this.canvas_view.prepare_canvas();var e=this.model.document;if(null!=e){var i=e.interactive_duration(),n=this.model.plot;i>=0&&i<n.lod_interval?setTimeout(function(){e.interactive_duration()>n.lod_timeout&&e.interactive_stop(n),t.request_render()},n.lod_timeout):e.interactive_stop(n)}for(var r in this.renderer_views){var o=this.renderer_views[r];if(null==this.range_update_timestamp||o instanceof a.GlyphRendererView&&o.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}}this.model.frame.update_scales();var s=this.canvas_view.ctx,l=this.canvas.pixel_ratio;s.save(),s.scale(l,l),s.translate(.5,.5);var h=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value];if(this._map_hook(s,h),this._paint_empty(s,h),this.prepare_webgl(l,h),s.save(),this.visuals.outline_line.doit){this.visuals.outline_line.set_value(s);var c=h[0],u=h[1],_=h[2],p=h[3];c+_==this.canvas._width.value&&(_-=1),u+p==this.canvas._height.value&&(p-=1),s.strokeRect(c,u,_,p)}s.restore(),this._paint_levels(s,[\"image\",\"underlay\",\"glyph\"],h),this.blit_webgl(l),this._paint_levels(s,[\"annotation\"],h),this._paint_levels(s,[\"overlay\"]),null==this._initial_state_info.range&&this.set_initial_range(),s.restore(),this._has_finished||(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,i){t.save(),null!=i&&(t.beginPath(),t.rect.apply(t,i),t.clip());for(var n={},r=0;r<this.model.plot.renderers.length;r++){var o=this.model.plot.renderers[r];n[o.id]=r}for(var s=function(t){return n[t.model.id]},a=0,l=e;a<l.length;a++)for(var h=l[a],c=w.sortBy(k.values(this.levels[h]),s),u=0,_=c;u<_.length;u++){var p=_[u];p.render()}t.restore()},e.prototype._map_hook=function(t,e){},e.prototype._paint_empty=function(t,e){var i=[0,0,this.canvas_view.model._width.value,this.canvas_view.model._height.value],n=i[0],r=i[1],o=i[2],s=i[3],a=e[0],l=e[1],h=e[2],c=e[3];t.clearRect(n,r,o,s),this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(t),t.fillRect(n,r,o,s),t.clearRect(a,l,h,c)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(a,l,h,c))},e.prototype.save=function(t){switch(this.model.plot.output_backend){case\"canvas\":case\"webgl\":var e=this.canvas_view.get_canvas_element();if(null!=e.msToBlob){var i=e.msToBlob();window.navigator.msSaveBlob(i,t)}else{var n=document.createElement(\"a\");n.href=e.toDataURL(\"image/png\"),n.download=t+\".png\",n.target=\"_blank\",n.dispatchEvent(new MouseEvent(\"click\"))}case\"svg\":var r=this.canvas_view.ctx.getSerializedSvg(!0),o=new Blob([r],{type:\"text/plain\"}),s=document.createElement(\"a\");s.download=t+\".svg\",s.innerHTML=\"Download svg\",s.href=window.URL.createObjectURL(o),s.onclick=function(t){return document.body.removeChild(t.target)},s.style.display=\"none\",document.body.appendChild(s),s.click()}},e}(p.DOMView);i.PlotCanvasView=T;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"AbovePanel\"},e}(d.LayoutCanvas);i.AbovePanel=A,A.initClass();var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BelowPanel\"},e}(d.LayoutCanvas);i.BelowPanel=E,E.initClass();var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LeftPanel\"},e}(d.LayoutCanvas);i.LeftPanel=M,M.initClass();var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"RightPanel\"},e}(d.LayoutCanvas);i.RightPanel=O,O.initClass();var z=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PlotCanvas\",this.prototype.default_view=T,this.internal({plot:[y.Instance],toolbar:[y.Instance],canvas:[y.Instance],frame:[y.Instance]}),this.override({sizing_mode:\"stretch_both\"})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.canvas=new r.Canvas({map:null!=this.use_map&&this.use_map,use_hidpi:this.plot.hidpi,output_backend:this.plot.output_backend}),this.frame=new o.CartesianFrame({x_range:this.plot.x_range,extra_x_ranges:this.plot.extra_x_ranges,x_scale:this.plot.x_scale,y_range:this.plot.y_range,extra_y_ranges:this.plot.extra_y_ranges,y_scale:this.plot.y_scale}),this.above_panel=new A,this.below_panel=new E,this.left_panel=new M,this.right_panel=new O,m.logger.debug(\"PlotCanvas initialized\")},e.prototype._doc_attached=function(){this.canvas.attach_document(this.document),this.frame.attach_document(this.document),this.above_panel.attach_document(this.document),this.below_panel.attach_document(this.document),this.left_panel.attach_document(this.document),this.right_panel.attach_document(this.document),t.prototype._doc_attached.call(this),m.logger.debug(\"PlotCanvas attached to document\")},e.prototype.get_layoutable_children=function(){var t=[this.above_panel,this.below_panel,this.left_panel,this.right_panel,this.canvas,this.frame],e=function(e){for(var i=0,n=e;i<n.length;i++){var r=n[i];S.isSizeable(r)&&null!=r.panel&&t.push(r.panel)}};return e(this.plot.above),e(this.plot.below),e(this.plot.left),e(this.plot.right),t},e.prototype.get_constraints=function(){return t.prototype.get_constraints.call(this).concat(this._get_constant_constraints(),this._get_side_constraints())},e.prototype._get_constant_constraints=function(){return[v.EQ(this.canvas._left,0),v.EQ(this.canvas._top,0),v.GE(this.above_panel._top,[-1,this.canvas._top]),v.EQ(this.above_panel._bottom,[-1,this.frame._top]),v.EQ(this.above_panel._left,[-1,this.left_panel._right]),v.EQ(this.above_panel._right,[-1,this.right_panel._left]),v.EQ(this.below_panel._top,[-1,this.frame._bottom]),v.LE(this.below_panel._bottom,[-1,this.canvas._bottom]),v.EQ(this.below_panel._left,[-1,this.left_panel._right]),v.EQ(this.below_panel._right,[-1,this.right_panel._left]),v.EQ(this.left_panel._top,[-1,this.above_panel._bottom]),v.EQ(this.left_panel._bottom,[-1,this.below_panel._top]),v.GE(this.left_panel._left,[-1,this.canvas._left]),v.EQ(this.left_panel._right,[-1,this.frame._left]),v.EQ(this.right_panel._top,[-1,this.above_panel._bottom]),v.EQ(this.right_panel._bottom,[-1,this.below_panel._top]),v.EQ(this.right_panel._left,[-1,this.frame._right]),v.LE(this.right_panel._right,[-1,this.canvas._right]),v.EQ(this._top,[-1,this.above_panel._bottom]),v.EQ(this._left,[-1,this.left_panel._right]),v.EQ(this._height,[-1,this._bottom],[-1,this.canvas._bottom],this.below_panel._top),v.EQ(this._width,[-1,this._right],[-1,this.canvas._right],this.right_panel._left),v.GE(this._top,-this.plot.min_border_top),v.GE(this._left,-this.plot.min_border_left),v.GE(this._height,[-1,this._bottom],-this.plot.min_border_bottom),v.GE(this._width,[-1,this._right],-this.plot.min_border_right)]},e.prototype._get_side_constraints=function(){var t=function(t){return t.map(function(t){return t.panel})},e=f.vstack(this.above_panel,t(this.plot.above)),i=f.vstack(this.below_panel,w.reversed(t(this.plot.below))),n=f.hstack(this.left_panel,t(this.plot.left)),r=f.hstack(this.right_panel,w.reversed(t(this.plot.right)));return w.concat([e,i,n,r])},e}(l.LayoutDOM);i.PlotCanvas=z,z.initClass()},function(t,e,i){var n=t(379),r=t(167),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DataRange\",this.define({names:[o.Array,[]],renderers:[o.Array,[]]})},e}(r.Range);i.DataRange=s,s.initClass()},function(t,e,i){var n=t(379),r=t(163),o=t(169),s=t(14),a=t(15),l=t(24),h=t(21),c=function(t){function e(e){var i=t.call(this,e)||this;return i._plot_bounds={},i.have_updated_interactively=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DataRange1d\",this.define({start:[a.Number],end:[a.Number],range_padding:[a.Number,.1],range_padding_units:[a.PaddingUnits,\"percent\"],flipped:[a.Bool,!1],follow:[a.StartEnd],follow_interval:[a.Number],default_span:[a.Number,2]}),this.internal({scale_hint:[a.String,\"auto\"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span},Object.defineProperty(e.prototype,\"min\",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max\",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),e.prototype.computed_renderers=function(){var t=this.names,e=this.renderers;if(0==e.length)for(var i=0,n=this.plots;i<n.length;i++){var r=n[i],a=r.renderers.filter(function(t){return t instanceof o.GlyphRenderer});e=e.concat(a)}t.length>0&&(e=e.filter(function(e){return h.includes(t,e.name)})),s.logger.debug(\"computed \"+e.length+\" renderers for DataRange1d \"+this.id);for(var l=0,c=e;l<c.length;l++){var u=c[l];s.logger.trace(\" - \"+u.type+\" \"+u.id)}return e},e.prototype._compute_plot_bounds=function(t,e){for(var i=l.empty(),n=0,r=t;n<r.length;n++){var o=r[n];null!=e[o.id]&&(i=l.union(i,e[o.id]))}return i},e.prototype.adjust_bounds_for_aspect=function(t,e){var i=l.empty(),n=t.maxX-t.minX;n<=0&&(n=1);var r=t.maxY-t.minY;r<=0&&(r=1);var o=.5*(t.maxX+t.minX),s=.5*(t.maxY+t.minY);return n<e*r?n=e*r:r=n/e,i.maxX=o+.5*n,i.minX=o-.5*n,i.maxY=s+.5*r,i.minY=s-.5*r,i},e.prototype._compute_min_max=function(t,e){var i=l.empty();for(var n in t){var r=t[n];i=l.union(i,r)}var o,s;return 0==e?(a=[i.minX,i.maxX],o=a[0],s=a[1]):(h=[i.minY,i.maxY],o=h[0],s=h[1]),[o,s];var a,h},e.prototype._compute_range=function(t,e){var i,n,r=this.range_padding;if(\"log\"==this.scale_hint){(isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?.1:e/100,s.logger.warn(\"could not determine minimum data value for log axis, DataRange1d using value \"+t)),(isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?10:100*t,s.logger.warn(\"could not determine maximum data value for log axis, DataRange1d using value \"+e));var o=void 0,a=void 0;if(e==t)a=this.default_span+.001,o=Math.log(t)/Math.log(10);else{var l=void 0,h=void 0;\"percent\"==this.range_padding_units?(l=Math.log(t)/Math.log(10),h=Math.log(e)/Math.log(10),a=(h-l)*(1+r)):(l=Math.log(t-r)/Math.log(10),h=Math.log(e+r)/Math.log(10),a=h-l),o=(l+h)/2}i=Math.pow(10,o-a/2),n=Math.pow(10,o+a/2)}else{var a=void 0;a=e==t?this.default_span:\"percent\"==this.range_padding_units?(e-t)*(1+r):e-t+2*r;var o=(e+t)/2;i=o-a/2,n=o+a/2}var c=1;this.flipped&&(i=(_=[n,i])[0],n=_[1],c=-1);var u=this.follow_interval;return null!=u&&Math.abs(i-n)>u&&(\"start\"==this.follow?n=i+c*u:\"end\"==this.follow&&(i=n-c*u)),[i,n];var _},e.prototype.update=function(t,e,i,n){if(!this.have_updated_interactively){var r=this.computed_renderers(),o=this._compute_plot_bounds(r,t);null!=n&&(o=this.adjust_bounds_for_aspect(o,n)),this._plot_bounds[i]=o;var s=this._compute_min_max(this._plot_bounds,e),a=s[0],l=s[1],h=this._compute_range(a,l),c=h[0],u=h[1];null!=this._initial_start&&(\"log\"==this.scale_hint?this._initial_start>0&&(c=this._initial_start):c=this._initial_start),null!=this._initial_end&&(\"log\"==this.scale_hint?this._initial_end>0&&(u=this._initial_end):u=this._initial_end);var _=[this.start,this.end],p=_[0],d=_[1];if(c!=p||u!=d){var f={};c!=p&&(f.start=c),u!=d&&(f.end=u),this.setv(f)}\"auto\"==this.bounds&&this.setv({bounds:[c,u]},{silent:!0}),this.change.emit()}},e.prototype.reset=function(){this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},e}(r.DataRange);i.DataRange1d=c,c.initClass()},function(t,e,i){function n(t,e,i){void 0===i&&(i=0);for(var n={},r=0;r<t.length;r++){var o=t[r];if(o in n)throw new Error(\"duplicate factor or subfactor: \"+o);n[o]={value:.5+r*(1+e)+i}}return[n,(t.length-1)*e]}function r(t,e,i,r){void 0===r&&(r=0);for(var o={},s={},a=[],l=0,h=t;l<h.length;l++){var u=h[l],_=u[0],p=u[1];_ in s||(s[_]=[],a.push(_)),s[_].push(p)}for(var d=r,f=0,v=function(t){var r=s[t].length,a=n(s[t],i,d),l=a[0],h=a[1];f+=h;var u=c.sum(s[t].map(function(t){return l[t].value}));o[t]={value:u/r,mapping:l},d+=r+e+h},m=0,g=a;m<g.length;m++){var _=g[m];v(_)}return[o,a,(a.length-1)*e+f]}function o(t,e,i,n,o){void 0===o&&(o=0);for(var s={},a={},l=[],h=0,u=t;h<u.length;h++){var _=u[h],p=_[0],d=_[1],f=_[2];p in a||(a[p]=[],l.push(p)),a[p].push([d,f])}for(var v=[],m=o,g=0,y=function(t){for(var o=a[t].length,l=r(a[t],i,n,m),h=l[0],u=l[1],_=l[2],p=0,d=u;p<d.length;p++){var f=d[p];v.push([t,f])}g+=_;var y=c.sum(a[t].map(function(t){var e=t[0];return h[e].value}));s[t]={value:y/o,mapping:h},m+=o+e+_},b=0,x=l;b<x.length;b++){var p=x[b];y(p)}return[s,l,v,(l.length-1)*e+g]}var s=t(379),a=t(167),l=t(15),h=t(22),c=t(21),u=t(44);i.map_one_level=n,i.map_two_levels=r,i.map_three_levels=o;var _=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type=\"FactorRange\",this.define({factors:[l.Array,[]],factor_padding:[l.Number,0],subgroup_padding:[l.Number,.8],group_padding:[l.Number,1.4],range_padding:[l.Number,0],range_padding_units:[l.PaddingUnits,\"percent\"],start:[l.Number],end:[l.Number]}),this.internal({levels:[l.Number],mids:[l.Array],tops:[l.Array],tops_groups:[l.Array]})},Object.defineProperty(e.prototype,\"min\",{get:function(){return this.start},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max\",{get:function(){return this.end},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.factors.change,function(){return e.reset()}),this.connect(this.properties.factor_padding.change,function(){return e.reset()}),this.connect(this.properties.group_padding.change,function(){return e.reset()}),this.connect(this.properties.subgroup_padding.change,function(){return e.reset()}),this.connect(this.properties.range_padding.change,function(){return e.reset()}),this.connect(this.properties.range_padding_units.change,function(){return e.reset()})},e.prototype.reset=function(){this._init(),this.change.emit()},e.prototype._lookup=function(t){if(1==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])?e[t[0]].value:NaN}if(2==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])?e[t[0]].mapping[t[1]].value:NaN}if(3==t.length){var e=this._mapping;return e.hasOwnProperty(t[0])&&e[t[0]].mapping.hasOwnProperty(t[1])&&e[t[0]].mapping[t[1]].mapping.hasOwnProperty(t[2])?e[t[0]].mapping[t[1]].mapping[t[2]].value:NaN}throw new Error(\"unreachable code\")},e.prototype.synthetic=function(t){if(u.isNumber(t))return t;if(u.isString(t))return this._lookup([t]);var e=0,i=t[t.length-1];return u.isNumber(i)&&(e=i,t=t.slice(0,-1)),this._lookup(t)+e},e.prototype.v_synthetic=function(t){var e=this;return h.map(t,function(t){return e.synthetic(t)})},e.prototype._init=function(){var t,e;if(c.all(this.factors,u.isString))t=1,l=n(this.factors,this.factor_padding),this._mapping=l[0],e=l[1];else if(c.all(this.factors,function(t){return u.isArray(t)&&2==t.length&&u.isString(t[0])&&u.isString(t[1])}))t=2,h=r(this.factors,this.group_padding,this.factor_padding),this._mapping=h[0],this.tops=h[1],e=h[2];else{if(!c.all(this.factors,function(t){return u.isArray(t)&&3==t.length&&u.isString(t[0])&&u.isString(t[1])&&u.isString(t[2])}))throw new Error(\"???\");t=3,_=o(this.factors,this.group_padding,this.subgroup_padding,this.factor_padding),this._mapping=_[0],this.tops=_[1],this.mids=_[2],e=_[3]}var i=0,s=this.factors.length+e;if(\"percent\"==this.range_padding_units){var a=(s-i)*this.range_padding/2;i-=a,s+=a}else i-=this.range_padding,s+=this.range_padding;this.setv({start:i,end:s,levels:t},{silent:!0}),\"auto\"==this.bounds&&this.setv({bounds:[i,s]},{silent:!0});var l,h,_},e}(a.Range);i.FactorRange=_,_.initClass()},function(t,e,i){var n=t(163);i.DataRange=n.DataRange;var r=t(164);i.DataRange1d=r.DataRange1d;var o=t(165);i.FactorRange=o.FactorRange;var s=t(167);i.Range=s.Range;var a=t(168);i.Range1d=a.Range1d},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=function(t){function e(e){var i=t.call(this,e)||this;return i.have_updated_interactively=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Range\",this.define({callback:[o.Any],bounds:[o.Any],min_interval:[o.Any],max_interval:[o.Any]}),this.internal({plots:[o.Array,[]]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._emit_callback()})},e.prototype.reset=function(){this.change.emit()},e.prototype._emit_callback=function(){null!=this.callback&&(s.isFunction(this.callback)?this.callback(this):this.callback.execute(this,{}))},e}(r.Model);i.Range=a,a.initClass()},function(t,e,i){var n=t(379),r=t(167),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Range1d\",this.define({start:[o.Number,0],end:[o.Number,1]})},e.prototype._set_auto_bounds=function(){if(\"auto\"==this.bounds){var t=Math.min(this._initial_start,this._initial_end),e=Math.max(this._initial_start,this._initial_end);this.setv({bounds:[t,e]},{silent:!0})}},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._initial_start=this.start,this._initial_end=this.end,this._set_auto_bounds()},Object.defineProperty(e.prototype,\"min\",{get:function(){return Math.min(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max\",{get:function(){return Math.max(this.start,this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"is_reversed\",{get:function(){return this.start>this.end},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._set_auto_bounds(),this.start!=this._initial_start||this.end!=this._initial_end?this.setv({start:this._initial_start,end:this._initial_end}):this.change.emit()},e}(r.Range);i.Range1d=s,s.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(120),s=t(189),a=t(183),l=t(14),h=t(15),c=t(22),u=t(21),_=t(32),p=t(165),d={fill:{},line:{}},f={fill:{fill_alpha:.3,fill_color:\"grey\"},line:{line_alpha:.3,line_color:\"grey\"}},v={fill:{fill_alpha:.2},line:{}},m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){function i(t){var e=_.clone(a);return r&&_.extend(e,t.fill),o&&_.extend(e,t.line),new n.constructor(e)}t.prototype.initialize.call(this,e);var n=this.model.glyph,r=u.includes(n.mixins,\"fill\"),o=u.includes(n.mixins,\"line\"),a=_.clone(n.attributes);delete a.id,this.glyph=this.build_glyph_view(n);var l=this.model.selection_glyph;null==l?l=i({fill:{},line:{}}):\"auto\"===l&&(l=i(d)),this.selection_glyph=this.build_glyph_view(l);var h=this.model.nonselection_glyph;null==h?h=i({fill:{},line:{}}):\"auto\"===h&&(h=i(v)),this.nonselection_glyph=this.build_glyph_view(h);var c=this.model.hover_glyph;null!=c&&(this.hover_glyph=this.build_glyph_view(c));var p=this.model.muted_glyph;null!=p&&(this.muted_glyph=this.build_glyph_view(p));var m=i(f);this.decimated_glyph=this.build_glyph_view(m),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1),this.model.data_source instanceof s.RemoteDataSource&&this.model.data_source.setup()},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()}),this.connect(this.model.glyph.change,function(){return e.set_data()}),this.connect(this.model.data_source.change,function(){return e.set_data()}),this.connect(this.model.data_source.streaming,function(){return e.set_data()}),this.connect(this.model.data_source.patching,function(t){return e.set_data(!0,t)}),this.connect(this.model.data_source._select,function(){return e.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return e.request_render()}),this.connect(this.model.properties.view.change,function(){return e.set_data()}),this.connect(this.model.view.change,function(){return e.set_data()});var i=this.plot_model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];s instanceof p.FactorRange&&this.connect(s.change,function(){return e.set_data()})}for(var a in r){var s=r[a];s instanceof p.FactorRange&&this.connect(s.change,function(){return e.set_data()})}this.connect(this.model.glyph.transformchange,function(){return e.set_data()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=null);var i=Date.now(),n=this.model.data_source;this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(n,this.all_indices,e),this.glyph.set_visuals(n),this.decimated_glyph.set_visuals(n),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(n),this.nonselection_glyph.set_visuals(n)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(n),null!=this.muted_glyph&&this.muted_glyph.set_visuals(n);var r=this.plot_model.plot.lod_factor;this.decimated=[];for(var o=0,s=Math.floor(this.all_indices.length/r);o<s;o++)this.decimated.push(o*r);var a=Date.now()-i;l.logger.debug(this.glyph.model.type+\" GlyphRenderer (\"+this.model.id+\"): set_data finished in \"+a+\"ms\"),this.set_data_timestamp=Date.now(),t&&this.request_render()},e.prototype.render=function(){var t=this;if(this.model.visible){var e=Date.now(),i=this.glyph.glglyph;this.glyph.map_data();var n=Date.now()-e,r=Date.now(),s=this.glyph.mask_data(this.all_indices);s.length===this.all_indices.length&&(s=u.range(0,this.all_indices.length));var a=Date.now()-r,h=this.plot_view.canvas_view.ctx;h.save();var c,_=this.model.data_source.selected;c=!_||_.is_empty()?[]:this.glyph instanceof o.LineView&&_.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(s):_.indices;var p,d=this.model.data_source.inspected;p=d&&0!==d.length?d[\"0d\"].glyph?this.model.view.convert_indices_from_subset(s):d[\"1d\"].indices.length>0?d[\"1d\"].indices:function(){for(var t=[],e=0,i=Object.keys(d[\"2d\"].indices);e<i.length;e++){var n=i[e];t.push(parseInt(n))}return t}():[];var f,v,m,g=function(){for(var e=[],i=0,n=s;i<n.length;i++){var r=n[i];u.includes(p,t.all_indices[r])&&e.push(r)}return e}(),y=this.plot_model.plot.lod_threshold;null!=this.model.document&&this.model.document.interactive_duration()>0&&!i&&null!=y&&this.all_indices.length>y?(s=this.decimated,f=this.decimated_glyph,v=this.decimated_glyph,m=this.selection_glyph):(f=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,v=this.nonselection_glyph,m=this.selection_glyph),null!=this.hover_glyph&&g.length&&(s=u.difference(s,g));var b,x=null;if(c.length&&this.have_selection_glyphs()){for(var w=Date.now(),k={},S=0,C=c;S<C.length;S++){var T=C[S];k[T]=!0}var A=new Array,E=new Array;if(this.glyph instanceof o.LineView)for(var M=0,O=this.all_indices;M<O.length;M++){var T=O[M];null!=k[T]?A.push(T):E.push(T)}else for(var z=0,P=s;z<P.length;z++){var T=P[z];null!=k[this.all_indices[T]]?A.push(T):E.push(T)}x=Date.now()-w,b=Date.now(),v.render(h,E,this.glyph),m.render(h,A,this.glyph),null!=this.hover_glyph&&(this.glyph instanceof o.LineView?this.hover_glyph.render(h,this.model.view.convert_indices_from_subset(g),this.glyph):this.hover_glyph.render(h,g,this.glyph))}else b=Date.now(),this.glyph instanceof o.LineView?this.hover_glyph&&g.length?this.hover_glyph.render(h,this.model.view.convert_indices_from_subset(g),this.glyph):f.render(h,this.all_indices,this.glyph):(f.render(h,s,this.glyph),this.hover_glyph&&g.length&&this.hover_glyph.render(h,g,this.glyph));var j=Date.now()-b;this.last_dtrender=j;var N=Date.now()-e;return l.logger.debug(this.glyph.model.type+\" GlyphRenderer (\"+this.model.id+\"): render finished in \"+N+\"ms\"),l.logger.trace(\" - map_data finished in : \"+n+\"ms\"),l.logger.trace(\" - mask_data finished in : \"+a+\"ms\"),null!=x&&l.logger.trace(\" - selection mask finished in : \"+x+\"ms\"),l.logger.trace(\" - glyph renders finished in : \"+j+\"ms\"),h.restore()}},e.prototype.draw_legend=function(t,e,i,n,r,o,s){var a=this.model.get_reference_point(o,s);this.glyph.draw_legend_for_index(t,{x0:e,x1:i,y0:n,y1:r},a)},e.prototype.hit_test=function(t){if(!this.model.visible)return null;var e=this.glyph.hit_test(t);return null==e?null:this.model.view.convert_selection_from_subset(e)},e}(r.RendererView);i.GlyphRendererView=m;var g=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GlyphRenderer\",this.prototype.default_view=m,this.define({x_range_name:[h.String,\"default\"],y_range_name:[h.String,\"default\"],data_source:[h.Instance],view:[h.Instance,function(){return new a.CDSView}],glyph:[h.Instance],hover_glyph:[h.Instance],nonselection_glyph:[h.Any,\"auto\"],selection_glyph:[h.Any,\"auto\"],muted_glyph:[h.Instance],muted:[h.Bool,!1]}),this.override({level:\"glyph\"})},e.prototype.initialize=function(){t.prototype.initialize.call(this),null==this.view.source&&(this.view.source=this.data_source,this.view.compute_indices())},e.prototype.get_reference_point=function(t,e){var i=0;if(null!=t){var n=this.data_source.get_column(t);if(null!=n){var r=c.indexOf(n,e);-1!=r&&(i=r)}}return i},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(r.Renderer);i.GlyphRenderer=g,g.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(136),s=t(15),a=t(4),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales.default,this.yscale=this.plot_view.frame.yscales.default,this._renderer_views={},i=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=i[0],this.edge_view=i[1],this.set_data();var i},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source._select,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return e.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source._select,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return e.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return e.set_data()});var i=this.plot_model.frame,n=i.x_ranges,r=i.y_ranges;for(var o in n){var s=n[o];this.connect(s.change,function(){return e.set_data()})}for(var a in r){var s=r[a];this.connect(s.change,function(){return e.set_data()})}},e.prototype.set_data=function(t){void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0});var e=this.node_view.glyph;n=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),e._x=n[0],e._y=n[1];var i=this.edge_view.glyph;r=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),i._xs=r[0],i._ys=r[1],e.index_data(),i.index_data(),t&&this.request_render();var n,r},e.prototype.render=function(){this.edge_view.render(),this.node_view.render()},e}(r.RendererView);i.GraphRendererView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GraphRenderer\",this.prototype.default_view=l,this.define({x_range_name:[s.String,\"default\"],y_range_name:[s.String,\"default\"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),this.override({level:\"glyph\"})},e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);i.GraphRenderer=h,h.initClass()},function(t,e,i){var n=t(379),r=t(173),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.RendererView);i.GuideRendererView=s;var a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GuideRenderer\",this.define({plot:[o.Instance]}),this.override({level:\"overlay\"})},e}(r.Renderer);i.GuideRenderer=a,a.initClass()},function(t,e,i){var n=t(169);i.GlyphRenderer=n.GlyphRenderer;var r=t(170);i.GraphRenderer=r.GraphRenderer;var o=t(171);i.GuideRenderer=o.GuideRenderer;var s=t(173);i.Renderer=s.Renderer},function(t,e,i){var n=t(379),r=t(6),o=t(49),s=t(15),a=t(53),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},Object.defineProperty(e.prototype,\"plot_model\",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),e.prototype.request_render=function(){this.plot_view.request_render()},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},e}(r.DOMView);i.RendererView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Renderer\",this.define({level:[s.RenderLevel],visible:[s.Bool,!0]})},e}(a.Model);i.Renderer=h,h.initClass()},function(t,e,i){var n=t(379),r=t(176),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CategoricalScale\"},e.prototype.compute=function(e){return t.prototype.compute.call(this,this.source_range.synthetic(e))},e.prototype.v_compute=function(e){return t.prototype.v_compute.call(this,this.source_range.v_synthetic(e))},e}(r.LinearScale);i.CategoricalScale=o,o.initClass()},function(t,e,i){var n=t(174);i.CategoricalScale=n.CategoricalScale;var r=t(176);i.LinearScale=r.LinearScale;var o=t(177);i.LogScale=o.LogScale;var s=t(178);i.Scale=s.Scale},function(t,e,i){var n=t(379),r=t(178),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LinearScale\"},e.prototype.compute=function(t){var e=this._compute_state(),i=e[0],n=e[1];return i*t+n},e.prototype.v_compute=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=i*t[o]+n;return r},e.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1];return(t-n)/i},e.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=new Float64Array(t.length),o=0;o<t.length;o++)r[o]=(t[o]-n)/i;return r},e.prototype._compute_state=function(){var t=this.source_range.start,e=this.source_range.end,i=this.target_range.start,n=this.target_range.end,r=(n-i)/(e-t),o=-r*t+i;return[r,o]},e}(r.Scale);i.LinearScale=o,o.initClass()},function(t,e,i){var n=t(379),r=t(178),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LogScale\"},e.prototype.compute=function(t){var e,i=this._compute_state(),n=i[0],r=i[1],o=i[2],s=i[3];if(0==o)e=0;else{var a=(Math.log(t)-s)/o;e=isFinite(a)?a*n+r:NaN}return e},e.prototype.v_compute=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length);if(0==r)for(var a=0;a<t.length;a++)s[a]=0;else for(var a=0;a<t.length;a++){var l=(Math.log(t[a])-o)/r,h=void 0;h=isFinite(l)?l*i+n:NaN,s[a]=h}return s},e.prototype.invert=function(t){var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=(t-n)/i;return Math.exp(r*s+o)},e.prototype.v_invert=function(t){for(var e=this._compute_state(),i=e[0],n=e[1],r=e[2],o=e[3],s=new Float64Array(t.length),a=0;a<t.length;a++){var l=(t[a]-n)/i;s[a]=Math.exp(r*l+o)}return s},e.prototype._get_safe_factor=function(t,e){var i=t<0?0:t,n=e<0?0:e;if(i==n)if(0==i)o=[1,10],i=o[0],n=o[1];else{var r=Math.log(i)/Math.log(10);i=Math.pow(10,Math.floor(r)),n=Math.ceil(r)!=Math.floor(r)?Math.pow(10,Math.ceil(r)):Math.pow(10,Math.ceil(r)+1)}return[i,n];var o},e.prototype._compute_state=function(){var t,e,i=this.source_range.start,n=this.source_range.end,r=this.target_range.start,o=this.target_range.end,s=o-r,a=this._get_safe_factor(i,n),l=a[0],h=a[1];0==l?(t=Math.log(h),e=0):(t=Math.log(h)-Math.log(l),e=Math.log(l));var c=s,u=r;return[c,u,t,e]},e}(r.Scale);i.LogScale=o,o.initClass()},function(t,e,i){var n=t(379),r=t(252),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Scale\",this.internal({source_range:[o.Any],target_range:[o.Any]})},e.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},e.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},e}(r.Transform);i.Scale=s,s.initClass()},function(t,e,i){var n=t(379);n.__exportStar(t(180),i);var r=t(181);i.Selection=r.Selection},function(t,e,i){var n=t(379),r=t(53),o=t(181),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.do_selection=function(t,e,i,n){if(null===t)return!1;e.selected.update(t,i,n);var r=new o.Selection;return r.update(e.selected,i,!1),e.selected=r,e._select.emit(),!e.selected.is_empty()},e}(r.Model);i.SelectionPolicy=s,s.prototype.type=\"SelectionPolicy\";var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(i.length>0){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_intersection(c)}return a}return null},e}(s);i.IntersectRenderers=a,a.prototype.type=\"IntersectRenderers\";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.hit_test=function(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n],s=o.hit_test(t);null!==s&&i.push(s)}if(i.length>0){for(var a=i[0],l=0,h=i;l<h.length;l++){var c=h[l];a.update_through_union(c)}return a}return null},e}(s);i.UnionRenderers=l,l.prototype.type=\"UnionRenderers\"},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(21),a=t(32),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Selection\",this.define({indices:[o.Array,[]],line_indices:[o.Array,[]],multiline_indices:[o.Any,{}]}),this.internal({final:[o.Boolean],selected_glyphs:[o.Array,[]],get_view:[o.Any]})},e.prototype.initialize=function(){var e=this;t.prototype.initialize.call(this),this[\"0d\"]={glyph:null,indices:[],flag:!1,get_view:function(){return null}},this[\"2d\"]={indices:{}},this[\"1d\"]={indices:this.indices},this.get_view=function(){return null},this.connect(this.properties.indices.change,function(){return e[\"1d\"].indices=e.indices}),this.connect(this.properties.line_indices.change,function(){e[\"0d\"].indices=e.line_indices,0==e.line_indices.length?e[\"0d\"].flag=!1:e[\"0d\"].flag=!0}),this.connect(this.properties.selected_glyphs.change,function(){return e[\"0d\"].glyph=e.selected_glyph}),this.connect(this.properties.get_view.change,function(){return e[\"0d\"].get_view=e.get_view}),this.connect(this.properties.multiline_indices.change,function(){return e[\"2d\"].indices=e.multiline_indices})},Object.defineProperty(e.prototype,\"selected_glyph\",{get:function(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null},enumerable:!0,configurable:!0}),e.prototype.add_to_selected_glyphs=function(t){this.selected_glyphs.push(t)},e.prototype.update=function(t,e,i){this.final=e,i?this.update_through_union(t):(this.indices=t.indices,this.line_indices=t.line_indices,this.selected_glyphs=t.selected_glyphs,this.get_view=t.get_view,this.multiline_indices=t.multiline_indices)},e.prototype.clear=function(){this.final=!0,this.indices=[],this.line_indices=[],this.multiline_indices={},this.get_view=function(){return null},this.selected_glyphs=[]},e.prototype.is_empty=function(){return 0==this.indices.length&&0==this.line_indices.length},e.prototype.update_through_union=function(t){this.indices=s.union(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},e.prototype.update_through_intersection=function(t){this.indices=s.intersection(t.indices,this.indices),this.selected_glyphs=s.union(t.selected_glyphs,this.selected_glyphs),this.line_indices=s.union(t.line_indices,this.line_indices),this.get_view()||(this.get_view=t.get_view),this.multiline_indices=a.merge(t.multiline_indices,this.multiline_indices)},e}(r.Model);i.Selection=l,l.initClass()},function(t,e,i){var n=t(379),r=t(189),o=t(14),s=t(15),a=function(t){function e(e){var i=t.call(this,e)||this;return i.initialized=!1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"AjaxDataSource\",this.define({mode:[s.String,\"replace\"],content_type:[s.String,\"application/json\"],http_headers:[s.Any,{}],max_size:[s.Number],method:[s.String,\"POST\"],if_modified:[s.Bool,!1]})},e.prototype.destroy=function(){null!=this.interval&&clearInterval(this.interval),t.prototype.destroy.call(this)},e.prototype.setup=function(){var t=this;if(!this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval)){var e=function(){return t.get_data(t.mode,t.max_size,t.if_modified)};this.interval=setInterval(e,this.polling_interval)}},e.prototype.get_data=function(t,e,i){var n=this;void 0===e&&(e=0),void 0===i&&(i=!1);var r=this.prepare_request();r.addEventListener(\"load\",function(){return n.do_load(r,t,e)}),r.addEventListener(\"error\",function(){return n.do_error(r)}),r.send()},e.prototype.prepare_request=function(){var t=new XMLHttpRequest;t.open(this.method,this.data_url,!0),t.withCredentials=!1,t.setRequestHeader(\"Content-Type\",this.content_type);var e=this.http_headers;for(var i in e){var n=e[i];t.setRequestHeader(i,n)}return t},e.prototype.do_load=function(t,e,i){if(200===t.status){var n=JSON.parse(t.responseText);switch(e){case\"replace\":this.data=n;break;case\"append\":for(var r=this.data,o=0,s=this.columns();o<s.length;o++){var a=s[o],l=Array.from(r[a]),h=Array.from(n[a]);n[a]=l.concat(h).slice(-i)}this.data=n}}},e.prototype.do_error=function(t){o.logger.error(\"Failed to fetch JSON from \"+this.data_url+\" with code \"+t.status)},e}(r.RemoteDataSource);i.AjaxDataSource=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(181),a=t(21),l=t(185),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CDSView\",this.define({filters:[o.Array,[]],source:[o.Instance]}),this.internal({indices:[o.Array,[]],indices_map:[o.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.compute_indices()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.filters.change,function(){e.compute_indices(),e.change.emit()}),null!=this.source&&(null!=this.source.change&&this.connect(this.source.change,function(){return e.compute_indices()}),null!=this.source.streaming&&this.connect(this.source.streaming,function(){return e.compute_indices()}),null!=this.source.patching&&this.connect(this.source.patching,function(){return e.compute_indices()}))},e.prototype.compute_indices=function(){var t=this,e=this.filters.map(function(e){return e.compute_indices(t.source)});(e=function(){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i];null!=r&&t.push(r)}return t}()).length>0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=this.source.get_indices()),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){this.indices_map={};for(var t=0;t<this.indices.length;t++)this.indices_map[this.indices[t]]=t},e.prototype.convert_selection_from_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices[t]});return i.indices=n,i},e.prototype.convert_selection_to_subset=function(t){var e=this,i=new s.Selection;i.update_through_union(t);var n=t.indices.map(function(t){return e.indices_map[t]});return i.indices=n,i},e.prototype.convert_indices_from_subset=function(t){var e=this;return t.map(function(t){return e.indices[t]})},e}(r.Model);i.CDSView=h,h.initClass()},function(t,e,i){function n(t,e,i){if(_.isArray(t)){var n=t.concat(e);return null!=i&&n.length>i?n.slice(-i):n}if(_.isTypedArray(t)){var r=t.length+e.length;if(null!=i&&r>i){var o=r-i,s=t.length,n=void 0;t.length<i?(n=new t.constructor(i)).set(t,0):n=t;for(var a=o,l=s;a<l;a++)n[a-o]=n[a];for(var a=0,l=e.length;a<l;a++)n[a+(s-o)]=e[a];return n}var h=new t.constructor(e);return p.concat(t,h)}throw new Error(\"unsupported array types\")}function r(t,e){var i,n,r;return _.isNumber(t)?(i=t,r=t+1,n=1):(i=null!=t.start?t.start:0,r=null!=t.stop?t.stop:e,n=null!=t.step?t.step:1),[i,r,n]}function o(t,e,i){for(var n=new c.Set,o=!1,s=0,a=e;s<a.length;s++){var l=a[s],h=l[0],u=l[1],p=void 0,d=void 0;if(_.isArray(h)){var f=h[0];n.push(f),d=i[f],p=t[f]}else _.isNumber(h)?(u=[u],n.push(h)):o=!0,h=[0,0,h],d=[1,t.length],p=t;2===h.length&&(d=[1,d[0]],h=[h[0],0,h[1]]);for(var v=0,m=r(h[1],d[0]),g=m[0],y=m[1],b=m[2],x=r(h[2],d[1]),w=x[0],k=x[1],S=x[2],f=g;f<y;f+=b)for(var C=w;C<k;C+=S)o&&n.push(C),p[f*d[1]+C]=u[v],v++}return n}var s=t(379),a=t(185),l=t(8),h=t(15),c=t(29),u=t(36),_=t(44),p=t(43),d=t(32);i.stream_to_column=n,i.slice=r,i.patch_to_column=o;var f=function(t){function e(e){return t.call(this,e)||this}return s.__extends(e,t),e.initClass=function(){this.prototype.type=\"ColumnDataSource\",this.define({data:[h.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),e=u.decode_column_data(this.data),this.data=e[0],this._shapes=e[1];var e},e.prototype.attributes_as_json=function(t,i){void 0===t&&(t=!0),void 0===i&&(i=e._value_to_json);for(var n={},r=this.serializable_attributes(),o=0,s=d.keys(r);o<s.length;o++){var a=s[o],l=r[a];\"data\"===a&&(l=u.encode_column_data(l,this._shapes)),t?n[a]=l:a in this._set_after_defaults&&(n[a]=l)}return i(\"attributes\",n,this)},e._value_to_json=function(t,e,i){return _.isObject(e)&&\"data\"===t?u.encode_column_data(e,i._shapes):l.HasProps._value_to_json(t,e,i)},e.prototype.stream=function(t,e){var i=this.data;for(var r in t)i[r]=n(i[r],t[r],e);this.setv({data:i},{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e=this.data,i=new c.Set;for(var n in t){var r=t[n];i=i.union(o(e[n],r,this._shapes[n]))}this.setv({data:e},{silent:!0}),this.patching.emit(i.values)},e}(a.ColumnarDataSource);i.ColumnDataSource=f,f.initClass()},function(t,e,i){var n=t(379),r=t(186),o=t(19),s=t(14),a=t(17),l=t(15),h=t(44),c=t(21),u=t(32),_=t(181),p=t(180),d=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.prototype.get_array=function(t){var e=this.data[t];return null==e?this.data[t]=e=[]:h.isArray(e)||(this.data[t]=e=Array.from(e)),e},e.initClass=function(){this.prototype.type=\"ColumnarDataSource\",this.define({column_names:[l.Array,[]],selection_policy:[l.Instance]}),this.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Instance,function(){return new _.Selection}],_shapes:[l.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._select=new o.Signal0(this,\"select\"),this.inspect=new o.Signal(this,\"inspect\"),this.streaming=new o.Signal0(this,\"streaming\"),this.patching=new o.Signal(this,\"patching\"),this.selection_policy||(this.selection_policy=new p.UnionRenderers)},e.prototype.get_column=function(t){var e=this.data[t];return null!=e?e:null},e.prototype.columns=function(){return u.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e=c.uniq(u.values(this.data).map(function(t){return t.length}));switch(e.length){case 0:return null;case 1:return e[0];default:var i=\"data source has columns of inconsistent lengths\";if(t)return s.logger.warn(i),e.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t=this.get_length();return c.range(0,null!=t?t:1)},e}(r.DataSource);i.ColumnarDataSource=d,d.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(15),s=t(44),a=t(181),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DataSource\",this.define({selected:[o.Instance],callback:[o.Any]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.selected||(this.selected=new a.Selection)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.selected.change,function(){var t=e.callback;null!=t&&(s.isFunction(t)?t(e):t.execute(e))})},e}(r.Model);i.DataSource=l,l.initClass()},function(t,e,i){var n=t(379),r=t(185),o=t(14),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GeoJSONDataSource\",this.define({geojson:[s.Any]}),this.internal({data:[s.Any,{}]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._update_data()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.geojson.change,function(){return e._update_data()})},e.prototype._update_data=function(){this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){return a.range(0,t).map(function(t){return[]})},e.prototype._get_new_nan_array=function(t){return a.range(0,t).map(function(t){return NaN})},e.prototype._add_properties=function(t,e,i,n){var r=t.properties||{};for(var o in r)e.hasOwnProperty(o)||(e[o]=this._get_new_nan_array(n)),e[o][i]=r[o]},e.prototype._add_geometry=function(t,e,i){function n(t){return null!=t?t:NaN}function r(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)}switch(t.type){case\"Point\":var s=t.coordinates,a=s[0],l=s[1],h=s[2];e.x[i]=a,e.y[i]=l,e.z[i]=n(h);break;case\"LineString\":for(var c=t.coordinates,u=0;u<c.length;u++){var _=c[u],a=_[0],l=_[1],h=_[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case\"Polygon\":t.coordinates.length>1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\");for(var p=t.coordinates[0],u=0;u<p.length;u++){var d=p[u],a=d[0],l=d[1],h=d[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case\"MultiPoint\":o.logger.warn(\"MultiPoint not supported in Bokeh\");break;case\"MultiLineString\":for(var c=t.coordinates.reduce(r),u=0;u<c.length;u++){var f=c[u],a=f[0],l=f[1],h=f[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;case\"MultiPolygon\":for(var v=[],m=0,g=t.coordinates;m<g.length;m++){var y=g[m];y.length>1&&o.logger.warn(\"Bokeh does not support Polygons with holes in, only exterior ring used.\"),v.push(y[0])}for(var c=v.reduce(r),u=0;u<c.length;u++){var b=c[u],a=b[0],l=b[1],h=b[2];e.xs[i][u]=a,e.ys[i][u]=l,e.zs[i][u]=n(h)}break;default:throw new Error(\"Invalid GeoJSON geometry type: \"+t.type)}},e.prototype.geojson_to_column_data=function(){var t,e=JSON.parse(this.geojson);switch(e.type){case\"GeometryCollection\":if(null==e.geometries)throw new Error(\"No geometries found in GeometryCollection\");if(0===e.geometries.length)throw new Error(\"geojson.geometries must have one or more items\");t=e.geometries;break;case\"FeatureCollection\":if(null==e.features)throw new Error(\"No features found in FeaturesCollection\");if(0==e.features.length)throw new Error(\"geojson.features must have one or more items\");t=e.features;break;default:throw new Error(\"Bokeh only supports type GeometryCollection and FeatureCollection at top level\")}for(var i=0,n=0,r=t;n<r.length;n++){var o=r[n],s=\"Feature\"===o.type?o.geometry:o;\"GeometryCollection\"==s.type?i+=s.geometries.length:i+=1}for(var a={x:this._get_new_nan_array(i),y:this._get_new_nan_array(i),z:this._get_new_nan_array(i),xs:this._get_new_list_array(i),ys:this._get_new_list_array(i),zs:this._get_new_list_array(i)},l=0,h=0,c=t;h<c.length;h++){var o=c[h],s=\"Feature\"==o.type?o.geometry:o;if(\"GeometryCollection\"==s.type)for(var u=0,_=s.geometries;u<_.length;u++){var p=_[u];this._add_geometry(p,a,l),\"Feature\"===o.type&&this._add_properties(o,a,l,i),l+=1}else this._add_geometry(s,a,l),\"Feature\"===o.type&&this._add_properties(o,a,l,i),l+=1}return a},e}(r.ColumnarDataSource);i.GeoJSONDataSource=l,l.initClass()},function(t,e,i){var n=t(182);i.AjaxDataSource=n.AjaxDataSource;var r=t(184);i.ColumnDataSource=r.ColumnDataSource;var o=t(185);i.ColumnarDataSource=o.ColumnarDataSource;var s=t(183);i.CDSView=s.CDSView;var a=t(186);i.DataSource=a.DataSource;var l=t(187);i.GeoJSONDataSource=l.GeoJSONDataSource;var h=t(189);i.RemoteDataSource=h.RemoteDataSource},function(t,e,i){var n=t(379),r=t(184),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"RemoteDataSource\",this.define({data_url:[o.String],polling_interval:[o.Number]})},e}(r.ColumnDataSource);i.RemoteDataSource=s,s.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=t(21),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"AdaptiveTicker\",this.define({base:[o.Number,10],mantissas:[o.Array,[1,2,5]],min_interval:[o.Number,0],max_interval:[o.Number]})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=s.nth(this.mantissas,-1)/this.base,i=s.nth(this.mantissas,0)*this.base;this.extended_mantissas=[e].concat(this.mantissas,[i]),this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()},e.prototype.get_interval=function(t,e,i){var n=e-t,r=this.get_ideal_interval(t,e,i),o=Math.floor(function(t,e){void 0===e&&(e=Math.E);return Math.log(t)/Math.log(e)}(r/this.base_factor,this.base)),a=Math.pow(this.base,o)*this.base_factor,l=this.extended_mantissas,h=l.map(function(t){return Math.abs(i-n/(t*a))}),c=l[s.argmin(h)],u=c*a;return function(t,e,i){return Math.max(e,Math.min(i,t))}(u,this.get_min_interval(),this.get_max_interval())},e}(r.ContinuousTicker);i.AdaptiveTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(190),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BasicTicker\"},e}(r.AdaptiveTicker);i.BasicTicker=o,o.initClass()},function(t,e,i){var n=t(379),r=t(203),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CategoricalTicker\"},e.prototype.get_ticks=function(t,e,i,n,r){var o=this._collect(i.factors,i,t,e),s=this._collect(i.tops||[],i,t,e),a=this._collect(i.mids||[],i,t,e);return{major:o,minor:[],tops:s,mids:a}},e.prototype._collect=function(t,e,i,n){for(var r=[],o=0,s=t;o<s.length;o++){var a=s[o],l=e.synthetic(a);l>i&&l<n&&r.push(a)}return r},e}(r.Ticker);i.CategoricalTicker=o,o.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=t(21),a=t(32),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CompositeTicker\",this.define({tickers:[o.Array,[]]})},Object.defineProperty(e.prototype,\"min_intervals\",{get:function(){return this.tickers.map(function(t){return t.get_min_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max_intervals\",{get:function(){return this.tickers.map(function(t){return t.get_max_interval()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"min_interval\",{get:function(){return this.min_intervals[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max_interval\",{get:function(){return this.max_intervals[0]},enumerable:!0,configurable:!0}),e.prototype.get_best_ticker=function(t,e,i){var n,r=e-t,o=this.get_ideal_interval(t,e,i),l=[s.sortedIndex(this.min_intervals,o)-1,s.sortedIndex(this.max_intervals,o)],h=[this.min_intervals[l[0]],this.max_intervals[l[1]]],c=h.map(function(t){return Math.abs(i-r/t)});if(a.isEmpty(c.filter(function(t){return!isNaN(t)})))n=this.tickers[0];else{var u=s.argmin(c),_=l[u];n=this.tickers[_]}return n},e.prototype.get_interval=function(t,e,i){var n=this.get_best_ticker(t,e,i);return n.get_interval(t,e,i)},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=this.get_best_ticker(t,e,n);return r.get_ticks_no_defaults(t,e,i,n)},e}(r.ContinuousTicker);i.CompositeTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(203),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ContinuousTicker\",this.define({num_minor_ticks:[o.Number,5],desired_num_ticks:[o.Number,6]})},e.prototype.get_ticks=function(t,e,i,n,r){return this.get_ticks_no_defaults(t,e,n,this.desired_num_ticks)},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=this.get_interval(t,e,n),o=Math.floor(t/r),l=Math.ceil(e/r),h=(a.isStrictNaN(o)||a.isStrictNaN(l)?[]:s.range(o,l+1)).map(function(t){return t*r}).filter(function(i){return t<=i&&i<=e}),c=this.num_minor_ticks,u=[];if(c>0&&h.length>0){for(var _=r/c,p=s.range(0,c).map(function(t){return t*_}),d=0,f=p.slice(1);d<f.length;d++){var v=f[d],m=h[0]-v;t<=m&&m<=e&&u.push(m)}for(var g=0,y=h;g<y.length;g++)for(var b=y[g],x=0,w=p;x<w.length;x++){var v=w[x],m=b+v;t<=m&&m<=e&&u.push(m)}}return{major:h,minor:u}},e.prototype.get_min_interval=function(){return this.min_interval},e.prototype.get_max_interval=function(){return null!=this.max_interval?this.max_interval:1/0},e.prototype.get_ideal_interval=function(t,e,i){var n=e-t;return n/i},e}(r.Ticker);i.ContinuousTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(21),o=t(190),s=t(193),a=t(196),l=t(201),h=t(205),c=t(204),u=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DatetimeTicker\",this.override({num_minor_ticks:0,tickers:function(){return[new o.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*c.ONE_MILLI,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:c.ONE_SECOND,max_interval:30*c.ONE_MINUTE,num_minor_ticks:0}),new o.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:c.ONE_HOUR,max_interval:12*c.ONE_HOUR,num_minor_ticks:0}),new a.DaysTicker({days:r.range(1,32)}),new a.DaysTicker({days:r.range(1,31,3)}),new a.DaysTicker({days:[1,8,15,22]}),new a.DaysTicker({days:[1,15]}),new l.MonthsTicker({months:r.range(0,12,1)}),new l.MonthsTicker({months:r.range(0,12,2)}),new l.MonthsTicker({months:r.range(0,12,4)}),new l.MonthsTicker({months:r.range(0,12,6)}),new h.YearsTicker({})]}})},e}(s.CompositeTicker);i.DatetimeTicker=u,u.initClass()},function(t,e,i){var n=t(379),r=t(202),o=t(204),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"DaysTicker\",this.define({days:[s.Array,[]]}),this.override({num_minor_ticks:0})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this.days;e.length>1?this.interval=(e[1]-e[0])*o.ONE_DAY:this.interval=31*o.ONE_DAY},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=function(t,e){var i=o.last_month_no_later_than(new Date(t)),n=o.last_month_no_later_than(new Date(e));n.setUTCMonth(n.getUTCMonth()+1);var r=[],s=i;for(;r.push(o.copy_date(s)),s.setUTCMonth(s.getUTCMonth()+1),!(s>n););return r}(t,e),s=this.days,l=this.interval,h=a.concat(r.map(function(t){return function(t,e){for(var i=[],n=0,r=s;n<r.length;n++){var a=r[n],l=o.copy_date(t);l.setUTCDate(a);var h=new Date(l.getTime()+e/2);h.getUTCMonth()==t.getUTCMonth()&&i.push(l)}return i}(t,l)})),c=h.map(function(t){return t.getTime()}),u=c.filter(function(i){return t<=i&&i<=e});return{major:u,minor:[]}},e}(r.SingleIntervalTicker);i.DaysTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=function(t){function e(e){var i=t.call(this,e)||this;return i.min_interval=0,i.max_interval=0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"FixedTicker\",this.define({ticks:[o.Array,[]]})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){return{major:this.ticks,minor:[]}},e.prototype.get_interval=function(t,e,i){return 0},e}(r.ContinuousTicker);i.FixedTicker=s,s.initClass()},function(t,e,i){var n=t(190);i.AdaptiveTicker=n.AdaptiveTicker;var r=t(191);i.BasicTicker=r.BasicTicker;var o=t(192);i.CategoricalTicker=o.CategoricalTicker;var s=t(193);i.CompositeTicker=s.CompositeTicker;var a=t(194);i.ContinuousTicker=a.ContinuousTicker;var l=t(195);i.DatetimeTicker=l.DatetimeTicker;var h=t(196);i.DaysTicker=h.DaysTicker;var c=t(197);i.FixedTicker=c.FixedTicker;var u=t(199);i.LogTicker=u.LogTicker;var _=t(200);i.MercatorTicker=_.MercatorTicker;var p=t(201);i.MonthsTicker=p.MonthsTicker;var d=t(202);i.SingleIntervalTicker=d.SingleIntervalTicker;var f=t(203);i.Ticker=f.Ticker;var v=t(205);i.YearsTicker=v.YearsTicker},function(t,e,i){var n=t(379),r=t(21),o=t(190),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LogTicker\",this.override({mantissas:[1,5]})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var o,s=this.num_minor_ticks,a=[],l=this.base,h=Math.log(t)/Math.log(l),c=Math.log(e)/Math.log(l),u=c-h;if(isFinite(u))if(u<2){var _=this.get_interval(t,e,n),p=Math.floor(t/_),d=Math.ceil(e/_);if(o=r.range(p,d+1).filter(function(t){return 0!=t}).map(function(t){return t*_}).filter(function(i){return t<=i&&i<=e}),s>0&&o.length>0){for(var f=_/s,v=r.range(0,s).map(function(t){return t*f}),m=0,g=v.slice(1);m<g.length;m++){var y=g[m];a.push(o[0]-y)}for(var b=0,x=o;b<x.length;b++)for(var w=x[b],k=0,S=v;k<S.length;k++){var y=S[k];a.push(w+y)}}}else{var C=Math.ceil(.999999*h),T=Math.floor(1.000001*c),A=Math.ceil((T-C)/9);if(o=r.range(C,T+1,A).map(function(t){return Math.pow(l,t)}).filter(function(i){return t<=i&&i<=e}),s>0&&o.length>0){for(var E=Math.pow(l,A)/s,v=r.range(1,s+1).map(function(t){return t*E}),M=0,O=v;M<O.length;M++){var y=O[M];a.push(o[0]/y)}a.push(o[0]);for(var z=0,P=o;z<P.length;z++)for(var w=P[z],j=0,N=v;j<N.length;j++){var y=N[j];a.push(w*y)}}}else o=[];return{major:o,minor:a}},e}(o.AdaptiveTicker);i.LogTicker=s,s.initClass()},function(t,e,i){var n=t(379),r=t(191),o=t(15),s=t(33),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MercatorTicker\",this.define({dimension:[o.LatLon]})},e.prototype.get_ticks_no_defaults=function(e,i,n,r){if(null==this.dimension)throw new Error(\"MercatorTicker.dimension not configured\");C=s.clip_mercator(e,i,this.dimension),e=C[0],i=C[1];var o,a,l;\"lon\"===this.dimension?(T=s.wgs84_mercator.inverse([e,n]),o=T[0],l=T[1],A=s.wgs84_mercator.inverse([i,n]),a=A[0],l=A[1]):(E=s.wgs84_mercator.inverse([n,e]),l=E[0],o=E[1],M=s.wgs84_mercator.inverse([n,i]),l=M[0],a=M[1]);var h=t.prototype.get_ticks_no_defaults.call(this,o,a,n,r),c=[],u=[];if(\"lon\"===this.dimension){for(var _=0,p=h.major;_<p.length;_++){var d=p[_];if(s.in_bounds(d,\"lon\")){var f=s.wgs84_mercator.forward([d,l])[0];c.push(f)}}for(var v=0,m=h.minor;v<m.length;v++){var d=m[v];if(s.in_bounds(d,\"lon\")){var f=s.wgs84_mercator.forward([d,l])[0];u.push(f)}}}else{for(var g=0,y=h.major;g<y.length;g++){var d=y[g];if(s.in_bounds(d,\"lat\")){var b=s.wgs84_mercator.forward([l,d]),x=b[1];c.push(x)}}for(var w=0,k=h.minor;w<k.length;w++){var d=k[w];if(s.in_bounds(d,\"lat\")){var S=s.wgs84_mercator.forward([l,d]),x=S[1];u.push(x)}}}return{major:c,minor:u};var C,T,A,E,M},e}(r.BasicTicker);i.MercatorTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(202),o=t(204),s=t(15),a=t(21),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MonthsTicker\",this.define({months:[s.Array,[]]})},e.prototype.initialize=function(){t.prototype.initialize.call(this);var e=this.months;e.length>1?this.interval=(e[1]-e[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=function(t,e){var i=o.last_year_no_later_than(new Date(t)),n=o.last_year_no_later_than(new Date(e));n.setUTCFullYear(n.getUTCFullYear()+1);var r=[],s=i;for(;r.push(o.copy_date(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>n););return r}(t,e),s=this.months,l=a.concat(r.map(function(t){return s.map(function(e){var i=o.copy_date(t);return i.setUTCMonth(e),i})})),h=l.map(function(t){return t.getTime()}),c=h.filter(function(i){return t<=i&&i<=e});return{major:c,minor:[]}},e}(r.SingleIntervalTicker);i.MonthsTicker=l,l.initClass()},function(t,e,i){var n=t(379),r=t(194),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"SingleIntervalTicker\",this.define({interval:[o.Number]})},e.prototype.get_interval=function(t,e,i){return this.interval},Object.defineProperty(e.prototype,\"min_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"max_interval\",{get:function(){return this.interval},enumerable:!0,configurable:!0}),e}(r.ContinuousTicker);i.SingleIntervalTicker=s,s.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Ticker\"},e}(r.Model);i.Ticker=o,o.initClass()},function(t,e,i){function n(t){return new Date(t.getTime())}function r(t){var e=n(t);return e.setUTCDate(1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}i.ONE_MILLI=1,i.ONE_SECOND=1e3,i.ONE_MINUTE=60*i.ONE_SECOND,i.ONE_HOUR=60*i.ONE_MINUTE,i.ONE_DAY=24*i.ONE_HOUR,i.ONE_MONTH=30*i.ONE_DAY,i.ONE_YEAR=365*i.ONE_DAY,i.copy_date=n,i.last_month_no_later_than=r,i.last_year_no_later_than=function(t){var e=r(t);return e.setUTCMonth(0),e}},function(t,e,i){var n=t(379),r=t(191),o=t(202),s=t(204),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"YearsTicker\"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.interval=s.ONE_YEAR,this.basic_ticker=new r.BasicTicker({num_minor_ticks:0})},e.prototype.get_ticks_no_defaults=function(t,e,i,n){var r=s.last_year_no_later_than(new Date(t)).getUTCFullYear(),o=s.last_year_no_later_than(new Date(e)).getUTCFullYear(),a=this.basic_ticker.get_ticks_no_defaults(r,o,i,n).major,l=a.map(function(t){return Date.UTC(t,0,1)}),h=l.filter(function(i){return t<=i&&i<=e});return{major:h,minor:[]}},e}(o.SingleIntervalTicker);i.YearsTicker=a,a.initClass()},function(t,e,i){var n=t(379),r=t(209),o=t(15),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BBoxTileSource\",this.define({use_latlon:[o.Bool,!1]})},e.prototype.get_image_url=function(t,e,i){var n,r,o,s,a=this.string_lookup_replace(this.url,this.extra_url_vars);return this.use_latlon?(l=this.get_tile_geographic_bounds(t,e,i),r=l[0],s=l[1],n=l[2],o=l[3]):(h=this.get_tile_meter_bounds(t,e,i),r=h[0],s=h[1],n=h[2],o=h[3]),a.replace(\"{XMIN}\",r.toString()).replace(\"{YMIN}\",s.toString()).replace(\"{XMAX}\",n.toString()).replace(\"{YMAX}\",o.toString());var l,h},e}(r.MercatorTileSource);i.BBoxTileSource=s,s.initClass()},function(t,e,i){var n=t(44),r=function(){function t(){this.images=[]}return t.prototype.pop=function(){var t=this.images.pop();return null!=t?t:new Image},t.prototype.push=function(t){if(!(this.images.length>50)){n.isArray(t)?(e=this.images).push.apply(e,t):this.images.push(t);var e}},t}();i.ImagePool=r},function(t,e,i){var n=t(206);i.BBoxTileSource=n.BBoxTileSource;var r=t(209);i.MercatorTileSource=r.MercatorTileSource;var o=t(210);i.QUADKEYTileSource=o.QUADKEYTileSource;var s=t(211);i.TileRenderer=s.TileRenderer;var a=t(212);i.TileSource=a.TileSource;var l=t(214);i.TMSTileSource=l.TMSTileSource;var h=t(215);i.WMTSTileSource=h.WMTSTileSource},function(t,e,i){var n=t(379),r=t(212),o=t(15),s=t(21),a=t(213),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"MercatorTileSource\",this.define({snap_to_zoom:[o.Bool,!1],wrap_around:[o.Bool,!0]}),this.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},e.prototype.initialize=function(){var e=this;t.prototype.initialize.call(this),this._resolutions=s.range(this.min_zoom,this.max_zoom+1).map(function(t){return e.get_resolution(t)})},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,i){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,i)))&&!(e<0||e>=Math.pow(2,i))},e.prototype.parent_by_tile_xyz=function(t,e,i){var n=this.tile_xyz_to_quadkey(t,e,i),r=n.substring(0,n.length-1);return this.quadkey_to_tile_xyz(r)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e;return[n,r]},e.prototype.get_level_by_extent=function(t,e,i){for(var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=0,a=0,l=this._resolutions;a<l.length;a++){var h=l[a];if(o>h){if(0===s)return 0;if(s>0)return s-1}s+=1}throw new Error(\"unreachable code\")},e.prototype.get_closest_level_by_extent=function(t,e,i){var n=(t[2]-t[0])/i,r=(t[3]-t[1])/e,o=Math.max(n,r),s=this._resolutions.reduce(function(t,e){return Math.abs(e-o)<Math.abs(t-o)?e:t});return this._resolutions.indexOf(s)},e.prototype.snap_to_zoom_level=function(t,e,i,n){var r=t[0],o=t[1],s=t[2],a=t[3],l=this._resolutions[n],h=i*l,c=e*l;if(!this.snap_to_zoom){var u=(s-r)/h,_=(a-o)/c;u>_?(h=s-r,c*=u):(h*=_,c=a-o)}var p=(h-(s-r))/2,d=(c-(a-o))/2;return[r-p,o-d,s+p,a+d]},e.prototype.tms_to_wmts=function(t,e,i){\"Note this works both ways\";return[t,Math.pow(2,i)-1-e,i]},e.prototype.wmts_to_tms=function(t,e,i){\"Note this works both ways\";return[t,Math.pow(2,i)-1-e,i]},e.prototype.pixels_to_meters=function(t,e,i){var n=this.get_resolution(i),r=t*n-this.x_origin_offset,o=e*n-this.y_origin_offset;return[r,o]},e.prototype.meters_to_pixels=function(t,e,i){var n=this.get_resolution(i),r=(t+this.x_origin_offset)/n,o=(e+this.y_origin_offset)/n;return[r,o]},e.prototype.pixels_to_tile=function(t,e){var i=Math.ceil(t/this.tile_size);i=0===i?i:i-1;var n=Math.max(Math.ceil(e/this.tile_size)-1,0);return[i,n]},e.prototype.pixels_to_raster=function(t,e,i){var n=this.tile_size<<i;return[t,n-e]},e.prototype.meters_to_tile=function(t,e,i){var n=this.meters_to_pixels(t,e,i),r=n[0],o=n[1];return this.pixels_to_tile(r,o)},e.prototype.get_tile_meter_bounds=function(t,e,i){var n=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,i),r=n[0],o=n[1],s=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,i),a=s[0],l=s[1];return[r,o,a,l]},e.prototype.get_tile_geographic_bounds=function(t,e,i){var n=this.get_tile_meter_bounds(t,e,i),r=a.meters_extent_to_geographic(n),o=r[0],s=r[1],l=r[2],h=r[3];return[o,s,l,h]},e.prototype.get_tiles_by_extent=function(t,e,i){void 0===i&&(i=1);var n=t[0],r=t[1],o=t[2],s=t[3],a=this.meters_to_tile(n,r,e),l=a[0],h=a[1],c=this.meters_to_tile(o,s,e),u=c[0],_=c[1];l-=i,h-=i,u+=i;for(var p=[],d=_+=i;d>=h;d--)for(var f=l;f<=u;f++)this.is_valid_tile(f,d,e)&&p.push([f,d,e,this.get_tile_meter_bounds(f,d,e)]);return this.sort_tiles_from_center(p,[l,h,u,_]),p},e.prototype.quadkey_to_tile_xyz=function(t){for(var e=0,i=0,n=t.length,r=n;r>0;r--){var o=t.charAt(n-r),s=1<<r-1;switch(o){case\"0\":continue;case\"1\":e|=s;break;case\"2\":i|=s;break;case\"3\":e|=s,i|=s;break;default:throw new TypeError(\"Invalid Quadkey: \"+t)}}return[e,i,n]},e.prototype.tile_xyz_to_quadkey=function(t,e,i){for(var n=\"\",r=i;r>0;r--){var o=1<<r-1,s=0;0!=(t&o)&&(s+=1),0!=(e&o)&&(s+=2),n+=s.toString()}return n},e.prototype.children_by_tile_xyz=function(t,e,i){for(var n=this.tile_xyz_to_quadkey(t,e,i),r=[],o=0;o<=3;o++){var s=this.quadkey_to_tile_xyz(n+o.toString()),a=s[0],l=s[1],h=s[2],c=this.get_tile_meter_bounds(a,l,h);r.push([a,l,h,c])}return r},e.prototype.get_closest_parent_by_tile_xyz=function(t,e,i){var n=this.calculate_world_x_by_tile_xyz(t,e,i);o=this.normalize_xyz(t,e,i),t=o[0],e=o[1],i=o[2];for(var r=this.tile_xyz_to_quadkey(t,e,i);r.length>0;)if(r=r.substring(0,r.length-1),s=this.quadkey_to_tile_xyz(r),t=s[0],e=s[1],i=s[2],a=this.denormalize_xyz(t,e,i,n),t=a[0],e=a[1],i=a[2],this.tile_xyz_to_key(t,e,i)in this.tiles)return[t,e,i];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,i){if(this.wrap_around){var n=Math.pow(2,i);return[(t%n+n)%n,e,i]}return[t,e,i]},e.prototype.denormalize_xyz=function(t,e,i,n){return[t+n*Math.pow(2,i),e,i]},e.prototype.denormalize_meters=function(t,e,i,n){return[t+2*n*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,i){return Math.floor(t/Math.pow(2,i))},e}(r.TileSource);i.MercatorTileSource=l,l.initClass()},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"QUADKEYTileSource\"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2],l=this.tile_xyz_to_quadkey(o,s,a);return n.replace(\"{Q}\",l)},e}(r.MercatorTileSource);i.QUADKEYTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(207),o=t(215),s=t(173),a=t(5),l=t(15),h=t(21),c=t(44),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},Object.defineProperty(e.prototype,\"map_plot\",{get:function(){return this.plot_model.plot},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"map_canvas\",{get:function(){return this.plot_view.canvas_view.ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"map_frame\",{get:function(){return this.plot_model.frame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"x_range\",{get:function(){return this.map_plot.x_range},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"y_range\",{get:function(){return this.map_plot.y_range},enumerable:!0,configurable:!0}),e.prototype._set_data=function(){this.pool=new r.ImagePool,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t=this.model.tile_source.attribution;if(c.isString(t)&&t.length>0){if(null==this.attributionEl){var e=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,i=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,n=this.map_frame._width.value;this.attributionEl=a.div({class:\"bk-tile-attribution\",style:{position:\"absolute\",bottom:i+\"px\",right:e+\"px\",\"max-width\":n+\"px\",padding:\"2px\",\"background-color\":\"rgba(255,255,255,0.8)\",\"font-size\":\"9pt\",\"font-family\":\"sans-serif\"}});var r=this.plot_view.canvas_view.events_el;r.appendChild(this.attributionEl)}this.attributionEl.innerHTML=t}},e.prototype._map_data=function(){this.initial_extent=this.get_extent();var t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this._add_attribution()},e.prototype._on_tile_load=function(t,e){t.img=e.target,t.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t,e){t.img=e.target,t.loaded=!0,t.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){t.finished=!0},e.prototype._create_tile=function(t,e,i,n,r){void 0===r&&(r=!1);var o=this.model.tile_source.normalize_xyz(t,e,i),s=o[0],a=o[1],l=o[2],h=this.pool.pop(),c={img:h,tile_coords:[t,e,i],normalized_coords:[s,a,l],quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,i),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,i),bounds:n,loaded:!1,finished:!1,x_coord:n[0],y_coord:n[3]};h.onload=r?this._on_tile_cache_load.bind(this,c):this._on_tile_load.bind(this,c),h.onerror=this._on_tile_error.bind(this,c),h.alt=\"\",h.src=this.model.tile_source.get_image_url(s,a,l),this.model.tile_source.tiles[c.cache_key]=c,this._tiles.push(c)},e.prototype._enforce_aspect_ratio=function(){if(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value){var t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame._height.value,this.map_frame._width.value,e);return this.x_range.setv({start:i[0],end:i[2]}),this.y_range.setv({start:i[1],end:i[3]}),this.extent=i,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0}return!1},e.prototype.has_finished=function(){if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(var e=0,i=this._tiles;e<i.length;e++){var n=i[e];if(!n.finished)return!1}return!0},e.prototype.render=function(){null==this.map_initialized&&(this._set_data(),this._map_data(),this.map_initialized=!0),this._enforce_aspect_ratio()||(this._update(),null!=this.prefetch_timer&&clearTimeout(this.prefetch_timer),this.prefetch_timer=setTimeout(this._prefetch_tiles.bind(this),500),this.has_finished()&&this.notify_finished())},e.prototype._draw_tile=function(t){var e=this.model.tile_source.tiles[t];if(null!=e){var i=this.plot_view.map_to_screen([e.bounds[0]],[e.bounds[3]]),n=i[0][0],r=i[1][0],o=this.plot_view.map_to_screen([e.bounds[2]],[e.bounds[1]]),s=o[0][0],a=o[1][0],l=s-n,h=a-r,c=n,u=r;this.map_canvas.drawImage(e.img,c,u,l,h)}},e.prototype._set_rect=function(){var t=this.plot_model.plot.properties.outline_line_width.value(),e=this.map_frame._left.value+t/2,i=this.map_frame._top.value+t/2,n=this.map_frame._width.value-t,r=this.map_frame._height.value-t;this.map_canvas.rect(e,i,n,r),this.map_canvas.clip()},e.prototype._render_tiles=function(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(var e=0,i=t;e<i.length;e++){var n=i[e];this._draw_tile(n)}this.map_canvas.restore()},e.prototype._prefetch_tiles=function(){for(var t=this.model.tile_source,e=this.get_extent(),i=this.map_frame._height.value,n=this.map_frame._width.value,r=this.model.tile_source.get_level_by_extent(e,i,n),o=this.model.tile_source.get_tiles_by_extent(e,r),s=0,a=Math.min(10,o.length);s<a;s++)for(var l=o[s],h=l[0],c=l[1],u=l[2],_=this.model.tile_source.children_by_tile_xyz(h,c,u),p=0,d=_;p<d.length;p++){var f=d[p],v=f[0],m=f[1],g=f[2],y=f[3];t.tile_xyz_to_key(v,m,g)in t.tiles||this._create_tile(v,m,g,y,!0)}},e.prototype._fetch_tiles=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e],r=n[0],o=n[1],s=n[2],a=n[3];this._create_tile(r,o,s,a)}},e.prototype._update=function(){var t=this,e=this.model.tile_source,i=e.min_zoom,n=e.max_zoom,r=this.get_extent(),o=this.extent[2]-this.extent[0]<r[2]-r[0],s=this.map_frame._height.value,a=this.map_frame._width.value,l=e.get_level_by_extent(r,s,a),c=!1;l<i?(r=this.extent,l=i,c=!0):l>n&&(r=this.extent,l=n,c=!0),c&&(this.x_range.setv({x_range:{start:r[0],end:r[2]}}),this.y_range.setv({start:r[1],end:r[3]}),this.extent=r),this.extent=r;for(var u=e.get_tiles_by_extent(r,l),_=[],p=[],d=[],f=[],v=0,m=u;v<m.length;v++){var g=m[v],y=g[0],b=g[1],x=g[2],w=e.tile_xyz_to_key(y,b,x),k=e.tiles[w];if(null!=k&&k.loaded)p.push(w);else if(this.model.render_parents){var S=e.get_closest_parent_by_tile_xyz(y,b,x),C=S[0],T=S[1],A=S[2],E=e.tile_xyz_to_key(C,T,A),M=e.tiles[E];if(null!=M&&M.loaded&&!h.includes(d,E)&&d.push(E),o)for(var O=e.children_by_tile_xyz(y,b,x),z=0,P=O;z<P.length;z++){var j=P[z],N=j[0],F=j[1],D=j[2],I=e.tile_xyz_to_key(N,F,D);I in e.tiles&&f.push(I)}}null==k&&_.push(g)}this._render_tiles(d),this._render_tiles(f),this._render_tiles(p),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout(function(){return t._fetch_tiles(_)},65)},e}(s.RendererView);i.TileRendererView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TileRenderer\",this.prototype.default_view=u,this.define({alpha:[l.Number,1],x_range_name:[l.String,\"default\"],y_range_name:[l.String,\"default\"],tile_source:[l.Instance,function(){return new o.WMTSTileSource}],render_parents:[l.Bool,!0]}),this.override({level:\"underlay\"})},e}(s.Renderer);i.TileRenderer=_,_.initClass()},function(t,e,i){var n=t(379),r=t(53),o=t(207),s=t(15),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TileSource\",this.define({url:[s.String,\"\"],tile_size:[s.Number,256],max_zoom:[s.Number,30],min_zoom:[s.Number,0],extra_url_vars:[s.Any,{}],attribution:[s.String,\"\"],x_origin_offset:[s.Number],y_origin_offset:[s.Number],initial_resolution:[s.Number]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this.tiles={},this.pool=new o.ImagePool,this._normalize_case()},e.prototype.string_lookup_replace=function(t,e){var i=t;for(var n in e){var r=e[n];i=i.replace(\"{\"+n+\"}\",r)}return i},e.prototype._normalize_case=function(){var t=this.url.replace(\"{x}\",\"{X}\").replace(\"{y}\",\"{Y}\").replace(\"{z}\",\"{Z}\").replace(\"{q}\",\"{Q}\").replace(\"{xmin}\",\"{XMIN}\").replace(\"{ymin}\",\"{YMIN}\").replace(\"{xmax}\",\"{XMAX}\").replace(\"{ymax}\",\"{YMAX}\");this.url=t},e.prototype.tile_xyz_to_key=function(t,e,i){return t+\":\"+e+\":\"+i},e.prototype.key_to_tile_xyz=function(t){var e=t.split(\":\").map(function(t){return parseInt(t)}),i=e[0],n=e[1],r=e[2];return[i,n,r]},e.prototype.sort_tiles_from_center=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=(r-i)/2+i,a=(o-n)/2+n;t.sort(function(t,e){var i=Math.sqrt(Math.pow(s-t[0],2)+Math.pow(a-t[1],2)),n=Math.sqrt(Math.pow(s-e[0],2)+Math.pow(a-e[1],2));return i-n})},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace(\"{X}\",t.toString()).replace(\"{Y}\",e.toString()).replace(\"{Z}\",i.toString())},e}(r.Model);i.TileSource=a,a.initClass()},function(t,e,i){function n(t,e){return o.wgs84_mercator.forward([t,e])}function r(t,e){return o.wgs84_mercator.inverse([t,e])}var o=t(33);i.geographic_to_meters=n,i.meters_to_geographic=r,i.geographic_extent_to_meters=function(t){var e=t[0],i=t[1],r=t[2],o=t[3],s=n(e,i),a=s[0],l=s[1],h=n(r,o),c=h[0],u=h[1];return[a,l,c,u]},i.meters_extent_to_geographic=function(t){var e=t[0],i=t[1],n=t[2],o=t[3],s=r(e,i),a=s[0],l=s[1],h=r(n,o),c=h[0],u=h[1];return[a,l,c,u]}},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TMSTileSource\"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars);return n.replace(\"{X}\",t.toString()).replace(\"{Y}\",e.toString()).replace(\"{Z}\",i.toString())},e}(r.MercatorTileSource);i.TMSTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(209),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"WMTSTileSource\"},e.prototype.get_image_url=function(t,e,i){var n=this.string_lookup_replace(this.url,this.extra_url_vars),r=this.tms_to_wmts(t,e,i),o=r[0],s=r[1],a=r[2];return n.replace(\"{X}\",o.toString()).replace(\"{Y}\",s.toString()).replace(\"{Z}\",a.toString())},e}(r.MercatorTileSource);i.WMTSTileSource=o,o.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(19),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._clicked=function(){this.model.do.emit()},e}(r.ButtonToolButtonView);i.ActionToolButtonView=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.do,function(){return e.doit()})},e}(r.ButtonToolView);i.ActionToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.button_view=s,i.do=new o.Signal0(i,\"do\"),i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ActionTool\"},e}(r.ButtonTool);i.ActionTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){window.open(this.model.redirect)},e}(r.ActionToolView);i.HelpToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Help\",i.icon=\"bk-tool-icon-help\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"HelpTool\",this.prototype.default_view=s,this.define({help_tooltip:[o.String,\"Click the question mark to learn more about Bokeh plot tools.\"],redirect:[o.String,\"https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools\"]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this.help_tooltip},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.HelpTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return e.model.disabled=!e.plot_view.can_redo()})},e.prototype.doit=function(){this.plot_view.redo()},e}(r.ActionToolView);i.RedoToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Redo\",i.icon=\"bk-tool-icon-redo\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"RedoTool\",this.prototype.default_view=o,this.override({disabled:!0})},e}(r.ActionTool);i.RedoTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(3),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.clear_state(),this.plot_view.reset_range(),this.plot_view.reset_selection(),this.plot_model.plot.trigger_event(new o.Reset)},e}(r.ActionToolView);i.ResetToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Reset\",i.icon=\"bk-tool-icon-reset\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ResetTool\",this.prototype.default_view=s},e}(r.ActionTool);i.ResetTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){this.plot_view.save(\"bokeh_plot\")},e}(r.ActionToolView);i.SaveToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Save\",i.icon=\"bk-tool-icon-save\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"SaveTool\",this.prototype.default_view=o},e}(r.ActionTool);i.SaveTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.plot_view.state_changed,function(){return e.model.disabled=!e.plot_view.can_undo()})},e.prototype.doit=function(){this.plot_view.undo()},e}(r.ActionToolView);i.UndoToolView=o;var s=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Undo\",i.icon=\"bk-tool-icon-undo\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"UndoTool\",this.prototype.default_view=o,this.override({disabled:!0})},e}(r.ActionTool);i.UndoTool=s,s.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i=\"width\"==e||\"both\"==e,n=\"height\"==e||\"both\"==e,r=o.scale_range(t,this.model.factor,i,n);this.plot_view.push_state(\"zoom_out\",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomInToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Zoom In\",i.icon=\"bk-tool-icon-zoom-in\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ZoomInTool\",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,\"both\"]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.ZoomInTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(216),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.doit=function(){var t=this.plot_model.frame,e=this.model.dimensions,i=\"width\"==e||\"both\"==e,n=\"height\"==e||\"both\"==e,r=o.scale_range(t,-this.model.factor,i,n);this.plot_view.push_state(\"zoom_out\",{range:r}),this.plot_view.update_range(r,!1,!0),this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.ActionToolView);i.ZoomOutToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Zoom Out\",i.icon=\"bk-tool-icon-zoom-out\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ZoomOutTool\",this.prototype.default_view=a,this.define({factor:[s.Percent,.1],dimensions:[s.Dimensions,\"both\"]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.ActionTool);i.ZoomOutTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(6),o=t(245),s=t(5),a=t(15),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){var i=this;t.prototype.initialize.call(this,e),this.connect(this.model.change,function(){return i.render()}),this.el.addEventListener(\"click\",function(t){t.stopPropagation(),t.preventDefault(),i._clicked()}),this.render()},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-toolbar-button\")},e.prototype.render=function(){s.empty(this.el),this.el.classList.add(this.model.icon),this.el.title=this.model.tooltip},e}(r.DOMView);i.ButtonToolButtonView=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(o.ToolView);i.ButtonToolView=h;var c=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ButtonTool\",this.internal({disabled:[a.Boolean,!1]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this.tool_name},enumerable:!0,configurable:!0}),e}(o.Tool);i.ButtonTool=c,c.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){if(null==this._draw_basepoint&&null==this._basepoint){var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){var o=n.data_source;o.selection_manager.clear()}}},e.prototype._set_extent=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l=this.model.renderers[0],h=this.plot_model.frame,c=l.glyph,u=l.data_source,_=h.xscales[l.x_range_name],p=h.yscales[l.y_range_name],d=_.r_invert(r,o),f=d[0],v=d[1],m=p.r_invert(s,a),g=m[0],y=m[1],b=[(f+v)/2,(g+y)/2],x=b[0],w=b[1],k=[v-f,y-g],S=k[0],C=k[1],T=[c.x.field,c.y.field],A=T[0],E=T[1],M=[c.width.field,c.height.field],O=M[0],z=M[1];if(i)A&&u.get_array(A).push(x),E&&u.get_array(E).push(w),O&&u.get_array(O).push(S),z&&u.get_array(z).push(C),this._pad_empty_columns(u,[A,E,O,z]);else{var P=u.data[A].length-1;A&&(u.data[A][P]=x),E&&(u.data[E][P]=w),O&&(u.data[O][P]=S),z&&(u.data[z][P]=C)}u.change.emit(),n&&u.properties.data.change.emit()},e.prototype._update_box=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),null!=this._draw_basepoint){var n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._draw_basepoint,n,r,o);if(null!=s){var a=s[0],l=s[1];this._set_extent(a,l,e,i)}}},e.prototype._doubletap=function(t){if(null!=this._draw_basepoint){this._update_box(t,!1,!0),this._draw_basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}}else this._draw_basepoint=[t.sx,t.sy],this._select_event(t,!0,this.model.renderers),this._update_box(t,!0,!1)},e.prototype._move=function(t){this._update_box(t,!1,!1)},e.prototype._pan_start=function(t){if(t.shiftKey){if(null!=this._draw_basepoint)return;this._draw_basepoint=[t.sx,t.sy],this._update_box(t,!0,!1)}else{if(null!=this._basepoint)return;this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy]}},e.prototype._pan=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),t.shiftKey){if(null==this._draw_basepoint)return;this._update_box(t,e,i)}else{if(null==this._basepoint)return;this._drag_points(t,this.model.renderers)}},e.prototype._pan_end=function(t){this._pan(t,!1,!0),t.shiftKey?this._draw_basepoint=null:this._basepoint=null;for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}},e}(s.EditToolView);i.BoxEditToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Box Edit Tool\",i.icon=\"bk-tool-icon-box-edit\",i.event_type=[\"tap\",\"pan\",\"move\"],i.default_order=1,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BoxEditTool\",this.prototype.default_view=a,this.define({dimensions:[o.Dimensions,\"both\"]})},e}(s.EditTool);i.BoxEditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(21),s=t(232),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._mouse_in_frame=!0,e}return n.__extends(e,t),e.prototype._move_enter=function(t){this._mouse_in_frame=!0},e.prototype._move_exit=function(t){this._mouse_in_frame=!1},e.prototype._map_drag=function(t,e,i){var n=this.plot_model.frame;if(!n.bbox.contains(t,e))return null;var r=n.xscales[i.x_range_name].invert(t),o=n.yscales[i.y_range_name].invert(e);return[r,o]},e.prototype._delete_selected=function(t){var e=t.data_source,i=e.selected.indices;i.sort();for(var n=0,r=e.columns();n<r.length;n++)for(var o=r[n],s=e.get_array(o),a=0;a<i.length;a++){var l=i[a];s.splice(l-a,1)}e.change.emit(),e.properties.data.change.emit(),e.selection_manager.clear()},e.prototype._drag_points=function(t,e){if(null!=this._basepoint){for(var i=this._basepoint,n=i[0],r=i[1],o=0,s=e;o<s.length;o++){var a=s[o],l=this._map_drag(n,r,a),h=this._map_drag(t.sx,t.sy,a);if(null!=h&&null!=l)for(var c=h[0],u=h[1],_=l[0],p=l[1],d=[c-_,u-p],f=d[0],v=d[1],m=a.glyph,g=a.data_source,y=[m.x.field,m.y.field],b=y[0],x=y[1],w=0,k=g.selected.indices;w<k.length;w++){var S=k[w];b&&(g.data[b][S]+=f),x&&(g.data[x][S]+=v)}}for(var C=0,T=e;C<T.length;C++){var a=T[C];a.data_source.change.emit()}this._basepoint=[t.sx,t.sy]}},e.prototype._pad_empty_columns=function(t,e){for(var i=0,n=t.columns();i<n.length;i++){var r=n[i];o.includes(e,r)||t.get_array(r).push(this.model.empty_value)}},e.prototype._select_event=function(t,e,i){var n=this.plot_model.frame,r=t.sx,o=t.sy;if(!n.bbox.contains(r,o))return[];for(var s={type:\"point\",sx:r,sy:o},a=[],l=0,h=i;l<h.length;l++){var c=h[l],u=c.get_selection_manager(),_=c.data_source,p=[this.plot_view.renderer_views[c.id]],d=u.select(p,s,!0,e);d&&a.push(c),_.properties.selected.change.emit()}return a},e}(s.GestureToolView);i.EditToolView=a;var l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"EditTool\",this.define({empty_value:[r.Any],renderers:[r.Array,[]]})},e}(s.GestureTool);i.EditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.shiftKey,i=this._select_event(t,e,this.model.renderers);if(!i.length&&this.model.add){var n=this.model.renderers[0],r=this._map_drag(t.sx,t.sy,n);if(null!=r){var o=n.glyph,s=n.data_source,a=[o.x.field,o.y.field],l=a[0],h=a[1],c=r[0],u=r[1];l&&s.get_array(l).push(c),h&&s.get_array(h).push(u),this._pad_empty_columns(s,[l,h]),s.change.emit(),s.properties.data.change.emit()}}},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){var o=n.data_source;o.selection_manager.clear()}}},e.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},e.prototype._pan=function(t){this.model.drag&&null!=this._basepoint&&this._drag_points(t,this.model.renderers)},e.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}this._basepoint=null}},e}(s.EditToolView);i.PointDrawToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Point Draw Tool\",i.icon=\"bk-tool-icon-point-draw\",i.event_type=[\"tap\",\"pan\",\"move\"],i.default_order=2,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PointDrawTool\",this.prototype.default_view=a,this.define({add:[o.Bool,!0],drag:[o.Bool,!0]})},e}(s.EditTool);i.PointDrawTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._drawing=!1,e}return n.__extends(e,t),e.prototype._tap=function(t){if(this._drawing)this._draw(t,\"add\"),this.model.renderers[0].data_source.properties.data.change.emit();else{var e=t.shiftKey;this._select_event(t,e,this.model.renderers)}},e.prototype._draw=function(t,e){var i=this.model.renderers[0],n=this._map_drag(t.sx,t.sy,i);if(null!=n){var r=n[0],o=n[1],s=i.data_source,a=i.glyph,l=[a.xs.field,a.ys.field],h=l[0],c=l[1];if(\"new\"==e)h&&s.get_array(h).push([r,r]),c&&s.get_array(c).push([o,o]),this._pad_empty_columns(s,[h,c]);else if(\"edit\"==e){if(h){var u=s.data[h][s.data[h].length-1];u[u.length-1]=r}if(c){var _=s.data[c][s.data[c].length-1];_[_.length-1]=o}}else if(\"add\"==e){if(h){var p=s.data[h].length-1,u=s.get_array(h)[p],d=u[u.length-1];u[u.length-1]=r,u.push(d)}if(c){var f=s.data[c].length-1,_=s.get_array(c)[f],v=_[_.length-1];_[_.length-1]=o,_.push(v)}}s.change.emit()}},e.prototype._doubletap=function(t){this.model.active&&(this._drawing?(this._drawing=!1,this._draw(t,\"edit\")):(this._drawing=!0,this._draw(t,\"new\")),this.model.renderers[0].data_source.properties.data.change.emit())},e.prototype._move=function(t){this._drawing&&this._draw(t,\"edit\")},e.prototype._remove=function(){var t=this.model.renderers[0],e=t.data_source,i=t.glyph,n=[i.xs.field,i.ys.field],r=n[0],o=n[1];if(r){var s=e.data[r].length-1,a=e.get_array(r)[s];a.splice(a.length-1,1)}if(o){var l=e.data[o].length-1,h=e.get_array(o)[l];h.splice(h.length-1,1)}e.change.emit(),e.properties.data.change.emit()},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){this._drawing&&(this._remove(),this._drawing=!1);var o=n.data_source;o.selection_manager.clear()}}},e.prototype._pan_start=function(t){this.model.drag&&(this._select_event(t,!0,this.model.renderers),this._basepoint=[t.sx,t.sy])},e.prototype._pan=function(t){if(null!=this._basepoint&&this.model.drag){for(var e=this._basepoint,i=e[0],n=e[1],r=0,o=this.model.renderers;r<o.length;r++){var s=o[r],a=this._map_drag(i,n,s),l=this._map_drag(t.sx,t.sy,s);if(null!=l&&null!=a){var h=s.data_source,c=s.glyph,u=[c.xs.field,c.ys.field],_=u[0],p=u[1];if(_||p){for(var d=l[0],f=l[1],v=a[0],m=a[1],g=[d-v,f-m],y=g[0],b=g[1],x=0,w=h.selected.indices;x<w.length;x++){var k=w[x],S=void 0,C=void 0,T=void 0;_&&(C=h.data[_][k]),p?(T=h.data[p][k],S=T.length):S=C.length;for(var A=0;A<S;A++)C&&(C[A]+=y),T&&(T[A]+=b)}h.change.emit()}}}this._basepoint=[t.sx,t.sy]}},e.prototype._pan_end=function(t){if(this.model.drag){this._pan(t);for(var e=0,i=this.model.renderers;e<i.length;e++){var n=i[e];n.data_source.selected.indices=[],n.data_source.properties.data.change.emit()}this._basepoint=null}},e.prototype.deactivate=function(){this._drawing&&(this._remove(),this._drawing=!1)},e}(s.EditToolView);i.PolyDrawToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Polygon Draw Tool\",i.icon=\"bk-tool-icon-poly-draw\",i.event_type=[\"pan\",\"tap\",\"move\"],i.default_order=3,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PolyDrawTool\",this.prototype.default_view=a,this.define({drag:[o.Bool,!0]})},e}(s.EditTool);i.PolyDrawTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(5),o=t(15),s=t(226),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._drawing=!1,e}return n.__extends(e,t),e.prototype._doubletap=function(t){if(this.model.active){var e=this._map_drag(t.sx,t.sy,this.model.vertex_renderer);if(null!=e){var i=e[0],n=e[1],r=this._select_event(t,!1,this.model.renderers),o=this._select_event(t,!1,[this.model.vertex_renderer]),s=this.model.vertex_renderer.data_source,a=this.model.vertex_renderer.glyph,l=[a.x.field,a.y.field],h=l[0],c=l[1];if(o.length&&null!=this._selected_renderer){var u=s.selected.indices[0];return this._drawing?(s.selected.indices=[],h&&(s.data[h][u]=i),c&&(s.data[c][u]=n),this._drawing=!1,this._selected_renderer.data_source.properties.data.change.emit()):(s.selected.indices=[u+1],h&&s.get_array(h).splice(u+1,0,i),c&&s.get_array(c).splice(u+1,0,n),this._drawing=!0),s.change.emit(),void this._selected_renderer.data_source.change.emit()}if(!r.length)return h&&(s.data[h]=[]),c&&(s.data[c]=[]),this._selected_renderer=null,this._drawing=!1,void s.change.emit();var _=r[0],p=_.glyph,d=_.data_source,f=d.selected.indices[0],v=[p.xs.field,p.ys.field],m=v[0],g=v[1];if(m){var y=d.data[m][f];h&&(s.data[h]=y)}else a.x={value:p.xs.value};if(g){var b=d.data[g][f];c&&(s.data[c]=b)}else a.y={value:p.ys.value};s.selected.indices=[],this._selected_renderer=_,s.change.emit(),s.properties.data.change.emit()}}},e.prototype._move=function(t){if(this._drawing&&null!=this._selected_renderer){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null==i)return;var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];l&&(o.data[l][c]=n),h&&(o.data[h][c]=r),o.change.emit(),this._selected_renderer.data_source.change.emit()}},e.prototype._tap=function(t){var e=this.model.vertex_renderer,i=this._map_drag(t.sx,t.sy,e);if(null!=i){if(this._drawing&&this._selected_renderer){var n=i[0],r=i[1],o=e.data_source,s=e.glyph,a=[s.x.field,s.y.field],l=a[0],h=a[1],c=o.selected.indices[0];if(o.selected.indices=[c+1],l){var u=o.get_array(l),_=u[c];u[c]=n,u.splice(c+1,0,_)}if(h){var p=o.get_array(h),d=p[c];p[c]=r,p.splice(c+1,0,d)}o.change.emit();var f=this._selected_renderer.data_source;return f.change.emit(),void f.properties.data.change.emit()}var v=t.shiftKey;this._select_event(t,v,[e]),this._select_event(t,v,this.model.renderers)}},e.prototype._remove_vertex=function(t){if(void 0===t&&(t=!0),this._drawing&&this._selected_renderer){var e=this.model.vertex_renderer,i=e.data_source,n=e.glyph,r=i.selected.indices[0],o=[n.x.field,n.y.field],s=o[0],a=o[1];s&&i.get_array(s).splice(r,1),a&&i.get_array(a).splice(r,1),t&&(i.change.emit(),i.properties.data.change.emit())}},e.prototype._pan_start=function(t){this._select_event(t,!0,[this.model.vertex_renderer]),this._basepoint=[t.sx,t.sy]},e.prototype._pan=function(t){null!=this._basepoint&&(this._drag_points(t,[this.model.vertex_renderer]),this._selected_renderer&&this._selected_renderer.data_source.change.emit())},e.prototype._pan_end=function(t){this.model.vertex_renderer.data_source.selected.indices=[],this._selected_renderer&&this._selected_renderer.data_source.properties.data.change.emit(),this._basepoint=null},e.prototype._keyup=function(t){if(this.model.active&&this._mouse_in_frame)for(var e=0,i=this._selected_renderer?[this.model.vertex_renderer]:this.model.renderers;e<i.length;e++){var n=i[e];if(t.keyCode===r.Keys.Backspace)this._delete_selected(n);else if(t.keyCode==r.Keys.Esc){this._drawing&&(this._remove_vertex(),this._drawing=!1);var o=n.data_source;o.selection_manager.clear()}}},e.prototype.deactivate=function(){if(this._selected_renderer){this._drawing&&(this._remove_vertex(!1),this._drawing=!1);var t=this.model.vertex_renderer,e=t.data_source,i=t.glyph,n=[i.x.field,i.y.field],r=n[0],o=n[1];r&&(e.data[r]=[]),o&&(e.data[o]=[]),e.selection_manager.clear(),e.change.emit(),this._selected_renderer.data_source.change.emit(),e.properties.data.change.emit(),this._selected_renderer.data_source.properties.data.change.emit(),this._selected_renderer=null}},e}(s.EditToolView);i.PolyEditToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Poly Edit Tool\",i.icon=\"bk-tool-icon-poly-edit\",i.event_type=[\"tap\",\"pan\",\"move\"],i.default_order=4,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PolyEditTool\",this.prototype.default_view=a,this.define({vertex_renderer:[o.Instance]})},e}(s.EditTool);i.PolyEditTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(58),s=t(15),a=t(32),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this._base_point=[e,i]},e.prototype._pan=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._base_point,n,r,o),a=s[0],l=s[1];if(this.model.overlay.update({left:a[0],right:a[1],top:l[0],bottom:l[1]}),this.model.select_every_mousemove){var h=t.shiftKey;this._do_select(a,l,!1,h)}},e.prototype._pan_end=function(t){var e=t.sx,i=t.sy,n=[e,i],r=this.plot_model.frame,o=this.model.dimensions,s=this.model._get_dim_limits(this._base_point,n,r,o),a=s[0],l=s[1],h=t.shiftKey;this._do_select(a,l,!0,h),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.push_state(\"box_select\",{selection:this.plot_view.get_selection()})},e.prototype._do_select=function(t,e,i,n){var r=t[0],o=t[1],s=e[0],a=e[1];void 0===n&&(n=!1);var l={type:\"rect\",sx0:r,sx1:o,sy0:s,sy1:a};this._select(l,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=t.sx0,s=t.sx1,l=t.sy0,h=t.sy1,c=n.r_invert(o,s),u=c[0],_=c[1],p=r.r_invert(l,h),d=p[0],f=p[1],v=a.extend({x0:u,y0:d,x1:_,y1:f},t);this.model.callback.execute(this.model,{geometry:v})},e}(r.SelectToolView);i.BoxSelectToolView=l;var h=function(){return new o.BoxAnnotation({level:\"overlay\",render_mode:\"css\",top_units:\"screen\",left_units:\"screen\",bottom_units:\"screen\",right_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},c=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Box Select\",i.icon=\"bk-tool-icon-box-select\",i.event_type=\"pan\",i.default_order=30,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BoxSelectTool\",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,\"both\"],select_every_mousemove:[s.Bool,!1],callback:[s.Instance],overlay:[s.Instance,h]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.SelectTool);i.BoxSelectTool=c,c.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(58),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._match_aspect=function(t,e,i){var n,r,o=i.bbox.aspect,s=i.bbox.h_range.end,a=i.bbox.h_range.start,l=i.bbox.v_range.end,h=i.bbox.v_range.start,c=Math.abs(t[0]-e[0]),u=Math.abs(t[1]-e[1]),_=0==u?0:c/u,p=(_>=o?[1,_/o]:[o/_,1])[0];t[0]<=e[0]?(n=t[0],(r=t[0]+c*p)>s&&(r=s)):(r=t[0],(n=t[0]-c*p)<a&&(n=a)),c=Math.abs(r-n);var d,f;return t[1]<=e[1]?(f=t[1],(d=t[1]+c/o)>l&&(d=l)):(d=t[1],(f=t[1]-c/o)<h&&(f=h)),u=Math.abs(d-f),t[0]<=e[0]?r=t[0]+o*u:n=t[0]-o*u,[[n,r],[f,d]]},e.prototype._pan_start=function(t){this._base_point=[t.sx,t.sy]},e.prototype._pan=function(t){var e,i,n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions;this.model.match_aspect&&\"both\"==o?(s=this._match_aspect(this._base_point,n,r),e=s[0],i=s[1]):(a=this.model._get_dim_limits(this._base_point,n,r,o),e=a[0],i=a[1]),this.model.overlay.update({left:e[0],right:e[1],top:i[0],bottom:i[1]});var s,a},e.prototype._pan_end=function(t){var e,i,n=[t.sx,t.sy],r=this.plot_model.frame,o=this.model.dimensions;this.model.match_aspect&&\"both\"==o?(s=this._match_aspect(this._base_point,n,r),e=s[0],i=s[1]):(a=this.model._get_dim_limits(this._base_point,n,r,o),e=a[0],i=a[1]),this._update(e,i),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null;var s,a},e.prototype._update=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1];if(!(Math.abs(n-i)<=5||Math.abs(o-r)<=5)){var s=this.plot_model.frame,a=s.xscales,l=s.yscales,h={};for(var c in a){var u=a[c],_=u.r_invert(i,n),p=_[0],d=_[1];h[c]={start:p,end:d}}var f={};for(var v in l){var u=l[v],m=u.r_invert(r,o),p=m[0],d=m[1];f[v]={start:p,end:d}}var g={xrs:h,yrs:f};this.plot_view.push_state(\"box_zoom\",{range:g}),this.plot_view.update_range(g)}},e}(r.GestureToolView);i.BoxZoomToolView=a;var l=function(){return new o.BoxAnnotation({level:\"overlay\",render_mode:\"css\",top_units:\"screen\",left_units:\"screen\",bottom_units:\"screen\",right_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Box Zoom\",i.icon=\"bk-tool-icon-box-zoom\",i.event_type=\"pan\",i.default_order=20,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"BoxZoomTool\",this.prototype.default_view=a,this.define({dimensions:[s.Dimensions,\"both\"],overlay:[s.Instance,l],match_aspect:[s.Bool,!1]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.BoxZoomTool=h,h.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(244),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.GestureToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.button_view=o.OnOffButtonView,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"GestureTool\"},e}(r.ButtonTool);i.GestureTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(65),s=t(5),a=t(15),l=t(32),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.data=null},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e._active_change()})},e.prototype._active_change=function(){this.model.active||this._clear_overlay()},e.prototype._keyup=function(t){t.keyCode==s.Keys.Enter&&this._clear_overlay()},e.prototype._pan_start=function(t){var e=t.sx,i=t.sy;this.data={sx:[e],sy:[i]}},e.prototype._pan=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox.clip(e,i),r=n[0],o=n[1];this.data.sx.push(r),this.data.sy.push(o);var s=this.model.overlay;if(s.update({xs:this.data.sx,ys:this.data.sy}),this.model.select_every_mousemove){var a=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!1,a)}},e.prototype._pan_end=function(t){this._clear_overlay();var e=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"lasso_select\",{selection:this.plot_view.get_selection()})},e.prototype._clear_overlay=function(){this.model.overlay.update({xs:[],ys:[]})},e.prototype._do_select=function(t,e,i,n){var r={type:\"poly\",sx:t,sy:e};this._select(r,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=l.extend({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},e}(r.SelectToolView);i.LassoSelectToolView=h;var c=function(){return new o.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},u=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Lasso Select\",i.icon=\"bk-tool-icon-lasso-select\",i.event_type=\"pan\",i.default_order=12,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LassoSelectTool\",this.prototype.default_view=h,this.define({select_every_mousemove:[a.Bool,!0],callback:[a.Instance],overlay:[a.Instance,c]})},e}(r.SelectTool);i.LassoSelectTool=u,u.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pan_start=function(t){this.last_dx=0,this.last_dy=0;var e=t.sx,i=t.sy,n=this.plot_model.frame.bbox;if(!n.contains(e,i)){var r=n.h_range,o=n.v_range;(e<r.start||e>r.end)&&(this.v_axis_only=!0),(i<o.start||i>o.end)&&(this.h_axis_only=!0)}null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan=function(t){this._update(t.deltaX,t.deltaY),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e.prototype._pan_end=function(t){this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info&&this.plot_view.push_state(\"pan\",{range:this.pan_info})},e.prototype._update=function(t,e){var i,n,r,o=this.plot_model.frame,s=t-this.last_dx,a=e-this.last_dy,l=o.bbox.h_range,h=l.start-s,c=l.end-s,u=o.bbox.v_range,_=u.start-a,p=u.end-a,d=this.model.dimensions;\"width\"!=d&&\"both\"!=d||this.v_axis_only?(i=l.start,n=l.end,r=0):(i=h,n=c,r=-s);var f,v,m;\"height\"!=d&&\"both\"!=d||this.h_axis_only?(f=u.start,v=u.end,m=0):(f=_,v=p,m=-a),this.last_dx=t,this.last_dy=e;var g=o.xscales,y=o.yscales,b={};for(var x in g){var w=g[x],k=w.r_invert(i,n),S=k[0],C=k[1];b[x]={start:S,end:C}}var T={};for(var A in y){var w=y[A],E=w.r_invert(f,v),S=E[0],C=E[1];T[A]={start:S,end:C}}this.pan_info={xrs:b,yrs:T,sdx:r,sdy:m},this.plot_view.update_range(this.pan_info,!0)},e}(r.GestureToolView);i.PanToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Pan\",i.event_type=\"pan\",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PanTool\",this.prototype.default_view=s,this.define({dimensions:[o.Dimensions,\"both\"]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(\"Pan\",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"icon\",{get:function(){switch(this.dimensions){case\"both\":return\"bk-tool-icon-pan\";case\"width\":return\"bk-tool-icon-xpan\";case\"height\":return\"bk-tool-icon-ypan\"}},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.PanTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(65),s=t(5),a=t(15),l=t(21),h=t(32),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.data={sx:[],sy:[]}},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e._active_change()})},e.prototype._active_change=function(){this.model.active||this._clear_data()},e.prototype._keyup=function(t){t.keyCode==s.Keys.Enter&&this._clear_data()},e.prototype._doubletap=function(t){var e=t.shiftKey;this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state(\"poly_select\",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e=t.sx,i=t.sy,n=this.plot_model.frame;n.bbox.contains(e,i)&&(this.data.sx.push(e),this.data.sy.push(i),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)}))},e.prototype._do_select=function(t,e,i,n){var r={type:\"poly\",sx:t,sy:e};this._select(r,i,n)},e.prototype._emit_callback=function(t){var e=this.computed_renderers[0],i=this.plot_model.frame,n=i.xscales[e.x_range_name],r=i.yscales[e.y_range_name],o=n.v_invert(t.sx),s=r.v_invert(t.sy),a=h.extend({x:o,y:s},t);this.model.callback.execute(this.model,{geometry:a})},e}(r.SelectToolView);i.PolySelectToolView=c;var u=function(){return new o.PolyAnnotation({level:\"overlay\",xs_units:\"screen\",ys_units:\"screen\",fill_color:{value:\"lightgrey\"},fill_alpha:{value:.5},line_color:{value:\"black\"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})},_=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Poly Select\",i.icon=\"bk-tool-icon-polygon-select\",i.event_type=\"tap\",i.default_order=11,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"PolySelectTool\",this.prototype.default_view=c,this.define({callback:[a.Instance],overlay:[a.Instance,u]})},e}(r.SelectTool);i.PolySelectTool=_,_.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(169),s=t(170),a=t(15),l=t(32),h=t(21),c=t(5),u=t(3),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,\"computed_renderers\",{get:function(){var t=this.model.renderers,e=this.model.names;if(0==t.length){var i=this.plot_model.plot.renderers;t=i.filter(function(t){return t instanceof o.GlyphRenderer||t instanceof s.GraphRenderer})}return e.length>0&&(t=t.filter(function(t){return h.includes(e,t.name)})),t},enumerable:!0,configurable:!0}),e.prototype._computed_renderers_by_data_source=function(){for(var t={},e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=void 0;(r=n instanceof s.GraphRenderer?n.node_renderer.data_source.id:n.data_source.id)in t||(t[r]=[]),t[r].push(n)}return t},e.prototype._keyup=function(t){if(t.keyCode==c.Keys.Esc)for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source,o=r.selection_manager;o.clear()}},e.prototype._select=function(t,e,i){var n=this._computed_renderers_by_data_source();for(var r in n){for(var o=n[r],s=o[0].get_selection_manager(),a=[],l=0,h=o;l<h.length;l++){var c=h[l];c.id in this.plot_view.renderer_views&&a.push(this.plot_view.renderer_views[c.id])}s.select(a,t,e,i)}null!=this.model.callback&&this._emit_callback(t),this._emit_selection_event(t,e)},e.prototype._emit_selection_event=function(t,e){void 0===e&&(e=!0);var i,n=this.plot_model.frame.xscales.default,r=this.plot_model.frame.yscales.default;switch(t.type){case\"point\":var o=t.sx,s=t.sy,a=n.invert(o),h=r.invert(s);i=l.extend({},t,{x:a,y:h});break;case\"rect\":var c=t.sx0,_=t.sx1,p=t.sy0,d=t.sy1,f=n.r_invert(c,_),v=f[0],m=f[1],g=r.r_invert(p,d),y=g[0],b=g[1];i=l.extend({},t,{x0:v,y0:y,x1:m,y1:b});break;case\"poly\":var o=t.sx,s=t.sy,a=n.v_invert(o),h=r.v_invert(s);i=l.extend({},t,{x:a,y:h});break;default:throw new Error(\"Unrecognized selection geometry type: '\"+t.type+\"'\")}this.plot_model.plot.trigger_event(new u.SelectionGeometry({geometry:i,final:e}))},e}(r.GestureToolView);i.SelectToolView=_;var p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"SelectTool\",this.define({renderers:[a.Array,[]],names:[a.Array,[]]})},e}(r.GestureTool);i.SelectTool=p,p.initClass()},function(t,e,i){var n=t(379),r=t(236),o=t(15),s=t(44),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._tap=function(t){var e=t.sx,i=t.sy,n={type:\"point\",sx:e,sy:i},r=t.shiftKey;this._select(n,!0,r)},e.prototype._select=function(t,e,i){var n=this,r=this.model.callback,o={geometries:t,source:null};if(\"select\"==this.model.behavior){var a=this._computed_renderers_by_data_source();for(var l in a){var h=a[l],c=h[0].get_selection_manager(),u=h.map(function(t){return n.plot_view.renderer_views[t.id]}),_=c.select(u,t,e,i);_&&null!=r&&(o.source=c.source,s.isFunction(r)?r(this,o):r.execute(this,o))}this._emit_selection_event(t),this.plot_view.push_state(\"tap\",{selection:this.plot_view.get_selection()})}else for(var p=0,d=this.computed_renderers;p<d.length;p++){var f=d[p],c=f.get_selection_manager(),_=c.inspect(this.plot_view.renderer_views[f.id],t);_&&null!=r&&(o.source=c.source,s.isFunction(r)?r(this,o):r.execute(this,o))}},e}(r.SelectToolView);i.TapToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Tap\",i.icon=\"bk-tool-icon-tap-select\",i.event_type=\"tap\",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"TapTool\",this.prototype.default_view=a,this.define({behavior:[o.String,\"select\"],callback:[o.Any]})},e}(r.SelectTool);i.TapTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._scroll=function(t){var e=this.model.speed*t.delta;e>.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,i,n,r,o=this.plot_model.frame,s=o.bbox.h_range,a=o.bbox.v_range,l=[s.start,s.end],h=l[0],c=l[1],u=[a.start,a.end],_=u[0],p=u[1];switch(this.model.dimension){case\"height\":var d=Math.abs(p-_);e=h,i=c,n=_-d*t,r=p-d*t;break;case\"width\":var f=Math.abs(c-h);e=h-f*t,i=c-f*t,n=_,r=p;break;default:throw new Error(\"this shouldn't have happened\")}var v=o.xscales,m=o.yscales,g={};for(var y in v){var b=v[y],x=b.r_invert(e,i),w=x[0],k=x[1];g[y]={start:w,end:k}}var S={};for(var C in m){var b=m[C],T=b.r_invert(n,r),w=T[0],k=T[1];S[C]={start:w,end:k}}var A={xrs:g,yrs:S,factor:t};this.plot_view.push_state(\"wheel_pan\",{range:A}),this.plot_view.update_range(A,!1,!0),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.GestureToolView);i.WheelPanToolView=s;var a=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Wheel Pan\",i.icon=\"bk-tool-icon-wheel-pan\",i.event_type=\"scroll\",i.default_order=12,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"WheelPanTool\",this.prototype.default_view=s,this.define({dimension:[o.Dimension,\"width\"]}),this.internal({speed:[o.Number,.001]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.WheelPanTool=a,a.initClass()},function(t,e,i){var n=t(379),r=t(232),o=t(46),s=t(15),a=t(20),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._pinch=function(t){var e,i=t.sx,n=t.sy,r=t.scale;e=r>=1?20*(r-1):-20/r,this._scroll({type:\"mousewheel\",sx:i,sy:n,delta:e})},e.prototype._scroll=function(t){var e=this.plot_model.frame,i=e.bbox.h_range,n=e.bbox.v_range,r=t.sx,s=t.sy,a=this.model.dimensions,l=(\"width\"==a||\"both\"==a)&&i.start<r&&r<i.end,h=(\"height\"==a||\"both\"==a)&&n.start<s&&s<n.end,c=this.model.speed*t.delta,u=o.scale_range(e,c,l,h,{x:r,y:s});this.plot_view.push_state(\"wheel_zoom\",{range:u}),this.plot_view.update_range(u,!1,!0,this.model.maintain_focus),null!=this.model.document&&this.model.document.interactive_start(this.plot_model.plot)},e}(r.GestureToolView);i.WheelZoomToolView=l;var h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Wheel Zoom\",i.icon=\"bk-tool-icon-wheel-zoom\",i.event_type=a.is_mobile?\"pinch\":\"scroll\",i.default_order=10,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"WheelZoomTool\",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,\"both\"],maintain_focus:[s.Boolean,!0]}),this.internal({speed:[s.Number,1/600]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)},enumerable:!0,configurable:!0}),e}(r.GestureTool);i.WheelZoomTool=h,h.initClass()},function(t,e,i){var n=t(216);i.ActionTool=n.ActionTool;var r=t(217);i.HelpTool=r.HelpTool;var o=t(218);i.RedoTool=o.RedoTool;var s=t(219);i.ResetTool=s.ResetTool;var a=t(220);i.SaveTool=a.SaveTool;var l=t(221);i.UndoTool=l.UndoTool;var h=t(222);i.ZoomInTool=h.ZoomInTool;var c=t(223);i.ZoomOutTool=c.ZoomOutTool;var u=t(224);i.ButtonTool=u.ButtonTool;var _=t(226);i.EditTool=_.EditTool;var p=t(225);i.BoxEditTool=p.BoxEditTool;var d=t(227);i.PointDrawTool=d.PointDrawTool;var f=t(228);i.PolyDrawTool=f.PolyDrawTool;var v=t(229);i.PolyEditTool=v.PolyEditTool;var m=t(230);i.BoxSelectTool=m.BoxSelectTool;var g=t(231);i.BoxZoomTool=g.BoxZoomTool;var y=t(232);i.GestureTool=y.GestureTool;var b=t(233);i.LassoSelectTool=b.LassoSelectTool;var x=t(234);i.PanTool=x.PanTool;var w=t(235);i.PolySelectTool=w.PolySelectTool;var k=t(236);i.SelectTool=k.SelectTool;var S=t(237);i.TapTool=S.TapTool;var C=t(238);i.WheelPanTool=C.WheelPanTool;var T=t(239);i.WheelZoomTool=T.WheelZoomTool;var A=t(241);i.CrosshairTool=A.CrosshairTool;var E=t(242);i.HoverTool=E.HoverTool;var M=t(243);i.InspectTool=M.InspectTool;var O=t(245);i.Tool=O.Tool;var z=t(246);i.ToolProxy=z.ToolProxy;var P=t(247);i.Toolbar=P.Toolbar;var j=t(248);i.ToolbarBase=j.ToolbarBase;var N=t(249);i.ProxyToolbar=N.ProxyToolbar;var F=t(249);i.ToolbarBox=F.ToolbarBox},function(t,e,i){var n=t(379),r=t(243),o=t(66),s=t(15),a=t(32),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._update_spans(e,i):this._update_spans(null,null)}},e.prototype._move_exit=function(t){this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var i=this.model.dimensions;\"width\"!=i&&\"both\"!=i||(this.model.spans.width.computed_location=e),\"height\"!=i&&\"both\"!=i||(this.model.spans.height.computed_location=t)},e}(r.InspectToolView);i.CrosshairToolView=l;var h=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Crosshair\",i.icon=\"bk-tool-icon-crosshair\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"CrosshairTool\",this.prototype.default_view=l,this.define({dimensions:[s.Dimensions,\"both\"],line_color:[s.Color,\"black\"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),this.internal({location_units:[s.SpatialUnits,\"screen\"],render_mode:[s.RenderMode,\"css\"],spans:[s.Any]})},Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this._get_dim_tooltip(\"Crosshair\",this.dimensions)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"synthetic_renderers\",{get:function(){return a.values(this.spans)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.spans={width:new o.Span({for_hover:!0,dimension:\"width\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:\"height\",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);i.CrosshairTool=h,h.initClass()},function(t,e,i){function n(t,e,i,n,r,o){var s,a,l={x:r[t],y:o[t]},h={x:r[t+1],y:o[t+1]};if(\"span\"==e.type)\"h\"==e.direction?(s=Math.abs(l.x-i),a=Math.abs(h.x-i)):(s=Math.abs(l.y-n),a=Math.abs(h.y-n));else{var u={x:i,y:n};s=c.dist_2_pts(l,u),a=c.dist_2_pts(h,u)}return s<a?[[l.x,l.y],t]:[[h.x,h.y],t+1]}function r(t,e,i){return[[t[i],e[i]],i]}var o=t(379),s=t(243),a=t(70),l=t(169),h=t(170),c=t(9),u=t(40),_=t(5),p=t(15),d=t(27),f=t(21),v=t(32),m=t(44),g=t(4);i._nearest_line_hit=n,i._line_hit=r;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){g.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this);for(var i=0,n=this.computed_renderers;i<n.length;i++){var r=n[i];r instanceof l.GlyphRenderer?this.connect(r.data_source.inspect,this._update):r instanceof h.GraphRenderer&&(this.connect(r.node_renderer.data_source.inspect,this._update),this.connect(r.edge_renderer.data_source.inspect,this._update))}this.connect(this.model.properties.renderers.change,function(){return e._computed_renderers=e._ttmodels=null}),this.connect(this.model.properties.names.change,function(){return e._computed_renderers=e._ttmodels=null}),this.connect(this.model.properties.tooltips.change,function(){return e._ttmodels=null})},e.prototype._compute_renderers=function(){var t=this.model.renderers,e=this.model.names;if(0==t.length){var i=this.plot_model.plot.renderers;t=i.filter(function(t){return t instanceof l.GlyphRenderer||t instanceof h.GraphRenderer})}return e.length>0&&(t=t.filter(function(t){return f.includes(e,t.name)})),t},e.prototype._compute_ttmodels=function(){var t={},e=this.model.tooltips;if(null!=e)for(var i=0,n=this.computed_renderers;i<n.length;i++){var r=n[i];if(r instanceof l.GlyphRenderer){var o=new a.Tooltip({custom:m.isString(e)||m.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.id]=o}else if(r instanceof h.GraphRenderer){var o=new a.Tooltip({custom:m.isString(e)||m.isFunction(e),attachment:this.model.attachment,show_arrow:this.model.show_arrow});t[r.node_renderer.id]=o,t[r.edge_renderer.id]=o}}return g.build_views(this.ttviews,v.values(t),{parent:this,plot_view:this.plot_view}),t},Object.defineProperty(e.prototype,\"computed_renderers\",{get:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"ttmodels\",{get:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels},enumerable:!0,configurable:!0}),e.prototype._clear=function(){this._inspect(1/0,1/0);for(var t in this.ttmodels){var e=this.ttmodels[t];e.clear()}},e.prototype._move=function(t){if(this.model.active){var e=t.sx,i=t.sy;this.plot_model.frame.bbox.contains(e,i)?this._inspect(e,i):this._clear()}},e.prototype._move_exit=function(){this._clear()},e.prototype._inspect=function(t,e){var i;if(\"mouse\"==this.model.mode)i={type:\"point\",sx:t,sy:e};else{var n=\"vline\"==this.model.mode?\"h\":\"v\";i={type:\"span\",direction:n,sx:t,sy:e}}for(var r=0,o=this.computed_renderers;r<o.length;r++){var s=o[r],a=s.get_selection_manager();a.inspect(this.plot_view.renderer_views[s.id],i)}null!=this.model.callback&&this._emit_callback(i)},e.prototype._update=function(t){var e=t[0],i=t[1].geometry;if(this.model.active){var o=this.ttmodels[e.model.id];if(null!=o){o.clear();var s=e.model.get_selection_manager().inspectors[e.model.id];e.model instanceof l.GlyphRenderer&&(s=e.model.view.convert_selection_to_subset(s));var a=e.model.get_selection_manager().source;if(!s.is_empty()){for(var h=this.plot_model.frame,c=i.sx,u=i.sy,_=h.xscales[e.model.x_range_name],p=h.yscales[e.model.y_range_name],d=_.invert(c),f=p.invert(u),m=e.glyph,g=0,y=s.line_indices;g<y.length;g++){var b=y[g],x=m._x[b+1],w=m._y[b+1],k=b,S=void 0,C=void 0;switch(this.model.line_policy){case\"interp\":F=m.get_interpolation_hit(b,i),x=F[0],w=F[1],S=_.compute(x),C=p.compute(w);break;case\"prev\":D=r(m.sx,m.sy,b),I=D[0],S=I[0],C=I[1],k=D[1];break;case\"next\":B=r(m.sx,m.sy,b+1),R=B[0],S=R[0],C=R[1],k=B[1];break;case\"nearest\":L=n(b,i,c,u,m.sx,m.sy),V=L[0],S=V[0],C=V[1],k=L[1],x=m._x[k],w=m._y[k];break;default:S=(G=[c,u])[0],C=G[1]}var T={index:k,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w,rx:S,ry:C};o.add(S,C,this._render_tooltips(a,k,T))}for(var A=0,E=s.indices;A<E.length;A++){var b=E[A];if(v.isEmpty(s.multiline_indices)){var x=null!=m._x?m._x[b]:void 0,w=null!=m._y?m._y[b]:void 0,S=void 0,C=void 0;if(\"snap_to_data\"==this.model.point_policy){var M=m.get_anchor_point(this.model.anchor,b,[c,u]);null==M&&(M=m.get_anchor_point(\"center\",b,[c,u])),S=M.x,C=M.y}else Q=[c,u],S=Q[0],C=Q[1];var O=void 0,T={index:O=e.model instanceof l.GlyphRenderer?e.model.view.convert_indices_from_subset([b])[0]:b,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w};o.add(S,C,this._render_tooltips(a,O,T))}else for(var z=0,P=s.multiline_indices[b.toString()];z<P.length;z++){var j=P[z],x=m._xs[b][j],w=m._ys[b][j],N=j,S=void 0,C=void 0;switch(this.model.line_policy){case\"interp\":U=m.get_interpolation_hit(b,j,i),x=U[0],w=U[1],S=_.compute(x),C=p.compute(w);break;case\"prev\":Y=r(m.sxs[b],m.sys[b],j),q=Y[0],S=q[0],C=q[1],N=Y[1];break;case\"next\":X=r(m.sxs[b],m.sys[b],j+1),W=X[0],S=W[0],C=W[1],N=X[1];break;case\"nearest\":H=n(j,i,c,u,m.sxs[b],m.sys[b]),J=H[0],S=J[0],C=J[1],N=H[1],x=m._xs[b][N],w=m._ys[b][N];break;default:throw new Error(\"should't have happened\")}var O=void 0,T={index:O=e.model instanceof l.GlyphRenderer?e.model.view.convert_indices_from_subset([b])[0]:b,segment_index:N,x:d,y:f,sx:c,sy:u,data_x:x,data_y:w};o.add(S,C,this._render_tooltips(a,O,T))}}var F,D,I,B,R,L,V,G,U,Y,q,X,W,H,J,Q}}}},e.prototype._emit_callback=function(t){for(var e=0,i=this.computed_renderers;e<i.length;e++){var n=i[e],r=n.data_source.inspected,o=this.plot_model.frame,s=o.xscales[n.x_range_name],a=o.yscales[n.y_range_name],l=s.invert(t.sx),h=a.invert(t.sy),c=v.extend({x:l,y:h},t),u=this.model.callback,_=[u,{index:r,geometry:c,renderer:n}],p=_[0],d=_[1];m.isFunction(u)?u(p,d):u.execute(p,d)}},e.prototype._render_tooltips=function(t,e,i){var n=this.model.tooltips;if(m.isString(n)){var r=_.div();return r.innerHTML=u.replace_placeholders(n,t,e,this.model.formatters,i),r}if(m.isFunction(n))return n(t,i);for(var o=_.div({style:{display:\"table\",borderSpacing:\"2px\"}}),s=0,a=n;s<a.length;s++){var l=a[s],h=l[0],c=l[1],p=_.div({style:{display:\"table-row\"}});o.appendChild(p);var f=void 0;if(f=_.div({style:{display:\"table-cell\"},class:\"bk-tooltip-row-label\"},h+\": \"),p.appendChild(f),f=_.div({style:{display:\"table-cell\"},class:\"bk-tooltip-row-value\"}),p.appendChild(f),c.indexOf(\"$color\")>=0){var v=c.match(/\\$color(\\[.*\\])?:(\\w*)/),g=v[1],y=void 0===g?\"\":g,b=v[2],x=t.get_column(b);if(null==x){var w=_.span({},b+\" unknown\");f.appendChild(w);continue}var k=y.indexOf(\"hex\")>=0,S=y.indexOf(\"swatch\")>=0,C=x[e];if(null==C){var T=_.span({},\"(null)\");f.appendChild(T);continue}k&&(C=d.color2hex(C));var r=_.span({},C);f.appendChild(r),S&&(r=_.span({class:\"bk-tooltip-color-block\",style:{backgroundColor:C}},\" \"),f.appendChild(r))}else{var r=_.span();r.innerHTML=u.replace_placeholders(c.replace(\"$~\",\"$data_\"),t,e,this.model.formatters,i),f.appendChild(r)}}return o},e}(s.InspectToolView);i.HoverToolView=y;var b=function(t){function e(e){var i=t.call(this,e)||this;return i.tool_name=\"Hover\",i.icon=\"bk-tool-icon-hover\",i}return o.__extends(e,t),e.initClass=function(){this.prototype.type=\"HoverTool\",this.prototype.default_view=y,this.define({tooltips:[p.Any,[[\"index\",\"$index\"],[\"data (x, y)\",\"($x, $y)\"],[\"screen (x, y)\",\"($sx, $sy)\"]]],formatters:[p.Any,{}],renderers:[p.Array,[]],names:[p.Array,[]],mode:[p.String,\"mouse\"],point_policy:[p.String,\"snap_to_data\"],line_policy:[p.String,\"nearest\"],show_arrow:[p.Boolean,!0],anchor:[p.String,\"center\"],attachment:[p.String,\"horizontal\"],callback:[p.Any]})},e}(s.InspectTool);i.HoverTool=b,b.initClass()},function(t,e,i){var n=t(379),r=t(224),o=t(244),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e}(r.ButtonToolView);i.InspectToolView=a;var l=function(t){function e(e){var i=t.call(this,e)||this;return i.event_type=\"move\",i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"InspectTool\",this.prototype.button_view=o.OnOffButtonView,this.define({toggleable:[s.Bool,!0]}),this.override({active:!0})},e}(r.ButtonTool);i.InspectTool=l,l.initClass()},function(t,e,i){var n=t(379),r=t(224),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.model.active?this.el.classList.add(\"bk-active\"):this.el.classList.remove(\"bk-active\")},e.prototype._clicked=function(){var t=this.model.active;this.model.active=!t},e}(r.ButtonToolButtonView);i.OnOffButtonView=o},function(t,e,i){var n=t(379),r=t(15),o=t(48),s=t(21),a=t(53),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},Object.defineProperty(e.prototype,\"plot_model\",{get:function(){return this.plot_view.model},enumerable:!0,configurable:!0}),e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);i.ToolView=l;var h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Tool\",this.internal({active:[r.Boolean,!1]})},Object.defineProperty(e.prototype,\"synthetic_renderers\",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype._get_dim_tooltip=function(t,e){switch(e){case\"width\":return t+\" (x-axis)\";case\"height\":return t+\" (y-axis)\";case\"both\":return t}},e.prototype._get_dim_limits=function(t,e,i,n){var r,o=t[0],a=t[1],l=e[0],h=e[1],c=i.bbox.h_range;\"width\"==n||\"both\"==n?(r=[s.min([o,l]),s.max([o,l])],r=[s.max([r[0],c.start]),s.min([r[1],c.end])]):r=[c.start,c.end];var u,_=i.bbox.v_range;return\"height\"==n||\"both\"==n?(u=[s.min([a,h]),s.max([a,h])],u=[s.max([u[0],_.start]),s.min([u[1],_.end])]):u=[_.start,_.end],[r,u]},e}(a.Model);i.Tool=h,h.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(19),s=t(53),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ToolProxy\",this.define({tools:[r.Array,[]],active:[r.Bool,!1],disabled:[r.Bool,!1]})},Object.defineProperty(e.prototype,\"button_view\",{get:function(){return this.tools[0].button_view},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"event_type\",{get:function(){return this.tools[0].event_type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"tooltip\",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"tool_name\",{get:function(){return this.tools[0].tool_name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"icon\",{get:function(){return this.tools[0].icon},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.do=new o.Signal0(this,\"do\")},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.do,function(){return e.doit()}),this.connect(this.properties.active.change,function(){return e.set_active()})},e.prototype.doit=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.do.emit()}},e.prototype.set_active=function(){for(var t=0,e=this.tools;t<e.length;t++){var i=e[t];i.active=this.active}},e}(s.Model);i.ToolProxy=a,a.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(14),s=t(44),a=t(21),l=t(216),h=t(217),c=t(232),u=t(243),_=t(248),p=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Toolbar\",this.prototype.default_view=_.ToolbarBaseView,this.define({active_drag:[r.Any,\"auto\"],active_inspect:[r.Any,\"auto\"],active_scroll:[r.Any,\"auto\"],active_tap:[r.Any,\"auto\"]})},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init_tools()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.properties.tools.change,function(){return e._init_tools()})},e.prototype._init_tools=function(){for(var t=this,e=function(t){if(t instanceof u.InspectTool)a.any(i.inspectors,function(e){return e.id==t.id})||(i.inspectors=i.inspectors.concat([t]));else if(t instanceof h.HelpTool)a.any(i.help,function(e){return e.id==t.id})||(i.help=i.help.concat([t]));else if(t instanceof l.ActionTool)a.any(i.actions,function(e){return e.id==t.id})||(i.actions=i.actions.concat([t]));else if(t instanceof c.GestureTool){var e=void 0,n=void 0;s.isString(t.event_type)?(e=[t.event_type],n=!1):(e=t.event_type||[],n=!0);for(var r=0,_=e;r<_.length;r++){var p=_[r];p in i.gestures?(n&&(p=\"multi\"),a.any(i.gestures[p].tools,function(e){return e.id==t.id})||(i.gestures[p].tools=i.gestures[p].tools.concat([t])),i.connect(t.properties.active.change,i._active_change.bind(i,t))):o.logger.warn(\"Toolbar: unknown event type '\"+p+\"' for tool: \"+t.type+\" (\"+t.id+\")\")}}},i=this,n=0,r=this.tools;n<r.length;n++){var _=r[n];e(_)}if(\"auto\"==this.active_inspect);else if(this.active_inspect instanceof u.InspectTool)for(var p=0,d=this.inspectors;p<d.length;p++){var f=d[p];f!=this.active_inspect&&(f.active=!1)}else if(s.isArray(this.active_inspect))for(var v=0,m=this.inspectors;v<m.length;v++){var f=m[v];a.includes(this.active_inspect,f)||(f.active=!1)}else if(null==this.active_inspect)for(var g=0,y=this.inspectors;g<y.length;g++){var f=y[g];f.active=!1}var b=function(e){e.active?t._active_change(e):e.active=!0};for(var x in this.gestures){var w=this.gestures[x];if(0!=w.tools.length){if(w.tools=a.sortBy(w.tools,function(t){return t.default_order}),\"tap\"==x){if(null==this.active_tap)continue;\"auto\"==this.active_tap?b(w.tools[0]):b(this.active_tap)}if(\"pan\"==x){if(null==this.active_drag)continue;\"auto\"==this.active_drag?b(w.tools[0]):b(this.active_drag)}if(\"pinch\"==x||\"scroll\"==x){if(null==this.active_scroll||\"auto\"==this.active_scroll)continue;b(this.active_scroll)}}}},e}(_.ToolbarBase);i.Toolbar=p,p.initClass()},function(t,e,i){var n=t(379),r=t(14),o=t(5),s=t(4),a=t(15),l=t(6),h=t(44),c=t(53),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this._tool_button_views={},this._build_tool_button_views()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.tools.change,function(){return e._build_tool_button_views()})},e.prototype.remove=function(){s.remove_views(this._tool_button_views),t.prototype.remove.call(this)},e.prototype._build_tool_button_views=function(){var t=null!=this.model._proxied_tools?this.model._proxied_tools:this.model.tools;s.build_views(this._tool_button_views,t,{parent:this},function(t){return t.button_view})},e.prototype.render=function(){var t=this;if(o.empty(this.el),this.el.classList.add(\"bk-toolbar\"),this.el.classList.add(\"bk-toolbar-\"+this.model.toolbar_location),null!=this.model.logo){var e=\"grey\"===this.model.logo?\"bk-grey\":null,i=o.a({href:\"https://bokeh.pydata.org/\",target:\"_blank\",class:[\"bk-logo\",\"bk-logo-small\",e]});this.el.appendChild(i)}var n=[],r=function(e){return t._tool_button_views[e.id].el},s=this.model.gestures;for(var a in s)n.push(s[a].tools.map(r));n.push(this.model.actions.map(r)),n.push(this.model.inspectors.filter(function(t){return t.toggleable}).map(r)),n.push(this.model.help.map(r));for(var l=0,h=n;l<h.length;l++){var c=h[l];if(0!==c.length){var u=o.div({class:\"bk-button-bar\"},c);this.el.appendChild(u)}}},e}(l.DOMView);i.ToolbarBaseView=u;var _=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ToolbarBase\",this.prototype.default_view=u,this.define({tools:[a.Array,[]],logo:[a.String,\"normal\"]}),this.internal({gestures:[a.Any,function(){return{pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}],actions:[a.Array,[]],inspectors:[a.Array,[]],help:[a.Array,[]],toolbar_location:[a.Location,\"right\"]})},Object.defineProperty(e.prototype,\"horizontal\",{get:function(){return\"above\"===this.toolbar_location||\"below\"===this.toolbar_location},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"vertical\",{get:function(){return\"left\"===this.toolbar_location||\"right\"===this.toolbar_location},enumerable:!0,configurable:!0}),e.prototype._active_change=function(t){var e=t.event_type;if(null!=e)for(var i=h.isString(e)?[e]:e,n=0,o=i;n<o.length;n++){var s=o[n];if(t.active){var a=this.gestures[s].active;null!=a&&t!=a&&(r.logger.debug(\"Toolbar: deactivating tool: \"+a.type+\" (\"+a.id+\") for event type '\"+s+\"'\"),a.active=!1),this.gestures[s].active=t,r.logger.debug(\"Toolbar: activating tool: \"+t.type+\" (\"+t.id+\") for event type '\"+s+\"'\")}else this.gestures[s].active=null}},e}(c.Model);i.ToolbarBase=_,_.initClass()},function(t,e,i){var n=t(379),r=t(15),o=t(5),s=t(14),a=t(44),l=t(21),h=t(216),c=t(217),u=t(232),_=t(243),p=t(248),d=t(246),f=t(146),v=t(4),m=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ProxyToolbar\"},e.prototype.initialize=function(){t.prototype.initialize.call(this),this._init_tools(),this._merge_tools()},e.prototype._init_tools=function(){for(var t=function(t){if(t instanceof _.InspectTool)l.any(e.inspectors,function(e){return e.id==t.id})||(e.inspectors=e.inspectors.concat([t]));else if(t instanceof c.HelpTool)l.any(e.help,function(e){return e.id==t.id})||(e.help=e.help.concat([t]));else if(t instanceof h.ActionTool)l.any(e.actions,function(e){return e.id==t.id})||(e.actions=e.actions.concat([t]));else if(t instanceof u.GestureTool){var i=void 0,n=void 0;a.isString(t.event_type)?(i=[t.event_type],n=!1):(i=t.event_type||[],n=!0);for(var r=0,o=i;r<o.length;r++){var p=o[r];p in e.gestures?(n&&(p=\"multi\"),l.any(e.gestures[p].tools,function(e){return e.id==t.id})||(e.gestures[p].tools=e.gestures[p].tools.concat([t]))):s.logger.warn(\"Toolbar: unknown event type '\"+p+\"' for tool: \"+t.type+\" (\"+t.id+\")\")}}},e=this,i=0,n=this.tools;i<n.length;i++){var r=n[i];t(r)}},e.prototype._merge_tools=function(){var t=this;this._proxied_tools=[];for(var e={},i={},n={},r=[],o=[],s=0,a=this.help;s<a.length;s++){var h=a[s];l.includes(o,h.redirect)||(r.push(h),o.push(h.redirect))}(C=this._proxied_tools).push.apply(C,r),this.help=r;for(var c in this.gestures){var u=this.gestures[c];c in n||(n[c]={});for(var _=0,p=u.tools;_<p.length;_++){var f=p[_];f.type in n[c]||(n[c][f.type]=[]),n[c][f.type].push(f)}}for(var v=0,m=this.inspectors;v<m.length;v++){var f=m[v];f.type in e||(e[f.type]=[]),e[f.type].push(f)}for(var g=0,y=this.actions;g<y.length;g++){var f=y[g];f.type in i||(i[f.type]=[]),i[f.type].push(f)}var b=function(e,i){void 0===i&&(i=!1);var n=new d.ToolProxy({tools:e,active:i});return t._proxied_tools.push(n),n};for(var c in n){var u=this.gestures[c];u.tools=[];for(var x in n[c]){var w=n[c][x];if(w.length>0){var k=b(w);u.tools.push(k),this.connect(k.properties.active.change,this._active_change.bind(this,k))}}}this.actions=[];for(var x in i){var w=i[x];w.length>0&&this.actions.push(b(w))}this.inspectors=[];for(var x in e){var w=e[x];w.length>0&&this.inspectors.push(b(w,!0))}for(var S in this.gestures){var u=this.gestures[S];0!=u.tools.length&&(u.tools=l.sortBy(u.tools,function(t){return t.default_order}),\"pinch\"!=S&&\"scroll\"!=S&&\"multi\"!=S&&(u.tools[0].active=!0))}var C},e}(p.ToolbarBase);i.ProxyToolbar=m,m.initClass();var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},v.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){v.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-toolbar-box\")},e.prototype.render=function(){t.prototype.render.call(this);var e=this._toolbar_views[this.model.toolbar.id];e.render(),o.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(f.LayoutDOMView);i.ToolbarBoxView=g;var y=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"ToolbarBox\",this.prototype.default_view=g,this.define({toolbar:[r.Instance],toolbar_location:[r.Location,\"right\"]})},Object.defineProperty(e.prototype,\"sizing_mode\",{get:function(){switch(this.toolbar_location){case\"above\":case\"below\":return\"scale_width\";case\"left\":case\"right\":return\"scale_height\"}},enumerable:!0,configurable:!0}),e}(f.LayoutDOM);i.ToolbarBox=y,y.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(15),s=t(32),a=function(e){function r(t){return e.call(this,t)||this}return n.__extends(r,e),r.initClass=function(){this.prototype.type=\"CustomJSTransform\",this.define({args:[o.Any,{}],func:[o.String,\"\"],v_func:[o.String,\"\"]})},Object.defineProperty(r.prototype,\"values\",{get:function(){return s.values(this.args)},enumerable:!0,configurable:!0}),r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(s.keys(this.args),[t,\"require\",\"exports\",e])))},Object.defineProperty(r.prototype,\"scalar_transform\",{get:function(){return this._make_transform(\"x\",this.func)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,\"vector_transform\",{get:function(){return this._make_transform(\"xs\",this.v_func)},enumerable:!0,configurable:!0}),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,i]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,i]))},r}(r.Transform);i.CustomJSTransform=a,a.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(165),s=t(15),a=t(44),l=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Dodge\",this.define({value:[s.Number,0],range:[s.Instance]})},e.prototype.v_compute=function(t){var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!a.isArrayableOf(t,a.isNumber))throw new Error(\"unexpected\");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return i},e.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(a.isNumber(t))return this._compute(t);throw new Error(\"unexpected\")},e.prototype._compute=function(t){return t+this.value},e}(r.Transform);i.Dodge=l,l.initClass()},function(t,e,i){var n=t(250);i.CustomJSTransform=n.CustomJSTransform;var r=t(251);i.Dodge=r.Dodge;var o=t(253);i.Interpolator=o.Interpolator;var s=t(254);i.Jitter=s.Jitter;var a=t(255);i.LinearInterpolator=a.LinearInterpolator;var l=t(256);i.StepInterpolator=l.StepInterpolator;var h=t(257);i.Transform=h.Transform},function(t,e,i){var n=t(379),r=t(257),o=t(15),s=t(21),a=t(44),l=function(t){function e(e){var i=t.call(this,e)||this;return i._sorted_dirty=!0,i}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Interpolator\",this.define({x:[o.Any],y:[o.Any],data:[o.Any],clip:[o.Bool,!0]})},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.change,function(){return e._sorted_dirty=!0})},e.prototype.v_compute=function(t){for(var e=new Float64Array(t.length),i=0;i<t.length;i++){var n=t[i];e[i]=this.compute(n)}return e},e.prototype.sort=function(t){if(void 0===t&&(t=!1),this._sorted_dirty){var e,i;if(a.isString(this.x)&&a.isString(this.y)&&null!=this.data){var n=this.data.columns();if(!s.includes(n,this.x))throw new Error(\"The x parameter does not correspond to a valid column name defined in the data parameter\");if(!s.includes(n,this.y))throw new Error(\"The y parameter does not correspond to a valid column name defined in the data parameter\");e=this.data.get_column(this.x),i=this.data.get_column(this.y)}else{if(!a.isArray(this.x)||!a.isArray(this.y))throw new Error(\"parameters 'x' and 'y' must be both either string fields or arrays\");e=this.x,i=this.y}if(e.length!==i.length)throw new Error(\"The length for x and y do not match\");if(e.length<2)throw new Error(\"x and y must have at least two elements to support interpolation\");var r=[];for(var o in e)r.push({x:e[o],y:i[o]});t?r.sort(function(t,e){return t.x>e.x?-1:t.x==e.x?0:1}):r.sort(function(t,e){return t.x<e.x?-1:t.x==e.x?0:1}),this._x_sorted=[],this._y_sorted=[];for(var l=0,h=r;l<h.length;l++){var c=h[l],u=c.x,_=c.y;this._x_sorted.push(u),this._y_sorted.push(_)}this._sorted_dirty=!1}},e}(r.Transform);i.Interpolator=l,l.initClass()},function(t,e,i){var n=t(379),r=t(257),o=t(165),s=t(44),a=t(15),l=t(31),h=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Jitter\",this.define({mean:[a.Number,0],width:[a.Number,1],distribution:[a.Distribution,\"uniform\"],range:[a.Instance]})},e.prototype.v_compute=function(t){var e;if(this.range instanceof o.FactorRange)e=this.range.v_synthetic(t);else{if(!s.isArrayableOf(t,s.isNumber))throw new Error(\"unexpected\");e=t}for(var i=new Float64Array(e.length),n=0;n<e.length;n++){var r=e[n];i[n]=this._compute(r)}return i},e.prototype.compute=function(t){if(this.range instanceof o.FactorRange)return this._compute(this.range.synthetic(t));if(s.isNumber(t))return this._compute(t);throw new Error(\"unexpected\")},e.prototype._compute=function(t){switch(this.distribution){case\"uniform\":return t+this.mean+(l.random()-.5)*this.width;case\"normal\":return t+l.rnorm(this.mean,this.width)}},e}(r.Transform);i.Jitter=h,h.initClass()},function(t,e,i){var n=t(379),r=t(21),o=t(253),s=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"LinearInterpolator\"},e.prototype.compute=function(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}if(t==this._x_sorted[0])return this._y_sorted[0];var e=r.findLastIndex(this._x_sorted,function(e){return e<t}),i=this._x_sorted[e],n=this._x_sorted[e+1],o=this._y_sorted[e],s=this._y_sorted[e+1];return o+(t-i)/(n-i)*(s-o)},e}(o.Interpolator);i.LinearInterpolator=s,s.initClass()},function(t,e,i){var n=t(379),r=t(253),o=t(15),s=t(21),a=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"StepInterpolator\",this.define({mode:[o.StepMode,\"after\"]})},e.prototype.compute=function(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}var e;switch(this.mode){case\"after\":e=s.findLastIndex(this._x_sorted,function(e){return t>=e});break;case\"before\":e=s.findIndex(this._x_sorted,function(e){return t<=e});break;case\"center\":var i=this._x_sorted.map(function(e){return Math.abs(e-t)}),n=s.min(i);e=s.findIndex(i,function(t){return n===t});break;default:throw new Error(\"unknown mode: \"+this.mode)}return-1!=e?this._y_sorted[e]:NaN},e}(r.Interpolator);i.StepInterpolator=a,a.initClass()},function(t,e,i){var n=t(379),r=t(53),o=function(t){function e(e){return t.call(this,e)||this}return n.__extends(e,t),e.initClass=function(){this.prototype.type=\"Transform\"},e}(r.Model);i.Transform=o,o.initClass()},function(t,e,i){\"function\"!=typeof WeakMap&&t(328),\"function\"!=typeof Set&&t(318),Number.isInteger||(Number.isInteger=function(t){return\"number\"==typeof t&&isFinite(t)&&Math.floor(t)===t});var n=String.prototype;n.repeat||(n.repeat=function(t){if(null==this)throw new TypeError(\"can't convert \"+this+\" to object\");var e=\"\"+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError(\"repeat count must be non-negative\");if(t==1/0)throw new RangeError(\"repeat count must be less than infinity\");if(t=Math.floor(t),0==e.length||0==t)return\"\";if(e.length*t>=1<<28)throw new RangeError(\"repeat count must not overflow maximum string size\");for(var i=\"\";1==(1&t)&&(i+=e),0!=(t>>>=1);)e+=e;return i}),Array.from||(Array.from=function(){var t=Object.prototype.toString,e=function(e){return\"function\"==typeof e||\"[object Function]\"===t.call(e)},i=Math.pow(2,53)-1,n=function(t){var e=function(t){var e=Number(t);if(isNaN(e))return 0;if(0===e||!isFinite(e))return e;return(e>0?1:-1)*Math.floor(Math.abs(e))}(t);return Math.min(Math.max(e,0),i)};return function(t){var i=Object(t);if(null==t)throw new TypeError(\"Array.from requires an array-like object - not null or undefined\");var r,o=arguments.length>1?arguments[1]:void 0;if(void 0!==o){if(!e(o))throw new TypeError(\"Array.from: when provided, the second argument must be a function\");arguments.length>2&&(r=arguments[2])}for(var s=n(i.length),a=e(this)?Object(new this(s)):new Array(s),l=0;l<s;){var h=i[l];a[l]=o?void 0===r?o(h,l):o.call(r,h,l):h,l+=1}return a.length=s,a}}())},function(t,e,i){var n=t(379);n.__exportStar(t(260),i),n.__exportStar(t(261),i)},function(t,e,i){var n=t(38),r=function(){function t(t,e,i){this.header=t,this.metadata=e,this.content=i,this.buffers=[]}return t.assemble=function(e,i,n){var r=JSON.parse(e),o=JSON.parse(i),s=JSON.parse(n);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var i=null!=this.header.num_buffers?this.header.num_buffers:0;if(i<=this.buffers.length)throw new Error(\"too many buffers received, expecting #{nb}\");this.buffers.push([t,e])},t.create=function(e,i,n){void 0===n&&(n={});var r=t.create_header(e);return new t(r,i,n)},t.create_header=function(t){return{msgid:n.uniqueId(),msgtype:t}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!(\"num_buffers\"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error(\"BokehJS only supports receiving buffers, not sending\");var i=JSON.stringify(this.header),n=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(i),t.send(n),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return\"msgid\"in this.header?\"msgtype\"in this.header?null:\"No msgtype in header\":\"No msgid in header\"},t}();i.Message=r},function(t,e,i){var n=t(260),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),i=e[0],r=e[1],o=e[2];this._partial=n.Message.assemble(i,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error(\"Expected text fragment but received binary fragment\")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error(\"Expected binary fragment but received text fragment\")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();i.Receiver=r},function(t,e,i){i.safely=function(t,e){void 0===e&&(e=!1);try{return t()}catch(t){if(function(t){var e=document.createElement(\"div\");e.style.backgroundColor=\"#f2dede\",e.style.border=\"1px solid #a94442\",e.style.borderRadius=\"4px\",e.style.display=\"inline-block\",e.style.fontFamily=\"sans-serif\",e.style.marginTop=\"5px\",e.style.minWidth=\"200px\",e.style.padding=\"5px 5px 5px 10px\";var i=document.createElement(\"span\");i.style.backgroundColor=\"#a94442\",i.style.borderRadius=\"0px 4px 0px 0px\",i.style.color=\"white\",i.style.cursor=\"pointer\",i.style.cssFloat=\"right\",i.style.fontSize=\"0.8em\",i.style.margin=\"-6px -6px 0px 0px\",i.style.padding=\"2px 5px 4px 5px\",i.title=\"close\",i.setAttribute(\"aria-label\",\"close\"),i.appendChild(document.createTextNode(\"x\")),i.addEventListener(\"click\",function(){return o.removeChild(e)});var n=document.createElement(\"h3\");n.style.color=\"#a94442\",n.style.margin=\"8px 0px 0px 0px\",n.style.padding=\"0px\",n.appendChild(document.createTextNode(\"Bokeh Error\"));var r=document.createElement(\"pre\");r.style.whiteSpace=\"unset\",r.style.overflowX=\"auto\",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(i),e.appendChild(n),e.appendChild(r);var o=document.getElementsByTagName(\"body\")[0];o.insertBefore(e,o.firstChild)}(t),e)return;throw t}}},function(t,e,i){i.version=\"0.12.15\"},/*!!\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,i){!function(){\"use strict\";function t(t,e){var i,n=Object.keys(e);for(i=0;i<n.length;i++)t=t.replace(new RegExp(\"\\\\{\"+n[i]+\"\\\\}\",\"gi\"),e[n[i]]);return t}function i(t){var e,i,n;if(!t)throw new Error(\"cannot create a random attribute name for an undefined object\");e=\"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\",i=\"\";do{for(i=\"\",n=0;n<12;n++)i+=e[Math.floor(Math.random()*e.length)]}while(t[i]);return i}var n,r,o,s,a;a=function(t,e){var i,n,r,o={};for(t=t.split(\",\"),e=e||10,i=0;i<t.length;i+=2)n=\"&\"+t[i+1]+\";\",r=parseInt(t[i],e),o[n]=\"&#\"+r+\";\";return o[\"\\\\xa0\"]=\"&#160;\",o}(\"50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro\",32),n={strokeStyle:{svgAttr:\"stroke\",canvas:\"#000000\",svg:\"none\",apply:\"stroke\"},fillStyle:{svgAttr:\"fill\",canvas:\"#000000\",svg:null,apply:\"fill\"},lineCap:{svgAttr:\"stroke-linecap\",canvas:\"butt\",svg:\"butt\",apply:\"stroke\"},lineJoin:{svgAttr:\"stroke-linejoin\",canvas:\"miter\",svg:\"miter\",apply:\"stroke\"},miterLimit:{svgAttr:\"stroke-miterlimit\",canvas:10,svg:4,apply:\"stroke\"},lineWidth:{svgAttr:\"stroke-width\",canvas:1,svg:1,apply:\"stroke\"},globalAlpha:{svgAttr:\"opacity\",canvas:1,svg:1,apply:\"fill stroke\"},font:{canvas:\"10px sans-serif\"},shadowColor:{canvas:\"#000000\"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:\"start\"},textBaseline:{canvas:\"alphabetic\"},lineDash:{svgAttr:\"stroke-dasharray\",canvas:[],svg:null,apply:\"stroke\"}},(o=function(t,e){this.__root=t,this.__ctx=e}).prototype.addColorStop=function(e,i){var n,r=this.__ctx.__createElement(\"stop\");r.setAttribute(\"offset\",e),-1!==i.indexOf(\"rgba\")?(n=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi.exec(i),r.setAttribute(\"stop-color\",t(\"rgb({r},{g},{b})\",{r:n[1],g:n[2],b:n[3]})),r.setAttribute(\"stop-opacity\",n[4])):r.setAttribute(\"stop-color\",i),this.__root.appendChild(r)},s=function(t,e){this.__root=t,this.__ctx=e},(r=function(t){var e,i={width:500,height:500,enableMirroring:!1};if(arguments.length>1?((e=i).width=arguments[0],e.height=arguments[1]):e=t||i,!(this instanceof r))return new r(e);this.width=e.width||i.width,this.height=e.height||i.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:i.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement(\"canvas\"),this.__ctx=this.__canvas.getContext(\"2d\")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\"),this.__root.setAttribute(\"version\",1.1),this.__root.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\",\"xmlns:xlink\",\"http://www.w3.org/1999/xlink\"),this.__root.setAttribute(\"width\",this.width),this.__root.setAttribute(\"height\",this.height),this.__ids={},this.__defs=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"),this.__root.appendChild(this.__currentElement)}).prototype.__createElement=function(t,e,i){void 0===e&&(e={});var n,r,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",t),s=Object.keys(e);for(i&&(o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"stroke\",\"none\")),n=0;n<s.length;n++)r=s[n],o.setAttribute(r,e[r]);return o},r.prototype.__setDefaultStyles=function(){var t,e,i=Object.keys(n);for(t=0;t<i.length;t++)this[e=i[t]]=n[e].canvas},r.prototype.__applyStyleState=function(t){var e,i,n=Object.keys(t);for(e=0;e<n.length;e++)this[i=n[e]]=t[i]},r.prototype.__getStyleState=function(){var t,e,i={},r=Object.keys(n);for(t=0;t<r.length;t++)e=r[t],i[e]=this[e];return i},r.prototype.__applyStyleToCurrentElement=function(e){var i=this.__currentElement,r=this.__currentElementsToStyle;r&&(i.setAttribute(e,\"\"),i=r.element,r.children.forEach(function(t){t.setAttribute(e,\"\")}));var a,l,h,c,u,_=Object.keys(n);for(a=0;a<_.length;a++)if(l=n[_[a]],h=this[_[a]],l.apply)if(h instanceof s){if(h.__ctx)for(;h.__ctx.__defs.childNodes.length;)c=h.__ctx.__defs.childNodes[0].getAttribute(\"id\"),this.__ids[c]=c,this.__defs.appendChild(h.__ctx.__defs.childNodes[0]);i.setAttribute(l.apply,t(\"url(#{id})\",{id:h.__root.getAttribute(\"id\")}))}else if(h instanceof o)i.setAttribute(l.apply,t(\"url(#{id})\",{id:h.__root.getAttribute(\"id\")}));else if(-1!==l.apply.indexOf(e)&&l.svg!==h)if(\"stroke\"!==l.svgAttr&&\"fill\"!==l.svgAttr||-1===h.indexOf(\"rgba\")){var p=l.svgAttr;if(\"globalAlpha\"===_[a]&&(p=e+\"-\"+l.svgAttr,i.getAttribute(p)))continue;i.setAttribute(p,h)}else{u=/rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi.exec(h),i.setAttribute(l.svgAttr,t(\"rgb({r},{g},{b})\",{r:u[1],g:u[2],b:u[3]}));var d=u[4],f=this.globalAlpha;null!=f&&(d*=f),i.setAttribute(l.svgAttr+\"-opacity\",d)}},r.prototype.__closestGroupOrSvg=function(t){return\"g\"===(t=t||this.__currentElement).nodeName||\"svg\"===t.nodeName?t:this.__closestGroupOrSvg(t.parentNode)},r.prototype.getSerializedSvg=function(t){var e,i,n,r,o,s=(new XMLSerializer).serializeToString(this.__root);if(/xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg\".+xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg/gi.test(s)&&(s=s.replace('xmlns=\"http://www.w3.org/2000/svg','xmlns:xlink=\"http://www.w3.org/1999/xlink')),t)for(e=Object.keys(a),i=0;i<e.length;i++)n=e[i],r=a[n],(o=new RegExp(n,\"gi\")).test(s)&&(s=s.replace(o,r));return s},r.prototype.getSvg=function(){return this.__root},r.prototype.save=function(){var t=this.__createElement(\"g\"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__stack.push(this.__getStyleState())},r.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var t=this.__stack.pop();this.__applyStyleState(t)},r.prototype.__addTransform=function(t){var e=this.__closestGroupOrSvg();if(e.childNodes.length>0){\"path\"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement(\"g\");e.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute(\"transform\");n?n+=\" \":n=\"\",n+=t,this.__currentElement.setAttribute(\"transform\",n)},r.prototype.scale=function(e,i){void 0===i&&(i=e),this.__addTransform(t(\"scale({x},{y})\",{x:e,y:i}))},r.prototype.rotate=function(e){var i=180*e/Math.PI;this.__addTransform(t(\"rotate({angle},{cx},{cy})\",{angle:i,cx:0,cy:0}))},r.prototype.translate=function(e,i){this.__addTransform(t(\"translate({x},{y})\",{x:e,y:i}))},r.prototype.transform=function(e,i,n,r,o,s){this.__addTransform(t(\"matrix({a},{b},{c},{d},{e},{f})\",{a:e,b:i,c:n,d:r,e:o,f:s}))},r.prototype.beginPath=function(){var t;this.__currentDefaultPath=\"\",this.__currentPosition={},t=this.__createElement(\"path\",{},!0),this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t},r.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;\"path\"===t.nodeName?t.setAttribute(\"d\",this.__currentDefaultPath):console.error(\"Attempted to apply path command to node\",t.nodeName)},r.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=\" \",this.__currentDefaultPath+=t},r.prototype.moveTo=function(e,i){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:i},this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:i}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand(\"Z\")},r.prototype.lineTo=function(e,i){this.__currentPosition={x:e,y:i},this.__currentDefaultPath.indexOf(\"M\")>-1?this.__addPathCommand(t(\"L {x} {y}\",{x:e,y:i})):this.__addPathCommand(t(\"M {x} {y}\",{x:e,y:i}))},r.prototype.bezierCurveTo=function(e,i,n,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",{cp1x:e,cp1y:i,cp2x:n,cp2y:r,x:o,y:s}))},r.prototype.quadraticCurveTo=function(e,i,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(t(\"Q {cpx} {cpy} {x} {y}\",{cpx:e,cpy:i,x:n,y:r}))};var l=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};r.prototype.arcTo=function(t,e,i,n,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if(void 0!==o&&void 0!==s){if(r<0)throw new Error(\"IndexSizeError: The radius provided (\"+r+\") is negative.\");if(o===t&&s===e||t===i&&e===n||0===r)this.lineTo(t,e);else{var a=l([o-t,s-e]),h=l([i-t,n-e]);if(a[0]*h[1]!=a[1]*h[0]){var c=a[0]*h[0]+a[1]*h[1],u=Math.acos(Math.abs(c)),_=l([a[0]+h[0],a[1]+h[1]]),p=r/Math.sin(u/2),d=t+p*_[0],f=e+p*_[1],v=[-a[1],a[0]],m=[h[1],-h[0]],g=function(t){var e=t[0],i=t[1];return i>=0?Math.acos(e):-Math.acos(e)},y=g(v),b=g(m);this.lineTo(d+v[0]*r,f+v[1]*r),this.arc(d,f,r,y,b)}else this.lineTo(t,e)}}},r.prototype.stroke=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"fill stroke markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.fill=function(){\"path\"===this.__currentElement.nodeName&&this.__currentElement.setAttribute(\"paint-order\",\"stroke fill markers\"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(\"fill\")},r.prototype.rect=function(t,e,i,n){\"path\"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()},r.prototype.fillRect=function(t,e,i,n){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"fill\")},r.prototype.strokeRect=function(t,e,i,n){var r;r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement(\"stroke\")},r.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute(\"transform\"),i=this.__root.childNodes[1],n=i.childNodes,r=n.length-1;r>=0;r--)n[r]&&i.removeChild(n[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)},r.prototype.clearRect=function(t,e,i,n){if(0!==t||0!==e||i!==this.width||n!==this.height){var r,o=this.__closestGroupOrSvg();r=this.__createElement(\"rect\",{x:t,y:e,width:i,height:n,fill:\"#FFFFFF\"},!0),o.appendChild(r)}else this.__clearCanvas()},r.prototype.createLinearGradient=function(t,e,n,r){var s=this.__createElement(\"linearGradient\",{id:i(this.__ids),x1:t+\"px\",x2:n+\"px\",y1:e+\"px\",y2:r+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(s),new o(s,this)},r.prototype.createRadialGradient=function(t,e,n,r,s,a){var l=this.__createElement(\"radialGradient\",{id:i(this.__ids),cx:r+\"px\",cy:s+\"px\",r:a+\"px\",fx:t+\"px\",fy:e+\"px\",gradientUnits:\"userSpaceOnUse\"},!1);return this.__defs.appendChild(l),new o(l,this)},r.prototype.__parseFont=function(){var t=/^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\'\\\"\\sa-z0-9]+?)\\s*$/i.exec(this.font),e={style:t[1]||\"normal\",size:t[4]||\"10px\",family:t[6]||\"sans-serif\",weight:t[3]||\"normal\",decoration:t[2]||\"normal\",href:null};return\"underline\"===this.__fontUnderline&&(e.decoration=\"underline\"),this.__fontHref&&(e.href=this.__fontHref),e},r.prototype.__wrapTextLink=function(t,e){if(t.href){var i=this.__createElement(\"a\");return i.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",t.href),i.appendChild(e),i}return e},r.prototype.__applyText=function(t,e,i,n){var r=this.__parseFont(),o=this.__closestGroupOrSvg(),s=this.__createElement(\"text\",{\"font-family\":r.family,\"font-size\":r.size,\"font-style\":r.style,\"font-weight\":r.weight,\"text-decoration\":r.decoration,x:e,y:i,\"text-anchor\":function(t){var e={left:\"start\",right:\"end\",center:\"middle\",start:\"start\",end:\"end\"};return e[t]||e.start}(this.textAlign),\"dominant-baseline\":function(t){var e={alphabetic:\"alphabetic\",hanging:\"hanging\",top:\"text-before-edge\",bottom:\"text-after-edge\",middle:\"central\"};return e[t]||e.alphabetic}(this.textBaseline)},!0);s.appendChild(this.__document.createTextNode(t)),this.__currentElement=s,this.__applyStyleToCurrentElement(n),o.appendChild(this.__wrapTextLink(r,s))},r.prototype.fillText=function(t,e,i){this.__applyText(t,e,i,\"fill\")},r.prototype.strokeText=function(t,e,i){this.__applyText(t,e,i,\"stroke\")},r.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},r.prototype.arc=function(e,i,n,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+n*Math.cos(o),l=i+n*Math.sin(o),h=e+n*Math.cos(r),c=i+n*Math.sin(r),u=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(h,c),this.__addPathCommand(t(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:_,sweepFlag:u,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),n=this.__createElement(\"clipPath\"),r=i(this.__ids),o=this.__createElement(\"g\");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),n.setAttribute(\"id\",r),n.appendChild(this.__currentElement),this.__defs.appendChild(n),e.setAttribute(\"clip-path\",t(\"url(#{id})\",{id:r})),e.appendChild(o),this.__currentElement=o},r.prototype.drawImage=function(){var t,e,i,n,o,s,a,l,h,c,u,_,p,d,f=Array.prototype.slice.call(arguments),v=f[0],m=0,g=0;if(3===f.length)t=f[1],e=f[2],o=v.width,s=v.height,i=o,n=s;else if(5===f.length)t=f[1],e=f[2],i=f[3],n=f[4],o=v.width,s=v.height;else{if(9!==f.length)throw new Error(\"Inavlid number of arguments passed to drawImage: \"+arguments.length);m=f[1],g=f[2],o=f[3],s=f[4],t=f[5],e=f[6],i=f[7],n=f[8]}a=this.__closestGroupOrSvg(),this.__currentElement;var y=\"translate(\"+t+\", \"+e+\")\";if(v instanceof r){if((l=v.getSvg().cloneNode(!0)).childNodes&&l.childNodes.length>1){for(h=l.childNodes[0];h.childNodes.length;)d=h.childNodes[0].getAttribute(\"id\"),this.__ids[d]=d,this.__defs.appendChild(h.childNodes[0]);if(c=l.childNodes[1]){var b,x=c.getAttribute(\"transform\");b=x?x+\" \"+y:y,c.setAttribute(\"transform\",b),a.appendChild(c)}}}else\"IMG\"===v.nodeName?((u=this.__createElement(\"image\")).setAttribute(\"width\",i),u.setAttribute(\"height\",n),u.setAttribute(\"preserveAspectRatio\",\"none\"),(m||g||o!==v.width||s!==v.height)&&((_=this.__document.createElement(\"canvas\")).width=i,_.height=n,(p=_.getContext(\"2d\")).drawImage(v,m,g,o,s,0,0,i,n),v=_),u.setAttribute(\"transform\",y),u.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===v.nodeName?v.toDataURL():v.getAttribute(\"src\")),a.appendChild(u)):\"CANVAS\"===v.nodeName&&((u=this.__createElement(\"image\")).setAttribute(\"width\",i),u.setAttribute(\"height\",n),u.setAttribute(\"preserveAspectRatio\",\"none\"),(_=this.__document.createElement(\"canvas\")).width=i,_.height=n,(p=_.getContext(\"2d\")).imageSmoothingEnabled=!1,p.mozImageSmoothingEnabled=!1,p.oImageSmoothingEnabled=!1,p.webkitImageSmoothingEnabled=!1,p.drawImage(v,m,g,o,s,0,0,i,n),v=_,u.setAttribute(\"transform\",y),u.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",v.toDataURL()),a.appendChild(u))},r.prototype.createPattern=function(t,e){var n,o=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"pattern\"),a=i(this.__ids);return o.setAttribute(\"id\",a),o.setAttribute(\"width\",t.width),o.setAttribute(\"height\",t.height),\"CANVAS\"===t.nodeName||\"IMG\"===t.nodeName?((n=this.__document.createElementNS(\"http://www.w3.org/2000/svg\",\"image\")).setAttribute(\"width\",t.width),n.setAttribute(\"height\",t.height),n.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",\"CANVAS\"===t.nodeName?t.toDataURL():t.getAttribute(\"src\")),o.appendChild(n),this.__defs.appendChild(o)):t instanceof r&&(o.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(o)),new s(o,this)},r.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(\",\"):this.lineDash=null},r.prototype.drawFocusRing=function(){},r.prototype.createImageData=function(){},r.prototype.getImageData=function(){},r.prototype.putImageData=function(){},r.prototype.globalCompositeOperation=function(){},r.prototype.setTransform=function(){},\"object\"==typeof window&&(window.C2S=r),\"object\"==typeof e&&\"object\"==typeof e.exports&&(e.exports=r)}()},function(t,e,i){var n,r=t(288),o=t(298),s=t(302),a=t(297),l=t(302),h=t(304),c=Function.prototype.bind,u=Object.defineProperty,_=Object.prototype.hasOwnProperty;n=function(t,e,i){var n,o=h(e)&&l(e.value);return n=r(e),delete n.writable,delete n.value,n.get=function(){return!i.overwriteDefinition&&_.call(this,t)?o:(e.value=c.call(o,i.resolveContext?i.resolveContext(this):this),u(this,t,e),this[t])},n},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,i){return n(i,t,e)})}},function(t,e,i){var n=t(285),r=t(298),o=t(291),s=t(305);(e.exports=function(t,e){var i,o,a,l,h;return arguments.length<2||\"string\"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(i=a=!0,o=!1):(i=s.call(t,\"c\"),o=s.call(t,\"e\"),a=s.call(t,\"w\")),h={value:e,configurable:i,enumerable:o,writable:a},l?n(r(l),h):h}).gs=function(t,e,i){var a,l,h,c;return\"string\"!=typeof t?(h=i,i=e,e=t,t=null):h=arguments[3],null==e?e=void 0:o(e)?null==i?i=void 0:o(i)||(h=i,i=void 0):(h=e,e=i=void 0),null==t?(a=!0,l=!1):(a=s.call(t,\"c\"),l=s.call(t,\"e\")),c={get:e,set:i,configurable:a,enumerable:l},h?n(r(h),c):c}},function(t,e,i){var n=t(304);e.exports=function(){return n(this).length=0,this}},function(t,e,i){var n=t(279),r=t(283),o=t(304),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,h=Math.floor;e.exports=function(t){var e,i,c,u;if(!n(t))return s.apply(this,arguments);for(i=r(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?h(c):r(this.length)-h(l(c)),e=c;e<i;++e)if(a.call(this,e)&&(u=this[e],n(u)))return e;return-1}},function(t,e,i){e.exports=t(270)()?Array.from:t(271)},function(t,e,i){e.exports=function(){var t,e,i=Array.from;return\"function\"==typeof i&&(t=[\"raz\",\"dwa\"],e=i(t),Boolean(e&&e!==t&&\"dwa\"===e[1]))}},function(t,e,i){var n=t(323).iterator,r=t(272),o=t(273),s=t(283),a=t(302),l=t(304),h=t(293),c=t(308),u=Array.isArray,_=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(t){var e,i,f,v,m,g,y,b,x,w,k=arguments[1],S=arguments[2];if(t=Object(l(t)),h(k)&&a(k),this&&this!==Array&&o(this))e=this;else{if(!k){if(r(t))return 1!==(m=t.length)?Array.apply(null,t):(v=new Array(1),v[0]=t[0],v);if(u(t)){for(v=new Array(m=t.length),i=0;i<m;++i)v[i]=t[i];return v}}v=[]}if(!u(t))if(void 0!==(x=t[n])){for(y=a(x).call(t),e&&(v=new e),b=y.next(),i=0;!b.done;)w=k?_.call(k,S,b.value,i):b.value,e?(p.value=w,d(v,i,p)):v[i]=w,b=y.next(),++i;m=i}else if(c(t)){for(m=t.length,e&&(v=new e),i=0,f=0;i<m;++i)w=t[i],i+1<m&&(g=w.charCodeAt(0))>=55296&&g<=56319&&(w+=t[++i]),w=k?_.call(k,S,w,f):w,e?(p.value=w,d(v,f,p)):v[f]=w,++f;m=f}if(void 0===m)for(m=s(t.length),e&&(v=new e(m)),i=0;i<m;++i)w=k?_.call(k,S,t[i],i):t[i],e?(p.value=w,d(v,i,p)):v[i]=w;return e&&(p.value=null,v.length=m),v}},function(t,e,i){var n=Object.prototype.toString,r=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===r}},function(t,e,i){var n=Object.prototype.toString,r=n.call(t(274));e.exports=function(t){return\"function\"==typeof t&&n.call(t)===r}},function(t,e,i){e.exports=function(){}},function(t,e,i){e.exports=function(){return this}()},function(t,e,i){e.exports=t(277)()?Math.sign:t(278)},function(t,e,i){e.exports=function(){var t=Math.sign;return\"function\"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,i){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,i){e.exports=t(280)()?Number.isNaN:t(281)},function(t,e,i){e.exports=function(){var t=Number.isNaN;return\"function\"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,i){e.exports=function(t){return t!=t}},function(t,e,i){var n=t(276),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(r(t)):t}},function(t,e,i){var n=t(282),r=Math.max;e.exports=function(t){return r(0,n(t))}},function(t,e,i){var n=t(302),r=t(304),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(i,h){var c,u=arguments[2],_=arguments[3];return i=Object(r(i)),n(h),c=a(i),_&&c.sort(\"function\"==typeof _?o.call(_,i):void 0),\"function\"!=typeof t&&(t=c[t]),s.call(t,c,function(t,n){return l.call(i,t)?s.call(h,u,i[t],t,i,n):e})}}},function(t,e,i){e.exports=t(286)()?Object.assign:t(287)},function(t,e,i){e.exports=function(){var t,e=Object.assign;return\"function\"==typeof e&&(t={foo:\"raz\"},e(t,{bar:\"dwa\"},{trzy:\"trzy\"}),t.foo+t.bar+t.trzy===\"razdwatrzy\")}},function(t,e,i){var n=t(294),r=t(304),o=Math.max;e.exports=function(t,e){var i,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(n){try{t[n]=e[n]}catch(t){i||(i=t)}},s=1;s<l;++s)e=arguments[s],n(e).forEach(a);if(void 0!==i)throw i;return t}},function(t,e,i){var n=t(269),r=t(285),o=t(304);e.exports=function(t){var e=Object(o(t)),i=arguments[1],s=Object(arguments[2]);if(e!==t&&!i)return e;var a={};return i?n(i,function(e){(s.ensure||e in t)&&(a[e]=t[e])}):r(a,t),a}},function(t,e,i){var n,r=Object.create;t(300)()||(n=t(301)),e.exports=function(){var t,e,i;return n?1!==n.level?r:(t={},e={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){e[t]=\"__proto__\"!==t?i:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(t,e),Object.defineProperty(n,\"nullPolyfill\",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,i){return r(null===e?t:e,i)}):r}()},function(t,e,i){e.exports=t(284)(\"forEach\")},function(t,e,i){e.exports=function(t){return\"function\"==typeof t}},function(t,e,i){var n=t(293),r={function:!0,object:!0};e.exports=function(t){return n(t)&&r[typeof t]||!1}},function(t,e,i){var n=t(274)();e.exports=function(t){return t!==n&&null!==t}},function(t,e,i){e.exports=t(295)()?Object.keys:t(296)},function(t,e,i){e.exports=function(){try{return Object.keys(\"primitive\"),!0}catch(t){return!1}}},function(t,e,i){var n=t(293),r=Object.keys;e.exports=function(t){return r(n(t)?Object(t):t)}},function(t,e,i){var n=t(302),r=t(290),o=Function.prototype.call;e.exports=function(t,e){var i={},s=arguments[2];return n(e),r(t,function(t,n,r,a){i[n]=o.call(e,s,t,n,r,a)}),i}},function(t,e,i){var n=t(293),r=Array.prototype.forEach,o=Object.create;e.exports=function(t){var e=o(null);return r.call(arguments,function(t){n(t)&&function(t,e){var i;for(i in t)e[i]=t[i]}(Object(t),e)}),e}},function(t,e,i){e.exports=t(300)()?Object.setPrototypeOf:t(301)},function(t,e,i){var n=Object.create,r=Object.getPrototypeOf,o={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return\"function\"==typeof t&&r(t(e(null),o))===o}},function(t,e,i){var n,r=t(292),o=t(304),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(o(t),null===e||r(e))return t;throw new TypeError(\"Prototype must be null or an object\")},e.exports=function(t){var e,i;return t?(2===t.level?t.set?(i=t.set,e=function(t,e){return i.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,i){var r;return n(e,i),(r=s.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===i&&(i=t.nullPolyfill),e.__proto__=i,r&&a(t.nullPolyfill,\"__proto__\",l),e},Object.defineProperty(e,\"level\",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),i={},n=Object.getOwnPropertyDescriptor(Object.prototype,\"__proto__\");if(n){try{(t=n.set).call(e,i)}catch(t){}if(Object.getPrototypeOf(e)===i)return{set:t,level:2}}return e.__proto__=i,Object.getPrototypeOf(e)===i?{level:2}:(e={},e.__proto__=i,Object.getPrototypeOf(e)===i&&{level:1})}()),t(289)},function(t,e,i){e.exports=function(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return t}},function(t,e,i){var n=t(292);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not an Object\");return t}},function(t,e,i){var n=t(293);e.exports=function(t){if(!n(t))throw new TypeError(\"Cannot use null or undefined\");return t}},function(t,e,i){e.exports=t(306)()?String.prototype.contains:t(307)},function(t,e,i){e.exports=function(){return\"function\"==typeof\"razdwatrzy\".contains&&(!0===\"razdwatrzy\".contains(\"dwa\")&&!1===\"razdwatrzy\".contains(\"foo\"))}},function(t,e,i){var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,i){var n=Object.prototype.toString,r=n.call(\"\");e.exports=function(t){return\"string\"==typeof t||t&&\"object\"==typeof t&&(t instanceof String||n.call(t)===r)||!1}},function(t,e,i){var n=Object.create(null),r=Math.random;e.exports=function(){var t;do{t=r().toString(36).slice(2)}while(n[t]);return t}},function(t,e,i){var n,r=t(299),o=t(305),s=t(266),a=t(323),l=t(313),h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");l.call(this,t),e=e?o.call(e,\"key+value\")?\"key+value\":o.call(e,\"key\")?\"key\":\"value\":\"value\",h(this,\"__kind__\",s(\"\",e))},r&&r(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:\"key+value\"===this.__kind__?[t,this.__list__[t]]:t})}),h(n.prototype,a.toStringTag,s(\"c\",\"Array Iterator\"))},function(t,e,i){var n=t(272),r=t(302),o=t(308),s=t(312),a=Array.isArray,l=Function.prototype.call,h=Array.prototype.some;e.exports=function(t,e){var i,c,u,_,p,d,f,v,m=arguments[2];if(a(t)||n(t)?i=\"array\":o(t)?i=\"string\":t=s(t),r(e),u=function(){_=!0},\"array\"!==i)if(\"string\"!==i)for(c=t.next();!c.done;){if(l.call(e,m,c.value,u),_)return;c=t.next()}else for(d=t.length,p=0;p<d&&(f=t[p],p+1<d&&(v=f.charCodeAt(0))>=55296&&v<=56319&&(f+=t[++p]),l.call(e,m,f,u),!_);++p);else h.call(t,function(t){return l.call(e,m,t,u),_})}},function(t,e,i){var n=t(272),r=t(308),o=t(310),s=t(315),a=t(316),l=t(323).iterator;e.exports=function(t){return\"function\"==typeof a(t)[l]?t[l]():n(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,i){var n,r=t(267),o=t(285),s=t(302),a=t(304),l=t(266),h=t(265),c=t(323),u=Object.defineProperty,_=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");_(this,{__list__:l(\"w\",a(t)),__context__:l(\"w\",e),__nextIndex__:l(\"w\",0)}),e&&(s(e.on),e.on(\"_add\",this._onAdd),e.on(\"_delete\",this._onDelete),e.on(\"_clear\",this._onClear))},delete n.prototype.constructor,_(n.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()}),next:l(function(){return this._createResult(this._next())}),_createResult:l(function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}}),_resolve:l(function(t){return this.__list__[t]}),_unBind:l(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off(\"_add\",this._onAdd),this.__context__.off(\"_delete\",this._onDelete),this.__context__.off(\"_clear\",this._onClear),this.__context__=null)}),toString:l(function(){return\"[object \"+(this[c.toStringTag]||\"Object\")+\"]\"})},h({_onAdd:l(function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,i){e>=t&&(this.__redo__[i]=++e)},this),this.__redo__.push(t)):u(this,\"__redo__\",l(\"c\",[t])))}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,i){e>t&&(this.__redo__[i]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),u(n.prototype,c.iterator,l(function(){return this}))},function(t,e,i){var n=t(272),r=t(293),o=t(308),s=t(323).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!n(t)||\"function\"==typeof t[s])))}},function(t,e,i){var n,r=t(299),o=t(266),s=t(323),a=t(313),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");t=String(t),a.call(this,t),l(this,\"__length__\",o(\"\",t.length))},r&&r(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()}),_resolve:o(function(t){var e,i=this.__list__[t];return this.__nextIndex__===this.__length__?i:(e=i.charCodeAt(0))>=55296&&e<=56319?i+this.__list__[this.__nextIndex__++]:i})}),l(n.prototype,s.toStringTag,o(\"c\",\"String Iterator\"))},function(t,e,i){var n=t(314);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not iterable\");return t}},/*!\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,i){(function(){\"use strict\";function i(t){return\"function\"==typeof t}function n(){return function(){setTimeout(r,1)}}function r(){for(var t=0;t<w;t+=2){var e=M[t],i=M[t+1];e(i),M[t]=void 0,M[t+1]=void 0}w=0}function o(){try{var e=t,i=e(\"vertx\");return g=i.runOnLoop||i.runOnContext,function(){g(r)}}catch(t){return n()}}function s(){}function a(t,e){if(e.constructor===t.constructor)!function(t,e){e._state===z?c(t,e._result):e._state===P?u(t,e._result):_(e,void 0,function(e){l(t,e)},function(e){u(t,e)})}(t,e);else{var n=function(t){try{return t.then}catch(t){return j.error=t,j}}(e);n===j?u(t,j.error):void 0===n?c(t,e):i(n)?function(t,e,i){k(function(t){var n=!1,r=function(t,e,i,n){try{t.call(e,i,n)}catch(t){return t}}(i,e,function(i){n||(n=!0,e!==i?l(t,i):c(t,i))},function(e){n||(n=!0,u(t,e))},t._label);!n&&r&&(n=!0,u(t,r))},t)}(t,e,n):c(t,e)}}function l(t,e){t===e?u(t,new TypeError(\"You cannot resolve a promise with itself\")):!function(t){return\"function\"==typeof t||\"object\"==typeof t&&null!==t}(e)?c(t,e):a(t,e)}function h(t){t._onerror&&t._onerror(t._result),p(t)}function c(t,e){t._state===O&&(t._result=e,t._state=z,0!==t._subscribers.length&&k(p,t))}function u(t,e){t._state===O&&(t._state=P,t._result=e,k(h,t))}function _(t,e,i,n){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+z]=i,r[o+P]=n,0===o&&t._state&&k(p,t)}function p(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var n,r,o=t._result,s=0;s<e.length;s+=3)n=e[s],r=e[s+i],n?f(i,n,r,o):r(o);t._subscribers.length=0}}function d(){this.error=null}function f(t,e,n,r){var o,s,a,h,_=i(n);if(_){if((o=function(t,e){try{return t(e)}catch(t){return N.error=t,N}}(n,r))===N?(h=!0,s=o.error,o=null):a=!0,e===o)return void u(e,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=r,a=!0;e._state!==O||(_&&a?l(e,o):h?u(e,s):t===z?c(e,o):t===P&&u(e,o))}function v(t,e){this._instanceConstructor=t,this.promise=new t(s),this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?c(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&c(this.promise,this._result))):u(this.promise,this._validationError())}function m(t){this._id=L++,this._state=void 0,this._result=void 0,this._subscribers=[],s!==t&&(i(t)||function(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}(),this instanceof m||function(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}(),function(t,e){try{e(function(e){l(t,e)},function(e){u(t,e)})}catch(e){u(t,e)}}(this,t))}var g,y,b,x=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},w=0,k=function(t,e){M[w]=t,M[w+1]=e,2===(w+=2)&&(y?y(r):b())},S=\"undefined\"!=typeof window?window:void 0,C=S||{},T=C.MutationObserver||C.WebKitMutationObserver,A=\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),E=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,M=new Array(1e3);b=A?function(){process.nextTick(r)}:T?function(){var t=0,e=new T(r),i=document.createTextNode(\"\");return e.observe(i,{characterData:!0}),function(){i.data=t=++t%2}}():E?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){t.port2.postMessage(0)}}():void 0===S&&\"function\"==typeof t?o():n();var O=void 0,z=1,P=2,j=new d,N=new d;v.prototype._validateInput=function(t){return x(t)},v.prototype._validationError=function(){return new Error(\"Array Methods must be provided an Array\")},v.prototype._init=function(){this._result=new Array(this.length)};var F=v;v.prototype._enumerate=function(){for(var t=this.length,e=this.promise,i=this._input,n=0;e._state===O&&n<t;n++)this._eachEntry(i[n],n)},v.prototype._eachEntry=function(t,e){var i=this._instanceConstructor;!function(t){return\"object\"==typeof t&&null!==t}(t)?(this._remaining--,this._result[e]=t):t.constructor===i&&t._state!==O?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(i.resolve(t),e)},v.prototype._settledAt=function(t,e,i){var n=this.promise;n._state===O&&(this._remaining--,t===P?u(n,i):this._result[e]=i),0===this._remaining&&c(n,this._result)},v.prototype._willSettleAt=function(t,e){var i=this;_(t,void 0,function(t){i._settledAt(z,e,t)},function(t){i._settledAt(P,e,t)})};var D=function(t){return new F(this,t).promise},I=function(t){function e(t){l(n,t)}function i(t){u(n,t)}var n=new this(s);if(!x(t))return u(n,new TypeError(\"You must pass an array to race.\")),n;var r=t.length;for(var o=0;n._state===O&&o<r;o++)_(this.resolve(t[o]),void 0,e,i);return n},B=function(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(s);return l(e,t),e},R=function(t){var e=new this(s);return u(e,t),e},L=0,V=m;m.all=D,m.race=I,m.resolve=B,m.reject=R,m._setScheduler=function(t){y=t},m._setAsap=function(t){k=t},m._asap=k,m.prototype={constructor:m,then:function(t,e){var i=this._state;if(i===z&&!t||i===P&&!e)return this;var n=new this.constructor(s),r=this._result;if(i){var o=arguments[i-1];k(function(){f(i,n,o,r)})}else _(this,n,t,e);return n},catch:function(t){return this.then(null,t)}};var G=function(){var t;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(t){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var e=t.Promise;if(e&&\"[object Promise]\"===Object.prototype.toString.call(e.resolve())&&!e.cast)return;t.Promise=V},U={Promise:V,polyfill:G};void 0!==e&&e.exports?e.exports=U:void 0!==this&&(this.ES6Promise=U),G()}).call(this)},function(t,e,i){t(319)()||Object.defineProperty(t(275),\"Set\",{value:t(322),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e,i;return\"function\"==typeof Set&&(t=new Set([\"raz\",\"dwa\",\"trzy\"]),\"[object Set]\"===String(t)&&(3===t.size&&(\"function\"==typeof t.add&&(\"function\"==typeof t.clear&&(\"function\"==typeof t.delete&&(\"function\"==typeof t.entries&&(\"function\"==typeof t.forEach&&(\"function\"==typeof t.has&&(\"function\"==typeof t.keys&&(\"function\"==typeof t.values&&(e=t.values(),!1===(i=e.next()).done&&\"raz\"===i.value)))))))))))}},function(t,e,i){e.exports=\"undefined\"!=typeof Set&&\"[object Set]\"===Object.prototype.toString.call(Set.prototype)},function(t,e,i){var n,r=t(299),o=t(305),s=t(266),a=t(313),l=t(323).toStringTag,h=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))return new n(t,e);a.call(this,t.__setData__,t),e=e&&o.call(e,\"key+value\")?\"key+value\":\"value\",h(this,\"__kind__\",s(\"\",e))},r&&r(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_resolve:s(function(t){return\"value\"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__list__[t]]}),toString:s(function(){return\"[object Set Iterator]\"})}),h(n.prototype,l,s(\"c\",\"Set Iterator\"))},function(t,e,i){var n,r,o,s=t(267),a=t(268),l=t(299),h=t(302),c=t(266),u=t(332),_=t(323),p=t(316),d=t(311),f=t(321),v=t(320),m=Function.prototype.call,g=Object.defineProperty,y=Object.getPrototypeOf;v&&(o=Set),e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");return t=v&&l?l(new o,y(this)):this,null!=e&&p(e),g(t,\"__setData__\",c(\"c\",[])),e?(d(e,function(t){-1===a.call(this,t)&&this.push(t)},t.__setData__),t):t},v&&(l&&l(n,o),n.prototype=Object.create(o.prototype,{constructor:c(n)})),u(Object.defineProperties(n.prototype,{add:c(function(t){return this.has(t)?this:(this.emit(\"_add\",this.__setData__.push(t)-1,t),this)}),clear:c(function(){this.__setData__.length&&(s.call(this.__setData__),this.emit(\"_clear\"))}),delete:c(function(t){var e=a.call(this.__setData__,t);return-1!==e&&(this.__setData__.splice(e,1),this.emit(\"_delete\",e,t),!0)}),entries:c(function(){return new f(this,\"key+value\")}),forEach:c(function(t){var e,i,n,r=arguments[1];for(h(t),e=this.values(),i=e._next();void 0!==i;)n=e._resolve(i),m.call(t,r,n,n,this),i=e._next()}),has:c(function(t){return-1!==a.call(this.__setData__,t)}),keys:c(r=function(){return this.values()}),size:c.gs(function(){return this.__setData__.length}),values:c(function(){return new f(this)}),toString:c(function(){return\"[object Set]\"})})),g(n.prototype,_.iterator,c(r)),g(n.prototype,_.toStringTag,c(\"c\",\"Set\"))},function(t,e,i){e.exports=t(324)()?Symbol:t(326)},function(t,e,i){var n={object:!0,symbol:!0};e.exports=function(){var t;if(\"function\"!=typeof Symbol)return!1;t=Symbol(\"test symbol\");try{String(t)}catch(t){return!1}return!!n[typeof Symbol.iterator]&&(!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag])}},function(t,e,i){e.exports=function(t){return!!t&&(\"symbol\"==typeof t||!!t.constructor&&(\"Symbol\"===t.constructor.name&&\"Symbol\"===t[t.constructor.toStringTag]))}},function(t,e,i){var n,r,o,s,a=t(266),l=t(327),h=Object.create,c=Object.defineProperties,u=Object.defineProperty,_=Object.prototype,p=h(null);if(\"function\"==typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(t){}}var d=function(){var t=h(null);return function(e){for(var i,n,r=0;t[e+(r||\"\")];)++r;return e+=r||\"\",t[e]=!0,i=\"@@\"+e,u(_,i,a.gs(null,function(t){n||(n=!0,u(this,i,a(t)),n=!1)})),i}}();o=function(t){if(this instanceof o)throw new TypeError(\"Symbol is not a constructor\");return r(t)},e.exports=r=function t(e){var i;if(this instanceof t)throw new TypeError(\"Symbol is not a constructor\");return s?n(e):(i=h(o.prototype),e=void 0===e?\"\":String(e),c(i,{__description__:a(\"\",e),__name__:a(\"\",d(e))}))},c(r,{for:a(function(t){return p[t]?p[t]:p[t]=r(String(t))}),keyFor:a(function(t){var e;l(t);for(e in p)if(p[e]===t)return e}),hasInstance:a(\"\",n&&n.hasInstance||r(\"hasInstance\")),isConcatSpreadable:a(\"\",n&&n.isConcatSpreadable||r(\"isConcatSpreadable\")),iterator:a(\"\",n&&n.iterator||r(\"iterator\")),match:a(\"\",n&&n.match||r(\"match\")),replace:a(\"\",n&&n.replace||r(\"replace\")),search:a(\"\",n&&n.search||r(\"search\")),species:a(\"\",n&&n.species||r(\"species\")),split:a(\"\",n&&n.split||r(\"split\")),toPrimitive:a(\"\",n&&n.toPrimitive||r(\"toPrimitive\")),toStringTag:a(\"\",n&&n.toStringTag||r(\"toStringTag\")),unscopables:a(\"\",n&&n.unscopables||r(\"unscopables\"))}),c(o.prototype,{constructor:a(r),toString:a(\"\",function(){return this.__name__})}),c(r.prototype,{toString:a(function(){return\"Symbol (\"+l(this).__description__+\")\"}),valueOf:a(function(){return l(this)})}),u(r.prototype,r.toPrimitive,a(\"\",function(){var t=l(this);return\"symbol\"==typeof t?t:t.toString()})),u(r.prototype,r.toStringTag,a(\"c\",\"Symbol\")),u(o.prototype,r.toStringTag,a(\"c\",r.prototype[r.toStringTag])),u(o.prototype,r.toPrimitive,a(\"c\",r.prototype[r.toPrimitive]))},function(t,e,i){var n=t(325);e.exports=function(t){if(!n(t))throw new TypeError(t+\" is not a symbol\");return t}},function(t,e,i){t(329)()||Object.defineProperty(t(275),\"WeakMap\",{value:t(331),configurable:!0,enumerable:!1,writable:!0})},function(t,e,i){e.exports=function(){var t,e;if(\"function\"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},\"one\"],[{},\"two\"],[{},\"three\"]])}catch(t){return!1}return\"[object WeakMap]\"===String(t)&&(\"function\"==typeof t.set&&(t.set({},1)===t&&(\"function\"==typeof t.delete&&(\"function\"==typeof t.has&&\"one\"===t.get(e)))))}},function(t,e,i){e.exports=\"function\"==typeof WeakMap&&\"[object WeakMap]\"===Object.prototype.toString.call(new WeakMap)},function(t,e,i){var n,r=t(299),o=t(303),s=t(304),a=t(309),l=t(266),h=t(312),c=t(311),u=t(323).toStringTag,_=t(330),p=Array.isArray,d=Object.defineProperty,f=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError(\"Constructor requires 'new'\");return t=_&&r&&WeakMap!==n?r(new WeakMap,v(this)):this,null!=e&&(p(e)||(e=h(e))),d(t,\"__weakMapData__\",l(\"c\",\"$weakMap$\"+a())),e?(c(e,function(e){s(e),t.set(e[0],e[1])}),t):t},_&&(r&&r(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:l(n)})),Object.defineProperties(n.prototype,{delete:l(function(t){return!!f.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:l(function(t){if(f.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:l(function(t){return f.call(o(t),this.__weakMapData__)}),set:l(function(t,e){return d(o(t),this.__weakMapData__,l(\"c\",e)),this}),toString:l(function(){return\"[object WeakMap]\"})}),d(n.prototype,u,l(\"c\",\"WeakMap\"))},function(t,e,i){var n,r,o,s,a,l,h,c=t(266),u=t(302),_=Function.prototype.apply,p=Function.prototype.call,d=Object.create,f=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};a={on:n=function(t,e){var i;return u(e),m.call(this,\"__ee__\")?i=this.__ee__:(i=g.value=d(null),f(this,\"__ee__\",g),g.value=null),i[t]?\"object\"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},once:r=function(t,e){var i,r;return u(e),r=this,n.call(this,t,i=function(){o.call(r,t,i),_.call(e,this,arguments)}),i.__eeOnceListener__=e,this},off:o=function(t,e){var i,n,r,o;if(u(e),!m.call(this,\"__ee__\"))return this;if(!(i=this.__ee__)[t])return this;if(\"object\"==typeof(n=i[t]))for(o=0;r=n[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},emit:s=function(t){var e,i,n,r,o;if(m.call(this,\"__ee__\")&&(r=this.__ee__[t]))if(\"object\"==typeof r){for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;n=r[e];++e)_.call(n,this,o)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),e=1;e<i;++e)o[e-1]=arguments[e];_.call(r,this,o)}}},l={on:c(n),once:c(r),off:c(o),emit:c(s)},h=v({},l),e.exports=i=function(t){return null==t?d(h):v(Object(t),l)},i.methods=a},/*! Hammer.JS - v2.0.7 - 2016-04-22\n",
" * http://hammerjs.github.io/\n",
" *\n",
" * Copyright (c) 2016 Jorik Tangelder;\n",
" * Licensed under the MIT license */\n",
" function(t,e,i){!function(t,i,n,r){\"use strict\";function o(t,e,i){return setTimeout(c(t,i),e)}function s(t,e,i){return!!Array.isArray(t)&&(a(t,i[e],i),!0)}function a(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==r)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function l(e,i,n){var r=\"DEPRECATED METHOD: \"+i+\"\\n\"+n+\" AT \\n\";return function(){var i=new Error(\"get-stack-trace\"),n=i&&i.stack?i.stack.replace(/^[^\\(]+?[\\n$]/gm,\"\").replace(/^\\s+at\\s+/gm,\"\").replace(/^Object.<anonymous>\\s*\\(/gm,\"{anonymous}()@\"):\"Unknown Stack Trace\",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,r,n),e.apply(this,arguments)}}function h(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&K(n,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function u(t,e){return typeof t==et?t.apply(e?e[0]||r:r,e):t}function _(t,e){return t===r?e:t}function p(t,e,i){a(m(e),function(e){t.addEventListener(e,i,!1)})}function d(t,e,i){a(m(e),function(e){t.removeEventListener(e,i,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function m(t){return t.trim().split(/\\s+/g)}function g(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function y(t){return Array.prototype.slice.call(t,0)}function b(t,e,i){for(var n=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];g(r,s)<0&&n.push(t[o]),r[o]=s,o++}return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function x(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<Z.length;){if(i=Z[s],(n=i?i+o:e)in t)return n;s++}return r}function w(e){var i=e.ownerDocument||e;return i.defaultView||i.parentWindow||t}function k(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){u(t.options.enable,[t])&&i.handler(e)},this.init()}function S(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&_t&&n-o==0,a=e&(dt|ft)&&n-o==0;i.isFirst=!!s,i.isFinal=!!a,s&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=C(e));o>1&&!i.firstMultiple?i.firstMultiple=C(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,l=a?a.center:s.center,h=e.center=T(n);e.timeStamp=rt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=O(l,h),e.distance=M(l,h),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==_t&&o.eventType!==dt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=E(e.deltaX,e.deltaY);var c=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=nt(c.x)>nt(c.y)?c.x:c.y,e.scale=a?function(t,e){return M(e[0],e[1],Ct)/M(t[0],t[1],Ct)}(a.pointers,n):1,e.rotation=a?function(t,e){return O(e[1],e[0],Ct)+O(t[1],t[0],Ct)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=ft&&(l>ut||a.velocity===r)){var h=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,u=A(l,h,c);n=u.x,o=u.y,i=nt(u.x)>nt(u.y)?u.x:u.y,s=E(h,c),t.lastInterval=e}else i=a.velocity,n=a.velocityX,o=a.velocityY,s=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u=t.element;f(e.srcEvent.target,u)&&(u=e.srcEvent.target);e.target=u}(t,i),t.emit(\"hammer.input\",i),t.recognize(i),t.session.prevInput=i}function C(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:it(t.pointers[i].clientX),clientY:it(t.pointers[i].clientY)},i++;return{timeStamp:rt(),pointers:e,center:T(e),deltaX:t.deltaX,deltaY:t.deltaY}}function T(t){var e=t.length;if(1===e)return{x:it(t[0].clientX),y:it(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:it(i/e),y:it(n/e)}}function A(t,e,i){return{x:e/t||0,y:i/t||0}}function E(t,e){return t===e?vt:nt(t)>=nt(e)?t<0?mt:gt:e<0?yt:bt}function M(t,e,i){i||(i=St);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function O(t,e,i){i||(i=St);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}function z(){this.evEl=At,this.evWin=Et,this.pressed=!1,k.apply(this,arguments)}function P(){this.evEl=zt,this.evWin=Pt,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function j(){this.evTarget=Nt,this.evWin=Ft,this.started=!1,k.apply(this,arguments)}function N(){this.evTarget=It,this.targetIds={},k.apply(this,arguments)}function F(){k.apply(this,arguments);var t=c(this.handler,this);this.touch=new N(this.manager,t),this.mouse=new z(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function D(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches,r=function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)};setTimeout(r,Bt)}}function I(t,e){this.manager=t,this.set(e)}function B(t){this.options=K({},this.defaults,t||{}),this.id=at++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Ht,this.simultaneous={},this.requireFail=[]}function R(t){return t&Zt?\"cancel\":t&$t?\"end\":t&Qt?\"move\":t&Jt?\"start\":\"\"}function L(t){return t==bt?\"down\":t==yt?\"up\":t==mt?\"left\":t==gt?\"right\":\"\"}function V(t,e){var i=e.manager;return i?i.get(t):t}function G(){B.apply(this,arguments)}function U(){G.apply(this,arguments),this.pX=null,this.pY=null}function Y(){G.apply(this,arguments)}function q(){B.apply(this,arguments),this._timer=null,this._input=null}function X(){G.apply(this,arguments)}function W(){G.apply(this,arguments)}function H(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function J(t,e){return e=e||{},e.recognizers=_(e.recognizers,J.defaults.preset),new Q(t,e)}function Q(t,e){this.options=K({},J.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){var e,i=t.options.inputClass;e=i||(ht?P:ct?N:lt?F:z);return new e(t,S)}(this),this.touchAction=new I(this,this.options.touchAction),$(this,!0),a(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function $(t,e){var i=t.element;if(i.style){var n;a(t.options.cssProps,function(r,o){n=x(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=t.oldCssProps[n]||\"\"}),e||(t.oldCssProps={})}}var K,Z=[\"\",\"webkit\",\"Moz\",\"MS\",\"ms\",\"o\"],tt=i.createElement(\"div\"),et=\"function\",it=Math.round,nt=Math.abs,rt=Date.now;K=\"function\"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==r&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var ot=l(function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&t[n[o]]===r)&&(t[n[o]]=e[n[o]]),o++;return t},\"extend\",\"Use `assign`.\"),st=l(function(t,e){return ot(t,e,!0)},\"merge\",\"Use `assign`.\"),at=1,lt=\"ontouchstart\"in t,ht=x(t,\"PointerEvent\")!==r,ct=lt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ut=25,_t=1,pt=2,dt=4,ft=8,vt=1,mt=2,gt=4,yt=8,bt=16,xt=mt|gt,wt=yt|bt,kt=xt|wt,St=[\"x\",\"y\"],Ct=[\"clientX\",\"clientY\"];k.prototype={handler:function(){},init:function(){this.evEl&&p(this.element,this.evEl,this.domHandler),this.evTarget&&p(this.target,this.evTarget,this.domHandler),this.evWin&&p(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(w(this.element),this.evWin,this.domHandler)}};var Tt={mousedown:_t,mousemove:pt,mouseup:dt},At=\"mousedown\",Et=\"mousemove mouseup\";h(z,k,{handler:function(t){var e=Tt[t.type];e&_t&&0===t.button&&(this.pressed=!0),e&pt&&1!==t.which&&(e=dt),this.pressed&&(e&dt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:\"mouse\",srcEvent:t}))}});var Mt={pointerdown:_t,pointermove:pt,pointerup:dt,pointercancel:ft,pointerout:ft},Ot={2:\"touch\",3:\"pen\",4:\"mouse\",5:\"kinect\"},zt=\"pointerdown\",Pt=\"pointermove pointerup pointercancel\";t.MSPointerEvent&&!t.PointerEvent&&(zt=\"MSPointerDown\",Pt=\"MSPointerMove MSPointerUp MSPointerCancel\"),h(P,k,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace(\"ms\",\"\"),r=Mt[n],o=Ot[t.pointerType]||t.pointerType,s=\"touch\"==o,a=g(e,t.pointerId,\"pointerId\");r&_t&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(dt|ft)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var jt={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},Nt=\"touchstart\",Ft=\"touchstart touchmove touchend touchcancel\";h(j,k,{handler:function(t){var e=jt[t.type];if(e===_t&&(this.started=!0),this.started){var i=function(t,e){var i=y(t.touches),n=y(t.changedTouches);e&(dt|ft)&&(i=b(i.concat(n),\"identifier\",!0));return[i,n]}.call(this,t,e);e&(dt|ft)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:\"touch\",srcEvent:t})}}});var Dt={touchstart:_t,touchmove:pt,touchend:dt,touchcancel:ft},It=\"touchstart touchmove touchend touchcancel\";h(N,k,{handler:function(t){var e=Dt[t.type],i=function(t,e){var i=y(t.touches),n=this.targetIds;if(e&(_t|pt)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=y(t.changedTouches),a=[],l=this.target;if(o=i.filter(function(t){return f(t.target,l)}),e===_t)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;r=0;for(;r<s.length;)n[s[r].identifier]&&a.push(s[r]),e&(dt|ft)&&delete n[s[r].identifier],r++;if(!a.length)return;return[b(o.concat(a),\"identifier\",!0),a]}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:\"touch\",srcEvent:t})}});var Bt=2500,Rt=25;h(F,k,{handler:function(t,e,i){var n=\"touch\"==i.pointerType,r=\"mouse\"==i.pointerType;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)(function(t,e){t&_t?(this.primaryTouch=e.changedPointers[0].identifier,D.call(this,e)):t&(dt|ft)&&D.call(this,e)}).call(this,e,i);else if(r&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),s=Math.abs(i-r.y);if(o<=Rt&&s<=Rt)return!0}return!1}.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Lt=x(tt.style,\"touchAction\"),Vt=Lt!==r,Gt=\"auto\",Ut=\"manipulation\",Yt=\"none\",qt=\"pan-x\",Xt=\"pan-y\",Wt=function(){if(!Vt)return!1;var e={},i=t.CSS&&t.CSS.supports;return[\"auto\",\"manipulation\",\"pan-y\",\"pan-x\",\"pan-x pan-y\",\"none\"].forEach(function(n){e[n]=!i||t.CSS.supports(\"touch-action\",n)}),e}();I.prototype={set:function(t){\"compute\"==t&&(t=this.compute()),Vt&&this.manager.element.style&&Wt[t]&&(this.manager.element.style[Lt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){u(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(v(t,Yt))return Yt;var e=v(t,qt),i=v(t,Xt);if(e&&i)return Yt;if(e||i)return e?qt:Xt;if(v(t,Ut))return Ut;return Gt}(t.join(\" \"))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=v(n,Yt)&&!Wt[Yt],o=v(n,Xt)&&!Wt[Xt],s=v(n,qt)&&!Wt[qt];if(r){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!s||!o)return r||o&&i&xt||s&&i&wt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ht=1,Jt=2,Qt=4,$t=8,Kt=$t,Zt=16;B.prototype={defaults:{},set:function(t){return K(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(s(t,\"recognizeWith\",this))return this;var e=this.simultaneous;return t=V(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return s(t,\"dropRecognizeWith\",this)?this:(t=V(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(s(t,\"requireFailure\",this))return this;var e=this.requireFail;return t=V(t,this),-1===g(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(s(t,\"dropRequireFailure\",this))return this;t=V(t,this);var e=g(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,n=this.state;n<$t&&e(i.options.event+R(n)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),n>=$t&&e(i.options.event+R(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|Ht)))return!1;t++}return!0},recognize:function(t){var e=K({},t);if(!u(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(Kt|Zt|32)&&(this.state=Ht),this.state=this.process(e),this.state&(Jt|Qt|$t|Zt)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},h(G,B,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(Jt|Qt),r=this.attrTest(t);return n&&(i&ft||!r)?e|Zt:n||r?i&dt?e|$t:e&Jt?e|Qt:Jt:32}}),h(U,G,{defaults:{event:\"pan\",threshold:10,pointers:1,direction:kt},getTouchAction:function(){var t=this.options.direction,e=[];return t&xt&&e.push(Xt),t&wt&&e.push(qt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&xt?(r=0===o?vt:o<0?mt:gt,i=o!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?vt:s<0?yt:bt,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return G.prototype.attrTest.call(this,t)&&(this.state&Jt||!(this.state&Jt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=L(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),h(Y,G,{defaults:{event:\"pinch\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Jt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?\"in\":\"out\";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),h(q,B,{defaults:{event:\"press\",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(dt|ft)&&!r)this.reset();else if(t.eventType&_t)this.reset(),this._timer=o(function(){this.state=Kt,this.tryEmit()},e.time,this);else if(t.eventType&dt)return Kt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Kt&&(t&&t.eventType&dt?this.manager.emit(this.options.event+\"up\",t):(this._input.timeStamp=rt(),this.manager.emit(this.options.event,this._input)))}}),h(X,G,{defaults:{event:\"rotate\",threshold:0,pointers:2},getTouchAction:function(){return[Yt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Jt)}}),h(W,G,{defaults:{event:\"swipe\",threshold:10,velocity:.3,direction:xt|wt,pointers:1},getTouchAction:function(){return U.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(xt|wt)?e=t.overallVelocity:i&xt?e=t.overallVelocityX:i&wt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&nt(e)>this.options.velocity&&t.eventType&dt},emit:function(t){var e=L(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),h(H,B,{defaults:{event:\"tap\",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ut]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&_t&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=dt)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||M(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&s?this.count+=1:this.count=1,this._input=t;var l=this.count%e.taps;if(0===l)return this.hasRequireFailures()?(this._timer=o(function(){this.state=Kt,this.tryEmit()},e.interval,this),Jt):Kt}return 32},failTimeout:function(){return this._timer=o(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Kt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),J.VERSION=\"2.0.7\",J.defaults={domEvents:!1,touchAction:\"compute\",enable:!0,inputTarget:null,inputClass:null,preset:[[X,{enable:!1}],[Y,{enable:!1},[\"rotate\"]],[W,{direction:xt}],[U,{direction:xt},[\"swipe\"]],[H],[H,{event:\"doubletap\",taps:2},[\"tap\"]],[q]],cssProps:{userSelect:\"none\",touchSelect:\"none\",touchCallout:\"none\",contentZooming:\"none\",userDrag:\"none\",tapHighlightColor:\"rgba(0,0,0,0)\"}};Q.prototype={set:function(t){return K(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,n=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&Kt)&&(r=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&i.state&(Jt|Qt|$t)&&(r=e.curRecognizer=i),o++}},get:function(t){if(t instanceof B)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(s(t,\"add\",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(s(t,\"remove\",this))return this;if(t=this.get(t)){var e=this.recognizers,i=g(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==r&&e!==r){var i=this.handlers;return a(m(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==r){var i=this.handlers;return a(m(t),function(t){e?i[t]&&i[t].splice(g(i[t],e),1):delete i[t]}),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=i.createEvent(\"Event\");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&$(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},K(J,{INPUT_START:_t,INPUT_MOVE:pt,INPUT_END:dt,INPUT_CANCEL:ft,STATE_POSSIBLE:Ht,STATE_BEGAN:Jt,STATE_CHANGED:Qt,STATE_ENDED:$t,STATE_RECOGNIZED:Kt,STATE_CANCELLED:Zt,STATE_FAILED:32,DIRECTION_NONE:vt,DIRECTION_LEFT:mt,DIRECTION_RIGHT:gt,DIRECTION_UP:yt,DIRECTION_DOWN:bt,DIRECTION_HORIZONTAL:xt,DIRECTION_VERTICAL:wt,DIRECTION_ALL:kt,Manager:Q,Input:k,TouchAction:I,TouchInput:N,MouseInput:z,PointerEventInput:P,TouchMouseInput:F,SingleTouchInput:j,Recognizer:B,AttrRecognizer:G,Tap:H,Pan:U,Swipe:W,Pinch:Y,Rotate:X,Press:q,on:p,off:d,each:a,merge:st,extend:ot,assign:K,inherit:h,bindFn:c,prefixed:x});var te=void 0!==t?t:\"undefined\"!=typeof self?self:{};te.Hammer=J,void 0!==e&&e.exports?e.exports=J:t.Hammer=J}(window,document)},function(t,e,i){var n,r=t(339);!function(t){t[t.Le=0]=\"Le\",t[t.Ge=1]=\"Ge\",t[t.Eq=2]=\"Eq\"}(n=i.Operator||(i.Operator={}));var o=function(){function t(t,e,i){void 0===i&&(i=r.Strength.required),this._id=s++,this._operator=e,this._expression=t,this._strength=r.Strength.clip(i)}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){var t=this;return this._expression+\" \"+function(){switch(t._operator){case n.Le:return\"<=\";case n.Ge:return\">=\";case n.Eq:return\"==\"}}()+\" 0\"},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"expression\",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"op\",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"strength\",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();i.Constraint=o;var s=0},function(t,e,i){var n=t(343),r=t(346),o=t(337),s=function(){function t(){var t=function(t){for(var e=0,i=function(){return 0},n=o.createMap(r.Variable.Compare),s=0,a=t.length;s<a;++s){var l=t[s];if(\"number\"==typeof l)e+=l;else if(l instanceof r.Variable)n.setDefault(l,i).second+=1;else{if(!(l instanceof Array))throw new Error(\"invalid Expression argument: \"+JSON.stringify(l));if(2!==l.length)throw new Error(\"array must have length 2\");var h=l[0],c=l[1];if(\"number\"!=typeof h)throw new Error(\"array item 0 must be a number\");if(!(c instanceof r.Variable))throw new Error(\"array item 1 must be a variable\");n.setDefault(c,i).second+=h}}return{terms:n,constant:e}}(arguments);this._terms=t.terms,this._constant=t.constant}return t.prototype.toString=function(){var t=[];n.forEach(this._terms,function(e){t.push([e.first,e.second])});for(var e=!0,i=\"\",r=0,o=t;r<o.length;r++){var s=o[r],a=s[0],l=s[1];e?(e=!1,i+=1==l?\"\"+a:-1==l?\"-\"+a:l+\"*\"+a):i+=1==l?\" + \"+a:-1==l?\" - \"+a:l>=0?\" + \"+l+a:\" - \"+-l+a}var h=this.constant;return h<0?i+=\" - \"+-h:h>0&&(i+=\" + \"+h),i},Object.defineProperty(t.prototype,\"terms\",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"constant\",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"value\",{get:function(){var t=this._constant;return n.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();i.Expression=s},function(t,e,i){/*-----------------------------------------------------------------------------\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 n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(346)),n(t(335)),n(t(334)),n(t(339)),n(t(338))},function(t,e,i){var n=t(343);i.createMap=function(t){return new n.AssociativeArray(t)}},function(t,e,i){function n(t){return t<0?-t<1e-8:t<1e-8}var r=t(346),o=t(335),s=t(334),a=t(339),l=t(337),h=t(343),c=function(){function t(){this._cnMap=l.createMap(s.Constraint.Compare),this._rowMap=l.createMap(_.Compare),this._varMap=l.createMap(r.Variable.Compare),this._editMap=l.createMap(r.Variable.Compare),this._infeasibleRows=[],this._objective=new d,this._artificial=null,this._idTick=0}return t.prototype.addConstraint=function(t){var e=this._cnMap.find(t);if(void 0!==e)throw new Error(\"duplicate constraint\");var i=this._createRow(t),r=i.row,o=i.tag,s=this._chooseSubject(r,o);if(s.type()===u.Invalid&&r.allDummies()){if(!n(r.constant())){for(var a=[],l=0,h=t.expression.terms._array;l<h.length;l++){var c=h[l];a.push(c.first.name)}var _=[\"LE\",\"GE\",\"EQ\"][t.op];throw new Error(\"unsatisfiable constraint [\"+a.join(\",\")+\"] operator: \"+_)}s=o.marker}if(s.type()===u.Invalid){if(!this._addWithArtificialVariable(r))throw new Error(\"unsatisfiable constraint\")}else r.solveFor(s),this._substitute(s,r),this._rowMap.insert(s,r);this._cnMap.insert(t,o),this._optimize(this._objective)},t.prototype.removeConstraint=function(t,e){void 0===e&&(e=!1);var i=this._cnMap.erase(t);if(void 0===i){if(e)return;throw new Error(\"unknown constraint\")}this._removeConstraintEffects(t,i.second);var n=i.second.marker,r=this._rowMap.erase(n);if(void 0===r){var o=this._getMarkerLeavingSymbol(n);if(o.type()===u.Invalid)throw new Error(\"failed to find leaving row\");(r=this._rowMap.erase(o)).second.solveForEx(o,n),this._substitute(n,r.second)}this._optimize(this._objective)},t.prototype.hasConstraint=function(t){return this._cnMap.contains(t)},t.prototype.addEditVariable=function(t,e){var i=this._editMap.find(t);if(void 0!==i)throw new Error(\"duplicate edit variable: \"+t.name);if((e=a.Strength.clip(e))===a.Strength.required)throw new Error(\"bad required strength\");var n=new o.Expression(t),r=new s.Constraint(n,s.Operator.Eq,e);this.addConstraint(r);var l=this._cnMap.find(r).second,h={tag:l,constraint:r,constant:0};this._editMap.insert(t,h)},t.prototype.removeEditVariable=function(t,e){void 0===e&&(e=!1);var i=this._editMap.erase(t);if(void 0===i){if(e)return;throw new Error(\"unknown edit variable: \"+t.name)}this.removeConstraint(i.second.constraint,e)},t.prototype.hasEditVariable=function(t){return this._editMap.contains(t)},t.prototype.suggestValue=function(t,e){var i=this._editMap.find(t);if(void 0===i)throw new Error(\"unknown edit variable: \"+t.name);var n=this._rowMap,r=i.second,o=e-r.constant;r.constant=e;var s=r.tag.marker,a=n.find(s);if(void 0!==a)return a.second.add(-o)<0&&this._infeasibleRows.push(s),void this._dualOptimize();var l=r.tag.other;if(void 0!==(a=n.find(l)))return a.second.add(o)<0&&this._infeasibleRows.push(l),void this._dualOptimize();for(var h=0,c=n.size();h<c;++h){var _=n.itemAt(h),p=_.second,d=p.coefficientFor(s);0!==d&&p.add(o*d)<0&&_.first.type()!==u.External&&this._infeasibleRows.push(_.first)}this._dualOptimize()},t.prototype.updateVariables=function(){for(var t=this._varMap,e=this._rowMap,i=0,n=t.size();i<n;++i){var r=t.itemAt(i),o=e.find(r.second),s=0;void 0!==o&&-0===(s=o.second.constant())&&(s=0),r.first.setValue(s)}},t.prototype.getConstraints=function(){var t=[];return h.forEach(this._cnMap,function(e){t.push(e.first)}),t},Object.defineProperty(t.prototype,\"numConstraints\",{get:function(){return this._cnMap.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"numEditVariables\",{get:function(){return this._editMap.size()},enumerable:!0,configurable:!0}),t.prototype._getVarSymbol=function(t){var e=this;return this._varMap.setDefault(t,function(){return e._makeSymbol(u.External)}).second},t.prototype._createRow=function(t){for(var e=t.expression,i=new d(e.constant),r=e.terms,o=0,l=r.size();o<l;++o){var h=r.itemAt(o);if(!n(h.second)){var c=this._getVarSymbol(h.first),_=this._rowMap.find(c);void 0!==_?i.insertRow(_.second,h.second):i.insertSymbol(c,h.second)}}var f=this._objective,v=t.strength,m={marker:p,other:p};switch(t.op){case s.Operator.Le:case s.Operator.Ge:var g=t.op===s.Operator.Le?1:-1,y=this._makeSymbol(u.Slack);if(m.marker=y,i.insertSymbol(y,g),v<a.Strength.required){var b=this._makeSymbol(u.Error);m.other=b,i.insertSymbol(b,-g),f.insertSymbol(b,v)}break;case s.Operator.Eq:if(v<a.Strength.required){var x=this._makeSymbol(u.Error),w=this._makeSymbol(u.Error);m.marker=x,m.other=w,i.insertSymbol(x,-1),i.insertSymbol(w,1),f.insertSymbol(x,v),f.insertSymbol(w,v)}else{var k=this._makeSymbol(u.Dummy);m.marker=k,i.insertSymbol(k)}}return i.constant()<0&&i.reverseSign(),{row:i,tag:m}},t.prototype._chooseSubject=function(t,e){for(var i=t.cells(),n=0,r=i.size();n<r;++n){var o=i.itemAt(n);if(o.first.type()===u.External)return o.first}var s=e.marker.type();return(s===u.Slack||s===u.Error)&&t.coefficientFor(e.marker)<0?e.marker:((s=e.other.type())===u.Slack||s===u.Error)&&t.coefficientFor(e.other)<0?e.other:p},t.prototype._addWithArtificialVariable=function(t){var e=this._makeSymbol(u.Slack);this._rowMap.insert(e,t.copy()),this._artificial=t.copy(),this._optimize(this._artificial);var i=n(this._artificial.constant());this._artificial=null;var r=this._rowMap.erase(e);if(void 0!==r){var o=r.second;if(o.isConstant())return i;var s=this._anyPivotableSymbol(o);if(s.type()===u.Invalid)return!1;o.solveForEx(e,s),this._substitute(s,o),this._rowMap.insert(s,o)}for(var a=this._rowMap,l=0,h=a.size();l<h;++l)a.itemAt(l).second.removeSymbol(e);return this._objective.removeSymbol(e),i},t.prototype._substitute=function(t,e){for(var i=this._rowMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);o.second.substitute(t,e),o.second.constant()<0&&o.first.type()!==u.External&&this._infeasibleRows.push(o.first)}this._objective.substitute(t,e),this._artificial&&this._artificial.substitute(t,e)},t.prototype._optimize=function(t){for(;;){var e=this._getEnteringSymbol(t);if(e.type()===u.Invalid)return;var i=this._getLeavingSymbol(e);if(i.type()===u.Invalid)throw new Error(\"the objective is unbounded\");var n=this._rowMap.erase(i).second;n.solveForEx(i,e),this._substitute(e,n),this._rowMap.insert(e,n)}},t.prototype._dualOptimize=function(){for(var t=this._rowMap,e=this._infeasibleRows;0!==e.length;){var i=e.pop(),n=t.find(i);if(void 0!==n&&n.second.constant()<0){var r=this._getDualEnteringSymbol(n.second);if(r.type()===u.Invalid)throw new Error(\"dual optimize failed\");var o=n.second;t.erase(i),o.solveForEx(i,r),this._substitute(r,o),t.insert(r,o)}}},t.prototype._getEnteringSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first;if(r.second<0&&o.type()!==u.Dummy)return o}return p},t.prototype._getDualEnteringSymbol=function(t){for(var e=Number.MAX_VALUE,i=p,n=t.cells(),r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first,l=s.second;if(l>0&&a.type()!==u.Dummy){var h=this._objective.coefficientFor(a),c=h/l;c<e&&(e=c,i=a)}}return i},t.prototype._getLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=p,n=this._rowMap,r=0,o=n.size();r<o;++r){var s=n.itemAt(r),a=s.first;if(a.type()!==u.External){var l=s.second,h=l.coefficientFor(t);if(h<0){var c=-l.constant()/h;c<e&&(e=c,i=a)}}}return i},t.prototype._getMarkerLeavingSymbol=function(t){for(var e=Number.MAX_VALUE,i=e,n=e,r=p,o=r,s=r,a=r,l=this._rowMap,h=0,c=l.size();h<c;++h){var _=l.itemAt(h),d=_.second,f=d.coefficientFor(t);if(0!==f){var v=_.first;if(v.type()===u.External)a=v;else if(f<0){var m=-d.constant()/f;m<i&&(i=m,o=v)}else{var m=d.constant()/f;m<n&&(n=m,s=v)}}}return o!==r?o:s!==r?s:a},t.prototype._removeConstraintEffects=function(t,e){e.marker.type()===u.Error&&this._removeMarkerEffects(e.marker,t.strength),e.other.type()===u.Error&&this._removeMarkerEffects(e.other,t.strength)},t.prototype._removeMarkerEffects=function(t,e){var i=this._rowMap.find(t);void 0!==i?this._objective.insertRow(i.second,-e):this._objective.insertSymbol(t,-e)},t.prototype._anyPivotableSymbol=function(t){for(var e=t.cells(),i=0,n=e.size();i<n;++i){var r=e.itemAt(i),o=r.first.type();if(o===u.Slack||o===u.Error)return r.first}return p},t.prototype._makeSymbol=function(t){return new _(t,this._idTick++)},t}();i.Solver=c;var u;!function(t){t[t.Invalid=0]=\"Invalid\",t[t.External=1]=\"External\",t[t.Slack=2]=\"Slack\",t[t.Error=3]=\"Error\",t[t.Dummy=4]=\"Dummy\"}(u||(u={}));var _=function(){function t(t,e){this._id=e,this._type=t}return t.Compare=function(t,e){return t.id()-e.id()},t.prototype.id=function(){return this._id},t.prototype.type=function(){return this._type},t}(),p=new _(u.Invalid,-1),d=function(){function t(t){void 0===t&&(t=0),this._cellMap=l.createMap(_.Compare),this._constant=t}return t.prototype.cells=function(){return this._cellMap},t.prototype.constant=function(){return this._constant},t.prototype.isConstant=function(){return this._cellMap.empty()},t.prototype.allDummies=function(){for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);if(n.first.type()!==u.Dummy)return!1}return!0},t.prototype.copy=function(){var e=new t(this._constant);return e._cellMap=this._cellMap.copy(),e},t.prototype.add=function(t){return this._constant+=t},t.prototype.insertSymbol=function(t,e){void 0===e&&(e=1);var i=this._cellMap.setDefault(t,function(){return 0});n(i.second+=e)&&this._cellMap.erase(t)},t.prototype.insertRow=function(t,e){void 0===e&&(e=1),this._constant+=t._constant*e;for(var i=t._cellMap,n=0,r=i.size();n<r;++n){var o=i.itemAt(n);this.insertSymbol(o.first,o.second*e)}},t.prototype.removeSymbol=function(t){this._cellMap.erase(t)},t.prototype.reverseSign=function(){this._constant=-this._constant;for(var t=this._cellMap,e=0,i=t.size();e<i;++e){var n=t.itemAt(e);n.second=-n.second}},t.prototype.solveFor=function(t){var e=this._cellMap,i=e.erase(t),n=-1/i.second;this._constant*=n;for(var r=0,o=e.size();r<o;++r)e.itemAt(r).second*=n},t.prototype.solveForEx=function(t,e){this.insertSymbol(t,-1),this.solveFor(e)},t.prototype.coefficientFor=function(t){var e=this._cellMap.find(t);return void 0!==e?e.second:0},t.prototype.substitute=function(t,e){var i=this._cellMap.erase(t);void 0!==i&&this.insertRow(e,i.second)},t}()},function(t,e,i){!function(t){function e(t,e,i,n){void 0===n&&(n=1);var r=0;return r+=1e6*Math.max(0,Math.min(1e3,t*n)),r+=1e3*Math.max(0,Math.min(1e3,e*n)),r+=Math.max(0,Math.min(1e3,i*n))}t.create=e,t.required=e(1e3,1e3,1e3),t.strong=e(1,0,0),t.medium=e(0,1,0),t.weak=e(0,0,1),t.clip=function(e){return Math.max(0,Math.min(t.required,e))}}(i.Strength||(i.Strength={}))},function(t,e,i){function n(t,e,i){for(var n,r,o=0,s=t.length;s>0;)i(t[r=o+(n=s>>1)],e)<0?(o=r+1,s-=n+1):s=n;return o}var r=t(344);i.lowerBound=n,i.binarySearch=function(t,e,i){var r=n(t,e,i);if(r===t.length)return-1;var o=t[r];if(0!==i(o,e))return-1;return r},i.binaryFind=function(t,e,i){var r=n(t,e,i);if(r===t.length)return;var o=t[r];if(0!==i(o,e))return;return o},i.asSet=function(t,e){var i=r.asArray(t),n=i.length;if(n<=1)return i;i.sort(e);for(var o=[i[0]],s=1,a=0;s<n;++s){var l=i[s];0!==e(o[a],l)&&(o.push(l),++a)}return o},i.setIsDisjoint=function(t,e,i){var n=0,r=0,o=t.length,s=e.length;for(;n<o&&r<s;){var a=i(t[n],e[r]);if(a<0)++n;else{if(!(a>0))return!1;++r}}return!0},i.setIsSubset=function(t,e,i){var n=t.length,r=e.length;if(n>r)return!1;var o=0,s=0;for(;o<n&&s<r;){var a=i(t[o],e[s]);if(a<0)return!1;a>0?++s:(++o,++s)}if(o<n)return!1;return!0},i.setUnion=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?(a.push(h),++r):(a.push(l),++n,++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a},i.setIntersection=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?++n:c>0?++r:(a.push(l),++n,++r)}return a},i.setDifference=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?++r:(++n,++r)}for(;n<o;)a.push(t[n]),++n;return a},i.setSymmetricDifference=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l,h);c<0?(a.push(l),++n):c>0?(a.push(h),++r):(++n,++r)}for(;n<o;)a.push(t[n]),++n;for(;r<s;)a.push(e[r]),++r;return a}},function(t,e,i){var n=t(344),r=function(){function t(){this._array=[]}return t.prototype.size=function(){return this._array.length},t.prototype.empty=function(){return 0===this._array.length},t.prototype.itemAt=function(t){return this._array[t]},t.prototype.takeAt=function(t){return this._array.splice(t,1)[0]},t.prototype.clear=function(){this._array=[]},t.prototype.swap=function(t){var e=this._array;this._array=t._array,t._array=e},t.prototype.__iter__=function(){return n.iter(this._array)},t.prototype.__reversed__=function(){return n.reversed(this._array)},t}();i.ArrayBase=r},function(t,e,i){/*-----------------------------------------------------------------------------\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",
" var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=t(345),o=t(341),s=t(340),a=t(344),l=function(t){function e(e){var i=t.call(this)||this;return i._compare=e,i._wrapped=function(t){return function(e,i){return t(e.first,i)}}(e),i}return n(e,t),e.prototype.comparitor=function(){return this._compare},e.prototype.indexOf=function(t){return s.binarySearch(this._array,t,this._wrapped)},e.prototype.contains=function(t){return s.binarySearch(this._array,t,this._wrapped)>=0},e.prototype.find=function(t){return s.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var i=this._array,n=s.lowerBound(i,t,this._wrapped);if(n===i.length){var o=new r.Pair(t,e());return i.push(o),o}var a=i[n];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e());return i.splice(n,0,o),o}return a},e.prototype.insert=function(t,e){var i=this._array,n=s.lowerBound(i,t,this._wrapped);if(n===i.length){var o=new r.Pair(t,e);return i.push(o),o}var a=i[n];if(0!==this._compare(a.first,t)){var o=new r.Pair(t,e);return i.splice(n,0,o),o}return a.second=e,a},e.prototype.update=function(t){var i=this;t instanceof e?this._array=function(t,e,i){var n=0,r=0,o=t.length,s=e.length,a=[];for(;n<o&&r<s;){var l=t[n],h=e[r],c=i(l.first,h.first);c<0?(a.push(l.copy()),++n):c>0?(a.push(h.copy()),++r):(a.push(h.copy()),++n,++r)}for(;n<o;)a.push(t[n].copy()),++n;for(;r<s;)a.push(e[r].copy()),++r;return a}(this._array,t._array,this._compare):a.forEach(t,function(t){i.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,i=s.binarySearch(e,t,this._wrapped);if(!(i<0))return e.splice(i,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),i=t._array,n=this._array,r=0,o=n.length;r<o;++r)i.push(n[r].copy());return t},e}(o.ArrayBase);i.AssociativeArray=l},function(t,e,i){function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}n(t(340)),n(t(341)),n(t(342)),n(t(344)),n(t(345))},function(t,e,i){var n=function(){function t(t,e){void 0===e&&(e=0),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[this._index++]},t.prototype.__iter__=function(){return this},t}();i.ArrayIterator=n;var r=function(){function t(t,e){void 0===e&&(e=t.length),this._array=t,this._index=Math.max(0,Math.min(e,t.length))}return t.prototype.__next__=function(){return this._array[--this._index]},t.prototype.__iter__=function(){return this},t}();i.ReverseArrayIterator=r,i.iter=function(t){if(t instanceof Array)return new n(t);return t.__iter__()},i.reversed=function(t){if(t instanceof Array)return new r(t);return t.__reversed__()},i.next=function(t){return t.__next__()},i.asArray=function(t){if(t instanceof Array)return t.slice();var e,i=[],n=t.__iter__();for(;void 0!==(e=n.__next__());)i.push(e);return i},i.forEach=function(t,e){if(t instanceof Array){for(var i=0,n=t.length;i<n;++i)if(!1===e(t[i]))return}else for(var r,o=t.__iter__();void 0!==(r=o.__next__());)if(!1===e(r))return},i.map=function(t,e){var i=[];if(t instanceof Array)for(var n=0,r=t.length;n<r;++n)i.push(e(t[n]));else for(var o,s=t.__iter__();void 0!==(o=s.__next__());)i.push(e(o));return i},i.filter=function(t,e){var i,n=[];if(t instanceof Array)for(var r=0,o=t.length;r<o;++r)i=t[r],e(i)&&n.push(i);else for(var s=t.__iter__();void 0!==(i=s.__next__());)e(i)&&n.push(i);return n}},function(t,e,i){var n=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.copy=function(){return new t(this.first,this.second)},t}();i.Pair=n},function(t,e,i){var n=function(){function t(t){void 0===t&&(t=\"\"),this._value=0,this._context=null,this._id=r++,this._name=t}return t.Compare=function(t,e){return t.id-e.id},t.prototype.toString=function(){return this._name},Object.defineProperty(t.prototype,\"id\",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"name\",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.setName=function(t){this._name=t},Object.defineProperty(t.prototype,\"context\",{get:function(){return this._context},enumerable:!0,configurable:!0}),t.prototype.setContext=function(t){this._context=t},Object.defineProperty(t.prototype,\"value\",{get:function(){return this._value},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){this._value=t},t}();i.Variable=n;var r=0},/*!\n",
" * numbro.js\n",
" * version : 1.6.2\n",
" * author : Företagsplatsen AB\n",
" * license : MIT\n",
" * http://www.foretagsplatsen.se\n",
" */\n",
" function(t,e,i){function n(t){this._value=t}function r(t){var e,i=\"\";for(e=0;e<t;e++)i+=\"0\";return i}function o(t,e,i,n){var o,s,a=Math.pow(10,e);return s=t.toFixed(0).search(\"e\")>-1?function(t,e){var i,n,o,s,a;a=t.toString(),i=a.split(\"e\")[0],s=a.split(\"e\")[1],n=i.split(\".\")[0],o=i.split(\".\")[1]||\"\",a=n+o+r(s-o.length),e>0&&(a+=\".\"+r(e));return a}(t,e):(i(t*a)/a).toFixed(e),n&&(o=new RegExp(\"0{1,\"+n+\"}$\"),s=s.replace(o,\"\")),s}function s(t,e,i){return e.indexOf(\"$\")>-1?function(t,e,i){var n,r,o=e,s=o.indexOf(\"$\"),l=o.indexOf(\"(\"),h=o.indexOf(\"+\"),c=o.indexOf(\"-\"),_=\"\",d=\"\";-1===o.indexOf(\"$\")?\"infix\"===u[p].currency.position?(d=u[p].currency.symbol,u[p].currency.spaceSeparated&&(d=\" \"+d+\" \")):u[p].currency.spaceSeparated&&(_=\" \"):o.indexOf(\" $\")>-1?(_=\" \",o=o.replace(\" $\",\"\")):o.indexOf(\"$ \")>-1?(_=\" \",o=o.replace(\"$ \",\"\")):o=o.replace(\"$\",\"\");if(r=a(t,o,i,d),-1===e.indexOf(\"$\"))switch(u[p].currency.position){case\"postfix\":r.indexOf(\")\")>-1?((r=r.split(\"\")).splice(-1,0,_+u[p].currency.symbol),r=r.join(\"\")):r=r+_+u[p].currency.symbol;break;case\"infix\":break;case\"prefix\":r.indexOf(\"(\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),n=Math.max(l,c)+1,r.splice(n,0,u[p].currency.symbol+_),r=r.join(\"\")):r=u[p].currency.symbol+_+r;break;default:throw Error('Currency position should be among [\"prefix\", \"infix\", \"postfix\"]')}else s<=1?r.indexOf(\"(\")>-1||r.indexOf(\"+\")>-1||r.indexOf(\"-\")>-1?(r=r.split(\"\"),n=1,(s<l||s<h||s<c)&&(n=0),r.splice(n,0,u[p].currency.symbol+_),r=r.join(\"\")):r=u[p].currency.symbol+_+r:r.indexOf(\")\")>-1?((r=r.split(\"\")).splice(-1,0,_+u[p].currency.symbol),r=r.join(\"\")):r=r+_+u[p].currency.symbol;return r}(t,e,i):e.indexOf(\"%\")>-1?function(t,e,i){var n,r=\"\";t*=100,e.indexOf(\" %\")>-1?(r=\" \",e=e.replace(\" %\",\"\")):e=e.replace(\"%\",\"\");(n=a(t,e,i)).indexOf(\")\")>-1?((n=n.split(\"\")).splice(-1,0,r+\"%\"),n=n.join(\"\")):n=n+r+\"%\";return n}(t,e,i):e.indexOf(\":\")>-1?function(t){var e=Math.floor(t/60/60),i=Math.floor((t-60*e*60)/60),n=Math.round(t-60*e*60-60*i);return e+\":\"+(i<10?\"0\"+i:i)+\":\"+(n<10?\"0\"+n:n)}(t):a(t,e,i)}function a(t,e,i,n){var r,s,a,l,h,c,_,f,v,m,g,y,b,x,w,k,S,C,T=!1,A=!1,E=!1,M=\"\",O=!1,z=!1,P=!1,j=!1,N=!1,F=\"\",D=\"\",I=Math.abs(t),B=[\"B\",\"KiB\",\"MiB\",\"GiB\",\"TiB\",\"PiB\",\"EiB\",\"ZiB\",\"YiB\"],R=[\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\"],L=\"\",V=!1,G=!1,U=\"\";if(0===t&&null!==d)return d;if(!isFinite(t))return\"\"+t;if(0===e.indexOf(\"{\")){var Y=e.indexOf(\"}\");if(-1===Y)throw Error('Format should also contain a \"}\"');y=e.slice(1,Y),e=e.slice(Y+1)}else y=\"\";if(e.indexOf(\"}\")===e.length-1){var q=e.indexOf(\"{\");if(-1===q)throw Error('Format should also contain a \"{\"');b=e.slice(q+1,-1),e=e.slice(0,q+1)}else b=\"\";var X;if(X=-1===e.indexOf(\".\")?e.match(/([0-9]+).*/):e.match(/([0-9]+)\\..*/),C=null===X?-1:X[1].length,-1!==e.indexOf(\"-\")&&(V=!0),e.indexOf(\"(\")>-1?(T=!0,e=e.slice(1,-1)):e.indexOf(\"+\")>-1&&(A=!0,e=e.replace(/\\+/g,\"\")),e.indexOf(\"a\")>-1){if(m=e.split(\".\")[0].match(/[0-9]+/g)||[\"0\"],m=parseInt(m[0],10),O=e.indexOf(\"aK\")>=0,z=e.indexOf(\"aM\")>=0,P=e.indexOf(\"aB\")>=0,j=e.indexOf(\"aT\")>=0,N=O||z||P||j,e.indexOf(\" a\")>-1?(M=\" \",e=e.replace(\" a\",\"\")):e=e.replace(\"a\",\"\"),h=Math.floor(Math.log(I)/Math.LN10)+1,_=h%3,_=0===_?3:_,m&&0!==I&&(c=Math.floor(Math.log(I)/Math.LN10)+1-m,f=3*~~((Math.min(m,h)-_)/3),I/=Math.pow(10,f),-1===e.indexOf(\".\")&&m>3))for(e+=\"[.]\",k=(k=0===c?0:3*~~(c/3)-c)<0?k+3:k,r=0;r<k;r++)e+=\"0\";Math.floor(Math.log(Math.abs(t))/Math.LN10)+1!==m&&(I>=Math.pow(10,12)&&!N||j?(M+=u[p].abbreviations.trillion,t/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!N||P?(M+=u[p].abbreviations.billion,t/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!N||z?(M+=u[p].abbreviations.million,t/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!N||O)&&(M+=u[p].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf(\"b\")>-1)for(e.indexOf(\" b\")>-1?(F=\" \",e=e.replace(\" b\",\"\")):e=e.replace(\"b\",\"\"),l=0;l<=B.length;l++)if(s=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=s&&t<a){F+=B[l],s>0&&(t/=s);break}if(e.indexOf(\"d\")>-1)for(e.indexOf(\" d\")>-1?(F=\" \",e=e.replace(\" d\",\"\")):e=e.replace(\"d\",\"\"),l=0;l<=R.length;l++)if(s=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=s&&t<a){F+=R[l],s>0&&(t/=s);break}if(e.indexOf(\"o\")>-1&&(e.indexOf(\" o\")>-1?(D=\" \",e=e.replace(\" o\",\"\")):e=e.replace(\"o\",\"\"),u[p].ordinal&&(D+=u[p].ordinal(t))),e.indexOf(\"[.]\")>-1&&(E=!0,e=e.replace(\"[.]\",\".\")),v=t.toString().split(\".\")[0],g=e.split(\".\")[1],x=e.indexOf(\",\"),g){if(-1!==g.indexOf(\"*\")?L=o(t,t.toString().split(\".\")[1].length,i):g.indexOf(\"[\")>-1?(g=(g=g.replace(\"]\",\"\")).split(\"[\"),L=o(t,g[0].length+g[1].length,i,g[1].length)):L=o(t,g.length,i),v=L.split(\".\")[0],L.split(\".\")[1].length){var W=n?M+n:u[p].delimiters.decimal;L=W+L.split(\".\")[1]}else L=\"\";E&&0===Number(L.slice(1))&&(L=\"\")}else v=o(t,null,i);return v.indexOf(\"-\")>-1&&(v=v.slice(1),G=!0),v.length<C&&(v=new Array(C-v.length+1).join(\"0\")+v),x>-1&&(v=v.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g,\"$1\"+u[p].delimiters.thousands)),0===e.indexOf(\".\")&&(v=\"\"),w=e.indexOf(\"(\"),S=e.indexOf(\"-\"),U=w<S?(T&&G?\"(\":\"\")+(V&&G||!T&&G?\"-\":\"\"):(V&&G||!T&&G?\"-\":\"\")+(T&&G?\"(\":\"\"),y+U+(!G&&A&&0!==t?\"+\":\"\")+v+L+(D||\"\")+(M&&!n?M:\"\")+(F||\"\")+(T&&G?\")\":\"\")+b}function l(t,e){u[t]=e}function h(t){p=t;var e=u[t].defaults;e&&e.format&&c.defaultFormat(e.format),e&&e.currencyFormat&&c.defaultCurrencyFormat(e.currencyFormat)}var c,u={},_=u,p=\"en-US\",d=null,f=\"0,0\";void 0!==e&&e.exports;(c=function(t){return c.isNumbro(t)?t=t.value():0===t||void 0===t?t=0:Number(t)||(t=c.fn.unformat(t)),new n(Number(t))}).version=\"1.6.2\",c.isNumbro=function(t){return t instanceof n},c.setLanguage=function(t,e){console.warn(\"`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead\");var i=t,n=t.split(\"-\")[0],r=null;_[i]||(Object.keys(_).forEach(function(t){r||t.split(\"-\")[0]!==n||(r=t)}),i=r||e||\"en-US\"),h(i)},c.setCulture=function(t,e){var i=t,n=t.split(\"-\")[1],r=null;u[i]||(n&&Object.keys(u).forEach(function(t){r||t.split(\"-\")[1]!==n||(r=t)}),i=r||e||\"en-US\"),h(i)},c.language=function(t,e){if(console.warn(\"`language` is deprecated since version 1.6.0. Use `culture` instead\"),!t)return p;if(t&&!e){if(!_[t])throw new Error(\"Unknown language : \"+t);h(t)}return!e&&_[t]||l(t,e),c},c.culture=function(t,e){if(!t)return p;if(t&&!e){if(!u[t])throw new Error(\"Unknown culture : \"+t);h(t)}return!e&&u[t]||l(t,e),c},c.languageData=function(t){if(console.warn(\"`languageData` is deprecated since version 1.6.0. Use `cultureData` instead\"),!t)return _[p];if(!_[t])throw new Error(\"Unknown language : \"+t);return _[t]},c.cultureData=function(t){if(!t)return u[p];if(!u[t])throw new Error(\"Unknown culture : \"+t);return u[t]},c.culture(\"en-US\",{delimiters:{thousands:\",\",decimal:\".\"},abbreviations:{thousand:\"k\",million:\"m\",billion:\"b\",trillion:\"t\"},ordinal:function(t){var e=t%10;return 1==~~(t%100/10)?\"th\":1===e?\"st\":2===e?\"nd\":3===e?\"rd\":\"th\"},currency:{symbol:\"$\",position:\"prefix\"},defaults:{currencyFormat:\",0000 a\"},formats:{fourDigits:\"0000 a\",fullWithTwoDecimals:\"$ ,0.00\",fullWithTwoDecimalsNoCurrency:\",0.00\"}}),c.languages=function(){return console.warn(\"`languages` is deprecated since version 1.6.0. Use `cultures` instead\"),_},c.cultures=function(){return u},c.zeroFormat=function(t){d=\"string\"==typeof t?t:null},c.defaultFormat=function(t){f=\"string\"==typeof t?t:\"0.0\"},c.defaultCurrencyFormat=function(t){\"string\"==typeof t?t:\"0$\"},c.validate=function(t,e){var i,n,r,o,s,a,l,h;if(\"string\"!=typeof t&&(t+=\"\",console.warn&&console.warn(\"Numbro.js: Value is not string. It has been co-erced to: \",t)),(t=t.trim()).match(/^\\d+$/))return!0;if(\"\"===t)return!1;try{l=c.cultureData(e)}catch(t){l=c.cultureData(c.culture())}return r=l.currency.symbol,s=l.abbreviations,i=l.delimiters.decimal,n=\".\"===l.delimiters.thousands?\"\\\\.\":l.delimiters.thousands,(null===(h=t.match(/^[^\\d]+/))||(t=t.substr(1),h[0]===r))&&((null===(h=t.match(/[^\\d]+$/))||(t=t.slice(0,-1),h[0]===s.thousand||h[0]===s.million||h[0]===s.billion||h[0]===s.trillion))&&(a=new RegExp(n+\"{2}\"),!t.match(/[^\\d.,]/g)&&!((o=t.split(i)).length>2||(o.length<2?!o[0].match(/^\\d+.*\\d$/)||o[0].match(a):1===o[0].length?!o[0].match(/^\\d+$/)||o[0].match(a)||!o[1].match(/^\\d+$/):!o[0].match(/^\\d+.*\\d$/)||o[0].match(a)||!o[1].match(/^\\d+$/)))))},e.exports={format:function(t,e,i,n){null!=i&&i!==c.culture()&&c.setCulture(i);return s(Number(t),null!=e?e:f,null==n?Math.round:n)}}},function(t,e,i){function n(t,e){if(!(this instanceof n))return new n(t);e=e||function(t){if(t)throw t};var i=r(t);if(\"object\"==typeof i){var s=n.projections.get(i.projName);if(s){if(i.datumCode&&\"none\"!==i.datumCode){var c=l[i.datumCode];c&&(i.datum_params=c.towgs84?c.towgs84.split(\",\"):null,i.ellps=c.ellipse,i.datumName=c.datumName?c.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||\"enu\";var u=a.sphere(i.a,i.b,i.rf,i.ellps,i.sphere),_=a.eccentricity(u.a,u.b,u.rf,i.R_A),p=i.datum||h(i.datumCode,i.datum_params,u.a,u.b,_.es,_.ep2);o(this,i),o(this,s),this.a=u.a,this.b=u.b,this.rf=u.rf,this.sphere=u.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}else e(t)}else e(t)}var r=t(368),o=t(366),s=t(370),a=t(365),l=t(356),h=t(361);(n.projections=s).start(),e.exports=n},function(t,e,i){e.exports=function(t,e,i){var n,r,o,s=i.x,a=i.y,l=i.z||0,h={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==i.z)switch(0===o?(n=s,r=\"x\"):1===o?(n=a,r=\"y\"):(n=l,r=\"z\"),t.axis[o]){case\"e\":h[r]=n;break;case\"w\":h[r]=-n;break;case\"n\":h[r]=n;break;case\"s\":h[r]=-n;break;case\"u\":void 0!==i[r]&&(h.z=n);break;case\"d\":void 0!==i[r]&&(h.z=-n);break;default:return null}return h}},function(t,e,i){var n=2*Math.PI,r=t(353);e.exports=function(t){return Math.abs(t)<=3.14159265359?t:t-r(t)*n}},function(t,e,i){e.exports=function(t,e,i){var n=t*e;return i/Math.sqrt(1-n*n)}},function(t,e,i){var n=Math.PI/2;e.exports=function(t,e){for(var i,r,o=.5*t,s=n-2*Math.atan(e),a=0;a<=15;a++)if(i=t*Math.sin(s),r=n-2*Math.atan(e*Math.pow((1-i)/(1+i),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,i){e.exports=function(t){return t<0?-1:1}},function(t,e,i){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,i){var n=Math.PI/2;e.exports=function(t,e,i){var r=t*i,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(n-e))/r}},function(t,e,i){i.wgs84={towgs84:\"0,0,0\",ellipse:\"WGS84\",datumName:\"WGS84\"},i.ch1903={towgs84:\"674.374,15.056,405.346\",ellipse:\"bessel\",datumName:\"swiss\"},i.ggrs87={towgs84:\"-199.87,74.79,246.62\",ellipse:\"GRS80\",datumName:\"Greek_Geodetic_Reference_System_1987\"},i.nad83={towgs84:\"0,0,0\",ellipse:\"GRS80\",datumName:\"North_American_Datum_1983\"},i.nad27={nadgrids:\"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",ellipse:\"clrk66\",datumName:\"North_American_Datum_1927\"},i.potsdam={towgs84:\"606.0,23.0,413.0\",ellipse:\"bessel\",datumName:\"Potsdam Rauenberg 1950 DHDN\"},i.carthage={towgs84:\"-263.0,6.0,431.0\",ellipse:\"clark80\",datumName:\"Carthage 1934 Tunisia\"},i.hermannskogel={towgs84:\"653.0,-212.0,449.0\",ellipse:\"bessel\",datumName:\"Hermannskogel\"},i.ire65={towgs84:\"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",ellipse:\"mod_airy\",datumName:\"Ireland 1965\"},i.rassadiran={towgs84:\"-133.63,-157.5,-158.62\",ellipse:\"intl\",datumName:\"Rassadiran\"},i.nzgd49={towgs84:\"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",ellipse:\"intl\",datumName:\"New Zealand Geodetic Datum 1949\"},i.osgb36={towgs84:\"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",ellipse:\"airy\",datumName:\"Airy 1830\"},i.s_jtsk={towgs84:\"589,76,480\",ellipse:\"bessel\",datumName:\"S-JTSK (Ferro)\"},i.beduaram={towgs84:\"-106,-87,188\",ellipse:\"clrk80\",datumName:\"Beduaram\"},i.gunung_segara={towgs84:\"-403,684,41\",ellipse:\"bessel\",datumName:\"Gunung Segara Jakarta\"},i.rnb72={towgs84:\"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",ellipse:\"intl\",datumName:\"Reseau National Belge 1972\"}},function(t,e,i){i.MERIT={a:6378137,rf:298.257,ellipseName:\"MERIT 1983\"},i.SGS85={a:6378136,rf:298.257,ellipseName:\"Soviet Geodetic System 85\"},i.GRS80={a:6378137,rf:298.257222101,ellipseName:\"GRS 1980(IUGG, 1980)\"},i.IAU76={a:6378140,rf:298.257,ellipseName:\"IAU 1976\"},i.airy={a:6377563.396,b:6356256.91,ellipseName:\"Airy 1830\"},i.APL4={a:6378137,rf:298.25,ellipseName:\"Appl. Physics. 1965\"},i.NWL9D={a:6378145,rf:298.25,ellipseName:\"Naval Weapons Lab., 1965\"},i.mod_airy={a:6377340.189,b:6356034.446,ellipseName:\"Modified Airy\"},i.andrae={a:6377104.43,rf:300,ellipseName:\"Andrae 1876 (Den., Iclnd.)\"},i.aust_SA={a:6378160,rf:298.25,ellipseName:\"Australian Natl & S. Amer. 1969\"},i.GRS67={a:6378160,rf:298.247167427,ellipseName:\"GRS 67(IUGG 1967)\"},i.bessel={a:6377397.155,rf:299.1528128,ellipseName:\"Bessel 1841\"},i.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:\"Bessel 1841 (Namibia)\"},i.clrk66={a:6378206.4,b:6356583.8,ellipseName:\"Clarke 1866\"},i.clrk80={a:6378249.145,rf:293.4663,ellipseName:\"Clarke 1880 mod.\"},i.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:\"Clarke 1858\"},i.CPM={a:6375738.7,rf:334.29,ellipseName:\"Comm. des Poids et Mesures 1799\"},i.delmbr={a:6376428,rf:311.5,ellipseName:\"Delambre 1810 (Belgium)\"},i.engelis={a:6378136.05,rf:298.2566,ellipseName:\"Engelis 1985\"},i.evrst30={a:6377276.345,rf:300.8017,ellipseName:\"Everest 1830\"},i.evrst48={a:6377304.063,rf:300.8017,ellipseName:\"Everest 1948\"},i.evrst56={a:6377301.243,rf:300.8017,ellipseName:\"Everest 1956\"},i.evrst69={a:6377295.664,rf:300.8017,ellipseName:\"Everest 1969\"},i.evrstSS={a:6377298.556,rf:300.8017,ellipseName:\"Everest (Sabah & Sarawak)\"},i.fschr60={a:6378166,rf:298.3,ellipseName:\"Fischer (Mercury Datum) 1960\"},i.fschr60m={a:6378155,rf:298.3,ellipseName:\"Fischer 1960\"},i.fschr68={a:6378150,rf:298.3,ellipseName:\"Fischer 1968\"},i.helmert={a:6378200,rf:298.3,ellipseName:\"Helmert 1906\"},i.hough={a:6378270,rf:297,ellipseName:\"Hough\"},i.intl={a:6378388,rf:297,ellipseName:\"International 1909 (Hayford)\"},i.kaula={a:6378163,rf:298.24,ellipseName:\"Kaula 1961\"},i.lerch={a:6378139,rf:298.257,ellipseName:\"Lerch 1979\"},i.mprts={a:6397300,rf:191,ellipseName:\"Maupertius 1738\"},i.new_intl={a:6378157.5,b:6356772.2,ellipseName:\"New International 1967\"},i.plessis={a:6376523,rf:6355863,ellipseName:\"Plessis 1817 (France)\"},i.krass={a:6378245,rf:298.3,ellipseName:\"Krassovsky, 1942\"},i.SEasia={a:6378155,b:6356773.3205,ellipseName:\"Southeast Asia\"},i.walbeck={a:6376896,b:6355834.8467,ellipseName:\"Walbeck\"},i.WGS60={a:6378165,rf:298.3,ellipseName:\"WGS 60\"},i.WGS66={a:6378145,rf:298.25,ellipseName:\"WGS 66\"},i.WGS7={a:6378135,rf:298.26,ellipseName:\"WGS 72\"},i.WGS84={a:6378137,rf:298.257223563,ellipseName:\"WGS 84\"},i.sphere={a:6370997,b:6370997,ellipseName:\"Normal Sphere (r=6370997)\"}},function(t,e,i){i.greenwich=0,i.lisbon=-9.131906111111,i.paris=2.337229166667,i.bogota=-74.080916666667,i.madrid=-3.687938888889,i.rome=12.452333333333,i.bern=7.439583333333,i.jakarta=106.807719444444,i.ferro=-17.666666666667,i.brussels=4.367975,i.stockholm=18.058277777778,i.athens=23.7163375,i.oslo=10.722916666667},function(t,e,i){i.ft={to_meter:.3048},i[\"us-ft\"]={to_meter:1200/3937}},function(t,e,i){function n(t,e,i){var n;return Array.isArray(i)?(n=s(t,e,i),3===i.length?[n.x,n.y,n.z]:[n.x,n.y]):s(t,e,i)}function r(t){return t instanceof o?t:t.oProj?t.oProj:o(t)}var o=t(348),s=t(373),a=o(\"WGS84\");e.exports=function(t,e,i){t=r(t);var o,s=!1;void 0===e?(e=t,t=a,s=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=a,s=!0);return e=r(e),i?n(t,e,i):(o={forward:function(i){return n(t,e,i)},inverse:function(i){return n(e,t,i)}},s&&(o.oProj=e),o)}},function(t,e,i){var n=1,r=2,o=4,s=5,a=484813681109536e-20;e.exports=function(t,e,i,l,h,c){var u={};u.datum_type=o,t&&\"none\"===t&&(u.datum_type=s);e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=n),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=r,u.datum_params[3]*=a,u.datum_params[4]*=a,u.datum_params[5]*=a,u.datum_params[6]=u.datum_params[6]/1e6+1)));return u.a=i,u.b=l,u.es=h,u.ep2=c,u}},function(t,e,i){var n=Math.PI/2;i.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(1===t.datum_type?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},i.geodeticToGeocentric=function(t,e,i){var r,o,s,a,l=t.x,h=t.y,c=t.z?t.z:0;if(h<-n&&h>-1.001*n)h=-n;else if(h>n&&h<1.001*n)h=n;else if(h<-n||h>n)return null;return l>Math.PI&&(l-=2*Math.PI),o=Math.sin(h),a=Math.cos(h),s=o*o,r=i/Math.sqrt(1-e*s),{x:(r+c)*a*Math.cos(l),y:(r+c)*a*Math.sin(l),z:(r*(1-e)+c)*o}},i.geocentricToGeodetic=function(t,e,i,r){var o,s,a,l,h,c,u,_,p,d,f,v,m,g,y,b,x=t.x,w=t.y,k=t.z?t.z:0;if(o=Math.sqrt(x*x+w*w),s=Math.sqrt(x*x+w*w+k*k),o/i<1e-12){if(g=0,s/i<1e-12)return y=n,b=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(w,x);a=k/s,l=o/s,h=1/Math.sqrt(1-e*(2-e)*l*l),_=l*(1-e)*h,p=a*h,m=0;do{m++,u=i/Math.sqrt(1-e*p*p),c=e*u/(u+(b=o*_+k*p-u*(1-e*p*p))),h=1/Math.sqrt(1-c*(2-c)*l*l),v=(f=a*h)*_-(d=l*(1-c)*h)*p,_=d,p=f}while(v*v>1e-24&&m<30);return y=Math.atan(f/Math.abs(d)),{x:g,y:y,z:b}},i.geocentricToWgs84=function(t,e,i){if(1===e)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+n,y:h*(l*t.x+t.y-s*t.z)+r,z:h*(-a*t.x+s*t.y+t.z)+o}}},i.geocentricFromWgs84=function(t,e,i){if(1===e)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===e){var n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6],c=(t.x-n)/h,u=(t.y-r)/h,_=(t.z-o)/h;return{x:c+l*u-a*_,y:-l*c+u+s*_,z:a*c-s*u+_}}}},function(t,e,i){function n(t){return t===r||t===o}var r=1,o=2,s=t(362);e.exports=function(t,e,i){return s.compareDatums(t,e)?i:5===t.datum_type||5===e.datum_type?i:t.es!==e.es||t.a!==e.a||n(t.datum_type)||n(e.datum_type)?(i=s.geodeticToGeocentric(i,t.es,t.a),n(t.datum_type)&&(i=s.geocentricToWgs84(i,t.datum_type,t.datum_params)),n(e.datum_type)&&(i=s.geocentricFromWgs84(i,e.datum_type,e.datum_params)),s.geocentricToGeodetic(i,e.es,e.a,e.b)):i}},function(t,e,i){function n(t){var e=this;if(2===arguments.length){var i=arguments[1];n[t]=\"string\"==typeof i?\"+\"===i.charAt(0)?o(arguments[1]):s(arguments[1]):i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if(\"string\"==typeof t){if(t in n)return n[t]}else\"EPSG\"in t?n[\"EPSG:\"+t.EPSG]=t:\"ESRI\"in t?n[\"ESRI:\"+t.ESRI]=t:\"IAU2000\"in t?n[\"IAU2000:\"+t.IAU2000]=t:console.log(t);return}}var r=t(367),o=t(369),s=t(374);r(n),e.exports=n},function(t,e,i){var n=t(357);i.eccentricity=function(t,e,i,n){var r=t*t,o=e*e,s=(r-o)/r,a=0;n?(r=(t*=1-s*(.16666666666666666+s*(.04722222222222222+.022156084656084655*s)))*t,s=0):a=Math.sqrt(s);var l=(r-o)/o;return{es:s,e:a,ep2:l}},i.sphere=function(t,e,i,r,o){if(!t){var s=n[r];s||(s=n.WGS84),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(0===i||Math.abs(t-e)<1e-10)&&(o=!0,e=t),{a:t,b:e,rf:i,sphere:o}}},function(t,e,i){e.exports=function(t,e){t=t||{};var i,n;if(!e)return t;for(n in e)void 0!==(i=e[n])&&(t[n]=i);return t}},function(t,e,i){e.exports=function(t){t(\"EPSG:4326\",\"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\"),t(\"EPSG:4269\",\"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\"),t(\"EPSG:3857\",\"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\"),t.WGS84=t[\"EPSG:4326\"],t[\"EPSG:3785\"]=t[\"EPSG:3857\"],t.GOOGLE=t[\"EPSG:3857\"],t[\"EPSG:900913\"]=t[\"EPSG:3857\"],t[\"EPSG:102113\"]=t[\"EPSG:3857\"]}},function(t,e,i){var n=t(364),r=t(374),o=t(369),s=[\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\"];e.exports=function(t){if(!function(t){return\"string\"==typeof t}(t))return t;if(function(t){return t in n}(t))return n[t];if(function(t){return s.some(function(e){return t.indexOf(e)>-1})}(t))return r(t);if(function(t){return\"+\"===t[0]}(t))return o(t)}},function(t,e,i){var n=.017453292519943295,r=t(358),o=t(359);e.exports=function(t){var e,i,s,a={},l=t.split(\"+\").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split(\"=\");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),h={proj:\"projName\",datum:\"datumCode\",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*n},lat_1:function(t){a.lat1=t*n},lat_2:function(t){a.lat2=t*n},lat_ts:function(t){a.lat_ts=t*n},lon_0:function(t){a.long0=t*n},lon_1:function(t){a.long1=t*n},lon_2:function(t){a.long2=t*n},alpha:function(t){a.alpha=parseFloat(t)*n},lonc:function(t){a.longc=t*n},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(\",\").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*n},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*n},nadgrids:function(t){\"@null\"===t?a.datumCode=\"none\":a.nadgrids=t},axis:function(t){3===t.length&&-1!==\"ewnsud\".indexOf(t.substr(0,1))&&-1!==\"ewnsud\".indexOf(t.substr(1,1))&&-1!==\"ewnsud\".indexOf(t.substr(2,1))&&(a.axis=t)}};for(e in l)i=l[e],e in h?\"function\"==typeof(s=h[e])?s(i):a[s]=i:a[e]=i;return\"string\"==typeof a.datumCode&&\"WGS84\"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,i){function n(t,e){var i=s.length;return t.names?(s[i]=t,t.names.forEach(function(t){o[t.toLowerCase()]=i}),this):(console.log(e),!0)}var r=[t(372),t(371)],o={},s=[];i.add=n,i.get=function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==o[e]&&s[o[e]]?s[o[e]]:void 0},i.start=function(){r.forEach(n)}},function(t,e,i){function n(t){return t}i.init=function(){},i.forward=n,i.inverse=n,i.names=[\"longlat\",\"identity\"]},function(t,e,i){var n=t(351),r=Math.PI/2,o=57.29577951308232,s=t(350),a=Math.PI/4,l=t(355),h=t(352);i.init=function(){var t=this.b/this.a;this.es=1-t*t,\"x0\"in this||(this.x0=0),\"y0\"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=n(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},i.forward=function(t){var e=t.x,i=t.y;if(i*o>90&&i*o<-90&&e*o>180&&e*o<-180)return null;var n,h;if(Math.abs(Math.abs(i)-r)<=1e-10)return null;if(this.sphere)n=this.x0+this.a*this.k0*s(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(a+.5*i));else{var c=Math.sin(i),u=l(this.e,i,c);n=this.x0+this.a*this.k0*s(e-this.long0),h=this.y0-this.a*this.k0*Math.log(u)}return t.x=n,t.y=h,t},i.inverse=function(t){var e,i,n=t.x-this.x0,o=t.y-this.y0;if(this.sphere)i=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(i=h(this.e,a)))return null}return e=s(this.long0+n/(this.a*this.k0)),t.x=e,t.y=i,t},i.names=[\"Mercator\",\"Popular Visualisation Pseudo Mercator\",\"Mercator_1SP\",\"Mercator_Auxiliary_Sphere\",\"merc\"]},function(t,e,i){var n=1,r=2,o=t(363),s=t(349),a=t(348),l=t(354);e.exports=function t(e,i,h){var c;return Array.isArray(h)&&(h=l(h)),e.datum&&i.datum&&function(t,e){return(t.datum.datum_type===n||t.datum.datum_type===r)&&\"WGS84\"!==e.datumCode||(e.datum.datum_type===n||e.datum.datum_type===r)&&\"WGS84\"!==t.datumCode}(e,i)&&(c=new a(\"WGS84\"),h=t(e,c,h),e=c),\"enu\"!==e.axis&&(h=s(e,!1,h)),\"longlat\"===e.projName?h={x:.017453292519943295*h.x,y:.017453292519943295*h.y}:(e.to_meter&&(h={x:h.x*e.to_meter,y:h.y*e.to_meter}),h=e.inverse(h)),e.from_greenwich&&(h.x+=e.from_greenwich),h=o(e.datum,i.datum,h),i.from_greenwich&&(h={x:h.x-i.grom_greenwich,y:h.y}),\"longlat\"===i.projName?h={x:57.29577951308232*h.x,y:57.29577951308232*h.y}:(h=i.forward(h),i.to_meter&&(h={x:h.x/i.to_meter,y:h.y/i.to_meter})),\"enu\"!==i.axis?s(i,!0,h):h}},function(t,e,i){function n(t,e,i){t[e]=i.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return a(t,e)},{})}function r(t,e){var i;Array.isArray(t)?(\"PARAMETER\"===(i=t.shift())&&(i=t.shift()),1===t.length?Array.isArray(t[0])?(e[i]={},r(t[0],e[i])):e[i]=t[0]:t.length?\"TOWGS84\"===i?e[i]=t:(e[i]={},[\"UNIT\",\"PRIMEM\",\"VERT_DATUM\"].indexOf(i)>-1?(e[i]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[i].auth=t[2])):\"SPHEROID\"===i?(e[i]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[i].auth=t[3])):[\"GEOGCS\",\"GEOCCS\",\"DATUM\",\"VERT_CS\",\"COMPD_CS\",\"LOCAL_CS\",\"FITTED_CS\",\"LOCAL_DATUM\"].indexOf(i)>-1?(t[0]=[\"name\",t[0]],n(e,i,t)):t.every(function(t){return Array.isArray(t)})?n(e,i,t):r(t,e[i])):e[i]=!0):e[t]=!0}function o(t){return t*s}var s=.017453292519943295,a=t(366);e.exports=function(t,e){var i=JSON.parse((\",\"+t).replace(/\\s*\\,\\s*([A-Z_0-9]+?)(\\[)/g,',[\"$1\",').slice(1).replace(/\\s*\\,\\s*([A-Z_0-9]+?)\\]/g,',\"$1\"]').replace(/,\\[\"VERTCS\".+/,\"\")),n=i.shift(),s=i.shift();i.unshift([\"name\",s]),i.unshift([\"type\",n]),i.unshift(\"output\");var l={};return r(i,l),function(t){function e(e){var i=t.to_meter||1;return parseFloat(e,10)*i}\"GEOGCS\"===t.type?t.projName=\"longlat\":\"LOCAL_CS\"===t.type?(t.projName=\"identity\",t.local=!0):\"object\"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION;t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),\"metre\"===t.units&&(t.units=\"meter\"),t.UNIT.convert&&(\"GEOGCS\"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10)));t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),\"d_\"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),\"new_zealand_geodetic_datum_1949\"!==t.datumCode&&\"new_zealand_1949\"!==t.datumCode||(t.datumCode=\"nzgd49\"),\"wgs_1984\"===t.datumCode&&(\"Mercator_Auxiliary_Sphere\"===t.PROJECTION&&(t.sphere=!0),t.datumCode=\"wgs84\"),\"_ferro\"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),\"_jakarta\"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf(\"belge\")&&(t.datumCode=\"rnb72\"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace(\"_19\",\"\").replace(/[Cc]larke\\_18/,\"clrk\"),\"international\"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps=\"intl\"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf(\"osgb_1936\")&&(t.datumCode=\"osgb36\"));t.b&&!isFinite(t.b)&&(t.b=t.a);[[\"standard_parallel_1\",\"Standard_Parallel_1\"],[\"standard_parallel_2\",\"Standard_Parallel_2\"],[\"false_easting\",\"False_Easting\"],[\"false_northing\",\"False_Northing\"],[\"central_meridian\",\"Central_Meridian\"],[\"latitude_of_origin\",\"Latitude_Of_Origin\"],[\"latitude_of_origin\",\"Central_Parallel\"],[\"scale_factor\",\"Scale_Factor\"],[\"k0\",\"scale_factor\"],[\"latitude_of_center\",\"Latitude_of_center\"],[\"lat0\",\"latitude_of_center\",o],[\"longitude_of_center\",\"Longitude_Of_Center\"],[\"longc\",\"longitude_of_center\",o],[\"x0\",\"false_easting\",e],[\"y0\",\"false_northing\",e],[\"long0\",\"central_meridian\",o],[\"lat0\",\"latitude_of_origin\",o],[\"lat0\",\"standard_parallel_1\",o],[\"lat1\",\"standard_parallel_1\",o],[\"lat2\",\"standard_parallel_2\",o],[\"alpha\",\"azimuth\",o],[\"srsCode\",\"name\"]].forEach(function(e){return function(t,e){var i=e[0],n=e[1];!(i in t)&&n in t&&(t[i]=t[n],3===e.length&&(t[i]=e[2](t[i])))}(t,e)}),t.long0||!t.longc||\"Albers_Conic_Equal_Area\"!==t.projName&&\"Lambert_Azimuthal_Equal_Area\"!==t.projName||(t.long0=t.longc);t.lat_ts||!t.lat1||\"Stereographic_South_Pole\"!==t.projName&&\"Polar Stereographic (variant B)\"!==t.projName||(t.lat0=o(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(l.output),a(e,l.output)}},function(t,e,i){function n(t,e,i,o,s){for(i=i||0,o=o||t.length-1,s=s||function(t,e){return t<e?-1:t>e?1:0};o>i;){if(o-i>600){var a=o-i+1,l=e-i+1,h=Math.log(a),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(a-c)/a)*(l-a/2<0?-1:1),_=Math.max(i,Math.floor(e-l*c/a+u)),p=Math.min(o,Math.floor(e+(a-l)*c/a+u));n(t,e,_,p,s)}var d=t[e],f=i,v=o;for(r(t,i,e),s(t[o],d)>0&&r(t,i,o);f<v;){for(r(t,f,v),f++,v--;s(t[f],d)<0;)f++;for(;s(t[v],d)>0;)v--}0===s(t[i],d)?r(t,i,v):r(t,++v,o),v<=e&&(i=v+1),e<=v&&(o=v-1)}}function r(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}e.exports=n},function(t,e,i){function n(t,e){if(!(this instanceof n))return new n(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e){o(t,0,t.children.length,e,t)}function o(t,e,i,n,r){r||(r=p(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,a=e;a<i;a++)o=t.children[a],s(r,t.leaf?n(o):o);return r}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function a(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function _(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(t,e,i,n,r){for(var o,s=[e,i];s.length;)i=s.pop(),e=s.pop(),i-e<=n||(o=e+Math.ceil((i-e)/n/2)*n,f(t,o,e,i,r),s.push(e,o,o,i))}e.exports=n;var f=t(375);n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!_(t,e))return i;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],a=e.leaf?n(s):s,_(t,a)&&(e.leaf?i.push(s):u(t,a)?this._all(s,i):l.push(s));e=l.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!_(t,e))return!1;for(var n,r,o,s,a=[];e;){for(n=0,r=e.children.length;n<r;n++)if(o=e.children[n],s=e.leaf?i(o):o,_(t,s)){if(e.leaf||u(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=p([]),this},remove:function(t,e){if(!t)return this;for(var i,n,r,o,s=this.data,a=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),n=l[l.length-1],i=h.pop(),o=!0),s.leaf&&-1!==(r=function(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}(t,s.children,e)))return s.children.splice(r,1),l.push(s),this._condense(l),this;o||s.leaf||!u(s,a)?n?(i++,s=n.children[i],o=!1):s=null:(l.push(s),h.push(i),i=0,n=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:a,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var o,s=i-e+1,a=this._maxEntries;if(s<=a)return o=p(t.slice(e,i+1)),r(o,this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(o=p([])).leaf=!1,o.height=n;var l,h,c,u,_=Math.ceil(s/a),f=_*Math.ceil(Math.sqrt(a));for(d(t,e,i,f,this.compareMinX),l=e;l<=i;l+=f)for(c=Math.min(l+f-1,i),d(t,l,c,_,this.compareMinY),h=l;h<=c;h+=_)u=Math.min(h+_-1,c),o.children.push(this._build(t,h,u,n-1));return r(o,this.toBBox),o},_chooseSubtree:function(t,e,i,n){for(var r,o,s,a,l,c,u,_;n.push(e),!e.leaf&&n.length-1!==i;){for(u=_=1/0,r=0,o=e.children.length;r<o;r++)s=e.children[r],l=h(s),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-l)<_?(_=c,u=l<u?l:u,a=s):c===_&&l<u&&(u=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,r=i?t:n(t),o=[],a=this._chooseSubtree(r,this.data,e,o);for(a.children.push(t),s(a,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=p(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,s,a,l,c,u,_;for(c=u=1/0,n=e;n<=i-e;n++)r=o(t,0,n,this.toBBox),s=o(t,n,i,this.toBBox),a=function(t,e){var i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}(r,s),l=h(r)+h(s),a<c?(c=a,_=n,u=l<u?l:u):a===c&&l<u&&(u=l,_=n);return _},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:a,r=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,i,n),s=this._allDistMargin(t,e,i,r);o<s&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var r,a,l=this.toBBox,h=o(t,0,e,l),u=o(t,i-e,i,l),_=c(h)+c(u);for(r=e;r<i-e;r++)a=t.children[r],s(h,t.leaf?l(a):a),_+=c(h);for(r=i-e-1;r>=e;r--)a=t.children[r],s(u,t.leaf?l(a):a),_+=c(u);return _},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)s(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():r(t[i],this.toBBox)},_initFormat:function(t){var e=[\"return a\",\" - b\",\";\"];this.compareMinX=new Function(\"a\",\"b\",e.join(t[0])),this.compareMinY=new Function(\"a\",\"b\",e.join(t[1])),this.toBBox=new Function(\"a\",\"return {minX: a\"+t[0]+\", minY: a\"+t[1]+\", maxX: a\"+t[2]+\", maxY: a\"+t[3]+\"};\")}}},function(t,e,i){!function(){\"use strict\";function t(e){return function(e,i){var r,o,s,a,l,h,c,u,_,p=1,d=e.length,f=\"\";for(o=0;o<d;o++)if(\"string\"==typeof e[o])f+=e[o];else if(Array.isArray(e[o])){if((a=e[o])[2])for(r=i[p],s=0;s<a[2].length;s++){if(!r.hasOwnProperty(a[2][s]))throw new Error(t('[sprintf] property \"%s\" does not exist',a[2][s]));r=r[a[2][s]]}else r=a[1]?i[a[1]]:i[p++];if(n.not_type.test(a[8])&&n.not_primitive.test(a[8])&&r instanceof Function&&(r=r()),n.numeric_arg.test(a[8])&&\"number\"!=typeof r&&isNaN(r))throw new TypeError(t(\"[sprintf] expecting number but found %T\",r));switch(n.number.test(a[8])&&(u=r>=0),a[8]){case\"b\":r=parseInt(r,10).toString(2);break;case\"c\":r=String.fromCharCode(parseInt(r,10));break;case\"d\":case\"i\":r=parseInt(r,10);break;case\"j\":r=JSON.stringify(r,null,a[6]?parseInt(a[6]):0);break;case\"e\":r=a[7]?parseFloat(r).toExponential(a[7]):parseFloat(r).toExponential();break;case\"f\":r=a[7]?parseFloat(r).toFixed(a[7]):parseFloat(r);break;case\"g\":r=a[7]?String(Number(r.toPrecision(a[7]))):parseFloat(r);break;case\"o\":r=(parseInt(r,10)>>>0).toString(8);break;case\"s\":r=String(r),r=a[7]?r.substring(0,a[7]):r;break;case\"t\":r=String(!!r),r=a[7]?r.substring(0,a[7]):r;break;case\"T\":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a[7]?r.substring(0,a[7]):r;break;case\"u\":r=parseInt(r,10)>>>0;break;case\"v\":r=r.valueOf(),r=a[7]?r.substring(0,a[7]):r;break;case\"x\":r=(parseInt(r,10)>>>0).toString(16);break;case\"X\":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}n.json.test(a[8])?f+=r:(!n.number.test(a[8])||u&&!a[3]?_=\"\":(_=u?\"+\":\"-\",r=r.toString().replace(n.sign,\"\")),h=a[4]?\"0\"===a[4]?\"0\":a[4].charAt(1):\" \",c=a[6]-(_+r).length,l=a[6]&&c>0?h.repeat(c):\"\",f+=a[5]?_+r+l:\"0\"===h?_+l+r:l+_+r)}return f}(function(t){if(r[t])return r[t];var e,i=t,o=[],s=0;for(;i;){if(null!==(e=n.text.exec(i)))o.push(e[0]);else if(null!==(e=n.modulo.exec(i)))o.push(\"%\");else{if(null===(e=n.placeholder.exec(i)))throw new SyntaxError(\"[sprintf] unexpected placeholder\");if(e[2]){s|=1;var a=[],l=e[2],h=[];if(null===(h=n.key.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");for(a.push(h[1]);\"\"!==(l=l.substring(h[0].length));)if(null!==(h=n.key_access.exec(l)))a.push(h[1]);else{if(null===(h=n.index_access.exec(l)))throw new SyntaxError(\"[sprintf] failed to parse named argument key\");a.push(h[1])}e[2]=a}else s|=2;if(3===s)throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\");o.push(e)}i=i.substring(e[0].length)}return r[t]=o}(e),arguments)}function e(e,i){return t.apply(null,[e].concat(i||[]))}var n={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\\x25]+/,modulo:/^\\x25{2}/,placeholder:/^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\\d]*)/i,key_access:/^\\.([a-z_][a-z_\\d]*)/i,index_access:/^\\[(\\d+)\\]/,sign:/^[\\+\\-]/},r=Object.create(null);void 0!==i&&(i.sprintf=t,i.vsprintf=e),\"undefined\"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},function(t,e,i){!function(t){\"object\"==typeof e&&e.exports?e.exports=t():this.tz=t()}(function(){function t(t,e,i){var n,r=e.day[1];do{n=new Date(Date.UTC(i,e.month,Math.abs(r++)))}while(e.day[0]<7&&n.getUTCDay()!=e.day[0]);return n={clock:e.clock,sort:n.getTime(),rule:e,save:6e4*e.save,offset:t.offset},n[n.clock]=n.sort+6e4*e.time,n.posix?n.wallclock=n[n.clock]+(t.offset+e.saved):n.posix=n[n.clock]-(t.offset+e.saved),n}function e(e,i,n){var r,o,s,a,l,h,c,u=e[e.zone],_=[],p=new Date(n).getUTCFullYear(),d=1;for(r=1,o=u.length;r<o&&!(u[r][i]<=n);r++);if((s=u[r]).rules){for(h=e[s.rules],c=p+1;c>=p-d;--c)for(r=0,o=h.length;r<o;r++)h[r].from<=c&&c<=h[r].to?_.push(t(s,h[r],c)):h[r].to<c&&1==d&&(d=c-h[r].to);for(_.sort(function(t,e){return t.sort-e.sort}),r=0,o=_.length;r<o;r++)n>=_[r][i]&&_[r][_[r].clock]>s[_[r].clock]&&(a=_[r])}return a&&((l=/^(.*)\\/(.*)$/.exec(s.format))?a.abbrev=l[a.save?2:1]:a.abbrev=s.format.replace(/%s/,a.rule.letter)),a||s}function i(t,i){return\"UTC\"==t.zone?i:(t.entry=e(t,\"posix\",i),i+t.entry.offset+t.entry.save)}function n(t,i){if(\"UTC\"==t.zone)return i;var n,r;return t.entry=n=e(t,\"wallclock\",i),0<(r=i-n.wallclock)&&r<n.save?null:i-n.offset-n.save}function r(t,e,r){var o,s=+(r[1]+1),a=r[2]*s,h=l.indexOf(r[3].toLowerCase());if(h>9)e+=a*c[h-10];else{if(o=new Date(i(t,e)),h<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==h&&(a-=s);else 7==h?o.setUTCFullYear(o.getUTCFullYear()+a):8==h?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=n(t,o.getTime()))&&(e=n(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t,e){var i,n,r;return n=new Date(Date.UTC(t.getUTCFullYear(),0)),i=Math.floor((t.getTime()-n.getTime())/864e5),n.getUTCDay()==e?r=0:8==(r=7-n.getUTCDay()+e)&&(r=1),i>=r?Math.floor((i-r)/7)+1:0}function s(t){var e,i,n;return i=t.getUTCFullYear(),e=new Date(Date.UTC(i,0)).getUTCDay(),(n=o(t,1)+(e>1&&e<=4?1:0))?53!=n||4==e||3==e&&29==new Date(i,1,29).getDate()?[n,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(i=t.getUTCFullYear()-1,e=new Date(Date.UTC(i,0)).getUTCDay(),n=4==e||3==e&&29==new Date(i,1,29).getDate()?53:52,[n,t.getUTCFullYear()-1])}var a={clock:function(){return+new Date},zone:\"UTC\",entry:{abbrev:\"UTC\",offset:0,save:0},UTC:1,z:function(t,e,i,n){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],h=3600;for(r=0;r<3;r++)l.push((\"0\"+Math.floor(a/h)).slice(-2)),a%=h,h/=60;return\"^\"!=i||s?(\"^\"==i&&(n=3),3==n?(o=(o=l.join(\":\")).replace(/:00$/,\"\"),\"^\"!=i&&(o=o.replace(/:00$/,\"\"))):n?(o=l.slice(0,n+1).join(\":\"),\"^\"==i&&(o=o.replace(/:00$/,\"\"))):o=l.slice(0,2).join(\"\"),o=(s<0?\"-\":\"+\")+o,o=o.replace(/([-+])(0)/,{_:\" $1\",\"-\":\"$1\"}[i]||\"$1$2\")):\"Z\"},\"%\":function(t){return\"%\"},n:function(t){return\"\\n\"},t:function(t){return\"\\t\"},U:function(t){return o(t,0)},W:function(t){return o(t,1)},V:function(t){return s(t)[0]},G:function(t){return s(t)[1]},g:function(t){return s(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return t.getTime()%1e3*1e6},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(t){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,\"%H:%M\"])},T:function(t,e){return this.convert([e,\"%H:%M:%S\"])},D:function(t,e){return this.convert([e,\"%m/%d/%y\"])},F:function(t,e){return this.convert([e,\"%Y-%m-%d\"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||\"%I:%M:%S\"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:function(t){if(!t.length)return\"1.0.13\";var e,o,s,a,l,c=Object.create(this),u=[];for(e=0;e<t.length;e++)if(a=t[e],Array.isArray(a))e||isNaN(a[1])?a.splice.apply(t,[e--,1].concat(a)):l=a;else if(isNaN(a)){if(\"string\"==(s=typeof a))~a.indexOf(\"%\")?c.format=a:e||\"*\"!=a?!e&&(s=/^(\\d{4})-(\\d{2})-(\\d{2})(?:[T\\s](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?(Z|(([+-])(\\d{2}(:\\d{2}){0,2})))?)?$/.exec(a))?((l=[]).push.apply(l,s.slice(1,8)),s[9]?(l.push(s[10]+1),l.push.apply(l,s[11].split(/:/))):s[8]&&l.push(1)):/^\\w{2,3}_\\w{2}$/.test(a)?c.locale=a:(s=h.exec(a))?u.push(s):c.zone=a:l=a;else if(\"function\"==s){if(s=a.call(c))return s}else if(/^\\w{2,3}_\\w{2}$/.test(a.name))c[a.name]=a;else if(a.zones){for(s in a.zones)c[s]=a.zones[s];for(s in a.rules)c[s]=a.rules[s]}}else e||(l=a);c[c.locale]||delete c.locale;c[c.zone]||delete c.zone;if(null!=l){if(\"*\"==l)l=c.clock();else if(Array.isArray(l)){for(s=[],o=!l[7],e=0;e<11;e++)s[e]=+(l[e]||0);--s[1],l=Date.UTC.apply(Date.UTC,s)+-s[7]*(36e5*s[8]+6e4*s[9]+1e3*s[10])}else l=Math.floor(l);if(!isNaN(l)){if(o&&(l=n(c,l)),null==l)return l;for(e=0,o=u.length;e<o;e++)l=r(c,l,u[e]);return c.format?(s=new Date(i(c,l)),c.format.replace(/%([-0_^]?)(:{0,3})(\\d*)(.)/g,function(t,e,i,n,r){var o,a,h=\"0\";if(o=c[r]){for(t=String(o.call(c,s,l,e,i.length)),\"_\"==(e||o.style)&&(h=\" \"),a=\"-\"==e?0:o.pad||0;t.length<a;)t=h+t;for(a=\"-\"==e?0:n||o.pad;t.length<a;)t=h+t;\"N\"==r&&a<t.length&&(t=t.slice(0,a)),\"^\"==e&&(t=t.toUpperCase())}return t})):l}}return function(){return c.convert(arguments)}},locale:\"en_US\",en_US:{date:\"%m/%d/%Y\",time24:\"%I:%M:%S %p\",time12:\"%I:%M:%S %p\",dateTime:\"%a %d %b %Y %I:%M:%S %p %Z\",meridiem:[\"AM\",\"PM\"],month:{abbrev:\"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec\".split(\"|\"),full:\"January|February|March|April|May|June|July|August|September|October|November|December\".split(\"|\")},day:{abbrev:\"Sun|Mon|Tue|Wed|Thu|Fri|Sat\".split(\"|\"),full:\"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday\".split(\"|\")}}},l=\"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond\",h=new RegExp(\"^\\\\s*([+-])(\\\\d+)\\\\s+(\"+l+\")s?\\\\s*$\",\"i\"),c=[36e5,6e4,1e3,1];return l=l.toLowerCase().split(\"|\"),\"delmHMSUWVgCIky\".replace(/./g,function(t){a[t].pad=2}),a.N.pad=9,a.j.pad=3,a.k.style=\"_\",a.l.style=\"_\",a.e.style=\"_\",function(){return a.convert(arguments)}})},/*! *****************************************************************************\n",
" Copyright (c) Microsoft Corporation. All rights reserved.\n",
" Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n",
" this file except in compliance with the License. You may obtain a copy of the\n",
" License at http://www.apache.org/licenses/LICENSE-2.0\n",
"\n",
" THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n",
" KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n",
" WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n",
" MERCHANTABLITY OR NON-INFRINGEMENT.\n",
"\n",
" See the Apache Version 2.0 License for specific language governing permissions\n",
" and limitations under the License.\n",
" ***************************************************************************** */\n",
" function(t,e,i){var n,r,o,s,a,l,h,c,u,_,p,d,f,v,m,g,y;!function(t){function i(t,e){return t!==n&&(\"function\"==typeof Object.create?Object.defineProperty(t,\"__esModule\",{value:!0}):t.__esModule=!0),function(i,n){return t[i]=e?e(i,n):n}}var n=\"object\"==typeof global?global:\"object\"==typeof self?self:\"object\"==typeof this?this:{};\"object\"==typeof e&&\"object\"==typeof e.exports?t(i(n,i(e.exports))):t(i(n))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};n=function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)},r=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&(i[n[r]]=t[n[r]]);return i},s=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s},a=function(t,e){return function(i,n){e(i,n,t)}},l=function(t,e){if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}l((n=n.apply(t,e||[])).next())})},c=function(t,e){function i(i){return function(s){return function(i){if(n)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(n=1,r&&(o=r[2&i[0]?\"return\":i[0]?\"throw\":\"next\"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}var n,r,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},\"function\"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},u=function(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])},_=function(t){var e=\"function\"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},p=function(t,e){var i=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},d=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t},f=function(t){return this instanceof f?(this.v=t,this):new f(t)},v=function(t,e,i){function n(t){h[t]&&(l[t]=function(e){return new Promise(function(i,n){c.push([t,e,i,n])>1||r(t,e)})})}function r(t,e){try{!function(t){t.value instanceof f?Promise.resolve(t.value.v).then(o,s):a(c[0][2],t)}(h[t](e))}catch(t){a(c[0][3],t)}}function o(t){r(\"next\",t)}function s(t){r(\"throw\",t)}function a(t,e){t(e),c.shift(),c.length&&r(c[0][0],c[0][1])}if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var l,h=i.apply(t,e||[]),c=[];return l={},n(\"next\"),n(\"throw\"),n(\"return\"),l[Symbol.asyncIterator]=function(){return this},l},m=function(t){function e(e,r){t[e]&&(i[e]=function(i){return(n=!n)?{value:f(t[e](i)),done:\"return\"===e}:r?r(i):i})}var i,n;return i={},e(\"next\"),e(\"throw\",function(t){throw t}),e(\"return\"),i[Symbol.iterator]=function(){return this},i},g=function(t){if(!Symbol.asyncIterator)throw new TypeError(\"Symbol.asyncIterator is not defined.\");var e=t[Symbol.asyncIterator];return e?e.call(t):\"function\"==typeof _?_(t):t[Symbol.iterator]()},y=function(t,e){return Object.defineProperty?Object.defineProperty(t,\"raw\",{value:e}):t.raw=e,t},t(\"__extends\",n),t(\"__assign\",r),t(\"__rest\",o),t(\"__decorate\",s),t(\"__param\",a),t(\"__metadata\",l),t(\"__awaiter\",h),t(\"__generator\",c),t(\"__exportStar\",u),t(\"__values\",_),t(\"__read\",p),t(\"__spread\",d),t(\"__await\",f),t(\"__asyncGenerator\",v),t(\"__asyncDelegator\",m),t(\"__asyncValues\",g),t(\"__makeTemplateObject\",y)})}],{base:0,\"client/connection\":1,\"client/session\":2,\"core/bokeh_events\":3,\"core/build_views\":4,\"core/dom\":5,\"core/dom_view\":6,\"core/enums\":7,\"core/has_props\":8,\"core/hittest\":9,\"core/layout/alignments\":10,\"core/layout/layout_canvas\":11,\"core/layout/side_panel\":12,\"core/layout/solver\":13,\"core/logging\":14,\"core/properties\":15,\"core/property_mixins\":16,\"core/selection_manager\":17,\"core/settings\":18,\"core/signaling\":19,\"core/ui_events\":20,\"core/util/array\":21,\"core/util/arrayable\":22,\"core/util/assert\":23,\"core/util/bbox\":24,\"core/util/callback\":25,\"core/util/canvas\":26,\"core/util/color\":27,\"core/util/compat\":28,\"core/util/data_structures\":29,\"core/util/eq\":30,\"core/util/math\":31,\"core/util/object\":32,\"core/util/projections\":33,\"core/util/refs\":34,\"core/util/selection\":35,\"core/util/serialization\":36,\"core/util/spatial\":37,\"core/util/string\":38,\"core/util/svg_colors\":39,\"core/util/templating\":40,\"core/util/text\":41,\"core/util/throttle\":42,\"core/util/typed_array\":43,\"core/util/types\":44,\"core/util/wheel\":45,\"core/util/zoom\":46,\"core/vectorization\":47,\"core/view\":48,\"core/visuals\":49,document:50,embed:51,main:52,model:53,\"models/annotations/annotation\":54,\"models/annotations/arrow\":55,\"models/annotations/arrow_head\":56,\"models/annotations/band\":57,\"models/annotations/box_annotation\":58,\"models/annotations/color_bar\":59,\"models/annotations/index\":60,\"models/annotations/label\":61,\"models/annotations/label_set\":62,\"models/annotations/legend\":63,\"models/annotations/legend_item\":64,\"models/annotations/poly_annotation\":65,\"models/annotations/span\":66,\"models/annotations/text_annotation\":67,\"models/annotations/title\":68,\"models/annotations/toolbar_panel\":69,\"models/annotations/tooltip\":70,\"models/annotations/whisker\":71,\"models/axes/axis\":72,\"models/axes/categorical_axis\":73,\"models/axes/continuous_axis\":74,\"models/axes/datetime_axis\":75,\"models/axes/index\":76,\"models/axes/linear_axis\":77,\"models/axes/log_axis\":78,\"models/axes/mercator_axis\":79,\"models/callbacks/callback\":80,\"models/callbacks/customjs\":81,\"models/callbacks/index\":82,\"models/callbacks/open_url\":83,\"models/canvas/canvas\":84,\"models/canvas/cartesian_frame\":85,\"models/canvas/index\":86,\"models/expressions/expression\":87,\"models/expressions/index\":88,\"models/expressions/stack\":89,\"models/filters/boolean_filter\":90,\"models/filters/customjs_filter\":91,\"models/filters/filter\":92,\"models/filters/group_filter\":93,\"models/filters/index\":94,\"models/filters/index_filter\":95,\"models/formatters/basic_tick_formatter\":96,\"models/formatters/categorical_tick_formatter\":97,\"models/formatters/datetime_tick_formatter\":98,\"models/formatters/func_tick_formatter\":99,\"models/formatters/index\":100,\"models/formatters/log_tick_formatter\":101,\"models/formatters/mercator_tick_formatter\":102,\"models/formatters/numeral_tick_formatter\":103,\"models/formatters/printf_tick_formatter\":104,\"models/formatters/tick_formatter\":105,\"models/glyphs/annular_wedge\":106,\"models/glyphs/annulus\":107,\"models/glyphs/arc\":108,\"models/glyphs/bezier\":109,\"models/glyphs/box\":110,\"models/glyphs/circle\":111,\"models/glyphs/ellipse\":112,\"models/glyphs/glyph\":113,\"models/glyphs/hbar\":114,\"models/glyphs/hex_tile\":115,\"models/glyphs/image\":116,\"models/glyphs/image_rgba\":117,\"models/glyphs/image_url\":118,\"models/glyphs/index\":119,\"models/glyphs/line\":120,\"models/glyphs/multi_line\":121,\"models/glyphs/oval\":122,\"models/glyphs/patch\":123,\"models/glyphs/patches\":124,\"models/glyphs/quad\":125,\"models/glyphs/quadratic\":126,\"models/glyphs/ray\":127,\"models/glyphs/rect\":128,\"models/glyphs/segment\":129,\"models/glyphs/step\":130,\"models/glyphs/text\":131,\"models/glyphs/utils\":132,\"models/glyphs/vbar\":133,\"models/glyphs/wedge\":134,\"models/glyphs/xy_glyph\":135,\"models/graphs/graph_hit_test_policy\":136,\"models/graphs/index\":137,\"models/graphs/layout_provider\":138,\"models/graphs/static_layout_provider\":139,\"models/grids/grid\":140,\"models/grids/index\":141,\"models/index\":142,\"models/layouts/box\":143,\"models/layouts/column\":144,\"models/layouts/index\":145,\"models/layouts/layout_dom\":146,\"models/layouts/row\":147,\"models/layouts/spacer\":148,\"models/layouts/widget_box\":149,\"models/mappers/categorical_color_mapper\":150,\"models/mappers/color_mapper\":151,\"models/mappers/continuous_color_mapper\":152,\"models/mappers/index\":153,\"models/mappers/linear_color_mapper\":154,\"models/mappers/log_color_mapper\":155,\"models/markers/index\":156,\"models/markers/marker\":157,\"models/plots/gmap_plot\":158,\"models/plots/gmap_plot_canvas\":159,\"models/plots/index\":160,\"models/plots/plot\":161,\"models/plots/plot_canvas\":162,\"models/ranges/data_range\":163,\"models/ranges/data_range1d\":164,\"models/ranges/factor_range\":165,\"models/ranges/index\":166,\"models/ranges/range\":167,\"models/ranges/range1d\":168,\"models/renderers/glyph_renderer\":169,\"models/renderers/graph_renderer\":170,\"models/renderers/guide_renderer\":171,\"models/renderers/index\":172,\"models/renderers/renderer\":173,\"models/scales/categorical_scale\":174,\"models/scales/index\":175,\"models/scales/linear_scale\":176,\"models/scales/log_scale\":177,\"models/scales/scale\":178,\"models/selections/index\":179,\"models/selections/interaction_policy\":180,\"models/selections/selection\":181,\"models/sources/ajax_data_source\":182,\"models/sources/cds_view\":183,\"models/sources/column_data_source\":184,\"models/sources/columnar_data_source\":185,\"models/sources/data_source\":186,\"models/sources/geojson_data_source\":187,\"models/sources/index\":188,\"models/sources/remote_data_source\":189,\"models/tickers/adaptive_ticker\":190,\"models/tickers/basic_ticker\":191,\"models/tickers/categorical_ticker\":192,\"models/tickers/composite_ticker\":193,\"models/tickers/continuous_ticker\":194,\"models/tickers/datetime_ticker\":195,\"models/tickers/days_ticker\":196,\"models/tickers/fixed_ticker\":197,\"models/tickers/index\":198,\"models/tickers/log_ticker\":199,\"models/tickers/mercator_ticker\":200,\"models/tickers/months_ticker\":201,\"models/tickers/single_interval_ticker\":202,\"models/tickers/ticker\":203,\"models/tickers/util\":204,\"models/tickers/years_ticker\":205,\"models/tiles/bbox_tile_source\":206,\"models/tiles/image_pool\":207,\"models/tiles/index\":208,\"models/tiles/mercator_tile_source\":209,\"models/tiles/quadkey_tile_source\":210,\"models/tiles/tile_renderer\":211,\"models/tiles/tile_source\":212,\"models/tiles/tile_utils\":213,\"models/tiles/tms_tile_source\":214,\"models/tiles/wmts_tile_source\":215,\"models/tools/actions/action_tool\":216,\"models/tools/actions/help_tool\":217,\"models/tools/actions/redo_tool\":218,\"models/tools/actions/reset_tool\":219,\"models/tools/actions/save_tool\":220,\"models/tools/actions/undo_tool\":221,\"models/tools/actions/zoom_in_tool\":222,\"models/tools/actions/zoom_out_tool\":223,\"models/tools/button_tool\":224,\"models/tools/edit/box_edit_tool\":225,\"models/tools/edit/edit_tool\":226,\"models/tools/edit/point_draw_tool\":227,\"models/tools/edit/poly_draw_tool\":228,\"models/tools/edit/poly_edit_tool\":229,\"models/tools/gestures/box_select_tool\":230,\"models/tools/gestures/box_zoom_tool\":231,\"models/tools/gestures/gesture_tool\":232,\"models/tools/gestures/lasso_select_tool\":233,\"models/tools/gestures/pan_tool\":234,\"models/tools/gestures/poly_select_tool\":235,\"models/tools/gestures/select_tool\":236,\"models/tools/gestures/tap_tool\":237,\"models/tools/gestures/wheel_pan_tool\":238,\"models/tools/gestures/wheel_zoom_tool\":239,\"models/tools/index\":240,\"models/tools/inspectors/crosshair_tool\":241,\"models/tools/inspectors/hover_tool\":242,\"models/tools/inspectors/inspect_tool\":243,\"models/tools/on_off_button\":244,\"models/tools/tool\":245,\"models/tools/tool_proxy\":246,\"models/tools/toolbar\":247,\"models/tools/toolbar_base\":248,\"models/tools/toolbar_box\":249,\"models/transforms/customjs_transform\":250,\"models/transforms/dodge\":251,\"models/transforms/index\":252,\"models/transforms/interpolator\":253,\"models/transforms/jitter\":254,\"models/transforms/linear_interpolator\":255,\"models/transforms/step_interpolator\":256,\"models/transforms/transform\":257,polyfill:258,\"protocol/index\":259,\"protocol/message\":260,\"protocol/receiver\":261,safely:262,version:263})}(this);/*!\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,403);throw new Error(\"Cannot find Bokeh. You have to load it prior to loading plugins.\")})({388:function(t,e,n){var i=t(379),r=t(15),o=t(5),s=t(4),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.icon_views={},this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.remove=function(){s.remove_views(this.icon_views),t.prototype.remove.call(this)},e.prototype._render_button=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.button.apply(void 0,[{type:\"button\",disabled:this.model.disabled,class:[\"bk-bs-btn\",\"bk-bs-btn-\"+this.model.button_type]}].concat(t))},e.prototype.render=function(){var e=this;t.prototype.render.call(this),o.empty(this.el),this.buttonEl=this._render_button(this.model.label),this.buttonEl.addEventListener(\"click\",function(t){return e._button_click(t)}),this.el.appendChild(this.buttonEl);var n=this.model.icon;null!=n&&(s.build_views(this.icon_views,[n],{parent:this}),o.prepend(this.buttonEl,this.icon_views[n.id].el,o.nbsp))},e.prototype._button_click=function(t){t.preventDefault(),this.change_input()},e.prototype.change_input=function(){null!=this.model.callback&&this.model.callback.execute(this.model)},e}(a.WidgetView);n.AbstractButtonView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"AbstractButton\",this.define({label:[r.String,\"Button\"],icon:[r.Instance],button_type:[r.String,\"default\"],callback:[r.Instance]})},e}(a.Widget);n.AbstractButton=u,u.initClass()},389:function(t,e,n){var i=t(379),r=t(428),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.WidgetView);n.AbstractIconView=o;var s=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"AbstractIcon\"},e}(r.Widget);n.AbstractIcon=s,s.initClass()},390:function(t,e,n){var i=t(379),r=t(419),o=t(15),s=t(5),a=t(14),l=t(21),u=t(25),c=t(428),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){var e=this;if(null==this.sliderEl&&t.prototype.render.call(this),null!=this.model.callback){var n=function(){return e.model.callback.execute(e.model)};switch(this.model.callback_policy){case\"continuous\":this.callback_wrapper=n;break;case\"throttle\":this.callback_wrapper=u.throttle(n,this.model.callback_throttle)}}var i,o=\"bk-noUi-\",c=this._calc_to(),d=c.start,h=c.end,p=c.value,f=c.step;if(this.model.tooltips){var m={to:function(t){return e.model.pretty(t)}};i=l.repeat(m,p.length)}else i=!1;if(this.el.classList.add(\"bk-slider\"),null==this.sliderEl){this.sliderEl=s.div(),this.el.appendChild(this.sliderEl),r.create(this.sliderEl,{cssPrefix:o,range:{min:d,max:h},start:p,step:f,behaviour:this.model.behaviour,connect:this.model.connected,tooltips:i,orientation:this.model.orientation,direction:this.model.direction}),this.sliderEl.noUiSlider.on(\"slide\",function(t,n,i){return e._slide(i)}),this.sliderEl.noUiSlider.on(\"change\",function(t,n,i){return e._change(i)});var v=function(t){var n=Number(e.sliderEl.noUiSlider.get());switch(t.which){case 37:n=Math.max(n-f,d);break;case 39:n=Math.min(n+f,h);break;default:return}var i=e.model.pretty(n);a.logger.debug(\"[slider keypress] value = \"+i),e.model.value=n,e.sliderEl.noUiSlider.set(n),null!=e.valueEl&&(e.valueEl.textContent=i),null!=e.callback_wrapper&&e.callback_wrapper()},g=this.sliderEl.querySelector(\".bk-noUi-handle\");g.setAttribute(\"tabindex\",\"0\"),g.addEventListener(\"keydown\",v);var y=function(t,n){var i=e.sliderEl.querySelectorAll(\".bk-noUi-handle\")[t],r=i.querySelector(\".bk-noUi-tooltip\");r.style.display=n?\"block\":\"\"};this.sliderEl.noUiSlider.on(\"start\",function(t,e){return y(e,!0)}),this.sliderEl.noUiSlider.on(\"end\",function(t,e){return y(e,!1)})}else this.sliderEl.noUiSlider.updateOptions({range:{min:d,max:h},start:p,step:f});if(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)){var b=p.map(function(t){return e.model.pretty(t)}).join(\" .. \");this.valueEl=s.div({class:\"bk-slider-value\"},b),this.el.insertBefore(this.valueEl,this.sliderEl)}this.model.disabled||(this.sliderEl.querySelector(\".bk-noUi-connect\").style.backgroundColor=this.model.bar_color),this.model.disabled?this.sliderEl.setAttribute(\"disabled\",\"true\"):this.sliderEl.removeAttribute(\"disabled\")},e.prototype._slide=function(t){var e=this,n=this._calc_from(t),i=t.map(function(t){return e.model.pretty(t)}).join(\" .. \");a.logger.debug(\"[slider slide] value = \"+i),null!=this.valueEl&&(this.valueEl.textContent=i),this.model.value=n,null!=this.callback_wrapper&&this.callback_wrapper()},e.prototype._change=function(t){var e=this,n=this._calc_from(t),i=t.map(function(t){return e.model.pretty(t)}).join(\" .. \");switch(a.logger.debug(\"[slider change] value = \"+i),null!=this.valueEl&&(this.valueEl.dataset.value=i),this.model.value=n,this.model.callback_policy){case\"mouseup\":case\"throttle\":null!=this.model.callback&&this.model.callback.execute(this.model)}},e}(c.WidgetView);n.AbstractSliderView=d;var h=function(t){function e(e){var n=t.call(this,e)||this;return n.connected=!1,n}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"AbstractSlider\",this.define({title:[o.String,\"\"],show_value:[o.Bool,!0],start:[o.Any],end:[o.Any],value:[o.Any],step:[o.Number,1],format:[o.String],orientation:[o.Orientation,\"horizontal\"],direction:[o.Any,\"ltr\"],tooltips:[o.Boolean,!0],callback:[o.Instance],callback_throttle:[o.Number,200],callback_policy:[o.String,\"throttle\"],bar_color:[o.Color,\"#e6e6e6\"]})},e.prototype._formatter=function(t,e){return\"\"+t},e.prototype.pretty=function(t){return this._formatter(t,this.format)},e}(c.Widget);n.AbstractSlider=h,h.initClass()},391:function(t,e,n){var i=t(379),r=t(416),o=t(395),s=t(5),a=t(15),l=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;t.prototype.connect_signals.call(this),o.clear_menus.connect(function(){return e._clear_menu()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),this.inputEl.classList.add(\"bk-autocomplete-input\"),this.inputEl.addEventListener(\"keydown\",function(t){return e._keydown(t)}),this.inputEl.addEventListener(\"keyup\",function(t){return e._keyup(t)}),this.menuEl=s.ul({class:\"bk-bs-dropdown-menu\"}),this.menuEl.addEventListener(\"click\",function(t){return e._item_click(t)}),this.el.appendChild(this.menuEl)},e.prototype._render_items=function(t){s.empty(this.menuEl);for(var e=0,n=t;e<n.length;e++){var i=n[e],r=s.li({},s.a({data:{text:i}},i));this.menuEl.appendChild(r)}},e.prototype._open_menu=function(){this.el.classList.add(\"bk-bs-open\")},e.prototype._clear_menu=function(){this.el.classList.remove(\"bk-bs-open\")},e.prototype._item_click=function(t){if(t.preventDefault(),t.target!=t.currentTarget){var e=t.target,n=e.dataset.text;this.model.value=n}},e.prototype._keydown=function(t){},e.prototype._keyup=function(t){switch(t.keyCode){case s.Keys.Enter:console.log(\"enter\");break;case s.Keys.Esc:this._clear_menu();break;case s.Keys.Up:case s.Keys.Down:console.log(\"up/down\");break;default:var e=this.inputEl.value;if(e.length<=1)return void this._clear_menu();for(var n=[],i=0,r=this.model.completions;i<r.length;i++){var o=r[i];-1!=o.indexOf(e)&&n.push(o)}0==n.length?this._clear_menu():(this._render_items(n),this._open_menu())}},e}(r.TextInputView);n.AutocompleteInputView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"AutocompleteInput\",this.prototype.default_view=l,this.define({completions:[a.Array,[]]}),this.internal({active:[a.Boolean,!0]})},e}(r.TextInput);n.AutocompleteInput=u,u.initClass()},392:function(t,e,n){var i=t(379),r=t(15),o=t(3),s=t(388),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){this.model.trigger_event(new o.ButtonClick({})),this.model.clicks=this.model.clicks+1,t.prototype.change_input.call(this)},e}(s.AbstractButtonView);n.ButtonView=a;var l=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Button\",this.prototype.default_view=a,this.define({clicks:[r.Number,0]}),o.register_with_event(o.ButtonClick,this)},e}(s.AbstractButton);n.Button=l,l.initClass()},393:function(t,e,n){var i=t(379),r=t(5),o=t(15),s=t(21),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);var n=r.div({class:\"bk-bs-btn-group\"});this.el.appendChild(n);for(var i=this.model.active,o=this.model.labels,a=function(t){var a=r.input({type:\"checkbox\",value:\"\"+t,checked:t in i});a.addEventListener(\"change\",function(){return e.model.change_input(t)});var u=r.label({class:[\"bk-bs-btn\",\"bk-bs-btn-\"+l.model.button_type]},a,o[t]);s.includes(i,t)&&u.classList.add(\"bk-bs-active\"),n.appendChild(u)},l=this,u=0;u<o.length;u++)a(u)},e}(a.WidgetView);n.CheckboxButtonGroupView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.prototype.change_input=function(t){var e=s.copy(this.active);s.includes(e,t)?s.removeBy(e,function(e){return t==e}):e.push(t),e.sort(),this.active=e,null!=this.callback&&this.callback.execute(this)},e.initClass=function(){this.prototype.type=\"CheckboxButtonGroup\",this.prototype.default_view=l,this.define({active:[o.Array,[]],labels:[o.Array,[]],button_type:[o.String,\"default\"],callback:[o.Instance]})},e}(a.Widget);n.CheckboxButtonGroup=u,u.initClass()},394:function(t,e,n){var i=t(379),r=t(5),o=t(15),s=t(21),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);for(var n=this.model.active,i=this.model.labels,o=0;o<i.length;o++){var a=i[o],l=r.input({type:\"checkbox\",value:\"\"+o});l.addEventListener(\"change\",function(){return e.change_input()}),this.model.disabled&&(l.disabled=!0),s.includes(n,o)&&(l.checked=!0);var u=r.label({},l,a);if(this.model.inline)u.classList.add(\"bk-bs-checkbox-inline\"),this.el.appendChild(u);else{var c=r.div({class:\"bk-bs-checkbox\"},u);this.el.appendChild(c)}}},e.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e,null!=this.model.callback&&this.model.callback.execute(this.model)},e}(a.WidgetView);n.CheckboxGroupView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"CheckboxGroup\",this.prototype.default_view=l,this.define({active:[o.Array,[]],labels:[o.Array,[]],inline:[o.Bool,!1],callback:[o.Instance]})},e}(a.Widget);n.CheckboxGroup=u,u.initClass()},395:function(t,e,n){var i=t(19);n.clear_menus=new i.Signal0({},\"clear_menus\"),document.addEventListener(\"click\",function(){return n.clear_menus.emit()})},396:function(t,e,n){var i=t(379),r=t(402),o=t(5),s=t(15),a=t(420);a.prototype.adjustPosition=function(){if(!this._o.container){this.el.style.position=\"absolute\";var t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,o=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,s=t.getBoundingClientRect(),a=s.left+window.pageXOffset,l=s.bottom+window.pageYOffset;a-=this.el.parentElement.offsetLeft,l-=this.el.parentElement.offsetTop,(this._o.reposition&&a+e>i||this._o.position.indexOf(\"right\")>-1&&a-e+t.offsetWidth>0)&&(a=a-e+t.offsetWidth),(this._o.reposition&&l+n>r+o||this._o.position.indexOf(\"top\")>-1&&l-n-t.offsetHeight>0)&&(l=l-n-t.offsetHeight),this.el.style.left=a+\"px\",this.el.style.top=l+\"px\"}};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget-form-group\")},e.prototype.render=function(){var e=this;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):void 0,maxDate:null!=this.model.max_date?new Date(this.model.max_date):void 0,onSelect:function(t){return e._on_select(t)}}),this._root_element.appendChild(this._picker.el)},e.prototype._on_select=function(t){this.model.value=t.toDateString(),this.change_input()},e}(r.InputWidgetView);n.DatePickerView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"DatePicker\",this.prototype.default_view=l,this.define({value:[s.Any,(new Date).toDateString()],min_date:[s.Any],max_date:[s.Any]})},e}(r.InputWidget);n.DatePicker=u,u.initClass()},397:function(t,e,n){var i=t(379),r=t(378),o=t(390),s=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);n.DateRangeSliderView=s;var a=function(t){function e(e){var n=t.call(this,e)||this;return n.behaviour=\"drag\",n.connected=[!1,!0,!1],n}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"DateRangeSlider\",this.prototype.default_view=s,this.override({format:\"%d %b %Y\"})},e.prototype._formatter=function(t,e){return r(t,e)},e}(o.AbstractSlider);n.DateRangeSlider=a,a.initClass()},398:function(t,e,n){var i=t(379),r=t(378),o=t(390),s=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);n.DateSliderView=s;var a=function(t){function e(e){var n=t.call(this,e)||this;return n.behaviour=\"tap\",n.connected=[!0,!1],n}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"DateSlider\",this.prototype.default_view=s,this.override({format:\"%d %b %Y\"})},e.prototype._formatter=function(t,e){return r(t,e)},e}(o.AbstractSlider);n.DateSlider=a,a.initClass()},399:function(t,e,n){var i=t(379),r=t(404),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.render=function(){t.prototype.render.call(this);var e=o.div();this.model.render_as_text?e.textContent=this.model.text:e.innerHTML=this.model.text,this.markupEl.appendChild(e)},e}(r.MarkupView);n.DivView=a;var l=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Div\",this.prototype.default_view=a,this.define({render_as_text:[s.Bool,!1]})},e}(r.Markup);n.Div=l,l.initClass()},400:function(t,e,n){var i=t(379),r=t(5),o=t(15),s=t(388),a=t(395),l=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;t.prototype.connect_signals.call(this),a.clear_menus.connect(function(){return e._clear_menu()})},e.prototype.render=function(){var e=this;if(t.prototype.render.call(this),this.model.is_split_button){this.el.classList.add(\"bk-bs-btn-group\");var n=this._render_button(r.span({class:\"bk-bs-caret\"}));n.classList.add(\"bk-bs-dropdown-toggle\"),n.addEventListener(\"click\",function(t){return e._caret_click(t)}),this.el.appendChild(n)}else 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\");for(var i=[],o=0,s=this.model.menu;o<s.length;o++){var a=s[o],l=void 0;if(null!=a){var u=a[0],c=a[1],d=r.a({},u);d.dataset.value=c,d.addEventListener(\"click\",function(t){return e._item_click(t)}),l=r.li({},d)}else l=r.li({class:\"bk-bs-divider\"});i.push(l)}var h=r.ul({class:\"bk-bs-dropdown-menu\"},i);this.el.appendChild(h)},e.prototype._clear_menu=function(){this.model.active=!1},e.prototype._toggle_menu=function(){var t=this.model.active;a.clear_menus.emit(),t||(this.model.active=!0)},e.prototype._button_click=function(t){t.preventDefault(),t.stopPropagation(),this.model.is_split_button?(this._clear_menu(),this.set_value(this.model.default_value)):this._toggle_menu()},e.prototype._caret_click=function(t){t.preventDefault(),t.stopPropagation(),this._toggle_menu()},e.prototype._item_click=function(t){t.preventDefault(),this._clear_menu(),this.set_value(t.currentTarget.dataset.value)},e.prototype.set_value=function(t){this.buttonEl.value=this.model.value=t,this.change_input()},e}(s.AbstractButtonView);n.DropdownView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Dropdown\",this.prototype.default_view=l,this.define({value:[o.String],default_value:[o.String],menu:[o.Array,[]]}),this.override({label:\"Dropdown\"}),this.internal({active:[o.Boolean,!1]})},Object.defineProperty(e.prototype,\"is_split_button\",{get:function(){return null!=this.default_value},enumerable:!0,configurable:!0}),e}(s.AbstractButton);n.Dropdown=u,u.initClass()},401:function(t,e,n){var i=t(388);n.AbstractButton=i.AbstractButton;var r=t(389);n.AbstractIcon=r.AbstractIcon;var o=t(391);n.AutocompleteInput=o.AutocompleteInput;var s=t(392);n.Button=s.Button;var a=t(393);n.CheckboxButtonGroup=a.CheckboxButtonGroup;var l=t(394);n.CheckboxGroup=l.CheckboxGroup;var u=t(396);n.DatePicker=u.DatePicker;var c=t(397);n.DateRangeSlider=c.DateRangeSlider;var d=t(398);n.DateSlider=d.DateSlider;var h=t(399);n.Div=h.Div;var p=t(400);n.Dropdown=p.Dropdown;var f=t(402);n.InputWidget=f.InputWidget;var m=t(404);n.Markup=m.Markup;var v=t(405);n.MultiSelect=v.MultiSelect;var g=t(406);n.Panel=g.Panel;var y=t(407);n.Paragraph=y.Paragraph;var b=t(408);n.PasswordInput=b.PasswordInput;var _=t(409);n.PreText=_.PreText;var w=t(410);n.RadioButtonGroup=w.RadioButtonGroup;var x=t(411);n.RadioGroup=x.RadioGroup;var k=t(412);n.RangeSlider=k.RangeSlider;var S=t(413);n.Select=S.Select;var C=t(414);n.Slider=C.Slider;var E=t(415);n.Tabs=E.Tabs;var D=t(416);n.TextInput=D.TextInput;var M=t(417);n.Toggle=M.Toggle;var A=t(428);n.Widget=A.Widget},402:function(t,e,n){var i=t(379),r=t(428),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.change_input=function(){null!=this.model.callback&&this.model.callback.execute(this.model)},e}(r.WidgetView);n.InputWidgetView=s;var a=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"InputWidget\",this.prototype.default_view=s,this.define({title:[o.String,\"\"],callback:[o.Instance]})},e}(r.Widget);n.InputWidget=a,a.initClass()},403:function(t,e,n){var i=t(401);n.Widgets=i;var r=t(0);r.register_models(i)},404:function(t,e,n){var i=t(379),r=t(15),o=t(5),s=t(32),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){t.prototype.render.call(this),o.empty(this.el);var e=s.extend({width:this.model.width+\"px\",height:this.model.height+\"px\"},this.model.style);this.markupEl=o.div({style:e}),this.el.appendChild(this.markupEl)},e}(a.WidgetView);n.MarkupView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Markup\",this.define({text:[r.String,\"\"],style:[r.Any,{}]})},e}(a.Widget);n.Markup=u,u.initClass()},405:function(t,e,n){var i=t(379),r=t(5),o=t(44),s=t(15),a=t(402),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.properties.value.change,function(){return e.render_selection()}),this.connect(this.model.properties.options.change,function(){return e.render()}),this.connect(this.model.properties.name.change,function(){return e.render()}),this.connect(this.model.properties.title.change,function(){return e.render()}),this.connect(this.model.properties.size.change,function(){return e.render()}),this.connect(this.model.properties.disabled.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);var n=r.label({for:this.model.id},this.model.title);this.el.appendChild(n);var i=this.model.options.map(function(t){var n,i;o.isString(t)?n=i=t:(n=t[0],i=t[1]);var s=n in e.model.value;return r.option({selected:s,value:n},i)});this.selectEl=r.select({multiple:!0,class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,size:this.model.size,disabled:this.model.disabled},i),this.selectEl.addEventListener(\"change\",function(){return e.change_input()}),this.el.appendChild(this.selectEl),this.render_selection()},e.prototype.render_selection=function(){for(var t={},e=0,n=this.model.value;e<n.length;e++){var i=n[e];t[i]=!0}for(var r=0,o=Array.from(this.el.querySelectorAll(\"option\"));r<o.length;r++){var s=o[r];t[s.value]&&(s.selected=!0)}this.selectEl.size=this.model.size},e.prototype.change_input=function(){for(var e=null!=this.el.querySelector(\"select:focus\"),n=[],i=0,r=Array.from(this.el.querySelectorAll(\"option\"));i<r.length;i++){var o=r[i];o.selected&&n.push(o.value)}this.model.value=n,t.prototype.change_input.call(this),e&&this.selectEl.focus()},e}(a.InputWidgetView);n.MultiSelectView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"MultiSelect\",this.prototype.default_view=l,this.define({value:[s.Array,[]],options:[s.Array,[]],size:[s.Number,4]})},e}(a.InputWidget);n.MultiSelect=u,u.initClass()},406:function(t,e,n){var i=t(379),r=t(428),o=t(15),s=t(5),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),s.empty(this.el)},e}(r.WidgetView);n.PanelView=a;var l=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Panel\",this.prototype.default_view=a,this.define({title:[o.String,\"\"],child:[o.Instance],closable:[o.Bool,!1]})},e}(r.Widget);n.Panel=l,l.initClass()},407:function(t,e,n){var i=t(379),r=t(404),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this);var e=o.p({style:{margin:0}},this.model.text);this.markupEl.appendChild(e)},e}(r.MarkupView);n.ParagraphView=s;var a=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Paragraph\",this.prototype.default_view=s},e}(r.Markup);n.Paragraph=a,a.initClass()},408:function(t,e,n){var i=t(379),r=t(416),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.inputEl.type=\"password\"},e}(r.TextInputView);n.PasswordInputView=o;var s=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"PasswordInput\",this.prototype.default_view=o},e}(r.TextInput);n.PasswordInput=s,s.initClass()},409:function(t,e,n){var i=t(379),r=t(404),o=t(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this);var e=o.pre({style:{overflow:\"auto\"}},this.model.text);this.markupEl.appendChild(e)},e}(r.MarkupView);n.PreTextView=s;var a=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"PreText\",this.prototype.default_view=s},e}(r.Markup);n.PreText=a,a.initClass()},410:function(t,e,n){var i=t(379),r=t(5),o=t(38),s=t(15),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);var n=r.div({class:\"bk-bs-btn-group\"});this.el.appendChild(n);for(var i=o.uniqueId(),s=this.model.active,a=this.model.labels,l=0;l<a.length;l++){var u=a[l],c=r.input({type:\"radio\",name:i,value:\"\"+l,checked:l==s});c.addEventListener(\"change\",function(){return e.change_input()});var d=r.label({class:[\"bk-bs-btn\",\"bk-bs-btn-\"+this.model.button_type]},c,u);l==s&&d.classList.add(\"bk-bs-active\"),n.appendChild(d)}},e.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e[0],null!=this.model.callback&&this.model.callback.execute(this.model)},e}(a.WidgetView);n.RadioButtonGroupView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"RadioButtonGroup\",this.prototype.default_view=l,this.define({active:[s.Any,null],labels:[s.Array,[]],button_type:[s.String,\"default\"],callback:[s.Instance]})},e}(a.Widget);n.RadioButtonGroup=u,u.initClass()},411:function(t,e,n){var i=t(379),r=t(5),o=t(38),s=t(15),a=t(428),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);for(var n=o.uniqueId(),i=this.model.active,s=this.model.labels,a=0;a<s.length;a++){var l=s[a],u=r.input({type:\"radio\",name:n,value:\"\"+a});u.addEventListener(\"change\",function(){return e.change_input()}),this.model.disabled&&(u.disabled=!0),a==i&&(u.checked=!0);var c=r.label({},u,l);if(this.model.inline)c.classList.add(\"bk-bs-radio-inline\"),this.el.appendChild(c);else{var d=r.div({class:\"bk-bs-radio\"},c);this.el.appendChild(d)}}},e.prototype.change_input=function(){for(var t=this.el.querySelectorAll(\"input\"),e=[],n=0;n<t.length;n++){var i=t[n];i.checked&&e.push(n)}this.model.active=e[0],null!=this.model.callback&&this.model.callback.execute(this.model)},e}(a.WidgetView);n.RadioGroupView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"RadioGroup\",this.prototype.default_view=l,this.define({active:[s.Any,null],labels:[s.Array,[]],inline:[s.Bool,!1],callback:[s.Instance]})},e}(a.Widget);n.RadioGroup=u,u.initClass()},412:function(t,e,n){var i=t(379),r=t(347),o=t(390),s=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);n.RangeSliderView=s;var a=function(t){function e(e){var n=t.call(this,e)||this;return n.behaviour=\"drag\",n.connected=[!1,!0,!1],n}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"RangeSlider\",this.prototype.default_view=s,this.override({format:\"0[.]00\"})},e.prototype._formatter=function(t,e){return r.format(t,e)},e}(o.AbstractSlider);n.RangeSlider=a,a.initClass()},413:function(t,e,n){var i=t(379),r=t(5),o=t(44),s=t(14),a=t(15),l=t(402),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.build_options=function(t){var e=this;return t.map(function(t){var n,i;o.isString(t)?n=i=t:(n=t[0],i=t[1]);var s=e.model.value==n;return r.option({selected:s,value:n},i)})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);var n=r.label({for:this.model.id},this.model.title);this.el.appendChild(n);var i;if(o.isArray(this.model.options))i=this.build_options(this.model.options);else{i=[];var s=this.model.options;for(var a in s){var l=s[a];i.push(r.optgroup({label:a},this.build_options(l)))}}this.selectEl=r.select({class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,disabled:this.model.disabled},i),this.selectEl.addEventListener(\"change\",function(){return e.change_input()}),this.el.appendChild(this.selectEl)},e.prototype.change_input=function(){var e=this.selectEl.value;s.logger.debug(\"selectbox: value = \"+e),this.model.value=e,t.prototype.change_input.call(this)},e}(l.InputWidgetView);n.SelectView=u;var c=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Select\",this.prototype.default_view=u,this.define({value:[a.String,\"\"],options:[a.Any,[]]})},e}(l.InputWidget);n.Select=c,c.initClass()},414:function(t,e,n){var i=t(379),r=t(347),o=t(390),s=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 Number.isInteger(this.model.start)&&Number.isInteger(this.model.end)&&Number.isInteger(this.model.step)?Math.round(e):e},e}(o.AbstractSliderView);n.SliderView=s;var a=function(t){function e(e){var n=t.call(this,e)||this;return n.behaviour=\"tap\",n.connected=[!0,!1],n}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Slider\",this.prototype.default_view=s,this.override({format:\"0[.]00\"})},e.prototype._formatter=function(t,e){return r.format(t,e)},e}(o.AbstractSlider);n.Slider=a,a.initClass()},415:function(t,e,n){var i=t(379),r=t(5),o=t(21),s=t(15),a=t(428),l=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;t.prototype.connect_signals.call(this),this.connect(this.model.properties.tabs.change,function(){return e.rebuild_child_views()}),this.connect(this.model.properties.active.change,function(){return e.render()})},e.prototype.render=function(){var e=this;t.prototype.render.call(this),r.empty(this.el);var n=this.model.tabs.length;if(0!=n){this.model.active>=n&&(this.model.active=n-1);var i=this.model.tabs.map(function(t,e){return r.li({},r.span({data:{index:e}},t.title))});i[this.model.active].classList.add(\"bk-bs-active\");var s=r.ul({class:[\"bk-bs-nav\",\"bk-bs-nav-tabs\"]},i);this.el.appendChild(s);var a=this.model.tabs.map(function(t){return r.div({class:\"bk-bs-tab-pane\"})});a[this.model.active].classList.add(\"bk-bs-active\");var l=r.div({class:\"bk-bs-tab-content\"},a);this.el.appendChild(l),s.addEventListener(\"click\",function(t){if(t.preventDefault(),t.target!=t.currentTarget){var n=t.target,r=e.model.active,o=parseInt(n.dataset.index);r!=o&&(i[r].classList.remove(\"bk-bs-active\"),a[r].classList.remove(\"bk-bs-active\"),i[o].classList.add(\"bk-bs-active\"),a[o].classList.add(\"bk-bs-active\"),e.model.active=o,null!=e.model.callback&&e.model.callback.execute(e.model))}});for(var u=0,c=o.zip(this.model.children,a);u<c.length;u++){var d=c[u],h=d[0],p=d[1];p.appendChild(this.child_views[h.id].el)}}},e}(a.WidgetView);n.TabsView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Tabs\",this.prototype.default_view=l,this.define({tabs:[s.Array,[]],active:[s.Number,0],callback:[s.Instance]})},e.prototype.get_layoutable_children=function(){return this.children},Object.defineProperty(e.prototype,\"children\",{get:function(){return this.tabs.map(function(t){return t.child})},enumerable:!0,configurable:!0}),e}(a.Widget);n.Tabs=u,u.initClass()},416:function(t,e,n){var i=t(379),r=t(14),o=t(15),s=t(5),a=t(402),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.render()},e.prototype.connect_signals=function(){var e=this;t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.render()})},e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget-form-group\")},e.prototype.render=function(){var e=this;t.prototype.render.call(this),s.empty(this.el);var n=s.label({for:this.model.id},this.model.title);this.el.appendChild(n),this.inputEl=s.input({type:\"text\",class:\"bk-widget-form-input\",id:this.model.id,name:this.model.name,value:this.model.value,disabled:this.model.disabled,placeholder:this.model.placeholder}),this.inputEl.addEventListener(\"change\",function(){return e.change_input()}),this.el.appendChild(this.inputEl),this.model.height&&(this.inputEl.style.height=this.model.height-35+\"px\")},e.prototype.change_input=function(){var e=this.inputEl.value;r.logger.debug(\"widget/text_input: value = \"+e),this.model.value=e,t.prototype.change_input.call(this)},e}(a.InputWidgetView);n.TextInputView=l;var u=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"TextInput\",this.prototype.default_view=l,this.define({value:[o.String,\"\"],placeholder:[o.String,\"\"]})},e}(a.InputWidget);n.TextInput=u,u.initClass()},417:function(t,e,n){var i=t(379),r=t(388),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.model.active&&this.buttonEl.classList.add(\"bk-bs-active\")},e.prototype.change_input=function(){this.model.active=!this.model.active,t.prototype.change_input.call(this)},e}(r.AbstractButtonView);n.ToggleView=s;var a=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Toggle\",this.prototype.default_view=s,this.define({active:[o.Bool,!1]}),this.override({label:\"Toggle\"})},e}(r.AbstractButton);n.Toggle=a,a.initClass()},428:function(t,e,n){var i=t(379),r=t(146),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.css_classes=function(){return t.prototype.css_classes.call(this).concat(\"bk-widget\")},e.prototype.render=function(){this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),null!=this.model.width&&(this.el.style.width=this.model.width+\"px\")},e.prototype.get_width=function(){throw new Error(\"unused\")},e.prototype.get_height=function(){throw new Error(\"unused\")},e}(r.LayoutDOMView);n.WidgetView=o;var s=function(t){function e(e){return t.call(this,e)||this}return i.__extends(e,t),e.initClass=function(){this.prototype.type=\"Widget\"},e}(r.LayoutDOM);n.Widget=s,s.initClass()},419:/*! nouislider - 10.1.0 - 2017-07-28 17:11:18 */\n",
" function(t,e,n){!function(t){\"object\"==typeof n?e.exports=t():window.noUiSlider=t()}(function(){\"use strict\";function t(t){t.preventDefault()}function e(t){return\"number\"==typeof t&&!isNaN(t)&&isFinite(t)}function n(t,e,n){n>0&&(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 h(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 p(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<r.length;i++)p(r[i][1],r[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)f(i,this.xNumSteps[i],this)}function v(t){if(function(t){return\"object\"==typeof t&&\"function\"==typeof t.to&&\"function\"==typeof t.from}(t))return!0;throw new Error(\"noUiSlider (\"+B+\"): 'format' requires 'to' and 'from' methods.\")}function g(t,n){if(!e(n))throw new Error(\"noUiSlider (\"+B+\"): 'step' is not numeric.\");t.singleStep=n}function y(t,e){if(\"object\"!=typeof e||Array.isArray(e))throw new Error(\"noUiSlider (\"+B+\"): 'range' is not an object.\");if(void 0===e.min||void 0===e.max)throw new Error(\"noUiSlider (\"+B+\"): Missing 'min' or 'max' in 'range'.\");if(e.min===e.max)throw new Error(\"noUiSlider (\"+B+\"): 'range' 'min' and 'max' cannot be equal.\");t.spectrum=new m(e,t.snap,t.singleStep)}function b(t,e){if(e=i(e),!Array.isArray(e)||!e.length)throw new Error(\"noUiSlider (\"+B+\"): 'start' option is incorrect.\");t.handles=e.length,t.start=e}function _(t,e){if(t.snap=e,\"boolean\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'snap' option must be a boolean.\")}function w(t,e){if(t.animate=e,\"boolean\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'animate' option must be a boolean.\")}function x(t,e){if(t.animationDuration=e,\"number\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'animationDuration' option must be a number.\")}function k(t,e){var n,i=[!1];if(\"lower\"===e?e=[!0,!1]:\"upper\"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)i.push(e);i.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error(\"noUiSlider (\"+B+\"): 'connect' option doesn't match handle count.\");i=e}t.connect=i}function S(t,e){switch(e){case\"horizontal\":t.ort=0;break;case\"vertical\":t.ort=1;break;default:throw new Error(\"noUiSlider (\"+B+\"): 'orientation' option is invalid.\")}}function C(t,n){if(!e(n))throw new Error(\"noUiSlider (\"+B+\"): 'margin' option must be numeric.\");if(0!==n&&(t.margin=t.spectrum.getMargin(n),!t.margin))throw new Error(\"noUiSlider (\"+B+\"): 'margin' option is only supported on linear sliders.\")}function E(t,n){if(!e(n))throw new Error(\"noUiSlider (\"+B+\"): 'limit' option must be numeric.\");if(t.limit=t.spectrum.getMargin(n),!t.limit||t.handles<2)throw new Error(\"noUiSlider (\"+B+\"): 'limit' option is only supported on linear sliders with 2 or more handles.\")}function D(t,n){if(!e(n))throw new Error(\"noUiSlider (\"+B+\"): 'padding' option must be numeric.\");if(0!==n){if(t.padding=t.spectrum.getMargin(n),!t.padding)throw new Error(\"noUiSlider (\"+B+\"): 'padding' option is only supported on linear sliders.\");if(t.padding<0)throw new Error(\"noUiSlider (\"+B+\"): 'padding' option must be a positive number.\");if(t.padding>=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\");C(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:i,fixed:r,snap:o,hover:s}}function N(t,e){if(t.multitouch=e,\"boolean\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'multitouch' option must be a boolean.\")}function V(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=i(e),t.tooltips.length!==t.handles)throw new Error(\"noUiSlider (\"+B+\"): must pass a formatter for all handles.\");t.tooltips.forEach(function(t){if(\"boolean\"!=typeof t&&(\"object\"!=typeof t||\"function\"!=typeof t.to))throw new Error(\"noUiSlider (\"+B+\"): 'tooltips' must be passed a formatter or 'false'.\")})}}function I(t,e){t.ariaFormat=e,v(e)}function P(t,e){t.format=e,v(e)}function R(t,e){if(void 0!==e&&\"string\"!=typeof e&&!1!==e)throw new Error(\"noUiSlider (\"+B+\"): 'cssPrefix' must be a string or `false`.\");t.cssPrefix=e}function L(t,e){if(void 0!==e&&\"object\"!=typeof e)throw new Error(\"noUiSlider (\"+B+\"): 'cssClasses' must be an object.\");if(\"string\"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function T(t,e){if(!0!==e&&!1!==e)throw new Error(\"noUiSlider (\"+B+\"): 'useRequestAnimationFrame' option should be true (default) or false.\");t.useRequestAnimationFrame=e}function O(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:U,format:U},n={step:{r:!1,t:g},start:{r:!0,t:b},connect:{r:!0,t:k},direction:{r:!0,t:M},snap:{r:!1,t:_},animate:{r:!1,t:w},animationDuration:{r:!1,t:x},range:{r:!0,t:y},orientation:{r:!1,t:S},margin:{r:!1,t:C},limit:{r:!1,t:E},padding:{r:!1,t:D},behaviour:{r:!0,t:A},multitouch:{r:!0,t:N},ariaFormat:{r:!1,t:I},format:{r:!1,t:P},tooltips:{r:!1,t:V},cssPrefix:{r:!1,t:R},cssClasses:{r:!1,t:L},useRequestAnimationFrame:{r:!1,t:T}},i={connect:!1,direction:\"ltr\",behaviour:\"tap\",multitouch:!1,orientation:\"horizontal\",cssPrefix:\"noUi-\",cssClasses:{target:\"target\",base:\"base\",origin:\"origin\",handle:\"handle\",handleLower:\"handle-lower\",handleUpper:\"handle-upper\",horizontal:\"horizontal\",vertical:\"vertical\",background:\"background\",connect:\"connect\",ltr:\"ltr\",rtl:\"rtl\",draggable:\"draggable\",drag:\"state-drag\",tap:\"state-tap\",active:\"active\",tooltip:\"tooltip\",pips:\"pips\",pipsHorizontal:\"pips-horizontal\",pipsVertical:\"pips-vertical\",marker:\"marker\",markerHorizontal:\"marker-horizontal\",markerVertical:\"marker-vertical\",markerNormal:\"marker-normal\",markerLarge:\"marker-large\",markerSub:\"marker-sub\",value:\"value\",valueHorizontal:\"value-horizontal\",valueVertical:\"value-vertical\",valueNormal:\"value-normal\",valueLarge:\"value-large\",valueSub:\"value-sub\"},useRequestAnimationFrame:!0};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(n).forEach(function(r){if(void 0===t[r]&&void 0===i[r]){if(n[r].r)throw new Error(\"noUiSlider (\"+B+\"): '\"+r+\"' is required.\");return!0}n[r].t(e,void 0===t[r]?i[r]:t[r])}),e.pips=t.pips;var r=[[\"left\",\"top\"],[\"right\",\"bottom\"]];return e.style=r[e.dir][e.ort],e.styleOposite=r[e.dir?0:1][e.ort],e}function W(e,r,l){function u(t,e){var n=Z.createElement(\"div\");return e&&o(n,e),t.appendChild(n),n}function c(t,e){var n=u(t,r.cssClasses.origin),i=u(n,r.cssClasses.handle);return i.setAttribute(\"data-handle\",e),i.setAttribute(\"tabindex\",\"0\"),i.setAttribute(\"role\",\"slider\"),i.setAttribute(\"aria-orientation\",r.ort?\"vertical\":\"horizontal\"),0===e?o(i,r.cssClasses.handleLower):e===r.handles-1&&o(i,r.cssClasses.handleUpper),n}function d(t,e){return!!e&&u(t,r.cssClasses.connect)}function h(t,e){return!!r.tooltips[e]&&u(t.firstChild,r.cssClasses.tooltip)}function p(t,e,n){function i(t,e){var n=e===r.cssClasses.value,i=n?c:d,o=n?a:l;return e+\" \"+i[r.ort]+\" \"+o[t]}var s=Z.createElement(\"div\"),a=[r.cssClasses.valueNormal,r.cssClasses.valueLarge,r.cssClasses.valueSub],l=[r.cssClasses.markerNormal,r.cssClasses.markerLarge,r.cssClasses.markerSub],c=[r.cssClasses.valueHorizontal,r.cssClasses.valueVertical],d=[r.cssClasses.markerHorizontal,r.cssClasses.markerVertical];return o(s,r.cssClasses.pips),o(s,0===r.ort?r.cssClasses.pipsHorizontal:r.cssClasses.pipsVertical),Object.keys(t).forEach(function(o){!function(t,o){o[1]=o[1]&&e?e(o[0],o[1]):o[1];var a=u(s,!1);a.className=i(o[1],r.cssClasses.marker),a.style[r.style]=t+\"%\",o[1]&&((a=u(s,!1)).className=i(o[1],r.cssClasses.value),a.style[r.style]=t+\"%\",a.innerText=n.to(o[0]))}(o,t[o])}),s}function f(){j&&(!function(t){t.parentElement.removeChild(t)}(j),j=null)}function m(t){f();var e=t.mode,n=t.density||1,i=t.filter||!1,r=t.values||!1,o=t.stepped||!1,s=function(t,e,n){if(\"range\"===t||\"steps\"===t)return J.xVal;if(\"count\"===t){if(!e)throw new Error(\"noUiSlider (\"+B+\"): 'values' required for mode 'count'.\");var i,r=100/(e-1),o=0;for(e=[];(i=o++*r)<=100;)e.push(i);t=\"positions\"}if(\"positions\"===t)return e.map(function(t){return J.fromStepping(n?J.getStep(t):t)});if(\"values\"===t)return n?e.map(function(t){return J.fromStepping(J.getStep(J.toStepping(t)))}):e}(e,r,o),a=function(t,e,n){function i(t,e){return(t+e).toFixed(7)/1}var r={},o=J.xVal[0],s=J.xVal[J.xVal.length-1],a=!1,l=!1,u=0;(n=function(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}(n.slice().sort(function(t,e){return t-e})))[0]!==o&&(n.unshift(o),a=!0);n[n.length-1]!==s&&(n.push(s),l=!0);return n.forEach(function(o,s){var c,d,h,p,f,m,v,g,y,b=o,_=n[s+1];if(\"steps\"===e&&(c=J.xNumSteps[s]),c||(c=_-b),!1!==b&&void 0!==_)for(c=Math.max(c,1e-7),d=b;d<=_;d=i(d,c)){for(v=(f=(p=J.toStepping(d))-u)/t,y=f/(g=Math.round(v)),h=1;h<=g;h+=1)r[(u+h*y).toFixed(5)]=[\"x\",0];m=n.indexOf(d)>-1?1:\"steps\"===e?2:0,!s&&a&&(m=0),d===_&&l||(r[p.toFixed(5)]=[d,m]),u=p}}),r}(n,e,s),l=t.format||{to:Math.round};return j=q.appendChild(p(a,i,l))}function v(){var t=T.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||T[e]:t.height||T[e]}function g(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 h=Array.prototype.find.call(t.changedTouches,c);if(!h)return!1;i=h.pageX,o=h.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/v();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=D(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=N(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=g(F.move,tt,x,{target:e.target,handle:i,listeners:a,startCalcPoint:e.calcPoint,baseSize:v(),pageOffset:e.pageOffset,handleNumbers:n.handleNumbers,buttonsProperty:e.buttons,locations:G.slice()}),u=g(F.end,tt,k,{target:e.target,handle:i,listeners:a,handleNumbers:n.handleNumbers}),c=g(\"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 C(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);o<e&&(n=r,e=o)}}),n}(e);if(!1===i)return!1;r.events.snap||n(q,r.cssClasses.tap,r.animationDuration),N(i,e,!0,!0),A(),_(\"slide\",i,!0),_(\"update\",i,!0),_(\"change\",i,!0),_(\"set\",i,!0),r.events.snap&&S(t,{handleNumbers:[i]})}function E(t){var e=y(t.calcPoint),n=J.getStep(e),i=J.fromStepping(n);Object.keys(Q).forEach(function(t){\"hover\"===t.split(\".\")[0]&&Q[t].forEach(function(t){t.call(z,i)})})}function D(t,e,n,i,o,s){return W.length>1&&(i&&e>0&&(n=Math.max(n,t[e-1]+r.margin)),o&&e<W.length-1&&(n=Math.min(n,t[e+1]-r.margin))),W.length>1&&r.limit&&(i&&e>0&&(n=Math.min(n,t[e-1]+r.limit)),o&&e<W.length-1&&(n=Math.max(n,t[e+1]-r.limit))),r.padding&&(0===e&&(n=Math.max(n,r.padding)),e===W.length-1&&(n=Math.min(n,100-r.padding))),n=J.getStep(n),!((n=function(t){return Math.max(Math.min(t,100),0)}(n))===t[e]&&!s)&&n}function M(t){return t+\"%\"}function A(){X.forEach(function(t){var e=G[t]>50?-1:1,n=3+(W.length+e*t);W[t].childNodes[0].style.zIndex=n})}function N(t,e,n,i){return!1!==(e=D(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),V(t),V(t+1)};window.requestAnimationFrame&&r.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function V(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)||N(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){N(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;n<r.handles;n++)W.push(c(e,n)),X[n]=n,U.push(d(e,t[n+1]))}(r.connect,T),z={destroy:function(){for(var t in r.cssClasses)r.cssClasses.hasOwnProperty(t)&&s(q,r.cssClasses[t]);for(;q.firstChild;)q.removeChild(q.firstChild);delete q.noUiSlider},steps:function(){return G.map(function(t,e){var n=J.getNearbySteps(t),i=$[e],r=n.thisStep.step,o=null;!1!==r&&i+r>n.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){g(F.start,t.children[0],S,{handleNumbers:[e]})});t.tap&&g(F.start,T,C,{});t.hover&&g(F.move,T,E,{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){g(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(h);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=D(G,t,0,!0,!0,!0),s=D(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=h(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}}})},420:/*!\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]},h=function(t){u(t)&&t.setHours(0,0,0,0)},p=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))},v=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},g={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,keyboardInput:!0},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'<td class=\"is-empty\"></td>';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\"),'<td data-day=\"'+t.day+'\" class=\"'+e.join(\" \")+'\" aria-selected=\"'+n+'\"><button class=\"pika-button pika-day\" type=\"button\" data-pika-year=\"'+t.year+'\" data-pika-month=\"'+t.month+'\" data-pika-day=\"'+t.day+'\">'+t.day+\"</button></td>\"},_=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'<td class=\"pika-week\">'+r+\"</td>\"},w=function(t,e,n,i){return'<tr class=\"pika-row'+(n?\" pick-whole-week\":\"\")+(i?\" is-selected\":\"\")+'\">'+(e?t.reverse():t).join(\"\")+\"</tr>\"},x=function(t,e,n,i,r,o){var s,a,u,c,d,h=t._o,p=n===h.minYear,f=n===h.maxYear,m='<div id=\"'+o+'\" class=\"pika-title\" role=\"heading\" aria-live=\"assertive\">',v=!0,g=!0;for(u=[],s=0;s<12;s++)u.push('<option value=\"'+(n===r?s-e:12+s-e)+'\"'+(s===i?' selected=\"selected\"':\"\")+(p&&s<h.minMonth||f&&s>h.maxMonth?'disabled=\"disabled\"':\"\")+\">\"+h.i18n.months[s]+\"</option>\");for(c='<div class=\"pika-label\">'+h.i18n.months[i]+'<select class=\"pika-select pika-select-month\" tabindex=\"-1\">'+u.join(\"\")+\"</select></div>\",l(h.yearRange)?(s=h.yearRange[0],a=h.yearRange[1]+1):(s=n-h.yearRange,a=1+n+h.yearRange),u=[];s<a&&s<=h.maxYear;s++)s>=h.minYear&&u.push('<option value=\"'+s+'\"'+(s===n?' selected=\"selected\"':\"\")+\">\"+s+\"</option>\");return d='<div class=\"pika-label\">'+n+h.yearSuffix+'<select class=\"pika-select pika-select-year\" tabindex=\"-1\">'+u.join(\"\")+\"</select></div>\",h.showMonthAfterYear?m+=d+c:m+=c+d,p&&(0===i||h.minMonth>=i)&&(v=!1),f&&(11===i||h.maxMonth<=i)&&(g=!1),0===e&&(m+='<button class=\"pika-prev'+(v?\"\":\" is-disabled\")+'\" type=\"button\">'+h.i18n.previousMonth+\"</button>\"),e===t._o.numberOfMonths-1&&(m+='<button class=\"pika-next'+(g?\"\":\" is-disabled\")+'\" type=\"button\">'+h.i18n.nextMonth+\"</button>\"),m+=\"</div>\"},k=function(t,e,n){return'<table cellpadding=\"0\" cellspacing=\"0\" class=\"pika-table\" role=\"grid\" aria-labelledby=\"'+n+'\">'+function(t){var e,n=[];t.showWeekNumber&&n.push(\"<th></th>\");for(e=0;e<7;e++)n.push('<th scope=\"col\"><abbr title=\"'+y(t,e)+'\">'+y(t,e,!0)+\"</abbr></th>\");return\"<thead><tr>\"+(t.isRTL?n.reverse():n).join(\"\")+\"</tr></thead>\"}(t)+function(t){return\"<tbody>\"+t.join(\"\")+\"</tbody>\"}(e)+\"</table>\"},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),c.keyboardInput&&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({},g,!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.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),l(e.yearRange)){var i=(new Date).getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||i,e.yearRange[1]=parseInt(e.yearRange[1],10)||i}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||g.yearRange,e.yearRange>100&&(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)&&t<n?t=n:u(i)&&t>i&&(t=i),this._d=new Date(t.getTime()),h(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<n.getTime()||i.getTime()<r}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],\"right\"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){var n,i=this.getDate()||new Date,r=24*parseInt(e)*60*60*1e3;\"add\"===t?n=new Date(i.valueOf()+r):\"subtract\"===t&&(n=new Date(i.valueOf()-r)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=v(this.calendars[0]);for(var t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=v({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(h(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(h(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(this._v||t){var e,n=this._o,i=n.minYear,o=n.maxYear,s=n.minMonth,a=n.maxMonth,l=\"\";this._y<=i&&(this._y=i,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=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<n.numberOfMonths;u++)l+='<div class=\"pika-lendar\">'+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)+\"</div>\";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=[];h(r),i.firstDay>0&&(s-=i.firstDay)<0&&(s+=7);for(var f=0===e?11:e-1,m=11===e?0:e+1,v=0===e?t-1:t,g=11===e?t+1:t,y=d(v,f),x=o+s,S=x;S>7;)S-=7;x+=7-S;for(var C=!1,E=0,D=0;E<x;E++){var M=new Date(t,e,E-s+1),A=!!u(this._d)&&p(M,this._d),N=p(M,r),V=-1!==i.events.indexOf(M.toDateString()),I=E<s||E>=o+s,P=E-s+1,R=e,L=t,T=i.startRange&&p(i.startRange,M),O=i.endRange&&p(i.endRange,M),W=i.startRange&&i.endRange&&i.startRange<M&&M<i.endRange,B=i.minDate&&M<i.minDate||i.maxDate&&M>i.maxDate||i.disableWeekends&&c(M)||i.disableDayFn&&i.disableDayFn(M);I&&(E<s?(P=y+P,R=f,L=v):(P-=o,R=m,L=g));var U={day:P,month:R,year:L,hasEvent:V,isSelected:A,isToday:N,isDisabled:B,isEmpty:I,isStartRange:T,isEndRange:O,isInRange:W,showDaysInNextAndPreviousMonths:i.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:i.enableSelectionDaysInNextAndPreviousMonths};i.pickWholeWeek&&A&&(C=!0),l.push(b(U)),7==++D&&(i.showWeekNumber&&l.unshift(_(E-s,e,t)),a.push(w(l,i.isRTL,i.pickWholeWeek,C)),l=[],D=0,C=!1)}return k(i,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),function(t,e){t.className=function(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}((\" \"+t.className+\" \").replace(\" \"+e+\" \",\" \"))}(this.el,\"is-hidden\"),this._o.bound&&(o(i,\"click\",this._onClick),this.adjustPosition()),\"function\"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var t=this._v;!1!==t&&(this._o.bound&&s(i,\"click\",this._onClick),this.el.style.position=\"static\",this.el.style.left=\"auto\",this.el.style.top=\"auto\",function(t,e){a(t,e)||(t.className=\"\"===t.className?e:t.className+\" \"+e)}(this.el,\"is-hidden\"),this._v=!1,void 0!==t&&\"function\"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var t=this._o;this.hide(),s(this.el,\"mousedown\",this._onMouseDown,!0),s(this.el,\"touchend\",this._onMouseDown,!0),s(this.el,\"change\",this._onChange),t.keyboardInput&&s(i,\"keydown\",this._onKeyChange),t.field&&(s(t.field,\"change\",this._onInputChange),t.bound&&(s(t.trigger,\"click\",this._onInputClick),s(t.trigger,\"focus\",this._onInputFocus),s(t.trigger,\"blur\",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},S})}},{\"models/widgets/abstract_button\":388,\"models/widgets/abstract_icon\":389,\"models/widgets/abstract_slider\":390,\"models/widgets/autocomplete_input\":391,\"models/widgets/button\":392,\"models/widgets/checkbox_button_group\":393,\"models/widgets/checkbox_group\":394,\"models/widgets/common\":395,\"models/widgets/date_picker\":396,\"models/widgets/date_range_slider\":397,\"models/widgets/date_slider\":398,\"models/widgets/div\":399,\"models/widgets/dropdown\":400,\"models/widgets/index\":401,\"models/widgets/input_widget\":402,\"models/widgets/main\":403,\"models/widgets/markup\":404,\"models/widgets/multiselect\":405,\"models/widgets/panel\":406,\"models/widgets/paragraph\":407,\"models/widgets/password_input\":408,\"models/widgets/pretext\":409,\"models/widgets/radio_button_group\":410,\"models/widgets/radio_group\":411,\"models/widgets/range_slider\":412,\"models/widgets/selectbox\":413,\"models/widgets/slider\":414,\"models/widgets/tabs\":415,\"models/widgets/text_input\":416,\"models/widgets/toggle\":417,\"models/widgets/widget\":428})}(t.Bokeh)}(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-widgets.min.js.map\n",
"\n",
" /* END bokeh-widgets.min.js */\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" /* BEGIN bokeh-tables.min.js */\n",
" !function(a8026,a8027){!function(Bokeh){var define;(function(e,t,n){if(null!=Bokeh)return Bokeh.register_plugin(e,t,425);throw new Error(\"Cannot find Bokeh. You have to load it prior to loading plugins.\")})({421:function(e,t,n){var o=e(379),r=e(15),i=e(5),l=e(32),s=e(6),a=e(53),c=e(423),u=function(e){function t(t){return e.call(this,l.extend({model:t.column.model},t))||this}return o.__extends(t,e),Object.defineProperty(t.prototype,\"emptyValue\",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){e.prototype.initialize.call(this,t),this.inputEl=this._createInput(),this.defaultValue=null,this.args=t,this.render()},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-cell-editor\")},t.prototype.render=function(){e.prototype.render.call(this),this.args.container.appendChild(this.el),this.el.appendChild(this.inputEl),this.renderEditor(),this.disableNavigation()},t.prototype.renderEditor=function(){},t.prototype.disableNavigation=function(){this.inputEl.addEventListener(\"keydown\",function(e){switch(e.keyCode){case i.Keys.Left:case i.Keys.Right:case i.Keys.Up:case i.Keys.Down:case i.Keys.PageUp:case i.Keys.PageDown:e.stopImmediatePropagation()}})},t.prototype.destroy=function(){this.remove()},t.prototype.focus=function(){this.inputEl.focus()},t.prototype.show=function(){},t.prototype.hide=function(){},t.prototype.position=function(){},t.prototype.getValue=function(){return this.inputEl.value},t.prototype.setValue=function(e){this.inputEl.value=e},t.prototype.serializeValue=function(){return this.getValue()},t.prototype.isValueChanged=function(){return!(\"\"==this.getValue()&&null==this.defaultValue)&&this.getValue()!==this.defaultValue},t.prototype.applyValue=function(e,t){this.args.grid.getData().setField(e[c.DTINDEX_NAME],this.args.column.field,t)},t.prototype.loadValue=function(e){var t=e[this.args.column.field];this.defaultValue=null!=t?t:this.emptyValue,this.setValue(this.defaultValue)},t.prototype.validateValue=function(e){if(this.args.column.validator){var t=this.args.column.validator(e);if(!t.valid)return t}return{valid:!0,msg:null}},t.prototype.validate=function(){this.validateValue(this.getValue())},t}(s.DOMView);n.CellEditorView=u;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"CellEditor\"},t}(a.Model);n.CellEditor=d,d.initClass();var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),Object.defineProperty(t.prototype,\"emptyValue\",{get:function(){return\"\"},enumerable:!0,configurable:!0}),t.prototype._createInput=function(){return i.input({type:\"text\"})},t.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},t.prototype.loadValue=function(t){e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t}(u);n.StringEditorView=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"StringEditor\",this.prototype.default_view=p,this.define({completions:[r.Array,[]]})},t}(d);n.StringEditor=f,f.initClass();var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.textarea()},t}(u);n.TextEditorView=h;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TextEditor\",this.prototype.default_view=h},t}(d);n.TextEditor=g,g.initClass();var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.select()},t.prototype.renderEditor=function(){for(var e=0,t=this.model.options;e<t.length;e++){var n=t[e];this.inputEl.appendChild(i.option({value:n},n))}this.focus()},t}(u);n.SelectEditorView=m;var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"SelectEditor\",this.prototype.default_view=m,this.define({options:[r.Array,[]]})},t}(d);n.SelectEditor=v,v.initClass();var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t}(u);n.PercentEditorView=w;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"PercentEditor\",this.prototype.default_view=w},t}(d);n.PercentEditor=y,y.initClass();var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"checkbox\",value:\"true\"})},t.prototype.renderEditor=function(){this.focus()},t.prototype.loadValue=function(e){this.defaultValue=!!e[this.args.column.field],this.inputEl.checked=this.defaultValue},t.prototype.serializeValue=function(){return this.inputEl.checked},t}(u);n.CheckboxEditorView=C;var b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"CheckboxEditor\",this.prototype.default_view=C},t}(d);n.CheckboxEditor=b,b.initClass();var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},t.prototype.remove=function(){e.prototype.remove.call(this)},t.prototype.serializeValue=function(){return parseInt(this.getValue(),10)||0},t.prototype.loadValue=function(t){e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t.prototype.validateValue=function(t){return isNaN(t)?{valid:!1,msg:\"Please enter a valid integer\"}:e.prototype.validateValue.call(this,t)},t}(u);n.IntEditorView=x;var R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"IntEditor\",this.prototype.default_view=x,this.define({step:[r.Number,1]})},t}(d);n.IntEditor=R,R.initClass();var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},t.prototype.remove=function(){e.prototype.remove.call(this)},t.prototype.serializeValue=function(){return parseFloat(this.getValue())||0},t.prototype.loadValue=function(t){e.prototype.loadValue.call(this,t),this.inputEl.defaultValue=this.defaultValue,this.inputEl.select()},t.prototype.validateValue=function(t){return isNaN(t)?{valid:!1,msg:\"Please enter a valid number\"}:e.prototype.validateValue.call(this,t)},t}(u);n.NumberEditorView=S;var E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"NumberEditor\",this.prototype.default_view=S,this.define({step:[r.Number,.01]})},t}(d);n.NumberEditor=E,E.initClass();var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},t}(u);n.TimeEditorView=k;var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TimeEditor\",this.prototype.default_view=k},t}(d);n.TimeEditor=T,T.initClass();var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype._createInput=function(){return i.input({type:\"text\"})},Object.defineProperty(t.prototype,\"emptyValue\",{get:function(){return new Date},enumerable:!0,configurable:!0}),t.prototype.renderEditor=function(){this.inputEl.focus(),this.inputEl.select()},t.prototype.destroy=function(){e.prototype.destroy.call(this)},t.prototype.show=function(){e.prototype.show.call(this)},t.prototype.hide=function(){e.prototype.hide.call(this)},t.prototype.position=function(){return e.prototype.position.call(this)},t.prototype.getValue=function(){},t.prototype.setValue=function(e){},t}(u);n.DateEditorView=P;var D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"DateEditor\",this.prototype.default_view=P},t}(d);n.DateEditor=D,D.initClass()},422:function(e,t,n){var o=e(379),r=e(347),i=e(437),l=e(378),s=e(15),a=e(5),c=e(32),u=e(44),d=e(53),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){return null==n?\"\":(n+\"\").replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")},t}(d.Model);n.CellFormatter=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"StringFormatter\",this.define({font_style:[s.FontStyle,\"normal\"],text_align:[s.TextAlign,\"left\"],text_color:[s.Color]})},t.prototype.doFormat=function(e,t,n,o,r){var i=this.font_style,l=this.text_align,s=this.text_color,c=a.span({},null==n?\"\":\"\"+n);switch(i){case\"bold\":c.style.fontWeight=\"bold\";break;case\"italic\":c.style.fontStyle=\"italic\"}return null!=l&&(c.style.textAlign=l),null!=s&&(c.style.color=s),c.outerHTML},t}(p);n.StringFormatter=f,f.initClass();var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"NumberFormatter\",this.define({format:[s.String,\"0,0\"],language:[s.String,\"en\"],rounding:[s.String,\"round\"]})},t.prototype.doFormat=function(t,n,o,i,l){var s=this,a=this.format,c=this.language,u=function(){switch(s.rounding){case\"round\":case\"nearest\":return Math.round;case\"floor\":case\"rounddown\":return Math.floor;case\"ceil\":case\"roundup\":return Math.ceil}}();return o=r.format(o,a,c,u),e.prototype.doFormat.call(this,t,n,o,i,l)},t}(f);n.NumberFormatter=h,h.initClass();var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"BooleanFormatter\",this.define({icon:[s.String,\"check\"]})},t.prototype.doFormat=function(e,t,n,o,r){return n?a.i({class:this.icon}).outerHTML:\"\"},t}(p);n.BooleanFormatter=g,g.initClass();var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"DateFormatter\",this.define({format:[s.String,\"ISO-8601\"]})},t.prototype.getFormat=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;default:return this.format}},t.prototype.doFormat=function(t,n,o,r,i){o=u.isString(o)?parseInt(o,10):o;var s=l(o,this.getFormat());return e.prototype.doFormat.call(this,t,n,s,r,i)},t}(p);n.DateFormatter=m,m.initClass();var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"HTMLTemplateFormatter\",this.define({template:[s.String,\"<%= value %>\"]})},t.prototype.doFormat=function(e,t,n,o,r){var l=this.template;if(null==n)return\"\";var s=i(l),a=c.extend({},r,{value:n});return s(a)},t}(p);n.HTMLTemplateFormatter=v,v.initClass()},423:function(e,t,n){var o=e(379),r=e(435).Grid,i=e(433).RowSelectionModel,l=e(432).CheckboxSelectColumn,s=e(9),a=e(15),c=e(38),u=e(21),d=e(32),p=e(14),f=e(427),h=e(428);n.DTINDEX_NAME=\"__bkdt_internal_index__\";var g=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){for(var t={},o=0,r=d.keys(this.source.data);o<r.length;o++){var i=r[o];t[i]=this.source.data[i][this.index[e]]}return t[n.DTINDEX_NAME]=this.index[e],t},e.prototype.setItem=function(e,t){for(var o in t){var r=t[o];o!=n.DTINDEX_NAME&&(this.source.data[o][this.index[e]]=r)}this._update_source_inplace()},e.prototype.getField=function(e,t){return t==n.DTINDEX_NAME?this.index[e]:this.source.data[t][this.index[e]]},e.prototype.setField=function(e,t,n){this.source.data[t][this.index[e]]=n,this._update_source_inplace()},e.prototype.getItemMetadata=function(e){return null},e.prototype.getRecords=function(){var e=this;return u.range(0,this.getLength()).map(function(t){return e.getItem(t)})},e.prototype.sort=function(e){var t=e.map(function(e){return[e.sortCol.field,e.sortAsc?1:-1]});0==t.length&&(t=[[n.DTINDEX_NAME,1]]);var o=this.getRecords(),r=this.index.slice();this.index.sort(function(e,n){for(var i=0,l=t;i<l.length;i++){var s=l[i],a=s[0],c=s[1],u=o[r.indexOf(e)][a],d=o[r.indexOf(n)][a],p=u==d?0:u>d?c:-c;if(0!=p)return p}return 0})},e.prototype._update_source_inplace=function(){this.source.properties.data.change.emit()},e}();n.DataProvider=g;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._in_selection_update=!1,t._warned_not_reorderable=!1,t}return o.__extends(t,e),t.prototype.connect_signals=function(){var t=this;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(){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=this;if(!this._in_selection_update){var t=this.model.source.selected,n=t[\"1d\"].indices,o=n.map(function(t){return e.data.index.indexOf(t)});this._in_selection_update=!0,this.grid.setSelectedRows(o),this._in_selection_update=!1;var r=this.grid.getViewport(),i=this.model.get_scroll_index(r,o);null!=i&&this.grid.scrollRowToTop(i)}},t.prototype.newIndexColumn=function(){return{id:c.uniqueId(),name:this.model.index_header,field:n.DTINDEX_NAME,width:this.model.index_width,behavior:\"select\",cannotTriggerInsert:!0,resizable:!1,selectable:!1,sortable:!0,cssClass:\"bk-cell-index\",headerCssClass:\"bk-header-index\"}},t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-data-table\")},t.prototype.render=function(){var e,t=this,n=this.model.columns.map(function(e){return e.toColumn()});if(\"checkbox\"==this.model.selectable&&(e=new l({cssClass:\"bk-cell-select\"}),n.unshift(e.getColumnDefinition())),null!=this.model.index_position){var o=this.model.index_position,a=this.newIndexColumn();-1==o?n.push(a):o<-1?n.splice(o+1,0,a):n.splice(o,0,a)}var c=this.model.reorderable;!c||\"undefined\"!=typeof $&&null!=$.fn&&null!=$.fn.sortable||(this._warned_not_reorderable||(p.logger.warn(\"jquery-ui is required to enable DataTable.reorderable\"),this._warned_not_reorderable=!0),c=!1);var u={enableCellNavigation:!1!==this.model.selectable,enableColumnReorder:c,forceFitColumns:this.model.fit_columns,autoHeight:\"auto\"==this.model.height,multiColumnSort:this.model.sortable,editable:this.model.editable,autoEdit:!1};null!=this.model.width?this.el.style.width=this.model.width+\"px\":this.el.style.width=this.model.default_width+\"px\",null!=this.model.height&&\"auto\"!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),this.data=new g(this.model.source,this.model.view),this.grid=new r(this.el,this.data,n,u),this.grid.onSort.subscribe(function(e,o){n=o.sortCols,t.data.sort(n),t.grid.invalidate(),t.updateSelection(),t.grid.render()}),!1!==this.model.selectable&&(this.grid.setSelectionModel(new i({selectActiveRow:null==e})),null!=e&&this.grid.registerPlugin(e),this.grid.onSelectedRowsChanged.subscribe(function(e,n){if(!t._in_selection_update){var o=s.create_empty_hit_test_result();o.indices=n.rows.map(function(e){return t.data.index[e]}),t.model.source.selected=o}}),this.updateSelection())},t}(h.WidgetView);n.DataTableView=m;var v=function(e){function t(t){var n=e.call(this,t)||this;return n.default_width=600,n}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"DataTable\",this.prototype.default_view=m,this.define({columns:[a.Array,[]],fit_columns:[a.Bool,!0],sortable:[a.Bool,!0],reorderable:[a.Bool,!0],editable:[a.Bool,!1],selectable:[a.Bool,!0],index_position:[a.Int,0],index_header:[a.String,\"#\"],index_width:[a.Int,40],scroll_to_selection:[a.Bool,!0]}),this.override({height:400})},t.prototype.get_scroll_index=function(e,t){return this.scroll_to_selection&&0!=t.length?u.any(t,function(t){return e.top<=t&&t<=e.bottom})?null:Math.max(0,Math.min.apply(Math,t)-1):null},t}(f.TableWidget);n.DataTable=v,v.initClass()},424:function(e,t,n){var o=e(379);o.__exportStar(e(421),n),o.__exportStar(e(422),n);var r=e(423);n.DataTable=r.DataTable;var i=e(426);n.TableColumn=i.TableColumn;var l=e(427);n.TableWidget=l.TableWidget},425:function(e,t,n){var o=e(424);n.Tables=o;var r=e(0);r.register_models(o)},426:function(e,t,n){var o=e(379),r=e(422),i=e(421),l=e(15),s=e(38),a=e(53),c=function(e){function t(t){return e.call(this,t)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TableColumn\",this.define({field:[l.String],title:[l.String],width:[l.Number,300],formatter:[l.Instance,function(){return new r.StringFormatter}],editor:[l.Instance,function(){return new i.StringEditor}],sortable:[l.Bool,!0],default_sort:[l.String,\"ascending\"]})},t.prototype.toColumn=function(){return{id:s.uniqueId(),field:this.field,name:this.title,width:this.width,formatter:null!=this.formatter?this.formatter.doFormat.bind(this.formatter):void 0,model:this.editor,editor:this.editor.default_view,sortable:this.sortable,defaultSortAsc:\"ascending\"==this.default_sort}},t}(a.Model);n.TableColumn=c,c.initClass()},427:function(e,t,n){var o=e(379),r=e(428),i=e(183),l=e(15),s=function(e){function t(t){return e.call(this,t)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"TableWidget\",this.define({source:[l.Instance],view:[l.Instance,function(){return new i.CDSView}]})},t.prototype.initialize=function(){e.prototype.initialize.call(this),null==this.view.source&&(this.view.source=this.source,this.view.compute_indices())},t}(r.Widget);n.TableWidget=s,s.initClass()},428:function(e,t,n){var o=e(379),r=e(146),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.__extends(t,e),t.prototype.css_classes=function(){return e.prototype.css_classes.call(this).concat(\"bk-widget\")},t.prototype.render=function(){this._render_classes(),null!=this.model.height&&(this.el.style.height=this.model.height+\"px\"),null!=this.model.width&&(this.el.style.width=this.model.width+\"px\")},t.prototype.get_width=function(){throw new Error(\"unused\")},t.prototype.get_height=function(){throw new Error(\"unused\")},t}(r.LayoutDOMView);n.WidgetView=i;var l=function(e){function t(t){return e.call(this,t)||this}return o.__extends(t,e),t.initClass=function(){this.prototype.type=\"Widget\"},t}(r.LayoutDOM);n.Widget=l,l.initClass()},429:/*!\n",
" * jQuery JavaScript Library v3.3.1\n",
" * https://jquery.com/\n",
" *\n",
" * Includes Sizzle.js\n",
" * https://sizzlejs.com/\n",
" *\n",
" * Copyright JS Foundation and other contributors\n",
" * Released under the MIT license\n",
" * https://jquery.org/license\n",
" *\n",
" * Date: 2018-01-20T17:24Z\n",
" */\n",
" function(e,t,n){!function(e,n){\"use strict\";\"object\"==typeof t&&\"object\"==typeof t.exports?t.exports=e.document?n(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return n(e)}:n(e)}(\"undefined\"!=typeof window?window:this,function(e,t){\"use strict\";function n(e,t,n){var o,r=(t=t||Z).createElement(\"script\");if(r.text=e,n)for(o in fe)n[o]&&(r[o]=n[o]);t.head.appendChild(r).parentNode.removeChild(r)}function o(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?ie[le.call(e)]||\"object\":typeof e}function r(e){var t=!!e&&\"length\"in e&&e.length,n=o(e);return!de(e)&&!pe(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&t>0&&t-1 in e)}function i(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function l(e,t,n){return de(t)?he.grep(e,function(e,o){return!!t.call(e,o,e)!==n}):t.nodeType?he.grep(e,function(e){return e===t!==n}):\"string\"!=typeof t?he.grep(e,function(e){return re.call(t,e)>-1!==n}):he.filter(t,e,n)}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){return e}function c(e){throw e}function u(e,t,n,o){var r;try{e&&de(r=e.promise)?r.call(e).done(t).fail(n):e&&de(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}function d(){Z.removeEventListener(\"DOMContentLoaded\",d),e.removeEventListener(\"load\",d),he.ready()}function p(e,t){return t.toUpperCase()}function f(e){return e.replace(Ne,\"ms-\").replace(Ae,p)}function h(){this.expando=he.expando+h.uid++}function g(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o=\"data-\"+t.replace(Ie,\"-$&\").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(_e.test(e))return JSON.parse(e);return e}(n)}catch(e){}Le.set(e,t,n)}else n=void 0;return n}function m(e,t,n,o){var r,i,l=20,s=o?function(){return o.cur()}:function(){return he.css(e,t,\"\")},a=s(),c=n&&n[3]||(he.cssNumber[t]?\"\":\"px\"),u=(he.cssNumber[t]||\"px\"!==c&&+a)&&Fe.exec(he.css(e,t));if(u&&u[3]!==c){for(a/=2,c=c||u[3],u=+a||1;l--;)he.style(e,t,u+c),(1-i)*(1-(i=s()/a||.5))<=0&&(l=0),u/=i;u*=2,he.style(e,t,u+c),n=n||[]}return n&&(u=+u||+a||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],o&&(o.unit=c,o.start=u,o.end=r)),r}function v(e){var t,n=e.ownerDocument,o=e.nodeName,r=Be[o];return r||(t=n.body.appendChild(n.createElement(o)),r=he.css(t,\"display\"),t.parentNode.removeChild(t),\"none\"===r&&(r=\"block\"),Be[o]=r,r)}function w(e,t){for(var n,o,r=[],i=0,l=e.length;i<l;i++)(o=e[i]).style&&(n=o.style.display,t?(\"none\"===n&&(r[i]=He.get(o,\"display\")||null,r[i]||(o.style.display=\"\")),\"\"===o.style.display&&je(o)&&(r[i]=v(o))):\"none\"!==n&&(r[i]=\"none\",He.set(o,\"display\",n)));for(i=0;i<l;i++)null!=r[i]&&(e[i].style.display=r[i]);return e}function y(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||\"*\"):void 0!==e.querySelectorAll?e.querySelectorAll(t||\"*\"):[],void 0===t||t&&i(e,t)?he.merge([e],n):n}function C(e,t){for(var n=0,o=e.length;n<o;n++)He.set(e[n],\"globalEval\",!t||He.get(t[n],\"globalEval\"))}function b(e,t,n,r,i){for(var l,s,a,c,u,d,p=t.createDocumentFragment(),f=[],h=0,g=e.length;h<g;h++)if((l=e[h])||0===l)if(\"object\"===o(l))he.merge(f,l.nodeType?[l]:l);else if(Ue.test(l)){for(s=s||p.appendChild(t.createElement(\"div\")),a=(Oe.exec(l)||[\"\",\"\"])[1].toLowerCase(),c=Xe[a]||Xe._default,s.innerHTML=c[1]+he.htmlPrefilter(l)+c[2],d=c[0];d--;)s=s.lastChild;he.merge(f,s.childNodes),(s=p.firstChild).textContent=\"\"}else f.push(t.createTextNode(l));for(p.textContent=\"\",h=0;l=f[h++];)if(r&&he.inArray(l,r)>-1)i&&i.push(l);else if(u=he.contains(l.ownerDocument,l),s=y(p.appendChild(l),\"script\"),u&&C(s),n)for(d=0;l=s[d++];)ze.test(l.type||\"\")&&n.push(l);return p}function x(){return!0}function R(){return!1}function S(){try{return Z.activeElement}catch(e){}}function E(e,t,n,o,r,i){var l,s;if(\"object\"==typeof t){\"string\"!=typeof n&&(o=o||n,n=void 0);for(s in t)E(e,s,n,o,t[s],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=R;else if(!r)return e;return 1===i&&(l=r,(r=function(e){return he().off(e),l.apply(this,arguments)}).guid=l.guid||(l.guid=he.guid++)),e.each(function(){he.event.add(this,t,r,o,n)})}function k(e,t){return i(e,\"table\")&&i(11!==t.nodeType?t:t.firstChild,\"tr\")?he(e).children(\"tbody\")[0]||e:e}function T(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function P(e){return\"true/\"===(e.type||\"\").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute(\"type\"),e}function D(e,t){var n,o,r,i,l,s,a,c;if(1===t.nodeType){if(He.hasData(e)&&(i=He.access(e),l=He.set(t,i),c=i.events)){delete l.handle,l.events={};for(r in c)for(n=0,o=c[r].length;n<o;n++)he.event.add(t,r,c[r][n])}Le.hasData(e)&&(s=Le.access(e),a=he.extend({},s),Le.set(t,a))}}function N(e,t){var n=t.nodeName.toLowerCase();\"input\"===n&&qe.test(e.type)?t.checked=e.checked:\"input\"!==n&&\"textarea\"!==n||(t.defaultValue=e.defaultValue)}function A(e,t,o,r){t=ne.apply([],t);var i,l,s,a,c,u,d=0,p=e.length,f=p-1,h=t[0],g=de(h);if(g||p>1&&\"string\"==typeof h&&!ue.checkClone&&et.test(h))return e.each(function(n){var i=e.eq(n);g&&(t[0]=h.call(this,n,i.html())),A(i,t,o,r)});if(p&&(i=b(t,e[0].ownerDocument,!1,e,r),l=i.firstChild,1===i.childNodes.length&&(i=l),l||r)){for(s=he.map(y(i,\"script\"),T),a=s.length;d<p;d++)c=i,d!==f&&(c=he.clone(c,!0,!0),a&&he.merge(s,y(c,\"script\"))),o.call(e[d],c,d);if(a)for(u=s[s.length-1].ownerDocument,he.map(s,P),d=0;d<a;d++)c=s[d],ze.test(c.type||\"\")&&!He.access(c,\"globalEval\")&&he.contains(u,c)&&(c.src&&\"module\"!==(c.type||\"\").toLowerCase()?he._evalUrl&&he._evalUrl(c.src):n(c.textContent.replace(tt,\"\"),u,c))}return e}function $(e,t,n){for(var o,r=t?he.filter(t,e):e,i=0;null!=(o=r[i]);i++)n||1!==o.nodeType||he.cleanData(y(o)),o.parentNode&&(n&&he.contains(o.ownerDocument,o)&&C(y(o,\"script\")),o.parentNode.removeChild(o));return e}function H(e,t,n){var o,r,i,l,s=e.style;return(n=n||ot(e))&&(\"\"!==(l=n.getPropertyValue(t)||n[t])||he.contains(e.ownerDocument,e)||(l=he.style(e,t)),!ue.pixelBoxStyles()&&nt.test(l)&&rt.test(t)&&(o=s.width,r=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=l,l=n.width,s.width=o,s.minWidth=r,s.maxWidth=i)),void 0!==l?l+\"\":l}function L(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function _(e){var t=he.cssProps[e];return t||(t=he.cssProps[e]=function(e){if(e in ut)return e;var t=e[0].toUpperCase()+e.slice(1),n=ct.length;for(;n--;)if((e=ct[n]+t)in ut)return e}(e)||e),t}function I(e,t,n){var o=Fe.exec(t);return o?Math.max(0,o[2]-(n||0))+(o[3]||\"px\"):t}function M(e,t,n,o,r,i){var l=\"width\"===t?1:0,s=0,a=0;if(n===(o?\"border\":\"content\"))return 0;for(;l<4;l+=2)\"margin\"===n&&(a+=he.css(e,n+We[l],!0,r)),o?(\"content\"===n&&(a-=he.css(e,\"padding\"+We[l],!0,r)),\"margin\"!==n&&(a-=he.css(e,\"border\"+We[l]+\"Width\",!0,r))):(a+=he.css(e,\"padding\"+We[l],!0,r),\"padding\"!==n?a+=he.css(e,\"border\"+We[l]+\"Width\",!0,r):s+=he.css(e,\"border\"+We[l]+\"Width\",!0,r));return!o&&i>=0&&(a+=Math.max(0,Math.ceil(e[\"offset\"+t[0].toUpperCase()+t.slice(1)]-i-a-s-.5))),a}function F(e,t,n){var o=ot(e),r=H(e,t,o),i=\"border-box\"===he.css(e,\"boxSizing\",!1,o),l=i;if(nt.test(r)){if(!n)return r;r=\"auto\"}return l=l&&(ue.boxSizingReliable()||r===e.style[t]),(\"auto\"===r||!parseFloat(r)&&\"inline\"===he.css(e,\"display\",!1,o))&&(r=e[\"offset\"+t[0].toUpperCase()+t.slice(1)],l=!0),(r=parseFloat(r)||0)+M(e,t,n||(i?\"border\":\"content\"),l,o,r)+\"px\"}function W(e,t,n,o,r){return new W.prototype.init(e,t,n,o,r)}function j(){pt&&(!1===Z.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(j):e.setTimeout(j,he.fx.interval),he.fx.tick())}function V(){return e.setTimeout(function(){dt=void 0}),dt=Date.now()}function B(e,t){var n,o=0,r={height:e};for(t=t?1:0;o<4;o+=2-t)n=We[o],r[\"margin\"+n]=r[\"padding\"+n]=e;return t&&(r.opacity=r.width=e),r}function q(e,t,n){for(var o,r=(O.tweeners[t]||[]).concat(O.tweeners[\"*\"]),i=0,l=r.length;i<l;i++)if(o=r[i].call(n,t,e))return o}function O(e,t,n){var o,r,i=0,l=O.prefilters.length,s=he.Deferred().always(function(){delete a.elem}),a=function(){if(r)return!1;for(var t=dt||V(),n=Math.max(0,c.startTime+c.duration-t),o=n/c.duration||0,i=1-o,l=0,a=c.tweens.length;l<a;l++)c.tweens[l].run(i);return s.notifyWith(e,[c,i,n]),i<1&&a?n:(a||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:he.extend({},t),opts:he.extend(!0,{specialEasing:{},easing:he.easing._default},n),originalProperties:t,originalOptions:n,startTime:dt||V(),duration:n.duration,tweens:[],createTween:function(t,n){var o=he.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(o),o},stop:function(t){var n=0,o=t?c.tweens.length:0;if(r)return this;for(r=!0;n<o;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,o,r,i,l;for(n in e)if(o=f(n),r=t[o],i=e[n],Array.isArray(i)&&(r=i[1],i=e[n]=i[0]),n!==o&&(e[o]=i,delete e[n]),(l=he.cssHooks[o])&&\"expand\"in l){i=l.expand(i),delete e[o];for(n in i)n in e||(e[n]=i[n],t[n]=r)}else t[o]=r}(u,c.opts.specialEasing);i<l;i++)if(o=O.prefilters[i].call(c,e,u,c.opts))return de(o.stop)&&(he._queueHooks(c.elem,c.opts.queue).stop=o.stop.bind(o)),o;return he.map(u,q,c),de(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),he.fx.timer(he.extend(a,{elem:e,anim:c,queue:c.opts.queue})),c}function z(e){var t=e.match(ke)||[];return t.join(\" \")}function X(e){return e.getAttribute&&e.getAttribute(\"class\")||\"\"}function U(e){return Array.isArray(e)?e:\"string\"==typeof e?e.match(ke)||[]:[]}function K(e,t,n,r){var i;if(Array.isArray(t))he.each(t,function(t,o){n||Et.test(e)?r(e,o):K(e+\"[\"+(\"object\"==typeof o&&null!=o?t:\"\")+\"]\",o,n,r)});else if(n||\"object\"!==o(t))r(e,t);else for(i in t)K(e+\"[\"+i+\"]\",t[i],n,r)}function G(e){return function(t,n){\"string\"!=typeof t&&(n=t,t=\"*\");var o,r=0,i=t.toLowerCase().match(ke)||[];if(de(n))for(;o=i[r++];)\"+\"===o[0]?(o=o.slice(1)||\"*\",(e[o]=e[o]||[]).unshift(n)):(e[o]=e[o]||[]).push(n)}}function Y(e,t,n,o){function r(s){var a;return i[s]=!0,he.each(e[s]||[],function(e,s){var c=s(t,n,o);return\"string\"!=typeof c||l||i[c]?l?!(a=c):void 0:(t.dataTypes.unshift(c),r(c),!1)}),a}var i={},l=e===It;return r(t.dataTypes[0])||!i[\"*\"]&&r(\"*\")}function Q(e,t){var n,o,r=he.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:o||(o={}))[n]=t[n]);return o&&he.extend(!0,e,o),e}var J=[],Z=e.document,ee=Object.getPrototypeOf,te=J.slice,ne=J.concat,oe=J.push,re=J.indexOf,ie={},le=ie.toString,se=ie.hasOwnProperty,ae=se.toString,ce=ae.call(Object),ue={},de=function(e){return\"function\"==typeof e&&\"number\"!=typeof e.nodeType},pe=function(e){return null!=e&&e===e.window},fe={type:!0,src:!0,noModule:!0},he=function(e,t){return new he.fn.init(e,t)},ge=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;he.fn=he.prototype={jquery:\"3.3.1\",constructor:he,length:0,toArray:function(){return te.call(this)},get:function(e){return null==e?te.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=he.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return he.each(this,e)},map:function(e){return this.pushStack(he.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(te.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:oe,sort:J.sort,splice:J.splice},he.extend=he.fn.extend=function(){var e,t,n,o,r,i,l=arguments[0]||{},s=1,a=arguments.length,c=!1;for(\"boolean\"==typeof l&&(c=l,l=arguments[s]||{},s++),\"object\"==typeof l||de(l)||(l={}),s===a&&(l=this,s--);s<a;s++)if(null!=(e=arguments[s]))for(t in e)n=l[t],o=e[t],l!==o&&(c&&o&&(he.isPlainObject(o)||(r=Array.isArray(o)))?(r?(r=!1,i=n&&Array.isArray(n)?n:[]):i=n&&he.isPlainObject(n)?n:{},l[t]=he.extend(c,i,o)):void 0!==o&&(l[t]=o));return l},he.extend({expando:\"jQuery\"+(\"3.3.1\"+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==le.call(e))&&(!(t=ee(e))||\"function\"==typeof(n=se.call(t,\"constructor\")&&t.constructor)&&ae.call(n)===ce)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){n(e)},each:function(e,t){var n,o=0;if(r(e))for(n=e.length;o<n&&!1!==t.call(e[o],o,e[o]);o++);else for(o in e)if(!1===t.call(e[o],o,e[o]))break;return e},trim:function(e){return null==e?\"\":(e+\"\").replace(ge,\"\")},makeArray:function(e,t){var n=t||[];return null!=e&&(r(Object(e))?he.merge(n,\"string\"==typeof e?[e]:e):oe.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:re.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,r=e.length;o<n;o++)e[r++]=t[o];return e.length=r,e},grep:function(e,t,n){for(var o=[],r=0,i=e.length,l=!n;r<i;r++)!t(e[r],r)!==l&&o.push(e[r]);return o},map:function(e,t,n){var o,i,l=0,s=[];if(r(e))for(o=e.length;l<o;l++)null!=(i=t(e[l],l,n))&&s.push(i);else for(l in e)null!=(i=t(e[l],l,n))&&s.push(i);return ne.apply([],s)},guid:1,support:ue}),\"function\"==typeof Symbol&&(he.fn[Symbol.iterator]=J[Symbol.iterator]),he.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){ie[\"[object \"+t+\"]\"]=t.toLowerCase()});var me=/*!\n",
" * Sizzle CSS Selector Engine v2.3.3\n",
" * https://sizzlejs.com/\n",
" *\n",
" * Copyright jQuery Foundation and other contributors\n",
" * Released under the MIT license\n",
" * http://jquery.org/license\n",
" *\n",
" * Date: 2016-08-08\n",
" */\n",
" function(e){function t(e,t,n,o){var r,i,l,s,a,c,u,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],\"string\"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!o&&((t?t.ownerDocument||t:W)!==A&&N(t),t=t||A,H)){if(11!==h&&(a=ge.exec(e)))if(r=a[1]){if(9===h){if(!(l=t.getElementById(r)))return n;if(l.id===r)return n.push(l),n}else if(p&&(l=p.getElementById(r))&&M(t,l)&&l.id===r)return n.push(l),n}else{if(a[2])return Y.apply(n,t.getElementsByTagName(e)),n;if((r=a[3])&&C.getElementsByClassName&&t.getElementsByClassName)return Y.apply(n,t.getElementsByClassName(r)),n}if(C.qsa&&!O[e+\" \"]&&(!L||!L.test(e))){if(1!==h)p=t,u=e;else if(\"object\"!==t.nodeName.toLowerCase()){for((s=t.getAttribute(\"id\"))?s=s.replace(ye,Ce):t.setAttribute(\"id\",s=F),c=S(e),i=c.length;i--;)c[i]=\"#\"+s+\" \"+f(c[i]);u=c.join(\",\"),p=me.test(e)&&d(t.parentNode)||t}if(u)try{return Y.apply(n,p.querySelectorAll(u)),n}catch(e){}finally{s===F&&t.removeAttribute(\"id\")}}}return k(e.replace(ie,\"$1\"),t,n,o)}function n(){function e(n,o){return t.push(n+\" \")>b.cacheLength&&delete e[t.shift()],e[n+\" \"]=o}var t=[];return e}function o(e){return e[F]=!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 s(e){return function(t){var n=t.nodeName.toLowerCase();return\"input\"===n&&t.type===e}}function a(e){return function(t){var n=t.nodeName.toLowerCase();return(\"input\"===n||\"button\"===n)&&t.type===e}}function c(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 u(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=\"\";t<n;t++)o+=e[t].value;return o}function h(e,t,n){var o=t.dir,r=t.next,i=r||o,l=n&&\"parentNode\"===i,s=V++;return t.first?function(t,n,r){for(;t=t[o];)if(1===t.nodeType||l)return e(t,n,r);return!1}:function(t,n,a){var c,u,d,p=[j,s];if(a){for(;t=t[o];)if((1===t.nodeType||l)&&e(t,n,a))return!0}else for(;t=t[o];)if(1===t.nodeType||l)if(d=t[F]||(t[F]={}),u=d[t.uniqueID]||(d[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[o]||t;else{if((c=u[i])&&c[0]===j&&c[1]===s)return p[2]=c[2];if(u[i]=p,p[2]=e(t,n,a))return!0}return!1}}function g(e){return e.length>1?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=[],s=0,a=e.length,c=null!=t;s<a;s++)(i=e[s])&&(n&&!n(i,o,r)||(l.push(i),c&&t.push(s)));return l}function v(e,n,r,i,l,s){return i&&!i[F]&&(i=v(i)),l&&!l[F]&&(l=v(l,s)),o(function(o,s,a,c){var u,d,p,f=[],h=[],g=s.length,v=o||function(e,n,o){for(var r=0,i=n.length;r<i;r++)t(e,n[r],o);return o}(n||\"*\",a.nodeType?[a]:a,[]),w=!e||!o&&n?v:m(v,f,e,a,c),y=r?l||(o?e:g||i)?[]:s:w;if(r&&r(w,y,a,c),i)for(u=m(y,h),i(u,[],a,c),d=u.length;d--;)(p=u[d])&&(y[h[d]]=!(w[h[d]]=p));if(o){if(l||e){if(l){for(u=[],d=y.length;d--;)(p=y[d])&&u.push(w[d]=p);l(null,y=[],u,c)}for(d=y.length;d--;)(p=y[d])&&(u=l?J(o,p):f[d])>-1&&(o[u]=!(s[u]=p))}}else y=m(y===s?y.splice(g,y.length):y),l?l(null,s,y,c):Y.apply(s,y)})}function w(e){for(var t,n,o,r=e.length,i=b.relative[e[0].type],l=i||b.relative[\" \"],s=i?1:0,a=h(function(e){return e===t},l,!0),c=h(function(e){return J(t,e)>-1},l,!0),u=[function(e,n,o){var r=!i&&(o||n!==T)||((t=n).nodeType?a(e,n,o):c(e,n,o));return t=null,r}];s<r;s++)if(n=b.relative[e[s].type])u=[h(g(u),n)];else{if((n=b.filter[e[s].type].apply(null,e[s].matches))[F]){for(o=++s;o<r&&!b.relative[e[o].type];o++);return v(s>1&&g(u),s>1&&f(e.slice(0,s-1).concat({value:\" \"===e[s-2].type?\"*\":\"\"})).replace(ie,\"$1\"),n,s<o&&w(e.slice(s,o)),o<r&&w(e=e.slice(o)),o<r&&f(e))}u.push(n)}return g(u)}var y,C,b,x,R,S,E,k,T,P,D,N,A,$,H,L,_,I,M,F=\"sizzle\"+1*new Date,W=e.document,j=0,V=0,B=n(),q=n(),O=n(),z=function(e,t){return e===t&&(D=!0),0},X={}.hasOwnProperty,U=[],K=U.pop,G=U.push,Y=U.push,Q=U.slice,J=function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},Z=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",ee=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",te=\"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",ne=\"\\\\[\"+ee+\"*(\"+te+\")(?:\"+ee+\"*([*^$|!~]?=)\"+ee+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+te+\"))|)\"+ee+\"*\\\\]\",oe=\":(\"+te+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+ne+\")*)|.*)\\\\)|)\",re=new RegExp(ee+\"+\",\"g\"),ie=new RegExp(\"^\"+ee+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+ee+\"+$\",\"g\"),le=new RegExp(\"^\"+ee+\"*,\"+ee+\"*\"),se=new RegExp(\"^\"+ee+\"*([>+~]|\"+ee+\")\"+ee+\"*\"),ae=new RegExp(\"=\"+ee+\"*([^\\\\]'\\\"]*?)\"+ee+\"*\\\\]\",\"g\"),ce=new RegExp(oe),ue=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=F,!A.getElementsByName||!A.getElementsByName(F).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)},_=[],L=[],(C.qsa=he.test(A.querySelectorAll))&&(r(function(e){$.appendChild(e).innerHTML=\"<a id='\"+F+\"'></a><select id='\"+F+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",e.querySelectorAll(\"[msallowcapture^='']\").length&&L.push(\"[*^$]=\"+ee+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||L.push(\"\\\\[\"+ee+\"*(?:value|\"+Z+\")\"),e.querySelectorAll(\"[id~=\"+F+\"-]\").length||L.push(\"~=\"),e.querySelectorAll(\":checked\").length||L.push(\":checked\"),e.querySelectorAll(\"a#\"+F+\"+*\").length||L.push(\".#.+[+~]\")}),r(function(e){e.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";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\"),_.push(\"!=\",oe)}),L=L.length&&new RegExp(L.join(\"|\")),_=_.length&&new RegExp(_.join(\"|\")),t=he.test($.compareDocumentPosition),M=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&&M(W,e)?-1:t===A||t.ownerDocument===W&&M(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,s=[e],a=[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;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[o]===a[o];)o++;return o?l(s[o],a[o]):s[o]===W?-1:a[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(ae,\"='$1']\"),C.matchesSelector&&H&&!O[n+\" \"]&&(!_||!_.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),M(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&&ce.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),s=\"of-type\"===t;return 1===o&&0===r?function(e){return!!e.parentNode}:function(t,n,a){var c,u,d,p,f,h,g=i!==l?\"nextSibling\":\"previousSibling\",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),w=!a&&!s,y=!1;if(m){if(i){for(;g;){for(p=t;p=p[g];)if(s?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)[F]||(p[F]={}),u=d[p.uniqueID]||(d[p.uniqueID]={}),c=u[e]||[],f=c[0]===j&&c[1],y=f&&c[2],p=f&&m.childNodes[f];p=++f&&p&&p[g]||(y=f=0)||h.pop();)if(1===p.nodeType&&++y&&p===t){u[e]=[j,f,y];break}}else if(w&&(d=(p=t)[F]||(p[F]={}),u=d[p.uniqueID]||(d[p.uniqueID]={}),c=u[e]||[],f=c[0]===j&&c[1],y=f),!1===y)for(;(p=++f&&p&&p[g]||(y=f=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++y||(w&&(d=p[F]||(p[F]={}),(u=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[F]?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[F]?o(function(e,t,n,o){for(var i,l=r(e,null,o,[]),s=e.length;s--;)(i=l[s])&&(e[s]=!(t[s]=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 ue.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:c(!1),disabled:c(!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:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[n<0?n+t:n]}),even:u(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var o=n<0?n+t:n;--o>=0;)e.push(o);return e}),gt:u(function(e,t,n){for(var o=n<0?n+t:n;++o<t;)e.push(o);return e})}}).pseudos.nth=b.pseudos.eq;for(y in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[y]=s(y);for(y in{submit:!0,reset:!0})b.pseudos[y]=a(y);return p.prototype=b.filters=b.pseudos,b.setFilters=new p,S=t.tokenize=function(e,n){var o,r,i,l,s,a,c,u=q[e+\" \"];if(u)return n?0:u.slice(0);for(s=e,a=[],c=b.preFilter;s;){o&&!(r=le.exec(s))||(r&&(s=s.slice(r[0].length)||s),a.push(i=[])),o=!1,(r=se.exec(s))&&(o=r.shift(),i.push({value:o,type:r[0].replace(ie,\" \")}),s=s.slice(o.length));for(l in b.filter)!(r=de[l].exec(s))||c[l]&&!(r=c[l](r))||(o=r.shift(),i.push({value:o,type:l,matches:r}),s=s.slice(o.length));if(!o)break}return n?s.length:s?t.error(e):q(e,a).slice(0)},E=t.compile=function(e,n){var r,i=[],l=[],s=O[e+\" \"];if(!s){for(n||(n=S(e)),r=n.length;r--;)(s=w(n[r]))[F]?i.push(s):l.push(s);(s=O(e,function(e,n){var r=n.length>0,i=e.length>0,l=function(o,l,s,a,c){var u,d,p,f=0,h=\"0\",g=o&&[],v=[],w=T,y=o||i&&b.find.TAG(\"*\",c),C=j+=null==w?1:Math.random()||.1,x=y.length;for(c&&(T=l===A||l||c);h!==x&&null!=(u=y[h]);h++){if(i&&u){for(d=0,l||u.ownerDocument===A||(N(u),s=!H);p=e[d++];)if(p(u,l||A,s)){a.push(u);break}c&&(j=C)}r&&((u=!p&&u)&&f--,o&&g.push(u))}if(f+=h,r&&h!==f){for(d=0;p=n[d++];)p(g,v,l,s);if(o){if(f>0)for(;h--;)g[h]||v[h]||(v[h]=K.call(a));v=m(v)}Y.apply(a,v),c&&!o&&v.length>0&&f+n.length>1&&t.uniqueSort(a)}return c&&(j=C,T=w),g};return r?o(l):l}(l,i))).selector=e}return s},k=t.select=function(e,t,n,o){var r,i,l,s,a,c=\"function\"==typeof e&&e,u=!o&&S(e=c.selector||e);if(n=n||[],1===u.length){if((i=u[0]=u[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;c&&(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[s=l.type]);)if((a=b.find[s])&&(o=a(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(c||E(e,u))(o,t,!H,n,!t||me.test(e)&&d(t.parentNode)||t),n},C.sortStable=F.split(\"\").sort(z).join(\"\")===F,C.detectDuplicates=!!D,N(),C.sortDetached=r(function(e){return 1&e.compareDocumentPosition(A.createElement(\"fieldset\"))}),r(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===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=\"<input/>\",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);he.find=me,he.expr=me.selectors,he.expr[\":\"]=he.expr.pseudos,he.uniqueSort=he.unique=me.uniqueSort,he.text=me.getText,he.isXMLDoc=me.isXML,he.contains=me.contains,he.escapeSelector=me.escape;var ve=function(e,t,n){for(var o=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&he(e).is(n))break;o.push(e)}return o},we=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},ye=he.expr.match.needsContext,Ce=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i;he.filter=function(e,t,n){var o=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===o.nodeType?he.find.matchesSelector(o,e)?[o]:[]:he.find.matches(e,he.grep(t,function(e){return 1===e.nodeType}))},he.fn.extend({find:function(e){var t,n,o=this.length,r=this;if(\"string\"!=typeof e)return this.pushStack(he(e).filter(function(){for(t=0;t<o;t++)if(he.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<o;t++)he.find(e,r[t],n);return o>1?he.uniqueSort(n):n},filter:function(e){return this.pushStack(l(this,e||[],!1))},not:function(e){return this.pushStack(l(this,e||[],!0))},is:function(e){return!!l(this,\"string\"==typeof e&&ye.test(e)?he(e):e||[],!1).length}});var be,xe=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,Re=he.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||be,\"string\"==typeof e){if(!(o=\"<\"===e[0]&&\">\"===e[e.length-1]&&e.length>=3?[null,e,null]:xe.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 he?t[0]:t,he.merge(this,he.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:Z,!0)),Ce.test(o[1])&&he.isPlainObject(t))for(o in t)de(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=Z.getElementById(o[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):de(e)?void 0!==n.ready?n.ready(e):e(he):he.makeArray(e,this)};Re.prototype=he.fn,be=he(Z);var Se=/^(?:parents|prev(?:Until|All))/,Ee={children:!0,contents:!0,next:!0,prev:!0};he.fn.extend({has:function(e){var t=he(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(he.contains(this,t[e]))return!0})},closest:function(e,t){var n,o=0,r=this.length,i=[],l=\"string\"!=typeof e&&he(e);if(!ye.test(e))for(;o<r;o++)for(n=this[o];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(l?l.index(n)>-1:1===n.nodeType&&he.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?he.uniqueSort(i):i)},index:function(e){return e?\"string\"==typeof e?re.call(he(e),this[0]):re.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(he.uniqueSort(he.merge(this.get(),he(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),he.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ve(e,\"parentNode\")},parentsUntil:function(e,t,n){return ve(e,\"parentNode\",n)},next:function(e){return s(e,\"nextSibling\")},prev:function(e){return s(e,\"previousSibling\")},nextAll:function(e){return ve(e,\"nextSibling\")},prevAll:function(e){return ve(e,\"previousSibling\")},nextUntil:function(e,t,n){return ve(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return ve(e,\"previousSibling\",n)},siblings:function(e){return we((e.parentNode||{}).firstChild,e)},children:function(e){return we(e.firstChild)},contents:function(e){return i(e,\"iframe\")?e.contentDocument:(i(e,\"template\")&&(e=e.content||e),he.merge([],e.childNodes))}},function(e,t){he.fn[e]=function(n,o){var r=he.map(this,t,n);return\"Until\"!==e.slice(-5)&&(o=n),o&&\"string\"==typeof o&&(r=he.filter(o,r)),this.length>1&&(Ee[e]||he.uniqueSort(r),Se.test(e)&&r.reverse()),this.pushStack(r)}});var ke=/[^\\x20\\t\\r\\n\\f]+/g;he.Callbacks=function(e){e=\"string\"==typeof e?function(e){var t={};return he.each(e.match(ke)||[],function(e,n){t[n]=!0}),t}(e):he.extend({},e);var t,n,r,i,l=[],s=[],a=-1,c=function(){for(i=i||e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<l.length;)!1===l[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=l.length,n=!1);e.memory||(n=!1),t=!1,i&&(l=n?[]:\"\")},u={add:function(){return l&&(n&&!t&&(a=l.length-1,s.push(n)),function t(n){he.each(n,function(n,r){de(r)?e.unique&&u.has(r)||l.push(r):r&&r.length&&\"string\"!==o(r)&&t(r)})}(arguments),n&&!t&&c()),this},remove:function(){return he.each(arguments,function(e,t){for(var n;(n=he.inArray(t,l,n))>-1;)l.splice(n,1),n<=a&&a--}),this},has:function(e){return e?he.inArray(e,l)>-1:l.length>0},empty:function(){return l&&(l=[]),this},disable:function(){return i=s=[],l=n=\"\",this},disabled:function(){return!l},lock:function(){return i=s=[],n||t||(l=n=\"\"),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},he.extend({Deferred:function(t){var n=[[\"notify\",\"progress\",he.Callbacks(\"memory\"),he.Callbacks(\"memory\"),2],[\"resolve\",\"done\",he.Callbacks(\"once memory\"),he.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",he.Callbacks(\"once memory\"),he.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 he.Deferred(function(t){he.each(n,function(n,o){var r=de(e[o[4]])&&e[o[4]];i[o[1]](function(){var e=r&&r.apply(this,arguments);e&&de(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 s=this,u=arguments,d=function(){var e,d;if(!(t<l)){if((e=o.apply(s,u))===n.promise())throw new TypeError(\"Thenable self-resolution\");d=e&&(\"object\"==typeof e||\"function\"==typeof e)&&e.then,de(d)?r?d.call(e,i(l,n,a,r),i(l,n,c,r)):(l++,d.call(e,i(l,n,a,r),i(l,n,c,r),i(l,n,a,n.notifyWith))):(o!==a&&(s=void 0,u=[e]),(r||n.resolveWith)(s,u))}},p=r?d:function(){try{d()}catch(e){he.Deferred.exceptionHook&&he.Deferred.exceptionHook(e,p.stackTrace),t+1>=l&&(o!==c&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?p():(he.Deferred.getStackHook&&(p.stackTrace=he.Deferred.getStackHook()),e.setTimeout(p))}}var l=0;return he.Deferred(function(e){n[0][3].add(i(0,e,de(r)?r:a,e.notifyWith)),n[1][3].add(i(0,e,de(t)?t:a)),n[2][3].add(i(0,e,de(o)?o:c))}).promise()},promise:function(e){return null!=e?he.extend(e,r):r}},i={};return he.each(n,function(e,t){var l=t[2],s=t[5];r[t[1]]=l.add,s&&l.add(function(){o=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].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=te.call(arguments),i=he.Deferred(),l=function(e){return function(n){o[e]=this,r[e]=arguments.length>1?te.call(arguments):n,--t||i.resolveWith(o,r)}};if(t<=1&&(u(e,i.done(l(n)).resolve,i.reject,!t),\"pending\"===i.state()||de(r[n]&&r[n].then)))return i.then();for(;n--;)u(r[n],l(n),i.reject);return i.promise()}});var Te=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;he.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Te.test(t.name)&&e.console.warn(\"jQuery.Deferred exception: \"+t.message,t.stack,n)},he.readyException=function(t){e.setTimeout(function(){throw t})};var Pe=he.Deferred();he.fn.ready=function(e){return Pe.then(e).catch(function(e){he.readyException(e)}),this},he.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--he.readyWait:he.isReady)||(he.isReady=!0,!0!==e&&--he.readyWait>0||Pe.resolveWith(Z,[he]))}}),he.ready.then=Pe.then,\"complete\"===Z.readyState||\"loading\"!==Z.readyState&&!Z.documentElement.doScroll?e.setTimeout(he.ready):(Z.addEventListener(\"DOMContentLoaded\",d),e.addEventListener(\"load\",d));var De=function(e,t,n,r,i,l,s){var a=0,c=e.length,u=null==n;if(\"object\"===o(n)){i=!0;for(a in n)De(e,t,a,n[a],!0,l,s)}else if(void 0!==r&&(i=!0,de(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(he(e),n)})),t))for(;a<c;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:u?t.call(e):c?t(e[0],n):l},Ne=/^-ms-/,Ae=/-([a-z])/g,$e=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};h.uid=1,h.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$e(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var o,r=this.cache(e);if(\"string\"==typeof t)r[f(t)]=n;else for(o in t)r[f(o)]=t[o];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][f(t)]},access:function(e,t,n){return void 0===t||t&&\"string\"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,o=e[this.expando];if(void 0!==o){if(void 0!==t){t=Array.isArray(t)?t.map(f):(t=f(t))in o?[t]:t.match(ke)||[],n=t.length;for(;n--;)delete o[t[n]]}(void 0===t||he.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!he.isEmptyObject(t)}};var He=new h,Le=new h,_e=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,Ie=/[A-Z]/g;he.extend({hasData:function(e){return Le.hasData(e)||He.hasData(e)},data:function(e,t,n){return Le.access(e,t,n)},removeData:function(e,t){Le.remove(e,t)},_data:function(e,t,n){return He.access(e,t,n)},_removeData:function(e,t){He.remove(e,t)}}),he.fn.extend({data:function(e,t){var n,o,r,i=this[0],l=i&&i.attributes;if(void 0===e){if(this.length&&(r=Le.get(i),1===i.nodeType&&!He.get(i,\"hasDataAttrs\"))){for(n=l.length;n--;)l[n]&&0===(o=l[n].name).indexOf(\"data-\")&&(o=f(o.slice(5)),g(i,o,r[o]));He.set(i,\"hasDataAttrs\",!0)}return r}return\"object\"==typeof e?this.each(function(){Le.set(this,e)}):De(this,function(t){var n;if(i&&void 0===t){if(void 0!==(n=Le.get(i,e)))return n;if(void 0!==(n=g(i,e)))return n}else this.each(function(){Le.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Le.remove(this,e)})}}),he.extend({queue:function(e,t,n){var o;if(e)return t=(t||\"fx\")+\"queue\",o=He.get(e,t),n&&(!o||Array.isArray(n)?o=He.access(e,t,he.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||\"fx\";var n=he.queue(e,t),o=n.length,r=n.shift(),i=he._queueHooks(e,t),l=function(){he.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 He.get(e,n)||He.access(e,n,{empty:he.Callbacks(\"once memory\").add(function(){He.remove(e,[t+\"queue\",n])})})}}),he.fn.extend({queue:function(e,t){var n=2;return\"string\"!=typeof e&&(t=e,e=\"fx\",n--),arguments.length<n?he.queue(this[0],e):void 0===t?this:this.each(function(){var n=he.queue(this,e,t);he._queueHooks(this,e),\"fx\"===e&&\"inprogress\"!==n[0]&&he.dequeue(this,e)})},dequeue:function(e){return this.each(function(){he.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,t){var n,o=1,r=he.Deferred(),i=this,l=this.length,s=function(){--o||r.resolveWith(i,[i])};for(\"string\"!=typeof e&&(t=e,e=void 0),e=e||\"fx\";l--;)(n=He.get(i[l],e+\"queueHooks\"))&&n.empty&&(o++,n.empty.add(s));return s(),r.promise(t)}});var Me=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,Fe=new RegExp(\"^(?:([+-])=|)(\"+Me+\")([a-z%]*)$\",\"i\"),We=[\"Top\",\"Right\",\"Bottom\",\"Left\"],je=function(e,t){return\"none\"===(e=t||e).style.display||\"\"===e.style.display&&he.contains(e.ownerDocument,e)&&\"none\"===he.css(e,\"display\")},Ve=function(e,t,n,o){var r,i,l={};for(i in t)l[i]=e.style[i],e.style[i]=t[i];r=n.apply(e,o||[]);for(i in t)e.style[i]=l[i];return r},Be={};he.fn.extend({show:function(){return w(this,!0)},hide:function(){return w(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){je(this)?he(this).show():he(this).hide()})}});var qe=/^(?:checkbox|radio)$/i,Oe=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]+)/i,ze=/^$|^module$|\\/(?:java|ecma)script/i,Xe={option:[1,\"<select multiple='multiple'>\",\"</select>\"],thead:[1,\"<table>\",\"</table>\"],col:[2,\"<table><colgroup>\",\"</colgroup></table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:[0,\"\",\"\"]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\\w+;/;!function(){var e=Z.createDocumentFragment(),t=e.appendChild(Z.createElement(\"div\")),n=Z.createElement(\"input\");n.setAttribute(\"type\",\"radio\"),n.setAttribute(\"checked\",\"checked\"),n.setAttribute(\"name\",\"t\"),t.appendChild(n),ue.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML=\"<textarea>x</textarea>\",ue.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Ke=Z.documentElement,Ge=/^key/,Ye=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Qe=/^([^.]*)(?:\\.(.+)|)/;he.event={global:{},add:function(e,t,n,o,r){var i,l,s,a,c,u,d,p,f,h,g,m=He.get(e);if(m)for(n.handler&&(n=(i=n).handler,r=i.selector),r&&he.find.matchesSelector(Ke,r),n.guid||(n.guid=he.guid++),(a=m.events)||(a=m.events={}),(l=m.handle)||(l=m.handle=function(t){return void 0!==he&&he.event.triggered!==t.type?he.event.dispatch.apply(e,arguments):void 0}),t=(t||\"\").match(ke)||[\"\"],c=t.length;c--;)s=Qe.exec(t[c])||[],f=g=s[1],h=(s[2]||\"\").split(\".\").sort(),f&&(d=he.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=he.event.special[f]||{},u=he.extend({type:f,origType:g,data:o,handler:n,guid:n.guid,selector:r,needsContext:r&&he.expr.match.needsContext.test(r),namespace:h.join(\".\")},i),(p=a[f])||((p=a[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,u),u.handler.guid||(u.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,u):p.push(u),he.event.global[f]=!0)},remove:function(e,t,n,o,r){var i,l,s,a,c,u,d,p,f,h,g,m=He.hasData(e)&&He.get(e);if(m&&(a=m.events)){for(t=(t||\"\").match(ke)||[\"\"],c=t.length;c--;)if(s=Qe.exec(t[c])||[],f=g=s[1],h=(s[2]||\"\").split(\".\").sort(),f){for(d=he.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,p=a[f]||[],s=s[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),l=i=p.length;i--;)u=p[i],!r&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||o&&o!==u.selector&&(\"**\"!==o||!u.selector)||(p.splice(i,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||he.removeEvent(e,f,m.handle),delete a[f])}else for(f in a)he.event.remove(e,f+t[c],n,o,!0);he.isEmptyObject(a)&&He.remove(e,\"handle events\")}},dispatch:function(e){var t,n,o,r,i,l,s=he.event.fix(e),a=new Array(arguments.length),c=(He.get(this,\"events\")||{})[s.type]||[],u=he.event.special[s.type]||{};for(a[0]=s,t=1;t<arguments.length;t++)a[t]=arguments[t];if(s.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,s)){for(l=he.event.handlers.call(this,s,c),t=0;(r=l[t++])&&!s.isPropagationStopped();)for(s.currentTarget=r.elem,n=0;(i=r.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(o=((he.event.special[i.origType]||{}).handle||i.handler).apply(r.elem,a))&&!1===(s.result=o)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,o,r,i,l,s=[],a=t.delegateCount,c=e.target;if(a&&c.nodeType&&!(\"click\"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&(\"click\"!==e.type||!0!==c.disabled)){for(i=[],l={},n=0;n<a;n++)o=t[n],r=o.selector+\" \",void 0===l[r]&&(l[r]=o.needsContext?he(r,this).index(c)>-1:he.find(r,this,null,[c]).length),l[r]&&i.push(o);i.length&&s.push({elem:c,handlers:i})}return c=this,a<t.length&&s.push({elem:c,handlers:t.slice(a)}),s},addProp:function(e,t){Object.defineProperty(he.Event.prototype,e,{enumerable:!0,configurable:!0,get:de(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[he.expando]?e:new he.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==S()&&this.focus)return this.focus(),!1},delegateType:\"focusin\"},blur:{trigger:function(){if(this===S()&&this.blur)return this.blur(),!1},delegateType:\"focusout\"},click:{trigger:function(){if(\"checkbox\"===this.type&&this.click&&i(this,\"input\"))return this.click(),!1},_default:function(e){return i(e.target,\"a\")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},he.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},he.Event=function(e,t){if(!(this instanceof he.Event))return new he.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?x:R,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&he.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[he.expando]=!0},he.Event.prototype={constructor:he.Event,isDefaultPrevented:R,isPropagationStopped:R,isImmediatePropagationStopped:R,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=x,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=x,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=x,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},he.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Ge.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ye.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},he.event.addProp),he.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(e,t){he.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,o=e.relatedTarget,r=e.handleObj;return o&&(o===this||he.contains(this,o))||(e.type=r.origType,n=r.handler.apply(this,arguments),e.type=t),n}}}),he.fn.extend({on:function(e,t,n,o){return E(this,e,t,n,o)},one:function(e,t,n,o){return E(this,e,t,n,o,1)},off:function(e,t,n){var o,r;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,he(e.delegateTarget).off(o.namespace?o.origType+\".\"+o.namespace:o.origType,o.selector,o.handler),this;if(\"object\"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&\"function\"!=typeof t||(n=t,t=void 0),!1===n&&(n=R),this.each(function(){he.event.remove(this,e,n,t)})}});var Je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,Ze=/<script|<style|<link/i,et=/checked\\s*(?:[^=]|=\\s*.checked.)/i,tt=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;he.extend({htmlPrefilter:function(e){return e.replace(Je,\"<$1></$2>\")},clone:function(e,t,n){var o,r,i,l,s=e.cloneNode(!0),a=he.contains(e.ownerDocument,e);if(!(ue.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||he.isXMLDoc(e)))for(l=y(s),i=y(e),o=0,r=i.length;o<r;o++)N(i[o],l[o]);if(t)if(n)for(i=i||y(e),l=l||y(s),o=0,r=i.length;o<r;o++)D(i[o],l[o]);else D(e,s);return(l=y(s,\"script\")).length>0&&C(l,!a&&y(e,\"script\")),s},cleanData:function(e){for(var t,n,o,r=he.event.special,i=0;void 0!==(n=e[i]);i++)if($e(n)){if(t=n[He.expando]){if(t.events)for(o in t.events)r[o]?he.event.remove(n,o):he.removeEvent(n,o,t.handle);n[He.expando]=void 0}n[Le.expando]&&(n[Le.expando]=void 0)}}}),he.fn.extend({detach:function(e){return $(this,e,!0)},remove:function(e){return $(this,e)},text:function(e){return De(this,function(e){return void 0===e?he.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 A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.appendChild(e)}})},prepend:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return A(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&&(he.cleanData(y(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return he.clone(this,e,t)})},html:function(e){return De(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&&!Ze.test(e)&&!Xe[(Oe.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=he.htmlPrefilter(e);try{for(;n<o;n++)1===(t=this[n]||{}).nodeType&&(he.cleanData(y(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return A(this,arguments,function(t){var n=this.parentNode;he.inArray(this,e)<0&&(he.cleanData(y(this)),n&&n.replaceChild(t,this))},e)}}),he.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,t){he.fn[e]=function(e){for(var n,o=[],r=he(e),i=r.length-1,l=0;l<=i;l++)n=l===i?this:this.clone(!0),he(r[l])[t](n),oe.apply(o,n.get());return this.pushStack(o)}});var nt=new RegExp(\"^(\"+Me+\")(?!px)[a-z%]+$\",\"i\"),ot=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},rt=new RegExp(We.join(\"|\"),\"i\");!function(){function t(){if(c){a.style.cssText=\"position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0\",c.style.cssText=\"position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%\",Ke.appendChild(a).appendChild(c);var t=e.getComputedStyle(c);o=\"1%\"!==t.top,s=12===n(t.marginLeft),c.style.right=\"60%\",l=36===n(t.right),r=36===n(t.width),c.style.position=\"absolute\",i=36===c.offsetWidth||\"absolute\",Ke.removeChild(a),c=null}}function n(e){return Math.round(parseFloat(e))}var o,r,i,l,s,a=Z.createElement(\"div\"),c=Z.createElement(\"div\");c.style&&(c.style.backgroundClip=\"content-box\",c.cloneNode(!0).style.backgroundClip=\"\",ue.clearCloneStyle=\"content-box\"===c.style.backgroundClip,he.extend(ue,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),l},pixelPosition:function(){return t(),o},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i}}))}();var it=/^(none|table(?!-c[ea]).+)/,lt=/^--/,st={position:\"absolute\",visibility:\"hidden\",display:\"block\"},at={letterSpacing:\"0\",fontWeight:\"400\"},ct=[\"Webkit\",\"Moz\",\"ms\"],ut=Z.createElement(\"div\").style;he.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=H(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,i,l,s=f(t),a=lt.test(t),c=e.style;if(a||(t=_(s)),l=he.cssHooks[t]||he.cssHooks[s],void 0===n)return l&&\"get\"in l&&void 0!==(r=l.get(e,!1,o))?r:c[t];\"string\"==(i=typeof n)&&(r=Fe.exec(n))&&r[1]&&(n=m(e,t,r),i=\"number\"),null!=n&&n==n&&(\"number\"===i&&(n+=r&&r[3]||(he.cssNumber[s]?\"\":\"px\")),ue.clearCloneStyle||\"\"!==n||0!==t.indexOf(\"background\")||(c[t]=\"inherit\"),l&&\"set\"in l&&void 0===(n=l.set(e,n,o))||(a?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,o){var r,i,l,s=f(t),a=lt.test(t);return a||(t=_(s)),(l=he.cssHooks[t]||he.cssHooks[s])&&\"get\"in l&&(r=l.get(e,!0,n)),void 0===r&&(r=H(e,t,o)),\"normal\"===r&&t in at&&(r=at[t]),\"\"===n||n?(i=parseFloat(r),!0===n||isFinite(i)?i||0:r):r}}),he.each([\"height\",\"width\"],function(e,t){he.cssHooks[t]={get:function(e,n,o){if(n)return!it.test(he.css(e,\"display\"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,o):Ve(e,st,function(){return F(e,t,o)})},set:function(e,n,o){var r,i=ot(e),l=\"border-box\"===he.css(e,\"boxSizing\",!1,i),s=o&&M(e,t,o,l,i);return l&&ue.scrollboxSize()===i.position&&(s-=Math.ceil(e[\"offset\"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-M(e,t,\"border\",!1,i)-.5)),s&&(r=Fe.exec(n))&&\"px\"!==(r[3]||\"px\")&&(e.style[t]=n,n=he.css(e,t)),I(e,n,s)}}}),he.cssHooks.marginLeft=L(ue.reliableMarginLeft,function(e,t){if(t)return(parseFloat(H(e,\"marginLeft\"))||e.getBoundingClientRect().left-Ve(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+\"px\"}),he.each({margin:\"\",padding:\"\",border:\"Width\"},function(e,t){he.cssHooks[e+t]={expand:function(n){for(var o=0,r={},i=\"string\"==typeof n?n.split(\" \"):[n];o<4;o++)r[e+We[o]+t]=i[o]||i[o-2]||i[0];return r}},\"margin\"!==e&&(he.cssHooks[e+t].set=I)}),he.fn.extend({css:function(e,t){return De(this,function(e,t,n){var o,r,i={},l=0;if(Array.isArray(t)){for(o=ot(e),r=t.length;l<r;l++)i[t[l]]=he.css(e,t[l],!1,o);return i}return void 0!==n?he.style(e,t,n):he.css(e,t)},e,t,arguments.length>1)}}),he.Tween=W,(W.prototype={constructor:W,init:function(e,t,n,o,r,i){this.elem=e,this.prop=n,this.easing=r||he.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=i||(he.cssNumber[n]?\"\":\"px\")},cur:function(){var e=W.propHooks[this.prop];return e&&e.get?e.get(this):W.propHooks._default.get(this)},run:function(e){var t,n=W.propHooks[this.prop];return this.options.duration?this.pos=t=he.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):W.propHooks._default.set(this),this}}).init.prototype=W.prototype,(W.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=he.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){he.fx.step[e.prop]?he.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[he.cssProps[e.prop]]&&!he.cssHooks[e.prop]?e.elem[e.prop]=e.now:he.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=W.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},he.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},he.fx=W.prototype.init,he.fx.step={};var dt,pt,ft=/^(?:toggle|show|hide)$/,ht=/queueHooks$/;he.Animation=he.extend(O,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return m(n.elem,e,Fe.exec(t),n),n}]},tweener:function(e,t){de(e)?(t=e,e=[\"*\"]):e=e.match(ke);for(var n,o=0,r=e.length;o<r;o++)n=e[o],O.tweeners[n]=O.tweeners[n]||[],O.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var o,r,i,l,s,a,c,u,d=\"width\"in t||\"height\"in t,p=this,f={},h=e.style,g=e.nodeType&&je(e),m=He.get(e,\"fxshow\");n.queue||(null==(l=he._queueHooks(e,\"fx\")).unqueued&&(l.unqueued=0,s=l.empty.fire,l.empty.fire=function(){l.unqueued||s()}),l.unqueued++,p.always(function(){p.always(function(){l.unqueued--,he.queue(e,\"fx\").length||l.empty.fire()})}));for(o in t)if(r=t[o],ft.test(r)){if(delete t[o],i=i||\"toggle\"===r,r===(g?\"hide\":\"show\")){if(\"show\"!==r||!m||void 0===m[o])continue;g=!0}f[o]=m&&m[o]||he.style(e,o)}if(!(a=!he.isEmptyObject(t))&&he.isEmptyObject(f))return;d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=m&&m.display)&&(c=He.get(e,\"display\")),\"none\"===(u=he.css(e,\"display\"))&&(c?u=c:(w([e],!0),c=e.style.display||c,u=he.css(e,\"display\"),w([e]))),(\"inline\"===u||\"inline-block\"===u&&null!=c)&&\"none\"===he.css(e,\"float\")&&(a||(p.done(function(){h.display=c}),null==c&&(u=h.display,c=\"none\"===u?\"\":u)),h.display=\"inline-block\"));n.overflow&&(h.overflow=\"hidden\",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));a=!1;for(o in f)a||(m?\"hidden\"in m&&(g=m.hidden):m=He.access(e,\"fxshow\",{display:c}),i&&(m.hidden=!g),g&&w([e],!0),p.done(function(){g||w([e]),He.remove(e,\"fxshow\");for(o in f)he.style(e,o,f[o])})),a=q(g?m[o]:0,o,p),o in m||(m[o]=a.start,g&&(a.end=a.start,a.start=0))}],prefilter:function(e,t){t?O.prefilters.unshift(e):O.prefilters.push(e)}}),he.speed=function(e,t,n){var o=e&&\"object\"==typeof e?he.extend({},e):{complete:n||!n&&t||de(e)&&e,duration:e,easing:n&&t||t&&!de(t)&&t};return he.fx.off?o.duration=0:\"number\"!=typeof o.duration&&(o.duration in he.fx.speeds?o.duration=he.fx.speeds[o.duration]:o.duration=he.fx.speeds._default),null!=o.queue&&!0!==o.queue||(o.queue=\"fx\"),o.old=o.complete,o.complete=function(){de(o.old)&&o.old.call(this),o.queue&&he.dequeue(this,o.queue)},o},he.fn.extend({fadeTo:function(e,t,n,o){return this.filter(je).css(\"opacity\",0).show().end().animate({opacity:t},e,n,o)},animate:function(e,t,n,o){var r=he.isEmptyObject(e),i=he.speed(t,n,o),l=function(){var t=O(this,he.extend({},e),i);(r||He.get(this,\"finish\"))&&t.stop(!0)};return l.finish=l,r||!1===i.queue?this.each(l):this.queue(i.queue,l)},stop:function(e,t,n){var o=function(e){var t=e.stop;delete e.stop,t(n)};return\"string\"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||\"fx\",[]),this.each(function(){var t=!0,r=null!=e&&e+\"queueHooks\",i=he.timers,l=He.get(this);if(r)l[r]&&l[r].stop&&o(l[r]);else for(r in l)l[r]&&l[r].stop&&ht.test(r)&&o(l[r]);for(r=i.length;r--;)i[r].elem!==this||null!=e&&i[r].queue!==e||(i[r].anim.stop(n),t=!1,i.splice(r,1));!t&&n||he.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||\"fx\"),this.each(function(){var t,n=He.get(this),o=n[e+\"queue\"],r=n[e+\"queueHooks\"],i=he.timers,l=o?o.length:0;for(n.finish=!0,he.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<l;t++)o[t]&&o[t].finish&&o[t].finish.call(this);delete n.finish})}}),he.each([\"toggle\",\"show\",\"hide\"],function(e,t){var n=he.fn[t];he.fn[t]=function(e,o,r){return null==e||\"boolean\"==typeof e?n.apply(this,arguments):this.animate(B(t,!0),e,o,r)}}),he.each({slideDown:B(\"show\"),slideUp:B(\"hide\"),slideToggle:B(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,t){he.fn[e]=function(e,n,o){return this.animate(t,e,n,o)}}),he.timers=[],he.fx.tick=function(){var e,t=0,n=he.timers;for(dt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||he.fx.stop(),dt=void 0},he.fx.timer=function(e){he.timers.push(e),he.fx.start()},he.fx.interval=13,he.fx.start=function(){pt||(pt=!0,j())},he.fx.stop=function(){pt=null},he.fx.speeds={slow:600,fast:200,_default:400},he.fn.delay=function(t,n){return t=he.fx?he.fx.speeds[t]||t:t,n=n||\"fx\",this.queue(n,function(n,o){var r=e.setTimeout(n,t);o.stop=function(){e.clearTimeout(r)}})},function(){var e=Z.createElement(\"input\"),t=Z.createElement(\"select\"),n=t.appendChild(Z.createElement(\"option\"));e.type=\"checkbox\",ue.checkOn=\"\"!==e.value,ue.optSelected=n.selected,(e=Z.createElement(\"input\")).value=\"t\",e.type=\"radio\",ue.radioValue=\"t\"===e.value}();var gt,mt=he.expr.attrHandle;he.fn.extend({attr:function(e,t){return De(this,he.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){he.removeAttr(this,e)})}}),he.extend({attr:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?he.prop(e,t,n):(1===i&&he.isXMLDoc(e)||(r=he.attrHooks[t.toLowerCase()]||(he.expr.match.bool.test(t)?gt:void 0)),void 0!==n?null===n?void he.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=he.find.attr(e,t))?void 0:o)},attrHooks:{type:{set:function(e,t){if(!ue.radioValue&&\"radio\"===t&&i(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(ke);if(r&&1===e.nodeType)for(;n=r[o++];)e.removeAttribute(n)}}),gt={set:function(e,t,n){return!1===t?he.removeAttr(e,n):e.setAttribute(n,n),n}},he.each(he.expr.match.bool.source.match(/\\w+/g),function(e,t){var n=mt[t]||he.find.attr;mt[t]=function(e,t,o){var r,i,l=t.toLowerCase();return o||(i=mt[l],mt[l]=r,r=null!=n(e,t,o)?l:null,mt[l]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;he.fn.extend({prop:function(e,t){return De(this,he.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[he.propFix[e]||e]})}}),he.extend({prop:function(e,t,n){var o,r,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&he.isXMLDoc(e)||(t=he.propFix[t]||t,r=he.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=he.find.attr(e,\"tabindex\");return t?parseInt(t,10):vt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:\"htmlFor\",class:\"className\"}}),ue.optSelected||(he.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)}}),he.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){he.propFix[this.toLowerCase()]=this}),he.fn.extend({addClass:function(e){var t,n,o,r,i,l,s,a=0;if(de(e))return this.each(function(t){he(this).addClass(e.call(this,t,X(this)))});if((t=U(e)).length)for(;n=this[a++];)if(r=X(n),o=1===n.nodeType&&\" \"+z(r)+\" \"){for(l=0;i=t[l++];)o.indexOf(\" \"+i+\" \")<0&&(o+=i+\" \");s=z(o),r!==s&&n.setAttribute(\"class\",s)}return this},removeClass:function(e){var t,n,o,r,i,l,s,a=0;if(de(e))return this.each(function(t){he(this).removeClass(e.call(this,t,X(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if((t=U(e)).length)for(;n=this[a++];)if(r=X(n),o=1===n.nodeType&&\" \"+z(r)+\" \"){for(l=0;i=t[l++];)for(;o.indexOf(\" \"+i+\" \")>-1;)o=o.replace(\" \"+i+\" \",\" \");s=z(o),r!==s&&n.setAttribute(\"class\",s)}return this},toggleClass:function(e,t){var n=typeof e,o=\"string\"===n||Array.isArray(e);return\"boolean\"==typeof t&&o?t?this.addClass(e):this.removeClass(e):de(e)?this.each(function(n){he(this).toggleClass(e.call(this,n,X(this),t),t)}):this.each(function(){var t,r,i,l;if(o)for(r=0,i=he(this),l=U(e);t=l[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&\"boolean\"!==n||((t=X(this))&&He.set(this,\"__className__\",t),this.setAttribute&&this.setAttribute(\"class\",t||!1===e?\"\":He.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,o=0;for(t=\" \"+e+\" \";n=this[o++];)if(1===n.nodeType&&(\" \"+z(X(n))+\" \").indexOf(t)>-1)return!0;return!1}});var yt=/\\r/g;he.fn.extend({val:function(e){var t,n,o,r=this[0];if(arguments.length)return o=de(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=o?e.call(this,n,he(this).val()):e)?r=\"\":\"number\"==typeof r?r+=\"\":Array.isArray(r)&&(r=he.map(r,function(e){return null==e?\"\":e+\"\"})),(t=he.valHooks[this.type]||he.valHooks[this.nodeName.toLowerCase()])&&\"set\"in t&&void 0!==t.set(this,r,\"value\")||(this.value=r))});if(r)return(t=he.valHooks[r.type]||he.valHooks[r.nodeName.toLowerCase()])&&\"get\"in t&&void 0!==(n=t.get(r,\"value\"))?n:\"string\"==typeof(n=r.value)?n.replace(yt,\"\"):null==n?\"\":n}}),he.extend({valHooks:{option:{get:function(e){var t=he.find.attr(e,\"value\");return null!=t?t:z(he.text(e))}},select:{get:function(e){var t,n,o,r=e.options,l=e.selectedIndex,s=\"select-one\"===e.type,a=s?null:[],c=s?l+1:r.length;for(o=l<0?c:s?l:0;o<c;o++)if(((n=r[o]).selected||o===l)&&!n.disabled&&(!n.parentNode.disabled||!i(n.parentNode,\"optgroup\"))){if(t=he(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,o,r=e.options,i=he.makeArray(t),l=r.length;l--;)((o=r[l]).selected=he.inArray(he.valHooks.option.get(o),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),he.each([\"radio\",\"checkbox\"],function(){he.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=he.inArray(he(e).val(),t)>-1}},ue.checkOn||(he.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})}),ue.focusin=\"onfocusin\"in e;var Ct=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};he.extend(he.event,{trigger:function(t,n,o,r){var i,l,s,a,c,u,d,p,f=[o||Z],h=se.call(t,\"type\")?t.type:t,g=se.call(t,\"namespace\")?t.namespace.split(\".\"):[];if(l=p=s=o=o||Z,3!==o.nodeType&&8!==o.nodeType&&!Ct.test(h+he.event.triggered)&&(h.indexOf(\".\")>-1&&(g=h.split(\".\"),h=g.shift(),g.sort()),c=h.indexOf(\":\")<0&&\"on\"+h,t=t[he.expando]?t:new he.Event(h,\"object\"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=g.join(\".\"),t.rnamespace=t.namespace?new RegExp(\"(^|\\\\.)\"+g.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:he.makeArray(n,[t]),d=he.event.special[h]||{},r||!d.trigger||!1!==d.trigger.apply(o,n))){if(!r&&!d.noBubble&&!pe(o)){for(a=d.delegateType||h,Ct.test(a+h)||(l=l.parentNode);l;l=l.parentNode)f.push(l),s=l;s===(o.ownerDocument||Z)&&f.push(s.defaultView||s.parentWindow||e)}for(i=0;(l=f[i++])&&!t.isPropagationStopped();)p=l,t.type=i>1?a:d.bindType||h,(u=(He.get(l,\"events\")||{})[t.type]&&He.get(l,\"handle\"))&&u.apply(l,n),(u=c&&l[c])&&u.apply&&$e(l)&&(t.result=u.apply(l,n),!1===t.result&&t.preventDefault());return t.type=h,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),n)||!$e(o)||c&&de(o[h])&&!pe(o)&&((s=o[c])&&(o[c]=null),he.event.triggered=h,t.isPropagationStopped()&&p.addEventListener(h,bt),o[h](),t.isPropagationStopped()&&p.removeEventListener(h,bt),he.event.triggered=void 0,s&&(o[c]=s)),t.result}},simulate:function(e,t,n){var o=he.extend(new he.Event,n,{type:e,isSimulated:!0});he.event.trigger(o,null,t)}}),he.fn.extend({trigger:function(e,t){return this.each(function(){he.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return he.event.trigger(e,t,n,!0)}}),ue.focusin||he.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){var n=function(e){he.event.simulate(t,e.target,he.event.fix(e))};he.event.special[t]={setup:function(){var o=this.ownerDocument||this,r=He.access(o,t);r||o.addEventListener(e,n,!0),He.access(o,t,(r||0)+1)},teardown:function(){var o=this.ownerDocument||this,r=He.access(o,t)-1;r?He.access(o,t,r):(o.removeEventListener(e,n,!0),He.remove(o,t))}}});var xt=e.location,Rt=Date.now(),St=/\\?/;he.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||he.error(\"Invalid XML: \"+t),n};var Et=/\\[\\]$/,kt=/\\r?\\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;he.param=function(e,t){var n,o=[],r=function(e,t){var n=de(t)?t():t;o[o.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(Array.isArray(e)||e.jquery&&!he.isPlainObject(e))he.each(e,function(){r(this.name,this.value)});else for(n in e)K(n,e[n],t,r);return o.join(\"&\")},he.fn.extend({serialize:function(){return he.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=he.prop(this,\"elements\");return e?he.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!he(this).is(\":disabled\")&&Pt.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!qe.test(e))}).map(function(e,t){var n=he(this).val();return null==n?null:Array.isArray(n)?he.map(n,function(e){return{name:t.name,value:e.replace(kt,\"\\r\\n\")}}):{name:t.name,value:n.replace(kt,\"\\r\\n\")}}).get()}});var Dt=/%20/g,Nt=/#.*$/,At=/([?&])_=[^&]*/,$t=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,Lt=/^\\/\\//,_t={},It={},Mt=\"*/\".concat(\"*\"),Ft=Z.createElement(\"a\");Ft.href=xt.href,he.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":Mt,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\":he.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Q(Q(e,he.ajaxSettings),t):Q(he.ajaxSettings,e)},ajaxPrefilter:G(_t),ajaxTransport:G(It),ajax:function(t,n){function o(t,n,o,s){var c,p,f,C,b,x=n;u||(u=!0,a&&e.clearTimeout(a),r=void 0,l=s||\"\",R.readyState=t>0?4:0,c=t>=200&&t<300||304===t,o&&(C=function(e,t,n){var o,r,i,l,s=e.contents,a=e.dataTypes;for(;\"*\"===a[0];)a.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(o)for(r in s)if(s[r]&&s[r].test(o)){a.unshift(r);break}if(a[0]in n)i=a[0];else{for(r in n){if(!a[0]||e.converters[r+\" \"+a[0]]){i=r;break}l||(l=r)}i=i||l}if(i)return i!==a[0]&&a.unshift(i),n[i]}(h,R,o)),C=function(e,t,n,o){var r,i,l,s,a,c={},u=e.dataTypes.slice();if(u[1])for(l in e.converters)c[l.toLowerCase()]=e.converters[l];i=u.shift();for(;i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!a&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=i,i=u.shift())if(\"*\"===i)i=a;else if(\"*\"!==a&&a!==i){if(!(l=c[a+\" \"+i]||c[\"* \"+i]))for(r in c)if((s=r.split(\" \"))[1]===i&&(l=c[a+\" \"+s[0]]||c[\"* \"+s[0]])){!0===l?l=c[r]:!0!==c[r]&&(i=s[0],u.unshift(s[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 \"+a+\" to \"+i}}}return{state:\"success\",data:t}}(h,C,R,c),c?(h.ifModified&&((b=R.getResponseHeader(\"Last-Modified\"))&&(he.lastModified[i]=b),(b=R.getResponseHeader(\"etag\"))&&(he.etag[i]=b)),204===t||\"HEAD\"===h.type?x=\"nocontent\":304===t?x=\"notmodified\":(x=C.state,p=C.data,f=C.error,c=!f)):(f=x,!t&&x||(x=\"error\",t<0&&(t=0))),R.status=t,R.statusText=(n||x)+\"\",c?v.resolveWith(g,[p,x,R]):v.rejectWith(g,[R,x,f]),R.statusCode(y),y=void 0,d&&m.trigger(c?\"ajaxSuccess\":\"ajaxError\",[R,h,c?p:f]),w.fireWith(g,[R,x]),d&&(m.trigger(\"ajaxComplete\",[R,h]),--he.active||he.event.trigger(\"ajaxStop\")))}\"object\"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,l,s,a,c,u,d,p,f,h=he.ajaxSetup({},n),g=h.context||h,m=h.context&&(g.nodeType||g.jquery)?he(g):he.event,v=he.Deferred(),w=he.Callbacks(\"once memory\"),y=h.statusCode||{},C={},b={},x=\"canceled\",R={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=$t.exec(l);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return u?l:null},setRequestHeader:function(e,t){return null==u&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,C[e]=t),this},overrideMimeType:function(e){return null==u&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)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||xt.href)+\"\").replace(Lt,xt.protocol+\"//\"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||\"*\").toLowerCase().match(ke)||[\"\"],null==h.crossDomain){c=Z.createElement(\"a\");try{c.href=h.url,c.href=c.href,h.crossDomain=Ft.protocol+\"//\"+Ft.host!=c.protocol+\"//\"+c.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&\"string\"!=typeof h.data&&(h.data=he.param(h.data,h.traditional)),Y(_t,h,n,R),u)return R;(d=he.event&&h.global)&&0==he.active++&&he.event.trigger(\"ajaxStart\"),h.type=h.type.toUpperCase(),h.hasContent=!Ht.test(h.type),i=h.url.replace(Nt,\"\"),h.hasContent?h.data&&h.processData&&0===(h.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(h.data=h.data.replace(Dt,\"+\")):(f=h.url.slice(i.length),h.data&&(h.processData||\"string\"==typeof h.data)&&(i+=(St.test(i)?\"&\":\"?\")+h.data,delete h.data),!1===h.cache&&(i=i.replace(At,\"$1\"),f=(St.test(i)?\"&\":\"?\")+\"_=\"+Rt+++f),h.url=i+f),h.ifModified&&(he.lastModified[i]&&R.setRequestHeader(\"If-Modified-Since\",he.lastModified[i]),he.etag[i]&&R.setRequestHeader(\"If-None-Match\",he.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]?\", \"+Mt+\"; 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)||u))return R.abort();if(x=\"abort\",w.add(h.complete),R.done(h.success),R.fail(h.error),r=Y(It,h,n,R)){if(R.readyState=1,d&&m.trigger(\"ajaxSend\",[R,h]),u)return R;h.async&&h.timeout>0&&(a=e.setTimeout(function(){R.abort(\"timeout\")},h.timeout));try{u=!1,r.send(C,o)}catch(e){if(u)throw e;o(-1,e)}}else o(-1,\"No Transport\");return R},getJSON:function(e,t,n){return he.get(e,t,n,\"json\")},getScript:function(e,t){return he.get(e,void 0,t,\"script\")}}),he.each([\"get\",\"post\"],function(e,t){he[t]=function(e,n,o,r){return de(n)&&(r=r||o,o=n,n=void 0),he.ajax(he.extend({url:e,type:t,dataType:r,data:n,success:o},he.isPlainObject(e)&&e))}}),he._evalUrl=function(e){return he.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,throws:!0})},he.fn.extend({wrapAll:function(e){var t;return this[0]&&(de(e)&&(e=e.call(this[0])),t=he(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 de(e)?this.each(function(t){he(this).wrapInner(e.call(this,t))}):this.each(function(){var t=he(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=de(e);return this.each(function(n){he(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){he(this).replaceWith(this.childNodes)}),this}}),he.expr.pseudos.hidden=function(e){return!he.expr.pseudos.visible(e)},he.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},he.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},jt=he.ajaxSettings.xhr();ue.cors=!!jt&&\"withCredentials\"in jt,ue.ajax=jt=!!jt,he.ajaxTransport(function(t){var n,o;if(ue.cors||jt&&!t.crossDomain)return{send:function(r,i){var l,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(l in t.xhrFields)s[l]=t.xhrFields[l];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r[\"X-Requested-With\"]||(r[\"X-Requested-With\"]=\"XMLHttpRequest\");for(l in r)s.setRequestHeader(l,r[l]);n=function(e){return function(){n&&(n=o=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,\"abort\"===e?s.abort():\"error\"===e?\"number\"!=typeof s.status?i(0,\"error\"):i(s.status,s.statusText):i(Wt[s.status]||s.status,s.statusText,\"text\"!==(s.responseType||\"text\")||\"string\"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),o=s.onerror=s.ontimeout=n(\"error\"),void 0!==s.onabort?s.onabort=o:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&o()})},n=n(\"abort\");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),he.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),he.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 he.globalEval(e),e}}}),he.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),he.ajaxTransport(\"script\",function(e){if(e.crossDomain){var t,n;return{send:function(o,r){t=he(\"<script>\").prop({charset:e.scriptCharset,src:e.url}).on(\"load error\",n=function(e){t.remove(),n=null,e&&r(\"error\"===e.type?404:200,e.type)}),Z.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Vt=[],Bt=/(=)\\?(?=&|$)|\\?\\?/;he.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=Vt.pop()||he.expando+\"_\"+Rt++;return this[e]=!0,e}}),he.ajaxPrefilter(\"json jsonp\",function(t,n,o){var r,i,l,s=!1!==t.jsonp&&(Bt.test(t.url)?\"url\":\"string\"==typeof t.data&&0===(t.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Bt.test(t.data)&&\"data\");if(s||\"jsonp\"===t.dataTypes[0])return r=t.jsonpCallback=de(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Bt,\"$1\"+r):!1!==t.jsonp&&(t.url+=(St.test(t.url)?\"&\":\"?\")+t.jsonp+\"=\"+r),t.converters[\"script json\"]=function(){return l||he.error(r+\" was not called\"),l[0]},t.dataTypes[0]=\"json\",i=e[r],e[r]=function(){l=arguments},o.always(function(){void 0===i?he(e).removeProp(r):e[r]=i,t[r]&&(t.jsonpCallback=n.jsonpCallback,Vt.push(r)),l&&de(i)&&i(l[0]),l=i=void 0}),\"script\"}),ue.createHTMLDocument=function(){var e=Z.implementation.createHTMLDocument(\"\").body;return e.innerHTML=\"<form></form><form></form>\",2===e.childNodes.length}(),he.parseHTML=function(e,t,n){if(\"string\"!=typeof e)return[];\"boolean\"==typeof t&&(n=t,t=!1);var o,r,i;return t||(ue.createHTMLDocument?(t=Z.implementation.createHTMLDocument(\"\"),(o=t.createElement(\"base\")).href=Z.location.href,t.head.appendChild(o)):t=Z),r=Ce.exec(e),i=!n&&[],r?[t.createElement(r[1])]:(r=b([e],t,i),i&&i.length&&he(i).remove(),he.merge([],r.childNodes))},he.fn.load=function(e,t,n){var o,r,i,l=this,s=e.indexOf(\" \");return s>-1&&(o=z(e.slice(s)),e=e.slice(0,s)),de(t)?(n=t,t=void 0):t&&\"object\"==typeof t&&(r=\"POST\"),l.length>0&&he.ajax({url:e,type:r||\"GET\",dataType:\"html\",data:t}).done(function(e){i=arguments,l.html(o?he(\"<div>\").append(he.parseHTML(e)).find(o):e)}).always(n&&function(e,t){l.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},he.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){he.fn[t]=function(e){return this.on(t,e)}}),he.expr.pseudos.animated=function(e){return he.grep(he.timers,function(t){return e===t.elem}).length},he.offset={setOffset:function(e,t,n){var o,r,i,l,s,a,c=he.css(e,\"position\"),u=he(e),d={};\"static\"===c&&(e.style.position=\"relative\"),s=u.offset(),i=he.css(e,\"top\"),a=he.css(e,\"left\"),(\"absolute\"===c||\"fixed\"===c)&&(i+a).indexOf(\"auto\")>-1?(o=u.position(),l=o.top,r=o.left):(l=parseFloat(i)||0,r=parseFloat(a)||0),de(t)&&(t=t.call(e,n,he.extend({},s))),null!=t.top&&(d.top=t.top-s.top+l),null!=t.left&&(d.left=t.left-s.left+r),\"using\"in t?t.using.call(e,d):u.css(d)}},he.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){he.offset.setOffset(this,e,t)});var t,n,o=this[0];if(o)return o.getClientRects().length?(t=o.getBoundingClientRect(),n=o.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,o=this[0],r={top:0,left:0};if(\"fixed\"===he.css(o,\"position\"))t=o.getBoundingClientRect();else{for(t=this.offset(),n=o.ownerDocument,e=o.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&\"static\"===he.css(e,\"position\");)e=e.parentNode;e&&e!==o&&1===e.nodeType&&((r=he(e).offset()).top+=he.css(e,\"borderTopWidth\",!0),r.left+=he.css(e,\"borderLeftWidth\",!0))}return{top:t.top-r.top-he.css(o,\"marginTop\",!0),left:t.left-r.left-he.css(o,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&\"static\"===he.css(e,\"position\");)e=e.offsetParent;return e||Ke})}}),he.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(e,t){var n=\"pageYOffset\"===t;he.fn[e]=function(o){return De(this,function(e,o,r){var i;if(pe(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===r)return i?i[t]:e[o];i?i.scrollTo(n?i.pageXOffset:r,n?r:i.pageYOffset):e[o]=r},e,o,arguments.length)}}),he.each([\"top\",\"left\"],function(e,t){he.cssHooks[t]=L(ue.pixelPosition,function(e,n){if(n)return n=H(e,t),nt.test(n)?he(e).position()[t]+\"px\":n})}),he.each({Height:\"height\",Width:\"width\"},function(e,t){he.each({padding:\"inner\"+e,content:t,\"\":\"outer\"+e},function(n,o){he.fn[o]=function(r,i){var l=arguments.length&&(n||\"boolean\"!=typeof r),s=n||(!0===r||!0===i?\"margin\":\"border\");return De(this,function(t,n,r){var i;return pe(t)?0===o.indexOf(\"outer\")?t[\"inner\"+e]:t.document.documentElement[\"client\"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body[\"scroll\"+e],i[\"scroll\"+e],t.body[\"offset\"+e],i[\"offset\"+e],i[\"client\"+e])):void 0===r?he.css(t,n,s):he.style(t,n,r,s)},t,l?r:void 0,l)}})}),he.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){he.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),he.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),he.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,o){return this.on(t,e,n,o)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)}}),he.proxy=function(e,t){var n,o,r;if(\"string\"==typeof t&&(n=e[t],t=e,e=n),de(e))return o=te.call(arguments,2),r=function(){return e.apply(t||this,o.concat(te.call(arguments)))},r.guid=e.guid=e.guid||he.guid++,r},he.holdReady=function(e){e?he.readyWait++:he.ready(!0)},he.isArray=Array.isArray,he.parseJSON=JSON.parse,he.nodeName=i,he.isFunction=de,he.isWindow=pe,he.camelCase=f,he.type=o,he.now=Date.now,he.isNumeric=function(e){var t=he.type(e);return(\"number\"===t||\"string\"===t)&&!isNaN(e-parseFloat(e))},\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return he});var qt=e.jQuery,Ot=e.$;return he.noConflict=function(t){return e.$===he&&(e.$=Ot),t&&e.jQuery===he&&(e.jQuery=qt),he},t||(e.jQuery=e.$=he),he})},430:/*!\n",
" * jquery.event.drag - v 2.3.0\n",
" * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com\n",
" * Open Source MIT License - http://threedubmedia.com/code/license\n",
" */\n",
" function(e,t,n){var o=e(436);o.fn.drag=function(e,t,n){var r=\"string\"==typeof e?e:\"\",i=o.isFunction(e)?e:o.isFunction(t)?t:null;return 0!==r.indexOf(\"drag\")&&(r=\"drag\"+r),n=(e==i?t:n)||{},i?this.on(r,n,i):this.trigger(r)};var r=o.event,i=r.special,l=i.drag={defaults:{which:1,distance:0,not:\":input\",handle:null,relative:!1,drop:!0,click:!1},datakey:\"dragdata\",noBubble:!0,add:function(e){var t=o.data(this,l.datakey),n=e.data||{};t.related+=1,o.each(l.defaults,function(e,o){void 0!==n[e]&&(t[e]=n[e])})},remove:function(){o.data(this,l.datakey).related-=1},setup:function(){if(!o.data(this,l.datakey)){var e=o.extend({related:0},l.defaults);o.data(this,l.datakey,e),r.add(this,\"touchstart mousedown\",l.init,e),this.attachEvent&&this.attachEvent(\"ondragstart\",l.dontstart)}},teardown:function(){var e=o.data(this,l.datakey)||{};e.related||(o.removeData(this,l.datakey),r.remove(this,\"touchstart mousedown\",l.init),l.textselect(!0),this.detachEvent&&this.detachEvent(\"ondragstart\",l.dontstart))},init:function(e){if(!l.touched){var t,n=e.data;if(!(0!=e.which&&n.which>0&&e.which!=n.which)&&!o(e.target).is(n.not)&&(!n.handle||o(e.target).closest(n.handle,e.currentTarget).length)&&(l.touched=\"touchstart\"==e.type?this:null,n.propagates=1,n.mousedown=this,n.interactions=[l.interaction(this,n)],n.target=e.target,n.pageX=e.pageX,n.pageY=e.pageY,n.dragging=null,t=l.hijack(e,\"draginit\",n),n.propagates))return(t=l.flatten(t))&&t.length&&(n.interactions=[],o.each(t,function(){n.interactions.push(l.interaction(this,n))})),n.propagates=n.interactions.length,!1!==n.drop&&i.drop&&i.drop.handler(e,n),l.textselect(!1),l.touched?r.add(l.touched,\"touchmove touchend\",l.handler,n):r.add(document,\"mousemove mouseup\",l.handler,n),!(!l.touched||n.live)&&void 0}},interaction:function(e,t){var n=e&&e.ownerDocument?o(e)[t.relative?\"position\":\"offset\"]()||{top:0,left:0}:{top:0,left:0};return{drag:e,callback:new l.callback,droppable:[],offset:n}},handler:function(e){var t=e.data;switch(e.type){case!t.dragging&&\"touchmove\":e.preventDefault();case!t.dragging&&\"mousemove\":if(Math.pow(e.pageX-t.pageX,2)+Math.pow(e.pageY-t.pageY,2)<Math.pow(t.distance,2))break;e.target=t.target,l.hijack(e,\"dragstart\",t),t.propagates&&(t.dragging=!0);case\"touchmove\":e.preventDefault();case\"mousemove\":if(t.dragging){if(l.hijack(e,\"drag\",t),t.propagates){!1!==t.drop&&i.drop&&i.drop.handler(e,t);break}e.type=\"mouseup\"}case\"touchend\":case\"mouseup\":default:l.touched?r.remove(l.touched,\"touchmove touchend\",l.handler):r.remove(document,\"mousemove mouseup\",l.handler),t.dragging&&(!1!==t.drop&&i.drop&&i.drop.handler(e,t),l.hijack(e,\"dragend\",t)),l.textselect(!0),!1===t.click&&t.dragging&&o.data(t.mousedown,\"suppress.click\",(new Date).getTime()+5),t.dragging=l.touched=!1}},hijack:function(e,t,n,i,s){if(n){var a,c,u,d={event:e.originalEvent,type:e.type},p=t.indexOf(\"drop\")?\"drag\":\"drop\",f=i||0,h=isNaN(i)?n.interactions.length:i;e.type=t;var g=function(){};e.originalEvent=new o.Event(d.event,{preventDefault:g,stopPropagation:g,stopImmediatePropagation:g}),n.results=[];do{if(c=n.interactions[f]){if(\"dragend\"!==t&&c.cancelled)continue;u=l.properties(e,n,c),c.results=[],o(s||c[p]||n.droppable).each(function(i,s){if(u.target=s,e.isPropagationStopped=function(){return!1},!1===(a=s?r.dispatch.call(s,e,u):null)?(\"drag\"==p&&(c.cancelled=!0,n.propagates-=1),\"drop\"==t&&(c[p][i]=null)):\"dropinit\"==t&&c.droppable.push(l.element(a)||s),\"dragstart\"==t&&(c.proxy=o(l.element(a)||c.drag)[0]),c.results.push(a),delete e.result,\"dropinit\"!==t)return a}),n.results[f]=l.flatten(c.results),\"dropinit\"==t&&(c.droppable=l.flatten(c.droppable)),\"dragstart\"!=t||c.cancelled||u.update()}}while(++f<h);return e.type=d.type,e.originalEvent=d.event,l.flatten(n.results)}},properties:function(e,t,n){var o=n.callback;return o.drag=n.drag,o.proxy=n.proxy||n.drag,o.startX=t.pageX,o.startY=t.pageY,o.deltaX=e.pageX-t.pageX,o.deltaY=e.pageY-t.pageY,o.originalX=n.offset.left,o.originalY=n.offset.top,o.offsetX=o.originalX+o.deltaX,o.offsetY=o.originalY+o.deltaY,o.drop=l.flatten((n.drop||[]).slice()),o.available=l.flatten((n.droppable||[]).slice()),o},element:function(e){if(e&&(e.jquery||1==e.nodeType))return e},flatten:function(e){return o.map(e,function(e){return e&&e.jquery?o.makeArray(e):e&&e.length?l.flatten(e):e})},textselect:function(e){o(document)[e?\"off\":\"on\"](\"selectstart\",l.dontstart).css(\"MozUserSelect\",e?\"\":\"none\"),document.unselectable=e?\"off\":\"on\"},dontstart:function(){return!1},callback:function(){}};l.callback.prototype={update:function(){i.drop&&this.available.length&&o.each(this.available,function(e){i.drop.locate(this,e)})}};var s=r.dispatch;r.dispatch=function(e){if(!(o.data(this,\"suppress.\"+e.type)-(new Date).getTime()>0))return s.apply(this,arguments);o.removeData(this,\"suppress.\"+e.type)},i.draginit=i.dragstart=i.dragend=l},431:/*!\n",
" * jquery.event.drop - v 2.3.0\n",
" * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com\n",
" * Open Source MIT License - http://threedubmedia.com/code/license\n",
" */\n",
" function(e,t,n){var o=e(436);o.fn.drop=function(e,t,n){var r=\"string\"==typeof e?e:\"\",i=o.isFunction(e)?e:o.isFunction(t)?t:null;return 0!==r.indexOf(\"drop\")&&(r=\"drop\"+r),n=(e==i?t:n)||{},i?this.on(r,n,i):this.trigger(r)},o.drop=function(e){e=e||{},l.multi=!0===e.multi?1/0:!1===e.multi?1:isNaN(e.multi)?l.multi:e.multi,l.delay=e.delay||l.delay,l.tolerance=o.isFunction(e.tolerance)?e.tolerance:null===e.tolerance?null:l.tolerance,l.mode=e.mode||l.mode||\"intersect\"};var r=o.event,i=r.special,l=o.event.special.drop={multi:1,delay:20,mode:\"overlap\",targets:[],datakey:\"dropdata\",noBubble:!0,add:function(e){var t=o.data(this,l.datakey);t.related+=1},remove:function(){o.data(this,l.datakey).related-=1},setup:function(){if(!o.data(this,l.datakey)){o.data(this,l.datakey,{related:0,active:[],anyactive:0,winner:0,location:{}}),l.targets.push(this)}},teardown:function(){var e=o.data(this,l.datakey)||{};if(!e.related){o.removeData(this,l.datakey);var t=this;l.targets=o.grep(l.targets,function(e){return e!==t})}},handler:function(e,t){var n;if(t)switch(e.type){case\"mousedown\":case\"touchstart\":n=o(l.targets),\"string\"==typeof t.drop&&(n=n.filter(t.drop)),n.each(function(){var e=o.data(this,l.datakey);e.active=[],e.anyactive=0,e.winner=0}),t.droppable=n,i.drag.hijack(e,\"dropinit\",t);break;case\"mousemove\":case\"touchmove\":l.event=e,l.timer||l.tolerate(t);break;case\"mouseup\":case\"touchend\":l.timer=clearTimeout(l.timer),t.propagates&&(i.drag.hijack(e,\"drop\",t),i.drag.hijack(e,\"dropend\",t))}},locate:function(e,t){var n=o.data(e,l.datakey),r=o(e),i=r.offset()||{},s=r.outerHeight(),a=r.outerWidth(),c={elem:e,width:a,height:s,top:i.top,left:i.left,right:i.left+a,bottom:i.top+s};return n&&(n.location=c,n.index=t,n.elem=e),c},contains:function(e,t){return(t[0]||t.left)>=e.left&&(t[0]||t.right)<=e.right&&(t[1]||t.top)>=e.top&&(t[1]||t.bottom)<=e.bottom},modes:{intersect:function(e,t,n){return this.contains(n,[e.pageX,e.pageY])?1e9:this.modes.overlap.apply(this,arguments)},overlap:function(e,t,n){return Math.max(0,Math.min(n.bottom,t.bottom)-Math.max(n.top,t.top))*Math.max(0,Math.min(n.right,t.right)-Math.max(n.left,t.left))},fit:function(e,t,n){return this.contains(n,t)?1:0},middle:function(e,t,n){return this.contains(n,[t.left+.5*t.width,t.top+.5*t.height])?1:0}},sort:function(e,t){return t.winner-e.winner||e.index-t.index},tolerate:function(e){var t,n,r,s,a,c,u,d,p=0,f=e.interactions.length,h=[l.event.pageX,l.event.pageY],g=l.tolerance||l.modes[l.mode];do{if(d=e.interactions[p]){if(!d)return;d.drop=[],a=[],c=d.droppable.length,g&&(r=l.locate(d.proxy)),t=0;do{if(u=d.droppable[t]){if(s=o.data(u,l.datakey),!(n=s.location))continue;s.winner=g?g.call(l,l.event,r,n):l.contains(n,h)?1:0,a.push(s)}}while(++t<c);a.sort(l.sort),t=0;do{(s=a[t])&&(s.winner&&d.drop.length<l.multi?(s.active[p]||s.anyactive||(!1!==i.drag.hijack(l.event,\"dropstart\",e,p,s.elem)[0]?(s.active[p]=1,s.anyactive+=1):s.winner=0),s.winner&&d.drop.push(s.elem)):s.active[p]&&1==s.anyactive&&(i.drag.hijack(l.event,\"dropend\",e,p,s.elem),s.active[p]=0,s.anyactive-=1))}while(++t<c)}}while(++p<f);l.last&&h[0]==l.last.pageX&&h[1]==l.last.pageY?delete l.timer:l.timer=setTimeout(function(){l.tolerate(e)},l.delay),l.last=l.event}};i.dropinit=i.dropstart=i.dropend=l},432:function(e,t,n){var o=e(436),r=e(434);t.exports={CheckboxSelectColumn:function(e){function t(e,t){var n,o,r=c.getSelectedRows(),i={};for(o=0;o<r.length;o++)n=r[o],i[n]=!0,i[n]!==d[n]&&(c.invalidateRow(n),delete d[n]);for(o in d)c.invalidateRow(o);d=i,c.render(),r.length&&r.length==c.getDataLength()?c.updateColumnHeader(p.columnId,\"<input type='checkbox' checked='checked'>\",p.toolTip):c.updateColumnHeader(p.columnId,\"<input type='checkbox'>\",p.toolTip)}function n(e,t){32==e.which&&c.getColumns()[t.cell].id===p.columnId&&(c.getEditorLock().isActive()&&!c.getEditorLock().commitCurrentEdit()||l(t.row),e.preventDefault(),e.stopImmediatePropagation())}function i(e,t){if(c.getColumns()[t.cell].id===p.columnId&&o(e.target).is(\":checkbox\")){if(c.getEditorLock().isActive()&&!c.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();l(t.row),e.stopPropagation(),e.stopImmediatePropagation()}}function l(e){d[e]?c.setSelectedRows(o.grep(c.getSelectedRows(),function(t){return t!=e})):c.setSelectedRows(c.getSelectedRows().concat(e))}function s(e,t){if(t.column.id==p.columnId&&o(e.target).is(\":checkbox\")){if(c.getEditorLock().isActive()&&!c.getEditorLock().commitCurrentEdit())return e.preventDefault(),void e.stopImmediatePropagation();if(o(e.target).is(\":checked\")){for(var n=[],r=0;r<c.getDataLength();r++)n.push(r);c.setSelectedRows(n)}else c.setSelectedRows([]);e.stopPropagation(),e.stopImmediatePropagation()}}function a(e,t,n,o,r){return r?d[e]?\"<input type='checkbox' checked='checked'>\":\"<input type='checkbox'>\":null}var c,u=new r.EventHandler,d={},p=o.extend(!0,{},{columnId:\"_checkbox_selector\",cssClass:null,toolTip:\"Select/Deselect All\",width:30},e);o.extend(this,{init:function(e){c=e,u.subscribe(c.onSelectedRowsChanged,t).subscribe(c.onClick,i).subscribe(c.onHeaderClick,s).subscribe(c.onKeyDown,n)},destroy:function(){u.unsubscribeAll()},deSelectRows:function(e){var t,n=e.length,r=[];for(t=0;t<n;t++)d[e[t]]&&(r[r.length]=e[t]);c.setSelectedRows(o.grep(c.getSelectedRows(),function(e){return r.indexOf(e)<0}))},selectRows:function(e){var t,n=e.length,o=[];for(t=0;t<n;t++)d[e[t]]||(o[o.length]=e[t]);c.setSelectedRows(c.getSelectedRows().concat(o))},getColumnDefinition:function(){return{id:p.columnId,name:\"<input type='checkbox'>\",toolTip:p.toolTip,field:\"sel\",width:p.width,resizable:!1,sortable:!1,cssClass:p.cssClass,formatter:a}}})}}},433:function(e,t,n){var o=e(436),r=e(434);t.exports={RowSelectionModel:function(e){function t(e){return function(){p||(p=!0,e.apply(this,arguments),p=!1)}}function n(e){for(var t=[],n=0;n<e.length;n++)for(var o=e[n].fromRow;o<=e[n].toRow;o++)t.push(o);return t}function i(e){for(var t=[],n=d.getColumns().length-1,o=0;o<e.length;o++)t.push(new r.Range(e[o],0,e[o],n));return t}function l(){return n(h)}function s(e){(h&&0!==h.length||e&&0!==e.length)&&(h=e,g.onSelectedRangesChanged.notify(h))}function a(e,t){f.selectActiveRow&&null!=t.row&&s([new r.Range(t.row,0,t.row,d.getColumns().length-1)])}function c(e){var t=d.getActiveCell();if(t&&e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(38==e.which||40==e.which)){var n=l();n.sort(function(e,t){return e-t}),n.length||(n=[t.row]);var o,r=n[0],a=n[n.length-1];if((o=40==e.which?t.row<a||r==a?++a:++r:t.row<a?--a:--r)>=0&&o<d.getDataLength()){d.scrollRowIntoView(o);var c=i(function(e,t){var n,o=[];for(n=e;n<=t;n++)o.push(n);for(n=t;n<e;n++)o.push(n);return o}(r,a));s(c)}e.preventDefault(),e.stopPropagation()}}function u(e){var t=d.getCellFromEvent(e);if(!t||!d.canCellBeActive(t.row,t.cell))return!1;if(!d.getOptions().multiSelect||!e.ctrlKey&&!e.shiftKey&&!e.metaKey)return!1;var r=n(h),l=o.inArray(t.row,r);if(-1===l&&(e.ctrlKey||e.metaKey))r.push(t.row),d.setActiveCell(t.row,t.cell);else if(-1!==l&&(e.ctrlKey||e.metaKey))r=o.grep(r,function(e,n){return e!==t.row}),d.setActiveCell(t.row,t.cell);else if(r.length&&e.shiftKey){var a=r.pop(),c=Math.min(t.row,a),u=Math.max(t.row,a);r=[];for(var p=c;p<=u;p++)p!==a&&r.push(p);r.push(a),d.setActiveCell(t.row,t.cell)}var f=i(r);return s(f),e.stopImmediatePropagation(),!0}var d,p,f,h=[],g=this,m=new r.EventHandler,v={selectActiveRow:!0};o.extend(this,{getSelectedRows:l,setSelectedRows:function(e){s(i(e))},getSelectedRanges:function(){return h},setSelectedRanges:s,init:function(n){f=o.extend(!0,{},v,e),d=n,m.subscribe(d.onActiveCellChanged,t(a)),m.subscribe(d.onKeyDown,t(c)),m.subscribe(d.onClick,t(u))},destroy:function(){m.unsubscribeAll()},onSelectedRangesChanged:new r.Event})}}},434:function(e,t,n){function o(){var e=!1,t=!1;this.stopPropagation=function(){e=!0},this.isPropagationStopped=function(){return e},this.stopImmediatePropagation=function(){t=!0},this.isImmediatePropagationStopped=function(){return t}}function r(){this.__nonDataRow=!0}function i(){this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.selectChecked=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=null}function l(){this.__groupTotals=!0,this.group=null,this.initialized=!1}function s(){var e=null;this.isActive=function(t){return t?e===t:null!==e},this.activate=function(t){if(t!==e){if(null!==e)throw new Error(\"SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController\");if(!t.commitCurrentEdit)throw new Error(\"SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()\");if(!t.cancelCurrentEdit)throw new Error(\"SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()\");e=t}},this.deactivate=function(t){if(e!==t)throw new Error(\"SlickGrid.EditorLock.deactivate: specified editController is not the currently active one\");e=null},this.commitCurrentEdit=function(){return!e||e.commitCurrentEdit()},this.cancelCurrentEdit=function(){return!e||e.cancelCurrentEdit()}}(i.prototype=new r).equals=function(e){return this.value===e.value&&this.count===e.count&&this.collapsed===e.collapsed&&this.title===e.title},l.prototype=new r,t.exports={Event:function(){var e=[];this.subscribe=function(t){e.push(t)},this.unsubscribe=function(t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},this.notify=function(t,n,r){n=n||new o,r=r||this;for(var i,l=0;l<e.length&&!n.isPropagationStopped()&&!n.isImmediatePropagationStopped();l++)i=e[l].call(r,n,t);return i}},EventData:o,EventHandler:function(){var e=[];this.subscribe=function(t,n){return e.push({event:t,handler:n}),t.subscribe(n),this},this.unsubscribe=function(t,n){for(var o=e.length;o--;)if(e[o].event===t&&e[o].handler===n)return e.splice(o,1),void t.unsubscribe(n);return this},this.unsubscribeAll=function(){for(var t=e.length;t--;)e[t].event.unsubscribe(e[t].handler);return e=[],this}},Range:function(e,t,n,o){void 0===n&&void 0===o&&(n=e,o=t);this.fromRow=Math.min(e,n),this.fromCell=Math.min(t,o),this.toRow=Math.max(e,n),this.toCell=Math.max(t,o),this.isSingleRow=function(){return this.fromRow==this.toRow},this.isSingleCell=function(){return this.fromRow==this.toRow&&this.fromCell==this.toCell},this.contains=function(e,t){return e>=this.fromRow&&e<=this.toRow&&t>=this.fromCell&&t<=this.toCell},this.toString=function(){return this.isSingleCell()?\"(\"+this.fromRow+\":\"+this.fromCell+\")\":\"(\"+this.fromRow+\":\"+this.fromCell+\" - \"+this.toRow+\":\"+this.toCell+\")\"}},NonDataRow:r,Group:i,GroupTotals:l,EditorLock:s,GlobalEditorLock:new s,keyCode:{BACKSPACE:8,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,ESC:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,TAB:9,UP:38,C:67,V:86},preClickClassName:\"slick-edit-preclick\"}},435:function _(require,module,exports){function SlickGrid(container,data,columns,options){function init(){if(($container=container instanceof $?container:$(container)).length<1)throw new Error(\"SlickGrid requires a valid container, \"+container+\" does not exist in the DOM.\");cacheCssForHiddenInit(),maxSupportedCssHeight=maxSupportedCssHeight||getMaxSupportedCssHeight(),scrollbarDimensions=scrollbarDimensions||measureScrollbar(),options=$.extend({},defaults,options),validateAndEnforceOptions(),columnDefaults.width=options.defaultColumnWidth,columnsById={};for(var e=0;e<columns.length;e++){var t=columns[e]=$.extend({},columnDefaults,columns[e]);columnsById[t.id]=e,t.minWidth&&t.width<t.minWidth&&(t.width=t.minWidth),t.maxWidth&&t.width>t.maxWidth&&(t.width=t.maxWidth)}if(options.enableColumnReorder&&!$.fn.sortable)throw new Error(\"SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded\");editController={commitCurrentEdit:commitCurrentEdit,cancelCurrentEdit:cancelCurrentEdit},$container.empty().css(\"overflow\",\"hidden\").css(\"outline\",0).addClass(uid).addClass(\"ui-widget\"),/relative|absolute|fixed/.test($container.css(\"position\"))||$container.css(\"position\",\"relative\"),$focusSink=$(\"<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>\").appendTo($container),options.createPreHeaderPanel&&($preHeaderPanelScroller=$(\"<div class='slick-preheader-panel ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$preHeaderPanel=$(\"<div />\").appendTo($preHeaderPanelScroller),$preHeaderPanelSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($preHeaderPanelScroller),options.showPreHeaderPanel||$preHeaderPanelScroller.hide()),$headerScroller=$(\"<div class='slick-header ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),($headers=$(\"<div class='slick-header-columns' style='left:-1000px' />\").appendTo($headerScroller)).width(getHeadersWidth()),$headerRowScroller=$(\"<div class='slick-headerrow ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$headerRow=$(\"<div class='slick-headerrow-columns' />\").appendTo($headerRowScroller),$headerRowSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($headerRowScroller),$topPanelScroller=$(\"<div class='slick-top-panel-scroller ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$topPanel=$(\"<div class='slick-top-panel' style='width:10000px' />\").appendTo($topPanelScroller),options.showTopPanel||$topPanelScroller.hide(),options.showHeaderRow||$headerRowScroller.hide(),($viewport=$(\"<div class='slick-viewport' style='width:100%;overflow:auto;outline:0;position:relative;;'>\").appendTo($container)).css(\"overflow-y\",options.autoHeight?\"hidden\":\"auto\"),$canvas=$(\"<div class='grid-canvas' />\").appendTo($viewport),options.createFooterRow&&($footerRowScroller=$(\"<div class='slick-footerrow ui-state-default' style='overflow:hidden;position:relative;' />\").appendTo($container),$footerRow=$(\"<div class='slick-footerrow-columns' />\").appendTo($footerRowScroller),$footerRowSpacer=$(\"<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>\").css(\"width\",getCanvasWidth()+scrollbarDimensions.width+\"px\").appendTo($footerRowScroller),options.showFooterRow||$footerRowScroller.hide()),options.numberedMultiColumnSort&&(sortIndicatorCssClass=\"slick-sort-indicator-numbered\"),$focusSink2=$focusSink.clone().appendTo($container),options.explicitInitialization||finishInitialization()}function finishInitialization(){initialized||(initialized=!0,viewportW=parseFloat($.css($container[0],\"width\",!0)),measureCellPaddingAndBorder(),disableSelection($headers),options.enableTextSelectionOnCells||$viewport.on(\"selectstart.ui\",function(e){return $(e.target).is(\"input,textarea\")}),updateColumnCaches(),createColumnHeaders(),setupColumnSort(),createCssRules(),resizeCanvas(),bindAncestorScrollEvents(),$container.on(\"resize.slickgrid\",resizeCanvas),$viewport.on(\"scroll\",handleScroll),$headerScroller.on(\"contextmenu\",handleHeaderContextMenu).on(\"click\",handleHeaderClick).on(\"mouseenter\",\".slick-header-column\",handleHeaderMouseEnter).on(\"mouseleave\",\".slick-header-column\",handleHeaderMouseLeave),$headerRowScroller.on(\"scroll\",handleHeaderRowScroll),options.createFooterRow&&$footerRowScroller.on(\"scroll\",handleFooterRowScroll),options.createPreHeaderPanel&&$preHeaderPanelScroller.on(\"scroll\",handlePreHeaderPanelScroll),$focusSink.add($focusSink2).on(\"keydown\",handleKeyDown),$canvas.on(\"keydown\",handleKeyDown).on(\"click\",handleClick).on(\"dblclick\",handleDblClick).on(\"contextmenu\",handleContextMenu).on(\"draginit\",handleDragInit).on(\"dragstart\",{distance:3},handleDragStart).on(\"drag\",handleDrag).on(\"dragend\",handleDragEnd).on(\"mouseenter\",\".slick-cell\",handleMouseEnter).on(\"mouseleave\",\".slick-cell\",handleMouseLeave),navigator.userAgent.toLowerCase().match(/webkit/)&&navigator.userAgent.toLowerCase().match(/macintosh/)&&$canvas.on(\"mousewheel\",handleMouseWheel),restoreCssFromHiddenInit())}function cacheCssForHiddenInit(){($hiddenParents=$container.parents().addBack().not(\":visible\")).each(function(){var e={};for(var t in cssShow)e[t]=this.style[t],this.style[t]=cssShow[t];oldProps.push(e)})}function restoreCssFromHiddenInit(){$hiddenParents.each(function(e){var t=oldProps[e];for(var n in cssShow)this.style[n]=t[n]})}function registerPlugin(e){plugins.unshift(e),e.init(self)}function unregisterPlugin(e){for(var t=plugins.length;t>=0;t--)if(plugins[t]===e){plugins[t].destroy&&plugins[t].destroy(),plugins.splice(t,1);break}}function setSelectionModel(e){selectionModel&&(selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged),selectionModel.destroy&&selectionModel.destroy()),(selectionModel=e)&&(selectionModel.init(self),selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged))}function getSelectionModel(){return selectionModel}function getCanvasNode(){return $canvas[0]}function measureScrollbar(){var e=$(\"<div style='position:absolute; top:-10000px; left:-10000px; width:100px; height:100px; overflow:scroll;'></div>\").appendTo(\"body\"),t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),t}function getColumnTotalWidth(e){for(var t=0,n=0,o=columns.length;n<o;n++){var r=columns[n].width;t+=r}return e&&(t+=scrollbarDimensions.width),t}function getHeadersWidth(){var e=getColumnTotalWidth(!0);return Math.max(e,viewportW)+1e3}function getCanvasWidth(){for(var e=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW,t=0,n=columns.length;n--;)t+=columns[n].width;return options.fullWidthRows?Math.max(t,e):t}function updateCanvasWidth(e){var t=canvasWidth;(canvasWidth=getCanvasWidth())!=t&&($canvas.width(canvasWidth),$headerRow.width(canvasWidth),options.createFooterRow&&$footerRow.width(canvasWidth),options.createPreHeaderPanel&&$preHeaderPanel.width(canvasWidth),$headers.width(getHeadersWidth()),viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width);var n=canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0);$headerRowSpacer.width(n),options.createFooterRow&&$footerRowSpacer.width(n),options.createPreHeaderPanel&&$preHeaderPanelSpacer.width(n),(canvasWidth!=t||e)&&applyColumnWidths()}function disableSelection(e){e&&e.jquery&&e.attr(\"unselectable\",\"on\").css(\"MozUserSelect\",\"none\").on(\"selectstart.ui\",function(){return!1})}function getMaxSupportedCssHeight(){for(var e=1e6,t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,n=$(\"<div style='display:none' />\").appendTo(document.body);;){var o=2*e;if(n.css(\"height\",o),o>t||n.height()!==o)break;e=o}return n.remove(),e}function getUID(){return uid}function getHeaderColumnWidthDiff(){return headerColumnWidthDiff}function getScrollbarDimensions(){return scrollbarDimensions}function bindAncestorScrollEvents(){for(var e=$canvas[0];(e=e.parentNode)!=document.body&&null!=e;)if(e==$viewport[0]||e.scrollWidth!=e.clientWidth||e.scrollHeight!=e.clientHeight){var t=$(e);$boundAncestors=$boundAncestors?$boundAncestors.add(t):t,t.on(\"scroll.\"+uid,handleActiveCellPositionChange)}}function unbindAncestorScrollEvents(){$boundAncestors&&($boundAncestors.off(\"scroll.\"+uid),$boundAncestors=null)}function updateColumnHeader(e,t,n){if(initialized){var o=getColumnIndex(e);if(null!=o){var r=columns[o],i=$headers.children().eq(o);i&&(void 0!==t&&(columns[o].name=t),void 0!==n&&(columns[o].toolTip=n),trigger(self.onBeforeHeaderCellDestroy,{node:i[0],column:r,grid:self}),i.attr(\"title\",n||\"\").children().eq(0).html(t),trigger(self.onHeaderCellRendered,{node:i[0],column:r,grid:self}))}}}function getHeaderRow(){return $headerRow[0]}function getFooterRow(){return $footerRow[0]}function getPreHeaderPanel(){return $preHeaderPanel[0]}function getHeaderRowColumn(e){var t=getColumnIndex(e),n=$headerRow.children().eq(t);return n&&n[0]}function getFooterRowColumn(e){var t=getColumnIndex(e),n=$footerRow.children().eq(t);return n&&n[0]}function createColumnHeaders(){function e(){$(this).addClass(\"ui-state-hover\")}function t(){$(this).removeClass(\"ui-state-hover\")}$headers.find(\".slick-header-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeHeaderCellDestroy,{node:this,column:e,grid:self})}),$headers.empty(),$headers.width(getHeadersWidth()),$headerRow.find(\".slick-headerrow-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeHeaderRowCellDestroy,{node:this,column:e,grid:self})}),$headerRow.empty(),options.createFooterRow&&($footerRow.find(\".slick-footerrow-column\").each(function(){var e=$(this).data(\"column\");e&&trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:e})}),$footerRow.empty());for(var n=0;n<columns.length;n++){var o=columns[n],r=$(\"<div class='ui-state-default slick-header-column' />\").html(\"<span class='slick-column-name'>\"+o.name+\"</span>\").width(o.width-headerColumnWidthDiff).attr(\"id\",\"\"+uid+o.id).attr(\"title\",o.toolTip||\"\").data(\"column\",o).addClass(o.headerCssClass||\"\").appendTo($headers);if((options.enableColumnReorder||o.sortable)&&r.on(\"mouseenter\",e).on(\"mouseleave\",t),o.sortable&&(r.addClass(\"slick-header-sortable\"),r.append(\"<span class='\"+sortIndicatorCssClass+\"' />\")),trigger(self.onHeaderCellRendered,{node:r[0],column:o,grid:self}),options.showHeaderRow){var i=$(\"<div class='ui-state-default slick-headerrow-column l\"+n+\" r\"+n+\"'></div>\").data(\"column\",o).appendTo($headerRow);trigger(self.onHeaderRowCellRendered,{node:i[0],column:o,grid:self})}if(options.createFooterRow&&options.showFooterRow){var l=$(\"<div class='ui-state-default slick-footerrow-column l\"+n+\" r\"+n+\"'></div>\").data(\"column\",o).appendTo($footerRow);trigger(self.onFooterRowCellRendered,{node:l[0],column:o})}}setSortColumns(sortColumns),setupColumnResize(),options.enableColumnReorder&&(\"function\"==typeof options.enableColumnReorder?options.enableColumnReorder(self,$headers,headerColumnWidthDiff,setColumns,setupColumnResize,columns,getColumnIndex,uid,trigger):setupColumnReorder())}function setupColumnSort(){$headers.click(function(e){if(e.metaKey=e.metaKey||e.ctrlKey,!$(e.target).hasClass(\"slick-resizable-handle\")){var t=$(e.target).closest(\".slick-header-column\");if(t.length){var n=t.data(\"column\");if(n.sortable){if(!getEditorLock().commitCurrentEdit())return;for(var o=null,r=0;r<sortColumns.length;r++)if(sortColumns[r].columnId==n.id){(o=sortColumns[r]).sortAsc=!o.sortAsc;break}var i=!!o;options.tristateMultiColumnSort?(o||(o={columnId:n.id,sortAsc:n.defaultSortAsc}),i&&o.sortAsc&&(sortColumns.splice(r,1),o=null),options.multiColumnSort||(sortColumns=[]),!o||i&&options.multiColumnSort||sortColumns.push(o)):e.metaKey&&options.multiColumnSort?o&&sortColumns.splice(r,1):((e.shiftKey||e.metaKey)&&options.multiColumnSort||(sortColumns=[]),o?0==sortColumns.length&&sortColumns.push(o):(o={columnId:n.id,sortAsc:n.defaultSortAsc},sortColumns.push(o))),setSortColumns(sortColumns),sortColumns.length>0&&(options.multiColumnSort?trigger(self.onSort,{multiColumnSort:!0,sortCols:$.map(sortColumns,function(e){return{sortCol:columns[getColumnIndex(e.columnId)],sortAsc:e.sortAsc}}),grid:self},e):trigger(self.onSort,{multiColumnSort:!1,sortCol:n,sortAsc:sortColumns[0].sortAsc,grid:self},e))}}}})}function setupColumnReorder(){$headers.filter(\":ui-sortable\").sortable(\"destroy\"),$headers.sortable({containment:\"parent\",distance:3,axis:\"x\",cursor:\"default\",tolerance:\"intersection\",helper:\"clone\",placeholder:\"slick-sortable-placeholder ui-state-default slick-header-column\",start:function(e,t){t.placeholder.width(t.helper.outerWidth()-headerColumnWidthDiff),$(t.helper).addClass(\"slick-header-column-active\")},beforeStop:function(e,t){$(t.helper).removeClass(\"slick-header-column-active\")},stop:function(e){if(getEditorLock().commitCurrentEdit()){for(var t=$headers.sortable(\"toArray\"),n=[],o=0;o<t.length;o++)n.push(columns[getColumnIndex(t[o].replace(uid,\"\"))]);setColumns(n),trigger(self.onColumnsReordered,{grid:self}),e.stopPropagation(),setupColumnResize()}else $(this).sortable(\"cancel\")}})}function setupColumnResize(){var e,t,n,o,r,i,l,s;(o=$headers.children()).find(\".slick-resizable-handle\").remove(),o.each(function(e,t){e>=columns.length||columns[e].resizable&&(void 0===l&&(l=e),s=e)}),void 0!==l&&o.each(function(a,c){a>=columns.length||a<l||options.forceFitColumns&&a>=s||($(c),$(\"<div class='slick-resizable-handle' />\").appendTo(c).on(\"dragstart\",function(l,s){if(!getEditorLock().commitCurrentEdit())return!1;n=l.pageX,$(this).parent().addClass(\"slick-header-column-active\");var c=null,u=null;if(o.each(function(e,t){e>=columns.length||(columns[e].previousWidth=$(t).outerWidth())}),options.forceFitColumns)for(c=0,u=0,e=a+1;e<columns.length;e++)(t=columns[e]).resizable&&(null!==u&&(t.maxWidth?u+=t.maxWidth-t.previousWidth:u=null),c+=t.previousWidth-Math.max(t.minWidth||0,absoluteColumnMinWidth));var d=0,p=0;for(e=0;e<=a;e++)(t=columns[e]).resizable&&(null!==p&&(t.maxWidth?p+=t.maxWidth-t.previousWidth:p=null),d+=t.previousWidth-Math.max(t.minWidth||0,absoluteColumnMinWidth));null===c&&(c=1e5),null===d&&(d=1e5),null===u&&(u=1e5),null===p&&(p=1e5),i=n+Math.min(c,p),r=n-Math.min(d,u)}).on(\"drag\",function(o,l){var s,c,u=Math.min(i,Math.max(r,o.pageX))-n;if(u<0){for(c=u,e=a;e>=0;e--)(t=columns[e]).resizable&&(s=Math.max(t.minWidth||0,absoluteColumnMinWidth),c&&t.previousWidth+c<s?(c+=t.previousWidth-s,t.width=s):(t.width=t.previousWidth+c,c=0));if(options.forceFitColumns)for(c=-u,e=a+1;e<columns.length;e++)(t=columns[e]).resizable&&(c&&t.maxWidth&&t.maxWidth-t.previousWidth<c?(c-=t.maxWidth-t.previousWidth,t.width=t.maxWidth):(t.width=t.previousWidth+c,c=0))}else{for(c=u,e=a;e>=0;e--)(t=columns[e]).resizable&&(c&&t.maxWidth&&t.maxWidth-t.previousWidth<c?(c-=t.maxWidth-t.previousWidth,t.width=t.maxWidth):(t.width=t.previousWidth+c,c=0));if(options.forceFitColumns)for(c=-u,e=a+1;e<columns.length;e++)(t=columns[e]).resizable&&(s=Math.max(t.minWidth||0,absoluteColumnMinWidth),c&&t.previousWidth+c<s?(c+=t.previousWidth-s,t.width=s):(t.width=t.previousWidth+c,c=0))}applyColumnHeaderWidths(),options.syncColumnCellResize&&applyColumnWidths()}).on(\"dragend\",function(n,r){var i;for($(this).parent().removeClass(\"slick-header-column-active\"),e=0;e<columns.length;e++)t=columns[e],i=$(o[e]).outerWidth(),t.previousWidth!==i&&t.rerenderOnResize&&invalidateAllRows();updateCanvasWidth(!0),render(),trigger(self.onColumnsResized,{grid:self})}))})}function getVBoxDelta(e){var t=0;return $.each([\"borderTopWidth\",\"borderBottomWidth\",\"paddingTop\",\"paddingBottom\"],function(n,o){t+=parseFloat(e.css(o))||0}),t}function measureCellPaddingAndBorder(){var e,t=[\"borderLeftWidth\",\"borderRightWidth\",\"paddingLeft\",\"paddingRight\"],n=[\"borderTopWidth\",\"borderBottomWidth\",\"paddingTop\",\"paddingBottom\"],o=$.fn.jquery.split(\".\");jQueryNewWidthBehaviour=1==o[0]&&o[1]>=8||o[0]>=2,e=$(\"<div class='ui-state-default slick-header-column' style='visibility:hidden'>-</div>\").appendTo($headers),headerColumnWidthDiff=headerColumnHeightDiff=0,\"border-box\"!=e.css(\"box-sizing\")&&\"border-box\"!=e.css(\"-moz-box-sizing\")&&\"border-box\"!=e.css(\"-webkit-box-sizing\")&&($.each(t,function(t,n){headerColumnWidthDiff+=parseFloat(e.css(n))||0}),$.each(n,function(t,n){headerColumnHeightDiff+=parseFloat(e.css(n))||0})),e.remove();var r=$(\"<div class='slick-row' />\").appendTo($canvas);e=$(\"<div class='slick-cell' id='' style='visibility:hidden'>-</div>\").appendTo(r),cellWidthDiff=cellHeightDiff=0,\"border-box\"!=e.css(\"box-sizing\")&&\"border-box\"!=e.css(\"-moz-box-sizing\")&&\"border-box\"!=e.css(\"-webkit-box-sizing\")&&($.each(t,function(t,n){cellWidthDiff+=parseFloat(e.css(n))||0}),$.each(n,function(t,n){cellHeightDiff+=parseFloat(e.css(n))||0})),r.remove(),absoluteColumnMinWidth=Math.max(headerColumnWidthDiff,cellWidthDiff)}function createCssRules(){$style=$(\"<style type='text/css' rel='stylesheet' />\").appendTo($(\"head\"));for(var e=options.rowHeight-cellHeightDiff,t=[\".\"+uid+\" .slick-header-column { left: 1000px; }\",\".\"+uid+\" .slick-top-panel { height:\"+options.topPanelHeight+\"px; }\",\".\"+uid+\" .slick-preheader-panel { height:\"+options.preHeaderPanelHeight+\"px; }\",\".\"+uid+\" .slick-headerrow-columns { height:\"+options.headerRowHeight+\"px; }\",\".\"+uid+\" .slick-footerrow-columns { height:\"+options.footerRowHeight+\"px; }\",\".\"+uid+\" .slick-cell { height:\"+e+\"px; }\",\".\"+uid+\" .slick-row { height:\"+options.rowHeight+\"px; }\"],n=0;n<columns.length;n++)t.push(\".\"+uid+\" .l\"+n+\" { }\"),t.push(\".\"+uid+\" .r\"+n+\" { }\");$style[0].styleSheet?$style[0].styleSheet.cssText=t.join(\" \"):$style[0].appendChild(document.createTextNode(t.join(\" \")))}function getColumnCssRules(e){var t;if(!stylesheet){var n=document.styleSheets;for(t=0;t<n.length;t++)if((n[t].ownerNode||n[t].owningElement)==$style[0]){stylesheet=n[t];break}if(!stylesheet)throw new Error(\"Cannot find stylesheet.\");columnCssRulesL=[],columnCssRulesR=[];var o,r,i=stylesheet.cssRules||stylesheet.rules;for(t=0;t<i.length;t++){var l=i[t].selectorText;(o=/\\.l\\d+/.exec(l))?(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesL[r]=i[t]):(o=/\\.r\\d+/.exec(l))&&(r=parseInt(o[0].substr(2,o[0].length-2),10),columnCssRulesR[r]=i[t])}}return{left:columnCssRulesL[e],right:columnCssRulesR[e]}}function removeCssRules(){$style.remove(),stylesheet=null}function destroy(){getEditorLock().cancelCurrentEdit(),trigger(self.onBeforeDestroy,{grid:self});for(var e=plugins.length;e--;)unregisterPlugin(plugins[e]);options.enableColumnReorder&&$headers.filter(\":ui-sortable\").sortable(\"destroy\"),unbindAncestorScrollEvents(),$container.off(\".slickgrid\"),removeCssRules(),$canvas.off(\"draginit dragstart dragend drag\"),$container.empty().removeClass(uid)}function trigger(e,t,n){return n=n||new Slick.EventData,t=t||{},t.grid=self,e.notify(t,n,self)}function getEditorLock(){return options.editorLock}function getEditController(){return editController}function getColumnIndex(e){return columnsById[e]}function autosizeColumns(){var e,t,n,o=[],r=0,i=0,l=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW;for(e=0;e<columns.length;e++)t=columns[e],o.push(t.width),i+=t.width,t.resizable&&(r+=t.width-Math.max(t.minWidth,absoluteColumnMinWidth));for(n=i;i>l&&r;){var s=(i-l)/r;for(e=0;e<columns.length&&i>l;e++){t=columns[e];var a=o[e];if(!(!t.resizable||a<=t.minWidth||a<=absoluteColumnMinWidth)){var c=Math.max(t.minWidth,absoluteColumnMinWidth),u=Math.floor(s*(a-c))||1;u=Math.min(u,a-c),i-=u,r-=u,o[e]-=u}}if(n<=i)break;n=i}for(n=i;i<l;){var d=l/i;for(e=0;e<columns.length&&i<l;e++){t=columns[e];var p,f=o[e];p=!t.resizable||t.maxWidth<=f?0:Math.min(Math.floor(d*f)-f,t.maxWidth-f||1e6)||1,i+=p,o[e]+=i<=l?p:0}if(n>=i)break;n=i}var h=!1;for(e=0;e<columns.length;e++)columns[e].rerenderOnResize&&columns[e].width!=o[e]&&(h=!0),columns[e].width=o[e];applyColumnHeaderWidths(),updateCanvasWidth(!0),h&&(invalidateAllRows(),render())}function applyColumnHeaderWidths(){if(initialized){for(var e,t=0,n=$headers.children(),o=columns.length;t<o;t++)e=$(n[t]),jQueryNewWidthBehaviour?e.outerWidth()!==columns[t].width&&e.outerWidth(columns[t].width):e.width()!==columns[t].width-headerColumnWidthDiff&&e.width(columns[t].width-headerColumnWidthDiff);updateColumnCaches()}}function applyColumnWidths(){for(var e,t,n=0,o=0;o<columns.length;o++)e=columns[o].width,(t=getColumnCssRules(o)).left.style.left=n+\"px\",t.right.style.right=canvasWidth-n-e+\"px\",n+=columns[o].width}function setSortColumn(e,t){setSortColumns([{columnId:e,sortAsc:t}])}function setSortColumns(e){sortColumns=e;var t=options.numberedMultiColumnSort&&sortColumns.length>1,n=$headers.children(),o=n.removeClass(\"slick-header-column-sorted\").find(\".\"+sortIndicatorCssClass).removeClass(\"slick-sort-indicator-asc slick-sort-indicator-desc\");t&&o.text(\"\"),$.each(sortColumns,function(e,r){null==r.sortAsc&&(r.sortAsc=!0);var i=getColumnIndex(r.columnId);null!=i&&(o=n.eq(i).addClass(\"slick-header-column-sorted\").find(\".\"+sortIndicatorCssClass).addClass(r.sortAsc?\"slick-sort-indicator-asc\":\"slick-sort-indicator-desc\"),t&&o.text(e+1))})}function getSortColumns(){return sortColumns}function handleSelectedRangesChanged(e,t){selectedRows=[];for(var n={},o=0;o<t.length;o++)for(var r=t[o].fromRow;r<=t[o].toRow;r++){n[r]||(selectedRows.push(r),n[r]={});for(var i=t[o].fromCell;i<=t[o].toCell;i++)canCellBeSelected(r,i)&&(n[r][columns[i].id]=options.selectedCellCssClass)}setCellCssStyles(options.selectedCellCssClass,n),trigger(self.onSelectedRowsChanged,{rows:getSelectedRows(),grid:self},e)}function getColumns(){return columns}function updateColumnCaches(){columnPosLeft=[],columnPosRight=[];for(var e=0,t=0,n=columns.length;t<n;t++)columnPosLeft[t]=e,columnPosRight[t]=e+columns[t].width,e+=columns[t].width}function setColumns(e){columns=e,columnsById={};for(var t=0;t<columns.length;t++){var n=columns[t]=$.extend({},columnDefaults,columns[t]);columnsById[n.id]=t,n.minWidth&&n.width<n.minWidth&&(n.width=n.minWidth),n.maxWidth&&n.width>n.maxWidth&&(n.width=n.maxWidth)}updateColumnCaches(),initialized&&(invalidateAllRows(),createColumnHeaders(),removeCssRules(),createCssRules(),resizeCanvas(),applyColumnWidths(),handleScroll())}function getOptions(){return options}function setOptions(e,t){getEditorLock().commitCurrentEdit()&&(makeActiveCellNormal(),options.enableAddRow!==e.enableAddRow&&invalidateRow(getDataLength()),options=$.extend(options,e),validateAndEnforceOptions(),$viewport.css(\"overflow-y\",options.autoHeight?\"hidden\":\"auto\"),t||render())}function validateAndEnforceOptions(){options.autoHeight&&(options.leaveSpaceForNewRows=!1)}function setData(e,t){data=e,invalidateAllRows(),updateRowCount(),t&&scrollTo(0)}function getData(){return data}function getDataLength(){return data.getLength?data.getLength():data.length}function getDataLengthIncludingAddNew(){return getDataLength()+(options.enableAddRow&&(!pagingActive||pagingIsLastPage)?1:0)}function getDataItem(e){return data.getItem?data.getItem(e):data[e]}function getTopPanel(){return $topPanel[0]}function setTopPanelVisibility(e){options.showTopPanel!=e&&(options.showTopPanel=e,e?$topPanelScroller.slideDown(\"fast\",resizeCanvas):$topPanelScroller.slideUp(\"fast\",resizeCanvas))}function setHeaderRowVisibility(e){options.showHeaderRow!=e&&(options.showHeaderRow=e,e?$headerRowScroller.slideDown(\"fast\",resizeCanvas):$headerRowScroller.slideUp(\"fast\",resizeCanvas))}function setFooterRowVisibility(e){options.showFooterRow!=e&&(options.showFooterRow=e,e?$footerRowScroller.slideDown(\"fast\",resizeCanvas):$footerRowScroller.slideUp(\"fast\",resizeCanvas))}function setPreHeaderPanelVisibility(e){options.showPreHeaderPanel!=e&&(options.showPreHeaderPanel=e,e?$preHeaderPanelScroller.slideDown(\"fast\",resizeCanvas):$preHeaderPanelScroller.slideUp(\"fast\",resizeCanvas))}function getContainerNode(){return $container.get(0)}function getRowTop(e){return options.rowHeight*e-offset}function getRowFromPosition(e){return Math.floor((e+offset)/options.rowHeight)}function scrollTo(e){e=Math.max(e,0),e=Math.min(e,th-viewportH+(viewportHasHScroll?scrollbarDimensions.height:0));var t=offset;page=Math.min(n-1,Math.floor(e/ph)),offset=Math.round(page*cj);var o=e-offset;if(offset!=t){var r=getVisibleRange(o);cleanupRows(r),updateRowPositions()}prevScrollTop!=o&&(vScrollDir=prevScrollTop+t<o+offset?1:-1,$viewport[0].scrollTop=lastRenderedScrollTop=scrollTop=prevScrollTop=o,trigger(self.onViewportChanged,{grid:self}))}function defaultFormatter(e,t,n,o,r){return null==n?\"\":(n+\"\").replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")}function getFormatter(e,t){var n=data.getItemMetadata&&data.getItemMetadata(e),o=n&&n.columns&&(n.columns[t.id]||n.columns[getColumnIndex(t.id)]);return o&&o.formatter||n&&n.formatter||t.formatter||options.formatterFactory&&options.formatterFactory.getFormatter(t)||options.defaultFormatter}function getEditor(e,t){var n=columns[t],o=data.getItemMetadata&&data.getItemMetadata(e),r=o&&o.columns;return r&&r[n.id]&&void 0!==r[n.id].editor?r[n.id].editor:r&&r[t]&&void 0!==r[t].editor?r[t].editor:n.editor||options.editorFactory&&options.editorFactory.getEditor(n)}function getDataItemValueForColumn(e,t){return options.dataItemColumnValueExtractor?options.dataItemColumnValueExtractor(e,t):e[t.field]}function appendRowHtml(e,t,n,o){var r=getDataItem(t),i=t<o&&!r,l=\"slick-row\"+(i?\" loading\":\"\")+(t===activeRow?\" active\":\"\")+(t%2==1?\" odd\":\" even\");r||(l+=\" \"+options.addNewRowCssClass);var s=data.getItemMetadata&&data.getItemMetadata(t);s&&s.cssClasses&&(l+=\" \"+s.cssClasses),e.push(\"<div class='ui-widget-content \"+l+\"' style='top:\"+getRowTop(t)+\"px'>\");for(var a,c,u=0,d=columns.length;u<d;u++){if(c=columns[u],a=1,s&&s.columns){var p=s.columns[c.id]||s.columns[u];\"*\"===(a=p&&p.colspan||1)&&(a=d-u)}if(columnPosRight[Math.min(d-1,u+a-1)]>n.leftPx){if(columnPosLeft[u]>n.rightPx)break;appendCellHtml(e,t,u,a,r)}a>1&&(u+=a-1)}e.push(\"</div>\")}function appendCellHtml(e,t,n,o,r){var i=columns[n],l=\"slick-cell l\"+n+\" r\"+Math.min(columns.length-1,n+o-1)+(i.cssClass?\" \"+i.cssClass:\"\");t===activeRow&&n===activeCell&&(l+=\" active\");for(var s in cellCssClasses)cellCssClasses[s][t]&&cellCssClasses[s][t][i.id]&&(l+=\" \"+cellCssClasses[s][t][i.id]);var a=null;r&&(a=getDataItemValueForColumn(r,i));var c=getFormatter(t,i)(t,n,a,i,r),u=trigger(self.onBeforeAppendCell,{row:t,cell:n,grid:self,value:a,dataContext:r})||\"\";u+=c.addClasses?(u?\" \":\"\")+c.addClasses:\"\",e.push(\"<div class='\"+l+(u?\" \"+u:\"\")+\"'>\"),r&&e.push(\"object\"!=typeof c?c:c.text),e.push(\"</div>\"),rowsCache[t].cellRenderQueue.push(n),rowsCache[t].cellColSpans[n]=o}function cleanupRows(e){for(var t in rowsCache)(t=parseInt(t,10))!==activeRow&&(t<e.top||t>e.bottom)&&removeRowFromCache(t);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}function invalidate(){updateRowCount(),invalidateAllRows(),render()}function invalidateAllRows(){currentEditor&&makeActiveCellNormal();for(var e in rowsCache)removeRowFromCache(e);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}function queuePostProcessedRowForCleanup(e,t,n){postProcessgroupId++;for(var o in t)t.hasOwnProperty(o)&&postProcessedCleanupQueue.push({actionType:\"C\",groupId:postProcessgroupId,node:e.cellNodesByColumnIdx[0|o],columnIdx:0|o,rowIdx:n});postProcessedCleanupQueue.push({actionType:\"R\",groupId:postProcessgroupId,node:e.rowNode}),$(e.rowNode).detach()}function queuePostProcessedCellForCleanup(e,t,n){postProcessedCleanupQueue.push({actionType:\"C\",groupId:postProcessgroupId,node:e,columnIdx:t,rowIdx:n}),$(e).detach()}function removeRowFromCache(e){var t=rowsCache[e];t&&(rowNodeFromLastMouseWheelEvent===t.rowNode?(t.rowNode.style.display=\"none\",zombieRowNodeFromLastMouseWheelEvent=rowNodeFromLastMouseWheelEvent,zombieRowCacheFromLastMouseWheelEvent=t,zombieRowPostProcessedFromLastMouseWheelEvent=postProcessedRows[e]):options.enableAsyncPostRenderCleanup&&postProcessedRows[e]?queuePostProcessedRowForCleanup(t,postProcessedRows[e],e):$canvas[0].removeChild(t.rowNode),delete rowsCache[e],delete postProcessedRows[e],renderedRows--,counter_rows_removed++)}function invalidateRows(e){var t,n;if(e&&e.length){for(vScrollDir=0,n=e.length,t=0;t<n;t++)currentEditor&&activeRow===e[t]&&makeActiveCellNormal(),rowsCache[e[t]]&&removeRowFromCache(e[t]);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup()}}function invalidateRow(e){invalidateRows([e])}function applyFormatResultToCellNode(e,t,n){\"object\"==typeof e?(t.innerHTML=e.text,e.removeClasses&&!n&&t.removeClass(e.removeClasses),e.addClasses&&t.addClass(e.addClasses)):t.innerHTML=e}function updateCell(e,t){var n=getCellNode(e,t);if(n){var o=columns[t],r=getDataItem(e);if(currentEditor&&activeRow===e&&activeCell===t)currentEditor.loadValue(r);else{var i=r?getFormatter(e,o)(e,t,getDataItemValueForColumn(r,o),o,r):\"\";applyFormatResultToCellNode(i,n),invalidatePostProcessingResults(e)}}}function updateRow(e){var t=rowsCache[e];if(t){ensureCellNodesInRowsCache(e);var n=getDataItem(e);for(var o in t.cellNodesByColumnIdx)if(t.cellNodesByColumnIdx.hasOwnProperty(o)){var r=columns[o|=0],i=t.cellNodesByColumnIdx[o];e===activeRow&&o===activeCell&&currentEditor?currentEditor.loadValue(n):n?applyFormatResultToCellNode(getFormatter(e,r)(e,o,getDataItemValueForColumn(n,r),r,n),i):i.innerHTML=\"\"}invalidatePostProcessingResults(e)}}function getViewportHeight(){return parseFloat($.css($container[0],\"height\",!0))-parseFloat($.css($container[0],\"paddingTop\",!0))-parseFloat($.css($container[0],\"paddingBottom\",!0))-parseFloat($.css($headerScroller[0],\"height\"))-getVBoxDelta($headerScroller)-(options.showTopPanel?options.topPanelHeight+getVBoxDelta($topPanelScroller):0)-(options.showHeaderRow?options.headerRowHeight+getVBoxDelta($headerRowScroller):0)-(options.createFooterRow&&options.showFooterRow?options.footerRowHeight+getVBoxDelta($footerRowScroller):0)-(options.createPreHeaderPanel&&options.showPreHeaderPanel?options.preHeaderPanelHeight+getVBoxDelta($preHeaderPanelScroller):0)}function resizeCanvas(){initialized&&(viewportH=options.autoHeight?options.rowHeight*getDataLengthIncludingAddNew():getViewportHeight(),numVisibleRows=Math.ceil(viewportH/options.rowHeight),viewportW=parseFloat($.css($container[0],\"width\",!0)),options.autoHeight||$viewport.height(viewportH),options.forceFitColumns&&autosizeColumns(),updateRowCount(),handleScroll(),lastRenderedScrollLeft=-1,render())}function updatePagingStatusFromView(e){pagingActive=0!==e.pageSize,pagingIsLastPage=e.pageNum==e.totalPages-1}function updateRowCount(){if(initialized){var e=getDataLength(),t=getDataLengthIncludingAddNew(),o=t+(options.leaveSpaceForNewRows?numVisibleRows-1:0),r=viewportHasVScroll;viewportHasVScroll=!options.autoHeight&&o*options.rowHeight>viewportH,viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width,makeActiveCellNormal();var i=e-1;for(var l in rowsCache)l>i&&removeRowFromCache(l);options.enableAsyncPostRenderCleanup&&startPostProcessingCleanup(),activeCellNode&&activeRow>i&&resetActiveCell();var s=h;(th=Math.max(options.rowHeight*o,viewportH-scrollbarDimensions.height))<maxSupportedCssHeight?(h=ph=th,n=1,cj=0):(ph=(h=maxSupportedCssHeight)/100,n=Math.floor(th/ph),cj=(th-h)/(n-1)),h!==s&&($canvas.css(\"height\",h),scrollTop=$viewport[0].scrollTop);var a=scrollTop+offset<=th-viewportH;0==th||0==scrollTop?page=offset=0:scrollTo(a?scrollTop+offset:th-viewportH),h!=s&&options.autoHeight&&resizeCanvas(),options.forceFitColumns&&r!=viewportHasVScroll&&autosizeColumns(),updateCanvasWidth(!1)}}function getVisibleRange(e,t){return null==e&&(e=scrollTop),null==t&&(t=scrollLeft),{top:getRowFromPosition(e),bottom:getRowFromPosition(e+viewportH)+1,leftPx:t,rightPx:t+viewportW}}function getRenderedRange(e,t){var n=getVisibleRange(e,t),o=Math.round(viewportH/options.rowHeight);return-1==vScrollDir?(n.top-=o,n.bottom+=3):1==vScrollDir?(n.top-=3,n.bottom+=o):(n.top-=3,n.bottom+=3),n.top=Math.max(0,n.top),n.bottom=Math.min(getDataLengthIncludingAddNew()-1,n.bottom),n.leftPx-=viewportW,n.rightPx+=viewportW,n.leftPx=Math.max(0,n.leftPx),n.rightPx=Math.min(canvasWidth,n.rightPx),n}function ensureCellNodesInRowsCache(e){var t=rowsCache[e];if(t&&t.cellRenderQueue.length)for(var n=t.rowNode.lastChild;t.cellRenderQueue.length;){var o=t.cellRenderQueue.pop();t.cellNodesByColumnIdx[o]=n,n=n.previousSibling}}function cleanUpCells(e,t){var n=rowsCache[t],o=[];for(var r in n.cellNodesByColumnIdx)if(n.cellNodesByColumnIdx.hasOwnProperty(r)){r|=0;var i=n.cellColSpans[r];(columnPosLeft[r]>e.rightPx||columnPosRight[Math.min(columns.length-1,r+i-1)]<e.leftPx)&&(t==activeRow&&r==activeCell||o.push(r))}var l,s;for(postProcessgroupId++;null!=(l=o.pop());)s=n.cellNodesByColumnIdx[l],options.enableAsyncPostRenderCleanup&&postProcessedRows[t]&&postProcessedRows[t][l]?queuePostProcessedCellForCleanup(s,l,t):n.rowNode.removeChild(s),delete n.cellColSpans[l],delete n.cellNodesByColumnIdx[l],postProcessedRows[t]&&delete postProcessedRows[t][l],0}function cleanUpAndRenderCells(e){for(var t,n,o,r=[],i=[],l=e.top,s=e.bottom;l<=s;l++)if(t=rowsCache[l]){ensureCellNodesInRowsCache(l),cleanUpCells(e,l),n=0;var a=data.getItemMetadata&&data.getItemMetadata(l);a=a&&a.columns;for(var c=getDataItem(l),u=0,d=columns.length;u<d&&!(columnPosLeft[u]>e.rightPx);u++)if(null==(o=t.cellColSpans[u])){if(o=1,a){var p=a[columns[u].id]||a[u];\"*\"===(o=p&&p.colspan||1)&&(o=d-u)}columnPosRight[Math.min(d-1,u+o-1)]>e.leftPx&&(appendCellHtml(r,l,u,o,c),n++),u+=o>1?o-1:0}else u+=o>1?o-1:0;n&&(n,i.push(l))}if(r.length){var f=document.createElement(\"div\");f.innerHTML=r.join(\"\");for(var h,g;null!=(h=i.pop());){t=rowsCache[h];for(var m;null!=(m=t.cellRenderQueue.pop());)g=f.lastChild,t.rowNode.appendChild(g),t.cellNodesByColumnIdx[m]=g}}}function renderRows(e){for(var t=$canvas[0],n=[],o=[],r=!1,i=getDataLength(),l=e.top,s=e.bottom;l<=s;l++)rowsCache[l]||(renderedRows++,o.push(l),rowsCache[l]={rowNode:null,cellColSpans:[],cellNodesByColumnIdx:[],cellRenderQueue:[]},appendRowHtml(n,l,e,i),activeCellNode&&activeRow===l&&(r=!0),counter_rows_rendered++);if(o.length){var a=document.createElement(\"div\");a.innerHTML=n.join(\"\");for(var l=0,s=o.length;l<s;l++)rowsCache[o[l]].rowNode=t.appendChild(a.firstChild);r&&(activeCellNode=getCellNode(activeRow,activeCell))}}function startPostProcessing(){options.enableAsyncPostRender&&(clearTimeout(h_postrender),h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay))}function startPostProcessingCleanup(){options.enableAsyncPostRenderCleanup&&(clearTimeout(h_postrenderCleanup),h_postrenderCleanup=setTimeout(asyncPostProcessCleanupRows,options.asyncPostRenderCleanupDelay))}function invalidatePostProcessingResults(e){for(var t in postProcessedRows[e])postProcessedRows[e].hasOwnProperty(t)&&(postProcessedRows[e][t]=\"C\");postProcessFromRow=Math.min(postProcessFromRow,e),postProcessToRow=Math.max(postProcessToRow,e),startPostProcessing()}function updateRowPositions(){for(var e in rowsCache)rowsCache[e].rowNode.style.top=getRowTop(e)+\"px\"}function render(){if(initialized){var e=getVisibleRange(),t=getRenderedRange();cleanupRows(t),lastRenderedScrollLeft!=scrollLeft&&cleanUpAndRenderCells(t),renderRows(t),postProcessFromRow=e.top,postProcessToRow=Math.min(getDataLengthIncludingAddNew()-1,e.bottom),startPostProcessing(),lastRenderedScrollTop=scrollTop,lastRenderedScrollLeft=scrollLeft,h_render=null}}function handleHeaderRowScroll(){var e=$headerRowScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handleFooterRowScroll(){var e=$footerRowScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handlePreHeaderPanelScroll(){var e=$preHeaderPanelScroller[0].scrollLeft;e!=$viewport[0].scrollLeft&&($viewport[0].scrollLeft=e)}function handleScroll(){scrollTop=$viewport[0].scrollTop,scrollLeft=$viewport[0].scrollLeft;var e=Math.abs(scrollTop-prevScrollTop),t=Math.abs(scrollLeft-prevScrollLeft);if(t&&(prevScrollLeft=scrollLeft,$hea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment