@stlite/desktop 0.42.4 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dump_artifacts.js +5 -5
- package/build/asset-manifest.json +77 -74
- package/build/index.html +1 -1
- package/build/static/css/1619.7ce51b75.chunk.css +1 -0
- package/build/static/css/7652.c24b25fa.chunk.css +1 -0
- package/build/static/css/7895.c24b25fa.chunk.css +1 -0
- package/build/static/css/main.fb5f4d99.css +1 -0
- package/build/static/js/1046.ea522608.chunk.js +1 -0
- package/build/static/js/1189.71b89117.chunk.js +1 -0
- package/build/static/js/1261.242b7386.chunk.js +1 -0
- package/build/static/js/142.dbf9ec20.chunk.js +1 -0
- package/build/static/js/144.2477d27a.chunk.js +1 -0
- package/build/static/js/1619.c039c65c.chunk.js +1 -0
- package/build/static/js/1687.a144d952.chunk.js +1 -0
- package/build/static/js/1729.528431ca.chunk.js +1 -0
- package/build/static/js/1740.32a0c10e.chunk.js +1 -0
- package/build/static/js/1839.a1fce0e6.chunk.js +1 -0
- package/build/static/js/2385.2cbc4e3c.chunk.js +1 -0
- package/build/static/js/2448.e6f85eda.chunk.js +1 -0
- package/build/static/js/{6557.fd2f35c8.chunk.js → 2873.cf145dcb.chunk.js} +1 -1
- package/build/static/js/2940.dd2240b9.chunk.js +1 -0
- package/build/static/js/3185.d317b162.chunk.js +1 -0
- package/build/static/js/4021.16f5498a.chunk.js +1 -0
- package/build/static/js/4232.b0bbe2e6.chunk.js +2 -0
- package/build/static/js/4232.b0bbe2e6.chunk.js.LICENSE.txt +52 -0
- package/build/static/js/4482.2f210b65.chunk.js +1 -0
- package/build/static/js/4494.c6ab91c6.chunk.js +1 -0
- package/build/static/js/4694.7e63f0ef.chunk.js +1 -0
- package/build/static/js/4724.366489f9.chunk.js +1 -0
- package/build/static/js/4785.3ac653c2.chunk.js +1 -0
- package/build/static/js/4831.3170175f.chunk.js +1 -0
- package/build/static/js/4949.391c96be.chunk.js +2 -0
- package/build/static/js/{2961.54b0c743.chunk.js.LICENSE.txt → 4949.391c96be.chunk.js.LICENSE.txt} +15 -15
- package/build/static/js/5037.03a99abb.chunk.js +1 -0
- package/build/static/js/5299.ad735cb8.chunk.js +1 -0
- package/build/static/js/5361.bc476229.chunk.js +2 -0
- package/build/static/js/5703.a68ecfdc.chunk.js +2 -0
- package/build/static/js/5703.a68ecfdc.chunk.js.LICENSE.txt +40 -0
- package/build/static/js/6134.5e3e3f58.chunk.js +1 -0
- package/build/static/js/6679.f4ee1d77.chunk.js +2 -0
- package/build/static/js/6679.f4ee1d77.chunk.js.LICENSE.txt +62 -0
- package/build/static/js/6802.ffb6887c.chunk.js +1 -0
- package/build/static/js/6865.12e417bf.chunk.js +1 -0
- package/build/static/js/698.7dce549b.chunk.js +1 -0
- package/build/static/js/7125.21833215.chunk.js +1 -0
- package/build/static/js/{7332.52202888.chunk.js → 7332.cb5400eb.chunk.js} +1 -1
- package/build/static/js/7579.7b9cc9ee.chunk.js +1 -0
- package/build/static/js/7652.f436cbbf.chunk.js +1 -0
- package/build/static/js/7696.406d4ef7.chunk.js +1 -0
- package/build/static/js/7895.198c568c.chunk.js +1 -0
- package/build/static/js/790.4b5acd65.chunk.js +1 -0
- package/build/static/js/865.143ae622.chunk.js +1 -0
- package/build/static/js/8801.77babe65.chunk.js +1 -0
- package/build/static/js/9005.87bae37e.chunk.js +1 -0
- package/build/static/js/9166.d35e76c1.chunk.js +2 -0
- package/build/static/js/9166.d35e76c1.chunk.js.LICENSE.txt +13 -0
- package/build/static/js/9311.f444417e.chunk.js +1 -0
- package/build/static/js/9320.14465db9.chunk.js +1 -0
- package/build/static/js/9813.c894655a.chunk.js +1 -0
- package/build/static/js/main.94addb49.js +28 -0
- package/build/static/js/{main.78d8e51a.js.LICENSE.txt → main.94addb49.js.LICENSE.txt} +23 -3
- package/build/static/media/SourceCodePro-Bold.17a68a0751a813474a0e.woff2 +0 -0
- package/build/static/media/SourceCodePro-BoldItalic.d45b7a3df103d441d78b.woff2 +0 -0
- package/build/static/media/SourceCodePro-Italic.ec122a420df4175e74f2.woff2 +0 -0
- package/build/static/media/SourceCodePro-Regular.84b900b88d09398d86b0.woff2 +0 -0
- package/build/static/media/SourceCodePro-SemiBold.17291d1c493cb25eb2c3.woff2 +0 -0
- package/build/static/media/SourceCodePro-SemiBoldItalic.f879ae27307c3926522b.woff2 +0 -0
- package/build/static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2 +0 -0
- package/build/static/media/SourceSansPro-BoldItalic.1d664be59d2eb5fef029.woff2 +0 -0
- package/build/static/media/SourceSansPro-Italic.8a9bfea74d43927d6eec.woff2 +0 -0
- package/build/static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2 +0 -0
- package/build/static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2 +0 -0
- package/build/static/media/SourceSansPro-SemiBoldItalic.befb0a2824eabc5ce36b.woff2 +0 -0
- package/build/static/media/SourceSerifPro-Bold.d7975b56594770699ae0.woff2 +0 -0
- package/build/static/media/SourceSerifPro-BoldItalic.913697a7178b128caa4c.woff2 +0 -0
- package/build/static/media/SourceSerifPro-Italic.d3529cb5797663ac5d88.woff2 +0 -0
- package/build/static/media/SourceSerifPro-Regular.e6c37aa3926474cc93e1.woff2 +0 -0
- package/build/static/media/SourceSerifPro-SemiBold.5c1d378dd5990ef334ca.woff2 +0 -0
- package/build/static/media/SourceSerifPro-SemiBoldItalic.249e948b885d0c7d30a8.woff2 +0 -0
- package/build/static/media/index.c05687ef19f5bac24939.cjs +1 -0
- package/build/static/media/index.cf5b321a6e04bf47c12e.cjs +1 -0
- package/build/static/media/index.db61103fb7fdd62b9c44.cjs +1 -0
- package/build/static/media/index.f29488c1099d5e3883ac.cjs +1 -0
- package/package.json +5 -5
- package/build/static/css/5099.60b7ada4.chunk.css +0 -1
- package/build/static/css/main.73ab603a.css +0 -1
- package/build/static/js/1318.57c335d2.chunk.js +0 -1
- package/build/static/js/142.3d0fb3e3.chunk.js +0 -1
- package/build/static/js/172.0ee3e7c6.chunk.js +0 -5
- package/build/static/js/1839.29b0ce99.chunk.js +0 -1
- package/build/static/js/2327.b8572a38.chunk.js +0 -1
- package/build/static/js/2775.c1ed54fa.chunk.js +0 -5
- package/build/static/js/291.aa03bc71.chunk.js +0 -1
- package/build/static/js/2961.54b0c743.chunk.js +0 -2
- package/build/static/js/3580.31cb6ce5.chunk.js +0 -1
- package/build/static/js/3603.e3f6f11d.chunk.js +0 -2
- package/build/static/js/3603.e3f6f11d.chunk.js.LICENSE.txt +0 -135
- package/build/static/js/3744.6440bac0.chunk.js +0 -2
- package/build/static/js/3744.6440bac0.chunk.js.LICENSE.txt +0 -5
- package/build/static/js/3975.5538132d.chunk.js +0 -1
- package/build/static/js/4140.edb6c36a.chunk.js +0 -1
- package/build/static/js/4141.623ab362.chunk.js +0 -9
- package/build/static/js/4320.5977ee6b.chunk.js +0 -2
- package/build/static/js/4320.5977ee6b.chunk.js.LICENSE.txt +0 -20
- package/build/static/js/5093.304fcb1e.chunk.js +0 -1
- package/build/static/js/5099.51feed45.chunk.js +0 -1
- package/build/static/js/5177.21c4f353.chunk.js +0 -2
- package/build/static/js/5241.0326c97c.chunk.js +0 -1
- package/build/static/js/5440.c7134ed1.chunk.js +0 -1
- package/build/static/js/5617.837c33c0.chunk.js +0 -1
- package/build/static/js/6679.a8b5d830.chunk.js +0 -2
- package/build/static/js/6679.a8b5d830.chunk.js.LICENSE.txt +0 -60
- package/build/static/js/6683.aab9fa01.chunk.js +0 -1
- package/build/static/js/6756.2cb6963c.chunk.js +0 -1
- package/build/static/js/6862.886eab8e.chunk.js +0 -1
- package/build/static/js/6865.b0803b6b.chunk.js +0 -1
- package/build/static/js/6913.30734208.chunk.js +0 -17
- package/build/static/js/6939.c09d92c1.chunk.js +0 -1
- package/build/static/js/787.a500c8a4.chunk.js +0 -1
- package/build/static/js/792.04aad606.chunk.js +0 -1
- package/build/static/js/8035.dc118cc9.chunk.js +0 -1
- package/build/static/js/8295.c3cd87de.chunk.js +0 -1
- package/build/static/js/8418.aed275df.chunk.js +0 -1
- package/build/static/js/8486.e56533d6.chunk.js +0 -1
- package/build/static/js/865.9e23130b.chunk.js +0 -1
- package/build/static/js/9004.6a66722a.chunk.js +0 -1
- package/build/static/js/9042.a6fcbc74.chunk.js +0 -5
- package/build/static/js/9107.b49ea9ea.chunk.js +0 -5
- package/build/static/js/9130.8e10440e.chunk.js +0 -1
- package/build/static/js/9166.1a468fb9.chunk.js +0 -2
- package/build/static/js/9166.1a468fb9.chunk.js.LICENSE.txt +0 -13
- package/build/static/js/9382.c417d448.chunk.js +0 -1
- package/build/static/js/9615.c725e9d2.chunk.js +0 -1
- package/build/static/js/9733.e3808291.chunk.js +0 -2
- package/build/static/js/9733.e3808291.chunk.js.LICENSE.txt +0 -8
- package/build/static/js/9915.fe11690a.chunk.js +0 -1
- package/build/static/js/main.78d8e51a.js +0 -28
- package/build/static/media/SourceCodePro-Bold.52ac8f3034507f1d9e53.ttf +0 -0
- package/build/static/media/SourceCodePro-BoldItalic.05b618077343fbbd92b7.ttf +0 -0
- package/build/static/media/SourceCodePro-Italic.454577c22304619db035.ttf +0 -0
- package/build/static/media/SourceCodePro-Regular.70cc7ff27245e82ad414.ttf +0 -0
- package/build/static/media/SourceCodePro-SemiBold.4d4c53c06b5bebed1cf3.ttf +0 -0
- package/build/static/media/SourceCodePro-SemiBoldItalic.2f5470bc8b2cd27a5c4b.ttf +0 -0
- package/build/static/media/SourceSansPro-Bold.12e6acd2589d00c9d0aa.ttf +0 -0
- package/build/static/media/SourceSansPro-BoldItalic.7c4f9b00300acb82f0f6.ttf +0 -0
- package/build/static/media/SourceSansPro-Italic.3c01996d38a55834ddcb.ttf +0 -0
- package/build/static/media/SourceSansPro-Regular.efa76f8326aa5cee3bdd.ttf +0 -0
- package/build/static/media/SourceSansPro-SemiBold.43cc81b496222dc9ce3c.ttf +0 -0
- package/build/static/media/SourceSansPro-SemiBoldItalic.c30987e28fc21daba1ae.ttf +0 -0
- package/build/static/media/SourceSerifPro-Bold.bada4fe17051c992f22f.ttf +0 -0
- package/build/static/media/SourceSerifPro-BoldItalic.9f9b1eb2d82e26bb2f4a.ttf +0 -0
- package/build/static/media/SourceSerifPro-Italic.90931d6ad253cd8de8e4.ttf +0 -0
- package/build/static/media/SourceSerifPro-Regular.6f22301c30206f4bad62.ttf +0 -0
- package/build/static/media/SourceSerifPro-SemiBold.b27cb117978bab2c80a3.ttf +0 -0
- package/build/static/media/SourceSerifPro-SemiBoldItalic.1266f2c17835efdcff7b.ttf +0 -0
- package/build/static/media/index.09797f5e19b3c0491904.cjs +0 -1
- package/build/static/media/index.1e3d64b0fcde879f0060.cjs +0 -1
- package/build/static/media/index.85823dd8655ed4119d0c.cjs +0 -1
- package/build/static/media/index.b599194a631d76b49328.cjs +0 -1
- /package/build/static/css/{4320.1edfa457.chunk.css → 5703.1edfa457.chunk.css} +0 -0
- /package/build/static/js/{5177.21c4f353.chunk.js.LICENSE.txt → 5361.bc476229.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 4232.b0bbe2e6.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[4232],{94232:(e,t,i)=>{i.r(t),i.d(t,{default:()=>a});var s=i(5057),n=i(70800);const o=function(e,t,i,s){void 0===i&&(i={}),void 0===s&&(s={});const n={},o=function(t){let r=n[t];if(!r){const l=function(e){if("number"===typeof e)return e;if("bokehjs"===e)return 0;if(!s[e]){const t="@bokehjs/";e.slice(0,t.length)===t&&(e=e.slice(t.length))}const t=i[e];if(null!=t)return t;const n=e.length>0&&"/"===e[e.lenght-1],o=i[e+(n?"":"/")+"index"];return null!=o?o:e}(t);if(r=n[l],r)n[t]=r;else{if(!e[l]){if(!1===s[l]||1==s[l]&&parent_require)try{return r={exports:s[l]?parent_require(l):{}},n[l]=n[t]=r,r.exports}catch(a){}const _=new Error("Cannot find module '"+t+"'");throw _.code="MODULE_NOT_FOUND",_}function c(){Object.defineProperty(r.exports,"__esModule",{value:!0})}function h(e,t){Object.defineProperty(r.exports,e,{enumerable:!0,get:function(){return t}})}r={exports:{}},n[l]=n[t]=r,e[l].call(r.exports,o,r,r.exports,c,h)}}return r.exports};o.resolve=function(e){return""};const r=o(0);return r.require=o,"undefined"!==typeof Proxy&&(r.loader=new Proxy({},{get:function(e,t){return o(t)}})),r.register_plugin=function(t,n,a,l){void 0===a&&(a={}),void 0===l&&(l={});for(let i in t)e[i]=t[i];for(let e in a)i[e]=a[e];for(let e in l)s[e]=l[e];const c=o(n);for(let e in c)r[e]=c[e];return c},r}([function(e,t,i,s,n){s(),(0,e(1).__exportStar)(e(2),i)},function(e,t,i,s,n){s();var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],s=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,n,o=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(s=o.next()).done;)r.push(s.value)}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}function l(e){return this instanceof l?(this.v=e,this):new l(e)}i.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i.__assign=function(){return i.__assign=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.__assign.apply(this,arguments)},i.__rest=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(i[s[n]]=e[s[n]])}return i},i.__decorate=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},i.__param=function(e,t){return function(i,s){t(i,s,e)}},i.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i.__awaiter=function(e,t,i,s){return new(i||(i=Promise))((function(n,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((s=s.apply(e,t||[])).next())}))},i.__generator=function(e,t){var i,s,n,o,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,s&&(n=2&o[0]?s.return:o[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,o[1])).done)return n;switch(s=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,s=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){r.label=o[1];break}if(6===o[0]&&r.label<n[1]){r.label=n[1],n=o;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(o);break}n[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e],s=0}finally{i=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i.__createBinding=Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]},i.__exportStar=function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||(0,i.__createBinding)(t,e,s)},i.__values=r,i.__read=a,i.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e},i.__spreadArrays=function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=Array(e),n=0;for(t=0;t<i;t++)for(var o=arguments[t],r=0,a=o.length;r<a;r++,n++)s[n]=o[r];return s},i.__spreadArray=function(e,t,i){if(i||2===arguments.length)for(var s,n=0,o=t.length;n<o;n++)!s&&n in t||(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},i.__await=l,i.__asyncGenerator=function(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,n=i.apply(e,t||[]),o=[];return s={},r("next"),r("throw"),r("return"),s[Symbol.asyncIterator]=function(){return this},s;function r(e){n[e]&&(s[e]=function(t){return new Promise((function(i,s){o.push([e,t,i,s])>1||a(e,t)}))})}function a(e,t){try{(i=n[e](t)).value instanceof l?Promise.resolve(i.value.v).then(c,h):_(o[0][2],i)}catch(e){_(o[0][3],e)}var i}function c(e){a("next",e)}function h(e){a("throw",e)}function _(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},i.__asyncDelegator=function(e){var t,i;return t={},s("next"),s("throw",(function(e){throw e})),s("return"),t[Symbol.iterator]=function(){return this},t;function s(s,n){t[s]=e[s]?function(t){return(i=!i)?{value:l(e[s](t)),done:"return"===s}:n?n(t):t}:n}},i.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=r(e),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(i){t[i]=e[i]&&function(t){return new Promise((function(s,n){!function(e,t,i,s){Promise.resolve(s).then((function(t){e({value:t,done:i})}),t)}(s,n,(t=e[i](t)).done,t.value)}))}}},i.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var c=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};i.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&(0,i.__createBinding)(t,e,s);return c(t,e),t},i.__importDefault=function(e){return e&&e.__esModule?e:{default:e}},i.__classPrivateFieldGet=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)},i.__classPrivateFieldSet=function(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i}},function(e,t,i,s,n){s();const o=e(1);n("version",e(3).version),n("index",e(4).index),i.embed=(0,o.__importStar)(e(4)),i.protocol=(0,o.__importStar)(e(406)),i._testing=(0,o.__importStar)(e(407));var r=e(19);n("logger",r.logger),n("set_log_level",r.set_log_level),n("settings",e(28).settings),n("Models",e(7).Models),n("documents",e(5).documents),n("safely",e(408).safely)},function(e,t,i,s,n){s(),i.version="2.4.3"},function(e,t,i,s,n){s();const o=e(5),r=e(19),a=e(34),l=e(13),c=e(8),h=e(16),_=e(397),u=e(399),d=e(398);var p=e(397);n("add_document_standalone",p.add_document_standalone),n("index",p.index),n("add_document_from_session",e(399).add_document_from_session);var m=e(404);async function g(e,t,i,s){(0,c.isString)(e)&&(e=JSON.parse((0,a.unescape)(e)));const n={};for(const[r,a]of(0,l.entries)(e))n[r]=o.Document.from_json(a);const h=[];for(const o of t){const t=(0,d._resolve_element)(o),a=(0,d._resolve_root_elements)(o);if(null!=o.docid)h.push(await(0,_.add_document_standalone)(n[o.docid],t,a,o.use_for_title));else{if(null==o.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const n=(0,u._get_ws_url)(i,s);r.logger.debug(`embed: computed ws url: ${n}`);try{h.push(await(0,u.add_document_from_session)(n,o.token,t,a,o.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){console.log("Error rendering Bokeh items:",e)}}}}return h}n("embed_items_notebook",m.embed_items_notebook),n("kernels",m.kernels),n("BOKEH_ROOT",e(398).BOKEH_ROOT),i.embed_item=async function(e,t){const i={},s=(0,a.uuid4)();i[s]=e.doc,null==t&&(t=e.target_id);const n=document.getElementById(t);null!=n&&n.classList.add(d.BOKEH_ROOT);const o={roots:{[e.root_id]:t},root_ids:[e.root_id],docid:s};await(0,h.defer)();const[r]=await g(i,[o]);return r},i.embed_items=async function(e,t,i,s){return await(0,h.defer)(),g(e,t,i,s)}},function(e,t,i,s,n){s();const o=e(1);(0,o.__exportStar)(e(6),i),(0,o.__exportStar)(e(35),i)},function(e,t,i,s,n){s();const o=e(1),r=e(7),a=e(3),l=e(19),c=e(251),h=e(14),_=e(30),u=e(15),d=e(17),p=e(31),m=e(29),g=e(9),f=e(13),b=(0,o.__importStar)(e(77)),y=e(26),v=e(8),x=e(309),w=e(75),A=e(53),k=e(396),S=e(35);class T{constructor(e){this.document=e,this.session=null,this.subscribed_models=new Set}send_event(e){const t=new S.MessageSentEvent(this.document,"bokeh_event",e.to_json());this.document._trigger_on_change(t)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}i.EventManager=T,T.__name__="EventManager",i.documents=[],i.DEFAULT_TITLE="Bokeh Application";class C{constructor(e){var t;i.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=null==e?void 0:e.resolver)&&void 0!==t?t:new r.ModelResolver,this._title=i.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new T(this),this.idle=new u.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}get layoutables(){return this._roots.filter((e=>e instanceof x.LayoutDOM))}get is_idle(){for(const e of this.layoutables)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.set(e,!0),this.is_idle&&(l.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new c.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new c.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new c.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,g.copy)(this._roots);this.clear();for(const i of t)if(null!=i.document)throw new Error(`Somehow we didn't detach ${i}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const i of t)e.add_root(i);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){l.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const o of this._roots)e=b.union(e,o.references());const t=new Set(this._all_models.values()),i=b.difference(t,e),s=b.difference(e,t),n=new Map;for(const o of e)n.set(o.id,o);for(const o of i)o.detach_document();for(const o of s)o.attach_document(this);this._all_models=n}roots(){return this._roots}add_root(e,t){if(l.logger.debug(`Adding root: ${e}`),!(0,g.includes)(this._roots,e)){this._push_all_models_freeze();try{this._roots.push(e)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new S.RootAddedEvent(this,e,t))}}remove_root(e,t){const i=this._roots.indexOf(e);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 S.RootRemovedEvent(this,e,t))}}title(){return this._title}set_title(e,t){e!==this._title&&(this._title=e,this._trigger_on_change(new S.TitleChangedEvent(this,e,t)))}get_model_by_id(e){var t;return null!==(t=this._all_models.get(e))&&void 0!==t?t:null}get_model_by_name(e){const t=[];for(const i of this._all_models.values())i instanceof A.Model&&i.name==e&&t.push(i);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const i=this._message_callbacks.get(e);null==i?this._message_callbacks.set(e,new Set([t])):i.add(t)}remove_on_message(e,t){var i;null===(i=this._message_callbacks.get(e))||void 0===i||i.delete(t)}_trigger_on_message(e,t){const i=this._message_callbacks.get(e);if(null!=i)for(const s of i)s(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,i]of this._callbacks)if(!i&&e instanceof S.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_notify_change(e,t,i,s,n){this._trigger_on_change(new S.ModelChangedEvent(this,e,t,i,s,null==n?void 0:n.setter_id,null==n?void 0:n.hint))}static _instantiate_object(e,t,i,s){const n=Object.assign(Object.assign({},i),{id:e,__deferred__:!0});return new(s.get(t))(n)}static _instantiate_references_json(e,t,i){var s;const n=new Map;for(const o of e){const e=o.id,r=o.type,a=null!==(s=o.attributes)&&void 0!==s?s:{};let l=t.get(e);null==l&&(l=C._instantiate_object(e,r,a,i),null!=o.subtype&&l.set_subtype(o.subtype)),n.set(l.id,l)}return n}static _resolve_refs(e,t,i,s){return function e(n){var o;if((0,d.is_ref)(n)){const e=null!==(o=t.get(n.id))&&void 0!==o?o:i.get(n.id);if(null!=e)return e;throw new Error(`reference ${JSON.stringify(n)} isn't known (not in Document?)`)}if((0,p.is_NDArray_ref)(n)){const{buffer:e,dtype:t,shape:i}=(0,p.decode_NDArray)(n,s);return(0,m.ndarray)(e,{dtype:t,shape:i})}return(0,v.isArray)(n)?function(t){const i=[];for(const s of t)i.push(e(s));return i}(n):(0,v.isPlainObject)(n)?function(t){const i={};for(const[s,n]of(0,f.entries)(t))i[s]=e(n);return i}(n):n}(e)}static _initialize_references_json(e,t,i,s){const n=new Map;for(const{id:l,attributes:c}of e){const e=!t.has(l),o=e?i.get(l):t.get(l),r=C._resolve_refs(c,t,i,s);o.setv(r,{silent:!0}),n.set(l,{instance:o,is_new:e})}const o=[],r=new Set;function a(e){if(e instanceof h.HasProps){if(n.has(e.id)&&!r.has(e.id)){r.add(e.id);const{instance:t,is_new:i}=n.get(e.id),{attributes:s}=t;for(const e of(0,f.values)(s))a(e);i&&(t.finalize(),o.push(t))}}else if((0,v.isArray)(e))for(const t of e)a(t);else if((0,v.isPlainObject)(e))for(const t of(0,f.values)(e))a(t)}for(const l of n.values())a(l.instance);for(const l of o)l.connect_signals()}static _event_for_attribute_change(e,t,i,s,n){if(s.get_model_by_id(e.id).property(t).syncable){const o={kind:"ModelChanged",model:{id:e.id},attr:t,new:i};return h.HasProps._json_record_references(s,i,n,{recursive:!0}),o}return null}static _events_to_sync_objects(e,t,i,s){const n=Object.keys(e.attributes),o=Object.keys(t.attributes),r=(0,g.difference)(n,o),a=(0,g.difference)(o,n),c=(0,g.intersection)(n,o),h=[];for(const _ of r)l.logger.warn(`Server sent key ${_} but we don't seem to have it in our JSON`);for(const l of a){const n=t.attributes[l];h.push(C._event_for_attribute_change(e,l,n,i,s))}for(const l of c){const n=e.attributes[l],o=t.attributes[l];null==n&&null==o||(null==n||null==o?h.push(C._event_for_attribute_change(e,l,o,i,s)):"data"==l||(0,y.is_equal)(n,o)||h.push(C._event_for_attribute_change(e,l,o,i,s)))}return h.filter((e=>null!=e))}static _compute_patch_since_json(e,t){const i=t.to_json(!1);function s(e){const t=new Map;for(const i of e.roots.references)t.set(i.id,i);return t}const n=s(e),o=new Map,r=[];for(const _ of e.roots.root_ids)o.set(_,n.get(_)),r.push(_);const a=s(i),l=new Map,c=[];for(const _ of i.roots.root_ids)l.set(_,a.get(_)),c.push(_);if(r.sort(),c.sort(),(0,g.difference)(r,c).length>0||(0,g.difference)(c,r).length>0)throw new Error("Not implemented: computing add/remove of document roots");const h=new Set;let u=[];for(const _ of t._all_models.keys())if(n.has(_)){const e=C._events_to_sync_objects(n.get(_),a.get(_),t,h);u=u.concat(e)}const d=new _.Serializer({include_defaults:!1});return d.to_serializable([...h]),{references:[...d.definitions],events:u}}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new _.Serializer({include_defaults:e}),i=t.to_serializable(this._roots);return{version:a.version,title:this._title,roots:{root_ids:i.map((e=>e.id)),references:[...t.definitions]}}}static from_json_string(e){const t=JSON.parse(e);return C.from_json(t)}static from_json(e){l.logger.debug("Creating Document from JSON");const t=e.version,i=-1!==t.indexOf("+")||-1!==t.indexOf("-"),s=`Library versions: JS (${a.version}) / Python (${t})`;i||a.version.replace(/-(dev|rc)\./,"$1")==t?l.logger.debug(s):(l.logger.warn("JS/Python version mismatch"),l.logger.warn(s));const n=new r.ModelResolver;null!=e.defs&&(0,k.resolve_defs)(e.defs,n);const o=e.roots,c=o.root_ids,h=o.references,_=C._instantiate_references_json(h,new Map,n);C._initialize_references_json(h,new Map,_,new Map);const u=new C({resolver:n});u._push_all_models_freeze();for(const r of c){const e=_.get(r);null!=e&&u.add_root(e)}return u._pop_all_models_freeze(),u.set_title(e.title),u}replace_with_json(e){C.from_json(e).destructively_move(this)}create_json_patch_string(e){return JSON.stringify(this.create_json_patch(e))}create_json_patch(e){for(const s of e)if(s.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new _.Serializer,i=t.to_serializable(e);for(const s of this._all_models.values())t.remove_def(s);return{events:i,references:[...t.definitions]}}apply_json_patch(e,t=new Map,i){const s=e.references,n=e.events,o=C._instantiate_references_json(s,this._all_models,this._resolver);t instanceof Map||(t=new Map(t));for(const c of n)switch(c.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":{const e=c.model.id,t=this._all_models.get(e);if(null!=t)o.set(e,t);else if(!o.has(e))throw l.logger.warn(`Got an event for unknown model ${c.model}"`),new Error("event model wasn't known");break}}const r=new Map(this._all_models),a=new Map;for(const[l,c]of o)r.has(l)||a.set(l,c);C._initialize_references_json(s,r,a,t);for(const l of n)switch(l.kind){case"MessageSent":{const{msg_type:e,msg_data:i}=l;let s;if(void 0===i){if(1!=t.size)throw new Error("expected exactly one buffer");{const[[,e]]=t;s=e}}else s=C._resolve_refs(i,r,a,t);this._trigger_on_message(e,s);break}case"ModelChanged":{const e=l.model.id,s=this._all_models.get(e);if(null==s)throw new Error(`Cannot apply patch to ${e} which is not in the document`);const n=l.attr,o=C._resolve_refs(l.new,r,a,t);s.setv({[n]:o},{setter_id:i});break}case"ColumnDataChanged":{const e=l.column_source.id,s=this._all_models.get(e);if(null==s)throw new Error(`Cannot stream to ${e} which is not in the document`);const n=C._resolve_refs(l.new,new Map,new Map,t);if(null!=l.cols)for(const t in s.data)t in n||(n[t]=s.data[t]);s.setv({data:n},{setter_id:i,check_eq:!1});break}case"ColumnsStreamed":{const e=l.column_source.id,t=this._all_models.get(e);if(null==t)throw new Error(`Cannot stream to ${e} which is not in the document`);if(!(t instanceof w.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");const s=l.data,n=l.rollover;t.stream(s,n,i);break}case"ColumnsPatched":{const e=l.column_source.id,t=this._all_models.get(e);if(null==t)throw new Error(`Cannot patch ${e} which is not in the document`);if(!(t instanceof w.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");const s=l.patches;t.patch(s,i);break}case"RootAdded":{const e=l.model.id,t=o.get(e);this.add_root(t,i);break}case"RootRemoved":{const e=l.model.id,t=o.get(e);this.remove_root(t,i);break}case"TitleChanged":this.set_title(l.title,i);break;default:throw new Error(`Unknown patch event ${JSON.stringify(l)}`)}}}i.Document=C,C.__name__="Document"},function(e,t,i,s,n){s();const o=e(1),r=e(8),a=e(13),l=e(14);i.overrides={};const c=new Map;i.Models=e=>{const t=i.Models.get(e);if(null!=t)return t;throw new Error(`Model '${e}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)},i.Models.get=e=>{var t;return null!==(t=i.overrides[e])&&void 0!==t?t:c.get(e)},i.Models.register=(e,t)=>{i.overrides[e]=t},i.Models.unregister=e=>{delete i.overrides[e]},i.Models.register_models=(e,t=!1,i)=>{var s;if(null!=e)for(const n of(0,r.isArray)(e)?e:(0,a.values)(e))if(s=n,(0,r.isObject)(s)&&s.prototype instanceof l.HasProps){const e=n.__qualified__;t||!c.has(e)?c.set(e,n):null!=i?i(e):console.warn(`Model '${e}' was already registered`)}},i.register_models=i.Models.register_models,i.Models.registered_names=()=>[...c.keys()];class h{constructor(){this._known_models=new Map}get(e,t){var s;const n=null!==(s=i.Models.get(e))&&void 0!==s?s:this._known_models.get(e);if(null!=n)return n;if(void 0!==t)return t;throw new Error(`Model '${e}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)}register(e){const t=e.__qualified__;null==this.get(t,null)?this._known_models.set(t,e):console.warn(`Model '${t}' was already registered with this resolver`)}}i.ModelResolver=h,h.__name__="ModelResolver";const _=(0,o.__importStar)(e(38));(0,i.register_models)(_);const u=(0,o.__importStar)(e(392));(0,i.register_models)(u)},function(e,t,i,s,n){s();const o=e(9),r=Object.prototype.toString;function a(e){return!0===e||!1===e||"[object Boolean]"===r.call(e)}function l(e){return"[object Number]"===r.call(e)}function c(e){return"[object String]"===r.call(e)}function h(e){return"symbol"==typeof e}function _(e){const t=typeof e;return"function"===t||"object"===t&&!!e}function u(e){return _(e)&&void 0!==e[Symbol.iterator]}i.isBoolean=a,i.isNumber=l,i.isInteger=function(e){return l(e)&&Number.isInteger(e)},i.isString=c,i.isSymbol=h,i.isPrimitive=function(e){return null===e||a(e)||l(e)||c(e)||h(e)},i.isFunction=function(e){return"[object Function]"===r.call(e)},i.isArray=function(e){return Array.isArray(e)},i.isArrayOf=function(e,t){return(0,o.every)(e,t)},i.isArrayableOf=function(e,t){for(let i=0,s=e.length;i<s;i++)if(!t(e[i]))return!1;return!0},i.isTypedArray=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},i.isObject=_,i.isPlainObject=function(e){return _(e)&&(null==e.constructor||e.constructor===Object)},i.isIterable=u,i.isArrayable=function(e){return u(e)&&"length"in e}},function(e,t,i,s,n){s();const o=e(10),r=e(11),a=e(12);n("map",a.map),n("reduce",a.reduce),n("min",a.min),n("min_by",a.min_by),n("max",a.max),n("max_by",a.max_by),n("sum",a.sum),n("cumsum",a.cumsum),n("every",a.every),n("some",a.some),n("find",a.find),n("find_last",a.find_last),n("find_index",a.find_index),n("find_last_index",a.find_last_index),n("sorted_index",a.sorted_index),n("is_empty",a.is_empty);const l=Array.prototype.slice;function c(e){return l.call(e)}function h(e){return[].concat(...e)}function _(e,t){return-1!==e.indexOf(t)}function u(e,t,i=1){(0,r.assert)(i>0,"'step' must be a positive number"),null==t&&(t=e,e=0);const{max:s,ceil:n,abs:o}=Math,a=e<=t?i:-i,l=s(n(o(t-e)/i),0),c=new Array(l);for(let r=0;r<l;r++,e+=a)c[r]=e;return c}i.head=function(e){return e[0]},i.tail=function(e){return e[e.length-1]},i.last=function(e){return e[e.length-1]},i.copy=c,i.concat=h,i.includes=_,i.contains=_,i.nth=function(e,t){return e[t>=0?t:e.length+t]},i.zip=function(...e){if(0==e.length)return[];const t=(0,a.min)(e.map((e=>e.length))),i=e.length,s=new Array(t);for(let n=0;n<t;n++){s[n]=new Array(i);for(let t=0;t<i;t++)s[n][t]=e[t][n]}return s},i.unzip=function(e){const t=e.length,i=(0,a.min)(e.map((e=>e.length))),s=Array(i);for(let n=0;n<i;n++)s[n]=new Array(t);for(let n=0;n<t;n++)for(let t=0;t<i;t++)s[t][n]=e[n][t];return s},i.range=u,i.linspace=function(e,t,i=100){const s=(t-e)/(i-1),n=new Array(i);for(let o=0;o<i;o++)n[o]=e+s*o;return n},i.transpose=function(e){const t=e.length,i=e[0].length,s=[];for(let n=0;n<i;n++){s[n]=[];for(let i=0;i<t;i++)s[n][i]=e[i][n]}return s},i.argmin=function(e){return(0,a.min_by)(u(e.length),(t=>e[t]))},i.argmax=function(e){return(0,a.max_by)(u(e.length),(t=>e[t]))},i.sort_by=function(e,t){const i=e.map(((e,i)=>({value:e,index:i,key:t(e)})));return i.sort(((e,t)=>{const i=e.key,s=t.key;if(i!==s){if(i>s||void 0===i)return 1;if(i<s||void 0===s)return-1}return e.index-t.index})),i.map((e=>e.value))},i.uniq=function(e){const t=new Set;for(const i of e)t.add(i);return[...t]},i.uniq_by=function(e,t){const i=[],s=[];for(const n of e){const e=t(n);_(s,e)||(s.push(e),i.push(n))}return i},i.union=function(...e){const t=new Set;for(const i of e)for(const e of i)t.add(e);return[...t]},i.intersection=function(e,...t){const i=[];e:for(const s of e)if(!_(i,s)){for(const e of t)if(!_(e,s))continue e;i.push(s)}return i},i.difference=function(e,...t){const i=h(t);return e.filter((e=>!_(i,e)))},i.remove_at=function(e,t){const i=c(e);return i.splice(t,1),i},i.remove_by=function(e,t){for(let i=0;i<e.length;)t(e[i])?e.splice(i,1):i++},i.shuffle=function(e){const t=e.length,i=new Array(t);for(let s=0;s<t;s++){const t=(0,o.randomIn)(0,s);t!==s&&(i[s]=i[t]),i[t]=e[s]}return i},i.pairwise=function(e,t){const i=e.length,s=new Array(i-1);for(let n=0;n<i-1;n++)s[n]=t(e[n],e[n+1]);return s},i.reversed=function(e){const t=e.length,i=new Array(t);for(let s=0;s<t;s++)i[t-s-1]=e[s];return i},i.repeat=function(e,t){const i=new Array(t);for(let s=0;s<t;s++)i[s]=e;return i}},function(e,t,i,s,n){s();const{PI:o}=Math;function r(e){if(0==e)return 0;for(;e<=0;)e+=2*o;for(;e>2*o;)e-=2*o;return e}function a(e,t){return r(e-t)}function l(){return Math.random()}function c(e){switch(e){case"deg":return o/180;case"rad":return 1;case"grad":return o/200;case"turn":return 2*o}}i.angle_norm=r,i.angle_dist=a,i.angle_between=function(e,t,i,s=!1){const n=a(t,i);if(0==n)return!1;if(n==2*o)return!0;const l=r(e),c=a(t,l)<=n&&a(l,i)<=n;return s?!c:c},i.random=l,i.randomIn=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},i.atan2=function(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])},i.radians=function(e){return e*(o/180)},i.degrees=function(e){return e/(o/180)},i.resolve_angle=function(e,t){return-c(t)*e},i.to_radians_coeff=c,i.rnorm=function(e,t){let i,s;for(;i=l(),s=l(),s=(2*s-1)*Math.sqrt(1/Math.E*2),!(-4*i*i*Math.log(i)>=s*s););let n=s/i;return n=e+t*n,n},i.clamp=function(e,t,i){return e<t?t:e>i?i:e},i.log=function(e,t=Math.E){return Math.log(e)/Math.log(t)},i.float32_epsilon=1.1920928955078125e-7},function(e,t,i,s,n){s();class o extends Error{}i.AssertionError=o,o.__name__="AssertionError",i.assert=function(e,t){if(!(!0===e||!1!==e&&e()))throw new o(null!=t?t:"Assertion failed")},i.unreachable=function(){throw new Error("unreachable code")}},function(e,t,i,s,n){s();const o=e(10);function r(e,t,i,...s){const n=e.length;t<0&&(t+=n),t<0?t=0:t>n&&(t=n),null==i||i>n-t?i=n-t:i<0&&(i=0);const o=n-i+s.length,r=new e.constructor(o);let a=0;for(;a<t;a++)r[a]=e[a];for(const l of s)r[a++]=l;for(let l=t+i;l<n;l++)r[a++]=e[l];return r}function a(e,t){return r(e,t,e.length-t)}function l(e,t){const i=e.length,s=new e.constructor(i);for(let n=0;n<i;n++)s[n]=t(e[n],n,e);return s}function c(e,t,i){const s=e.length;if(void 0===i&&0==s)throw new Error("can't reduce an empty array without an initial value");let n,o;for(void 0===i?(n=e[0],o=1):(n=i,o=0);o<s;o++)n=t(n,e[o],o,e);return n}function h(e){return function(t,i){const s=t.length;let n=e>0?0:s-1;for(;n>=0&&n<s;n+=e)if(i(t[n]))return n;return-1}}function _(e,t){let i=0,s=e.length;for(;i<s;){const n=Math.floor((i+s)/2);e[n]<t?i=n+1:s=n}return i}function u(e,t,i,s,n){const o=(n-i)/(s-t);let r=o*(e-t)+i;return isFinite(r)||(r=o*(e-s)+n,isFinite(r)||i!=n||(r=i)),r}function d(e,t){if(e<t[0])return-1;if(e>t[t.length-1])return t.length;let i=0,s=t.length-1;for(;s-i!=1;){const n=i+Math.floor((s-i)/2);e>=t[n]?i=n:s=n}return i}i.is_empty=function(e){return 0==e.length},i.copy=function(e){return Array.isArray(e)?e.slice():new e.constructor(e)},i.splice=r,i.head=a,i.insert=function(e,t,i){return r(e,i,0,t)},i.append=function(e,t){return r(e,e.length,0,t)},i.prepend=function(e,t){return r(e,0,0,t)},i.indexOf=function(e,t){for(let i=0,s=e.length;i<s;i++)if(e[i]===t)return i;return-1},i.subselect=function(e,t){const i=t.length,s=new e.constructor(i);for(let n=0;n<i;n++)s[n]=e[t[n]];return s},i.mul=function(e,t,i){const s=e.length,n=null!=i?i:new e.constructor(s);for(let o=0;o<s;o++)n[o]=e[o]*t;return n},i.map=l,i.inplace_map=function(e,t,i){const s=e.length,n=null!=i?i:e;for(let o=0;o<s;o++)n[o]=t(e[o],o)},i.filter=function(e,t){const i=e.length,s=new e.constructor(i);let n=0;for(let o=0;o<i;o++){const i=e[o];t(i,o,e)&&(s[n++]=i)}return a(s,n)},i.reduce=c,i.min=function(e){let t,i=1/0;for(let s=0,n=e.length;s<n;s++)t=e[s],!isNaN(t)&&t<i&&(i=t);return i},i.max=function(e){let t,i=-1/0;for(let s=0,n=e.length;s<n;s++)t=e[s],!isNaN(t)&&t>i&&(i=t);return i},i.minmax=function(e){let t,i=1/0,s=-1/0;for(let n=0,o=e.length;n<o;n++)t=e[n],isNaN(t)||(t<i&&(i=t),t>s&&(s=t));return[i,s]},i.minmax2=function(e,t){let i,s,n=1/0,o=-1/0,r=1/0,a=-1/0;const l=Math.min(e.length,t.length);for(let c=0;c<l;c++)i=e[c],s=t[c],isNaN(i)||isNaN(s)||(i<n&&(n=i),i>o&&(o=i),s<r&&(r=s),s>a&&(a=s));return[n,o,r,a]},i.min_by=function(e,t){if(0==e.length)throw new Error("min_by() called with an empty array");let i=e[0],s=t(i);for(let n=1,o=e.length;n<o;n++){const o=e[n],r=t(o);r<s&&(i=o,s=r)}return i},i.max_by=function(e,t){if(0==e.length)throw new Error("max_by() called with an empty array");let i=e[0],s=t(i);for(let n=1,o=e.length;n<o;n++){const o=e[n],r=t(o);r>s&&(i=o,s=r)}return i},i.sum=function(e){let t=0;for(let i=0,s=e.length;i<s;i++)t+=e[i];return t},i.cumsum=function(e){const t=new e.constructor(e.length);return c(e,((e,i,s)=>t[s]=e+i),0),t},i.every=function(e,t){for(let i=0,s=e.length;i<s;i++)if(!t(e[i]))return!1;return!0},i.some=function(e,t){for(let i=0,s=e.length;i<s;i++)if(t(e[i]))return!0;return!1},i.index_of=function(e,t){for(let i=0,s=e.length;i<s;i++)if(e[i]===t)return i;return-1},i.find_index=h(1),i.find_last_index=h(-1),i.find=function(e,t){const s=(0,i.find_index)(e,t);return-1==s?void 0:e[s]},i.find_last=function(e,t){const s=(0,i.find_last_index)(e,t);return-1==s?void 0:e[s]},i.sorted_index=_,i.bin_counts=function(e,t){const i=t.length-1,s=Array(i).fill(0);for(let n=0;n<e.length;n++){const r=_(t,e[n]);s[(0,o.clamp)(r-1,0,i-1)]+=1}return s},i.interpolate=function(e,t,i){const s=e.length,n=new Array(s);for(let o=0;o<s;o++){const s=e[o];if(isNaN(s)){n[o]=s;continue}const r=d(s,t);if(-1==r)n[o]=i[0];else if(r==t.length)n[o]=i[i.length-1];else if(r==t.length-1||t[r]==s)n[o]=i[r];else{const e=t[r],a=i[r],l=t[r+1],c=i[r+1];n[o]=u(s,e,a,l,c)}}return n},i.left_edge_index=d,i.norm=function(e,t,i){const s=i-t;return l(e,(e=>(e-t)/s))}},function(e,t,i,s,n){s();const o=e(9),{hasOwnProperty:r}=Object.prototype;function a(e){return Object.keys(e).length}function l(e){return 0==a(e)}i.keys=Object.keys,i.values=Object.values,i.entries=Object.entries,i.extend=Object.assign,i.clone=function(e){return Object.assign({},e)},i.merge=function(e,t){const i=Object.create(Object.prototype),s=(0,o.concat)([Object.keys(e),Object.keys(t)]);for(const n of s){const s=r.call(e,n)?e[n]:[],a=r.call(t,n)?t[n]:[];i[n]=(0,o.union)(s,a)}return i},i.size=a,i.is_empty=l,i.isEmpty=l,i.to_object=function(e){const t={};for(const[i,s]of e)t[i]=s;return t}},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(15),l=e(17),c=(0,o.__importStar)(e(18)),h=(0,o.__importStar)(e(21)),_=e(34),u=e(13),d=e(8),p=e(26),m=e(30),g=e(35),f=e(26),b=e(36),y=e(37),v=(0,o.__importStar)(e(21));class x extends((0,a.Signalable)()){constructor(e={}){var t,i;super(),this._subtype=void 0,this.document=null,this.destroyed=new a.Signal0(this,"destroyed"),this.change=new a.Signal0(this,"change"),this.transformchange=new a.Signal0(this,"transformchange"),this.exprchange=new a.Signal0(this,"exprchange"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const s=e instanceof Map?e.get.bind(e):t=>e[t];this.id=null!==(t=s("id"))&&void 0!==t?t:(0,_.uniqueId)();for(const[n,{type:o,default_value:r,options:a}]of(0,u.entries)(this._props)){let e;o instanceof c.PropertyAlias?Object.defineProperty(this.properties,n,{get:()=>this.properties[o.attr],configurable:!1,enumerable:!1}):(e=o instanceof h.Kind?new c.PrimitiveProperty(this,n,o,r,s(n),a):new o(this,n,h.Any,r,s(n),a),this.properties[n]=e)}null!==(i=s("__deferred__"))&&void 0!==i&&i||(this.finalize(),this.connect_signals())}get is_syncable(){return!0}set type(e){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=e}get type(){return this.constructor.__qualified__}static get __qualified__(){const{__module__:e,__name__:t}=this;return null!=e?`${e}.${t}`:t}static get[Symbol.toStringTag](){return this.__name__}static _fix_default(e,t){if(void 0===e||(0,d.isFunction)(e))return e;if((0,d.isPrimitive)(e))return()=>e;{const t=new y.Cloner;return()=>t.clone(e)}}static define(e){for(const[t,i]of(0,u.entries)((0,d.isFunction)(e)?e(v):e)){if(null!=this.prototype._props[t])throw new Error(`attempted to redefine property '${this.prototype.type}.${t}'`);if(null!=this.prototype[t])throw new Error(`attempted to redefine attribute '${this.prototype.type}.${t}'`);Object.defineProperty(this.prototype,t,{get(){return this.properties[t].get_value()},set(e){return this.setv({[t]:e}),this},configurable:!1,enumerable:!0});const[e,s,n={}]=i,o={type:e,default_value:this._fix_default(s,t),options:n},r=Object.assign({},this.prototype._props);r[t]=o,this.prototype._props=r}}static internal(e){const t={};for(const[i,s]of(0,u.entries)((0,d.isFunction)(e)?e(v):e)){const[e,n,o={}]=s;t[i]=[e,n,Object.assign(Object.assign({},o),{internal:!0})]}this.define(t)}static mixins(e){function t(e,t){const i={};for(const[s,n]of(0,u.entries)(t))i[e+s]=n;return i}const i={},s=[];for(const n of(0,d.isArray)(e)?e:[e])if((0,d.isArray)(n)){const[e,o]=n;(0,u.extend)(i,t(e,o)),s.push([e,o])}else{const e=n;(0,u.extend)(i,e),s.push(["",e])}this.define(i),this.prototype._mixins=[...this.prototype._mixins,...s]}static override(e){for(const[t,i]of(0,u.entries)(e)){const e=this._fix_default(i,t),s=this.prototype._props[t];if(null==s)throw new Error(`attempted to override nonexistent '${this.prototype.type}.${t}'`);const n=Object.assign({},this.prototype._props);n[t]=Object.assign(Object.assign({},s),{default_value:e}),this.prototype._props=n}}toString(){return`${this.type}(${this.id})`}property(e){const t=this.properties[e];if(null!=t)return t;throw new Error(`unknown property ${this.type}.${e}`)}get attributes(){const e={};for(const t of this)e[t.attr]=t.get_value();return e}[y.clone](e){const t=new Map;for(const i of this)i.dirty&&t.set(i.attr,e.clone(i.get_value()));return new this.constructor(t)}[f.equals](e,t){for(const i of this){const s=e.property(i.attr);if(!t.eq(i.get_value(),s.get_value()))return!1}return!0}[b.pretty](e){const t=e.token,i=[];for(const s of this)if(s.dirty){const n=s.get_value();i.push(`${s.attr}${t(":")} ${e.to_string(n)}`)}return`${this.constructor.__qualified__}${t("(")}${t("{")}${i.join(`${t(",")} `)}${t("}")}${t(")")}`}[m.serialize](e){const t=this.ref();e.add_ref(this,t);const i=this.struct();for(const s of this)s.syncable&&(e.include_defaults||s.dirty)&&(i.attributes[s.attr]=e.to_serializable(s.get_value()));return e.add_def(this,i),t}finalize(){for(const e of this){if(!(e instanceof c.VectorSpec||e instanceof c.ScalarSpec))continue;const t=e.get_value();if(null!=t){const{transform:e,expr:i}=t;null!=e&&this.connect(e.change,(()=>this.transformchange.emit())),null!=i&&this.connect(i.change,(()=>this.exprchange.emit()))}}this.initialize()}initialize(){}connect_signals(){}disconnect_signals(){a.Signal.disconnectReceiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new y.Cloner).clone(this)}changed_for(e){const t=this._watchers.get(e);return this._watchers.set(e,!1),null==t||t}_setv(e,t){const i=t.check_eq,s=[],n=this._changing;this._changing=!0;for(const[o,r]of e)!1!==i&&(0,p.is_equal)(o.get_value(),r)||(o.set_value(r),s.push(o));s.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(const o of s)o.change.emit();if(!n){if(!t.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}setv(e,t={}){const i=(0,u.entries)(e);if(0==i.length)return;if(!0===t.silent){this._watchers=new WeakMap;for(const[e,t]of i)this.properties[e].set_value(t);return}const s=new Map,n=new Map;for(const[r,a]of i){const e=this.properties[r];s.set(e,a),n.set(e,e.get_value())}this._setv(s,t);const{document:o}=this;if(null!=o){const e=[];for(const[t,i]of n)e.push([t,i,t.get_value()]);for(const[,t,i]of e)if(this._needs_invalidate(t,i)){o._invalidate_all_models();break}this._push_changes(e,t)}}getv(e){return this.property(e).get_value()}ref(){return{id:this.id}}struct(){const e={type:this.type,id:this.id,attributes:{}};return null!=this._subtype&&(e.subtype=this._subtype),e}set_subtype(e){this._subtype=e}*[Symbol.iterator](){yield*(0,u.values)(this.properties)}*syncable_properties(){for(const e of this)e.syncable&&(yield e)}serializable_attributes(){const e={};for(const t of this.syncable_properties())e[t.attr]=t.get_value();return e}static _json_record_references(e,t,i,s){const{recursive:n}=s;if((0,l.is_ref)(t)){const s=e.get_model_by_id(t.id);null==s||i.has(s)||x._value_record_references(s,i,{recursive:n})}else if((0,d.isArray)(t))for(const o of t)x._json_record_references(e,o,i,{recursive:n});else if((0,d.isPlainObject)(t))for(const o of(0,u.values)(t))x._json_record_references(e,o,i,{recursive:n})}static _value_record_references(e,t,i){const{recursive:s}=i;if(e instanceof x){if(!t.has(e)&&(t.add(e),s))for(const n of e.syncable_properties()){const e=n.get_value();x._value_record_references(e,t,{recursive:s})}}else if((0,d.isArray)(e))for(const n of e)x._value_record_references(n,t,{recursive:s});else if((0,d.isPlainObject)(e))for(const n of(0,u.values)(e))x._value_record_references(n,t,{recursive:s})}references(){const e=new Set;return x._value_record_references(this,e,{recursive:!0}),e}_doc_attached(){}_doc_detached(){}attach_document(e){if(null!=this.document&&this.document!=e)throw new Error("models must be owned by only a single document");this.document=e,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(e,t){const i=new Set;x._value_record_references(t,i,{recursive:!1});const s=new Set;x._value_record_references(e,s,{recursive:!1});for(const n of i)if(!s.has(n))return!0;for(const n of s)if(!i.has(n))return!0;return!1}_push_changes(e,t={}){if(!this.is_syncable)return;const{document:i}=this;if(null==i)return;const{setter_id:s}=t,n=[];for(const[o,r,a]of e)o.syncable&&n.push(new g.ModelChangedEvent(i,this,o.attr,r,a,s));if(0!=n.length){let e;1==n.length?[e]=n:e=new g.DocumentEventBatch(i,n,s),i._trigger_on_change(e)}}on_change(e,t){for(const i of(0,d.isArray)(e)?e:[e])this.connect(i.change,t)}}i.HasProps=x,(r=x).prototype._props={},r.prototype._mixins=[]},function(e,t,i,s,n){s();const o=e(16),r=e(9);class a{constructor(e,t){this.sender=e,this.name=t}connect(e,t=null){c.has(this.sender)||c.set(this.sender,[]);const i=c.get(this.sender);if(null!=_(i,this,e,t))return!1;const s=null!=t?t:e;h.has(s)||h.set(s,[]);const n=h.get(s),o={signal:this,slot:e,context:t};return i.push(o),n.push(o),!0}disconnect(e,t=null){const i=c.get(this.sender);if(null==i||0===i.length)return!1;const s=_(i,this,e,t);if(null==s)return!1;const n=null!=t?t:e,o=h.get(n);return s.signal=null,d(i),d(o),!0}emit(e){var t;const i=null!==(t=c.get(this.sender))&&void 0!==t?t:[];for(const{signal:s,slot:n,context:o}of i)s===this&&n.call(o,e,this.sender)}}i.Signal=a,a.__name__="Signal";class l extends a{emit(){super.emit(void 0)}}i.Signal0=l,l.__name__="Signal0",function(e){function t(e,t){const i=c.get(e);if(null==i||0===i.length)return;const s=h.get(t);if(null!=s&&0!==s.length){for(const t of s){if(null==t.signal)return;t.signal.sender===e&&(t.signal=null)}d(i),d(s)}}function i(e){var t;const i=c.get(e);if(null!=i&&0!==i.length){for(const e of i){if(null==e.signal)return;const i=null!==(t=e.context)&&void 0!==t?t:e.slot;e.signal=null,d(h.get(i))}d(i)}}function s(e,t,i){const s=h.get(e);if(null!=s&&0!==s.length){for(const e of s){if(null==e.signal)return;if(null!=t&&e.slot!=t)continue;const s=e.signal.sender;null!=i&&i.has(s)||(e.signal=null,d(c.get(s)))}d(s)}}function n(e){const t=c.get(e);if(null!=t&&0!==t.length){for(const e of t)e.signal=null;d(t)}const i=h.get(e);if(null!=i&&0!==i.length){for(const e of i)e.signal=null;d(i)}}e.disconnect_between=t,e.disconnect_sender=i,e.disconnect_receiver=s,e.disconnect_all=n,e.disconnectBetween=t,e.disconnectSender=i,e.disconnectReceiver=s,e.disconnectAll=n}(a||(i.Signal=a={})),i.Signalable=function(){return class{connect(e,t){return e.connect(t,this)}disconnect(e,t){return e.disconnect(t,this)}}};const c=new WeakMap,h=new WeakMap;function _(e,t,i,s){return(0,r.find)(e,(e=>e.signal===t&&e.slot===i&&e.context===s))}const u=new Set;function d(e){0===u.size&&(async()=>{await(0,o.defer)(),function(){for(const e of u)(0,r.remove_by)(e,(e=>null==e.signal));u.clear()}()})(),u.add(e)}},function(e,t,i,s,n){s();const o=new MessageChannel,r=new Map;o.port1.onmessage=e=>{const t=e.data,i=r.get(t);if(null!=i)try{i()}finally{r.delete(t)}};let a=1;i.defer=function(){return new Promise((e=>{const t=a++;r.set(t,e),o.port2.postMessage(t)}))},i.wait=function(e){return new Promise((t=>setTimeout(t,e)))}},function(e,t,i,s,n){s();const o=e(8),r=e(13);i.is_ref=function(e){if((0,o.isPlainObject)(e)){const t=(0,r.keys)(e);return 1==t.length&&"id"==t[0]}return!1}},function(e,t,i,s,n){s(),i.YCoordinateSeqSeqSeqSpec=i.XCoordinateSeqSeqSeqSpec=i.YCoordinateSeqSpec=i.XCoordinateSeqSpec=i.YCoordinateSpec=i.XCoordinateSpec=i.CoordinateSeqSeqSeqSpec=i.CoordinateSeqSpec=i.CoordinateSpec=i.BaseCoordinateSpec=i.NumberUnitsSpec=i.UnitsSpec=i.DataSpec=i.VectorSpec=i.TextBaselineScalar=i.TextAlignScalar=i.FontStyleScalar=i.FontSizeScalar=i.FontScalar=i.LineDashScalar=i.LineCapScalar=i.LineJoinScalar=i.ArrayScalar=i.NullStringScalar=i.StringScalar=i.NumberScalar=i.ColorScalar=i.AnyScalar=i.ScalarSpec=i.VerticalAlign=i.UpdateMode=i.TooltipAttachment=i.TickLabelOrientation=i.TextureRepetition=i.TextBaseline=i.TextAlign=i.TapBehavior=i.StepMode=i.StartEnd=i.SpatialUnits=i.Sort=i.SizingMode=i.Side=i.RoundingFunction=i.ResetPolicy=i.RenderMode=i.RenderLevel=i.RadiusDimension=i.PointPolicy=i.Place=void 0,i.TextBaselineSpec=i.TextAlignSpec=i.FontStyleSpec=i.FontSizeSpec=i.FontSpec=i.LineDashSpec=i.LineCapSpec=i.LineJoinSpec=i.MarkerSpec=i.ArraySpec=i.NullStringSpec=i.StringSpec=i.AnySpec=i.NDArraySpec=i.ColorSpec=i.ScreenSizeSpec=i.NumberSpec=i.IntSpec=i.BooleanSpec=i.NullDistanceSpec=i.DistanceSpec=i.AngleSpec=void 0;const o=e(1),r=e(15),a=e(19),l=(0,o.__importStar)(e(20)),c=e(24),h=e(9),_=e(12),u=e(10),d=e(22),p=e(27),m=e(8),g=e(28),f=e(29),b=e(33);function y(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function v(e){return(0,m.isPlainObject)(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)==1}n("Uniform",b.Uniform),n("UniformScalar",b.UniformScalar),n("UniformVector",b.UniformVector),i.isSpec=v;class x{constructor(e,t,i,s,n,o={}){var a;let l;if(this.obj=e,this.attr=t,this.kind=i,this.default_value=s,this._dirty=!1,this.change=new r.Signal0(this.obj,"change"),this.internal=null!==(a=o.internal)&&void 0!==a&&a,this.convert=o.convert,this.on_update=o.on_update,void 0!==n)l=n,this._dirty=!0;else{const t=this._default_override();if(void 0!==t)l=t;else{if(void 0===s)return void(this.spec={value:null});l=s(e)}}this._update(l)}get is_value(){return void 0!==this.spec.value}get syncable(){return!this.internal}get_value(){return this.spec.value}set_value(e){this._update(e),this._dirty=!0}_default_override(){}get dirty(){return this._dirty}_update(e){var t;if(this.validate(e),null!=this.convert){const t=this.convert(e);void 0!==t&&(e=t)}this.spec={value:e},null===(t=this.on_update)||void 0===t||t.call(this,e,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, spec: ${y(this.spec)})`}normalize(e){return e}validate(e){if(!this.valid(e))throw new Error(`${this.obj}.${this.attr} given invalid value: ${y(e)}`)}valid(e){return this.kind.valid(e)}_value(e=!0){if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");let t=this.normalize([this.spec.value])[0];return null!=this.spec.transform&&e&&(t=this.spec.transform.compute(t)),t}}i.Property=x,x.__name__="Property";class w{constructor(e){this.attr=e}}i.PropertyAlias=w,w.__name__="PropertyAlias",i.Alias=function(e){return new w(e)};class A extends x{}i.PrimitiveProperty=A,A.__name__="PrimitiveProperty";class k extends x{}i.Any=k,k.__name__="Any";class S extends x{valid(e){return(0,m.isArray)(e)||(0,m.isTypedArray)(e)}}i.Array=S,S.__name__="Array";class T extends x{valid(e){return(0,m.isBoolean)(e)}}i.Boolean=T,T.__name__="Boolean";class C extends x{valid(e){return(0,d.is_Color)(e)}}i.Color=C,C.__name__="Color";class M extends x{}i.Instance=M,M.__name__="Instance";class z extends x{valid(e){return(0,m.isNumber)(e)}}i.Number=z,z.__name__="Number";class E extends z{valid(e){return(0,m.isNumber)(e)&&(0|e)==e}}i.Int=E,E.__name__="Int";class R extends z{}i.Angle=R,R.__name__="Angle";class B extends z{valid(e){return(0,m.isNumber)(e)&&0<=e&&e<=1}}i.Percent=B,B.__name__="Percent";class N extends x{valid(e){return(0,m.isString)(e)}}i.String=N,N.__name__="String";class O extends x{valid(e){return null===e||(0,m.isString)(e)}}i.NullString=O,O.__name__="NullString";class D extends N{}i.FontSize=D,D.__name__="FontSize";class I extends N{_default_override(){return g.settings.dev?"Bokeh":void 0}}i.Font=I,I.__name__="Font";class P extends x{valid(e){return(0,m.isString)(e)&&(0,h.includes)(this.enum_values,e)}}function V(e){return class extends P{get enum_values(){return[...e]}}}i.EnumProperty=P,P.__name__="EnumProperty",i.Enum=V;class L extends P{get enum_values(){return[...l.Direction]}normalize(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)switch(e[i]){case"clock":t[i]=0;break;case"anticlock":t[i]=1}return t}}i.Direction=L,L.__name__="Direction",i.Anchor=V(l.Anchor),i.AngleUnits=V(l.AngleUnits),i.BoxOrigin=V(l.BoxOrigin),i.ButtonType=V(l.ButtonType),i.CalendarPosition=V(l.CalendarPosition),i.Dimension=V(l.Dimension),i.Dimensions=V(l.Dimensions),i.Distribution=V(l.Distribution),i.FontStyle=V(l.FontStyle),i.HatchPatternType=V(l.HatchPatternType),i.HTTPMethod=V(l.HTTPMethod),i.HexTileOrientation=V(l.HexTileOrientation),i.HoverMode=V(l.HoverMode),i.LatLon=V(l.LatLon),i.LegendClickPolicy=V(l.LegendClickPolicy),i.LegendLocation=V(l.LegendLocation),i.LineCap=V(l.LineCap),i.LineJoin=V(l.LineJoin),i.LinePolicy=V(l.LinePolicy),i.Location=V(l.Location),i.Logo=V(l.Logo),i.MarkerType=V(l.MarkerType),i.MutedPolicy=V(l.MutedPolicy),i.Orientation=V(l.Orientation),i.OutputBackend=V(l.OutputBackend),i.PaddingUnits=V(l.PaddingUnits),i.Place=V(l.Place),i.PointPolicy=V(l.PointPolicy),i.RadiusDimension=V(l.RadiusDimension),i.RenderLevel=V(l.RenderLevel),i.RenderMode=V(l.RenderMode),i.ResetPolicy=V(l.ResetPolicy),i.RoundingFunction=V(l.RoundingFunction),i.Side=V(l.Side),i.SizingMode=V(l.SizingMode),i.Sort=V(l.Sort),i.SpatialUnits=V(l.SpatialUnits),i.StartEnd=V(l.StartEnd),i.StepMode=V(l.StepMode),i.TapBehavior=V(l.TapBehavior),i.TextAlign=V(l.TextAlign),i.TextBaseline=V(l.TextBaseline),i.TextureRepetition=V(l.TextureRepetition),i.TickLabelOrientation=V(l.TickLabelOrientation),i.TooltipAttachment=V(l.TooltipAttachment),i.UpdateMode=V(l.UpdateMode),i.VerticalAlign=V(l.VerticalAlign);class j extends x{get_value(){const{value:e,expr:t,transform:i}=this.spec;return null!=t||null!=i?this.spec:e}_update(e){v(e)?this.spec=e:this.spec={value:e},null!=this.spec.value&&this.validate(this.spec.value)}materialize(e){return e}scalar(e,t){return new b.UniformScalar(e,t)}uniform(e){var t;const{expr:i,value:s,transform:n}=this.spec,o=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=i){let t=i.compute(e);return null!=n&&(t=n.compute(t)),t=this.materialize(t),this.scalar(t,o)}{let e=s;return null!=n&&(e=n.compute(e)),e=this.materialize(e),this.scalar(e,o)}}}i.ScalarSpec=j,j.__name__="ScalarSpec";class U extends j{}i.AnyScalar=U,U.__name__="AnyScalar";class F extends j{}i.ColorScalar=F,F.__name__="ColorScalar";class G extends j{}i.NumberScalar=G,G.__name__="NumberScalar";class H extends j{}i.StringScalar=H,H.__name__="StringScalar";class Y extends j{}i.NullStringScalar=Y,Y.__name__="NullStringScalar";class J extends j{}i.ArrayScalar=J,J.__name__="ArrayScalar";class W extends j{}i.LineJoinScalar=W,W.__name__="LineJoinScalar";class q extends j{}i.LineCapScalar=q,q.__name__="LineCapScalar";class X extends j{}i.LineDashScalar=X,X.__name__="LineDashScalar";class Z extends j{_default_override(){return g.settings.dev?"Bokeh":void 0}}i.FontScalar=Z,Z.__name__="FontScalar";class K extends j{}i.FontSizeScalar=K,K.__name__="FontSizeScalar";class Q extends j{}i.FontStyleScalar=Q,Q.__name__="FontStyleScalar";class $ extends j{}i.TextAlignScalar=$,$.__name__="TextAlignScalar";class ee extends j{}i.TextBaselineScalar=ee,ee.__name__="TextBaselineScalar";class te extends x{get_value(){return null===this.spec.value?null:this.spec}_update(e){v(e)?this.spec=e:this.spec={value:e},null!=this.spec.value&&this.validate(this.spec.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new b.UniformScalar(e,t)}vector(e){return new b.UniformVector(e)}uniform(e){var t;const{field:i,expr:s,value:n,transform:o}=this.spec,r=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=i){let t=e.get_column(i);return null!=t?(null!=o&&(t=o.v_compute(t)),t=this.v_materialize(t),this.vector(t)):(a.logger.warn(`attempted to retrieve property array for nonexistent field '${i}'`),this.scalar(null,r))}if(null!=s){let t=s.v_compute(e);return null!=o&&(t=o.v_compute(t)),t=this.v_materialize(t),this.vector(t)}{let e=n;return null!=o&&(e=o.compute(e)),e=this.materialize(e),this.scalar(e,r)}}array(e){var t;let i;const s=null!==(t=e.get_length())&&void 0!==t?t:1;if(null!=this.spec.field){const t=e.get_column(this.spec.field);if(null!=t)i=this.normalize(t);else{a.logger.warn(`attempted to retrieve property array for nonexistent field '${this.spec.field}'`);const e=new Float64Array(s);e.fill(NaN),i=e}}else if(null!=this.spec.expr)i=this.normalize(this.spec.expr.v_compute(e));else{const e=this._value(!1);if((0,m.isNumber)(e)){const t=new Float64Array(s);t.fill(e),i=t}else i=(0,h.repeat)(e,s)}return null!=this.spec.transform&&(i=this.spec.transform.v_compute(i)),i}}i.VectorSpec=te,te.__name__="VectorSpec";class ie extends te{}i.DataSpec=ie,ie.__name__="DataSpec";class se extends te{_update(e){super._update(e);const{units:t}=this.spec;if(null!=t&&!(0,h.includes)(this.valid_units,t))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${t}`)}get units(){var e;return null!==(e=this.spec.units)&&void 0!==e?e:this.default_units}set units(e){e!=this.default_units?this.spec.units=e:delete this.spec.units}}i.UnitsSpec=se,se.__name__="UnitsSpec";class ne extends se{array(e){return new Float64Array(super.array(e))}}i.NumberUnitsSpec=ne,ne.__name__="NumberUnitsSpec";class oe extends ie{}i.BaseCoordinateSpec=oe,oe.__name__="BaseCoordinateSpec";class re extends oe{}i.CoordinateSpec=re,re.__name__="CoordinateSpec";class ae extends oe{}i.CoordinateSeqSpec=ae,ae.__name__="CoordinateSeqSpec";class le extends oe{}i.CoordinateSeqSeqSeqSpec=le,le.__name__="CoordinateSeqSeqSeqSpec";class ce extends re{constructor(){super(...arguments),this.dimension="x"}}i.XCoordinateSpec=ce,ce.__name__="XCoordinateSpec";class he extends re{constructor(){super(...arguments),this.dimension="y"}}i.YCoordinateSpec=he,he.__name__="YCoordinateSpec";class _e extends ae{constructor(){super(...arguments),this.dimension="x"}}i.XCoordinateSeqSpec=_e,_e.__name__="XCoordinateSeqSpec";class ue extends ae{constructor(){super(...arguments),this.dimension="y"}}i.YCoordinateSeqSpec=ue,ue.__name__="YCoordinateSeqSpec";class de extends le{constructor(){super(...arguments),this.dimension="x"}}i.XCoordinateSeqSeqSeqSpec=de,de.__name__="XCoordinateSeqSeqSeqSpec";class pe extends le{constructor(){super(...arguments),this.dimension="y"}}i.YCoordinateSeqSeqSeqSpec=pe,pe.__name__="YCoordinateSeqSeqSeqSpec";class me extends ne{get default_units(){return"rad"}get valid_units(){return[...l.AngleUnits]}materialize(e){return e*-(0,u.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,u.to_radians_coeff)(this.units),i=new Float32Array(e.length);return(0,_.mul)(e,t,i),i}array(e){throw new Error("not supported")}}i.AngleSpec=me,me.__name__="AngleSpec";class ge extends ne{get default_units(){return"data"}get valid_units(){return[...l.SpatialUnits]}}i.DistanceSpec=ge,ge.__name__="DistanceSpec";class fe extends ge{materialize(e){return null!=e?e:NaN}}i.NullDistanceSpec=fe,fe.__name__="NullDistanceSpec";class be extends ie{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}i.BooleanSpec=be,be.__name__="BooleanSpec";class ye extends ie{v_materialize(e){return(0,m.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}i.IntSpec=ye,ye.__name__="IntSpec";class ve extends ie{v_materialize(e){return(0,m.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}i.NumberSpec=ve,ve.__name__="NumberSpec";class xe extends ve{valid(e){return(0,m.isNumber)(e)&&e>=0}}i.ScreenSizeSpec=xe,xe.__name__="ScreenSizeSpec";class we extends ie{materialize(e){return(0,d.encode_rgba)((0,d.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e)){const t=e.length,i=new c.RGBAArray(4*t);let s=0;for(const n of e){const[e,t,o,r]=(0,d.color2rgba)(n);i[s++]=e,i[s++]=t,i[s++]=o,i[s++]=r}return new c.ColorArray(i.buffer)}if("uint32"==e.dtype&&1==e.dimension)return(0,p.to_big_endian)(e);if("uint8"==e.dtype&&1==e.dimension){const[t]=e.shape,i=new c.RGBAArray(4*t);let s=0;for(const n of e)i[s++]=n,i[s++]=n,i[s++]=n,i[s++]=255;return new c.ColorArray(i.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,i]=e.shape;if(4==i)return new c.ColorArray(e.buffer);if(3==i){const s=new c.RGBAArray(4*t);for(let n=0,o=0;n<i*t;)s[o++]=e[n++],s[o++]=e[n++],s[o++]=e[n++],s[o++]=255;return new c.ColorArray(s.buffer)}}else if(("float32"==e.dtype||"float64"==e.dtype)&&2==e.dimension){const[t,i]=e.shape;if(3==i||4==i){const s=new c.RGBAArray(4*t);for(let n=0,o=0;n<i*t;)s[o++]=255*e[n++],s[o++]=255*e[n++],s[o++]=255*e[n++],s[o++]=255*(3==i?1:e[n++]);return new c.ColorArray(s.buffer)}}throw new Error("invalid color array")}vector(e){return new b.ColorUniformVector(e)}}i.ColorSpec=we,we.__name__="ColorSpec";class Ae extends ie{}i.NDArraySpec=Ae,Ae.__name__="NDArraySpec";class ke extends ie{}i.AnySpec=ke,ke.__name__="AnySpec";class Se extends ie{}i.StringSpec=Se,Se.__name__="StringSpec";class Te extends ie{}i.NullStringSpec=Te,Te.__name__="NullStringSpec";class Ce extends ie{}i.ArraySpec=Ce,Ce.__name__="ArraySpec";class Me extends ie{}i.MarkerSpec=Me,Me.__name__="MarkerSpec";class ze extends ie{}i.LineJoinSpec=ze,ze.__name__="LineJoinSpec";class Ee extends ie{}i.LineCapSpec=Ee,Ee.__name__="LineCapSpec";class Re extends ie{}i.LineDashSpec=Re,Re.__name__="LineDashSpec";class Be extends ie{_default_override(){return g.settings.dev?"Bokeh":void 0}}i.FontSpec=Be,Be.__name__="FontSpec";class Ne extends ie{}i.FontSizeSpec=Ne,Ne.__name__="FontSizeSpec";class Oe extends ie{}i.FontStyleSpec=Oe,Oe.__name__="FontStyleSpec";class De extends ie{}i.TextAlignSpec=De,De.__name__="TextAlignSpec";class Ie extends ie{}i.TextBaselineSpec=Ie,Ie.__name__="TextBaselineSpec"},function(e,t,i,s,n){s();const o=e(8),r=e(13),a={};class l{constructor(e,t){this.name=e,this.level=t}}i.LogLevel=l,l.__name__="LogLevel";class c{constructor(e,t=c.INFO){this._name=e,this.set_level(t)}static get levels(){return Object.keys(c.log_levels)}static get(e,t=c.INFO){if(e.length>0){let i=a[e];return null==i&&(a[e]=i=new c(e,t)),i}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}get level(){return this.get_level()}get_level(){return this._log_level}set_level(e){if(e instanceof l)this._log_level=e;else{if(!(0,o.isString)(e)||null==c.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=c.log_levels[e]}const t=`[${this._name}]`;for(const[i,s]of(0,r.entries)(c.log_levels))s.level<this._log_level.level||this._log_level.level===c.OFF.level?this[i]=function(){}:this[i]=h(i,t)}trace(...e){}debug(...e){}info(...e){}warn(...e){}error(...e){}}function h(e,t){return null!=console[e]?console[e].bind(console,t):null!=console.log?console.log.bind(console,t):function(){}}function _(e){const t=i.logger.level;return(0,o.isString)(e)&&null==c.log_levels[e]?(console.log(`[bokeh] unrecognized logging level '${e}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${c.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,o.isString)(e)?e:e.level}'`),i.logger.set_level(e)),t}i.Logger=c,c.__name__="Logger",c.TRACE=new l("trace",0),c.DEBUG=new l("debug",1),c.INFO=new l("info",2),c.WARN=new l("warn",6),c.ERROR=new l("error",7),c.FATAL=new l("fatal",8),c.OFF=new l("off",9),c.log_levels={trace:c.TRACE,debug:c.DEBUG,info:c.INFO,warn:c.WARN,error:c.ERROR,fatal:c.FATAL,off:c.OFF},i.logger=c.get("bokeh"),i.set_log_level=_,i.with_log_level=function(e,t){const i=_(e);try{t()}finally{_(i)}}},function(e,t,i,s,n){s(),i.VerticalAlign=void 0;const o=e(21);i.Align=(0,o.Enum)("start","center","end"),i.Anchor=(0,o.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),i.AngleUnits=(0,o.Enum)("deg","rad","grad","turn"),i.BoxOrigin=(0,o.Enum)("corner","center"),i.ButtonType=(0,o.Enum)("default","primary","success","warning","danger","light"),i.CalendarPosition=(0,o.Enum)("auto","above","below"),i.Dimension=(0,o.Enum)("width","height"),i.Dimensions=(0,o.Enum)("width","height","both"),i.Direction=(0,o.Enum)("clock","anticlock"),i.Distribution=(0,o.Enum)("uniform","normal"),i.FontStyle=(0,o.Enum)("normal","italic","bold","bold italic"),i.HatchPatternType=(0,o.Enum)("blank","dot","ring","horizontal_line","vertical_line","cross","horizontal_dash","vertical_dash","spiral","right_diagonal_line","left_diagonal_line","diagonal_cross","right_diagonal_dash","left_diagonal_dash","horizontal_wave","vertical_wave","criss_cross"," ",".","o","-","|","+",'"',":","@","/","\\","x",",","`","v",">","*"),i.HTTPMethod=(0,o.Enum)("POST","GET"),i.HexTileOrientation=(0,o.Enum)("pointytop","flattop"),i.HoverMode=(0,o.Enum)("mouse","hline","vline"),i.LatLon=(0,o.Enum)("lat","lon"),i.LegendClickPolicy=(0,o.Enum)("none","hide","mute"),i.LegendLocation=i.Anchor,i.LineCap=(0,o.Enum)("butt","round","square"),i.LineJoin=(0,o.Enum)("miter","round","bevel"),i.LineDash=(0,o.Enum)("solid","dashed","dotted","dotdash","dashdot"),i.LinePolicy=(0,o.Enum)("prev","next","nearest","interp","none"),i.Location=(0,o.Enum)("above","below","left","right"),i.Logo=(0,o.Enum)("normal","grey"),i.MarkerType=(0,o.Enum)("asterisk","circle","circle_cross","circle_dot","circle_x","circle_y","cross","dash","diamond","diamond_cross","diamond_dot","dot","hex","hex_dot","inverted_triangle","plus","square","square_cross","square_dot","square_pin","square_x","star","star_dot","triangle","triangle_dot","triangle_pin","x","y"),i.MutedPolicy=(0,o.Enum)("show","ignore"),i.Orientation=(0,o.Enum)("vertical","horizontal"),i.OutputBackend=(0,o.Enum)("canvas","svg","webgl"),i.PaddingUnits=(0,o.Enum)("percent","absolute"),i.Place=(0,o.Enum)("above","below","left","right","center"),i.PointPolicy=(0,o.Enum)("snap_to_data","follow_mouse","none"),i.RadiusDimension=(0,o.Enum)("x","y","max","min"),i.RenderLevel=(0,o.Enum)("image","underlay","glyph","guide","annotation","overlay"),i.RenderMode=(0,o.Enum)("canvas","css"),i.ResetPolicy=(0,o.Enum)("standard","event_only"),i.RoundingFunction=(0,o.Enum)("round","nearest","floor","rounddown","ceil","roundup"),i.SelectionMode=(0,o.Enum)("replace","append","intersect","subtract"),i.Side=(0,o.Enum)("above","below","left","right"),i.SizingMode=(0,o.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),i.Sort=(0,o.Enum)("ascending","descending"),i.SpatialUnits=(0,o.Enum)("screen","data"),i.StartEnd=(0,o.Enum)("start","end"),i.StepMode=(0,o.Enum)("after","before","center"),i.TapBehavior=(0,o.Enum)("select","inspect"),i.TextAlign=(0,o.Enum)("left","right","center"),i.TextBaseline=(0,o.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),i.TextureRepetition=(0,o.Enum)("repeat","repeat_x","repeat_y","no_repeat"),i.TickLabelOrientation=(0,o.Enum)("vertical","horizontal","parallel","normal"),i.TooltipAttachment=(0,o.Enum)("horizontal","vertical","left","right","above","below"),i.UpdateMode=(0,o.Enum)("replace","append"),i.VerticalAlign=(0,o.Enum)("top","middle","bottom")},function(e,t,i,s,n){s();const o=(0,e(1).__importStar)(e(8)),r=e(22),a=e(13),l=window.Map,{hasOwnProperty:c}=Object.prototype;class h{}i.Kind=h,h.__name__="Kind",function(e){class t extends h{valid(e){return!0}}t.__name__="Any",e.Any=t;class i extends h{valid(e){return!0}}i.__name__="Unknown",e.Unknown=i;class s extends h{valid(e){return o.isBoolean(e)}}s.__name__="Boolean",e.Boolean=s;class n extends h{constructor(e){super(),this.obj_type=e}valid(e){return!0}}n.__name__="Ref",e.Ref=n;class _ extends h{valid(e){return!0}}_.__name__="AnyRef",e.AnyRef=_;class u extends h{valid(e){return o.isNumber(e)}}u.__name__="Number",e.Number=u;class d extends u{valid(e){return super.valid(e)&&o.isInteger(e)}}d.__name__="Int",e.Int=d;class p extends u{valid(e){return super.valid(e)&&0<=e&&e<=1}}p.__name__="Percent",e.Percent=p;class m extends h{constructor(e){super(),this.types=e,this.types=e}valid(e){return this.types.some((t=>t.valid(e)))}}m.__name__="Or",e.Or=m;class g extends h{constructor(e){super(),this.types=e,this.types=e}valid(e){if(!o.isArray(e))return!1;for(let t=0;t<this.types.length;t++){const i=this.types[t],s=e[t];if(!i.valid(s))return!1}return!0}}g.__name__="Tuple",e.Tuple=g;class f extends h{constructor(e){super(),this.struct_type=e}valid(e){if(!o.isPlainObject(e))return!1;const{struct_type:t}=this;if((0,a.size)(t)!=(0,a.size)(e))return!1;for(const i in t)if(c.call(t,i)){if(!c.call(e,i))return!1;const s=t[i],n=e[i];if(!s.valid(n))return!1}return!0}}f.__name__="Struct",e.Struct=f;class b extends h{valid(e){return o.isArray(e)||o.isTypedArray(e)}}b.__name__="Arrayable",e.Arrayable=b;class y extends h{constructor(e){super(),this.item_type=e}valid(e){return o.isArray(e)&&e.every((e=>this.item_type.valid(e)))}}y.__name__="Array",e.Array=y;class v extends h{valid(e){return null===e}}v.__name__="Null",e.Null=v;class x extends h{constructor(e){super(),this.base_type=e}valid(e){return null===e||this.base_type.valid(e)}}x.__name__="Nullable",e.Nullable=x;class w extends h{constructor(e){super(),this.base_type=e}valid(e){return void 0===e||this.base_type.valid(e)}}w.__name__="Opt",e.Opt=w;class A extends h{valid(e){return o.isString(e)}}A.__name__="String",e.String=A;class k extends h{constructor(e){super(),this.values=new Set(e)}valid(e){return this.values.has(e)}*[Symbol.iterator](){yield*this.values}}k.__name__="Enum",e.Enum=k;class S extends h{constructor(e){super(),this.item_type=e}valid(e){if(!o.isPlainObject(e))return!1;for(const t in e)if(c.call(e,t)){const i=e[t];if(!this.item_type.valid(i))return!1}return!0}}S.__name__="Dict",e.Dict=S;class T extends h{constructor(e,t){super(),this.key_type=e,this.item_type=t}valid(e){if(!(e instanceof l))return!1;for(const[t,i]of e.entries())if(!this.key_type.valid(t)||!this.item_type.valid(i))return!1;return!0}}T.__name__="Map",e.Map=T;class C extends h{valid(e){return(0,r.is_Color)(e)}}C.__name__="Color",e.Color=C;class M extends h{valid(e){return o.isFunction(e)}}M.__name__="Function",e.Function=M}(i.Kinds||(i.Kinds={})),i.Any=new i.Kinds.Any,i.Unknown=new i.Kinds.Unknown,i.Boolean=new i.Kinds.Boolean,i.Number=new i.Kinds.Number,i.Int=new i.Kinds.Int,i.String=new i.Kinds.String,i.Null=new i.Kinds.Null,i.Nullable=e=>new i.Kinds.Nullable(e),i.Opt=e=>new i.Kinds.Opt(e),i.Or=(...e)=>new i.Kinds.Or(e),i.Tuple=(...e)=>new i.Kinds.Tuple(e),i.Struct=e=>new i.Kinds.Struct(e),i.Arrayable=new i.Kinds.Arrayable,i.Array=e=>new i.Kinds.Array(e),i.Dict=e=>new i.Kinds.Dict(e),i.Map=(e,t)=>new i.Kinds.Map(e,t),i.Enum=(...e)=>new i.Kinds.Enum(e),i.Ref=e=>new i.Kinds.Ref(e),i.AnyRef=()=>new i.Kinds.AnyRef,i.Function=()=>new i.Kinds.Function,i.Percent=new i.Kinds.Percent,i.Alpha=i.Percent,i.Color=new i.Kinds.Color,i.Auto=(0,i.Enum)("auto"),i.FontSize=i.String,i.Font=i.String,i.Angle=i.Number},function(e,t,i,s,n){s();const o=e(23),r=e(10),a=e(8),{round:l}=Math;function c(e){return(0,r.clamp)(l(e),0,255)}function h(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}function _(e,t){var i;let s,n,o,r;return null==e?[s,n,o,r]=[0,0,0,0]:(0,a.isInteger)(e)?[s,n,o,r]=h(e):(0,a.isString)(e)?[s,n,o,r]=null!==(i=f(e))&&void 0!==i?i:[0,0,0,0]:([s,n,o,r=1]=e,r=c(255*r)),255==r&&null!=t&&(r=c(255*t)),[s,n,o,r]}i.transparent=function(){return[0,0,0,0]},i.encode_rgba=function([e,t,i,s]){return e<<24|t<<16|i<<8|s},i.decode_rgba=h,i.compose_alpha=function(e,t){return 255==(255&e)?4294967040&e|c(255*t):e},i.color2rgba=_;const u={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"a",11:"b",12:"c",13:"d",14:"e",15:"f"};function d(e){return u[e>>4]+u[15&e]}i.color2css=function(e,t){const[i,s,n,o]=_(e,t);return`rgba(${i}, ${s}, ${n}, ${o/255})`},i.color2hex=function(e,t){const[i,s,n,o]=_(e,t),r=`#${d(i)}${d(s)}${d(n)}`;return 255==o?r:`${r}${d(o)}`},i.color2hexrgb=function(e){const[t,i,s]=_(e);return`#${d(t)}${d(i)}${d(s)}`};const p=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,m=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,g=(()=>{const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d"),i=t.createLinearGradient(0,0,1,1);return e=>{t.fillStyle=i,t.fillStyle=e;const s=t.fillStyle;return s!=i?s:null}})();function f(e){var t;if(!(e=e.trim().toLowerCase()))return null;if("transparent"==e)return[0,0,0,0];if((0,o.is_named_color)(e))return h(o.named_colors[e]);if("#"==e[0]){const t=Number(`0x${e.substr(1)}`);if(isNaN(t))return null;switch(e.length-1){case 3:{const e=t>>8&15,i=t>>4&15,s=t>>0&15;return[e<<4|e,i<<4|i,s<<4|s,255]}case 4:{const e=t>>12&15,i=t>>8&15,s=t>>4&15,n=t>>0&15;return[e<<4|e,i<<4|i,s<<4|s,n<<4|n]}case 6:return[t>>16&255,t>>8&255,t>>0&255,255];case 8:return[t>>24&255,t>>16&255,t>>8&255,t>>0&255]}}else if(e.startsWith("rgb")){const i=null!==(t=e.match(p))&&void 0!==t?t:e.match(m);if(null!=i){let[,e,t,s,n="1"]=i;const o=e.endsWith("%"),r=t.endsWith("%"),a=s.endsWith("%"),l=n.endsWith("%");if(!(o&&r&&a)&&(o||r||a))return null;o&&(e=e.slice(0,-1)),r&&(t=t.slice(0,-1)),a&&(s=s.slice(0,-1)),l&&(n=n.slice(0,-1));let h=Number(e),_=Number(t),u=Number(s),d=Number(n);return isNaN(h+_+u+d)?null:(o&&(h=h/100*255),r&&(_=_/100*255),a&&(u=u/100*255),d=255*(l?d/100:d),h=c(h),_=c(_),u=c(u),d=c(d),[h,_,u,d])}}else{const t=g(e);if(null!=t)return f(t)}return null}i.css4_parse=f,i.is_Color=function(e){return!!(0,a.isInteger)(e)||!(!(0,a.isString)(e)||null==f(e))||!(!(0,a.isArray)(e)||3!=e.length&&4!=e.length)},i.is_dark=function([e,t,i]){return 1-(.299*e+.587*t+.114*i)/255>=.6}},function(e,t,i,s,n){s(),i.named_colors={aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},i.is_named_color=function(e){return e in i.named_colors}},function(e,t,i,s,n){s(),i.GeneratorFunction=Object.getPrototypeOf((function*(){})).constructor,i.ColorArray=Uint32Array,i.RGBAArray=Uint8ClampedArray,i.infer_type=function(e,t){return e instanceof Float64Array||e instanceof Array||t instanceof Float64Array||t instanceof Array?Float64Array:Float32Array},i.ScreenArray=Float32Array,i.to_screen=function(e){return e instanceof Float32Array?e:Float32Array.from(e)},n("Indices",e(25).BitSet)},function(e,t,i,s,n){var o;s();const r=e(26),a=e(11);class l{constructor(e,t=0){this.size=e,this[o]="BitSet",this._count=null,this._nwords=Math.ceil(e/32),0==t||1==t?(this._array=new Uint32Array(this._nwords),1==t&&this._array.fill(4294967295)):((0,a.assert)(t.length==this._nwords,"Initializer size mismatch"),this._array=t)}clone(){return new l(this.size,new Uint32Array(this._array))}[(o=Symbol.toStringTag,r.equals)](e,t){if(!t.eq(this.size,e.size))return!1;const{_nwords:i}=this,s=this.size%i,n=0==s?i:i-1;for(let o=0;o<n;o++)if(this._array[o]!=e._array[o])return!1;if(0==s)return!0;{const t=1<<s-1,i=t-1^t;return(this._array[n]&i)==(e._array[n]&i)}}static all_set(e){return new l(e,1)}static all_unset(e){return new l(e,0)}static from_indices(e,t){const i=new l(e);for(const s of t)i.set(s);return i}static from_booleans(e,t){const i=new l(e),s=Math.min(e,t.length);for(let n=0;n<s;n++)t[n]&&i.set(n);return i}_check_bounds(e){(0,a.assert)(0<=e&&e<this.size,`Out of bounds: 0 <= ${e} < ${this.size}`)}get(e){this._check_bounds(e);const t=e>>>5,i=31&e;return!!(this._array[t]>>i&1)}set(e,t=!0){this._check_bounds(e),this._count=null;const i=e>>>5,s=31&e;t?this._array[i]|=1<<s:this._array[i]&=~(1<<s)}unset(e){this.set(e,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let e=this._count;return null==e&&(this._count=e=this._get_count()),e}_get_count(){const{_array:e,_nwords:t,size:i}=this;let s=0;for(let n=0,o=0;o<t;o++){const t=e[o];if(0==t)n+=32;else for(let e=0;e<32&&n<i;e++,n++)t>>>e&1&&(s+=1)}return s}*ones(){const{_array:e,_nwords:t,size:i}=this;for(let s=0,n=0;n<t;n++){const t=e[n];if(0!=t)for(let e=0;e<32&&s<i;e++,s++)t>>>e&1&&(yield s);else s+=32}}*zeros(){const{_array:e,_nwords:t,size:i}=this;for(let s=0,n=0;n<t;n++){const t=e[n];if(4294967295!=t)for(let e=0;e<32&&s<i;e++,s++)t>>>e&1||(yield s);else s+=32}}_check_size(e){(0,a.assert)(this.size==e.size,"Size mismatch")}add(e){this._check_size(e);for(let t=0;t<this._nwords;t++)this._array[t]|=e._array[t]}intersect(e){this._check_size(e);for(let t=0;t<this._nwords;t++)this._array[t]&=e._array[t]}subtract(e){this._check_size(e);for(let t=0;t<this._nwords;t++){const i=this._array[t],s=e._array[t];this._array[t]=(i^s)&i}}union(e){this._check_size(e);const t=this.clone();for(let i=0;i<this._nwords;i++)t._array[i]|=e._array[i];return t}intersection(e){this._check_size(e);const t=this.clone();for(let i=0;i<this._nwords;i++)t._array[i]&=e._array[i];return t}difference(e){this._check_size(e);const t=this.clone();for(let i=0;i<this._nwords;i++){const s=this._array[i],n=e._array[i];t._array[i]=(s^n)&s}return t}select(e){(0,a.assert)(this.size<=e.length,"Size mismatch");const t=this.count,i=new e.constructor(t);let s=0;for(const n of this)i[s++]=e[n];return i}}i.BitSet=l,l.__name__="BitSet"},function(e,t,i,s,n){s();const o=e(8),{hasOwnProperty:r}=Object.prototype;function a(e){return(0,o.isObject)(e)&&void 0!==e[i.equals]}i.equals=Symbol("equals"),i.wildcard=Symbol("wildcard");const l=Object.prototype.toString;class c{constructor(){this.a_stack=[],this.b_stack=[]}eq(e,t){if(Object.is(e,t))return!0;if(e===i.wildcard||t===i.wildcard)return!0;if(null==e||null==t)return e===t;const s=l.call(e);if(s!=l.call(t))return!1;switch(s){case"[object Number]":return this.numbers(e,t);case"[object RegExp]":case"[object String]":return`${e}`==`${t}`;case"[object Date]":case"[object Boolean]":return+e==+t}const{a_stack:n,b_stack:o}=this;let r=n.length;for(;r--;)if(n[r]===e)return o[r]===t;n.push(e),o.push(t);const c=(()=>{if(a(e)&&a(t))return e[i.equals](t,this);switch(s){case"[object Array]":case"[object Uint8Array]":case"[object Int8Array]":case"[object Uint16Array]":case"[object Int16Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":return this.arrays(e,t);case"[object Map]":return this.maps(e,t);case"[object Set]":return this.sets(e,t);case"[object Object]":if(e.constructor==t.constructor&&(null==e.constructor||e.constructor===Object))return this.objects(e,t);case"[object Function]":if(e.constructor==t.constructor&&e.constructor===Function)return this.eq(`${e}`,`${t}`)}if(e instanceof Node)return this.nodes(e,t);throw Error(`can't compare objects of type ${s}`)})();return n.pop(),o.pop(),c}numbers(e,t){return Object.is(e,t)}arrays(e,t){const{length:i}=e;if(i!=t.length)return!1;for(let s=0;s<i;s++)if(!this.eq(e[s],t[s]))return!1;return!0}iterables(e,t){const i=e[Symbol.iterator](),s=t[Symbol.iterator]();for(;;){const e=i.next(),t=s.next();if(e.done&&t.done)return!0;if(e.done||t.done)return!1;if(!this.eq(e.value,t.value))return!1}}maps(e,t){if(e.size!=t.size)return!1;for(const[i,s]of e)if(!t.has(i)||!this.eq(s,t.get(i)))return!1;return!0}sets(e,t){if(e.size!=t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}objects(e,t){const i=Object.keys(e);if(i.length!=Object.keys(t).length)return!1;for(const s of i)if(!r.call(t,s)||!this.eq(e[s],t[s]))return!1;return!0}nodes(e,t){return e.nodeType==t.nodeType&&e.textContent==t.textContent&&!!this.iterables(e.childNodes,t.childNodes)}}i.Comparator=c,c.__name__="Comparator";const{abs:h}=Math;class _ extends c{constructor(e=1e-4){super(),this.tolerance=e}numbers(e,t){return super.numbers(e,t)||h(e-t)<this.tolerance}}function u(e,t){return(new c).eq(e,t)}i.SimilarComparator=_,_.__name__="SimilarComparator",i.is_equal=u,i.is_similar=function(e,t,i){return new _(i).eq(e,t)},i.isEqual=u},function(e,t,i,s,n){s(),i.is_windows=navigator.appVersion.includes("Windows"),i.is_ie=(()=>{const e=navigator.userAgent;return e.includes("MSIE")||e.includes("Trident")||e.includes("Edge")})(),i.is_mobile="undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0),i.is_little_endian=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);new Uint32Array(e)[1]=168496141;let i=!0;return 10==t[4]&&11==t[5]&&12==t[6]&&13==t[7]&&(i=!1),i})(),i.BYTE_ORDER=i.is_little_endian?"little":"big",i.to_big_endian=function(e){if(i.is_little_endian){const t=new Uint32Array(e.length),i=new DataView(t.buffer);let s=0;for(const n of e)i.setUint32(s,n),s+=4;return t}return e}},function(e,t,i,s,n){s();class o{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(e){this._dev=e}get dev(){return this._dev}set wireframe(e){this._wireframe=e}get wireframe(){return this._wireframe}set force_webgl(e){this._force_webgl=e}get force_webgl(){return this._force_webgl}}i.Settings=o,o.__name__="Settings",i.settings=new o},function(e,t,i,s,n){var o,r,a,l,c,h,_,u;s();const d=e(8),p=e(11),m=e(26),g=e(30),f=e(31),b=Symbol("__ndarray__");class y extends Uint8Array{constructor(e,t){super(e),this[o]=!0,this.dtype="uint8",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>y.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>y.prototype[g.serialize].call(this,e))}[(o=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Uint8NDArray=y,y.__name__="Uint8NDArray";class v extends Int8Array{constructor(e,t){super(e),this[r]=!0,this.dtype="int8",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>v.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>v.prototype[g.serialize].call(this,e))}[(r=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Int8NDArray=v,v.__name__="Int8NDArray";class x extends Uint16Array{constructor(e,t){super(e),this[a]=!0,this.dtype="uint16",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>x.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>x.prototype[g.serialize].call(this,e))}[(a=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Uint16NDArray=x,x.__name__="Uint16NDArray";class w extends Int16Array{constructor(e,t){super(e),this[l]=!0,this.dtype="int16",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>w.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>w.prototype[g.serialize].call(this,e))}[(l=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Int16NDArray=w,w.__name__="Int16NDArray";class A extends Uint32Array{constructor(e,t){super(e),this[c]=!0,this.dtype="uint32",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>A.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>A.prototype[g.serialize].call(this,e))}[(c=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Uint32NDArray=A,A.__name__="Uint32NDArray";class k extends Int32Array{constructor(e,t){super(e),this[h]=!0,this.dtype="int32",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>k.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>k.prototype[g.serialize].call(this,e))}[(h=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Int32NDArray=k,k.__name__="Int32NDArray";class S extends Float32Array{constructor(e,t){super(e),this[_]=!0,this.dtype="float32",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>S.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>S.prototype[g.serialize].call(this,e))}[(_=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}i.Float32NDArray=S,S.__name__="Float32NDArray";class T extends Float64Array{constructor(e,t){super(e),this[u]=!0,this.dtype="float64",this.shape=null!=t?t:C(e)?e.shape:[this.length],this.dimension=this.shape.length,null==this[m.equals]&&(this[m.equals]=(e,t)=>T.prototype[m.equals].call(this,e,t)),null==this[g.serialize]&&(this[g.serialize]=e=>T.prototype[g.serialize].call(this,e))}[(u=b,m.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[g.serialize](e){return(0,f.encode_NDArray)(this)}}function C(e){return(0,d.isObject)(e)&&void 0!==e[b]}i.Float64NDArray=T,T.__name__="Float64NDArray",i.is_NDArray=C,i.ndarray=function(e,t={}){let{dtype:i}=t;null==i&&(i=e instanceof ArrayBuffer||(0,d.isArray)(e)?"float64":(()=>{switch(!0){case e instanceof Uint8Array:return"uint8";case e instanceof Int8Array:return"int8";case e instanceof Uint16Array:return"uint16";case e instanceof Int16Array:return"int16";case e instanceof Uint32Array:return"uint32";case e instanceof Int32Array:return"int32";case e instanceof Float32Array:return"float32";case e instanceof Float64Array:return"float64";default:(0,p.unreachable)()}})());const{shape:s}=t;switch(i){case"uint8":return new y(e,s);case"int8":return new v(e,s);case"uint16":return new x(e,s);case"int16":return new w(e,s);case"uint32":return new A(e,s);case"int32":return new k(e,s);case"float32":return new S(e,s);case"float64":return new T(e,s)}}},function(e,t,i,s,n){s();const o=e(11),r=e(13),a=e(8);i.serialize=Symbol("serialize");class l extends Error{}i.SerializationError=l,l.__name__="SerializationError";class c{constructor(e){var t;this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=null===(t=null==e?void 0:e.include_defaults)||void 0===t||t}get_ref(e){return this._references.get(e)}add_ref(e,t){(0,o.assert)(!this._references.has(e)),this._references.set(e,t)}add_def(e,t){const i=this.get_ref(e);(0,o.assert)(null!=i),this._definitions.set(e,t),this._refmap.set(i,t)}get objects(){return new Set(this._references.keys())}get references(){return new Set(this._references.values())}get definitions(){return new Set(this._definitions.values())}resolve_ref(e){return this._refmap.get(e)}remove_ref(e){return this._references.delete(e)}remove_def(e){return this._definitions.delete(e)}to_serializable(e){const t=this.get_ref(e);if(null!=t)return t;if(function(e){return(0,a.isObject)(e)&&void 0!==e[i.serialize]}(e))return e[i.serialize](this);if((0,a.isArray)(e)||(0,a.isTypedArray)(e)){const t=e.length,i=new Array(t);for(let s=0;s<t;s++){const t=e[s];i[s]=this.to_serializable(t)}return i}if((0,a.isPlainObject)(e)){const t={};for(const[i,s]of(0,r.entries)(e))t[i]=this.to_serializable(s);return t}if(null===e||(0,a.isBoolean)(e)||(0,a.isNumber)(e)||(0,a.isString)(e))return e;throw new l(`${Object.prototype.toString.call(e)} is not serializable`)}}i.Serializer=c,c.__name__="Serializer"},function(e,t,i,s,n){s();const o=e(8),r=e(27),a=e(32);i.is_NDArray_ref=function(e){return(0,o.isPlainObject)(e)&&("__buffer__"in e||"__ndarray__"in e)},i.decode_NDArray=function(e,t){const{shape:i,dtype:s,order:n}=e;let o;if("__buffer__"in e){const i=t.get(e.__buffer__);if(null==i)throw new Error(`buffer for ${e.__buffer__} not found`);o=i}else o=(0,a.base64_to_buffer)(e.__ndarray__);return n!==r.BYTE_ORDER&&(0,a.swap)(o,s),{buffer:o,dtype:s,shape:i}},i.encode_NDArray=function(e,t){const i={order:r.BYTE_ORDER,dtype:e.dtype,shape:e.shape};if(null!=t){const s=`${t.size}`;return t.set(s,e.buffer),Object.assign({__buffer__:s},i)}{const t={toJSON:()=>(0,a.buffer_to_base64)(e.buffer)};return Object.assign({__ndarray__:t},i)}}},function(e,t,i,s,n){s(),i.buffer_to_base64=function(e){const t=new Uint8Array(e),i=Array.from(t).map((e=>String.fromCharCode(e)));return btoa(i.join(""))},i.base64_to_buffer=function(e){const t=atob(e),i=t.length,s=new Uint8Array(i);for(let n=0,o=i;n<o;n++)s[n]=t.charCodeAt(n);return s.buffer},i.swap=function(e,t){switch(t){case"uint16":case"int16":!function(e){const t=new Uint8Array(e);for(let i=0,s=t.length;i<s;i+=2){const e=t[i];t[i]=t[i+1],t[i+1]=e}}(e);break;case"uint32":case"int32":case"float32":!function(e){const t=new Uint8Array(e);for(let i=0,s=t.length;i<s;i+=4){let e=t[i];t[i]=t[i+3],t[i+3]=e,e=t[i+1],t[i+1]=t[i+2],t[i+2]=e}}(e);break;case"float64":!function(e){const t=new Uint8Array(e);for(let i=0,s=t.length;i<s;i+=8){let e=t[i];t[i]=t[i+7],t[i+7]=e,e=t[i+1],t[i+1]=t[i+6],t[i+6]=e,e=t[i+2],t[i+2]=t[i+5],t[i+5]=e,e=t[i+3],t[i+3]=t[i+4],t[i+4]=e}}(e)}}},function(e,t,i,s,n){s();const o=e(26);class r{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}i.Uniform=r,r.__name__="Uniform";class a extends r{constructor(e,t){super(),this.value=e,this.length=t,this.is_scalar=!0}get(e){return this.value}*[Symbol.iterator](){const{length:e,value:t}=this;for(let i=0;i<e;i++)yield t}select(e){return new a(this.value,e.count)}[o.equals](e,t){return t.eq(this.length,e.length)&&t.eq(this.value,e.value)}}i.UniformScalar=a,a.__name__="UniformScalar";class l extends r{constructor(e){super(),this.array=e,this.is_scalar=!1,this.length=this.array.length}get(e){return this.array[e]}*[Symbol.iterator](){yield*this.array}select(e){const t=e.select(this.array);return new this.constructor(t)}[o.equals](e,t){return t.eq(this.length,e.length)&&t.eq(this.array,e.array)}}i.UniformVector=l,l.__name__="UniformVector";class c extends l{constructor(e){super(e),this.array=e,this._view=new DataView(e.buffer)}get(e){return this._view.getUint32(4*e)}*[Symbol.iterator](){const e=this.length;for(let t=0;t<e;t++)yield this.get(t)}}i.ColorUniformVector=c,c.__name__="ColorUniformVector"},function(e,t,i,s,n){s();const o=e(28);function r(){const e=new Array(32),t="0123456789ABCDEF";for(let i=0;i<32;i++)e[i]=t.substr(Math.floor(16*Math.random()),1);return e[12]="4",e[16]=t.substr(3&e[16].charCodeAt(0)|8,1),e.join("")}i.startsWith=function(e,t,i=0){return e.substr(i,t.length)==t},i.uuid4=r;let a=1e3;i.uniqueId=function(e){const t=o.settings.dev?"j"+a++:r();return null!=e?`${e}-${t}`:t},i.escape=function(e){return e.replace(/(?:[&<>"'`])/g,(e=>{switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return e}}))},i.unescape=function(e){return e.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,((e,t)=>{switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return t}}))},i.use_strict=function(e){return`'use strict';\n${e}`},i.to_fixed=function(e,t){return e.toFixed(t).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")}},function(e,t,i,s,n){s();const o=e(30);class r{constructor(e){this.document=e}}i.DocumentEvent=r,r.__name__="DocumentEvent";class a extends r{constructor(e,t,i){super(e),this.events=t,this.setter_id=i}}i.DocumentEventBatch=a,a.__name__="DocumentEventBatch";class l extends r{}i.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class c extends l{constructor(e,t,i){super(e),this.msg_type=t,this.msg_data=i}[o.serialize](e){const t=this.msg_data,i=e.to_serializable(t);return{kind:"MessageSent",msg_type:this.msg_type,msg_data:i}}}i.MessageSentEvent=c,c.__name__="MessageSentEvent";class h extends l{constructor(e,t,i,s,n,o,r){super(e),this.model=t,this.attr=i,this.old=s,this.new_=n,this.setter_id=o,this.hint=r}[o.serialize](e){if(null!=this.hint)return e.to_serializable(this.hint);const t=this.new_,i=e.to_serializable(t);return this.model!=t&&e.remove_def(this.model),{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:i}}}i.ModelChangedEvent=h,h.__name__="ModelChangedEvent";class _ extends l{constructor(e,t,i){super(e),this.column_source=t,this.patches=i}[o.serialize](e){return{kind:"ColumnsPatched",column_source:this.column_source,patches:this.patches}}}i.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class u extends l{constructor(e,t,i,s){super(e),this.column_source=t,this.data=i,this.rollover=s}[o.serialize](e){return{kind:"ColumnsStreamed",column_source:this.column_source,data:this.data,rollover:this.rollover}}}i.ColumnsStreamedEvent=u,u.__name__="ColumnsStreamedEvent";class d extends l{constructor(e,t,i){super(e),this.title=t,this.setter_id=i}[o.serialize](e){return{kind:"TitleChanged",title:this.title}}}i.TitleChangedEvent=d,d.__name__="TitleChangedEvent";class p extends l{constructor(e,t,i){super(e),this.model=t,this.setter_id=i}[o.serialize](e){return{kind:"RootAdded",model:e.to_serializable(this.model)}}}i.RootAddedEvent=p,p.__name__="RootAddedEvent";class m extends l{constructor(e,t,i){super(e),this.model=t,this.setter_id=i}[o.serialize](e){return{kind:"RootRemoved",model:this.model.ref()}}}i.RootRemovedEvent=m,m.__name__="RootRemovedEvent"},function(e,t,i,s,n){s();const o=e(8),r=e(13);i.pretty=Symbol("pretty");class a{constructor(e){this.visited=new Set,this.precision=null==e?void 0:e.precision}to_string(e){if((0,o.isObject)(e)){if(this.visited.has(e))return"<circular>";this.visited.add(e)}return function(e){return(0,o.isObject)(e)&&void 0!==e[i.pretty]}(e)?e[i.pretty](this):(0,o.isBoolean)(e)?this.boolean(e):(0,o.isNumber)(e)?this.number(e):(0,o.isString)(e)?this.string(e):(0,o.isArray)(e)?this.array(e):(0,o.isIterable)(e)?this.iterable(e):(0,o.isPlainObject)(e)?this.object(e):(0,o.isSymbol)(e)?this.symbol(e):`${e}`}token(e){return e}boolean(e){return`${e}`}number(e){return null!=this.precision?e.toFixed(this.precision):`${e}`}string(e){return`"${e.replace(/'/g,"\\'")}"`}symbol(e){return e.toString()}array(e){const t=this.token,i=[];for(const s of e)i.push(this.to_string(s));return`${t("[")}${i.join(`${t(",")} `)}${t("]")}`}iterable(e){var t;const i=this.token,s=null!==(t=Object(e)[Symbol.toStringTag])&&void 0!==t?t:"Object",n=this.array(e);return`${s}${i("(")}${n}${i(")")}`}object(e){const t=this.token,i=[];for(const[s,n]of(0,r.entries)(e))i.push(`${s}${t(":")} ${this.to_string(n)}`);return`${t("{")}${i.join(`${t(",")} `)}${t("}")}`}}i.Printer=a,a.__name__="Printer",i.to_string=function(e,t){return new a(t).to_string(e)}},function(e,t,i,s,n){s();const o=e(13),r=e(8);function a(e){return(0,r.isObject)(e)&&void 0!==e[i.clone]}i.clone=Symbol("clone"),i.is_Cloneable=a;class l extends Error{}i.CloningError=l,l.__name__="CloningError";class c{constructor(){}clone(e){if(a(e))return e[i.clone](this);if((0,r.isArray)(e)){const t=e.length,i=new Array(t);for(let s=0;s<t;s++){const t=e[s];i[s]=this.clone(t)}return i}if((0,r.isPlainObject)(e)){const t={};for(const[i,s]of(0,o.entries)(e))t[i]=this.clone(s);return t}if(null===e||(0,r.isBoolean)(e)||(0,r.isNumber)(e)||(0,r.isString)(e))return e;throw new l(`${Object.prototype.toString.call(e)} is not cloneable`)}}i.Cloner=c,c.__name__="Cloner"},function(e,t,i,s,n){s();const o=e(1);(0,o.__exportStar)(e(39),i),(0,o.__exportStar)(e(127),i),(0,o.__exportStar)(e(244),i),(0,o.__exportStar)(e(248),i),(0,o.__exportStar)(e(253),i),(0,o.__exportStar)(e(262),i),(0,o.__exportStar)(e(192),i),(0,o.__exportStar)(e(267),i),(0,o.__exportStar)(e(301),i),(0,o.__exportStar)(e(305),i),(0,o.__exportStar)(e(307),i),(0,o.__exportStar)(e(196),i),(0,o.__exportStar)(e(320),i),(0,o.__exportStar)(e(321),i),(0,o.__exportStar)(e(329),i),(0,o.__exportStar)(e(337),i),(0,o.__exportStar)(e(206),i),(0,o.__exportStar)(e(338),i),(0,o.__exportStar)(e(204),i),(0,o.__exportStar)(e(340),i),(0,o.__exportStar)(e(341),i),(0,o.__exportStar)(e(168),i),(0,o.__exportStar)(e(346),i),(0,o.__exportStar)(e(356),i),(0,o.__exportStar)(e(360),i)},function(e,t,i,s,n){s(),n("Annotation",e(40).Annotation),n("Arrow",e(68).Arrow),n("ArrowHead",e(112).ArrowHead),n("OpenHead",e(112).OpenHead),n("NormalHead",e(112).NormalHead),n("TeeHead",e(112).TeeHead),n("VeeHead",e(112).VeeHead),n("Band",e(114).Band),n("BoxAnnotation",e(116).BoxAnnotation),n("ColorBar",e(117).ColorBar),n("Label",e(212).Label),n("LabelSet",e(213).LabelSet),n("Legend",e(214).Legend),n("LegendItem",e(215).LegendItem),n("PolyAnnotation",e(217).PolyAnnotation),n("Slope",e(218).Slope),n("Span",e(219).Span),n("TextAnnotation",e(119).TextAnnotation),n("Title",e(118).Title),n("ToolbarPanel",e(220).ToolbarPanel),n("Tooltip",e(241).Tooltip),n("Whisker",e(243).Whisker)},function(e,t,i,s,n){var o;s();const r=e(41);class a extends r.RendererView{get_size(){if(this.model.visible){const{width:e,height:t}=this._get_size();return{width:Math.round(e),height:Math.round(t)}}return{width:0,height:0}}_get_size(){throw new Error("not implemented")}connect_signals(){super.connect_signals();const e=this.model.properties;this.on_change(e.visible,(()=>{null!=this.layout&&(this.layout.visible=this.model.visible,this.plot_view.request_layout())}))}get needs_clip(){return null==this.layout}serializable_state(){const e=super.serializable_state();return null==this.layout?e:Object.assign(Object.assign({},e),{bbox:this.layout.bbox.box})}}i.AnnotationView=a,a.__name__="AnnotationView";class l extends r.Renderer{constructor(e){super(e)}}i.Annotation=l,o=l,l.__name__="Annotation",o.override({level:"annotation"})},function(e,t,i,s,n){s();const o=e(1);var r,a;const l=e(42),c=(0,o.__importStar)(e(45)),h=e(20),_=e(53),u=e(54);class d extends _.Model{constructor(e){super(e)}}i.RendererGroup=d,r=d,d.__name__="RendererGroup",r.define((({Boolean:e})=>({visible:[e,!0]})));class p extends l.View{get coordinates(){const{_coordinates:e}=this;return null!=e?e:this._coordinates=this._initialize_coordinates()}initialize(){super.initialize(),this.visuals=new c.Visuals(this),this.needs_webgl_blit=!1}connect_signals(){super.connect_signals();const{x_range_name:e,y_range_name:t}=this.model.properties;this.on_change([e,t],(()=>this._initialize_coordinates()));const{group:i}=this.model;null!=i&&this.on_change(i.properties.visible,(()=>{this.model.visible=i.visible}))}_initialize_coordinates(){const{coordinates:e}=this.model,{frame:t}=this.plot_view;if(null!=e)return e.get_transform(t);{const{x_range_name:e,y_range_name:i}=this.model,s=t.x_scales.get(e),n=t.y_scales.get(i);return new u.CoordinateTransform(s,n)}}get plot_view(){return this.parent}get plot_model(){return this.parent.model}get layer(){const{overlays:e,primary:t}=this.canvas;return"overlay"==this.model.level?e:t}get canvas(){return this.plot_view.canvas_view}request_render(){this.request_paint()}request_paint(){this.plot_view.request_paint(this)}request_layout(){this.plot_view.request_layout()}notify_finished(){this.plot_view.notify_finished()}notify_finished_after_paint(){this.plot_view.notify_finished_after_paint()}get needs_clip(){return!1}get has_webgl(){return!1}render(){this.model.visible&&this._render(),this._has_finished=!0}renderer_view(e){}}i.RendererView=p,p.__name__="RendererView";class m extends _.Model{constructor(e){super(e)}}i.Renderer=m,a=m,m.__name__="Renderer",a.define((({Boolean:e,String:t,Ref:i,Nullable:s})=>({group:[s(i(d)),null],level:[h.RenderLevel,"image"],visible:[e,!0],x_range_name:[t,"default"],y_range_name:[t,"default"],coordinates:[s(i(u.CoordinateMapping)),null]})))},function(e,t,i,s,n){s();const o=e(1),r=e(15),a=e(43),l=e(8),c=(0,o.__importDefault)(e(44));class h{constructor(e){this.removed=new r.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._idle_notified=!1;const{model:t,parent:i}=e;this.model=t,this.parent=i,this.root=null==i?this:i.root,this.removed.emit()}get ready(){return this._ready}connect(e,t){let i=this._slots.get(t);return null==i&&(i=(e,i)=>{const s=Promise.resolve(t.call(this,e,i));this._ready=this._ready.then((()=>s))},this._slots.set(t,i)),e.connect(i,this)}disconnect(e,t){return e.disconnect(t,this)}initialize(){this._has_finished=!1,this.is_root&&(this._stylesheet=a.stylesheet);for(const e of this.styles())this.stylesheet.append(e)}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit()}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return null==this.parent}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){r.Signal.disconnect_receiver(this)}on_change(e,t){for(const i of(0,l.isArray)(e)?e:[e])this.connect(i.change,t)}cursor(e,t){return null}get stylesheet(){return this.is_root?this._stylesheet:this.root.stylesheet}styles(){return[c.default]}notify_finished(){this.is_root?!this._idle_notified&&this.has_finished()&&null!=this.model.document&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):this.root.notify_finished()}}i.View=h,h.__name__="View"},function(e,t,i,s,n){s();const o=e(8),r=e(13),a=e=>(t={},...i)=>{const s=document.createElement(e);s.classList.add("bk"),(0,o.isPlainObject)(t)||(i=[t,...i],t={});for(let[e,a]of(0,r.entries)(t))if(null!=a&&(!(0,o.isBoolean)(a)||a))if("class"===e&&((0,o.isString)(a)&&(a=a.split(/\s+/)),(0,o.isArray)(a)))for(const t of a)null!=t&&s.classList.add(t);else if("style"===e&&(0,o.isPlainObject)(a))for(const[t,i]of(0,r.entries)(a))s.style[t]=i;else if("data"===e&&(0,o.isPlainObject)(a))for(const[t,i]of(0,r.entries)(a))s.dataset[t]=i;else s.setAttribute(e,a);function n(e){if((0,o.isString)(e))s.appendChild(document.createTextNode(e));else if(e instanceof Node)s.appendChild(e);else if(e instanceof NodeList||e instanceof HTMLCollection)for(const t of e)s.appendChild(t);else if(null!=e&&!1!==e)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(e)}`)}for(const e of i)if((0,o.isArray)(e))for(const t of e)n(t);else n(e);return s};function l(e){const t=e.parentNode;null!=t&&t.removeChild(e)}function c(e,...t){const i=e.firstChild;for(const s of t)e.insertBefore(s,i)}function h(e,t){var i,s,n;const o=Element.prototype;return(null!==(n=null!==(s=null!==(i=o.matches)&&void 0!==i?i:o.webkitMatchesSelector)&&void 0!==s?s:o.mozMatchesSelector)&&void 0!==n?n:o.msMatchesSelector).call(e,t)}function _(e){return parseFloat(e)||0}function u(e){const t=getComputedStyle(e);return{border:{top:_(t.borderTopWidth),bottom:_(t.borderBottomWidth),left:_(t.borderLeftWidth),right:_(t.borderRightWidth)},margin:{top:_(t.marginTop),bottom:_(t.marginBottom),left:_(t.marginLeft),right:_(t.marginRight)},padding:{top:_(t.paddingTop),bottom:_(t.paddingBottom),left:_(t.paddingLeft),right:_(t.paddingRight)}}}function d(e){const t=e.getBoundingClientRect();return{width:Math.ceil(t.width),height:Math.ceil(t.height)}}i.createElement=function(e,t,...i){return a(e)(t,...i)},i.div=a("div"),i.span=a("span"),i.canvas=a("canvas"),i.link=a("link"),i.style=a("style"),i.a=a("a"),i.p=a("p"),i.i=a("i"),i.pre=a("pre"),i.button=a("button"),i.label=a("label"),i.input=a("input"),i.select=a("select"),i.option=a("option"),i.optgroup=a("optgroup"),i.textarea=a("textarea"),i.createSVGElement=function(e,t,...i){const s=document.createElementNS("http://www.w3.org/2000/svg",e);for(const[a,l]of(0,r.entries)(null!=t?t:{}))null==l||(0,o.isBoolean)(l)&&!l||s.setAttribute(a,l);function n(e){if((0,o.isString)(e))s.appendChild(document.createTextNode(e));else if(e instanceof Node)s.appendChild(e);else if(e instanceof NodeList||e instanceof HTMLCollection)for(const t of e)s.appendChild(t);else if(null!=e&&!1!==e)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(e)}`)}for(const r of i)if((0,o.isArray)(r))for(const e of r)n(e);else n(r);return s},i.nbsp=function(){return document.createTextNode("\xa0")},i.append=function(e,...t){for(const i of t)e.appendChild(i)},i.remove=l,i.removeElement=l,i.replaceWith=function(e,t){const i=e.parentNode;null!=i&&i.replaceChild(t,e)},i.prepend=c,i.empty=function(e,t=!1){let i;for(;i=e.firstChild;)e.removeChild(i);if(t&&e instanceof Element)for(const s of e.attributes)e.removeAttributeNode(s)},i.display=function(e){e.style.display=""},i.undisplay=function(e){e.style.display="none"},i.show=function(e){e.style.visibility=""},i.hide=function(e){e.style.visibility="hidden"},i.offset=function(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}},i.matches=h,i.parent=function(e,t){let i=e;for(;i=i.parentElement;)if(h(i,t))return i;return null},i.extents=u,i.size=d,i.scroll_size=function(e){return{width:Math.ceil(e.scrollWidth),height:Math.ceil(e.scrollHeight)}},i.outer_size=function(e){const{margin:{left:t,right:i,top:s,bottom:n}}=u(e),{width:o,height:r}=d(e);return{width:Math.ceil(o+t+i),height:Math.ceil(r+s+n)}},i.content_size=function(e){const{left:t,top:i}=e.getBoundingClientRect(),{padding:s}=u(e);let n=0,o=0;for(const r of e.children){const e=r.getBoundingClientRect();n=Math.max(n,Math.ceil(e.left-t-s.left+e.width)),o=Math.max(o,Math.ceil(e.top-i-s.top+e.height))}return{width:n,height:o}},i.position=function(e,t,i){const{style:s}=e;if(s.left=`${t.x}px`,s.top=`${t.y}px`,s.width=`${t.width}px`,s.height=`${t.height}px`,null==i)s.margin="";else{const{top:e,right:t,bottom:n,left:o}=i;s.margin=`${e}px ${t}px ${n}px ${o}px`}},i.children=function(e){return Array.from(e.children)};class p{constructor(e){this.el=e,this.classList=e.classList}get values(){const e=[];for(let t=0;t<this.classList.length;t++){const i=this.classList.item(t);null!=i&&e.push(i)}return e}has(e){return this.classList.contains(e)}add(...e){for(const t of e)this.classList.add(t);return this}remove(...e){for(const t of e)this.classList.remove(t);return this}clear(){for(const e of this.values)"bk"!=e&&this.classList.remove(e);return this}toggle(e,t){return(null!=t?t:!this.has(e))?this.add(e):this.remove(e),this}}var m;function g(e,t,i){const{width:s,height:n,position:o,display:r}=e.style;e.style.position="absolute",e.style.display="",e.style.width=null!=t.width&&t.width!=1/0?`${t.width}px`:"auto",e.style.height=null!=t.height&&t.height!=1/0?`${t.height}px`:"auto";try{return i()}finally{e.style.position=o,e.style.display=r,e.style.width=s,e.style.height=n}}i.ClassList=p,p.__name__="ClassList",i.classes=function(e){return new p(e)},i.toggle_attribute=function(e,t,i){null==i&&(i=!e.hasAttribute(t)),i?e.setAttribute(t,"true"):e.removeAttribute(t)},(m=i.Keys||(i.Keys={}))[m.Backspace=8]="Backspace",m[m.Tab=9]="Tab",m[m.Enter=13]="Enter",m[m.Esc=27]="Esc",m[m.PageUp=33]="PageUp",m[m.PageDown=34]="PageDown",m[m.Left=37]="Left",m[m.Up=38]="Up",m[m.Right=39]="Right",m[m.Down=40]="Down",m[m.Delete=46]="Delete",i.undisplayed=function(e,t){const{display:i}=e.style;e.style.display="none";try{return t()}finally{e.style.display=i}},i.unsized=function(e,t){return g(e,{},t)},i.sized=g;class f{constructor(e){this.root=e,this.known=new Set,this.style=(0,i.style)({type:"text/css"}),c(e,this.style)}append(e){this.known.has(e)||(this.style.appendChild(document.createTextNode(e)),this.known.add(e))}}i.StyleSheet=f,f.__name__="StyleSheet",i.stylesheet=new f(document.head),i.dom_ready=async function(){if("loading"==document.readyState)return new Promise(((e,t)=>{document.addEventListener("DOMContentLoaded",(()=>e()),{once:!0})}))}},function(e,t,i,s,n){s(),i.root="bk-root",i.default=".bk-root{position:relative;width:auto;height:auto;box-sizing:border-box;font-family:Helvetica, Arial, sans-serif;font-size:13px;}.bk-root .bk,.bk-root .bk:before,.bk-root .bk:after{box-sizing:inherit;margin:0;border:0;padding:0;background-image:none;font-family:inherit;font-size:100%;line-height:1.42857143;}.bk-root pre.bk{font-family:Courier, monospace;}"},function(e,t,i,s,n){s();const o=e(1),r=e(46);n("Line",r.Line),n("LineScalar",r.LineScalar),n("LineVector",r.LineVector);const a=e(49);n("Fill",a.Fill),n("FillScalar",a.FillScalar),n("FillVector",a.FillVector);const l=e(50);n("Text",l.Text),n("TextScalar",l.TextScalar),n("TextVector",l.TextVector);const c=e(51);n("Hatch",c.Hatch),n("HatchScalar",c.HatchScalar),n("HatchVector",c.HatchVector);const h=(0,o.__importStar)(e(48)),_=e(47);n("VisualProperties",_.VisualProperties),n("VisualUniforms",_.VisualUniforms);class u{constructor(e){this._visuals=[];for(const[t,i]of e.model._mixins){const s=(()=>{switch(i){case h.Line:return new r.Line(e,t);case h.LineScalar:return new r.LineScalar(e,t);case h.LineVector:return new r.LineVector(e,t);case h.Fill:return new a.Fill(e,t);case h.FillScalar:return new a.FillScalar(e,t);case h.FillVector:return new a.FillVector(e,t);case h.Text:return new l.Text(e,t);case h.TextScalar:return new l.TextScalar(e,t);case h.TextVector:return new l.TextVector(e,t);case h.Hatch:return new c.Hatch(e,t);case h.HatchScalar:return new c.HatchScalar(e,t);case h.HatchVector:return new c.HatchVector(e,t);default:throw new Error("unknown visual")}})();s instanceof _.VisualProperties&&s.update(),this._visuals.push(s),Object.defineProperty(this,t+s.type,{get:()=>s,configurable:!1,enumerable:!0})}}*[Symbol.iterator](){yield*this._visuals}}i.Visuals=u,u.__name__="Visuals"},function(e,t,i,s,n){s();const o=e(1),r=e(47),a=(0,o.__importStar)(e(48)),l=e(22),c=e(8);function h(e){if((0,c.isArray)(e))return e;switch(e){case"solid":return[];case"dashed":return[6];case"dotted":return[2,4];case"dotdash":return[2,4,6,4];case"dashdot":return[6,4,2,4];default:return e.split(" ").map(Number).filter(c.isInteger)}}i.resolve_line_dash=h;class _ extends r.VisualProperties{get doit(){const e=this.line_color.get_value(),t=this.line_alpha.get_value(),i=this.line_width.get_value();return!(null==e||0==t||0==i)}apply(e){const{doit:t}=this;return t&&(this.set_value(e),e.stroke()),t}values(){return{color:this.line_color.get_value(),alpha:this.line_alpha.get_value(),width:this.line_width.get_value(),join:this.line_join.get_value(),cap:this.line_cap.get_value(),dash:this.line_dash.get_value(),offset:this.line_dash_offset.get_value()}}set_value(e){const t=this.line_color.get_value(),i=this.line_alpha.get_value();e.strokeStyle=(0,l.color2css)(t,i),e.lineWidth=this.line_width.get_value(),e.lineJoin=this.line_join.get_value(),e.lineCap=this.line_cap.get_value(),e.lineDash=h(this.line_dash.get_value()),e.lineDashOffset=this.line_dash_offset.get_value()}}i.Line=_,_.__name__="Line";class u extends r.VisualUniforms{get doit(){const e=this.line_color.value,t=this.line_alpha.value,i=this.line_width.value;return!(0==e||0==t||0==i)}apply(e){const{doit:t}=this;return t&&(this.set_value(e),e.stroke()),t}values(){return{color:this.line_color.value,alpha:this.line_alpha.value,width:this.line_width.value,join:this.line_join.value,cap:this.line_cap.value,dash:this.line_dash.value,offset:this.line_dash_offset.value}}set_value(e){const t=this.line_color.value,i=this.line_alpha.value;e.strokeStyle=(0,l.color2css)(t,i),e.lineWidth=this.line_width.value,e.lineJoin=this.line_join.value,e.lineCap=this.line_cap.value,e.lineDash=h(this.line_dash.value),e.lineDashOffset=this.line_dash_offset.value}}i.LineScalar=u,u.__name__="LineScalar";class d extends r.VisualUniforms{get doit(){const{line_color:e}=this;if(e.is_Scalar()&&0==e.value)return!1;const{line_alpha:t}=this;if(t.is_Scalar()&&0==t.value)return!1;const{line_width:i}=this;return!i.is_Scalar()||0!=i.value}apply(e,t){const{doit:i}=this;return i&&(this.set_vectorize(e,t),e.stroke()),i}values(e){return{color:this.line_color.get(e),alpha:this.line_alpha.get(e),width:this.line_width.get(e),join:this.line_join.get(e),cap:this.line_cap.get(e),dash:this.line_dash.get(e),offset:this.line_dash_offset.get(e)}}set_vectorize(e,t){const i=this.line_color.get(t),s=this.line_alpha.get(t),n=this.line_width.get(t),o=this.line_join.get(t),r=this.line_cap.get(t),a=this.line_dash.get(t),c=this.line_dash_offset.get(t);e.strokeStyle=(0,l.color2css)(i,s),e.lineWidth=n,e.lineJoin=o,e.lineCap=r,e.lineDash=h(a),e.lineDashOffset=c}}i.LineVector=d,d.__name__="LineVector",_.prototype.type="line",_.prototype.attrs=Object.keys(a.Line),u.prototype.type="line",u.prototype.attrs=Object.keys(a.LineScalar),d.prototype.type="line",d.prototype.attrs=Object.keys(a.LineVector)},function(e,t,i,s,n){s();class o{constructor(e,t=""){this.obj=e,this.prefix=t;const i=this;this._props=[];for(const s of this.attrs){const n=e.model.properties[t+s];n.change.connect((()=>this.update())),i[s]=n,this._props.push(n)}}*[Symbol.iterator](){yield*this._props}update(){}}i.VisualProperties=o,o.__name__="VisualProperties";class r{constructor(e,t=""){this.obj=e,this.prefix=t;for(const i of this.attrs)Object.defineProperty(this,i,{get:()=>e[t+i]})}*[Symbol.iterator](){for(const e of this.attrs)yield this.obj.model.properties[this.prefix+e]}update(){}}i.VisualUniforms=r,r.__name__="VisualUniforms"},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importStar)(e(18)),a=e(20),l=(0,o.__importStar)(e(21)),c=e(13);i.Line={line_color:[l.Nullable(l.Color),"black"],line_alpha:[l.Alpha,1],line_width:[l.Number,1],line_join:[a.LineJoin,"bevel"],line_cap:[a.LineCap,"butt"],line_dash:[l.Or(a.LineDash,l.Array(l.Number)),[]],line_dash_offset:[l.Number,0]},i.Fill={fill_color:[l.Nullable(l.Color),"gray"],fill_alpha:[l.Alpha,1]},i.Hatch={hatch_color:[l.Nullable(l.Color),"black"],hatch_alpha:[l.Alpha,1],hatch_scale:[l.Number,12],hatch_pattern:[l.Nullable(l.Or(a.HatchPatternType,l.String)),null],hatch_weight:[l.Number,1],hatch_extra:[l.Dict(l.AnyRef()),{}]},i.Text={text_color:[l.Nullable(l.Color),"#444444"],text_alpha:[l.Alpha,1],text_font:[r.Font,"helvetica"],text_font_size:[l.FontSize,"16px"],text_font_style:[a.FontStyle,"normal"],text_align:[a.TextAlign,"left"],text_baseline:[a.TextBaseline,"bottom"],text_line_height:[l.Number,1.2]},i.LineScalar={line_color:[r.ColorScalar,"black"],line_alpha:[r.NumberScalar,1],line_width:[r.NumberScalar,1],line_join:[r.LineJoinScalar,"bevel"],line_cap:[r.LineCapScalar,"butt"],line_dash:[r.LineDashScalar,[]],line_dash_offset:[r.NumberScalar,0]},i.FillScalar={fill_color:[r.ColorScalar,"gray"],fill_alpha:[r.NumberScalar,1]},i.HatchScalar={hatch_color:[r.ColorScalar,"black"],hatch_alpha:[r.NumberScalar,1],hatch_scale:[r.NumberScalar,12],hatch_pattern:[r.NullStringScalar,null],hatch_weight:[r.NumberScalar,1],hatch_extra:[r.AnyScalar,{}]},i.TextScalar={text_color:[r.ColorScalar,"#444444"],text_alpha:[r.NumberScalar,1],text_font:[r.FontScalar,"helvetica"],text_font_size:[r.FontSizeScalar,"16px"],text_font_style:[r.FontStyleScalar,"normal"],text_align:[r.TextAlignScalar,"left"],text_baseline:[r.TextBaselineScalar,"bottom"],text_line_height:[r.NumberScalar,1.2]},i.LineVector={line_color:[r.ColorSpec,"black"],line_alpha:[r.NumberSpec,1],line_width:[r.NumberSpec,1],line_join:[r.LineJoinSpec,"bevel"],line_cap:[r.LineCapSpec,"butt"],line_dash:[r.LineDashSpec,[]],line_dash_offset:[r.NumberSpec,0]},i.FillVector={fill_color:[r.ColorSpec,"gray"],fill_alpha:[r.NumberSpec,1]},i.HatchVector={hatch_color:[r.ColorSpec,"black"],hatch_alpha:[r.NumberSpec,1],hatch_scale:[r.NumberSpec,12],hatch_pattern:[r.NullStringSpec,null],hatch_weight:[r.NumberSpec,1],hatch_extra:[r.AnyScalar,{}]},i.TextVector={text_color:[r.ColorSpec,"#444444"],text_alpha:[r.NumberSpec,1],text_font:[r.FontSpec,"helvetica"],text_font_size:[r.FontSizeSpec,"16px"],text_font_style:[r.FontStyleSpec,"normal"],text_align:[r.TextAlignSpec,"left"],text_baseline:[r.TextBaselineSpec,"bottom"],text_line_height:[r.NumberSpec,1.2]},i.attrs_of=function(e,t,i,s=!1){const n={};for(const o of(0,c.keys)(i)){const i=`${t}${o}`,r=e[i];n[s?i:o]=r}return n}},function(e,t,i,s,n){s();const o=e(1),r=e(47),a=(0,o.__importStar)(e(48)),l=e(22);class c extends r.VisualProperties{get doit(){const e=this.fill_color.get_value(),t=this.fill_alpha.get_value();return!(null==e||0==t)}apply(e,t){const{doit:i}=this;return i&&(this.set_value(e),e.fill(t)),i}values(){return{color:this.fill_color.get_value(),alpha:this.fill_alpha.get_value()}}set_value(e){const t=this.fill_color.get_value(),i=this.fill_alpha.get_value();e.fillStyle=(0,l.color2css)(t,i)}}i.Fill=c,c.__name__="Fill";class h extends r.VisualUniforms{get doit(){const e=this.fill_color.value,t=this.fill_alpha.value;return!(0==e||0==t)}apply(e,t){const{doit:i}=this;return i&&(this.set_value(e),e.fill(t)),i}values(){return{color:this.fill_color.value,alpha:this.fill_alpha.value}}set_value(e){const t=this.fill_color.value,i=this.fill_alpha.value;e.fillStyle=(0,l.color2css)(t,i)}}i.FillScalar=h,h.__name__="FillScalar";class _ extends r.VisualUniforms{get doit(){const{fill_color:e}=this;if(e.is_Scalar()&&0==e.value)return!1;const{fill_alpha:t}=this;return!t.is_Scalar()||0!=t.value}apply(e,t,i){const{doit:s}=this;return s&&(this.set_vectorize(e,t),e.fill(i)),s}values(e){return{color:this.fill_color.get(e),alpha:this.fill_alpha.get(e)}}set_vectorize(e,t){const i=this.fill_color.get(t),s=this.fill_alpha.get(t);e.fillStyle=(0,l.color2css)(i,s)}}i.FillVector=_,_.__name__="FillVector",c.prototype.type="fill",c.prototype.attrs=Object.keys(a.Fill),h.prototype.type="fill",h.prototype.attrs=Object.keys(a.FillScalar),_.prototype.type="fill",_.prototype.attrs=Object.keys(a.FillVector)},function(e,t,i,s,n){s();const o=e(1),r=e(47),a=(0,o.__importStar)(e(48)),l=e(22);class c extends r.VisualProperties{get doit(){const e=this.text_color.get_value(),t=this.text_alpha.get_value();return!(null==e||0==t)}values(){return{color:this.text_color.get_value(),alpha:this.text_alpha.get_value(),font:this.text_font.get_value(),font_size:this.text_font_size.get_value(),font_style:this.text_font_style.get_value(),align:this.text_align.get_value(),baseline:this.text_baseline.get_value(),line_height:this.text_line_height.get_value()}}set_value(e){const t=this.text_color.get_value(),i=this.text_alpha.get_value();e.fillStyle=(0,l.color2css)(t,i),e.font=this.font_value(),e.textAlign=this.text_align.get_value(),e.textBaseline=this.text_baseline.get_value()}font_value(){return`${this.text_font_style.get_value()} ${this.text_font_size.get_value()} ${this.text_font.get_value()}`}}i.Text=c,c.__name__="Text";class h extends r.VisualUniforms{get doit(){const e=this.text_color.value,t=this.text_alpha.value;return!(0==e||0==t)}values(){return{color:this.text_color.value,alpha:this.text_alpha.value,font:this.text_font.value,font_size:this.text_font_size.value,font_style:this.text_font_style.value,align:this.text_align.value,baseline:this.text_baseline.value,line_height:this.text_line_height.value}}set_value(e){const t=this.text_color.value,i=this.text_alpha.value,s=this.font_value(),n=this.text_align.value,o=this.text_baseline.value;e.fillStyle=(0,l.color2css)(t,i),e.font=s,e.textAlign=n,e.textBaseline=o}font_value(){return`${this.text_font_style.value} ${this.text_font_size.value} ${this.text_font.value}`}}i.TextScalar=h,h.__name__="TextScalar";class _ extends r.VisualUniforms{values(e){return{color:this.text_color.get(e),alpha:this.text_alpha.get(e),font:this.text_font.get(e),font_size:this.text_font_size.get(e),font_style:this.text_font_style.get(e),align:this.text_align.get(e),baseline:this.text_baseline.get(e),line_height:this.text_line_height.get(e)}}get doit(){const{text_color:e}=this;if(e.is_Scalar()&&0==e.value)return!1;const{text_alpha:t}=this;return!t.is_Scalar()||0!=t.value}set_vectorize(e,t){const i=this.text_color.get(t),s=this.text_alpha.get(t),n=this.font_value(t),o=this.text_align.get(t),r=this.text_baseline.get(t);e.fillStyle=(0,l.color2css)(i,s),e.font=n,e.textAlign=o,e.textBaseline=r}font_value(e){return`${this.text_font_style.get(e)} ${this.text_font_size.get(e)} ${this.text_font.get(e)}`}}i.TextVector=_,_.__name__="TextVector",c.prototype.type="text",c.prototype.attrs=Object.keys(a.Text),h.prototype.type="text",h.prototype.attrs=Object.keys(a.TextScalar),_.prototype.type="text",_.prototype.attrs=Object.keys(a.TextVector)},function(e,t,i,s,n){s();const o=e(1),r=e(47),a=e(52),l=(0,o.__importStar)(e(18)),c=(0,o.__importStar)(e(48));class h extends r.VisualProperties{constructor(){super(...arguments),this._update_iteration=0}update(){if(this._update_iteration++,this._hatch_image=null,!this.doit)return;const e=this.hatch_color.get_value(),t=this.hatch_alpha.get_value(),i=this.hatch_scale.get_value(),s=this.hatch_pattern.get_value(),n=this.hatch_weight.get_value(),o=e=>{this._hatch_image=e},r=this.hatch_extra.get_value()[s];if(null!=r){const s=r.get_pattern(e,t,i,n);if(s instanceof Promise){const{_update_iteration:e}=this;s.then((t=>{this._update_iteration==e&&(o(t),this.obj.request_render())}))}else o(s)}else{const r=this.obj.canvas.create_layer(),l=(0,a.get_pattern)(r,s,e,t,i,n);o(l)}}get doit(){const e=this.hatch_color.get_value(),t=this.hatch_alpha.get_value(),i=this.hatch_pattern.get_value();return!(null==e||0==t||" "==i||"blank"==i||null==i)}apply(e,t){const{doit:i}=this;return i&&(this.set_value(e),e.layer.undo_transform((()=>e.fill(t)))),i}set_value(e){const t=this.pattern(e);e.fillStyle=null!=t?t:"transparent"}pattern(e){const t=this._hatch_image;return null==t?null:e.createPattern(t,this.repetition())}repetition(){const e=this.hatch_pattern.get_value(),t=this.hatch_extra.get_value()[e];if(null==t)return"repeat";switch(t.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}i.Hatch=h,h.__name__="Hatch";class _ extends r.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const e=this.hatch_color.value,t=this.hatch_alpha.value,i=this.hatch_pattern.value;return!(null==e||0==t||" "==i||"blank"==i||null==i)}update(){this._update_iteration++;const e=this.hatch_color.length;if(this._hatch_image=new l.UniformScalar(null,e),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const t=this.hatch_color.value,i=this.hatch_alpha.value,s=this.hatch_scale.value,n=this.hatch_pattern.value,o=this.hatch_weight.value,r=t=>{this._hatch_image=new l.UniformScalar(t,e)},c=this.hatch_extra.value[n];if(null!=c){const e=c.get_pattern(t,i,s,o);if(e instanceof Promise){const{_update_iteration:t}=this;e.then((e=>{this._update_iteration==t&&(r(e),this.obj.request_render())}))}else r(e)}else{const e=this.obj.canvas.create_layer(),l=(0,a.get_pattern)(e,n,t,i,s,o);r(l)}}get doit(){return this._static_doit}apply(e,t){const{doit:i}=this;return i&&(this.set_value(e),e.layer.undo_transform((()=>e.fill(t)))),i}set_value(e){var t;e.fillStyle=null!==(t=this.pattern(e))&&void 0!==t?t:"transparent"}pattern(e){const t=this._hatch_image.value;return null==t?null:e.createPattern(t,this.repetition())}repetition(){const e=this.hatch_pattern.value,t=this.hatch_extra.value[e];if(null==t)return"repeat";switch(t.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}i.HatchScalar=_,_.__name__="HatchScalar";class u extends r.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const{hatch_color:e}=this;if(e.is_Scalar()&&0==e.value)return!1;const{hatch_alpha:t}=this;if(t.is_Scalar()&&0==t.value)return!1;const{hatch_pattern:i}=this;if(i.is_Scalar()){const e=i.value;if(" "==e||"blank"==e||null==e)return!1}return!0}update(){this._update_iteration++;const e=this.hatch_color.length;if(this._hatch_image=new l.UniformScalar(null,e),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const t=(e,t,i,s,n,o)=>{const r=this.hatch_extra.value[e];if(null!=r){const e=r.get_pattern(t,i,s,n);if(e instanceof Promise){const{_update_iteration:t}=this;e.then((e=>{this._update_iteration==t&&(o(e),this.obj.request_render())}))}else o(e)}else{const r=this.obj.canvas.create_layer(),l=(0,a.get_pattern)(r,e,t,i,s,n);o(l)}};if(this.hatch_color.is_Scalar()&&this.hatch_alpha.is_Scalar()&&this.hatch_scale.is_Scalar()&&this.hatch_pattern.is_Scalar()&&this.hatch_weight.is_Scalar()){const i=this.hatch_color.value,s=this.hatch_alpha.value,n=this.hatch_scale.value;t(this.hatch_pattern.value,i,s,n,this.hatch_weight.value,(t=>{this._hatch_image=new l.UniformScalar(t,e)}))}else{const i=new Array(e);i.fill(null),this._hatch_image=new l.UniformVector(i);for(let s=0;s<e;s++){const e=this.hatch_color.get(s),n=this.hatch_alpha.get(s),o=this.hatch_scale.get(s);t(this.hatch_pattern.get(s),e,n,o,this.hatch_weight.get(s),(e=>{i[s]=e}))}}}get doit(){return this._static_doit}apply(e,t,i){const{doit:s}=this;return s&&(this.set_vectorize(e,t),e.layer.undo_transform((()=>e.fill(i)))),s}set_vectorize(e,t){var i;e.fillStyle=null!==(i=this.pattern(e,t))&&void 0!==i?i:"transparent"}pattern(e,t){const i=this._hatch_image.get(t);return null==i?null:e.createPattern(i,this.repetition(t))}repetition(e){const t=this.hatch_pattern.get(e),i=this.hatch_extra.value[t];if(null==i)return"repeat";switch(i.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}i.HatchVector=u,u.__name__="HatchVector",h.prototype.type="hatch",h.prototype.attrs=Object.keys(c.Hatch),_.prototype.type="hatch",_.prototype.attrs=Object.keys(c.HatchScalar),u.prototype.type="hatch",u.prototype.attrs=Object.keys(c.HatchVector)},function(e,t,i,s,n){s();const o=e(22);function r(e,t,i){e.moveTo(0,i+.5),e.lineTo(t,i+.5),e.stroke()}function a(e,t,i){e.moveTo(i+.5,0),e.lineTo(i+.5,t),e.stroke()}function l(e,t){e.moveTo(0,t),e.lineTo(t,0),e.stroke(),e.moveTo(0,0),e.lineTo(t,t),e.stroke()}i.hatch_aliases={" ":"blank",".":"dot",o:"ring","-":"horizontal_line","|":"vertical_line","+":"cross",'"':"horizontal_dash",":":"vertical_dash","@":"spiral","/":"right_diagonal_line","\\":"left_diagonal_line",x:"diagonal_cross",",":"right_diagonal_dash","`":"left_diagonal_dash",v:"horizontal_wave",">":"vertical_wave","*":"criss_cross"},i.get_pattern=function(e,t,s,n,c,h){return e.resize(c,c),e.prepare(),function(e,t,s,n,c,h){var _;const u=c,d=u/2,p=d/2,m=(0,o.color2css)(s,n);switch(e.strokeStyle=m,e.fillStyle=m,e.lineCap="square",e.lineWidth=h,null!==(_=i.hatch_aliases[t])&&void 0!==_?_:t){case"blank":break;case"dot":e.arc(d,d,d/2,0,2*Math.PI,!0),e.fill();break;case"ring":e.arc(d,d,d/2,0,2*Math.PI,!0),e.stroke();break;case"horizontal_line":r(e,u,d);break;case"vertical_line":a(e,u,d);break;case"cross":r(e,u,d),a(e,u,d);break;case"horizontal_dash":r(e,d,d);break;case"vertical_dash":a(e,d,d);break;case"spiral":{const t=u/30;e.moveTo(d,d);for(let i=0;i<360;i++){const s=.1*i,n=d+t*s*Math.cos(s),o=d+t*s*Math.sin(s);e.lineTo(n,o)}e.stroke();break}case"right_diagonal_line":e.moveTo(.5-p,u),e.lineTo(p+.5,0),e.stroke(),e.moveTo(p+.5,u),e.lineTo(3*p+.5,0),e.stroke(),e.moveTo(3*p+.5,u),e.lineTo(5*p+.5,0),e.stroke(),e.stroke();break;case"left_diagonal_line":e.moveTo(p+.5,u),e.lineTo(.5-p,0),e.stroke(),e.moveTo(3*p+.5,u),e.lineTo(p+.5,0),e.stroke(),e.moveTo(5*p+.5,u),e.lineTo(3*p+.5,0),e.stroke(),e.stroke();break;case"diagonal_cross":l(e,u);break;case"right_diagonal_dash":e.moveTo(p+.5,3*p+.5),e.lineTo(3*p+.5,p+.5),e.stroke();break;case"left_diagonal_dash":e.moveTo(p+.5,p+.5),e.lineTo(3*p+.5,3*p+.5),e.stroke();break;case"horizontal_wave":e.moveTo(0,p),e.lineTo(d,3*p),e.lineTo(u,p),e.stroke();break;case"vertical_wave":e.moveTo(p,0),e.lineTo(3*p,d),e.lineTo(p,u),e.stroke();break;case"criss_cross":l(e,u),r(e,u,d),a(e,u,d)}}(e.ctx,t,s,n,c,h),e.canvas}},function(e,t,i,s,n){var o;s();const r=e(14),a=e(8),l=e(13),c=e(26),h=e(19);class _ extends r.HasProps{constructor(e){super(e)}get is_syncable(){return this.syncable}[c.equals](e,t){return t.eq(this.id,e.id)&&super[c.equals](e,t)}initialize(){super.initialize(),this._js_callbacks=new Map}connect_signals(){super.connect_signals(),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,(()=>this._update_property_callbacks())),this.connect(this.properties.js_event_callbacks.change,(()=>this._update_event_callbacks())),this.connect(this.properties.subscribed_events.change,(()=>this._update_event_callbacks()))}_process_event(e){var t;for(const i of null!==(t=this.js_event_callbacks[e.event_name])&&void 0!==t?t:[])i.execute(e);null!=this.document&&this.subscribed_events.some((t=>t==e.event_name))&&this.document.event_manager.send_event(e)}trigger_event(e){null!=this.document&&(e.origin=this,this.document.event_manager.trigger(e))}_update_event_callbacks(){null!=this.document?this.document.event_manager.subscribed_models.add(this):h.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const e=e=>{const[t,i=null]=e.split(":");return null!=i?this.properties[i][t]:this[t]};for(const[t,i]of this._js_callbacks){const s=e(t);for(const e of i)this.disconnect(s,e)}this._js_callbacks.clear();for(const[t,i]of(0,l.entries)(this.js_property_callbacks)){const s=i.map((e=>()=>e.execute(this)));this._js_callbacks.set(t,s);const n=e(t);for(const e of s)this.connect(n,e)}}_doc_attached(){(0,l.isEmpty)(this.js_event_callbacks)&&0==this.subscribed_events.length||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(e){if((0,a.isString)(e))return[...this.references()].filter((t=>t instanceof _&&t.name===e));if(e.prototype instanceof r.HasProps)return[...this.references()].filter((t=>t instanceof e));throw new Error("invalid selector")}select_one(e){const t=this.select(e);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error("found more than one object matching given selector")}}}i.Model=_,o=_,_.__name__="Model",o.define((({Any:e,Unknown:t,Boolean:i,String:s,Array:n,Dict:o,Nullable:r})=>({tags:[n(t),[]],name:[r(s),null],js_property_callbacks:[o(n(e)),{}],js_event_callbacks:[o(n(e)),{}],subscribed_events:[n(s),[]],syncable:[i,!0]})))},function(e,t,i,s,n){var o,r;s();const a=e(12),l=e(53),c=e(55),h=e(59),_=e(61),u=e(62),d=e(57),p=e(63),m=e(67);class g{constructor(e,t){this.x_scale=e,this.y_scale=t,this.x_source=this.x_scale.source_range,this.y_source=this.y_scale.source_range,this.ranges=[this.x_source,this.y_source],this.scales=[this.x_scale,this.y_scale]}map_to_screen(e,t){return[this.x_scale.v_compute(e),this.y_scale.v_compute(t)]}map_from_screen(e,t){return[this.x_scale.v_invert(e),this.y_scale.v_invert(t)]}}i.CoordinateTransform=g,g.__name__="CoordinateTransform";class f extends l.Model{constructor(e){super(e)}get x_ranges(){return new Map([["default",this.x_source]])}get y_ranges(){return new Map([["default",this.y_source]])}_get_scale(e,t,i){if(e instanceof m.FactorRange!=t instanceof u.CategoricalScale)throw new Error(`Range ${e.type} is incompatible is Scale ${t.type}`);t instanceof _.LogScale&&e instanceof p.DataRange1d&&(e.scale_hint="log");const s=t.clone();return s.setv({source_range:e,target_range:i}),s}get_transform(e){const{x_source:t,x_scale:i,x_target:s}=this,n=this._get_scale(t,i,s),{y_source:o,y_scale:r,y_target:a}=this,l=this._get_scale(o,r,a),c=new b({source_scale:n,source_range:n.source_range,target_scale:e.x_scale,target_range:e.x_target}),h=new b({source_scale:l,source_range:l.source_range,target_scale:e.y_scale,target_range:e.y_target});return new g(c,h)}}i.CoordinateMapping=f,o=f,f.__name__="CoordinateMapping",o.define((({Ref:e})=>({x_source:[e(d.Range),()=>new p.DataRange1d],y_source:[e(d.Range),()=>new p.DataRange1d],x_scale:[e(c.Scale),()=>new h.LinearScale],y_scale:[e(c.Scale),()=>new h.LinearScale],x_target:[e(d.Range)],y_target:[e(d.Range)]})));class b extends c.Scale{constructor(e){super(e)}get s_compute(){const e=this.source_scale.s_compute,t=this.target_scale.s_compute;return i=>t(e(i))}get s_invert(){const e=this.source_scale.s_invert,t=this.target_scale.s_invert;return i=>e(t(i))}compute(e){return this.s_compute(e)}v_compute(e){const{s_compute:t}=this;return(0,a.map)(e,t)}invert(e){return this.s_invert(e)}v_invert(e){const{s_invert:t}=this;return(0,a.map)(e,t)}}i.CompositeScale=b,r=b,b.__name__="CompositeScale",r.internal((({Ref:e})=>({source_scale:[e(c.Scale)],target_scale:[e(c.Scale)]})))},function(e,t,i,s,n){var o;s();const r=e(56),a=e(57),l=e(58),c=e(24);class h extends r.Transform{constructor(e){super(e)}compute(e){return this.s_compute(e)}v_compute(e){const t=new c.ScreenArray(e.length),{s_compute:i}=this;for(let s=0;s<e.length;s++)t[s]=i(e[s]);return t}invert(e){return this.s_invert(e)}v_invert(e){const t=new Float64Array(e.length),{s_invert:i}=this;for(let s=0;s<e.length;s++)t[s]=i(e[s]);return t}r_compute(e,t){const{s_compute:i}=this;return this.target_range.is_reversed?[i(t),i(e)]:[i(e),i(t)]}r_invert(e,t){const{s_invert:i}=this;return this.target_range.is_reversed?[i(t),i(e)]:[i(e),i(t)]}}i.Scale=h,o=h,h.__name__="Scale",o.internal((({Ref:e})=>({source_range:[e(a.Range)],target_range:[e(l.Range1d)]})))},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{constructor(e){super(e)}}i.Transform=r,r.__name__="Transform"},function(e,t,i,s,n){var o;s();const r=e(53);class a extends r.Model{constructor(e){super(e),this.have_updated_interactively=!1}get is_reversed(){return this.start>this.end}get is_valid(){return isFinite(this.min)&&isFinite(this.max)}get span(){return Math.abs(this.end-this.start)}}i.Range=a,o=a,a.__name__="Range",o.define((({Number:e,Tuple:t,Or:i,Auto:s,Nullable:n})=>({bounds:[n(i(t(n(e),n(e)),s)),null],min_interval:[n(e),null],max_interval:[n(e),null]}))),o.internal((({Array:e,AnyRef:t})=>({plots:[e(t()),[]]})))},function(e,t,i,s,n){var o;s();const r=e(57);class a extends r.Range{constructor(e){super(e)}_set_auto_bounds(){if("auto"==this.bounds){const e=Math.min(this._reset_start,this._reset_end),t=Math.max(this._reset_start,this._reset_end);this.setv({bounds:[e,t]},{silent:!0})}}initialize(){super.initialize(),this._set_auto_bounds()}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}reset(){this._set_auto_bounds();const{_reset_start:e,_reset_end:t}=this;this.start!=e||this.end!=t?this.setv({start:e,end:t}):this.change.emit()}map(e){return new a({start:e(this.start),end:e(this.end)})}widen(e){let{start:t,end:i}=this;return this.is_reversed?(t+=e,i-=e):(t-=e,i+=e),new a({start:t,end:i})}}i.Range1d=a,o=a,a.__name__="Range1d",o.define((({Number:e,Nullable:t})=>({start:[e,0],end:[e,1],reset_start:[t(e),null,{on_update(e,t){t._reset_start=null!=e?e:t.start}}],reset_end:[t(e),null,{on_update(e,t){t._reset_end=null!=e?e:t.end}}]})))},function(e,t,i,s,n){s();const o=e(60);class r extends o.ContinuousScale{constructor(e){super(e)}get s_compute(){const[e,t]=this._linear_compute_state();return i=>e*i+t}get s_invert(){const[e,t]=this._linear_compute_state();return i=>(i-t)/e}_linear_compute_state(){const e=this.source_range.start,t=this.source_range.end,i=this.target_range.start,s=(this.target_range.end-i)/(t-e);return[s,-s*e+i]}}i.LinearScale=r,r.__name__="LinearScale"},function(e,t,i,s,n){s();const o=e(55);class r extends o.Scale{constructor(e){super(e)}}i.ContinuousScale=r,r.__name__="ContinuousScale"},function(e,t,i,s,n){s();const o=e(60);class r extends o.ContinuousScale{constructor(e){super(e)}get s_compute(){const[e,t,i,s]=this._compute_state();return n=>{if(0==i)return 0;{const o=(Math.log(n)-s)/i;return isFinite(o)?o*e+t:NaN}}}get s_invert(){const[e,t,i,s]=this._compute_state();return n=>{const o=(n-t)/e;return Math.exp(i*o+s)}}_get_safe_factor(e,t){let i=e<0?0:e,s=t<0?0:t;if(i==s)if(0==i)[i,s]=[1,10];else{const e=Math.log(i)/Math.log(10);i=10**Math.floor(e),s=Math.ceil(e)!=Math.floor(e)?10**Math.ceil(e):10**(Math.ceil(e)+1)}return[i,s]}_compute_state(){const e=this.source_range.start,t=this.source_range.end,i=this.target_range.start,s=this.target_range.end-i,[n,o]=this._get_safe_factor(e,t);let r,a;return 0==n?(r=Math.log(o),a=0):(r=Math.log(o)-Math.log(n),a=Math.log(n)),[s,i,r,a]}}i.LogScale=r,r.__name__="LogScale"},function(e,t,i,s,n){s();const o=e(55),r=e(59),{_linear_compute_state:a}=r.LinearScale.prototype;class l extends o.Scale{constructor(e){super(e)}get s_compute(){const[e,t]=a.call(this),i=this.source_range;return s=>e*i.synthetic(s)+t}get s_invert(){const[e,t]=a.call(this);return i=>(i-t)/e}}i.CategoricalScale=l,l.__name__="CategoricalScale"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(64),l=e(20),c=e(9),h=e(19),_=(0,o.__importStar)(e(65)),u=e(66);class d extends a.DataRange{constructor(e){super(e),this.have_updated_interactively=!1}initialize(){super.initialize(),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,this._plot_bounds=new Map}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:e,names:t}=this,i=(0,c.concat)(this.plots.map((e=>e.data_renderers)));return(0,u.compute_renderers)(0==e.length?"auto":e,i,t)}_compute_plot_bounds(e,t){let i=_.empty();for(const s of e){const e=t.get(s);null==e||!s.visible&&this.only_visible||(i=_.union(i,e))}return i}adjust_bounds_for_aspect(e,t){const i=_.empty();let s=e.x1-e.x0;s<=0&&(s=1);let n=e.y1-e.y0;n<=0&&(n=1);const o=.5*(e.x1+e.x0),r=.5*(e.y1+e.y0);return s<t*n?s=t*n:n=s/t,i.x1=o+.5*s,i.x0=o-.5*s,i.y1=r+.5*n,i.y0=r-.5*n,i}_compute_min_max(e,t){let i,s,n=_.empty();for(const[o,r]of e)o.visible&&(n=_.union(n,r));return[i,s]=0==t?[n.x0,n.x1]:[n.y0,n.y1],[i,s]}_compute_range(e,t){const i=this.range_padding;let s,n;if(null!=this._initial_start&&(e=this._initial_start),null!=this._initial_end&&(t=this._initial_end),"log"==this.scale_hint){let o,r;if((isNaN(e)||!isFinite(e)||e<=0)&&(e=isNaN(t)||!isFinite(t)||t<=0?.1:t/100,h.logger.warn(`could not determine minimum data value for log axis, DataRange1d using value ${e}`)),(isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(e)||!isFinite(e)||e<=0?10:100*e,h.logger.warn(`could not determine maximum data value for log axis, DataRange1d using value ${t}`)),t==e)r=this.default_span+.001,o=Math.log(e)/Math.log(10);else{let s,n;"percent"==this.range_padding_units?(s=Math.log(e)/Math.log(10),n=Math.log(t)/Math.log(10),r=(n-s)*(1+i)):(s=Math.log(e-i)/Math.log(10),n=Math.log(t+i)/Math.log(10),r=n-s),o=(s+n)/2}s=10**(o-r/2),n=10**(o+r/2)}else{let o;o=t==e?this.default_span:"percent"==this.range_padding_units?(t-e)*(1+i):t-e+2*i;const r=(t+e)/2;s=r-o/2,n=r+o/2}let o=1;this.flipped&&([s,n]=[n,s],o=-1);const r=this.follow_interval;return null!=r&&Math.abs(s-n)>r&&("start"==this.follow?n=s+o*r:"end"==this.follow&&(s=n-o*r)),[s,n]}update(e,t,i,s){if(this.have_updated_interactively)return;const n=this.computed_renderers();let o=this._compute_plot_bounds(n,e);null!=s&&(o=this.adjust_bounds_for_aspect(o,s)),this._plot_bounds.set(i,o);const[r,a]=this._compute_min_max(this._plot_bounds.entries(),t);let[l,c]=this._compute_range(r,a);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(l=this._initial_start):l=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(c=this._initial_end):c=this._initial_end);let h=!1;"auto"==this.bounds&&(this.setv({bounds:[l,c]},{silent:!0}),h=!0);const[_,u]=[this.start,this.end];if(l!=_||c!=u){const e={};l!=_&&(e.start=l),c!=u&&(e.end=c),this.setv(e),h=!1}h&&this.change.emit()}reset(){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()}}i.DataRange1d=d,r=d,d.__name__="DataRange1d",r.define((({Boolean:e,Number:t,Nullable:i})=>({start:[t],end:[t],range_padding:[t,.1],range_padding_units:[l.PaddingUnits,"percent"],flipped:[e,!1],follow:[i(l.StartEnd),null],follow_interval:[i(t),null],default_span:[t,2],only_visible:[e,!1]}))),r.internal((({Enum:e})=>({scale_hint:[e("log","auto"),"auto"]})))},function(e,t,i,s,n){var o;s();const r=e(57);class a extends r.Range{constructor(e){super(e)}}i.DataRange=a,o=a,a.__name__="DataRange",o.define((({String:e,Array:t,AnyRef:i})=>({names:[t(e),[]],renderers:[t(i()),[]]})))},function(e,t,i,s,n){s();const o=e(24),r=e(26),{min:a,max:l}=Math;i.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},i.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},i.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},i.union=function(e,t){return{x0:a(e.x0,t.x0),x1:l(e.x1,t.x1),y0:a(e.y0,t.y0),y1:l(e.y1,t.y1)}};class c{constructor(e){if(null==e)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in e){const{x0:t,y0:i,x1:s,y1:n}=e;if(!(t<=s&&i<=n))throw new Error(`invalid bbox {x0: ${t}, y0: ${i}, x1: ${s}, y1: ${n}}`);this.x0=t,this.y0=i,this.x1=s,this.y1=n}else if("x"in e){const{x:t,y:i,width:s,height:n}=e;if(!(s>=0&&n>=0))throw new Error(`invalid bbox {x: ${t}, y: ${i}, width: ${s}, height: ${n}}`);this.x0=t,this.y0=i,this.x1=t+s,this.y1=i+n}else{let t,i,s,n;if("width"in e)if("left"in e)t=e.left,i=t+e.width;else if("right"in e)i=e.right,t=i-e.width;else{const s=e.width/2;t=e.hcenter-s,i=e.hcenter+s}else t=e.left,i=e.right;if("height"in e)if("top"in e)s=e.top,n=s+e.height;else if("bottom"in e)n=e.bottom,s=n-e.height;else{const t=e.height/2;s=e.vcenter-t,n=e.vcenter+t}else s=e.top,n=e.bottom;if(!(t<=i&&s<=n))throw new Error(`invalid bbox {left: ${t}, top: ${s}, right: ${i}, bottom: ${n}}`);this.x0=t,this.y0=s,this.x1=i,this.y1=n}}static from_rect({left:e,right:t,top:i,bottom:s}){return new c({x0:Math.min(e,t),y0:Math.min(i,s),x1:Math.max(e,t),y1:Math.max(i,s)})}equals(e){return this.x0==e.x0&&this.y0==e.y0&&this.x1==e.x1&&this.y1==e.y1}[r.equals](e,t){return t.eq(this.x0,e.x0)&&t.eq(this.y0,e.y0)&&t.eq(this.x1,e.x1)&&t.eq(this.y1,e.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return[this.x0,this.y0]}get p1(){return[this.x1,this.y1]}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:e,y0:t,x1:i,y1:s}=this;return{p0:{x:e,y:t},p1:{x:i,y:t},p2:{x:i,y:s},p3:{x:e,y:s}}}get box(){const{x:e,y:t,width:i,height:s}=this;return{x:e,y:t,width:i,height:s}}get h_range(){return{start:this.x0,end:this.x1}}get v_range(){return{start:this.y0,end:this.y1}}get ranges(){return[this.h_range,this.v_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}relative(){const{width:e,height:t}=this;return new c({x:0,y:0,width:e,height:t})}translate(e,t){const{x:i,y:s,width:n,height:o}=this;return new c({x:e+i,y:t+s,width:n,height:o})}relativize(e,t){return[e-this.x,t-this.y]}contains(e,t){return this.x0<=e&&e<=this.x1&&this.y0<=t&&t<=this.y1}clip(e,t){return e<this.x0?e=this.x0:e>this.x1&&(e=this.x1),t<this.y0?t=this.y0:t>this.y1&&(t=this.y1),[e,t]}grow_by(e){return new c({left:this.left-e,right:this.right+e,top:this.top-e,bottom:this.bottom+e})}shrink_by(e){return new c({left:this.left+e,right:this.right-e,top:this.top+e,bottom:this.bottom-e})}union(e){return new c({x0:a(this.x0,e.x0),y0:a(this.y0,e.y0),x1:l(this.x1,e.x1),y1:l(this.y1,e.y1)})}intersection(e){return this.intersects(e)?new c({x0:l(this.x0,e.x0),y0:l(this.y0,e.y0),x1:a(this.x1,e.x1),y1:a(this.y1,e.y1)}):null}intersects(e){return!(e.x1<this.x0||e.x0>this.x1||e.y1<this.y0||e.y0>this.y1)}get xview(){return{compute:e=>this.left+e,v_compute:e=>{const t=new o.ScreenArray(e.length),i=this.left;for(let s=0;s<e.length;s++)t[s]=i+e[s];return t}}}get yview(){return{compute:e=>this.bottom-e,v_compute:e=>{const t=new o.ScreenArray(e.length),i=this.bottom;for(let s=0;s<e.length;s++)t[s]=i-e[s];return t}}}}i.BBox=c,c.__name__="BBox"},function(e,t,i,s,n){s();const o=e(9);i.compute_renderers=function(e,t,i){if(null==e)return[];let s="auto"==e?t:e;return i.length>0&&(s=s.filter((e=>(0,o.includes)(i,e.name)))),s}},function(e,t,i,s,n){var o;s();const r=e(57),a=e(20),l=e(21),c=e(24),h=e(9),_=e(8),u=e(11);function d(e,t,i=0){const s=new Map;for(let n=0;n<e.length;n++){const o=e[n];if(s.has(o))throw new Error(`duplicate factor or subfactor: ${o}`);s.set(o,{value:.5+n*(1+t)+i})}return[s,(e.length-1)*t]}function p(e,t,i,s=0){var n;const o=new Map,r=new Map;for(const[c,h]of e){const e=null!==(n=r.get(c))&&void 0!==n?n:[];r.set(c,[...e,h])}let a=s,l=0;for(const[c,_]of r){const e=_.length,[s,n]=d(_,i,a);l+=n;const r=(0,h.sum)(_.map((e=>s.get(e).value)));o.set(c,{value:r/e,mapping:s}),a+=e+t+n}return[o,(r.size-1)*t+l]}function m(e,t,i,s,n=0){var o;const r=new Map,a=new Map;for(const[h,_,u]of e){const e=null!==(o=a.get(h))&&void 0!==o?o:[];a.set(h,[...e,[_,u]])}let l=n,c=0;for(const[_,u]of a){const e=u.length,[n,o]=p(u,i,s,l);c+=o;const a=(0,h.sum)(u.map((([e])=>n.get(e).value)));r.set(_,{value:a/e,mapping:n}),l+=e+t+o}return[r,(a.size-1)*t+c]}i.Factor=(0,l.Or)(l.String,(0,l.Tuple)(l.String,l.String),(0,l.Tuple)(l.String,l.String,l.String)),i.FactorSeq=(0,l.Or)((0,l.Array)(l.String),(0,l.Array)((0,l.Tuple)(l.String,l.String)),(0,l.Array)((0,l.Tuple)(l.String,l.String,l.String))),i.map_one_level=d,i.map_two_levels=p,i.map_three_levels=m;class g extends r.Range{constructor(e){super(e)}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init(!0)}connect_signals(){super.connect_signals(),this.connect(this.properties.factors.change,(()=>this.reset())),this.connect(this.properties.factor_padding.change,(()=>this.reset())),this.connect(this.properties.group_padding.change,(()=>this.reset())),this.connect(this.properties.subgroup_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding.change,(()=>this.reset())),this.connect(this.properties.range_padding_units.change,(()=>this.reset()))}reset(){this._init(!1),this.change.emit()}_lookup(e){switch(e.length){case 1:{const[t]=e,i=this._mapping.get(t);return null!=i?i.value:NaN}case 2:{const[t,i]=e,s=this._mapping.get(t);if(null!=s){const e=s.mapping.get(i);if(null!=e)return e.value}return NaN}case 3:{const[t,i,s]=e,n=this._mapping.get(t);if(null!=n){const e=n.mapping.get(i);if(null!=e){const t=e.mapping.get(s);if(null!=t)return t.value}}return NaN}default:(0,u.unreachable)()}}synthetic(e){if((0,_.isNumber)(e))return e;if((0,_.isString)(e))return this._lookup([e]);let t=0;const i=e[e.length-1];return(0,_.isNumber)(i)&&(t=i,e=e.slice(0,-1)),this._lookup(e)+t}v_synthetic(e){const t=e.length,i=new c.ScreenArray(t);for(let s=0;s<t;s++)i[s]=this.synthetic(e[s]);return i}_init(e){const{levels:t,mapping:i,tops:s,mids:n,inside_padding:o}=(()=>{if((0,h.every)(this.factors,_.isString)){const e=this.factors,[t,i]=d(e,this.factor_padding);return{levels:1,mapping:t,tops:null,mids:null,inside_padding:i}}if((0,h.every)(this.factors,(e=>(0,_.isArray)(e)&&2==e.length&&(0,_.isString)(e[0])&&(0,_.isString)(e[1])))){const e=this.factors,[t,i]=p(e,this.group_padding,this.factor_padding),s=[...t.keys()];return{levels:2,mapping:t,tops:s,mids:null,inside_padding:i}}if((0,h.every)(this.factors,(e=>(0,_.isArray)(e)&&3==e.length&&(0,_.isString)(e[0])&&(0,_.isString)(e[1])&&(0,_.isString)(e[2])))){const e=this.factors,[t,i]=m(e,this.group_padding,this.subgroup_padding,this.factor_padding),s=[...t.keys()],n=[];for(const[o,r]of t)for(const e of r.mapping.keys())n.push([o,e]);return{levels:3,mapping:t,tops:s,mids:n,inside_padding:i}}(0,u.unreachable)()})();this._mapping=i,this.tops=s,this.mids=n;let r=0,a=this.factors.length+o;if("percent"==this.range_padding_units){const e=(a-r)*this.range_padding/2;r-=e,a+=e}else r-=this.range_padding,a+=this.range_padding;this.setv({start:r,end:a,levels:t},{silent:e}),"auto"==this.bounds&&this.setv({bounds:[r,a]},{silent:!0})}}i.FactorRange=g,o=g,g.__name__="FactorRange",o.define((({Number:e})=>({factors:[i.FactorSeq,[]],factor_padding:[e,0],subgroup_padding:[e,.8],group_padding:[e,1.4],range_padding:[e,0],range_padding_units:[a.PaddingUnits,"percent"],start:[e],end:[e]}))),o.internal((({Number:e,String:t,Array:i,Tuple:s,Nullable:n})=>({levels:[e],mids:[n(i(s(t,t))),null],tops:[n(i(t)),null]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(69),l=e(112),c=e(48),h=e(20),_=e(24),u=e(113),d=(0,o.__importStar)(e(18)),p=e(10);class m extends a.DataAnnotationView{async lazy_initialize(){await super.lazy_initialize();const{start:e,end:t}=this.model;null!=e&&(this.start=await(0,u.build_view)(e,{parent:this})),null!=t&&(this.end=await(0,u.build_view)(t,{parent:this}))}set_data(e){var t,i;super.set_data(e),null===(t=this.start)||void 0===t||t.set_data(e),null===(i=this.end)||void 0===i||i.set_data(e)}remove(){var e,t;null===(e=this.start)||void 0===e||e.remove(),null===(t=this.end)||void 0===t||t.remove(),super.remove()}map_data(){const{frame:e}=this.plot_view;"data"==this.model.start_units?(this._sx_start=this.coordinates.x_scale.v_compute(this._x_start),this._sy_start=this.coordinates.y_scale.v_compute(this._y_start)):(this._sx_start=e.bbox.xview.v_compute(this._x_start),this._sy_start=e.bbox.yview.v_compute(this._y_start)),"data"==this.model.end_units?(this._sx_end=this.coordinates.x_scale.v_compute(this._x_end),this._sy_end=this.coordinates.y_scale.v_compute(this._y_end)):(this._sx_end=e.bbox.xview.v_compute(this._x_end),this._sy_end=e.bbox.yview.v_compute(this._y_end));const{_sx_start:t,_sy_start:i,_sx_end:s,_sy_end:n}=this,o=t.length,r=this._angles=new _.ScreenArray(o);for(let a=0;a<o;a++)r[a]=Math.PI/2+(0,p.atan2)([t[a],i[a]],[s[a],n[a]])}paint(e){const{start:t,end:i}=this,{_sx_start:s,_sy_start:n,_sx_end:o,_sy_end:r,_angles:a}=this,{x:l,y:c,width:h,height:_}=this.plot_view.frame.bbox;for(let u=0,d=s.length;u<d;u++)null!=i&&(e.save(),e.translate(o[u],r[u]),e.rotate(a[u]),i.render(e,u),e.restore()),null!=t&&(e.save(),e.translate(s[u],n[u]),e.rotate(a[u]+Math.PI),t.render(e,u),e.restore()),this.visuals.line.doit&&(e.save(),null==t&&null==i||(e.beginPath(),e.rect(l,c,h,_),null!=i&&(e.save(),e.translate(o[u],r[u]),e.rotate(a[u]),i.clip(e,u),e.restore()),null!=t&&(e.save(),e.translate(s[u],n[u]),e.rotate(a[u]+Math.PI),t.clip(e,u),e.restore()),e.closePath(),e.clip()),this.visuals.line.set_vectorize(e,u),e.beginPath(),e.moveTo(s[u],n[u]),e.lineTo(o[u],r[u]),e.stroke(),e.restore())}}i.ArrowView=m,m.__name__="ArrowView";class g extends a.DataAnnotation{constructor(e){super(e)}}i.Arrow=g,r=g,g.__name__="Arrow",r.prototype.default_view=m,r.mixins(c.LineVector),r.define((({Ref:e,Nullable:t})=>({x_start:[d.XCoordinateSpec,{field:"x_start"}],y_start:[d.YCoordinateSpec,{field:"y_start"}],start_units:[h.SpatialUnits,"data"],start:[t(e(l.ArrowHead)),null],x_end:[d.XCoordinateSpec,{field:"x_end"}],y_end:[d.YCoordinateSpec,{field:"y_end"}],end_units:[h.SpatialUnits,"data"],end:[t(e(l.ArrowHead)),()=>new l.OpenHead]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=e(70),c=e(75),h=e(78),_=(0,o.__importStar)(e(18));class u extends a.AnnotationView{constructor(){super(...arguments),this._initial_set_data=!1}connect_signals(){super.connect_signals();const e=()=>{this.set_data(this.model.source),this._rerender()};this.connect(this.model.change,e),this.connect(this.model.source.streaming,e),this.connect(this.model.source.patching,e),this.connect(this.model.source.change,e)}_rerender(){this.request_render()}set_data(e){const t=this;for(const i of this.model)if(i instanceof _.VectorSpec||i instanceof _.ScalarSpec)if(i instanceof _.BaseCoordinateSpec){const s=i.array(e);t[`_${i.attr}`]=s}else{const s=i.uniform(e);t[`${i.attr}`]=s}this.plot_model.use_map&&(null!=t._x&&h.inplace.project_xy(t._x,t._y),null!=t._xs&&h.inplace.project_xsys(t._xs,t._ys));for(const i of this.visuals)i.update()}_render(){this._initial_set_data||(this.set_data(this.model.source),this._initial_set_data=!0),this.map_data(),this.paint(this.layer.ctx)}}i.DataAnnotationView=u,u.__name__="DataAnnotationView";class d extends a.Annotation{constructor(e){super(e)}}i.DataAnnotation=d,r=d,d.__name__="DataAnnotation",r.define((({Ref:e})=>({source:[e(l.ColumnarDataSource),()=>new c.ColumnDataSource]})))},function(e,t,i,s,n){var o;s();const r=e(71),a=e(15),l=e(19),c=e(73),h=e(8),_=e(9),u=e(13),d=e(72),p=e(74),m=e(29);class g extends r.DataSource{constructor(e){super(e),this.selection_manager=new c.SelectionManager(this)}get_array(e){let t=this.data[e];return null==t?this.data[e]=t=[]:(0,h.isArray)(t)||(this.data[e]=t=Array.from(t)),t}initialize(){super.initialize(),this._select=new a.Signal0(this,"select"),this.inspect=new a.Signal(this,"inspect"),this.streaming=new a.Signal0(this,"streaming"),this.patching=new a.Signal(this,"patching")}get_column(e){const t=this.data[e];return null!=t?t:null}columns(){return(0,u.keys)(this.data)}get_length(e=!0){const t=(0,_.uniq)((0,u.values)(this.data).map((e=>(0,m.is_NDArray)(e)?e.shape[0]:e.length)));switch(t.length){case 0:return null;case 1:return t[0];default:{const i="data source has columns of inconsistent lengths";if(e)return l.logger.warn(i),t.sort()[0];throw new Error(i)}}}get length(){var e;return null!==(e=this.get_length())&&void 0!==e?e:0}clear(){const e={};for(const t of this.columns())e[t]=new this.data[t].constructor(0);this.data=e}}i.ColumnarDataSource=g,o=g,g.__name__="ColumnarDataSource",o.define((({Ref:e})=>({selection_policy:[e(p.SelectionPolicy),()=>new p.UnionRenderers]}))),o.internal((({AnyRef:e})=>({inspected:[e(),()=>new d.Selection]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(72);class l extends r.Model{constructor(e){super(e)}}i.DataSource=l,o=l,l.__name__="DataSource",o.define((({Ref:e})=>({selected:[e(a.Selection),()=>new a.Selection]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(9),l=e(13);class c extends r.Model{constructor(e){super(e)}get_view(){return this.view}get selected_glyph(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null}add_to_selected_glyphs(e){this.selected_glyphs.push(e)}update(e,t=!0,i="replace"){switch(i){case"replace":this.indices=e.indices,this.line_indices=e.line_indices,this.multiline_indices=e.multiline_indices,this.image_indices=e.image_indices,this.view=e.view,this.selected_glyphs=e.selected_glyphs;break;case"append":this.update_through_union(e);break;case"intersect":this.update_through_intersection(e);break;case"subtract":this.update_through_subtraction(e)}}clear(){this.indices=[],this.line_indices=[],this.multiline_indices={},this.image_indices=[],this.view=null,this.selected_glyphs=[]}map(e){return new c(Object.assign(Object.assign({},this.attributes),{indices:this.indices.map(e),multiline_indices:(0,l.to_object)((0,l.entries)(this.multiline_indices).map((([t,i])=>[e(Number(t)),i]))),image_indices:this.image_indices.map((t=>Object.assign(Object.assign({},t),{index:e(t.index)})))}))}is_empty(){return 0==this.indices.length&&0==this.line_indices.length&&0==this.image_indices.length}update_through_union(e){this.indices=(0,a.union)(this.indices,e.indices),this.selected_glyphs=(0,a.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,a.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}update_through_intersection(e){this.indices=(0,a.intersection)(this.indices,e.indices),this.selected_glyphs=(0,a.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,a.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}update_through_subtraction(e){this.indices=(0,a.difference)(this.indices,e.indices),this.selected_glyphs=(0,a.union)(e.selected_glyphs,this.selected_glyphs),this.line_indices=(0,a.union)(e.line_indices,this.line_indices),this.view=e.view,this.multiline_indices=(0,l.merge)(e.multiline_indices,this.multiline_indices)}}i.Selection=c,o=c,c.__name__="Selection",o.define((({Int:e,Array:t,Dict:i})=>({indices:[t(e),[]],line_indices:[t(e),[]],multiline_indices:[i(t(e)),{}]}))),o.internal((({Int:e,Array:t,AnyRef:i,Struct:s,Nullable:n})=>({selected_glyphs:[t(i()),[]],view:[n(i()),null],image_indices:[t(s({index:e,dim1:e,dim2:e,flat_index:e})),[]]})))},function(e,t,i,s,n){s();const o=e(72);function r(e){return"GlyphRenderer"==e.model.type}function a(e){return"GraphRenderer"==e.model.type}class l{constructor(e){this.source=e,this.inspectors=new Map}select(e,t,i,s="replace"){const n=[],o=[];for(const c of e)r(c)?n.push(c):a(c)&&o.push(c);let l=!1;for(const r of o){const e=r.model.selection_policy.hit_test(t,r);l=l||r.model.selection_policy.do_selection(e,r.model,i,s)}if(n.length>0){const e=this.source.selection_policy.hit_test(t,n);l=l||this.source.selection_policy.do_selection(e,this.source,i,s)}return l}inspect(e,t){let i=!1;if(r(e)){const s=e.hit_test(t);if(null!=s){i=!s.is_empty();const n=this.get_or_create_inspector(e.model);n.update(s,!0,"replace"),this.source.setv({inspected:n},{silent:!0}),this.source.inspect.emit([e.model,{geometry:t}])}}else if(a(e)){const s=e.model.inspection_policy.hit_test(t,e);i=i||e.model.inspection_policy.do_inspection(s,t,e,!1,"replace")}return i}clear(e){this.source.selected.clear(),null!=e&&this.get_or_create_inspector(e.model).clear()}get_or_create_inspector(e){let t=this.inspectors.get(e);return null==t&&(t=new o.Selection,this.inspectors.set(e,t)),t}}i.SelectionManager=l,l.__name__="SelectionManager"},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{do_selection(e,t,i,s){return null!=e&&(t.selected.update(e,i,s),t._select.emit(),!t.selected.is_empty())}}i.SelectionPolicy=r,r.__name__="SelectionPolicy";class a extends r{hit_test(e,t){const i=[];for(const s of t){const t=s.hit_test(e);null!=t&&i.push(t)}if(i.length>0){const e=i[0];for(const t of i)e.update_through_intersection(t);return e}return null}}i.IntersectRenderers=a,a.__name__="IntersectRenderers";class l extends r{hit_test(e,t){const i=[];for(const s of t){const t=s.hit_test(e);null!=t&&i.push(t)}if(i.length>0){const e=i[0];for(const t of i)e.update_through_union(t);return e}return null}}i.UnionRenderers=l,l.__name__="UnionRenderers"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(70),l=e(8),c=e(13),h=(0,o.__importStar)(e(76)),_=e(77),u=e(35);function d(e,t,i){if((0,l.isArray)(e)){const s=e.concat(t);return null!=i&&s.length>i?s.slice(-i):s}if((0,l.isTypedArray)(e)){const s=e.length+t.length;if(null!=i&&s>i){const n=s-i,o=e.length;let r;e.length<i?(r=new e.constructor(i),r.set(e,0)):r=e;for(let e=n,t=o;e<t;e++)r[e-n]=r[e];for(let e=0,i=t.length;e<i;e++)r[e+(o-n)]=t[e];return r}{const i=new e.constructor(t);return h.concat(e,i)}}throw new Error("unsupported array types")}function p(e,t){let i,s,n;return(0,l.isNumber)(e)?(i=e,n=e+1,s=1):(i=null!=e.start?e.start:0,n=null!=e.stop?e.stop:t,s=null!=e.step?e.step:1),[i,n,s]}function m(e,t){const i=new Set;let s=!1;for(const[n,o]of t){let t,r,a,c;if((0,l.isArray)(n)){const[s]=n;i.add(s),t=e[s].shape,r=e[s],c=o,2===n.length?(t=[1,t[0]],a=[n[0],0,n[1]]):a=n}else(0,l.isNumber)(n)?(c=[o],i.add(n)):(c=o,s=!0),a=[0,0,n],t=[1,e.length],r=e;let h=0;const[_,u,d]=p(a[1],t[0]),[m,g,f]=p(a[2],t[1]);for(let e=_;e<u;e+=d)for(let n=m;n<g;n+=f)s&&i.add(n),r[e*t[1]+n]=c[h],h++}return i}i.stream_to_column=d,i.slice=p,i.patch_to_column=m;class g extends a.ColumnarDataSource{constructor(e){super(e)}stream(e,t,i){const{data:s}=this;for(const[n,o]of(0,c.entries)(e))s[n]=d(s[n],o,t);if(this.setv({data:s},{silent:!0}),this.streaming.emit(),null!=this.document){const s=new u.ColumnsStreamedEvent(this.document,this.ref(),e,t);this.document._notify_change(this,"data",null,null,{setter_id:i,hint:s})}}patch(e,t){const{data:i}=this;let s=new Set;for(const[n,o]of(0,c.entries)(e))s=(0,_.union)(s,m(i[n],o));if(this.setv({data:i},{silent:!0}),this.patching.emit([...s]),null!=this.document){const i=new u.ColumnsPatchedEvent(this.document,this.ref(),e);this.document._notify_change(this,"data",null,null,{setter_id:t,hint:i})}}}i.ColumnDataSource=g,r=g,g.__name__="ColumnDataSource",r.define((({Dict:e,Any:t})=>({data:[e(t),{}]})))},function(e,t,i,s,n){s(),i.concat=function(e,...t){let i=e.length;for(const o of t)i+=o.length;const s=new e.constructor(i);s.set(e,0);let n=e.length;for(const o of t)s.set(o,n),n+=o.length;return s}},function(e,t,i,s,n){function o(...e){const t=new Set;for(const i of e)for(const e of i)t.add(e);return t}s(),i.union=o,i.intersection=function(e,...t){const i=new Set;e:for(const s of e){for(const e of t)if(!e.has(s))continue e;i.add(s)}return i},i.difference=function(e,...t){const i=new Set(e);for(const s of o(...t))i.delete(s);return i}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(79)),a=(0,o.__importDefault)(e(80)),l=e(24),c=new a.default("GOOGLE"),h=new a.default("WGS84"),_=(0,r.default)(h,c);i.wgs84_mercator={compute:(e,t)=>isFinite(e)&&isFinite(t)?_.forward([e,t]):[NaN,NaN],invert:(e,t)=>isFinite(e)&&isFinite(t)?_.inverse([e,t]):[NaN,NaN]};const u={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},d={lon:[-180,180],lat:[-85.06,85.06]},{min:p,max:m}=Math;function g(e,t){const s=p(e.length,t.length),n=(0,l.infer_type)(e,t),o=new n(s),r=new n(s);return i.inplace.project_xy(e,t,o,r),[o,r]}i.clip_mercator=function(e,t,i){const[s,n]=u[i];return[m(e,s),p(t,n)]},i.in_bounds=function(e,t){const[i,s]=d[t];return i<e&&e<s},function(e){function t(e,t,s,n){const o=p(e.length,t.length);s=null!=s?s:e,n=null!=n?n:t;for(let r=0;r<o;r++){const o=e[r],a=t[r],[l,c]=i.wgs84_mercator.compute(o,a);s[r]=l,n[r]=c}}e.project_xy=t,e.project_xsys=function(e,i,s,n){const o=p(e.length,i.length);s=null!=s?s:e,n=null!=n?n:i;for(let r=0;r<o;r++)t(e[r],i[r],s[r],n[r])}}(i.inplace||(i.inplace={})),i.project_xy=g,i.project_xsys=function(e,t){const i=p(e.length,t.length),s=new Array(i),n=new Array(i);for(let o=0;o<i;o++){const[i,r]=g(e[o],t[o]);s[o]=i,n[o]=r}return[s,n]}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(80)),a=(0,o.__importDefault)(e(106));var l=(0,r.default)("WGS84");function c(e,t,i,s){var n,o,r;return Array.isArray(i)?(n=(0,a.default)(e,t,i,s)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(o=(0,a.default)(e,t,i,s),2===(r=Object.keys(i)).length||r.forEach((function(s){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===s||"y"===s||"z"===s)return}else if("x"===s||"y"===s)return;o[s]=i[s]})),o)}function h(e){return e instanceof r.default?e:e.oProj?e.oProj:(0,r.default)(e)}i.default=function(e,t,i){e=h(e);var s,n=!1;return void 0===t?(t=e,e=l,n=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=l,n=!0),t=h(t),i?c(e,t,i):(s={forward:function(i,s){return c(e,t,i,s)},inverse:function(i,s){return c(t,e,i,s)}},n&&(s.oProj=t),s)}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(81)),a=(0,o.__importDefault)(e(92)),l=(0,o.__importDefault)(e(93)),c=e(101),h=(0,o.__importDefault)(e(103)),_=(0,o.__importDefault)(e(104)),u=(0,o.__importDefault)(e(88)),d=e(105);function p(e,t){if(!(this instanceof p))return new p(e);t=t||function(e){if(e)throw e};var i=(0,r.default)(e);if("object"==typeof i){var s=p.projections.get(i.projName);if(s){if(i.datumCode&&"none"!==i.datumCode){var n=(0,u.default)(h.default,i.datumCode);n&&(i.datum_params=i.datum_params||(n.towgs84?n.towgs84.split(","):null),i.ellps=n.ellipse,i.datumName=n.datumName?n.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var o=(0,c.sphere)(i.a,i.b,i.rf,i.ellps,i.sphere),l=(0,c.eccentricity)(o.a,o.b,o.rf,i.R_A),m=(0,d.getNadgrids)(i.nadgrids),g=i.datum||(0,_.default)(i.datumCode,i.datum_params,o.a,o.b,l.es,l.ep2,m);(0,a.default)(this,i),(0,a.default)(this,s),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=l.es,this.e=l.e,this.ep2=l.ep2,this.datum=g,this.init(),t(null,this)}else t(e)}else t(e)}p.projections=l.default,p.projections.start(),i.default=p},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(82)),a=(0,o.__importDefault)(e(89)),l=(0,o.__importDefault)(e(84)),c=(0,o.__importDefault)(e(88));var h=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],_=["3857","900913","3785","102113"];i.default=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in r.default}(e))return r.default[e];if(function(e){return h.some((function(t){return e.indexOf(t)>-1}))}(e)){var t=(0,a.default)(e);if(function(e){var t=(0,c.default)(e,"authority");if(t){var i=(0,c.default)(t,"epsg");return i&&_.indexOf(i)>-1}}(t))return r.default["EPSG:3857"];var i=function(e){var t=(0,c.default)(e,"extension");if(t)return(0,c.default)(t,"proj4")}(t);return i?(0,l.default)(i):t}return function(e){return"+"===e[0]}(e)?(0,l.default)(e):void 0}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(83)),a=(0,o.__importDefault)(e(84)),l=(0,o.__importDefault)(e(89));function c(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?c[e]=(0,a.default)(arguments[1]):c[e]=(0,l.default)(arguments[1]):c[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?c.apply(t,e):c(e)}));if("string"==typeof e){if(e in c)return c[e]}else"EPSG"in e?c["EPSG:"+e.EPSG]=e:"ESRI"in e?c["ESRI:"+e.ESRI]=e:"IAU2000"in e?c["IAU2000:"+e.IAU2000]=e:console.log(e);return}}(0,r.default)(c),i.default=c},function(e,t,i,s,n){s(),i.default=function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}},function(e,t,i,s,n){s();const o=e(1),r=e(85),a=(0,o.__importDefault)(e(86)),l=(0,o.__importDefault)(e(87)),c=(0,o.__importDefault)(e(88));i.default=function(e){var t,i,s,n={},o=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e}),{}),h={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*r.D2R},lat_1:function(e){n.lat1=e*r.D2R},lat_2:function(e){n.lat2=e*r.D2R},lat_ts:function(e){n.lat_ts=e*r.D2R},lon_0:function(e){n.long0=e*r.D2R},lon_1:function(e){n.long1=e*r.D2R},lon_2:function(e){n.long2=e*r.D2R},alpha:function(e){n.alpha=parseFloat(e)*r.D2R},gamma:function(e){n.rectified_grid_angle=parseFloat(e)},lonc:function(e){n.longc=e*r.D2R},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=(0,c.default)(l.default,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*r.D2R},pm:function(e){var t=(0,c.default)(a.default,e);n.from_greenwich=(t||parseFloat(e))*r.D2R},nadgrids:function(e){"@null"===e?n.datumCode="none":n.nadgrids=e},axis:function(e){var t="ewnsud";3===e.length&&-1!==t.indexOf(e.substr(0,1))&&-1!==t.indexOf(e.substr(1,1))&&-1!==t.indexOf(e.substr(2,1))&&(n.axis=e)},approx:function(){n.approx=!0}};for(t in o)i=o[t],t in h?"function"==typeof(s=h[t])?s(i):n[s]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n}},function(e,t,i,s,n){s(),i.PJD_3PARAM=1,i.PJD_7PARAM=2,i.PJD_GRIDSHIFT=3,i.PJD_WGS84=4,i.PJD_NODATUM=5,i.SRS_WGS84_SEMIMAJOR=6378137,i.SRS_WGS84_SEMIMINOR=6356752.314,i.SRS_WGS84_ESQUARED=.0066943799901413165,i.SEC_TO_RAD=484813681109536e-20,i.HALF_PI=Math.PI/2,i.SIXTH=.16666666666666666,i.RA4=.04722222222222222,i.RA6=.022156084656084655,i.EPSLN=1e-10,i.D2R=.017453292519943295,i.R2D=57.29577951308232,i.FORTPI=Math.PI/4,i.TWO_PI=2*Math.PI,i.SPI=3.14159265359},function(e,t,i,s,n){s();var o={};i.default=o,o.greenwich=0,o.lisbon=-9.131906111111,o.paris=2.337229166667,o.bogota=-74.080916666667,o.madrid=-3.687938888889,o.rome=12.452333333333,o.bern=7.439583333333,o.jakarta=106.807719444444,o.ferro=-17.666666666667,o.brussels=4.367975,o.stockholm=18.058277777778,o.athens=23.7163375,o.oslo=10.722916666667},function(e,t,i,s,n){s(),i.default={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(e,t,i,s,n){s();var o=/[\s_\-\/\(\)]/g;i.default=function(e,t){if(e[t])return e[t];for(var i,s=Object.keys(e),n=t.toLowerCase().replace(o,""),r=-1;++r<s.length;)if((i=s[r]).toLowerCase().replace(o,"")===n)return e[i]}},function(e,t,i,s,n){s();const o=(0,e(1).__importDefault)(e(90)),r=e(91);function a(e){return.017453292519943295*e}i.default=function(e){var t=(0,o.default)(e),i=t.shift(),s=t.shift();t.unshift(["name",s]),t.unshift(["type",i]);var n={};return(0,r.sExpr)(t,n),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,s=e.AXIS.length;i<s;++i){var n=[e.AXIS[i][0].toLowerCase(),e.AXIS[i][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?t+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?t+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?t+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;function r(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",a],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",a],["x0","false_easting",r],["y0","false_northing",r],["long0","central_meridian",a],["lat0","latitude_of_origin",a],["lat0","standard_parallel_1",a],["lat1","standard_parallel_1",a],["lat2","standard_parallel_2",a],["azimuth","Azimuth"],["alpha","azimuth",a],["srsCode","name"]].forEach((function(t){return i=e,n=(s=t)[0],o=s[1],void(!(n in i)&&o in i&&(i[n]=i[o],3===s.length&&(i[n]=s[2](i[n]))));var i,s,n,o})),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=a(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(n),n}},function(e,t,i,s,n){s(),i.default=function(e){return new h(e).output()};var o=/\s/,r=/[A-Za-z]/,a=/[A-Za-z84]/,l=/[,\]]/,c=/[\d\.E\-\+]/;function h(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}h.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;o.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case 1:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},h.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(l.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},h.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},h.prototype.number=function(e){if(!c.test(e)){if(l.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},h.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},h.prototype.keyword=function(e){if(a.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=1)}if(!l.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},h.prototype.neutral=function(e){if(r.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(c.test(e))return this.word=e,void(this.state=3);if(!l.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},h.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(e,t,i,s,n){function o(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var s=t?{}:e,n=i.reduce((function(e,t){return r(t,e),e}),s);t&&(e[t]=n)}function r(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void r(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var s;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&r(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&r(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void o(t,i,e);default:for(s=-1;++s<e.length;)if(!Array.isArray(e[s]))return r(e,t[i]);return o(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}s(),i.sExpr=r},function(e,t,i,s,n){s(),i.default=function(e,t){var i,s;if(e=e||{},!t)return e;for(s in t)void 0!==(i=t[s])&&(e[s]=i);return e}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(94)),a=(0,o.__importDefault)(e(100));var l=[r.default,a.default],c={},h=[];function _(e,t){var i=h.length;return e.names?(h[i]=e,e.names.forEach((function(e){c[e.toLowerCase()]=i})),this):(console.log(t),!0)}function u(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==c[t]&&h[c[t]]?h[c[t]]:void 0}function d(){l.forEach(_)}i.add=_,i.get=u,i.start=d,i.default={start:d,add:_,get:u}},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(95)),a=(0,o.__importDefault)(e(96)),l=(0,o.__importDefault)(e(98)),c=(0,o.__importDefault)(e(99)),h=e(85);function _(){var e=this.b/this.a;this.es=1-e*e,"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=(0,r.default)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function u(e){var t,i,s=e.x,n=e.y;if(n*h.R2D>90&&n*h.R2D<-90&&s*h.R2D>180&&s*h.R2D<-180)return null;if(Math.abs(Math.abs(n)-h.HALF_PI)<=h.EPSLN)return null;if(this.sphere)t=this.x0+this.a*this.k0*(0,a.default)(s-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(h.FORTPI+.5*n));else{var o=Math.sin(n),r=(0,l.default)(this.e,n,o);t=this.x0+this.a*this.k0*(0,a.default)(s-this.long0),i=this.y0-this.a*this.k0*Math.log(r)}return e.x=t,e.y=i,e}function d(e){var t,i,s=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=h.HALF_PI-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var o=Math.exp(-n/(this.a*this.k0));if(-9999===(i=(0,c.default)(this.e,o)))return null}return t=(0,a.default)(this.long0+s/(this.a*this.k0)),e.x=t,e.y=i,e}i.init=_,i.forward=u,i.inverse=d,i.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],i.default={init:_,forward:u,inverse:d,names:i.names}},function(e,t,i,s,n){s(),i.default=function(e,t,i){var s=e*t;return i/Math.sqrt(1-s*s)}},function(e,t,i,s,n){s();const o=e(1),r=e(85),a=(0,o.__importDefault)(e(97));i.default=function(e){return Math.abs(e)<=r.SPI?e:e-(0,a.default)(e)*r.TWO_PI}},function(e,t,i,s,n){s(),i.default=function(e){return e<0?-1:1}},function(e,t,i,s,n){s();const o=e(85);i.default=function(e,t,i){var s=e*i,n=.5*e;return s=Math.pow((1-s)/(1+s),n),Math.tan(.5*(o.HALF_PI-t))/s}},function(e,t,i,s,n){s();const o=e(85);i.default=function(e,t){for(var i,s,n=.5*e,r=o.HALF_PI-2*Math.atan(t),a=0;a<=15;a++)if(i=e*Math.sin(r),r+=s=o.HALF_PI-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-r,Math.abs(s)<=1e-10)return r;return-9999}},function(e,t,i,s,n){function o(){}function r(e){return e}s(),i.init=o,i.forward=r,i.inverse=r,i.names=["longlat","identity"],i.default={init:o,forward:r,inverse:r,names:i.names}},function(e,t,i,s,n){s();const o=e(1),r=e(85),a=(0,o.__importStar)(e(102)),l=(0,o.__importDefault)(e(88));i.eccentricity=function(e,t,i,s){var n=e*e,o=t*t,a=(n-o)/n,l=0;return s?(n=(e*=1-a*(r.SIXTH+a*(r.RA4+a*r.RA6)))*e,a=0):l=Math.sqrt(a),{es:a,e:l,ep2:(n-o)/o}},i.sphere=function(e,t,i,s,n){if(!e){var o=(0,l.default)(a.default,s);o||(o=a.WGS84),e=o.a,t=o.b,i=o.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<r.EPSLN)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}},function(e,t,i,s,n){s();var o={};i.default=o,o.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},o.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},o.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},o.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},o.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},o.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},o.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},o.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},o.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},o.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},o.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},o.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},o.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},o.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},o.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},o.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},o.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},o.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},o.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},o.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},o.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},o.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},o.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},o.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},o.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},o.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},o.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},o.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},o.hough={a:6378270,rf:297,ellipseName:"Hough"},o.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},o.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},o.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},o.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},o.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},o.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},o.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},o.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},o.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},o.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},o.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},o.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},i.WGS84=o.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},o.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(e,t,i,s,n){s();var o={};i.default=o,o.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},o.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},o.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},o.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},o.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},o.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},o.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},o.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},o.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},o.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},o.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},o.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},o.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},o.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},o.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},o.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},o.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(e,t,i,s,n){s();const o=e(85);i.default=function(e,t,i,s,n,r,a){var l={};return l.datum_type=void 0===e||"none"===e?o.PJD_NODATUM:o.PJD_WGS84,t&&(l.datum_params=t.map(parseFloat),0===l.datum_params[0]&&0===l.datum_params[1]&&0===l.datum_params[2]||(l.datum_type=o.PJD_3PARAM),l.datum_params.length>3&&(0===l.datum_params[3]&&0===l.datum_params[4]&&0===l.datum_params[5]&&0===l.datum_params[6]||(l.datum_type=o.PJD_7PARAM,l.datum_params[3]*=o.SEC_TO_RAD,l.datum_params[4]*=o.SEC_TO_RAD,l.datum_params[5]*=o.SEC_TO_RAD,l.datum_params[6]=l.datum_params[6]/1e6+1))),a&&(l.datum_type=o.PJD_GRIDSHIFT,l.grids=a),l.a=i,l.b=s,l.es=n,l.ep2=r,l}},function(e,t,i,s,n){s();var o={};function r(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:o[e]||null,isNull:!1}}function a(e){return e/3600*Math.PI/180}function l(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function c(e){return e.map((function(e){return[a(e.longitudeShift),a(e.latitudeShift)]}))}function h(e,t,i){return{name:l(e,t+8,t+16).trim(),parent:l(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function _(e,t,i,s){for(var n=t+176,o=[],r=0;r<i.gridNodeCount;r++){var a={latitudeShift:e.getFloat32(n+16*r,s),longitudeShift:e.getFloat32(n+16*r+4,s),latitudeAccuracy:e.getFloat32(n+16*r+8,s),longitudeAccuracy:e.getFloat32(n+16*r+12,s)};o.push(a)}return o}i.default=function(e,t){var i=new DataView(t),s=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),n=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:l(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,s);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var r=function(e,t,i){for(var s=[],n=0;n<t.nSubgrids;n++){var o=h(e,176,i),r=_(e,176,o,i),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),u=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);s.push({ll:[a(o.lowerLongitude),a(o.lowerLatitude)],del:[a(o.longitudeInterval),a(o.latitudeInterval)],lim:[l,u],count:o.gridNodeCount,cvs:c(r)})}return s}(i,n,s),u={header:n,subgrids:r};return o[e]=u,u},i.getNadgrids=function(e){return void 0===e?null:e.split(",").map(r)}},function(e,t,i,s,n){s();const o=e(1),r=e(85),a=(0,o.__importDefault)(e(107)),l=(0,o.__importDefault)(e(109)),c=(0,o.__importDefault)(e(80)),h=(0,o.__importDefault)(e(110)),_=(0,o.__importDefault)(e(111));i.default=function e(t,i,s,n){var o;if(Array.isArray(s)&&(s=(0,h.default)(s)),(0,_.default)(s),t.datum&&i.datum&&function(e,t){return(e.datum.datum_type===r.PJD_3PARAM||e.datum.datum_type===r.PJD_7PARAM)&&"WGS84"!==t.datumCode||(t.datum.datum_type===r.PJD_3PARAM||t.datum.datum_type===r.PJD_7PARAM)&&"WGS84"!==e.datumCode}(t,i)&&(s=e(t,o=new c.default("WGS84"),s,n),t=o),n&&"enu"!==t.axis&&(s=(0,l.default)(t,!1,s)),"longlat"===t.projName)s={x:s.x*r.D2R,y:s.y*r.D2R,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),!(s=t.inverse(s)))return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=(0,a.default)(t.datum,i.datum,s))return i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}),"longlat"===i.projName?s={x:s.x*r.R2D,y:s.y*r.R2D,z:s.z||0}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0})),n&&"enu"!==i.axis?(0,l.default)(i,!0,s):s}},function(e,t,i,s,n){s();const o=e(1),r=e(85),a=e(108),l=(0,o.__importDefault)(e(96));function c(e){return e===r.PJD_3PARAM||e===r.PJD_7PARAM}function h(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var s={x:-i.x,y:i.y},n={x:Number.NaN,y:Number.NaN},o=[],a=0;a<e.grids.length;a++){var l=e.grids[a];if(o.push(l.name),l.isNull){n=s;break}if(l.mandatory,null!==l.grid){var c=l.grid.subgrids[0],h=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4,u=c.ll[0]-h,d=c.ll[1]-h,p=c.ll[0]+(c.lim[0]-1)*c.del[0]+h,m=c.ll[1]+(c.lim[1]-1)*c.del[1]+h;if(!(d>s.y||u>s.x||m<s.y||p<s.x||(n=_(s,t,c),isNaN(n.x))))break}else if(l.mandatory)return console.log("Unable to find mandatory grid '"+l.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*r.R2D+" "+s.y*r.R2D+" tried: '"+o+"'"),-1):(i.x=-n.x,i.y=n.y,0)}function _(e,t,i){var s={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return s;var n={x:e.x,y:e.y};n.x-=i.ll[0],n.y-=i.ll[1],n.x=(0,l.default)(n.x-Math.PI)+Math.PI;var o=u(n,i);if(t){if(isNaN(o.x))return s;o.x=n.x-o.x,o.y=n.y-o.y;var r,a,c=9;do{if(a=u(o,i),isNaN(a.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}r={x:n.x-(a.x+o.x),y:n.y-(a.y+o.y)},o.x+=r.x,o.y+=r.y}while(c--&&Math.abs(r.x)>1e-12&&Math.abs(r.y)>1e-12);if(c<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=(0,l.default)(o.x+i.ll[0]),s.y=o.y+i.ll[1]}else isNaN(o.x)||(s.x=e.x+o.x,s.y=e.y+o.y);return s}function u(e,t){var i,s={x:e.x/t.del[0],y:e.y/t.del[1]},n=Math.floor(s.x),o=Math.floor(s.y),r=s.x-1*n,a=s.y-1*o,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=t.lim[0])return l;if(o<0||o>=t.lim[1])return l;i=o*t.lim[0]+n;var c=t.cvs[i][0],h=t.cvs[i][1];i++;var _=t.cvs[i][0],u=t.cvs[i][1];i+=t.lim[0];var d=t.cvs[i][0],p=t.cvs[i][1];i--;var m=t.cvs[i][0],g=t.cvs[i][1],f=r*a,b=r*(1-a),y=(1-r)*(1-a),v=(1-r)*a;return l.x=y*c+b*_+v*m+f*d,l.y=y*h+b*u+v*g+f*p,l}i.default=function(e,t,i){if((0,a.compareDatums)(e,t))return i;if(e.datum_type===r.PJD_NODATUM||t.datum_type===r.PJD_NODATUM)return i;var s=e.a,n=e.es;if(e.datum_type===r.PJD_GRIDSHIFT){if(0!==h(e,!1,i))return;s=r.SRS_WGS84_SEMIMAJOR,n=r.SRS_WGS84_ESQUARED}var o=t.a,l=t.b,_=t.es;return t.datum_type===r.PJD_GRIDSHIFT&&(o=r.SRS_WGS84_SEMIMAJOR,l=r.SRS_WGS84_SEMIMINOR,_=r.SRS_WGS84_ESQUARED),n!==_||s!==o||c(e.datum_type)||c(t.datum_type)?(i=(0,a.geodeticToGeocentric)(i,n,s),c(e.datum_type)&&(i=(0,a.geocentricToWgs84)(i,e.datum_type,e.datum_params)),c(t.datum_type)&&(i=(0,a.geocentricFromWgs84)(i,t.datum_type,t.datum_params)),i=(0,a.geocentricToGeodetic)(i,_,o,l),t.datum_type!==r.PJD_GRIDSHIFT||0===h(t,!0,i)?i:void 0):i},i.applyGridShift=h},function(e,t,i,s,n){s();const o=e(85);i.compareDatums=function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===o.PJD_3PARAM?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==o.PJD_7PARAM||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])},i.geodeticToGeocentric=function(e,t,i){var s,n,r,a,l=e.x,c=e.y,h=e.z?e.z:0;if(c<-o.HALF_PI&&c>-1.001*o.HALF_PI)c=-o.HALF_PI;else if(c>o.HALF_PI&&c<1.001*o.HALF_PI)c=o.HALF_PI;else{if(c<-o.HALF_PI)return{x:-1/0,y:-1/0,z:e.z};if(c>o.HALF_PI)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),n=Math.sin(c),a=Math.cos(c),r=n*n,{x:((s=i/Math.sqrt(1-t*r))+h)*a*Math.cos(l),y:(s+h)*a*Math.sin(l),z:(s*(1-t)+h)*n}},i.geocentricToGeodetic=function(e,t,i,s){var n,r,a,l,c,h,_,u,d,p,m,g,f,b,y,v=e.x,x=e.y,w=e.z?e.z:0;if(n=Math.sqrt(v*v+x*x),r=Math.sqrt(v*v+x*x+w*w),n/i<1e-12){if(b=0,r/i<1e-12)return o.HALF_PI,y=-s,{x:e.x,y:e.y,z:e.z}}else b=Math.atan2(x,v);a=w/r,u=(l=n/r)*(1-t)*(c=1/Math.sqrt(1-t*(2-t)*l*l)),d=a*c,f=0;do{f++,h=t*(_=i/Math.sqrt(1-t*d*d))/(_+(y=n*u+w*d-_*(1-t*d*d))),g=(m=a*(c=1/Math.sqrt(1-h*(2-h)*l*l)))*u-(p=l*(1-h)*c)*d,u=p,d=m}while(g*g>1e-24&&f<30);return{x:b,y:Math.atan(m/Math.abs(p)),z:y}},i.geocentricToWgs84=function(e,t,i){if(t===o.PJD_3PARAM)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===o.PJD_7PARAM){var s=i[0],n=i[1],r=i[2],a=i[3],l=i[4],c=i[5],h=i[6];return{x:h*(e.x-c*e.y+l*e.z)+s,y:h*(c*e.x+e.y-a*e.z)+n,z:h*(-l*e.x+a*e.y+e.z)+r}}},i.geocentricFromWgs84=function(e,t,i){if(t===o.PJD_3PARAM)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===o.PJD_7PARAM){var s=i[0],n=i[1],r=i[2],a=i[3],l=i[4],c=i[5],h=i[6],_=(e.x-s)/h,u=(e.y-n)/h,d=(e.z-r)/h;return{x:_+c*u-l*d,y:-c*_+u+a*d,z:l*_-a*u+d}}}},function(e,t,i,s,n){s(),i.default=function(e,t,i){var s,n,o,r=i.x,a=i.y,l=i.z||0,c={};for(o=0;o<3;o++)if(!t||2!==o||void 0!==i.z)switch(0===o?(s=r,n=-1!=="ew".indexOf(e.axis[o])?"x":"y"):1===o?(s=a,n=-1!=="ns".indexOf(e.axis[o])?"y":"x"):(s=l,n="z"),e.axis[o]){case"e":case"n":c[n]=s;break;case"w":case"s":c[n]=-s;break;case"u":void 0!==i[n]&&(c.z=s);break;case"d":void 0!==i[n]&&(c.z=-s);break;default:return null}return c}},function(e,t,i,s,n){s(),i.default=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}},function(e,t,i,s,n){function o(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}s(),i.default=function(e){o(e.x),o(e.y)}},function(e,t,i,s,n){s();const o=e(1);var r,a,l,c,h;const _=e(53),u=e(42),d=(0,o.__importStar)(e(45)),p=e(48),m=(0,o.__importStar)(e(18));class g extends u.View{initialize(){super.initialize(),this.visuals=new d.Visuals(this)}request_render(){this.parent.request_render()}get canvas(){return this.parent.canvas}set_data(e){const t=this;for(const i of this.model){if(!(i instanceof m.VectorSpec||i instanceof m.ScalarSpec))continue;const s=i.uniform(e);t[`${i.attr}`]=s}}}i.ArrowHeadView=g,g.__name__="ArrowHeadView";class f extends _.Model{constructor(e){super(e)}}i.ArrowHead=f,r=f,f.__name__="ArrowHead",r.define((()=>({size:[m.NumberSpec,25]})));class b extends g{clip(e,t){this.visuals.line.set_vectorize(e,t);const i=this.size.get(t);e.moveTo(.5*i,i),e.lineTo(.5*i,-2),e.lineTo(-.5*i,-2),e.lineTo(-.5*i,i),e.lineTo(0,0),e.lineTo(.5*i,i)}render(e,t){if(this.visuals.line.doit){this.visuals.line.set_vectorize(e,t);const i=this.size.get(t);e.beginPath(),e.moveTo(.5*i,i),e.lineTo(0,0),e.lineTo(-.5*i,i),e.stroke()}}}i.OpenHeadView=b,b.__name__="OpenHeadView";class y extends f{constructor(e){super(e)}}i.OpenHead=y,a=y,y.__name__="OpenHead",a.prototype.default_view=b,a.mixins(p.LineVector);class v extends g{clip(e,t){this.visuals.line.set_vectorize(e,t);const i=this.size.get(t);e.moveTo(.5*i,i),e.lineTo(.5*i,-2),e.lineTo(-.5*i,-2),e.lineTo(-.5*i,i),e.lineTo(.5*i,i)}render(e,t){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(e,t),this._normal(e,t),e.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(e,t),this._normal(e,t),e.stroke())}_normal(e,t){const i=this.size.get(t);e.beginPath(),e.moveTo(.5*i,i),e.lineTo(0,0),e.lineTo(-.5*i,i),e.closePath()}}i.NormalHeadView=v,v.__name__="NormalHeadView";class x extends f{constructor(e){super(e)}}i.NormalHead=x,l=x,x.__name__="NormalHead",l.prototype.default_view=v,l.mixins([p.LineVector,p.FillVector]),l.override({fill_color:"black"});class w extends g{clip(e,t){this.visuals.line.set_vectorize(e,t);const i=this.size.get(t);e.moveTo(.5*i,i),e.lineTo(.5*i,-2),e.lineTo(-.5*i,-2),e.lineTo(-.5*i,i),e.lineTo(0,.5*i),e.lineTo(.5*i,i)}render(e,t){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(e,t),this._vee(e,t),e.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(e,t),this._vee(e,t),e.stroke())}_vee(e,t){const i=this.size.get(t);e.beginPath(),e.moveTo(.5*i,i),e.lineTo(0,0),e.lineTo(-.5*i,i),e.lineTo(0,.5*i),e.closePath()}}i.VeeHeadView=w,w.__name__="VeeHeadView";class A extends f{constructor(e){super(e)}}i.VeeHead=A,c=A,A.__name__="VeeHead",c.prototype.default_view=w,c.mixins([p.LineVector,p.FillVector]),c.override({fill_color:"black"});class k extends g{render(e,t){if(this.visuals.line.doit){this.visuals.line.set_vectorize(e,t);const i=this.size.get(t);e.beginPath(),e.moveTo(.5*i,0),e.lineTo(-.5*i,0),e.stroke()}}clip(e,t){}}i.TeeHeadView=k,k.__name__="TeeHeadView";class S extends f{constructor(e){super(e)}}i.TeeHead=S,h=S,S.__name__="TeeHead",h.prototype.default_view=k,h.mixins(p.LineVector)},function(e,t,i,s,n){s();const o=e(9);async function r(e,t,i){const s=new e(Object.assign(Object.assign({},i),{model:t}));return s.initialize(),await s.lazy_initialize(),s}i.build_view=async function(e,t={parent:null},i=(e=>e.default_view)){const s=await r(i(e),e,t);return s.connect_signals(),s},i.build_views=async function(e,t,i={parent:null},s=(e=>e.default_view)){const n=(0,o.difference)([...e.keys()],t);for(const o of n)e.get(o).remove(),e.delete(o);const a=[],l=t.filter((t=>!e.has(t)));for(const o of l){const t=await r(s(o),o,i);e.set(o,t),a.push(t)}for(const o of a)o.connect_signals();return a},i.remove_views=function(e){for(const[t,i]of e)i.remove(),e.delete(t)}},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(115),l=(0,o.__importStar)(e(48));class c extends a.UpperLowerView{paint(e){e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let t=0,i=this._lower_sx.length;t<i;t++)e.lineTo(this._lower_sx[t],this._lower_sy[t]);for(let t=this._upper_sx.length-1;t>=0;t--)e.lineTo(this._upper_sx[t],this._upper_sy[t]);e.closePath(),this.visuals.fill.apply(e),e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let t=0,i=this._lower_sx.length;t<i;t++)e.lineTo(this._lower_sx[t],this._lower_sy[t]);this.visuals.line.apply(e),e.beginPath(),e.moveTo(this._upper_sx[0],this._upper_sy[0]);for(let t=0,i=this._upper_sx.length;t<i;t++)e.lineTo(this._upper_sx[t],this._upper_sy[t]);this.visuals.line.apply(e)}}i.BandView=c,c.__name__="BandView";class h extends a.UpperLower{constructor(e){super(e)}}i.Band=h,r=h,h.__name__="Band",r.prototype.default_view=c,r.mixins([l.Line,l.Fill]),r.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(69),l=e(20),c=(0,o.__importStar)(e(18));class h extends a.DataAnnotationView{map_data(){const{frame:e}=this.plot_view,t=this.model.dimension,i=this.coordinates.x_scale,s=this.coordinates.y_scale,n="height"==t?s:i,o="height"==t?i:s,r="height"==t?e.bbox.yview:e.bbox.xview,a="height"==t?e.bbox.xview:e.bbox.yview;let l,c,h;l="data"==this.model.properties.lower.units?n.v_compute(this._lower):r.v_compute(this._lower),c="data"==this.model.properties.upper.units?n.v_compute(this._upper):r.v_compute(this._upper),h="data"==this.model.properties.base.units?o.v_compute(this._base):a.v_compute(this._base);const[_,u]="height"==t?[1,0]:[0,1],d=[l,h],p=[c,h];this._lower_sx=d[_],this._lower_sy=d[u],this._upper_sx=p[_],this._upper_sy=p[u]}}i.UpperLowerView=h,h.__name__="UpperLowerView";class _ extends c.CoordinateSpec{get dimension(){return"width"==this.obj.dimension?"x":"y"}get units(){var e;return null!==(e=this.spec.units)&&void 0!==e?e:"data"}}i.XOrYCoordinateSpec=_,_.__name__="XOrYCoordinateSpec";class u extends a.DataAnnotation{constructor(e){super(e)}}i.UpperLower=u,r=u,u.__name__="UpperLower",r.define((()=>({dimension:[l.Dimension,"height"],lower:[_,{field:"lower"}],upper:[_,{field:"upper"}],base:[_,{field:"base"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=(0,o.__importStar)(e(48)),c=e(20),h=e(65);i.EDGE_TOLERANCE=2.5;class _ extends a.AnnotationView{constructor(){super(...arguments),this.bbox=new h.BBox}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_render(){const{left:e,right:t,top:i,bottom:s}=this.model;if(null==e&&null==t&&null==i&&null==s)return;const{frame:n}=this.plot_view,o=this.coordinates.x_scale,r=this.coordinates.y_scale,a=(e,t,i,s,n)=>{let o;return o=null!=e?this.model.screen?e:"data"==t?i.compute(e):s.compute(e):n,o};this.bbox=h.BBox.from_rect({left:a(e,this.model.left_units,o,n.bbox.xview,n.bbox.left),right:a(t,this.model.right_units,o,n.bbox.xview,n.bbox.right),top:a(i,this.model.top_units,r,n.bbox.yview,n.bbox.top),bottom:a(s,this.model.bottom_units,r,n.bbox.yview,n.bbox.bottom)}),this._paint_box()}_paint_box(){const{ctx:e}=this.layer;e.save();const{left:t,top:i,width:s,height:n}=this.bbox;e.beginPath(),e.rect(t,i,s,n),this.visuals.fill.apply(e),this.visuals.hatch.apply(e),this.visuals.line.apply(e),e.restore()}interactive_bbox(){const e=this.model.line_width+i.EDGE_TOLERANCE;return this.bbox.grow_by(e)}interactive_hit(e,t){return null!=this.model.in_cursor&&this.interactive_bbox().contains(e,t)}cursor(e,t){const{left:i,right:s,bottom:n,top:o}=this.bbox;return Math.abs(e-i)<3||Math.abs(e-s)<3?this.model.ew_cursor:Math.abs(t-n)<3||Math.abs(t-o)<3?this.model.ns_cursor:this.bbox.contains(e,t)?this.model.in_cursor:null}}i.BoxAnnotationView=_,_.__name__="BoxAnnotationView";class u extends a.Annotation{constructor(e){super(e)}update({left:e,right:t,top:i,bottom:s}){this.setv({left:e,right:t,top:i,bottom:s,screen:!0})}}i.BoxAnnotation=u,r=u,u.__name__="BoxAnnotation",r.prototype.default_view=_,r.mixins([l.Line,l.Fill,l.Hatch]),r.define((({Number:e,Nullable:t})=>({top:[t(e),null],top_units:[c.SpatialUnits,"data"],bottom:[t(e),null],bottom_units:[c.SpatialUnits,"data"],left:[t(e),null],left_units:[c.SpatialUnits,"data"],right:[t(e),null],right_units:[c.SpatialUnits,"data"],render_mode:[c.RenderMode,"canvas"]}))),r.internal((({Boolean:e,String:t,Nullable:i})=>({screen:[e,!1],ew_cursor:[i(t),null],ns_cursor:[i(t),null],in_cursor:[i(t),null]}))),r.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=e(118),c=e(126),h=e(127),_=e(130),u=e(168),d=e(131),p=e(192),m=e(132),g=e(173),f=e(172),b=e(196),y=e(204),v=e(206),x=e(133),w=e(20),A=(0,o.__importStar)(e(48)),k=e(9),S=e(207),T=e(208),C=e(211),M=e(123),z=e(11),E=e(113),R=e(65),B=e(8);class N extends a.AnnotationView{get orientation(){return this._orientation}initialize(){super.initialize();const{ticker:e,formatter:t,color_mapper:i}=this.model;this._ticker="auto"!=e?e:(()=>{switch(!0){case i instanceof b.LogColorMapper:return new u.LogTicker;case i instanceof b.ScanningColorMapper:return new u.BinnedTicker({mapper:i});case i instanceof b.CategoricalColorMapper:return new u.CategoricalTicker;default:return new u.BasicTicker}})(),this._formatter="auto"!=t?t:(()=>{switch(!0){case this._ticker instanceof u.LogTicker:return new p.LogTickFormatter;case i instanceof b.CategoricalColorMapper:return new p.CategoricalTickFormatter;default:return new p.BasicTickFormatter}})(),this._major_range=(()=>{if(i instanceof b.CategoricalColorMapper){const{factors:e}=i;return new v.FactorRange({factors:e})}if(i instanceof f.ContinuousColorMapper){const{min:e,max:t}=i.metrics;return new v.Range1d({start:e,end:t})}(0,z.unreachable)()})(),this._major_scale=(()=>{if(i instanceof b.LinearColorMapper)return new y.LinearScale;if(i instanceof b.LogColorMapper)return new y.LogScale;if(i instanceof b.ScanningColorMapper){const{binning:e}=i.metrics;return new y.LinearInterpolationScale({binning:e})}if(i instanceof b.CategoricalColorMapper)return new y.CategoricalScale;(0,z.unreachable)()})(),this._minor_range=new v.Range1d({start:0,end:1}),this._minor_scale=new y.LinearScale;const s=A.attrs_of(this.model,"major_label_",A.Text,!0),n=A.attrs_of(this.model,"major_tick_",A.Line,!0),o=A.attrs_of(this.model,"minor_tick_",A.Line,!0),r=A.attrs_of(this.model,"title_",A.Text),a=i instanceof b.CategoricalColorMapper?h.CategoricalAxis:i instanceof b.LogColorMapper?h.LogAxis:h.LinearAxis;this._axis=new a(Object.assign(Object.assign(Object.assign({ticker:this._ticker,formatter:this._formatter,major_tick_in:this.model.major_tick_in,major_tick_out:this.model.major_tick_out,minor_tick_in:this.model.minor_tick_in,minor_tick_out:this.model.minor_tick_out,major_label_standoff:this.model.label_standoff,major_label_overrides:this.model.major_label_overrides,major_label_policy:this.model.major_label_policy,axis_line_color:null},s),n),o));const{title:c}=this.model;c&&(this._title=new l.Title(Object.assign({text:c,standoff:this.model.title_standoff},r)))}async lazy_initialize(){await super.lazy_initialize();const e=this,t={get parent(){return e.parent},get root(){return e.root},get frame(){return e._frame},get canvas_view(){return e.parent.canvas_view},request_layout(){e.parent.request_layout()}};this._axis_view=await(0,E.build_view)(this._axis,{parent:t}),null!=this._title&&(this._title_view=await(0,E.build_view)(this._title,{parent:t}))}remove(){var e;null===(e=this._title_view)||void 0===e||e.remove(),this._axis_view.remove(),super.remove()}connect_signals(){super.connect_signals(),this.connect(this._ticker.change,(()=>this.request_render())),this.connect(this._formatter.change,(()=>this.request_render())),this.connect(this.model.color_mapper.metrics_change,(()=>{const e=this._major_range,t=this._major_scale,{color_mapper:i}=this.model;if(i instanceof f.ContinuousColorMapper&&e instanceof v.Range1d){const{min:t,max:s}=i.metrics;e.setv({start:t,end:s})}if(i instanceof b.ScanningColorMapper&&t instanceof y.LinearInterpolationScale){const{binning:e}=i.metrics;t.binning=e}this._set_canvas_image(),this.plot_view.request_layout()}))}_set_canvas_image(){const{orientation:e}=this,t=(()=>{const{palette:t}=this.model.color_mapper;return"vertical"==e?(0,k.reversed)(t):t})(),[i,s]="vertical"==e?[1,t.length]:[t.length,1],n=this._image=document.createElement("canvas");n.width=i,n.height=s;const o=n.getContext("2d"),r=o.getImageData(0,0,i,s),a=new b.LinearColorMapper({palette:t}).rgba_mapper.v_compute((0,k.range)(0,t.length));r.data.set(a),o.putImageData(r,0,0)}update_layout(){const{location:e,width:t,height:i,padding:s,margin:n}=this.model,[o,r]=(()=>{if(!(0,B.isString)(e))return["end","start"];switch(e){case"top_left":return["start","start"];case"top":case"top_center":return["start","center"];case"top_right":return["start","end"];case"bottom_left":return["end","start"];case"bottom":case"bottom_center":return["end","center"];case"bottom_right":return["end","end"];case"left":case"center_left":return["center","start"];case"center":case"center_center":return["center","center"];case"right":case"center_right":return["center","end"]}})(),a=this._orientation=(()=>{const{orientation:e}=this.model;return"auto"==e?null!=this.panel?this.panel.is_horizontal?"horizontal":"vertical":"start"==r||"end"==r||"center"==r&&"center"==o?"vertical":"horizontal":e})(),l=new T.NodeLayout,h=new T.VStack,_=new T.VStack,u=new T.HStack,d=new T.HStack;l.absolute=!0,h.absolute=!0,_.absolute=!0,u.absolute=!0,d.absolute=!0;const[p,m,g,f]=(()=>"horizontal"==a?[this._major_scale,this._minor_scale,this._major_range,this._minor_range]:[this._minor_scale,this._major_scale,this._minor_range,this._major_range])();this._frame=new c.CartesianFrame(p,m,g,f),l.on_resize((e=>this._frame.set_geometry(e)));const b=new C.BorderLayout;this._inner_layout=b,b.absolute=!0,b.center_panel=l,b.top_panel=h,b.bottom_panel=_,b.left_panel=u,b.right_panel=d;const y={left:s,right:s,top:s,bottom:s},v=(()=>{if(null==this.panel){if((0,B.isString)(e))return{left:n,right:n,top:n,bottom:n};{const[t,i]=e;return{left:t,right:n,top:n,bottom:i}}}if(!(0,B.isString)(e)){const[t,i]=e;return b.fixup_geometry=(e,s)=>{const n=e,o=this.layout.bbox,{width:r,height:a}=e;if(e=new R.BBox({left:o.left+t,bottom:o.bottom-i,width:r,height:a}),null!=s){const t=e.left-n.left,i=e.top-n.top,{left:o,top:r,width:a,height:l}=s;s=new R.BBox({left:o+t,top:r+i,width:a,height:l})}return[e,s]},{left:t,right:0,top:0,bottom:i}}b.fixup_geometry=(e,t)=>{const i=e;if("horizontal"==a){const{top:t,width:i,height:s}=e;if("end"==r){const{right:n}=this.layout.bbox;e=new R.BBox({right:n,top:t,width:i,height:s})}else if("center"==r){const{hcenter:n}=this.layout.bbox;e=new R.BBox({hcenter:Math.round(n),top:t,width:i,height:s})}}else{const{left:t,width:i,height:s}=e;if("end"==o){const{bottom:n}=this.layout.bbox;e=new R.BBox({left:t,bottom:n,width:i,height:s})}else if("center"==o){const{vcenter:n}=this.layout.bbox;e=new R.BBox({left:t,vcenter:Math.round(n),width:i,height:s})}}if(null!=t){const s=e.left-i.left,n=e.top-i.top,{left:o,top:r,width:a,height:l}=t;t=new R.BBox({left:o+s,top:r+n,width:a,height:l})}return[e,t]}})();let x,w,A,k;if(b.padding=y,null!=this.panel?(x="max",w=void 0,A=void 0,k=void 0):"auto"==("horizontal"==a?t:i)?(x="fixed",w=25*this.model.color_mapper.palette.length,A={percent:.3},k={percent:.8}):(x="fit",w=void 0),"horizontal"==a){const e="auto"==t?void 0:t,s="auto"==i?25:i;b.set_sizing({width_policy:x,height_policy:"min",width:w,min_width:A,max_width:k,halign:r,valign:o,margin:v}),b.center_panel.set_sizing({width_policy:"auto"==t?"fit":"fixed",height_policy:"fixed",width:e,height:s})}else{const e="auto"==t?25:t,s="auto"==i?void 0:i;b.set_sizing({width_policy:"min",height_policy:x,height:w,min_height:A,max_height:k,halign:r,valign:o,margin:v}),b.center_panel.set_sizing({width_policy:"fixed",height_policy:"auto"==i?"fit":"fixed",width:e,height:s})}h.set_sizing({width_policy:"fit",height_policy:"min"}),_.set_sizing({width_policy:"fit",height_policy:"min"}),u.set_sizing({width_policy:"min",height_policy:"fit"}),d.set_sizing({width_policy:"min",height_policy:"fit"});const{_title_view:z}=this;null!=z&&("horizontal"==a?(z.panel=new M.Panel("above"),z.update_layout(),h.children.push(z.layout)):(z.panel=new M.Panel("left"),z.update_layout(),u.children.push(z.layout)));const{panel:E}=this,N=null!=E&&a==E.orientation?E.side:"horizontal"==a?"below":"right",O=(()=>{switch(N){case"above":return h;case"below":return _;case"left":return u;case"right":return d}})(),{_axis_view:D}=this;if(D.panel=new M.Panel(N),D.update_layout(),O.children.push(D.layout),null!=this.panel){const e=new S.Grid([{layout:b,row:0,col:0}]);e.absolute=!0,"horizontal"==a?e.set_sizing({width_policy:"max",height_policy:"min"}):e.set_sizing({width_policy:"min",height_policy:"max"}),this.layout=e}else this.layout=this._inner_layout;const{visible:I}=this.model;this.layout.sizing.visible=I,this._set_canvas_image()}_render(){var e;const{ctx:t}=this.layer;t.save(),this._paint_bbox(t,this._inner_layout.bbox),this._paint_image(t,this._inner_layout.center_panel.bbox),null===(e=this._title_view)||void 0===e||e.render(),this._axis_view.render(),t.restore()}_paint_bbox(e,t){const{x:i,y:s}=t;let{width:n,height:o}=t;i+n>=this.parent.canvas_view.bbox.width&&(n-=1),s+o>=this.parent.canvas_view.bbox.height&&(o-=1),e.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(i,s,n,o)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(e),e.strokeRect(i,s,n,o)),e.restore()}_paint_image(e,t){const{x:i,y:s,width:n,height:o}=t;e.save(),e.setImageSmoothingEnabled(!1),e.globalAlpha=this.model.scale_alpha,e.drawImage(this._image,i,s,n,o),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(e),e.strokeRect(i,s,n,o)),e.restore()}serializable_state(){const e=super.serializable_state(),{children:t=[]}=e,i=(0,o.__rest)(e,["children"]);return null!=this._title_view&&t.push(this._title_view.serializable_state()),t.push(this._axis_view.serializable_state()),Object.assign(Object.assign({},i),{children:t})}}i.ColorBarView=N,N.__name__="ColorBarView";class O extends a.Annotation{constructor(e){super(e)}}i.ColorBar=O,r=O,O.__name__="ColorBar",r.prototype.default_view=N,r.mixins([["major_label_",A.Text],["title_",A.Text],["major_tick_",A.Line],["minor_tick_",A.Line],["border_",A.Line],["bar_",A.Line],["background_",A.Fill]]),r.define((({Alpha:e,Number:t,String:i,Tuple:s,Dict:n,Or:o,Ref:r,Auto:a,Nullable:l})=>({location:[o(w.Anchor,s(t,t)),"top_right"],orientation:[o(w.Orientation,a),"auto"],title:[l(i),null],title_standoff:[t,2],width:[o(t,a),"auto"],height:[o(t,a),"auto"],scale_alpha:[e,1],ticker:[o(r(_.Ticker),a),"auto"],formatter:[o(r(d.TickFormatter),a),"auto"],major_label_overrides:[n(o(i,r(x.BaseText))),{}],major_label_policy:[r(m.LabelingPolicy),()=>new m.NoOverlap],color_mapper:[r(g.ColorMapper)],label_standoff:[t,5],margin:[t,30],padding:[t,10],major_tick_in:[t,5],major_tick_out:[t,0],minor_tick_in:[t,0],minor_tick_out:[t,0]}))),r.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_font_size:"11px",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"13px",title_text_font_style:"italic"})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(119),l=e(20),c=e(120),h=(0,o.__importStar)(e(48));class _ extends a.TextAnnotationView{_get_location(){const e=this.model.offset,t=this.model.standoff/2;let i,s;const{bbox:n}=this.layout;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":s=n.top+t;break;case"middle":s=n.vcenter;break;case"bottom":s=n.bottom-t}switch(this.model.align){case"left":i=n.left+e;break;case"center":i=n.hcenter;break;case"right":i=n.right-e}break;case"left":switch(this.model.vertical_align){case"top":i=n.left+t;break;case"middle":i=n.hcenter;break;case"bottom":i=n.right-t}switch(this.model.align){case"left":s=n.bottom-e;break;case"center":s=n.vcenter;break;case"right":s=n.top+e}break;case"right":switch(this.model.vertical_align){case"top":i=n.right-t;break;case"middle":i=n.hcenter;break;case"bottom":i=n.left+t}switch(this.model.align){case"left":s=n.top+e;break;case"center":s=n.vcenter;break;case"right":s=n.bottom-e}}return[i,s]}_render(){const{text:e}=this.model;if(null==e||0==e.length)return;this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;const[t,i]=this._get_location(),s=this.panel.get_label_angle_heuristic("parallel");("canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,e,t,i,s)}_get_size(){const{text:e}=this.model,t=new c.TextBox({text:e});t.visuals=this.visuals.text.values();const{width:i,height:s}=t.size();return{width:i,height:0==s?0:2+s+this.model.standoff}}}i.TitleView=_,_.__name__="TitleView";class u extends a.TextAnnotation{constructor(e){super(e)}}i.Title=u,r=u,u.__name__="Title",r.prototype.default_view=_,r.mixins([h.Text,["border_",h.Line],["background_",h.Fill]]),r.define((({Number:e,String:t})=>({text:[t,""],vertical_align:[l.VerticalAlign,"bottom"],align:[l.TextAlign,"left"],offset:[e,0],standoff:[e,10]}))),r.prototype._props.text_align.options.internal=!0,r.prototype._props.text_baseline.options.internal=!0,r.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})},function(e,t,i,s,n){var o;s();const r=e(40),a=e(43),l=e(20),c=e(120),h=e(123),_=e(11);class u extends r.AnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new h.SideLayout(e,(()=>this.get_size()),!0):void 0}initialize(){super.initialize(),"css"==this.model.render_mode&&(this.el=(0,a.div)(),this.plot_view.canvas_view.add_overlay(this.el))}remove(){null!=this.el&&(0,a.remove)(this.el),super.remove()}connect_signals(){super.connect_signals(),"css"==this.model.render_mode?this.connect(this.model.change,(()=>this.render())):this.connect(this.model.change,(()=>this.request_render()))}render(){this.model.visible||"css"!=this.model.render_mode||(0,a.undisplay)(this.el),super.render()}_canvas_text(e,t,i,s,n){const o=new c.TextBox({text:t});o.angle=n,o.position={sx:i,sy:s},o.visuals=this.visuals.text.values();const{background_fill:r,border_line:a}=this.visuals;if(r.doit||a.doit){const{p0:t,p1:i,p2:s,p3:n}=o.rect();e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),e.lineTo(s.x,s.y),e.lineTo(n.x,n.y),e.closePath(),this.visuals.background_fill.apply(e),this.visuals.border_line.apply(e)}this.visuals.text.doit&&o.paint(e)}_css_text(e,t,i,s,n){const{el:o}=this;(0,_.assert)(null!=o),(0,a.undisplay)(o),o.textContent=t,this.visuals.text.set_value(e),o.style.position="absolute",o.style.left=`${i}px`,o.style.top=`${s}px`,o.style.color=e.fillStyle,o.style.font=e.font,o.style.lineHeight="normal",o.style.whiteSpace="pre";const[r,l]=(()=>{switch(this.visuals.text.text_align.get_value()){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[c,h]=(()=>{switch(this.visuals.text.text_baseline.get_value()){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}})();let u=`translate(${l}, ${h})`;n&&(u+=`rotate(${n}rad)`),o.style.transformOrigin=`${r} ${c}`,o.style.transform=u,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),o.style.backgroundColor=e.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(e),o.style.borderStyle=e.lineDash.length<2?"solid":"dashed",o.style.borderWidth=`${e.lineWidth}px`,o.style.borderColor=e.strokeStyle),(0,a.display)(o)}}i.TextAnnotationView=u,u.__name__="TextAnnotationView";class d extends r.Annotation{constructor(e){super(e)}}i.TextAnnotation=d,o=d,d.__name__="TextAnnotation",o.define((()=>({render_mode:[l.RenderMode,"canvas"]})))},function(e,t,i,s,n){s();const o=e(65),r=e(121),a=e(9),l=e(8),c=e(122),h=e(22);i.text_width=(()=>{const e=document.createElement("canvas").getContext("2d");let t="";return(i,s)=>(s!=t&&(t=s,e.font=s),e.measureText(i).width)})();class _{constructor(){this._position={sx:0,sy:0},this.font_size_scale=1,this.align="left",this._base_font_size=13,this._x_anchor="left",this._y_anchor="center"}set base_font_size(e){null!=e&&(this._base_font_size=e)}get base_font_size(){return this._base_font_size}set position(e){this._position=e}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:e,p1:t,p2:i,p3:s}=this.rect(),n=Math.min(e.x,t.x,i.x,s.x),r=Math.min(e.y,t.y,i.y,s.y),a=Math.max(e.x,t.x,i.x,s.x),l=Math.max(e.y,t.y,i.y,s.y);return new o.BBox({left:n,right:a,top:r,bottom:l})}size(){const{width:e,height:t}=this._size(),{angle:i}=this;if(i){const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(e*s+t*n),height:Math.abs(e*n+t*s)}}return{width:e,height:t}}rect(){const e=this._rect(),{angle:t}=this;if(t){const{sx:i,sy:s}=this.position,n=new c.AffineTransform;return n.translate(i,s),n.rotate(t),n.translate(-i,-s),n.apply_rect(e)}return e}paint_rect(e){const{p0:t,p1:i,p2:s,p3:n}=this.rect();e.save(),e.strokeStyle="red",e.lineWidth=1,e.beginPath();const{round:o}=Math;e.moveTo(o(t.x),o(t.y)),e.lineTo(o(i.x),o(i.y)),e.lineTo(o(s.x),o(s.y)),e.lineTo(o(n.x),o(n.y)),e.closePath(),e.stroke(),e.restore()}paint_bbox(e){const{x:t,y:i,width:s,height:n}=this.bbox();e.save(),e.strokeStyle="blue",e.lineWidth=1,e.beginPath();const{round:o}=Math;e.moveTo(o(t),o(i)),e.lineTo(o(t),o(i+n)),e.lineTo(o(t+s),o(i+n)),e.lineTo(o(t+s),o(i)),e.closePath(),e.stroke(),e.restore()}}i.GraphicsBox=_,_.__name__="GraphicsBox";class u extends _{constructor({text:e}){super(),this.text=e}set visuals(e){const t=e.color,i=e.alpha,s=e.font_style;let n=e.font_size;const o=e.font,{font_size_scale:a,base_font_size:l}=this,c=(0,r.parse_css_font_size)(n);if(null!=c){let{value:e,unit:t}=c;e*=a,"em"==t&&l&&(e*=l,t="px"),n=`${e}${t}`}const _=`${s} ${n} ${o}`;this.font=_,this.color=(0,h.color2css)(t,i),this.line_height=e.line_height;const u=e.align;this._x_anchor=u;const d=e.baseline;this._y_anchor=(()=>{switch(d){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}infer_text_height(){if(this.text.includes("\n"))return"ascent_descent";{function e(e){for(const t of new Set(e))if(!("0"<=t&&t<="9"))switch(t){case",":case".":case"+":case"-":case"\u2212":case"e":continue;default:return!1}return!0}return e(this.text)?"cap":"ascent_descent"}}_text_line(e){var t;const i=null!==(t=this.text_height_metric)&&void 0!==t?t:this.infer_text_height(),s=(()=>{switch(i){case"x":case"x_descent":return e.x_height;case"cap":case"cap_descent":return e.cap_height;case"ascent":case"ascent_descent":return e.ascent}})(),n=(()=>{switch(i){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return e.descent}})();return{height:s+n,ascent:s,descent:n}}get nlines(){return this.text.split("\n").length}_size(){var e,t;const{font:s}=this,n=(0,r.font_metrics)(s),o=(this.line_height-1)*n.height,l=""==this.text,c=this.text.split("\n"),h=c.length,_=c.map((e=>(0,i.text_width)(e,s))),u=this._text_line(n).height*h,d="%"==(null===(e=this.width)||void 0===e?void 0:e.unit)?this.width.value:1,p="%"==(null===(t=this.height)||void 0===t?void 0:t.unit)?this.height.value:1;return{width:(0,a.max)(_)*d,height:l?0:(u+o*(h-1))*p,metrics:n}}_computed_position(e,t,i){const{width:s,height:n}=e,{sx:o,sy:r,x_anchor:a=this._x_anchor,y_anchor:c=this._y_anchor}=this.position;return{x:o-(()=>{if((0,l.isNumber)(a))return a*s;switch(a){case"left":return 0;case"center":return.5*s;case"right":return s}})(),y:r-(()=>{var e;if((0,l.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":return.5*n;case"bottom":return n;case"baseline":if(1!=i)return.5*n;switch(null!==(e=this.text_height_metric)&&void 0!==e?e:this.infer_text_height()){case"x":case"x_descent":return t.x_height;case"cap":case"cap_descent":return t.cap_height;case"ascent":case"ascent_descent":return t.ascent}}})()}}_rect(){const{width:e,height:t,metrics:i}=this._size(),s=this.text.split("\n").length,{x:n,y:r}=this._computed_position({width:e,height:t},i,s);return new o.BBox({x:n,y:r,width:e,height:t}).rect}paint(e){var t,s;const{font:n}=this,o=(0,r.font_metrics)(n),l=(this.line_height-1)*o.height,c=this.text.split("\n"),h=c.length,_=c.map((e=>(0,i.text_width)(e,n))),u=this._text_line(o),d=u.height*h,p="%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1,m="%"==(null===(s=this.height)||void 0===s?void 0:s.unit)?this.height.value:1,g=(0,a.max)(_)*p,f=(d+l*(h-1))*m;e.save(),e.fillStyle=this.color,e.font=this.font,e.textAlign="left",e.textBaseline="alphabetic";const{sx:b,sy:y}=this.position,{align:v}=this,{angle:x}=this;x&&(e.translate(b,y),e.rotate(x),e.translate(-b,-y));let{x:w,y:A}=this._computed_position({width:g,height:f},o,h);if("justify"==v)for(let r=0;r<h;r++){let t=w;const s=c[r].split(" "),o=s.length,h=s.map((e=>(0,i.text_width)(e,n))),_=(g-(0,a.sum)(h))/(o-1);for(let i=0;i<o;i++)e.fillText(s[i],t,A),t+=h[i]+_;A+=u.height+l}else for(let i=0;i<h;i++){const t=w+(()=>{switch(v){case"left":return 0;case"center":return.5*(g-_[i]);case"right":return g-_[i]}})();e.fillStyle=this.color,e.fillText(c[i],t,A+u.ascent),A+=u.height+l}e.restore()}}i.TextBox=u,u.__name__="TextBox";class d extends _{constructor(e,t){super(),this.base=e,this.expo=t}get children(){return[this.base,this.expo]}set base_font_size(e){super.base_font_size=e,this.base.base_font_size=e,this.expo.base_font_size=e}set position(e){this._position=e;const t=this.base.size(),i=this.expo.size(),s=this._shift_scale()*t.height,n=Math.max(t.height,s+i.height);this.base.position={sx:0,x_anchor:"left",sy:n,y_anchor:"bottom"},this.expo.position={sx:t.width,x_anchor:"left",sy:s,y_anchor:"bottom"}}get position(){return this._position}set visuals(e){this.expo.font_size_scale=.7,this.base.visuals=e,this.expo.visuals=e}_shift_scale(){if(this.base instanceof u&&1==this.base.nlines){const{x_height:e,cap_height:t}=(0,r.font_metrics)(this.base.font);return e/t}return 2/3}infer_text_height(){return this.base.infer_text_height()}_rect(){const e=this.base.bbox(),t=this.expo.bbox(),i=e.union(t),{x:s,y:n}=this._computed_position();return i.translate(s,n).rect}_size(){const e=this.base.size(),t=this.expo.size();return{width:e.width+t.width,height:Math.max(e.height,this._shift_scale()*e.height+t.height)}}paint(e){e.save();const{angle:t}=this;if(t){const{sx:i,sy:s}=this.position;e.translate(i,s),e.rotate(t),e.translate(-i,-s)}const{x:i,y:s}=this._computed_position();e.translate(i,s),this.base.paint(e),this.expo.paint(e),e.restore()}paint_bbox(e){super.paint_bbox(e);const{x:t,y:i}=this._computed_position();e.save(),e.translate(t,i);for(const s of this.children)s.paint_bbox(e);e.restore()}_computed_position(){const{width:e,height:t}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:o=this._y_anchor}=this.position;return{x:i-(()=>{if((0,l.isNumber)(n))return n*e;switch(n){case"left":return 0;case"center":return.5*e;case"right":return e}})(),y:s-(()=>{if((0,l.isNumber)(o))return o*t;switch(o){case"top":return 0;case"center":case"baseline":return.5*t;case"bottom":return t}})()}}}i.BaseExpo=d,d.__name__="BaseExpo";class p{constructor(e){this.items=e}set base_font_size(e){for(const t of this.items)t.base_font_size=e}get length(){return this.items.length}set visuals(e){for(const s of this.items)s.visuals=e;const t={x:0,cap:1,ascent:2,x_descent:3,cap_descent:4,ascent_descent:5},i=(0,a.max_by)(this.items.map((e=>e.infer_text_height())),(e=>t[e]));for(const s of this.items)s.text_height_metric=i}set angle(e){for(const t of this.items)t.angle=e}max_size(){let e=0,t=0;for(const i of this.items){const s=i.size();e=Math.max(e,s.width),t=Math.max(t,s.height)}return{width:e,height:t}}}i.GraphicsBoxes=p,p.__name__="GraphicsBoxes"},function(e,t,i,s,n){s();const o=e(11),r=(()=>{try{return"undefined"!=typeof OffscreenCanvas&&null!=new OffscreenCanvas(0,0).getContext("2d")}catch(e){return!1}})()?(e,t)=>new OffscreenCanvas(e,t):(e,t)=>{const i=document.createElement("canvas");return i.width=e,i.height=t,i},a=(()=>{const e=r(0,0).getContext("2d");return t=>{e.font=t;const i=e.measureText("M"),s=e.measureText("x"),n=e.measureText("\xc5\u015ag|"),r=n.fontBoundingBoxAscent,a=n.fontBoundingBoxDescent;if(null!=r&&null!=a)return{height:r+a,ascent:r,descent:a,cap_height:i.actualBoundingBoxAscent,x_height:s.actualBoundingBoxAscent};const l=n.actualBoundingBoxAscent,c=n.actualBoundingBoxDescent;if(null!=l&&null!=c)return{height:l+c,ascent:l,descent:c,cap_height:i.actualBoundingBoxAscent,x_height:s.actualBoundingBoxAscent};(0,o.unreachable)()}})(),l=(()=>{const e=r(0,0).getContext("2d");return(t,i)=>{e.font=i;const s=e.measureText(t),n=s.actualBoundingBoxAscent,r=s.actualBoundingBoxDescent;if(null!=n&&null!=r)return{width:s.width,height:n+r,ascent:n,descent:r};(0,o.unreachable)()}})(),c=(()=>{const e=document.createElement("canvas"),t=e.getContext("2d");let i=-1,s=-1;return(n,o=1)=>{t.font=n;const{width:r}=t.measureText("M"),a=r*o,l=Math.ceil(a),c=Math.ceil(2*a),h=Math.ceil(1.5*a);i<l&&(i=l,e.width=l),s<c&&(s=c,e.height=c),t.save(),t.scale(o,o),t.fillStyle="#f00",t.fillRect(0,0,l,c);const _=e=>{let t=0;for(let i=0;i<=h;i++)for(let s=0;s<l;s++,t+=4)if(255!=e[t])return h-i;return 0};t.font=n,t.fillStyle="#000";for(const e of"xa")t.fillText(e,0,h/o);const{data:u}=t.getImageData(0,0,l,c),d=_(u)/o;for(const e of"ASQ")t.fillText(e,0,h/o);const{data:p}=t.getImageData(0,0,l,c),m=_(p)/o;for(const e of"\xc5\u015agy")t.fillText(e,0,h/o);const{data:g}=t.getImageData(0,0,l,c),f=_(g)/o,b=(e=>{let t=e.length-4;for(let i=c;i>=h;i--)for(let s=0;s<l;s++,t-=4)if(255!=e[t])return i-h;return 0})(g)/o;return t.restore(),{height:f+b,ascent:f,cap_height:m,x_height:d,descent:b}}})(),h=(()=>{const e=document.createElement("canvas"),t=e.getContext("2d");let i=-1,s=-1;return(n,o,r=1)=>{t.font=o;const{width:a}=t.measureText("M"),l=a*r,c=Math.ceil(l),h=Math.ceil(2*l),_=Math.ceil(1.5*l);(i<c||s<h)&&(i=c,e.width=c,s=h,e.height=h),t.save(),t.scale(r,r),t.fillStyle="#f00",t.fillRect(0,0,c,h),t.font=o,t.fillStyle="#000",t.fillText(n,0,_/r);const u=t.measureText(n),{data:d}=t.getImageData(0,0,c,h),p=(e=>{let t=0;for(let i=0;i<=_;i++)for(let s=0;s<c;s++,t+=4)if(255!=e[t])return _-i;return 0})(d)/r,m=(e=>{let t=e.length-4;for(let i=h;i>=_;i--)for(let s=0;s<c;s++,t-=4)if(255!=e[t])return i-_;return 0})(d)/r;return t.restore(),{width:u.width,height:p+m,ascent:p,descent:m}}})(),_=(()=>{try{return a("normal 10px sans-serif"),a}catch(e){return c}})(),u=(()=>{try{return l("A","normal 10px sans-serif"),l}catch(e){return h}})(),d=new Map;function p(e){let t=d.get(e);return null==t&&(t={font:_(e),glyphs:new Map},d.set(e,t)),t.font}i.font_metrics=p,i.glyph_metrics=function(e,t){let i=d.get(t);null==i&&(p(t),i=d.get(t));let s=i.glyphs.get(e);return null==s&&(s=u(e,t),i.glyphs.set(e,s)),s},i.parse_css_font_size=function(e){const t=e.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){const[,e,,i]=t,s=Number(e);if(isFinite(s))return{value:s,unit:i}}return null}},function(e,t,i,s,n){s();const{sin:o,cos:r}=Math;class a{constructor(e=1,t=0,i=0,s=1,n=0,o=0){this.a=e,this.b=t,this.c=i,this.d=s,this.e=n,this.f=o}toString(){const{a:e,b:t,c:i,d:s,e:n,f:o}=this;return`matrix(${e}, ${t}, ${i}, ${s}, ${n}, ${o})`}static from_DOMMatrix(e){const{a:t,b:i,c:s,d:n,e:o,f:r}=e;return new a(t,i,s,n,o,r)}to_DOMMatrix(){const{a:e,b:t,c:i,d:s,e:n,f:o}=this;return new DOMMatrix([e,t,i,s,n,o])}clone(){const{a:e,b:t,c:i,d:s,e:n,f:o}=this;return new a(e,t,i,s,n,o)}get is_identity(){const{a:e,b:t,c:i,d:s,e:n,f:o}=this;return 1==e&&0==t&&0==i&&1==s&&0==n&&0==o}apply_point(e){const[t,i]=this.apply(e.x,e.y);return{x:t,y:i}}apply_rect(e){return{p0:this.apply_point(e.p0),p1:this.apply_point(e.p1),p2:this.apply_point(e.p2),p3:this.apply_point(e.p3)}}apply(e,t){const{a:i,b:s,c:n,d:o,e:r,f:a}=this;return[i*e+n*t+r,s*e+o*t+a]}iv_apply(e,t){const{a:i,b:s,c:n,d:o,e:r,f:a}=this,l=e.length;for(let c=0;c<l;c++){const l=e[c],h=t[c];e[c]=i*l+n*h+r,t[c]=s*l+o*h+a}}transform(e,t,i,s,n,o){const{a:r,b:a,c:l,d:c,e:h,f:_}=this;return this.a=r*e+l*t,this.c=r*i+l*s,this.e=r*n+l*o+h,this.b=a*e+c*t,this.d=a*i+c*s,this.f=a*n+c*o+_,this}translate(e,t){return this.transform(1,0,0,1,e,t)}scale(e,t){return this.transform(e,0,0,t,0,0)}skew(e,t){return this.transform(1,t,e,1,0,0)}rotate(e){const t=o(e),i=r(e);return this.transform(i,t,-t,i,0,0)}rotate_ccw(e){return this.rotate(-e)}translate_x(e){return this.translate(e,0)}translate_y(e){return this.translate(0,e)}flip(){return this.scale(-1,-1)}flip_x(){return this.scale(1,-1)}flip_y(){return this.scale(-1,1)}}i.AffineTransform=a,a.__name__="AffineTransform"},function(e,t,i,s,n){s();const o=e(124),r=e(125),a=e(8),l=Math.PI/2,c={above:{parallel:0,normal:-l,horizontal:0,vertical:-l},below:{parallel:0,normal:l,horizontal:0,vertical:l},left:{parallel:-l,normal:0,horizontal:0,vertical:-l},right:{parallel:l,normal:0,horizontal:0,vertical:l}},h={above:{parallel:"bottom",normal:"center",horizontal:"bottom",vertical:"center"},below:{parallel:"top",normal:"center",horizontal:"top",vertical:"center"},left:{parallel:"bottom",normal:"center",horizontal:"center",vertical:"bottom"},right:{parallel:"bottom",normal:"center",horizontal:"center",vertical:"bottom"}},_={above:{parallel:"center",normal:"left",horizontal:"center",vertical:"left"},below:{parallel:"center",normal:"left",horizontal:"center",vertical:"left"},left:{parallel:"center",normal:"right",horizontal:"right",vertical:"center"},right:{parallel:"center",normal:"left",horizontal:"left",vertical:"center"}},u={above:"right",below:"left",left:"right",right:"left"},d={above:"left",below:"right",left:"right",right:"left"};class p{constructor(e){this.side=e}get dimension(){return"above"==this.side||"below"==this.side?0:1}get normals(){switch(this.side){case"above":return[0,-1];case"below":return[0,1];case"left":return[-1,0];case"right":return[1,0]}}get orientation(){return this.is_horizontal?"horizontal":"vertical"}get is_horizontal(){return 0==this.dimension}get is_vertical(){return 1==this.dimension}get_label_text_heuristics(e){const{side:t}=this;return(0,a.isString)(e)?{vertical_align:h[t][e],align:_[t][e]}:{vertical_align:"center",align:(e<0?u:d)[t]}}get_label_angle_heuristic(e){return(0,a.isString)(e)?c[this.side][e]:-e}}i.Panel=p,p.__name__="Panel";class m extends r.ContentLayoutable{constructor(e,t,i=!1){super(),this.panel=e,this.get_size=t,this.rotate=i,this.panel.is_horizontal?this.set_sizing({width_policy:"max",height_policy:"fixed"}):this.set_sizing({width_policy:"fixed",height_policy:"max"})}_content_size(){const{width:e,height:t}=this.get_size();return!this.rotate||this.panel.is_horizontal?new o.Sizeable({width:e,height:t}):new o.Sizeable({width:t,height:e})}has_size_changed(){const{width:e,height:t}=this._content_size();return this.panel.is_horizontal?this.bbox.height!=t:this.bbox.width!=e}}i.SideLayout=m,m.__name__="SideLayout"},function(e,t,i,s,n){s();const o=e(21),{min:r,max:a}=Math;class l{constructor(e={}){this.width=null!=e.width?e.width:0,this.height=null!=e.height?e.height:0}bounded_to({width:e,height:t}){return new l({width:this.width==1/0&&null!=e?e:this.width,height:this.height==1/0&&null!=t?t:this.height})}expanded_to({width:e,height:t}){return new l({width:e!=1/0?a(this.width,e):this.width,height:t!=1/0?a(this.height,t):this.height})}expand_to({width:e,height:t}){this.width=a(this.width,e),this.height=a(this.height,t)}narrowed_to({width:e,height:t}){return new l({width:r(this.width,e),height:r(this.height,t)})}narrow_to({width:e,height:t}){this.width=r(this.width,e),this.height=r(this.height,t)}grow_by({left:e,right:t,top:i,bottom:s}){const n=this.width+e+t,o=this.height+i+s;return new l({width:n,height:o})}shrink_by({left:e,right:t,top:i,bottom:s}){const n=a(this.width-e-t,0),o=a(this.height-i-s,0);return new l({width:n,height:o})}map(e,t){return new l({width:e(this.width),height:(null!=t?t:e)(this.height)})}}i.Sizeable=l,l.__name__="Sizeable",i.SizingPolicy=(0,o.Enum)("fixed","fit","min","max")},function(e,t,i,s,n){s();const o=e(124),r=e(65),a=e(8),{min:l,max:c,round:h}=Math;class _{constructor(){this.absolute=!1,this._bbox=new r.BBox,this._inner_bbox=new r.BBox,this._dirty=!1,this._handlers=[]}*[Symbol.iterator](){}get bbox(){return this._bbox}get inner_bbox(){return this._inner_bbox}get sizing(){return this._sizing}set visible(e){this._sizing.visible=e,this._dirty=!0}set_sizing(e){var t,i,s,n,o;const r=null!==(t=e.width_policy)&&void 0!==t?t:"fit",a=e.width,l=e.min_width,c=e.max_width,h=null!==(i=e.height_policy)&&void 0!==i?i:"fit",_=e.height,u=e.min_height,d=e.max_height,p=e.aspect,m=null!==(s=e.margin)&&void 0!==s?s:{top:0,right:0,bottom:0,left:0},g=!1!==e.visible,f=null!==(n=e.halign)&&void 0!==n?n:"start",b=null!==(o=e.valign)&&void 0!==o?o:"start";this._sizing={width_policy:r,min_width:l,width:a,max_width:c,height_policy:h,min_height:u,height:_,max_height:d,aspect:p,margin:m,visible:g,halign:f,valign:b,size:{width:a,height:_}},this._init()}_init(){}_set_geometry(e,t){this._bbox=e,this._inner_bbox=t}set_geometry(e,t){const{fixup_geometry:i}=this;null!=i&&([e,t]=i(e,t)),this._set_geometry(e,null!=t?t:e);for(const s of this._handlers)s(this._bbox,this._inner_bbox)}on_resize(e){this._handlers.push(e)}is_width_expanding(){return"max"==this.sizing.width_policy}is_height_expanding(){return"max"==this.sizing.height_policy}apply_aspect(e,{width:t,height:i}){const{aspect:s}=this.sizing;if(null!=s){const{width_policy:n,height_policy:o}=this.sizing,r=(e,t)=>{const i={max:4,fit:3,min:2,fixed:1};return i[e]>i[t]};if("fixed"!=n&&"fixed"!=o)if(n==o){const n=t,o=h(t/s),r=h(i*s),a=i;Math.abs(e.width-n)+Math.abs(e.height-o)<=Math.abs(e.width-r)+Math.abs(e.height-a)?(t=n,i=o):(t=r,i=a)}else r(n,o)?i=h(t/s):t=h(i*s);else"fixed"==n?i=h(t/s):"fixed"==o&&(t=h(i*s))}return{width:t,height:i}}measure(e){if(!this.sizing.visible)return{width:0,height:0};const t=e=>"fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:e,i=e=>"fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:e,s=new o.Sizeable(e).shrink_by(this.sizing.margin).map(t,i),n=this._measure(s),r=this.clip_size(n,s),a=t(r.width),l=i(r.height),c=this.apply_aspect(s,{width:a,height:l});return Object.assign(Object.assign({},n),c)}compute(e={}){const t=this.measure({width:null!=e.width&&this.is_width_expanding()?e.width:1/0,height:null!=e.height&&this.is_height_expanding()?e.height:1/0}),{width:i,height:s}=t,n=new r.BBox({left:0,top:0,width:i,height:s});let o;if(null!=t.inner){const{left:e,top:n,right:a,bottom:l}=t.inner;o=new r.BBox({left:e,top:n,right:i-a,bottom:s-l})}this.set_geometry(n,o)}get xview(){return this.bbox.xview}get yview(){return this.bbox.yview}clip_size(e,t){function i(e,t,i,s){return null==i?i=0:(0,a.isNumber)(i)||(i=Math.round(i.percent*t)),null==s?s=1/0:(0,a.isNumber)(s)||(s=Math.round(s.percent*t)),c(i,l(e,s))}return{width:i(e.width,t.width,this.sizing.min_width,this.sizing.max_width),height:i(e.height,t.height,this.sizing.min_height,this.sizing.max_height)}}has_size_changed(){const{_dirty:e}=this;return this._dirty=!1,e}}i.Layoutable=_,_.__name__="Layoutable";class u extends _{_measure(e){const{width_policy:t,height_policy:i}=this.sizing;return{width:(()=>{const{width:i}=this.sizing;if(e.width==1/0)return null!=i?i:0;switch(t){case"fixed":return null!=i?i:0;case"min":return null!=i?l(e.width,i):0;case"fit":return null!=i?l(e.width,i):e.width;case"max":return null!=i?c(e.width,i):e.width}})(),height:(()=>{const{height:t}=this.sizing;if(e.height==1/0)return null!=t?t:0;switch(i){case"fixed":return null!=t?t:0;case"min":return null!=t?l(e.height,t):0;case"fit":return null!=t?l(e.height,t):e.height;case"max":return null!=t?c(e.height,t):e.height}})()}}}i.LayoutItem=u,u.__name__="LayoutItem";class d extends _{_measure(e){const t=this._content_size(),i=e.bounded_to(this.sizing.size).bounded_to(t);return{width:(()=>{switch(this.sizing.width_policy){case"fixed":return null!=this.sizing.width?this.sizing.width:t.width;case"min":return t.width;case"fit":return i.width;case"max":return Math.max(t.width,i.width)}})(),height:(()=>{switch(this.sizing.height_policy){case"fixed":return null!=this.sizing.height?this.sizing.height:t.height;case"min":return t.height;case"fit":return i.height;case"max":return Math.max(t.height,i.height)}})()}}}i.ContentLayoutable=d,d.__name__="ContentLayoutable"},function(e,t,i,s,n){s();const o=e(62),r=e(61),a=e(58),l=e(63),c=e(67),h=e(65),_=e(13),u=e(11);class d{constructor(e,t,i,s,n={},o={},r={},a={}){this.in_x_scale=e,this.in_y_scale=t,this.x_range=i,this.y_range=s,this.extra_x_ranges=n,this.extra_y_ranges=o,this.extra_x_scales=r,this.extra_y_scales=a,this._bbox=new h.BBox,(0,u.assert)(null==e.source_range&&null==e.target_range),(0,u.assert)(null==t.source_range&&null==t.target_range),this._configure_scales()}get bbox(){return this._bbox}_get_ranges(e,t){return new Map((0,_.entries)(Object.assign(Object.assign({},t),{default:e})))}_get_scales(e,t,i,s){var n;const a=new Map((0,_.entries)(Object.assign(Object.assign({},t),{default:e}))),h=new Map;for(const[_,u]of i){if(u instanceof c.FactorRange!=e instanceof o.CategoricalScale)throw new Error(`Range ${u.type} is incompatible is Scale ${e.type}`);e instanceof r.LogScale&&u instanceof l.DataRange1d&&(u.scale_hint="log");const t=(null!==(n=a.get(_))&&void 0!==n?n:e).clone();t.setv({source_range:u,target_range:s}),h.set(_,t)}return h}_configure_frame_ranges(){const{bbox:e}=this;this._x_target=new a.Range1d({start:e.left,end:e.right}),this._y_target=new a.Range1d({start:e.bottom,end:e.top})}_configure_scales(){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._x_scales=this._get_scales(this.in_x_scale,this.extra_x_scales,this._x_ranges,this._x_target),this._y_scales=this._get_scales(this.in_y_scale,this.extra_y_scales,this._y_ranges,this._y_target)}_update_scales(){this._configure_frame_ranges();for(const[,e]of this._x_scales)e.target_range=this._x_target;for(const[,e]of this._y_scales)e.target_range=this._y_target}set_geometry(e){this._bbox=e,this._update_scales()}get x_target(){return this._x_target}get y_target(){return this._y_target}get x_ranges(){return this._x_ranges}get y_ranges(){return this._y_ranges}get x_scales(){return this._x_scales}get y_scales(){return this._y_scales}get x_scale(){return this._x_scales.get("default")}get y_scale(){return this._y_scales.get("default")}get xscales(){return(0,_.to_object)(this.x_scales)}get yscales(){return(0,_.to_object)(this.y_scales)}}i.CartesianFrame=d,d.__name__="CartesianFrame"},function(e,t,i,s,n){s(),n("Axis",e(128).Axis),n("CategoricalAxis",e(140).CategoricalAxis),n("ContinuousAxis",e(143).ContinuousAxis),n("DatetimeAxis",e(144).DatetimeAxis),n("LinearAxis",e(145).LinearAxis),n("LogAxis",e(162).LogAxis),n("MercatorAxis",e(165).MercatorAxis)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(129),l=e(130),c=e(131),h=e(132),_=(0,o.__importStar)(e(48)),u=e(20),d=e(24),p=e(123),m=e(9),g=e(13),f=e(8),b=e(120),y=e(67),v=e(133),x=e(113),w=e(11),A=e(8),k=e(134),{abs:S}=Math;class T extends a.GuideRendererView{constructor(){super(...arguments),this._axis_label_view=null,this._major_label_views=new Map}async lazy_initialize(){await super.lazy_initialize(),await this._init_axis_label(),await this._init_major_labels()}async _init_axis_label(){const{axis_label:e}=this.model;if(null!=e){const t=(0,A.isString)(e)?(0,k.parse_delimited_string)(e):e;this._axis_label_view=await(0,x.build_view)(t,{parent:this})}else this._axis_label_view=null}async _init_major_labels(){const{major_label_overrides:e}=this.model;for(const[t,i]of(0,g.entries)(e)){const e=(0,A.isString)(i)?(0,k.parse_delimited_string)(i):i;this._major_label_views.set(t,await(0,x.build_view)(e,{parent:this}))}}update_layout(){this.layout=new p.SideLayout(this.panel,(()=>this.get_size()),!0),this.layout.on_resize((()=>this._coordinates=void 0))}get_size(){const{visible:e,fixed_location:t}=this.model;if(e&&null==t&&this.is_renderable){const{extents:e}=this;return{width:0,height:Math.round(e.tick+e.tick_label+e.axis_label)}}return{width:0,height:0}}get is_renderable(){const[e,t]=this.ranges;return e.is_valid&&t.is_valid}_render(){var e;if(!this.is_renderable)return;const{tick_coords:t,extents:i}=this,s=this.layer.ctx;s.save(),this._draw_rule(s,i),this._draw_major_ticks(s,i,t),this._draw_minor_ticks(s,i,t),this._draw_major_labels(s,i,t),this._draw_axis_label(s,i,t),null===(e=this._paint)||void 0===e||e.call(this,s,i,t),s.restore()}connect_signals(){super.connect_signals();const{axis_label:e,major_label_overrides:t}=this.model.properties;this.on_change(e,(async()=>{var e;null===(e=this._axis_label_view)||void 0===e||e.remove(),await this._init_axis_label()})),this.on_change(t,(async()=>{for(const e of this._major_label_views.values())e.remove();await this._init_major_labels()})),this.connect(this.model.change,(()=>this.plot_view.request_layout()))}get needs_clip(){return null!=this.model.fixed_location}_draw_rule(e,t){if(!this.visuals.axis_line.doit)return;const[i,s]=this.rule_coords,[n,o]=this.coordinates.map_to_screen(i,s),[r,a]=this.normals,[l,c]=this.offsets;this.visuals.axis_line.set_value(e),e.beginPath();for(let h=0;h<n.length;h++){const t=Math.round(n[h]+r*l),i=Math.round(o[h]+a*c);e.lineTo(t,i)}e.stroke()}_draw_major_ticks(e,t,i){const s=this.model.major_tick_in,n=this.model.major_tick_out,o=this.visuals.major_tick_line;this._draw_ticks(e,i.major,s,n,o)}_draw_minor_ticks(e,t,i){const s=this.model.minor_tick_in,n=this.model.minor_tick_out,o=this.visuals.minor_tick_line;this._draw_ticks(e,i.minor,s,n,o)}_draw_major_labels(e,t,i){const s=i.major,n=this.compute_labels(s[this.dimension]),o=this.model.major_label_orientation,r=t.tick+this.model.major_label_standoff,a=this.visuals.major_label_text;this._draw_oriented_labels(e,n,s,o,this.panel.side,r,a)}_axis_label_extent(){if(null==this._axis_label_view)return 0;const e=this._axis_label_view.graphics();e.visuals=this.visuals.axis_label_text.values(),e.angle=this.panel.get_label_angle_heuristic("parallel"),(0,f.isNumber)(this.plot_view.base_font_size)&&(e.base_font_size=this.plot_view.base_font_size);const t=e.size(),i=0==this.dimension?t.height:t.width,s=this.model.axis_label_standoff;return i>0?s+i+3:0}_draw_axis_label(e,t,i){if(null==this._axis_label_view||null!=this.model.fixed_location)return;const[s,n]=(()=>{const{bbox:e}=this.layout;switch(this.panel.side){case"above":return[e.hcenter,e.bottom];case"below":return[e.hcenter,e.top];case"left":return[e.right,e.vcenter];case"right":return[e.left,e.vcenter]}})(),[o,r]=this.normals,a=t.tick+t.tick_label+this.model.axis_label_standoff,{vertical_align:l,align:c}=this.panel.get_label_text_heuristics("parallel"),h={sx:s+o*a,sy:n+r*a,x_anchor:c,y_anchor:l},_=this._axis_label_view.graphics();_.visuals=this.visuals.axis_label_text.values(),_.angle=this.panel.get_label_angle_heuristic("parallel"),this.plot_view.base_font_size&&(_.base_font_size=this.plot_view.base_font_size),_.position=h,_.align=c,_.paint(e)}_draw_ticks(e,t,i,s,n){if(!n.doit)return;const[o,r]=t,[a,l]=this.coordinates.map_to_screen(o,r),[c,h]=this.normals,[_,u]=this.offsets,[d,p]=[c*(_-i),h*(u-i)],[m,g]=[c*(_+s),h*(u+s)];n.set_value(e),e.beginPath();for(let f=0;f<a.length;f++){const t=Math.round(a[f]+m),i=Math.round(l[f]+g),s=Math.round(a[f]+d),n=Math.round(l[f]+p);e.moveTo(t,i),e.lineTo(s,n)}e.stroke()}_draw_oriented_labels(e,t,i,s,n,o,r){if(!r.doit||0==t.length)return;const[a,l]=i,[c,h]=this.coordinates.map_to_screen(a,l),[_,u]=this.offsets,[p,m]=this.normals,g=p*(_+o),f=m*(u+o),{vertical_align:y,align:v}=this.panel.get_label_text_heuristics(s),x=this.panel.get_label_angle_heuristic(s);t.visuals=r.values(),t.angle=x,t.base_font_size=this.plot_view.base_font_size;for(let d=0;d<t.length;d++){const e=t.items[d];e.position={sx:c[d]+g,sy:h[d]+f,x_anchor:v,y_anchor:y},e instanceof b.TextBox&&(e.align=v)}const w=t.length,A=d.Indices.all_set(w),{items:k}=t,S=k.map((e=>e.bbox())),T=(()=>{const[e]=this.ranges;return e.is_reversed?0==this.dimension?(e,t)=>S[e].left-S[t].right:(e,t)=>S[t].top-S[e].bottom:0==this.dimension?(e,t)=>S[t].left-S[e].right:(e,t)=>S[e].top-S[t].bottom})(),{major_label_policy:C}=this.model,M=C.filter(A,S,T),z=[...M.ones()];if(0!=z.length){const e=this.parent.canvas_view.bbox,t=t=>{const i=S[t];if(i.left<0){const e=-i.left,{position:s}=k[t];k[t].position=Object.assign(Object.assign({},s),{sx:s.sx+e})}else if(i.right>e.width){const s=i.right-e.width,{position:n}=k[t];k[t].position=Object.assign(Object.assign({},n),{sx:n.sx-s})}},i=t=>{const i=S[t];if(i.top<0){const e=-i.top,{position:s}=k[t];k[t].position=Object.assign(Object.assign({},s),{sy:s.sy+e})}else if(i.bottom>e.height){const s=i.bottom-e.height,{position:n}=k[t];k[t].position=Object.assign(Object.assign({},n),{sy:n.sy-s})}},s=z[0],n=z[z.length-1];0==this.dimension?(t(s),t(n)):(i(s),i(n))}for(const d of M)k[d].paint(e)}_tick_extent(){return this.model.major_tick_out}_tick_label_extents(){const e=this.tick_coords.major,t=this.compute_labels(e[this.dimension]),i=this.model.major_label_orientation,s=this.model.major_label_standoff,n=this.visuals.major_label_text;return[this._oriented_labels_extent(t,i,s,n)]}get extents(){const e=this._tick_label_extents();return{tick:this._tick_extent(),tick_labels:e,tick_label:(0,m.sum)(e),axis_label:this._axis_label_extent()}}_oriented_labels_extent(e,t,i,s){if(0==e.length||!s.doit)return 0;const n=this.panel.get_label_angle_heuristic(t);e.visuals=s.values(),e.angle=n,e.base_font_size=this.plot_view.base_font_size;const o=e.max_size(),r=0==this.dimension?o.height:o.width;return r>0?i+r+3:0}get normals(){return this.panel.normals}get dimension(){return this.panel.dimension}compute_labels(e){const t=this.model.formatter.format_graphics(e,this),{_major_label_views:i}=this,s=new Set;for(let n=0;n<e.length;n++){const o=i.get(e[n].toString());null!=o&&(s.add(o),t[n]=o.graphics())}for(const n of this._major_label_views.values())s.has(n)||(n._has_finished=!0);return new b.GraphicsBoxes(t)}get offsets(){if(null!=this.model.fixed_location)return[0,0];const{frame:e}=this.plot_view;let[t,i]=[0,0];switch(this.panel.side){case"below":i=S(this.layout.bbox.top-e.bbox.bottom);break;case"above":i=S(this.layout.bbox.bottom-e.bbox.top);break;case"right":t=S(this.layout.bbox.left-e.bbox.right);break;case"left":t=S(this.layout.bbox.right-e.bbox.left)}return[t,i]}get ranges(){const e=this.dimension,t=(e+1)%2,{ranges:i}=this.coordinates;return[i[e],i[t]]}get computed_bounds(){const[e]=this.ranges,t=this.model.bounds,i=[e.min,e.max];if("auto"==t)return[e.min,e.max];{let e,s;const[n,o]=t,[r,a]=i,{min:l,max:c}=Math;return S(n-o)>S(r-a)?(e=c(l(n,o),r),s=l(c(n,o),a)):(e=l(n,o),s=c(n,o)),[e,s]}}get rule_coords(){const e=this.dimension,t=(e+1)%2,[i]=this.ranges,[s,n]=this.computed_bounds,o=[new Array(2),new Array(2)];return o[e][0]=Math.max(s,i.min),o[e][1]=Math.min(n,i.max),o[e][0]>o[e][1]&&(o[e][0]=o[e][1]=NaN),o[t][0]=this.loc,o[t][1]=this.loc,o}get tick_coords(){const e=this.dimension,t=(e+1)%2,[i]=this.ranges,[s,n]=this.computed_bounds,o=this.model.ticker.get_ticks(s,n,i,this.loc),r=o.major,a=o.minor,l=[[],[]],c=[[],[]],[h,_]=[i.min,i.max];for(let u=0;u<r.length;u++)r[u]<h||r[u]>_||(l[e].push(r[u]),l[t].push(this.loc));for(let u=0;u<a.length;u++)a[u]<h||a[u]>_||(c[e].push(a[u]),c[t].push(this.loc));return{major:l,minor:c}}get loc(){const{fixed_location:e}=this.model;if(null!=e){if((0,f.isNumber)(e))return e;const[,t]=this.ranges;if(t instanceof y.FactorRange)return t.synthetic(e);(0,w.unreachable)()}const[,t]=this.ranges;switch(this.panel.side){case"left":case"below":return t.start;case"right":case"above":return t.end}}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.layout.bbox.box})}remove(){var e;null===(e=this._axis_label_view)||void 0===e||e.remove();for(const t of this._major_label_views.values())t.remove();super.remove()}has_finished(){if(!super.has_finished())return!1;if(null!=this._axis_label_view&&!this._axis_label_view.has_finished())return!1;for(const e of this._major_label_views.values())if(!e.has_finished())return!1;return!0}}i.AxisView=T,T.__name__="AxisView";class C extends a.GuideRenderer{constructor(e){super(e)}}i.Axis=C,r=C,C.__name__="Axis",r.prototype.default_view=T,r.mixins([["axis_",_.Line],["major_tick_",_.Line],["minor_tick_",_.Line],["major_label_",_.Text],["axis_label_",_.Text]]),r.define((({Any:e,Int:t,Number:i,String:s,Ref:n,Dict:o,Tuple:r,Or:a,Nullable:_,Auto:d})=>({bounds:[a(r(i,i),d),"auto"],ticker:[n(l.Ticker)],formatter:[n(c.TickFormatter)],axis_label:[_(a(s,n(v.BaseText))),null],axis_label_standoff:[t,5],major_label_standoff:[t,5],major_label_orientation:[a(u.TickLabelOrientation,i),"horizontal"],major_label_overrides:[o(a(s,n(v.BaseText))),{}],major_label_policy:[n(h.LabelingPolicy),()=>new h.AllLabels],major_tick_in:[i,2],major_tick_out:[i,6],minor_tick_in:[i,0],minor_tick_out:[i,4],fixed_location:[_(a(i,e)),null]}))),r.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"11px",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"13px",axis_label_text_font_style:"italic"})},function(e,t,i,s,n){var o;s();const r=e(41);class a extends r.RendererView{}i.GuideRendererView=a,a.__name__="GuideRendererView";class l extends r.Renderer{constructor(e){super(e)}}i.GuideRenderer=l,o=l,l.__name__="GuideRenderer",o.override({level:"guide"})},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{constructor(e){super(e)}}i.Ticker=r,r.__name__="Ticker"},function(e,t,i,s,n){s();const o=e(53),r=e(120);class a extends o.Model{constructor(e){super(e)}format_graphics(e,t){return this.doFormat(e,t).map((e=>new r.TextBox({text:e})))}compute(e,t){return this.doFormat([e],null!=t?t:{loc:0})[0]}v_compute(e,t){return this.doFormat(e,null!=t?t:{loc:0})}}i.TickFormatter=a,a.__name__="TickFormatter"},function(e,t,i,s,n){var o,r;s();const a=e(53),l=e(13),c=e(34),h=e(8),_=e(24);class u extends a.Model{constructor(e){super(e)}}i.LabelingPolicy=u,u.__name__="LabelingPolicy";class d extends u{constructor(e){super(e)}filter(e,t,i){return e}}i.AllLabels=d,d.__name__="AllLabels";class p extends u{constructor(e){super(e)}filter(e,t,i){const{min_distance:s}=this;let n=null;for(const o of e)null!=n&&i(n,o)<s?e.unset(o):n=o;return e}}i.NoOverlap=p,o=p,p.__name__="NoOverlap",o.define((({Number:e})=>({min_distance:[e,5]})));class m extends u{constructor(e){super(e)}get names(){return(0,l.keys)(this.args)}get values(){return(0,l.values)(this.args)}get func(){const e=(0,c.use_strict)(this.code);return new _.GeneratorFunction("indices","bboxes","distance",...this.names,e)}filter(e,t,i){const s=Object.create(null),n=this.func.call(s,e,t,i,...this.values);let o=n.next();if(o.done&&void 0!==o.value){const{value:t}=o;return t instanceof _.Indices?t:void 0===t?e:(0,h.isIterable)(t)?_.Indices.from_indices(e.size,t):_.Indices.all_unset(e.size)}{const t=[];do{t.push(o.value),o=n.next()}while(!o.done);return _.Indices.from_indices(e.size,t)}}}i.CustomLabelingPolicy=m,r=m,m.__name__="CustomLabelingPolicy",r.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(42);class l extends a.View{}i.BaseTextView=l,l.__name__="BaseTextView";class c extends r.Model{constructor(e){super(e)}}i.BaseText=c,o=c,c.__name__="BaseText",o.define((({String:e})=>({text:[e]})))},function(e,t,i,s,n){s();const o=e(135),r=e(139),a=[{start:"$$",end:"$$",inline:!1},{start:"\\[",end:"\\]",inline:!1},{start:"\\(",end:"\\)",inline:!0}];i.parse_delimited_string=function(e){for(const t of a){const i=e.indexOf(t.start),s=i+t.start.length;if(0==i){const i=e.indexOf(t.end,s),n=i;if(i==e.length-t.end.length)return new o.TeX({text:e.slice(s,n),inline:t.inline});break}}return new r.PlainText({text:e})}},function(e,t,i,s,n){var o,r,a;s();const l=e(8),c=e(136),h=e(22),_=e(120),u=e(121),d=e(122),p=e(65),m=e(133),g=e(137);class f extends m.BaseTextView{constructor(){super(...arguments),this._position={sx:0,sy:0},this.align="left",this._x_anchor="left",this._y_anchor="center",this._base_font_size=13,this.font_size_scale=1,this.svg_image=null}graphics(){return this}infer_text_height(){return"ascent_descent"}set base_font_size(e){null!=e&&(this._base_font_size=e)}get base_font_size(){return this._base_font_size}get has_image_loaded(){return null!=this.svg_image}_rect(){const{width:e,height:t}=this._size(),{x:i,y:s}=this._computed_position();return new p.BBox({x:i,y:s,width:e,height:t}).rect}set position(e){this._position=e}get position(){return this._position}get text(){return this.model.text}get provider(){return g.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch(),"not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&await this.load_image()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(e){const t=e.color,i=e.alpha,s=e.font_style;let n=e.font_size;const o=e.font,{font_size_scale:r,_base_font_size:a}=this,l=(0,u.parse_css_font_size)(n);if(null!=l){let{value:e,unit:t}=l;e*=r,"em"==t&&a&&(e*=a,t="px"),n=`${e}${t}`}const c=`${s} ${n} ${o}`;this.font=c,this.color=(0,h.color2css)(t,i)}_computed_position(){const{width:e,height:t}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:o=this._y_anchor}=this.position;return{x:i-(()=>{if((0,l.isNumber)(n))return n*e;switch(n){case"left":return 0;case"center":return.5*e;case"right":return e}})(),y:s-(()=>{if((0,l.isNumber)(o))return o*t;switch(o){case"top":return 0;case"center":case"baseline":return.5*t;case"bottom":return t}})()}}size(){const{width:e,height:t}=this._size(),{angle:i}=this;if(i){const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(e*s+t*n),height:Math.abs(e*n+t*s)}}return{width:e,height:t}}get_text_dimensions(){return{width:(0,_.text_width)(this.model.text,this.font),height:(0,u.font_metrics)(this.font).height}}get_image_dimensions(){var e,t,i,s;const n=parseFloat(null!==(t=null===(e=this.svg_element.getAttribute("height"))||void 0===e?void 0:e.replace(/([A-z])/g,""))&&void 0!==t?t:"0"),o=parseFloat(null!==(s=null===(i=this.svg_element.getAttribute("width"))||void 0===i?void 0:i.replace(/([A-z])/g,""))&&void 0!==s?s:"0");return{width:(0,u.font_metrics)(this.font).x_height*o,height:(0,u.font_metrics)(this.font).x_height*n}}_size(){return this.has_image_loaded?this.get_image_dimensions():this.get_text_dimensions()}bbox(){const{p0:e,p1:t,p2:i,p3:s}=this.rect(),n=Math.min(e.x,t.x,i.x,s.x),o=Math.min(e.y,t.y,i.y,s.y),r=Math.max(e.x,t.x,i.x,s.x),a=Math.max(e.y,t.y,i.y,s.y);return new p.BBox({left:n,right:r,top:o,bottom:a})}rect(){const e=this._rect(),{angle:t}=this;if(t){const{sx:i,sy:s}=this.position,n=new d.AffineTransform;return n.translate(i,s),n.rotate(t),n.translate(-i,-s),n.apply_rect(e)}return e}paint_rect(e){const{p0:t,p1:i,p2:s,p3:n}=this.rect();e.save(),e.strokeStyle="red",e.lineWidth=1,e.beginPath();const{round:o}=Math;e.moveTo(o(t.x),o(t.y)),e.lineTo(o(i.x),o(i.y)),e.lineTo(o(s.x),o(s.y)),e.lineTo(o(n.x),o(n.y)),e.closePath(),e.stroke(),e.restore()}paint_bbox(e){const{x:t,y:i,width:s,height:n}=this.bbox();e.save(),e.strokeStyle="blue",e.lineWidth=1,e.beginPath();const{round:o}=Math;e.moveTo(o(t),o(i)),e.lineTo(o(t),o(i+n)),e.lineTo(o(t+s),o(i+n)),e.lineTo(o(t+s),o(i)),e.closePath(),e.stroke(),e.restore()}async load_image(){if(null==this.provider.MathJax)return null;const e=this._process_text(this.model.text);if(null==e)return this._has_finished=!0,null;const t=e.children[0];this.svg_element=t,t.setAttribute("font",this.font),t.setAttribute("stroke",this.color);const i=t.outerHTML,s=new Blob([i],{type:"image/svg+xml"}),n=URL.createObjectURL(s);try{this.svg_image=await(0,c.load_image)(n)}finally{URL.revokeObjectURL(n)}return this.parent.request_layout(),this.svg_image}paint(e){e.save();const{sx:t,sy:i}=this.position;this.angle&&(e.translate(t,i),e.rotate(this.angle),e.translate(-t,-i));const{x:s,y:n}=this._computed_position();if(null!=this.svg_image){const{width:t,height:i}=this.get_image_dimensions();e.drawImage(this.svg_image,s,n,t,i)}else e.fillStyle=this.color,e.font=this.font,e.textAlign="left",e.textBaseline="alphabetic",e.fillText(this.model.text,s,n+(0,u.font_metrics)(this.font).ascent);e.restore(),this._has_finished||"failed"!=this.provider.status&&!this.has_image_loaded||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}i.MathTextView=f,f.__name__="MathTextView";class b extends m.BaseText{constructor(e){super(e)}}i.MathText=b,b.__name__="MathText";class y extends f{_process_text(e){}}i.AsciiView=y,y.__name__="AsciiView";class v extends b{constructor(e){super(e)}}i.Ascii=v,o=v,v.__name__="Ascii",o.prototype.default_view=y;class x extends f{_process_text(e){var t;return null===(t=this.provider.MathJax)||void 0===t?void 0:t.mathml2svg(e.trim())}}i.MathMLView=x,x.__name__="MathMLView";class w extends b{constructor(e){super(e)}}i.MathML=w,r=w,w.__name__="MathML",r.prototype.default_view=x;class A extends f{_process_text(e){var t;return null===(t=this.provider.MathJax)||void 0===t?void 0:t.tex2svg(e,void 0,this.model.macros)}}i.TeXView=A,A.__name__="TeXView";class k extends b{constructor(e){super(e)}}i.TeX=k,a=k,k.__name__="TeX",a.prototype.default_view=A,a.define((({Boolean:e,Number:t,String:i,Dict:s,Tuple:n,Or:o})=>({macros:[s(o(i,n(i,t))),{}],inline:[e,!1]})))},function(e,t,i,s,n){s();const o=e(19);i.load_image=async function(e,t){return new r(e,t).promise};class r{constructor(e,t={}){this._image=new Image,this._finished=!1;const{attempts:i=1,timeout:s=1}=t;this.promise=new Promise(((n,r)=>{this._image.crossOrigin="anonymous";let a=0;this._image.onerror=()=>{if(++a==i){const s=`unable to load ${e} image after ${i} attempts`;if(o.logger.warn(s),null==this._image.crossOrigin)return void(null!=t.failed&&t.failed());o.logger.warn(`attempting to load ${e} without a cross origin policy`),this._image.crossOrigin=null,a=0}setTimeout((()=>this._image.src=e),s)},this._image.onload=()=>{this._finished=!0,null!=t.loaded&&t.loaded(this._image),n(this._image)},this._image.src=e}))}get finished(){return this._finished}get image(){if(this._finished)return this._image;throw new Error("not loaded yet")}}i.ImageLoader=r,r.__name__="ImageLoader"},function(e,t,i,s,n){var o=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&o(t,e,i);return r(t,e),t};s();const l=e(15),c=e(138);class h{constructor(){this.ready=new l.Signal0(this,"ready"),this.status="not_started"}}i.MathJaxProvider=h,h.__name__="MathJaxProvider";class _ extends h{get MathJax(){return null}async fetch(){this.status="failed"}}i.NoProvider=_,_.__name__="NoProvider";class u extends h{get MathJax(){return"undefined"!=typeof MathJax?MathJax:null}async fetch(){const e=document.createElement("script");e.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js",e.onload=()=>{this.status="loaded",this.ready.emit()},e.onerror=()=>{this.status="failed"},this.status="loading",document.head.appendChild(e)}}i.CDNProvider=u,u.__name__="CDNProvider";class d extends h{get MathJax(){return this._mathjax}async fetch(){this.status="loading";try{const t=await(0,c.load_module)(Promise.resolve().then((()=>a(e(519)))));this._mathjax=t,this.status="loaded",this.ready.emit()}catch(e){this.status="failed"}}}i.BundleProvider=d,d.__name__="BundleProvider",i.default_provider=new d},function(e,t,i,s,n){s(),i.load_module=async function(e){try{return await e}catch(e){if((t=e)instanceof Error&&"code"in t&&"MODULE_NOT_FOUND"===e.code)return null;throw e}var t}},function(e,t,i,s,n){var o;s();const r=e(133),a=e(120);class l extends r.BaseTextView{initialize(){super.initialize(),this._has_finished=!0}graphics(){return new a.TextBox({text:this.model.text})}}i.PlainTextView=l,l.__name__="PlainTextView";class c extends r.BaseText{constructor(e){super(e)}}i.PlainText=c,o=c,c.__name__="PlainText",o.prototype.default_view=l},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(128),l=e(141),c=e(142),h=(0,o.__importStar)(e(48)),_=e(20),u=e(120),d=e(8);class p extends a.AxisView{_paint(e,t,i){this._draw_group_separators(e,t,i)}_draw_group_separators(e,t,i){const[s]=this.ranges,[n,o]=this.computed_bounds;if(!s.tops||s.tops.length<2||!this.visuals.separator_line.doit)return;const r=this.dimension,a=(r+1)%2,l=[[],[]];let c=0;for(let _=0;_<s.tops.length-1;_++){let e,t;for(let n=c;n<s.factors.length;n++)if(s.factors[n][0]==s.tops[_+1]){[e,t]=[s.factors[n-1],s.factors[n]],c=n;break}const i=(s.synthetic(e)+s.synthetic(t))/2;i>n&&i<o&&(l[r].push(i),l[a].push(this.loc))}const h=this.extents.tick_label;this._draw_ticks(e,l,-3,h-6,this.visuals.separator_line)}_draw_major_labels(e,t,i){const s=this._get_factor_info();let n=t.tick+this.model.major_label_standoff;for(let o=0;o<s.length;o++){const[i,r,a,l]=s[o];this._draw_oriented_labels(e,i,r,a,this.panel.side,n,l),n+=t.tick_labels[o]}}_tick_label_extents(){const e=this._get_factor_info(),t=[];for(const[i,,s,n]of e){const e=this._oriented_labels_extent(i,s,this.model.major_label_standoff,n);t.push(e)}return t}_get_factor_info(){const[e]=this.ranges,[t,i]=this.computed_bounds,s=this.loc,n=this.model.ticker.get_ticks(t,i,e,s),o=this.tick_coords,r=[],a=e=>new u.GraphicsBoxes(e.map((e=>(0,d.isString)(e)?new u.TextBox({text:e}):e))),l=e=>a(this.model.formatter.doFormat(e,this));if(1==e.levels){const e=l(n.major);r.push([e,o.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==e.levels){const e=l(n.major.map((e=>e[1])));r.push([e,o.major,this.model.major_label_orientation,this.visuals.major_label_text]),r.push([a(n.tops),o.tops,this.model.group_label_orientation,this.visuals.group_text])}else if(3==e.levels){const e=l(n.major.map((e=>e[2]))),t=n.mids.map((e=>e[1]));r.push([e,o.major,this.model.major_label_orientation,this.visuals.major_label_text]),r.push([a(t),o.mids,this.model.subgroup_label_orientation,this.visuals.subgroup_text]),r.push([a(n.tops),o.tops,this.model.group_label_orientation,this.visuals.group_text])}return r}get tick_coords(){const e=this.dimension,t=(e+1)%2,[i]=this.ranges,[s,n]=this.computed_bounds,o=this.model.ticker.get_ticks(s,n,i,this.loc),r={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return r.major[e]=o.major,r.major[t]=o.major.map((()=>this.loc)),3==i.levels&&(r.mids[e]=o.mids,r.mids[t]=o.mids.map((()=>this.loc))),i.levels>1&&(r.tops[e]=o.tops,r.tops[t]=o.tops.map((()=>this.loc))),r}}i.CategoricalAxisView=p,p.__name__="CategoricalAxisView";class m extends a.Axis{constructor(e){super(e)}}i.CategoricalAxis=m,r=m,m.__name__="CategoricalAxis",r.prototype.default_view=p,r.mixins([["separator_",h.Line],["group_",h.Text],["subgroup_",h.Text]]),r.define((({Number:e,Or:t})=>({group_label_orientation:[t(_.TickLabelOrientation,e),"parallel"],subgroup_label_orientation:[t(_.TickLabelOrientation,e),"parallel"]}))),r.override({ticker:()=>new l.CategoricalTicker,formatter:()=>new c.CategoricalTickFormatter,separator_line_color:"lightgrey",separator_line_width:2,group_text_font_style:"bold",group_text_font_size:"11px",group_text_color:"grey",subgroup_text_font_style:"bold",subgroup_text_font_size:"11px"})},function(e,t,i,s,n){s();const o=e(130);class r extends o.Ticker{constructor(e){super(e)}get_ticks(e,t,i,s){var n,o;return{major:this._collect(i.factors,i,e,t),minor:[],tops:this._collect(null!==(n=i.tops)&&void 0!==n?n:[],i,e,t),mids:this._collect(null!==(o=i.mids)&&void 0!==o?o:[],i,e,t)}}_collect(e,t,i,s){const n=[];for(const o of e){const e=t.synthetic(o);e>i&&e<s&&n.push(o)}return n}}i.CategoricalTicker=r,r.__name__="CategoricalTicker"},function(e,t,i,s,n){s();const o=e(131),r=e(9);class a extends o.TickFormatter{constructor(e){super(e)}doFormat(e,t){return(0,r.copy)(e)}}i.CategoricalTickFormatter=a,a.__name__="CategoricalTickFormatter"},function(e,t,i,s,n){s();const o=e(128);class r extends o.AxisView{}i.ContinuousAxisView=r,r.__name__="ContinuousAxisView";class a extends o.Axis{constructor(e){super(e)}}i.ContinuousAxis=a,a.__name__="ContinuousAxis"},function(e,t,i,s,n){var o;s();const r=e(145),a=e(150),l=e(155);class c extends r.LinearAxisView{}i.DatetimeAxisView=c,c.__name__="DatetimeAxisView";class h extends r.LinearAxis{constructor(e){super(e)}}i.DatetimeAxis=h,o=h,h.__name__="DatetimeAxis",o.prototype.default_view=c,o.override({ticker:()=>new l.DatetimeTicker,formatter:()=>new a.DatetimeTickFormatter})},function(e,t,i,s,n){var o;s();const r=e(143),a=e(146),l=e(147);class c extends r.ContinuousAxisView{}i.LinearAxisView=c,c.__name__="LinearAxisView";class h extends r.ContinuousAxis{constructor(e){super(e)}}i.LinearAxis=h,o=h,h.__name__="LinearAxis",o.prototype.default_view=c,o.override({ticker:()=>new l.BasicTicker,formatter:()=>new a.BasicTickFormatter})},function(e,t,i,s,n){var o;s();const r=e(131),a=e(34);function l(e){let t="";for(const i of e)t+="-"==i?"\u2212":i;return t}i.unicode_replace=l;class c extends r.TickFormatter{constructor(e){super(e),this.last_precision=3}get scientific_limit_low(){return 10**this.power_limit_low}get scientific_limit_high(){return 10**this.power_limit_high}_need_sci(e){if(!this.use_scientific)return!1;const{scientific_limit_high:t}=this,{scientific_limit_low:i}=this,s=e.length<2?0:Math.abs(e[1]-e[0])/1e4;for(const n of e){const e=Math.abs(n);if(!(e<=s)&&(e>=t||e<=i))return!0}return!1}_format_with_precision(e,t,i){return t?e.map((e=>l(e.toExponential(i)))):e.map((e=>l((0,a.to_fixed)(e,i))))}_auto_precision(e,t){const i=new Array(e.length),s=this.last_precision<=15;e:for(let n=this.last_precision;s?n<=15:n>=1;s?n++:n--){if(t){i[0]=e[0].toExponential(n);for(let t=1;t<e.length;t++)if(i[t]==i[t-1])continue e;this.last_precision=n;break}i[0]=(0,a.to_fixed)(e[0],n);for(let t=1;t<e.length;t++)if(i[t]=(0,a.to_fixed)(e[t],n),i[t]==i[t-1])continue e;this.last_precision=n;break}return this.last_precision}doFormat(e,t){if(0==e.length)return[];const i=this._need_sci(e),s="auto"==this.precision?this._auto_precision(e,i):this.precision;return this._format_with_precision(e,i,s)}}i.BasicTickFormatter=c,o=c,c.__name__="BasicTickFormatter",o.define((({Boolean:e,Int:t,Auto:i,Or:s})=>({precision:[s(t,i),"auto"],use_scientific:[e,!0],power_limit_high:[t,5],power_limit_low:[t,-3]})))},function(e,t,i,s,n){s();const o=e(148);class r extends o.AdaptiveTicker{constructor(e){super(e)}}i.BasicTicker=r,r.__name__="BasicTicker"},function(e,t,i,s,n){var o;s();const r=e(149),a=e(9),l=e(10);class c extends r.ContinuousTicker{constructor(e){super(e)}get_min_interval(){return this.min_interval}get_max_interval(){var e;return null!==(e=this.max_interval)&&void 0!==e?e:1/0}initialize(){super.initialize();const e=(0,a.nth)(this.mantissas,-1)/this.base,t=(0,a.nth)(this.mantissas,0)*this.base;this.extended_mantissas=[e,...this.mantissas,t],this.base_factor=0===this.get_min_interval()?1:this.get_min_interval()}get_interval(e,t,i){const s=t-e,n=this.get_ideal_interval(e,t,i),o=Math.floor((0,l.log)(n/this.base_factor,this.base)),r=this.base**o*this.base_factor,c=this.extended_mantissas,h=c.map((e=>Math.abs(i-s/(e*r)))),_=c[(0,a.argmin)(h)]*r;return(0,l.clamp)(_,this.get_min_interval(),this.get_max_interval())}}i.AdaptiveTicker=c,o=c,c.__name__="AdaptiveTicker",o.define((({Number:e,Array:t,Nullable:i})=>({base:[e,10],mantissas:[t(e),[1,2,5]],min_interval:[e,0],max_interval:[i(e),null]})))},function(e,t,i,s,n){var o;s();const r=e(130),a=e(9);class l extends r.Ticker{constructor(e){super(e)}get_ticks(e,t,i,s){return this.get_ticks_no_defaults(e,t,s,this.desired_num_ticks)}get_ticks_no_defaults(e,t,i,s){const n=this.get_interval(e,t,s),o=Math.floor(e/n),r=Math.ceil(t/n);let l;l=isFinite(o)&&isFinite(r)?(0,a.range)(o,r+1):[];const c=l.map((e=>e*n)).filter((i=>e<=i&&i<=t)),h=this.num_minor_ticks,_=[];if(h>0&&c.length>0){const i=n/h,s=(0,a.range)(0,h).map((e=>e*i));for(const n of s.slice(1)){const i=c[0]-n;e<=i&&i<=t&&_.push(i)}for(const n of c)for(const i of s){const s=n+i;e<=s&&s<=t&&_.push(s)}}return{major:c,minor:_}}get_ideal_interval(e,t,i){return(t-e)/i}}i.ContinuousTicker=l,o=l,l.__name__="ContinuousTicker",o.define((({Int:e})=>({num_minor_ticks:[e,5],desired_num_ticks:[e,6]})))},function(e,t,i,s,n){var o;s();const r=(0,e(1).__importDefault)(e(151)),a=e(131),l=e(19),c=e(152),h=e(9),_=e(8);function u(e){return(0,r.default)(e,"%Y %m %d %H %M %S").split(/\s+/).map((e=>parseInt(e,10)))}function d(e,t){if((0,_.isFunction)(t))return t(e);{const i=(0,c.sprintf)("$1%06d",function(e){return Math.round(e/1e3%1*1e6)}(e));return-1==(t=t.replace(/((^|[^%])(%%)*)%f/,i)).indexOf("%")?t:(0,r.default)(e,t)}}const p=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"];class m extends a.TickFormatter{constructor(e){super(e),this.strip_leading_zeros=!0}initialize(){super.initialize(),this._update_width_formats()}_update_width_formats(){const e=+(0,r.default)(new Date),t=function(t){const i=t.map((t=>d(e,t).length)),s=(0,h.sort_by)((0,h.zip)(i,t),(([e])=>e));return(0,h.unzip)(s)};this._width_formats={microseconds:t(this.microseconds),milliseconds:t(this.milliseconds),seconds:t(this.seconds),minsec:t(this.minsec),minutes:t(this.minutes),hourmin:t(this.hourmin),hours:t(this.hours),days:t(this.days),months:t(this.months),years:t(this.years)}}_get_resolution_str(e,t){const i=1.1*e;switch(!1){case!(i<.001):return"microseconds";case!(i<1):return"milliseconds";case!(i<60):return t>=60?"minsec":"seconds";case!(i<3600):return t>=3600?"hourmin":"minutes";case!(i<86400):return"hours";case!(i<2678400):return"days";case!(i<31536e3):return"months";default:return"years"}}doFormat(e,t){if(0==e.length)return[];const i=Math.abs(e[e.length-1]-e[0])/1e3,s=i/(e.length-1),n=this._get_resolution_str(s,i),[,[o]]=this._width_formats[n],r=[],a=p.indexOf(n),c={};for(const l of p)c[l]=0;c.seconds=5,c.minsec=4,c.minutes=4,c.hourmin=3,c.hours=3;for(const h of e){let t,i;try{i=u(h),t=d(h,o)}catch(e){l.logger.warn(`unable to format tick for timestamp value ${h}`),l.logger.warn(` - ${e}`),r.push("ERR");continue}let s=!1,_=a;for(;0==i[c[p[_]]];){let e;if(_+=1,_==p.length)break;if(("minsec"==n||"hourmin"==n)&&!s){if("minsec"==n&&0==i[4]&&0!=i[5]||"hourmin"==n&&0==i[3]&&0!=i[4]){e=this._width_formats[p[a-1]][1][0],t=d(h,e);break}s=!0}e=this._width_formats[p[_]][1][0],t=d(h,e)}if(this.strip_leading_zeros){let e=t.replace(/^0+/g,"");e!=t&&isNaN(parseInt(e))&&(e=`0${e}`),r.push(e)}else r.push(t)}return r}}i.DatetimeTickFormatter=m,o=m,m.__name__="DatetimeTickFormatter",o.define((({String:e,Array:t})=>({microseconds:[t(e),["%fus"]],milliseconds:[t(e),["%3Nms","%S.%3Ns"]],seconds:[t(e),["%Ss"]],minsec:[t(e),[":%M:%S"]],minutes:[t(e),[":%M","%Mm"]],hourmin:[t(e),["%H:%M"]],hours:[t(e),["%Hh","%H:%M"]],days:[t(e),["%m/%d","%a%d"]],months:[t(e),["%m/%Y","%b %Y"]],years:[t(e),["%Y"]]})))},function(e,t,i,s,n){!function(e){"object"==typeof t&&t.exports?t.exports=e():"function"==typeof define?define(e):this.tz=e()}((function(){function e(e,t,i){var s,n=t.day[1];do{s=new Date(Date.UTC(i,t.month,Math.abs(n++)))}while(t.day[0]<7&&s.getUTCDay()!=t.day[0]);return(s={clock:t.clock,sort:s.getTime(),rule:t,save:6e4*t.save,offset:e.offset})[s.clock]=s.sort+6e4*t.time,s.posix?s.wallclock=s[s.clock]+(e.offset+t.saved):s.posix=s[s.clock]-(e.offset+t.saved),s}function t(t,i,s){var n,o,r,a,l,c,h,_=t[t.zone],u=[],d=new Date(s).getUTCFullYear(),p=1;for(n=1,o=_.length;n<o&&!(_[n][i]<=s);n++);if((r=_[n]).rules){for(c=t[r.rules],h=d+1;h>=d-p;--h)for(n=0,o=c.length;n<o;n++)c[n].from<=h&&h<=c[n].to?u.push(e(r,c[n],h)):c[n].to<h&&1==p&&(p=h-c[n].to);for(u.sort((function(e,t){return e.sort-t.sort})),n=0,o=u.length;n<o;n++)s>=u[n][i]&&u[n][u[n].clock]>r[u[n].clock]&&(a=u[n])}return a&&((l=/^(.*)\/(.*)$/.exec(r.format))?a.abbrev=l[a.save?2:1]:a.abbrev=r.format.replace(/%s/,a.rule.letter)),a||r}function i(e,i){return"UTC"==e.zone?i:(e.entry=t(e,"posix",i),i+e.entry.offset+e.entry.save)}function s(e,i){return"UTC"==e.zone?i:(e.entry=s=t(e,"wallclock",i),0<(n=i-s.wallclock)&&n<s.save?null:i-s.offset-s.save);var s,n}function n(e,t,n){var o,a=+(n[1]+1),c=n[2]*a,h=r.indexOf(n[3].toLowerCase());if(h>9)t+=c*l[h-10];else{if(o=new Date(i(e,t)),h<7)for(;c;)o.setUTCDate(o.getUTCDate()+a),o.getUTCDay()==h&&(c-=a);else 7==h?o.setUTCFullYear(o.getUTCFullYear()+c):8==h?o.setUTCMonth(o.getUTCMonth()+c):o.setUTCDate(o.getUTCDate()+c);null==(t=s(e,o.getTime()))&&(t=s(e,o.getTime()+864e5*a)-864e5*a)}return t}var o={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(e,t,i,s){var n,o,r=this.entry.offset+this.entry.save,a=Math.abs(r/1e3),l=[],c=3600;for(n=0;n<3;n++)l.push(("0"+Math.floor(a/c)).slice(-2)),a%=c,c/=60;return"^"!=i||r?("^"==i&&(s=3),3==s?(o=(o=l.join(":")).replace(/:00$/,""),"^"!=i&&(o=o.replace(/:00$/,""))):s?(o=l.slice(0,s+1).join(":"),"^"==i&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(o=(r<0?"-":"+")+o).replace(/([-+])(0)/,{_:" $1","-":"$1"}[i]||"$1$2")):"Z"},"%":function(e){return"%"},n:function(e){return"\n"},t:function(e){return"\t"},U:function(e){return c(e,0)},W:function(e){return c(e,1)},V:function(e){return h(e)[0]},G:function(e){return h(e)[1]},g:function(e){return h(e)[1]%100},j:function(e){return Math.floor((e.getTime()-Date.UTC(e.getUTCFullYear(),0))/864e5)+1},s:function(e){return Math.floor(e.getTime()/1e3)},C:function(e){return Math.floor(e.getUTCFullYear()/100)},N:function(e){return e.getTime()%1e3*1e6},m:function(e){return e.getUTCMonth()+1},Y:function(e){return e.getUTCFullYear()},y:function(e){return e.getUTCFullYear()%100},H:function(e){return e.getUTCHours()},M:function(e){return e.getUTCMinutes()},S:function(e){return e.getUTCSeconds()},e:function(e){return e.getUTCDate()},d:function(e){return e.getUTCDate()},u:function(e){return e.getUTCDay()||7},w:function(e){return e.getUTCDay()},l:function(e){return e.getUTCHours()%12||12},I:function(e){return e.getUTCHours()%12||12},k:function(e){return e.getUTCHours()},Z:function(e){return this.entry.abbrev},a:function(e){return this[this.locale].day.abbrev[e.getUTCDay()]},A:function(e){return this[this.locale].day.full[e.getUTCDay()]},h:function(e){return this[this.locale].month.abbrev[e.getUTCMonth()]},b:function(e){return this[this.locale].month.abbrev[e.getUTCMonth()]},B:function(e){return this[this.locale].month.full[e.getUTCMonth()]},P:function(e){return this[this.locale].meridiem[Math.floor(e.getUTCHours()/12)].toLowerCase()},p:function(e){return this[this.locale].meridiem[Math.floor(e.getUTCHours()/12)]},R:function(e,t){return this.convert([t,"%H:%M"])},T:function(e,t){return this.convert([t,"%H:%M:%S"])},D:function(e,t){return this.convert([t,"%m/%d/%y"])},F:function(e,t){return this.convert([t,"%Y-%m-%d"])},x:function(e,t){return this.convert([t,this[this.locale].date])},r:function(e,t){return this.convert([t,this[this.locale].time12||"%I:%M:%S"])},X:function(e,t){return this.convert([t,this[this.locale].time24])},c:function(e,t){return this.convert([t,this[this.locale].dateTime])},convert:function(e){if(!e.length)return"1.0.23";var t,o,r,l,c,h=Object.create(this),_=[];for(t=0;t<e.length;t++)if(l=e[t],Array.isArray(l))t||isNaN(l[1])?l.splice.apply(e,[t--,1].concat(l)):c=l;else if(isNaN(l)){if("string"==(r=typeof l))~l.indexOf("%")?h.format=l:t||"*"!=l?!t&&(r=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(l))?((c=[]).push.apply(c,r.slice(1,8)),r[9]?(c.push(r[10]+1),c.push.apply(c,r[11].split(/:/))):r[8]&&c.push(1)):/^\w{2,3}_\w{2}$/.test(l)?h.locale=l:(r=a.exec(l))?_.push(r):h.zone=l:c=l;else if("function"==r){if(r=l.call(h))return r}else if(/^\w{2,3}_\w{2}$/.test(l.name))h[l.name]=l;else if(l.zones){for(r in l.zones)h[r]=l.zones[r];for(r in l.rules)h[r]=l.rules[r]}}else t||(c=l);if(h[h.locale]||delete h.locale,h[h.zone]||delete h.zone,null!=c){if("*"==c)c=h.clock();else if(Array.isArray(c)){for(r=[],o=!c[7],t=0;t<11;t++)r[t]=+(c[t]||0);--r[1],c=Date.UTC.apply(Date.UTC,r)+-r[7]*(36e5*r[8]+6e4*r[9]+1e3*r[10])}else c=Math.floor(c);if(!isNaN(c)){if(o&&(c=s(h,c)),null==c)return c;for(t=0,o=_.length;t<o;t++)c=n(h,c,_[t]);return h.format?(r=new Date(i(h,c)),h.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,(function(e,t,i,s,n){var o,a,l="0";if(o=h[n]){for(e=String(o.call(h,r,c,t,i.length)),"_"==(t||o.style)&&(l=" "),a="-"==t?0:o.pad||0;e.length<a;)e=l+e;for(a="-"==t?0:s||o.pad;e.length<a;)e=l+e;"N"==n&&a<e.length&&(e=e.slice(0,a)),"^"==t&&(e=e.toUpperCase())}return e}))):c}}return function(){return h.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("|")}}},r="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",a=new RegExp("^\\s*([+-])(\\d+)\\s+("+r+")s?\\s*$","i"),l=[36e5,6e4,1e3,1];function c(e,t){var i,s,n;return s=new Date(Date.UTC(e.getUTCFullYear(),0)),i=Math.floor((e.getTime()-s.getTime())/864e5),s.getUTCDay()==t?n=0:8==(n=7-s.getUTCDay()+t)&&(n=1),i>=n?Math.floor((i-n)/7)+1:0}function h(e){var t,i,s;return i=e.getUTCFullYear(),t=new Date(Date.UTC(i,0)).getUTCDay(),(s=c(e,1)+(t>1&&t<=4?1:0))?53!=s||4==t||3==t&&29==new Date(i,1,29).getDate()?[s,e.getUTCFullYear()]:[1,e.getUTCFullYear()+1]:(i=e.getUTCFullYear()-1,[s=4==(t=new Date(Date.UTC(i,0)).getUTCDay())||3==t&&29==new Date(i,1,29).getDate()?53:52,e.getUTCFullYear()-1])}return r=r.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,(function(e){o[e].pad=2})),o.N.pad=9,o.j.pad=3,o.k.style="_",o.l.style="_",o.e.style="_",function(){return o.convert(arguments)}}))},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importStar)(e(153)),a=e(154),l=(0,o.__importDefault)(e(151)),c=e(21),h=e(8);function _(e,...t){return(0,a.sprintf)(e,...t)}function u(e,t,i){return(0,h.isNumber)(e)?_((()=>{switch(!1){case Math.floor(e)!=e:return"%d";case!(Math.abs(e)>.1&&Math.abs(e)<1e3):return"%0.3f";default:return"%0.3e"}})(),e):`${e}`}function d(e,t,s){if(null==t)return u;if(null!=s&&e in s){const t=s[e];if((0,h.isString)(t)){if(t in i.DEFAULT_FORMATTERS)return i.DEFAULT_FORMATTERS[t];throw new Error(`Unknown tooltip field formatter type '${t}'`)}return function(e,i,s){return t.format(e,i,s)}}return i.DEFAULT_FORMATTERS.numeral}function p(e,t,i){const s=t.get_column(e);if(null==s)return null;if((0,h.isNumber)(i))return s[i];const n=s[i.index];return(0,h.isTypedArray)(n)||(0,h.isArray)(n)?(0,h.isArray)(n[0])?n[i.dim2][i.dim1]:n[i.flat_index]:n}function m(e,t,i,s){return"$"==e[0]?function(e,t){if(e in t)return t[e];throw new Error(`Unknown special variable '$${e}'`)}(e.substring(1),s):p(e.substring(1).replace(/[{}]/g,""),t,i)}i.FormatterType=(0,c.Enum)("numeral","printf","datetime"),i.DEFAULT_FORMATTERS={numeral:(e,t,i)=>r.format(e,t),datetime:(e,t,i)=>(0,l.default)(e,t),printf:(e,t,i)=>_(t,e)},i.sprintf=_,i.basic_formatter=u,i.get_formatter=d,i._get_column_value=p,i.get_value=m,i.replace_placeholders=function(e,t,i,s,n={},o){let r,a;return(0,h.isString)(e)?(r=e,a=!1):(r=e.html,a=!0),r=r.replace(/@\$name/g,(e=>`@{${n.name}}`)),r=r.replace(/((?:\$\w+)|(?:@\w+)|(?:@{(?:[^{}]+)}))(?:{([^{}]+)})?/g,((e,r,l)=>{const c=m(r,t,i,n);if(null==c)return o?o("???"):"???";if("safe"==l)return a=!0,`${c}`;const h=`${d(r,l,s)(c,l,n)}`;return o?o(h):h})),a?[...(new DOMParser).parseFromString(r,"text/html").body.childNodes]:r}},function(e,t,i,s,n){var o,r={},a=r,l="en-US",c=null,h="0,0";function _(e){this._value=e}function u(e){var t,i="";for(t=0;t<e;t++)i+="0";return i}function d(e,t,i,s){var n,o,r=Math.pow(10,t);return o=e.toFixed(0).search("e")>-1?function(e,t){var i,s,n,o;return i=(o=e.toString()).split("e")[0],n=o.split("e")[1],o=i.split(".")[0]+(s=i.split(".")[1]||"")+u(n-s.length),t>0&&(o+="."+u(t)),o}(e,t):(i(e*r)/r).toFixed(t),s&&(n=new RegExp("0{1,"+s+"}$"),o=o.replace(n,"")),o}function p(e,t,i,s){var n,o,a,h,_,u,p,m,g,f,b,y,v,x,w,A,k,S=!1,T=!1,C=!1,M="",z=!1,E=!1,R=!1,B=!1,N=!1,O="",D="",I=Math.abs(e),P=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],V=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],L="",j=!1,U=!1;if(0===e&&null!==c)return c;if(!isFinite(e))return""+e;if(0===t.indexOf("{")){var F=t.indexOf("}");if(-1===F)throw Error('Format should also contain a "}"');y=t.slice(1,F),t=t.slice(F+1)}else y="";if(t.indexOf("}")===t.length-1){var G=t.indexOf("{");if(-1===G)throw Error('Format should also contain a "{"');v=t.slice(G+1,-1),t=t.slice(0,G+1)}else v="";if(A=null===(k=-1===t.indexOf(".")?t.match(/([0-9]+).*/):t.match(/([0-9]+)\..*/))?-1:k[1].length,-1!==t.indexOf("-")&&(j=!0),t.indexOf("(")>-1?(S=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(T=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1){if(f=t.split(".")[0].match(/[0-9]+/g)||["0"],f=parseInt(f[0],10),z=t.indexOf("aK")>=0,E=t.indexOf("aM")>=0,R=t.indexOf("aB")>=0,B=t.indexOf("aT")>=0,N=z||E||R||B,t.indexOf(" a")>-1?(M=" ",t=t.replace(" a","")):t=t.replace("a",""),p=0===(p=(_=Math.floor(Math.log(I)/Math.LN10)+1)%3)?3:p,f&&0!==I&&(u=Math.floor(Math.log(I)/Math.LN10)+1-f,m=3*~~((Math.min(f,_)-p)/3),I/=Math.pow(10,m),-1===t.indexOf(".")&&f>3))for(t+="[.]",w=(w=0===u?0:3*~~(u/3)-u)<0?w+3:w,n=0;n<w;n++)t+="0";Math.floor(Math.log(Math.abs(e))/Math.LN10)+1!==f&&(I>=Math.pow(10,12)&&!N||B?(M+=r[l].abbreviations.trillion,e/=Math.pow(10,12)):I<Math.pow(10,12)&&I>=Math.pow(10,9)&&!N||R?(M+=r[l].abbreviations.billion,e/=Math.pow(10,9)):I<Math.pow(10,9)&&I>=Math.pow(10,6)&&!N||E?(M+=r[l].abbreviations.million,e/=Math.pow(10,6)):(I<Math.pow(10,6)&&I>=Math.pow(10,3)&&!N||z)&&(M+=r[l].abbreviations.thousand,e/=Math.pow(10,3)))}if(t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(O=" ",t=t.replace(" b","")):t=t.replace("b",""),h=0;h<=P.length;h++)if(o=Math.pow(1024,h),a=Math.pow(1024,h+1),e>=o&&e<a){O+=P[h],o>0&&(e/=o);break}if(t.indexOf("d")>-1)for(t.indexOf(" d")>-1?(O=" ",t=t.replace(" d","")):t=t.replace("d",""),h=0;h<=V.length;h++)if(o=Math.pow(1e3,h),a=Math.pow(1e3,h+1),e>=o&&e<a){O+=V[h],o>0&&(e/=o);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(D=" ",t=t.replace(" o","")):t=t.replace("o",""),r[l].ordinal&&(D+=r[l].ordinal(e))),t.indexOf("[.]")>-1&&(C=!0,t=t.replace("[.]",".")),g=e.toString().split(".")[0],b=t.split(".")[1],x=t.indexOf(","),b?(g=(L=-1!==b.indexOf("*")?d(e,e.toString().split(".")[1].length,i):b.indexOf("[")>-1?d(e,(b=(b=b.replace("]","")).split("["))[0].length+b[1].length,i,b[1].length):d(e,b.length,i)).split(".")[0],L=L.split(".")[1].length?(s?M+s:r[l].delimiters.decimal)+L.split(".")[1]:"",C&&0===Number(L.slice(1))&&(L="")):g=d(e,null,i),g.indexOf("-")>-1&&(g=g.slice(1),U=!0),g.length<A&&(g=new Array(A-g.length+1).join("0")+g),x>-1&&(g=g.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+r[l].delimiters.thousands)),0===t.indexOf(".")&&(g=""),y+(t.indexOf("(")<t.indexOf("-")?(S&&U?"(":"")+(j&&U||!S&&U?"-":""):(j&&U||!S&&U?"-":"")+(S&&U?"(":""))+(!U&&T&&0!==e?"+":"")+g+L+(D||"")+(M&&!s?M:"")+(O||"")+(S&&U?")":"")+v}function m(e,t){r[e]=t}function g(e){l=e;var t=r[e].defaults;t&&t.format&&o.defaultFormat(t.format),t&&t.currencyFormat&&o.defaultCurrencyFormat(t.currencyFormat)}void 0!==t&&t.exports,(o=function(e){return o.isNumbro(e)?e=e.value():0===e||void 0===e?e=0:Number(e)||(e=o.fn.unformat(e)),new _(Number(e))}).version="1.6.2",o.isNumbro=function(e){return e instanceof _},o.setLanguage=function(e,t){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var i=e,s=e.split("-")[0],n=null;a[i]||(Object.keys(a).forEach((function(e){n||e.split("-")[0]!==s||(n=e)})),i=n||t||"en-US"),g(i)},o.setCulture=function(e,t){var i=e,s=e.split("-")[1],n=null;r[i]||(s&&Object.keys(r).forEach((function(e){n||e.split("-")[1]!==s||(n=e)})),i=n||t||"en-US"),g(i)},o.language=function(e,t){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!e)return l;if(e&&!t){if(!a[e])throw new Error("Unknown language : "+e);g(e)}return!t&&a[e]||m(e,t),o},o.culture=function(e,t){if(!e)return l;if(e&&!t){if(!r[e])throw new Error("Unknown culture : "+e);g(e)}return!t&&r[e]||m(e,t),o},o.languageData=function(e){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!e)return a[l];if(!a[e])throw new Error("Unknown language : "+e);return a[e]},o.cultureData=function(e){if(!e)return r[l];if(!r[e])throw new Error("Unknown culture : "+e);return r[e]},o.culture("en-US",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}}),o.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),a},o.cultures=function(){return r},o.zeroFormat=function(e){c="string"==typeof e?e:null},o.defaultFormat=function(e){h="string"==typeof e?e:"0.0"},o.defaultCurrencyFormat=function(e){},o.validate=function(e,t){var i,s,n,r,a,l,c,h;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numbro.js: Value is not string. It has been co-erced to: ",e)),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{c=o.cultureData(t)}catch(e){c=o.cultureData(o.culture())}return n=c.currency.symbol,a=c.abbreviations,i=c.delimiters.decimal,s="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(h=e.match(/^[^\d]+/))||(e=e.substr(1),h[0]===n))&&(null===(h=e.match(/[^\d]+$/))||(e=e.slice(0,-1),h[0]===a.thousand||h[0]===a.million||h[0]===a.billion||h[0]===a.trillion))&&(l=new RegExp(s+"{2}"),!e.match(/[^\d.,]/g)&&!((r=e.split(i)).length>2)&&(r.length<2?!!r[0].match(/^\d+.*\d$/)&&!r[0].match(l):1===r[0].length?!!r[0].match(/^\d+$/)&&!r[0].match(l)&&!!r[1].match(/^\d+$/):!!r[0].match(/^\d+.*\d$/)&&!r[0].match(l)&&!!r[1].match(/^\d+$/)))},t.exports={format:function(e,t,i,s){return null!=i&&i!==o.culture()&&o.setCulture(i),function(e,t,i){var s;return s=t.indexOf("$")>-1?function(e,t,i){var s,n,o=t,a=o.indexOf("$"),c=o.indexOf("("),h=o.indexOf("+"),_=o.indexOf("-"),u="",d="";if(-1===o.indexOf("$")?"infix"===r[l].currency.position?(d=r[l].currency.symbol,r[l].currency.spaceSeparated&&(d=" "+d+" ")):r[l].currency.spaceSeparated&&(u=" "):o.indexOf(" $")>-1?(u=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(u=" ",o=o.replace("$ ","")):o=o.replace("$",""),n=p(e,o,i,d),-1===t.indexOf("$"))switch(r[l].currency.position){case"postfix":n.indexOf(")")>-1?((n=n.split("")).splice(-1,0,u+r[l].currency.symbol),n=n.join("")):n=n+u+r[l].currency.symbol;break;case"infix":break;case"prefix":n.indexOf("(")>-1||n.indexOf("-")>-1?(n=n.split(""),s=Math.max(c,_)+1,n.splice(s,0,r[l].currency.symbol+u),n=n.join("")):n=r[l].currency.symbol+u+n;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else a<=1?n.indexOf("(")>-1||n.indexOf("+")>-1||n.indexOf("-")>-1?(s=1,(a<c||a<h||a<_)&&(s=0),(n=n.split("")).splice(s,0,r[l].currency.symbol+u),n=n.join("")):n=r[l].currency.symbol+u+n:n.indexOf(")")>-1?((n=n.split("")).splice(-1,0,u+r[l].currency.symbol),n=n.join("")):n=n+u+r[l].currency.symbol;return n}(e,t,i):t.indexOf("%")>-1?function(e,t,i){var s,n="";return e*=100,t.indexOf(" %")>-1?(n=" ",t=t.replace(" %","")):t=t.replace("%",""),(s=p(e,t,i)).indexOf(")")>-1?((s=s.split("")).splice(-1,0,n+"%"),s=s.join("")):s=s+n+"%",s}(e,t,i):t.indexOf(":")>-1?function(e){var t=Math.floor(e/60/60),i=Math.floor((e-60*t*60)/60),s=Math.round(e-60*t*60-60*i);return t+":"+(i<10?"0"+i:i)+":"+(s<10?"0"+s:s)}(e):p(e,t,i),s}(Number(e),null!=t?t:h,null==s?Math.round:s)}}},function(e,t,s,n,o){!function(){var e={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:/^[+-]/};function t(e){return o(a(e),arguments)}function n(e,i){return t.apply(null,[e].concat(i||[]))}function o(i,s){var n,o,r,a,l,c,h,_,u,d=1,p=i.length,m="";for(o=0;o<p;o++)if("string"==typeof i[o])m+=i[o];else if("object"==typeof i[o]){if((a=i[o]).keys)for(n=s[d],r=0;r<a.keys.length;r++){if(null==n)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[r],a.keys[r-1]));n=n[a.keys[r]]}else n=a.param_no?s[a.param_no]:s[d++];if(e.not_type.test(a.type)&&e.not_primitive.test(a.type)&&n instanceof Function&&(n=n()),e.numeric_arg.test(a.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(t("[sprintf] expecting number but found %T",n));switch(e.number.test(a.type)&&(_=n>=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}e.json.test(a.type)?m+=n:(!e.number.test(a.type)||_&&!a.sign?u="":(u=_?"+":"-",n=n.toString().replace(e.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",h=a.width-(u+n).length,l=a.width&&h>0?c.repeat(h):"",m+=a.align?u+n+l:"0"===c?u+l+n:l+u+n)}return m}var r=Object.create(null);function a(t){if(r[t])return r[t];for(var i,s=t,n=[],o=0;s;){if(null!==(i=e.text.exec(s)))n.push(i[0]);else if(null!==(i=e.modulo.exec(s)))n.push("%");else{if(null===(i=e.placeholder.exec(s)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){o|=1;var a=[],l=i[2],c=[];if(null===(c=e.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=e.key_access.exec(l)))a.push(c[1]);else{if(null===(c=e.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(c[1])}i[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:i[0],param_no:i[1],keys:i[2],sign:i[3],pad_char:i[4],align:i[5],width:i[6],precision:i[7],type:i[8]})}s=s.substring(i[0].length)}return r[t]=n}void 0!==s&&(s.sprintf=t,s.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=n,"function"==typeof define&&i.amdO&&define((function(){return{sprintf:t,vsprintf:n}})))}()},function(e,t,i,s,n){var o;s();const r=e(9),a=e(148),l=e(156),c=e(157),h=e(160),_=e(161),u=e(159);class d extends l.CompositeTicker{constructor(e){super(e)}}i.DatetimeTicker=d,o=d,d.__name__="DatetimeTicker",o.override({num_minor_ticks:0,tickers:()=>[new a.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*u.ONE_MILLI,num_minor_ticks:0}),new a.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:u.ONE_SECOND,max_interval:30*u.ONE_MINUTE,num_minor_ticks:0}),new a.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:u.ONE_HOUR,max_interval:12*u.ONE_HOUR,num_minor_ticks:0}),new c.DaysTicker({days:(0,r.range)(1,32)}),new c.DaysTicker({days:(0,r.range)(1,31,3)}),new c.DaysTicker({days:[1,8,15,22]}),new c.DaysTicker({days:[1,15]}),new h.MonthsTicker({months:(0,r.range)(0,12,1)}),new h.MonthsTicker({months:(0,r.range)(0,12,2)}),new h.MonthsTicker({months:(0,r.range)(0,12,4)}),new h.MonthsTicker({months:(0,r.range)(0,12,6)}),new _.YearsTicker({})]})},function(e,t,i,s,n){var o;s();const r=e(149),a=e(9);class l extends r.ContinuousTicker{constructor(e){super(e)}get min_intervals(){return this.tickers.map((e=>e.get_min_interval()))}get max_intervals(){return this.tickers.map((e=>e.get_max_interval()))}get_min_interval(){return this.min_intervals[0]}get_max_interval(){return this.max_intervals[0]}get_best_ticker(e,t,i){const s=t-e,n=this.get_ideal_interval(e,t,i),o=[(0,a.sorted_index)(this.min_intervals,n)-1,(0,a.sorted_index)(this.max_intervals,n)],r=[this.min_intervals[o[0]],this.max_intervals[o[1]]].map((e=>Math.abs(i-s/e)));let l;if((0,a.is_empty)(r.filter((e=>!isNaN(e)))))l=this.tickers[0];else{const e=o[(0,a.argmin)(r)];l=this.tickers[e]}return l}get_interval(e,t,i){return this.get_best_ticker(e,t,i).get_interval(e,t,i)}get_ticks_no_defaults(e,t,i,s){return this.get_best_ticker(e,t,s).get_ticks_no_defaults(e,t,i,s)}}i.CompositeTicker=l,o=l,l.__name__="CompositeTicker",o.define((({Array:e,Ref:t})=>({tickers:[e(t(r.ContinuousTicker)),[]]})))},function(e,t,i,s,n){var o;s();const r=e(158),a=e(159),l=e(9);class c extends r.SingleIntervalTicker{constructor(e){super(e)}initialize(){super.initialize();const e=this.days;e.length>1?this.interval=(e[1]-e[0])*a.ONE_DAY:this.interval=31*a.ONE_DAY}get_ticks_no_defaults(e,t,i,s){const n=function(e,t){const i=(0,a.last_month_no_later_than)(new Date(e)),s=(0,a.last_month_no_later_than)(new Date(t));s.setUTCMonth(s.getUTCMonth()+1);const n=[],o=i;for(;n.push((0,a.copy_date)(o)),o.setUTCMonth(o.getUTCMonth()+1),!(o>s););return n}(e,t),o=this.days,r=this.interval,c=(0,l.concat)(n.map((e=>((e,t)=>{const i=e.getUTCMonth(),s=[];for(const n of o){const o=(0,a.copy_date)(e);o.setUTCDate(n),new Date(o.getTime()+t/2).getUTCMonth()==i&&s.push(o)}return s})(e,r))));return{major:c.map((e=>e.getTime())).filter((i=>e<=i&&i<=t)),minor:[]}}}i.DaysTicker=c,o=c,c.__name__="DaysTicker",o.define((({Int:e,Array:t})=>({days:[t(e),[]]}))),o.override({num_minor_ticks:0})},function(e,t,i,s,n){var o;s();const r=e(149);class a extends r.ContinuousTicker{constructor(e){super(e)}get_interval(e,t,i){return this.interval}get_min_interval(){return this.interval}get_max_interval(){return this.interval}}i.SingleIntervalTicker=a,o=a,a.__name__="SingleIntervalTicker",o.define((({Number:e})=>({interval:[e]})))},function(e,t,i,s,n){function o(e){return new Date(e.getTime())}function r(e){const t=o(e);return t.setUTCDate(1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),t}s(),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=o,i.last_month_no_later_than=r,i.last_year_no_later_than=function(e){const t=r(e);return t.setUTCMonth(0),t}},function(e,t,i,s,n){var o;s();const r=e(158),a=e(159),l=e(9);class c extends r.SingleIntervalTicker{constructor(e){super(e)}initialize(){super.initialize();const e=this.months;e.length>1?this.interval=(e[1]-e[0])*a.ONE_MONTH:this.interval=12*a.ONE_MONTH}get_ticks_no_defaults(e,t,i,s){const n=function(e,t){const i=(0,a.last_year_no_later_than)(new Date(e)),s=(0,a.last_year_no_later_than)(new Date(t));s.setUTCFullYear(s.getUTCFullYear()+1);const n=[],o=i;for(;n.push((0,a.copy_date)(o)),o.setUTCFullYear(o.getUTCFullYear()+1),!(o>s););return n}(e,t),o=this.months;return{major:(0,l.concat)(n.map((e=>o.map((t=>{const i=(0,a.copy_date)(e);return i.setUTCMonth(t),i}))))).map((e=>e.getTime())).filter((i=>e<=i&&i<=t)),minor:[]}}}i.MonthsTicker=c,o=c,c.__name__="MonthsTicker",o.define((({Int:e,Array:t})=>({months:[t(e),[]]})))},function(e,t,i,s,n){s();const o=e(147),r=e(158),a=e(159);class l extends r.SingleIntervalTicker{constructor(e){super(e)}initialize(){super.initialize(),this.interval=a.ONE_YEAR,this.basic_ticker=new o.BasicTicker({num_minor_ticks:0})}get_ticks_no_defaults(e,t,i,s){const n=(0,a.last_year_no_later_than)(new Date(e)).getUTCFullYear(),o=(0,a.last_year_no_later_than)(new Date(t)).getUTCFullYear();return{major:this.basic_ticker.get_ticks_no_defaults(n,o,i,s).major.map((e=>Date.UTC(e,0,1))).filter((i=>e<=i&&i<=t)),minor:[]}}}i.YearsTicker=l,l.__name__="YearsTicker"},function(e,t,i,s,n){var o;s();const r=e(143),a=e(163),l=e(164);class c extends r.ContinuousAxisView{}i.LogAxisView=c,c.__name__="LogAxisView";class h extends r.ContinuousAxis{constructor(e){super(e)}}i.LogAxis=h,o=h,h.__name__="LogAxis",o.prototype.default_view=c,o.override({ticker:()=>new l.LogTicker,formatter:()=>new a.LogTickFormatter})},function(e,t,i,s,n){var o;s();const r=e(131),a=e(146),l=e(164),c=e(120),{abs:h,log:_,round:u}=Math;class d extends r.TickFormatter{constructor(e){super(e)}initialize(){super.initialize(),this.basic_formatter=new a.BasicTickFormatter}format_graphics(e,t){var i,s;if(0==e.length)return[];const n=null!==(s=null===(i=this.ticker)||void 0===i?void 0:i.base)&&void 0!==s?s:10,o=this._exponents(e,n);return null==o?this.basic_formatter.format_graphics(e,t):o.map((e=>{if(h(e)<this.min_exponent){const t=new c.TextBox({text:(0,a.unicode_replace)(`${n**e}`)}),i=new c.TextBox({text:""});return new c.BaseExpo(t,i)}{const t=new c.TextBox({text:(0,a.unicode_replace)(`${n}`)}),i=new c.TextBox({text:(0,a.unicode_replace)(`${e}`)});return new c.BaseExpo(t,i)}}))}_exponents(e,t){let i=null;const s=[];for(const n of e){const e=u(_(n)/_(t));if(i==e)return null;i=e,s.push(e)}return s}doFormat(e,t){var i,s;if(0==e.length)return[];const n=null!==(s=null===(i=this.ticker)||void 0===i?void 0:i.base)&&void 0!==s?s:10,o=this._exponents(e,n);return null==o?this.basic_formatter.doFormat(e,t):o.map((e=>h(e)<this.min_exponent?(0,a.unicode_replace)(`${n**e}`):(0,a.unicode_replace)(`${n}^${e}`)))}}i.LogTickFormatter=d,o=d,d.__name__="LogTickFormatter",o.define((({Int:e,Ref:t,Nullable:i})=>({ticker:[i(t(l.LogTicker)),null],min_exponent:[e,0]})))},function(e,t,i,s,n){var o;s();const r=e(148),a=e(9);class l extends r.AdaptiveTicker{constructor(e){super(e)}get_ticks_no_defaults(e,t,i,s){const n=this.num_minor_ticks,o=[],r=this.base,l=Math.log(e)/Math.log(r),c=Math.log(t)/Math.log(r),h=c-l;let _;if(isFinite(h))if(h<2){const i=this.get_interval(e,t,s),r=Math.floor(e/i),l=Math.ceil(t/i);if(_=(0,a.range)(r,l+1).filter((e=>0!=e)).map((e=>e*i)).filter((i=>e<=i&&i<=t)),n>0&&_.length>0){const e=i/n,t=(0,a.range)(0,n).map((t=>t*e));for(const i of t.slice(1))o.push(_[0]-i);for(const i of _)for(const e of t)o.push(i+e)}}else{const e=Math.ceil(.999999*l),t=Math.floor(1.000001*c),i=Math.ceil((t-e)/9);if(_=(0,a.range)(e-1,t+1,i).map((e=>r**e)),n>0&&_.length>0){const e=r**i/n,t=(0,a.range)(1,n+1).map((t=>t*e));for(const i of t)o.push(_[0]/i);o.push(_[0]);for(const i of _)for(const e of t)o.push(i*e)}}else _=[];return{major:_.filter((i=>e<=i&&i<=t)),minor:o.filter((i=>e<=i&&i<=t))}}}i.LogTicker=l,o=l,l.__name__="LogTicker",o.override({mantissas:[1,5]})},function(e,t,i,s,n){var o;s();const r=e(128),a=e(145),l=e(166),c=e(167);class h extends r.AxisView{}i.MercatorAxisView=h,h.__name__="MercatorAxisView";class _ extends a.LinearAxis{constructor(e){super(e)}}i.MercatorAxis=_,o=_,_.__name__="MercatorAxis",o.prototype.default_view=h,o.override({ticker:()=>new c.MercatorTicker({dimension:"lat"}),formatter:()=>new l.MercatorTickFormatter({dimension:"lat"})})},function(e,t,i,s,n){var o;s();const r=e(146),a=e(20),l=e(78);class c extends r.BasicTickFormatter{constructor(e){super(e)}doFormat(e,t){if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0==e.length)return[];const i=e.length,s=new Array(i);if("lon"==this.dimension)for(let n=0;n<i;n++){const[i]=l.wgs84_mercator.invert(e[n],t.loc);s[n]=i}else for(let n=0;n<i;n++){const[,i]=l.wgs84_mercator.invert(t.loc,e[n]);s[n]=i}return super.doFormat(s,t)}}i.MercatorTickFormatter=c,o=c,c.__name__="MercatorTickFormatter",o.define((({Nullable:e})=>({dimension:[e(a.LatLon),null]})))},function(e,t,i,s,n){var o;s();const r=e(147),a=e(20),l=e(78);class c extends r.BasicTicker{constructor(e){super(e)}get_ticks_no_defaults(e,t,i,s){if(null==this.dimension)throw new Error(`${this}.dimension wasn't configured`);return[e,t]=(0,l.clip_mercator)(e,t,this.dimension),"lon"==this.dimension?this._get_ticks_lon(e,t,i,s):this._get_ticks_lat(e,t,i,s)}_get_ticks_lon(e,t,i,s){const[n]=l.wgs84_mercator.invert(e,i),[o,r]=l.wgs84_mercator.invert(t,i),a=super.get_ticks_no_defaults(n,o,i,s),c=[];for(const _ of a.major)if((0,l.in_bounds)(_,"lon")){const[e]=l.wgs84_mercator.compute(_,r);c.push(e)}const h=[];for(const _ of a.minor)if((0,l.in_bounds)(_,"lon")){const[e]=l.wgs84_mercator.compute(_,r);h.push(e)}return{major:c,minor:h}}_get_ticks_lat(e,t,i,s){const[,n]=l.wgs84_mercator.invert(i,e),[o,r]=l.wgs84_mercator.invert(i,t),a=super.get_ticks_no_defaults(n,r,i,s),c=[];for(const _ of a.major)if((0,l.in_bounds)(_,"lat")){const[,e]=l.wgs84_mercator.compute(o,_);c.push(e)}const h=[];for(const _ of a.minor)if((0,l.in_bounds)(_,"lat")){const[,e]=l.wgs84_mercator.compute(o,_);h.push(e)}return{major:c,minor:h}}}i.MercatorTicker=c,o=c,c.__name__="MercatorTicker",o.define((({Nullable:e})=>({dimension:[e(a.LatLon),null]})))},function(e,t,i,s,n){s(),n("AdaptiveTicker",e(148).AdaptiveTicker),n("BasicTicker",e(147).BasicTicker),n("CategoricalTicker",e(141).CategoricalTicker),n("CompositeTicker",e(156).CompositeTicker),n("ContinuousTicker",e(149).ContinuousTicker),n("DatetimeTicker",e(155).DatetimeTicker),n("DaysTicker",e(157).DaysTicker),n("FixedTicker",e(169).FixedTicker),n("LogTicker",e(164).LogTicker),n("MercatorTicker",e(167).MercatorTicker),n("MonthsTicker",e(160).MonthsTicker),n("SingleIntervalTicker",e(158).SingleIntervalTicker),n("Ticker",e(130).Ticker),n("YearsTicker",e(161).YearsTicker),n("BinnedTicker",e(170).BinnedTicker)},function(e,t,i,s,n){var o;s();const r=e(149);class a extends r.ContinuousTicker{constructor(e){super(e)}get_ticks_no_defaults(e,t,i,s){return{major:this.ticks,minor:this.minor_ticks}}get_interval(e,t,i){return 0}get_min_interval(){return 0}get_max_interval(){return 0}}i.FixedTicker=a,o=a,a.__name__="FixedTicker",o.define((({Number:e,Array:t})=>({ticks:[t(e),[]],minor_ticks:[t(e),[]]})))},function(e,t,i,s,n){var o;s();const r=e(130),a=e(171),l=e(12);class c extends r.Ticker{constructor(e){super(e)}get_ticks(e,t,i,s){const{binning:n}=this.mapper.metrics,o=Math.max(0,(0,l.left_edge_index)(e,n)),r=Math.min((0,l.left_edge_index)(t,n)+1,n.length-1),a=[];for(let l=o;l<=r;l++)a.push(n[l]);const{num_major_ticks:c}=this,h=[],_="auto"==c?a.length:c,u=Math.max(1,Math.floor(a.length/_));for(let l=0;l<a.length;l+=u)h.push(a[l]);return{major:h,minor:[]}}}i.BinnedTicker=c,o=c,c.__name__="BinnedTicker",o.define((({Number:e,Ref:t,Or:i,Auto:s})=>({mapper:[t(a.ScanningColorMapper)],num_major_ticks:[i(e,s),8]})))},function(e,t,i,s,n){s();const o=e(172),r=e(12);class a extends o.ContinuousColorMapper{constructor(e){super(e)}cmap(e,t,i,s,n){return e<n.binning[0]?i:e>n.binning[n.binning.length-1]?s:t[(0,r.left_edge_index)(e,n.binning)]}}i.ScanningColorMapper=a,a.__name__="ScanningColorMapper"},function(e,t,i,s,n){var o;s();const r=e(173),a=e(175),l=e(9),c=e(8);class h extends r.ColorMapper{constructor(e){super(e),this._scan_data=null}connect_signals(){super.connect_signals();const e=()=>{for(const[e]of this.domain)this.connect(e.view.change,(()=>this.update_data())),this.connect(e.data_source.selected.change,(()=>this.update_data()))};this.connect(this.properties.domain.change,(()=>e())),e()}update_data(){const{domain:e,palette:t}=this,i=[...this._collect(e)];this._scan_data=this.scan(i,t.length),this.metrics_change.emit(),this.change.emit()}get metrics(){return null==this._scan_data&&this.update_data(),this._scan_data}*_collect(e){for(const[t,i]of e)for(const e of(0,c.isArray)(i)?i:[i]){let i=t.data_source.get_column(e);i=t.view.indices.select(i);const s=t.view.masked,n=t.data_source.selected.indices;let o;if(null!=s&&n.length>0?o=(0,l.intersection)([...s],n):null!=s?o=[...s]:n.length>0&&(o=n),null!=o&&(i=(0,l.map)(o,(e=>i[e]))),i.length>0&&!(0,c.isNumber)(i[0]))for(const e of i)yield*e;else yield*i}}_v_compute(e,t,i,s){const{nan_color:n}=s;let{low_color:o,high_color:r}=s;null==o&&(o=i[0]),null==r&&(r=i[i.length-1]);const{domain:a}=this,c=(0,l.is_empty)(a)?e:[...this._collect(a)];this._scan_data=this.scan(c,i.length),this.metrics_change.emit();for(let l=0,h=e.length;l<h;l++){const s=e[l];isNaN(s)?t[l]=n:t[l]=this.cmap(s,i,o,r,this._scan_data)}}_colors(e){return Object.assign(Object.assign({},super._colors(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})}}i.ContinuousColorMapper=h,o=h,h.__name__="ContinuousColorMapper",o.define((({Number:e,String:t,Ref:i,Color:s,Or:n,Tuple:o,Array:r,Nullable:l})=>({high:[l(e),null],low:[l(e),null],high_color:[l(s),null],low_color:[l(s),null],domain:[r(o(i(a.GlyphRenderer),n(t,r(t)))),[]]})))},function(e,t,i,s,n){var o;s();const r=e(174),a=e(15),l=e(24),c=e(22),h=e(27);function _(e){return(0,c.encode_rgba)((0,c.color2rgba)(e))}function u(e){const t=new Uint32Array(e.length);for(let i=0,s=e.length;i<s;i++)t[i]=_(e[i]);return t}i._convert_color=_,i._convert_palette=u;class d extends r.Mapper{constructor(e){super(e)}initialize(){super.initialize(),this.metrics_change=new a.Signal0(this,"metrics_change")}v_compute(e){const t=new Array(e.length);return this._v_compute(e,t,this.palette,this._colors((e=>e))),t}get rgba_mapper(){const e=this,t=u(this.palette),i=this._colors(_);return{v_compute(s){const n=new l.ColorArray(s.length);return e._v_compute(s,n,t,i),new Uint8ClampedArray((0,h.to_big_endian)(n).buffer)}}}_colors(e){return{nan_color:e(this.nan_color)}}}i.ColorMapper=d,o=d,d.__name__="ColorMapper",o.define((({Color:e,Array:t})=>({palette:[t(e)],nan_color:[e,"gray"]})))},function(e,t,i,s,n){s();const o=e(56);class r extends o.Transform{constructor(e){super(e)}compute(e){throw new Error("mapping single values is not supported")}}i.Mapper=r,r.__name__="Mapper"},function(e,t,i,s,n){var o;s();const r=e(176),a=e(177),l=e(186),c=e(187),h=e(189),_=e(179),u=e(70),d=e(190),p=e(24),m=e(12),g=e(13),f=e(113),b=e(67),y={fill:{},line:{}},v={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},x={fill:{fill_alpha:.2},line:{}},w={fill:{fill_alpha:.2},line:{}};class A extends r.DataRendererView{get glyph_view(){return this.glyph}async lazy_initialize(){var e;await super.lazy_initialize();const t=this.model.glyph;this.glyph=await this.build_glyph_view(t);const i="fill"in this.glyph.visuals,s="line"in this.glyph.visuals,n=Object.assign({},t.attributes);function o(e){const o=(0,g.clone)(n);return i&&(0,g.extend)(o,e.fill),s&&(0,g.extend)(o,e.line),new t.constructor(o)}function r(e,t){return t instanceof _.Glyph?t:o("auto"==t?e:{fill:{},line:{}})}delete n.id;let{selection_glyph:a,nonselection_glyph:l,hover_glyph:c,muted_glyph:h}=this.model;a=r(y,a),this.selection_glyph=await this.build_glyph_view(a),l=r(x,l),this.nonselection_glyph=await this.build_glyph_view(l),null!=c&&(this.hover_glyph=await this.build_glyph_view(c)),h=r(w,h),this.muted_glyph=await this.build_glyph_view(h);const u=r(v,"auto");this.decimated_glyph=await this.build_glyph_view(u),this.selection_glyph.set_base(this.glyph),this.nonselection_glyph.set_base(this.glyph),null===(e=this.hover_glyph)||void 0===e||e.set_base(this.glyph),this.muted_glyph.set_base(this.glyph),this.decimated_glyph.set_base(this.glyph),this.set_data()}async build_glyph_view(e){return(0,f.build_view)(e,{parent:this})}remove(){var e;this.glyph.remove(),this.selection_glyph.remove(),this.nonselection_glyph.remove(),null===(e=this.hover_glyph)||void 0===e||e.remove(),this.muted_glyph.remove(),this.decimated_glyph.remove(),super.remove()}connect_signals(){super.connect_signals();const e=()=>this.request_render(),t=()=>this.update_data();this.connect(this.model.change,e),this.connect(this.glyph.model.change,t),this.connect(this.selection_glyph.model.change,t),this.connect(this.nonselection_glyph.model.change,t),null!=this.hover_glyph&&this.connect(this.hover_glyph.model.change,t),this.connect(this.muted_glyph.model.change,t),this.connect(this.decimated_glyph.model.change,t),this.connect(this.model.data_source.change,t),this.connect(this.model.data_source.streaming,t),this.connect(this.model.data_source.patching,(e=>this.update_data(e))),this.connect(this.model.data_source.selected.change,e),this.connect(this.model.data_source._select,e),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,e),this.connect(this.model.properties.view.change,t),this.connect(this.model.view.properties.indices.change,t),this.connect(this.model.view.properties.masked.change,(()=>this.set_visuals())),this.connect(this.model.properties.visible.change,(()=>this.plot_view.invalidate_dataranges=!0));const{x_ranges:i,y_ranges:s}=this.plot_view.frame;for(const[,r]of i)r instanceof b.FactorRange&&this.connect(r.change,t);for(const[,r]of s)r instanceof b.FactorRange&&this.connect(r.change,t);const{transformchange:n,exprchange:o}=this.model.glyph;this.connect(n,t),this.connect(o,t)}_update_masked_indices(){const e=this.glyph.mask_data();return this.model.view.masked=e,e}update_data(e){this.set_data(e),this.request_render()}set_data(e){const t=this.model.data_source;this.all_indices=this.model.view.indices;const{all_indices:i}=this;this.glyph.set_data(t,i,e),this.set_visuals(),this._update_masked_indices();const{lod_factor:s}=this.plot_model,n=this.all_indices.count;this.decimated=new p.Indices(n);for(let o=0;o<n;o+=s)this.decimated.set(o);this.plot_view.invalidate_dataranges=!0}set_visuals(){var e;const t=this.model.data_source,{all_indices:i}=this;this.glyph.set_visuals(t,i),this.decimated_glyph.set_visuals(t,i),this.selection_glyph.set_visuals(t,i),this.nonselection_glyph.set_visuals(t,i),null===(e=this.hover_glyph)||void 0===e||e.set_visuals(t,i),this.muted_glyph.set_visuals(t,i)}get has_webgl(){return this.glyph.has_webgl}_render(){const e=this.has_webgl;this.glyph.map_data();const t=[...this.all_indices];let i=[...this._update_masked_indices()];const{ctx:s}=this.layer;s.save();const{selected:n}=this.model.data_source;let o;o=!n||n.is_empty()?[]:this.glyph instanceof a.LineView&&n.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(i):n.indices;const{inspected:r}=this.model.data_source,_=new Set((()=>!r||r.is_empty()?[]:r.selected_glyph?this.model.view.convert_indices_from_subset(i):r.indices.length>0?r.indices:Object.keys(r.multiline_indices).map((e=>parseInt(e))))()),u=(0,m.filter)(i,(e=>_.has(t[e]))),{lod_threshold:d}=this.plot_model;let p,g,f;if(null!=this.model.document&&this.model.document.interactive_duration()>0&&!e&&null!=d&&t.length>d?(i=[...this.decimated],p=this.decimated_glyph,g=this.decimated_glyph,f=this.selection_glyph):(p=this.model.muted?this.muted_glyph:this.glyph,g=this.nonselection_glyph,f=this.selection_glyph),null!=this.hover_glyph&&u.length){const e=new Set(i);for(const t of u)e.delete(t);i=[...e]}if(o.length){const e={};for(const t of o)e[t]=!0;const n=new Array,r=new Array;if(this.glyph instanceof a.LineView)for(const i of t)null!=e[i]?n.push(i):r.push(i);else for(const s of i)null!=e[t[s]]?n.push(s):r.push(s);g.render(s,r),f.render(s,n),null!=this.hover_glyph&&(this.glyph instanceof a.LineView?this.hover_glyph.render(s,this.model.view.convert_indices_from_subset(u)):this.hover_glyph.render(s,u))}else if(this.glyph instanceof a.LineView)this.hover_glyph&&u.length?this.hover_glyph.render(s,this.model.view.convert_indices_from_subset(u)):p.render(s,t);else if(this.glyph instanceof l.PatchView||this.glyph instanceof c.HAreaView||this.glyph instanceof h.VAreaView)if(0==r.selected_glyphs.length||null==this.hover_glyph)p.render(s,t);else for(const a of r.selected_glyphs)a==this.glyph.model&&this.hover_glyph.render(s,t);else p.render(s,i),this.hover_glyph&&u.length&&this.hover_glyph.render(s,u);s.restore()}draw_legend(e,t,i,s,n,o,r,a){0!=this.glyph.data_size&&(null==a&&(a=this.model.get_reference_point(o,r)),this.glyph.draw_legend_for_index(e,{x0:t,x1:i,y0:s,y1:n},a))}hit_test(e){if(!this.model.visible)return null;const t=this.glyph.hit_test(e);return null==t?null:this.model.view.convert_selection_from_subset(t)}}i.GlyphRendererView=A,A.__name__="GlyphRendererView";class k extends r.DataRenderer{constructor(e){super(e)}initialize(){super.initialize(),this.view.source!=this.data_source&&(this.view.source=this.data_source,this.view.compute_indices())}get_reference_point(e,t){if(null!=e){const i=this.data_source.get_column(e);if(null!=i)for(const[e,s]of Object.entries(this.view.indices_map))if(i[parseInt(e)]==t)return s}return 0}get_selection_manager(){return this.data_source.selection_manager}}i.GlyphRenderer=k,o=k,k.__name__="GlyphRenderer",o.prototype.default_view=A,o.define((({Boolean:e,Auto:t,Or:i,Ref:s,Null:n,Nullable:o})=>({data_source:[s(u.ColumnarDataSource)],view:[s(d.CDSView),e=>new d.CDSView({source:e.data_source})],glyph:[s(_.Glyph)],hover_glyph:[o(s(_.Glyph)),null],nonselection_glyph:[i(s(_.Glyph),t,n),"auto"],selection_glyph:[i(s(_.Glyph),t,n),"auto"],muted_glyph:[i(s(_.Glyph),t,n),"auto"],muted:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(41);class a extends r.RendererView{get xscale(){return this.coordinates.x_scale}get yscale(){return this.coordinates.y_scale}}i.DataRendererView=a,a.__name__="DataRendererView";class l extends r.Renderer{constructor(e){super(e)}get selection_manager(){return this.get_selection_manager()}}i.DataRenderer=l,o=l,l.__name__="DataRenderer",o.override({level:"glyph"})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=(0,o.__importStar)(e(48)),h=(0,o.__importStar)(e(185)),_=e(72);class u extends a.XYGlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null==t?void 0:t.regl_wrapper.has_webgl){const{LineGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(426))));this.glglyph=new i(t.regl_wrapper,this)}}_render(e,t,i){const{sx:s,sy:n}=null!=i?i:this;let o=null;const r=e=>null!=o&&e-o!=1;let a=!0;e.beginPath();for(const l of t){const t=s[l],i=n[l];isFinite(t+i)?a||r(l)?(e.moveTo(t,i),a=!1):e.lineTo(t,i):a=!0,o=l}this.visuals.line.set_value(e),e.stroke()}_hit_point(e){const t=new _.Selection,i={x:e.sx,y:e.sy};let s=9999;const n=Math.max(2,this.line_width.value/2);for(let o=0,r=this.sx.length-1;o<r;o++){const e={x:this.sx[o],y:this.sy[o]},r={x:this.sx[o+1],y:this.sy[o+1]},a=h.dist_to_segment(i,e,r);a<n&&a<s&&(s=a,t.add_to_selected_glyphs(this.model),t.view=this,t.line_indices=[o])}return t}_hit_span(e){const{sx:t,sy:i}=e,s=new _.Selection;let n,o;"v"==e.direction?(n=this.renderer.yscale.invert(i),o=this._y):(n=this.renderer.xscale.invert(t),o=this._x);for(let r=0,a=o.length-1;r<a;r++)(o[r]<=n&&n<=o[r+1]||o[r+1]<=n&&n<=o[r])&&(s.add_to_selected_glyphs(this.model),s.view=this,s.line_indices.push(r));return s}get_interpolation_hit(e,t){const[i,s,n,o]=[this._x[e],this._y[e],this._x[e+1],this._y[e+1]];return(0,l.line_interpolation)(this.renderer,t,i,s,n,o)}draw_legend_for_index(e,t,i){(0,l.generic_line_scalar_legend)(this.visuals,e,t)}}i.LineView=u,u.__name__="LineView";class d extends a.XYGlyph{constructor(e){super(e)}}i.Line=d,r=d,d.__name__="Line",r.prototype.default_view=u,r.mixins(c.LineScalar)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(78),l=(0,o.__importStar)(e(18)),c=e(179);class h extends c.GlyphView{_project_data(){a.inplace.project_xy(this._x,this._y)}_index_data(e){const{_x:t,_y:i,data_size:s}=this;for(let n=0;n<s;n++){const s=t[n],o=i[n];e.add_point(s,o)}}scenterxy(e){return[this.sx[e],this.sy[e]]}}i.XYGlyphView=h,h.__name__="XYGlyphView";class _ extends c.Glyph{constructor(e){super(e)}}i.XYGlyph=_,r=_,_.__name__="XYGlyph",r.define((({})=>({x:[l.XCoordinateSpec,{field:"x"}],y:[l.YCoordinateSpec,{field:"y"}]})))},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importStar)(e(18)),a=(0,o.__importStar)(e(65)),l=(0,o.__importStar)(e(45)),c=e(42),h=e(53),_=e(19),u=e(24),d=e(8),p=e(180),m=e(12),g=e(26),f=e(181),b=e(67),y=e(72),{abs:v,ceil:x}=Math;class w extends c.View{constructor(){super(...arguments),this._index=null,this._data_size=null,this._nohit_warned=new Set}get renderer(){return this.parent}get has_webgl(){return null!=this.glglyph}get index(){const{_index:e}=this;if(null!=e)return e;throw new Error(`${this}.index_data() wasn't called`)}get data_size(){const{_data_size:e}=this;if(null!=e)return e;throw new Error(`${this}.set_data() wasn't called`)}initialize(){super.initialize(),this.visuals=new l.Visuals(this)}request_render(){this.parent.request_render()}get canvas(){return this.renderer.parent.canvas_view}render(e,t,i){var s;null!=this.glglyph&&(this.renderer.needs_webgl_blit=this.glglyph.render(e,t,null!==(s=this.base)&&void 0!==s?s:this),this.renderer.needs_webgl_blit)||this._render(e,t,null!=i?i:this.base)}has_finished(){return!0}notify_finished(){this.renderer.notify_finished()}_bounds(e){return e}bounds(){return this._bounds(this.index.bbox)}log_bounds(){const{x0:e,x1:t}=this.index.bounds(a.positive_x()),{y0:i,y1:s}=this.index.bounds(a.positive_y());return this._bounds({x0:e,y0:i,x1:t,y1:s})}get_anchor_point(e,t,[i,s]){switch(e){case"center":case"center_center":{const[e,n]=this.scenterxy(t,i,s);return{x:e,y:n}}default:return null}}scenterx(e,t,i){return this.scenterxy(e,t,i)[0]}scentery(e,t,i){return this.scenterxy(e,t,i)[1]}sdist(e,t,i,s="edge",n=!1){const o=t.length,r=new u.ScreenArray(o),a=e.s_compute;if("center"==s)for(let l=0;l<o;l++){const e=t[l],s=i.get(l)/2,n=a(e-s),o=a(e+s);r[l]=v(o-n)}else for(let l=0;l<o;l++){const e=t[l],s=a(e),n=a(e+i.get(l));r[l]=v(n-s)}return n&&(0,m.inplace_map)(r,(e=>x(e))),r}draw_legend_for_index(e,t,i){}hit_test(e){switch(e.type){case"point":if(null!=this._hit_point)return this._hit_point(e);break;case"span":if(null!=this._hit_span)return this._hit_span(e);break;case"rect":if(null!=this._hit_rect)return this._hit_rect(e);break;case"poly":if(null!=this._hit_poly)return this._hit_poly(e)}return this._nohit_warned.has(e.type)||(_.logger.debug(`'${e.type}' selection not available for ${this.model.type}`),this._nohit_warned.add(e.type)),null}_hit_rect_against_index(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,[o,r]=this.renderer.coordinates.x_scale.r_invert(t,i),[a,l]=this.renderer.coordinates.y_scale.r_invert(s,n),c=[...this.index.indices({x0:o,x1:r,y0:a,y1:l})];return new y.Selection({indices:c})}_project_data(){}*_iter_visuals(){for(const e of this.visuals)for(const t of e)(t instanceof r.VectorSpec||t instanceof r.ScalarSpec)&&(yield t)}set_base(e){e!=this&&e instanceof this.constructor&&(this.base=e)}_configure(e,t){Object.defineProperty(this,(0,d.isString)(e)?e:e.attr,Object.assign({configurable:!0,enumerable:!0},t))}set_visuals(e,t){var i;for(const s of this._iter_visuals()){const{base:i}=this;if(null!=i){const e=i.model.properties[s.attr];if(null!=e&&(0,g.is_equal)(s.get_value(),e.get_value())){this._configure(s,{get:()=>i[`${s.attr}`]});continue}}const n=s.uniform(e).select(t);this._configure(s,{value:n})}for(const s of this.visuals)s.update();null===(i=this.glglyph)||void 0===i||i.set_visuals_changed()}set_data(e,t,i){var s;const{x_source:n,y_source:o}=this.renderer.coordinates,a=new Set(this._iter_visuals());this._data_size=t.count;for(const l of this.model)if((l instanceof r.VectorSpec||l instanceof r.ScalarSpec)&&!a.has(l))if(l instanceof r.BaseCoordinateSpec){const i=l.array(e);let s=t.select(i);const a="x"==l.dimension?n:o;if(a instanceof b.FactorRange)if(l instanceof r.CoordinateSpec)s=a.v_synthetic(s);else if(l instanceof r.CoordinateSeqSpec)for(let e=0;e<s.length;e++)s[e]=a.v_synthetic(s[e]);let c;c=l instanceof r.CoordinateSeqSpec?p.RaggedArray.from(s,Float64Array):s,this._configure(`_${l.attr}`,{value:c})}else{const i=l.uniform(e).select(t);if(this._configure(l,{value:i}),l instanceof r.DistanceSpec){const e=i.is_Scalar()?i.value:(0,m.max)(i.array);this._configure(`max_${l.attr}`,{value:e})}}this.renderer.plot_view.model.use_map&&this._project_data(),this._set_data(null!=i?i:null),null===(s=this.glglyph)||void 0===s||s.set_data_changed(),this.index_data()}_set_data(e){}get _index_size(){return this.data_size}index_data(){const e=new f.SpatialIndex(this._index_size);this._index_data(e),e.finish(),this._index=e}mask_data(){return null==this._mask_data?u.Indices.all_set(this.data_size):this._mask_data()}map_data(){var e;const t=this,{x_scale:i,y_scale:s}=this.renderer.coordinates;for(const n of this.model)if(n instanceof r.BaseCoordinateSpec){const e="x"==n.dimension?i:s;let o=t[`_${n.attr}`];if(o instanceof p.RaggedArray){const t=e.v_compute(o.array);o=new p.RaggedArray(o.offsets,t)}else o=e.v_compute(o);this[`s${n.attr}`]=o}this._map_data(),null===(e=this.glglyph)||void 0===e||e.set_data_changed()}_map_data(){}}i.GlyphView=w,w.__name__="GlyphView";class A extends h.Model{constructor(e){super(e)}}i.Glyph=A,A.__name__="Glyph"},function(e,t,i,s,n){var o;s();const r=e(26),a=e(11);class l{constructor(e,t){this.offsets=e,this.array=t}[(o=Symbol.toStringTag,r.equals)](e,t){return t.arrays(this.offsets,e.offsets)&&t.arrays(this.array,e.array)}get length(){return this.offsets.length}clone(){return new l(this.offsets.slice(),this.array.slice())}static from(e,t){const i=e.length;let s=0;const n=(()=>{const t=new Uint32Array(i);for(let n=0;n<i;n++){const i=e[n].length;t[n]=s,s+=i}return s<256?new Uint8Array(t):s<65536?new Uint16Array(t):t})(),o=new t(s);for(let r=0;r<i;r++)o.set(e[r],n[r]);return new l(n,o)}*[Symbol.iterator](){const{offsets:e,length:t}=this;for(let i=0;i<t;i++)yield this.array.subarray(e[i],e[i+1])}_check_bounds(e){(0,a.assert)(0<=e&&e<this.length,`Out of bounds: 0 <= ${e} < ${this.length}`)}get(e){this._check_bounds(e);const{offsets:t}=this;return this.array.subarray(t[e],t[e+1])}set(e,t){this._check_bounds(e),this.array.set(t,this.offsets[e])}}i.RaggedArray=l,l.__name__="RaggedArray",l[o]="RaggedArray"},function(e,t,i,s,n){s();const o=(0,e(1).__importDefault)(e(182)),r=e(24),a=e(65);function l(e,t){let i=0,s=t.length-1;for(;i<s;){const n=i+s>>1;t[n]>e?s=n:i=n+1}return t[i]}class c extends o.default{get boxes(){return this._boxes}search_indices(e,t,i,s){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let n=this._boxes.length-4;const o=[],a=new r.Indices(this.numItems);for(;void 0!==n;){const r=Math.min(n+4*this.nodeSize,l(n,this._levelBounds));for(let l=n;l<r;l+=4){const r=0|this._indices[l>>2],c=this._boxes[l+0],h=this._boxes[l+1],_=this._boxes[l+2],u=this._boxes[l+3];i<c||s<h||e>_||t>u||(n<4*this.numItems?a.set(r):o.push(r))}n=o.pop()}return a}}c.__name__="_FlatBush";class h{constructor(e){this.index=null,e>0&&(this.index=new c(e))}add_rect(e,t,i,s){var n;isFinite(e+t+i+s)?null===(n=this.index)||void 0===n||n.add(e,t,i,s):this.add_empty()}add_point(e,t){var i;isFinite(e+t)?null===(i=this.index)||void 0===i||i.add(e,t,e,t):this.add_empty()}add_empty(){var e;null===(e=this.index)||void 0===e||e.add(1/0,1/0,-1/0,-1/0)}finish(){var e;null===(e=this.index)||void 0===e||e.finish()}_normalize(e){let{x0:t,y0:i,x1:s,y1:n}=e;return t>s&&([t,s]=[s,t]),i>n&&([i,n]=[n,i]),{x0:t,y0:i,x1:s,y1:n}}get bbox(){if(null==this.index)return(0,a.empty)();{const{minX:e,minY:t,maxX:i,maxY:s}=this.index;return{x0:e,y0:t,x1:i,y1:s}}}indices(e){if(null==this.index)return new r.Indices(0);{const{x0:t,y0:i,x1:s,y1:n}=this._normalize(e);return this.index.search_indices(t,i,s,n)}}bounds(e){const t=(0,a.empty)();if(null==this.index)return t;const{boxes:i}=this.index;for(const s of this.indices(e)){const n=i[4*s+0],o=i[4*s+1],r=i[4*s+2],a=i[4*s+3];n>=e.x0&&n<t.x0&&(t.x0=n),r<=e.x1&&r>t.x1&&(t.x1=r),o>=e.y0&&o<t.y0&&(t.y0=o),a<=e.y1&&a>t.y1&&(t.y1=a)}return t}}i.SpatialIndex=h,h.__name__="SpatialIndex"},function(e,t,i,s,n){s();const o=(0,e(1).__importDefault)(e(183)),r=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class a{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,i]=new Uint8Array(e,0,2);if(251!==t)throw new Error("Data does not appear to be in a Flatbush format.");if(i>>4!=3)throw new Error(`Got v${i>>4} data when expected v3.`);const[s]=new Uint16Array(e,2,1),[n]=new Uint32Array(e,4,1);return new a(n,s,r[15&i],e)}constructor(e,t=16,i=Float64Array,s){if(void 0===e)throw new Error("Missing required argument: numItems.");if(isNaN(e)||e<=0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535);let n=e,a=n;this._levelBounds=[4*n];do{n=Math.ceil(n/this.nodeSize),a+=n,this._levelBounds.push(4*a)}while(1!==n);this.ArrayType=i||Float64Array,this.IndexArrayType=a<16384?Uint16Array:Uint32Array;const l=r.indexOf(this.ArrayType),c=4*a*this.ArrayType.BYTES_PER_ELEMENT;if(l<0)throw new Error(`Unexpected typed array class: ${i}.`);s&&s instanceof ArrayBuffer?(this.data=s,this._boxes=new this.ArrayType(this.data,8,4*a),this._indices=new this.IndexArrayType(this.data,8+c,a),this._pos=4*a,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1]):(this.data=new ArrayBuffer(8+c+a*this.IndexArrayType.BYTES_PER_ELEMENT),this._boxes=new this.ArrayType(this.data,8,4*a),this._indices=new this.IndexArrayType(this.data,8+c,a),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(this.data,0,2).set([251,48+l]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e),this._queue=new o.default}add(e,t,i,s){const n=this._pos>>2;return this._indices[n]=n,this._boxes[this._pos++]=e,this._boxes[this._pos++]=t,this._boxes[this._pos++]=i,this._boxes[this._pos++]=s,e<this.minX&&(this.minX=e),t<this.minY&&(this.minY=t),i>this.maxX&&(this.maxX=i),s>this.maxY&&(this.maxY=s),n}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);if(this.numItems<=this.nodeSize)return this._boxes[this._pos++]=this.minX,this._boxes[this._pos++]=this.minY,this._boxes[this._pos++]=this.maxX,void(this._boxes[this._pos++]=this.maxY);const e=this.maxX-this.minX,t=this.maxY-this.minY,i=new Uint32Array(this.numItems);for(let s=0;s<this.numItems;s++){let n=4*s;const o=this._boxes[n++],r=this._boxes[n++],a=this._boxes[n++],l=this._boxes[n++],c=Math.floor(65535*((o+a)/2-this.minX)/e),h=Math.floor(65535*((r+l)/2-this.minY)/t);i[s]=u(c,h)}h(i,this._boxes,this._indices,0,this.numItems-1,this.nodeSize);for(let s=0,n=0;s<this._levelBounds.length-1;s++){const e=this._levelBounds[s];for(;n<e;){const t=n;let i=1/0,s=1/0,o=-1/0,r=-1/0;for(let a=0;a<this.nodeSize&&n<e;a++)i=Math.min(i,this._boxes[n++]),s=Math.min(s,this._boxes[n++]),o=Math.max(o,this._boxes[n++]),r=Math.max(r,this._boxes[n++]);this._indices[this._pos>>2]=t,this._boxes[this._pos++]=i,this._boxes[this._pos++]=s,this._boxes[this._pos++]=o,this._boxes[this._pos++]=r}}}search(e,t,i,s,n){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let o=this._boxes.length-4;const r=[],a=[];for(;void 0!==o;){const l=Math.min(o+4*this.nodeSize,c(o,this._levelBounds));for(let c=o;c<l;c+=4){const l=0|this._indices[c>>2];i<this._boxes[c]||s<this._boxes[c+1]||e>this._boxes[c+2]||t>this._boxes[c+3]||(o<4*this.numItems?(void 0===n||n(l))&&a.push(l):r.push(l))}o=r.pop()}return a}neighbors(e,t,i=1/0,s=1/0,n){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let o=this._boxes.length-4;const r=this._queue,a=[],h=s*s;for(;void 0!==o;){const s=Math.min(o+4*this.nodeSize,c(o,this._levelBounds));for(let i=o;i<s;i+=4){const s=0|this._indices[i>>2],a=l(e,this._boxes[i],this._boxes[i+2]),c=l(t,this._boxes[i+1],this._boxes[i+3]),h=a*a+c*c;o<4*this.numItems?(void 0===n||n(s))&&r.push(-s-1,h):r.push(s,h)}for(;r.length&&r.peek()<0;){if(r.peekValue()>h)return r.clear(),a;if(a.push(-r.pop()-1),a.length===i)return r.clear(),a}o=r.pop()}return r.clear(),a}}function l(e,t,i){return e<t?t-e:e<=i?0:e-i}function c(e,t){let i=0,s=t.length-1;for(;i<s;){const n=i+s>>1;t[n]>e?s=n:i=n+1}return t[i]}function h(e,t,i,s,n,o){if(Math.floor(s/o)>=Math.floor(n/o))return;const r=e[s+n>>1];let a=s-1,l=n+1;for(;;){do{a++}while(e[a]<r);do{l--}while(e[l]>r);if(a>=l)break;_(e,t,i,a,l)}h(e,t,i,s,l,o),h(e,t,i,l+1,n,o)}function _(e,t,i,s,n){const o=e[s];e[s]=e[n],e[n]=o;const r=4*s,a=4*n,l=t[r],c=t[r+1],h=t[r+2],_=t[r+3];t[r]=t[a],t[r+1]=t[a+1],t[r+2]=t[a+2],t[r+3]=t[a+3],t[a]=l,t[a+1]=c,t[a+2]=h,t[a+3]=_;const u=i[s];i[s]=i[n],i[n]=u}function u(e,t){let i=e^t,s=65535^i,n=65535^(e|t),o=e&(65535^t),r=i|s>>1,a=i>>1^i,l=n>>1^s&o>>1^n,c=i&n>>1^o>>1^o;i=r,s=a,n=l,o=c,r=i&i>>2^s&s>>2,a=i&s>>2^s&(i^s)>>2,l^=i&n>>2^s&o>>2,c^=s&n>>2^(i^s)&o>>2,i=r,s=a,n=l,o=c,r=i&i>>4^s&s>>4,a=i&s>>4^s&(i^s)>>4,l^=i&n>>4^s&o>>4,c^=s&n>>4^(i^s)&o>>4,i=r,s=a,n=l,o=c,l^=i&n>>8^s&o>>8,c^=s&n>>8^(i^s)&o>>8,i=l^l>>1,s=c^c>>1;let h=e^t,_=s|65535^(h|i);return h=16711935&(h|h<<8),h=252645135&(h|h<<4),h=858993459&(h|h<<2),h=1431655765&(h|h<<1),_=16711935&(_|_<<8),_=252645135&(_|_<<4),_=858993459&(_|_<<2),_=1431655765&(_|_<<1),(_<<1|h)>>>0}i.default=a},function(e,t,i,s,n){s(),i.default=class{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,t){let i=this.length++;for(this.ids[i]=e,this.values[i]=t;i>0;){const e=i-1>>1,s=this.values[e];if(t>=s)break;this.ids[i]=this.ids[e],this.values[i]=s,i=e}this.ids[i]=e,this.values[i]=t}pop(){if(0===this.length)return;const e=this.ids[0];if(this.length--,this.length>0){const e=this.ids[0]=this.ids[this.length],t=this.values[0]=this.values[this.length],i=this.length>>1;let s=0;for(;s<i;){let e=1+(s<<1);const i=e+1;let n=this.ids[e],o=this.values[e];const r=this.values[i];if(i<this.length&&r<o&&(e=i,n=this.ids[i],o=r),o>=t)break;this.ids[s]=n,this.values[s]=o,s=e}this.ids[s]=e,this.values[s]=t}return e}peek(){if(0!==this.length)return this.ids[0]}peekValue(){if(0!==this.length)return this.values[0]}}},function(e,t,i,s,n){s();const o=(0,e(1).__importStar)(e(185));function r(e,t,{x0:i,x1:s,y0:n,y1:o},r){t.save(),t.beginPath(),t.moveTo(i,(n+o)/2),t.lineTo(s,(n+o)/2),e.line.apply(t,r),t.restore()}function a(e,t,{x0:i,x1:s,y0:n,y1:o},r){var a,l;const c=.1*Math.abs(s-i),h=.1*Math.abs(o-n),_=i+c,u=s-c,d=n+h,p=o-h;t.beginPath(),t.rect(_,d,u-_,p-d),e.fill.apply(t,r),null===(a=e.hatch)||void 0===a||a.apply(t,r),null===(l=e.line)||void 0===l||l.apply(t,r)}i.generic_line_scalar_legend=function(e,t,{x0:i,x1:s,y0:n,y1:o}){t.save(),t.beginPath(),t.moveTo(i,(n+o)/2),t.lineTo(s,(n+o)/2),e.line.apply(t),t.restore()},i.generic_line_vector_legend=r,i.generic_line_legend=r,i.generic_area_scalar_legend=function(e,t,{x0:i,x1:s,y0:n,y1:o}){var r,a;const l=.1*Math.abs(s-i),c=.1*Math.abs(o-n),h=i+l,_=s-l,u=n+c,d=o-c;t.beginPath(),t.rect(h,u,_-h,d-u),e.fill.apply(t),null===(r=e.hatch)||void 0===r||r.apply(t),null===(a=e.line)||void 0===a||a.apply(t)},i.generic_area_vector_legend=a,i.generic_area_legend=a,i.line_interpolation=function(e,t,i,s,n,r){const{sx:a,sy:l}=t;let c,h,_,u;"point"==t.type?([_,u]=e.yscale.r_invert(l-1,l+1),[c,h]=e.xscale.r_invert(a-1,a+1)):"v"==t.direction?([_,u]=e.yscale.r_invert(l,l),[c,h]=[Math.min(i-1,n-1),Math.max(i+1,n+1)]):([c,h]=e.xscale.r_invert(a,a),[_,u]=[Math.min(s-1,r-1),Math.max(s+1,r+1)]);const{x:d,y:p}=o.check_2_segments_intersect(c,_,h,u,i,s,n,r);return[d,p]}},function(e,t,i,s,n){function o(e,t){return(e.x-t.x)**2+(e.y-t.y)**2}function r(e,t,i){const s=o(t,i);if(0==s)return o(e,t);const n=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/s;return o(e,n<0?t:n>1?i:{x:t.x+n*(i.x-t.x),y:t.y+n*(i.y-t.y)})}s(),i.point_in_poly=function(e,t,i,s){let n=!1,o=i[i.length-1],r=s[s.length-1];for(let a=0;a<i.length;a++){const l=i[a],c=s[a];r<t!=c<t&&o+(t-r)/(c-r)*(l-o)<e&&(n=!n),o=l,r=c}return n},i.point_in_ellipse=function(e,t,i,s,n,o,r){return((Math.cos(i)/n)**2+(Math.sin(i)/s)**2)*(e-o)**2+2*Math.cos(i)*Math.sin(i)*((1/n)**2-(1/s)**2)*(e-o)*(t-r)+((Math.cos(i)/s)**2+(Math.sin(i)/n)**2)*(t-r)**2<=1},i.dist_2_pts=o,i.dist_to_segment_squared=r,i.dist_to_segment=function(e,t,i){return Math.sqrt(r(e,t,i))},i.check_2_segments_intersect=function(e,t,i,s,n,o,r,a){const l=(a-o)*(i-e)-(r-n)*(s-t);if(0==l)return{hit:!1,x:null,y:null};{let c=t-o,h=e-n;const _=(i-e)*c-(s-t)*h;return c=((r-n)*c-(a-o)*h)/l,h=_/l,{hit:c>0&&c<1&&h>0&&h<1,x:e+c*(i-e),y:t+c*(s-t)}}}},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=(0,o.__importStar)(e(185)),h=(0,o.__importStar)(e(48)),_=e(72);class u extends a.XYGlyphView{_render(e,t,i){const{sx:s,sy:n}=null!=i?i:this;let o=!0;e.beginPath();for(const r of t){const t=s[r],i=n[r];isFinite(t+i)?o?(e.moveTo(t,i),o=!1):e.lineTo(t,i):(e.closePath(),o=!0)}e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e),this.visuals.line.apply(e)}draw_legend_for_index(e,t,i){(0,l.generic_area_scalar_legend)(this.visuals,e,t)}_hit_point(e){const t=new _.Selection;return c.point_in_poly(e.sx,e.sy,this.sx,this.sy)&&(t.add_to_selected_glyphs(this.model),t.view=this),t}}i.PatchView=u,u.__name__="PatchView";class d extends a.XYGlyph{constructor(e){super(e)}}i.Patch=d,r=d,d.__name__="Patch",r.prototype.default_view=u,r.mixins([h.LineScalar,h.FillScalar,h.HatchScalar])},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(188),l=(0,o.__importStar)(e(185)),c=(0,o.__importStar)(e(18)),h=e(72);class _ extends a.AreaView{_index_data(e){const{min:t,max:i}=Math,{data_size:s}=this;for(let n=0;n<s;n++){const s=this._x1[n],o=this._x2[n],r=this._y[n];e.add_rect(t(s,o),r,i(s,o),r)}}_render(e,t,i){const{sx1:s,sx2:n,sy:o}=null!=i?i:this;e.beginPath();for(let r=0,a=s.length;r<a;r++)e.lineTo(s[r],o[r]);for(let r=n.length-1;r>=0;r--)e.lineTo(n[r],o[r]);e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e)}_hit_point(e){const t=this.sy.length,i=new h.Selection;for(let s=0,n=t-1;s<n;s++){const t=[this.sx1[s],this.sx1[s+1],this.sx2[s+1],this.sx2[s]],n=[this.sy[s],this.sy[s+1],this.sy[s+1],this.sy[s]];if(l.point_in_poly(e.sx,e.sy,t,n)){i.add_to_selected_glyphs(this.model),i.view=this,i.line_indices=[s];break}}return i}scenterxy(e){return[(this.sx1[e]+this.sx2[e])/2,this.sy[e]]}_map_data(){this.sx1=this.renderer.xscale.v_compute(this._x1),this.sx2=this.renderer.xscale.v_compute(this._x2),this.sy=this.renderer.yscale.v_compute(this._y)}}i.HAreaView=_,_.__name__="HAreaView";class u extends a.Area{constructor(e){super(e)}}i.HArea=u,r=u,u.__name__="HArea",r.prototype.default_view=_,r.define((({})=>({x1:[c.XCoordinateSpec,{field:"x1"}],x2:[c.XCoordinateSpec,{field:"x2"}],y:[c.YCoordinateSpec,{field:"y"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(179),l=e(184),c=(0,o.__importStar)(e(48));class h extends a.GlyphView{draw_legend_for_index(e,t,i){(0,l.generic_area_scalar_legend)(this.visuals,e,t)}}i.AreaView=h,h.__name__="AreaView";class _ extends a.Glyph{constructor(e){super(e)}}i.Area=_,r=_,_.__name__="Area",r.mixins([c.FillScalar,c.HatchScalar])},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(188),l=(0,o.__importStar)(e(185)),c=(0,o.__importStar)(e(18)),h=e(72);class _ extends a.AreaView{_index_data(e){const{min:t,max:i}=Math,{data_size:s}=this;for(let n=0;n<s;n++){const s=this._x[n],o=this._y1[n],r=this._y2[n];e.add_rect(s,t(o,r),s,i(o,r))}}_render(e,t,i){const{sx:s,sy1:n,sy2:o}=null!=i?i:this;e.beginPath();for(let r=0,a=n.length;r<a;r++)e.lineTo(s[r],n[r]);for(let r=o.length-1;r>=0;r--)e.lineTo(s[r],o[r]);e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e)}scenterxy(e){return[this.sx[e],(this.sy1[e]+this.sy2[e])/2]}_hit_point(e){const t=this.sx.length,i=new h.Selection;for(let s=0,n=t-1;s<n;s++){const t=[this.sx[s],this.sx[s+1],this.sx[s+1],this.sx[s]],n=[this.sy1[s],this.sy1[s+1],this.sy2[s+1],this.sy2[s]];if(l.point_in_poly(e.sx,e.sy,t,n)){i.add_to_selected_glyphs(this.model),i.view=this,i.line_indices=[s];break}}return i}_map_data(){this.sx=this.renderer.xscale.v_compute(this._x),this.sy1=this.renderer.yscale.v_compute(this._y1),this.sy2=this.renderer.yscale.v_compute(this._y2)}}i.VAreaView=_,_.__name__="VAreaView";class u extends a.Area{constructor(e){super(e)}}i.VArea=u,r=u,u.__name__="VArea",r.prototype.default_view=_,r.define((({})=>({x:[c.XCoordinateSpec,{field:"x"}],y1:[c.YCoordinateSpec,{field:"y1"}],y2:[c.YCoordinateSpec,{field:"y2"}]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(24),l=e(191),c=e(70);class h extends r.Model{constructor(e){super(e)}initialize(){super.initialize(),this.compute_indices()}connect_signals(){super.connect_signals(),this.connect(this.properties.filters.change,(()=>this.compute_indices()));const e=()=>{const e=()=>this.compute_indices();null!=this.source&&(this.connect(this.source.change,e),this.source instanceof c.ColumnarDataSource&&(this.connect(this.source.streaming,e),this.connect(this.source.patching,e)))};let t=null!=this.source;t?e():this.connect(this.properties.source.change,(()=>{t||(e(),t=!0)}))}compute_indices(){var e;const{source:t}=this;if(null==t)return;const i=null!==(e=t.get_length())&&void 0!==e?e:1,s=a.Indices.all_set(i);for(const n of this.filters)s.intersect(n.compute_indices(t));this.indices=s,this._indices=[...s],this.indices_map_to_subset()}indices_map_to_subset(){this.indices_map={};for(let e=0;e<this._indices.length;e++)this.indices_map[this._indices[e]]=e}convert_selection_from_subset(e){return e.map((e=>this._indices[e]))}convert_selection_to_subset(e){return e.map((e=>this.indices_map[e]))}convert_indices_from_subset(e){return e.map((e=>this._indices[e]))}}i.CDSView=h,o=h,h.__name__="CDSView",o.define((({Array:e,Ref:t})=>({filters:[e(t(l.Filter)),[]],source:[t(c.ColumnarDataSource)]}))),o.internal((({Int:e,Dict:t,Ref:i,Nullable:s})=>({indices:[i(a.Indices)],indices_map:[t(e),{}],masked:[s(i(a.Indices)),null]})))},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{constructor(e){super(e)}}i.Filter=r,r.__name__="Filter"},function(e,t,i,s,n){s(),n("BasicTickFormatter",e(146).BasicTickFormatter),n("CategoricalTickFormatter",e(142).CategoricalTickFormatter),n("DatetimeTickFormatter",e(150).DatetimeTickFormatter),n("FuncTickFormatter",e(193).FuncTickFormatter),n("LogTickFormatter",e(163).LogTickFormatter),n("MercatorTickFormatter",e(166).MercatorTickFormatter),n("NumeralTickFormatter",e(194).NumeralTickFormatter),n("PrintfTickFormatter",e(195).PrintfTickFormatter),n("TickFormatter",e(131).TickFormatter)},function(e,t,i,s,n){var o;s();const r=e(131),a=e(13),l=e(34);class c extends r.TickFormatter{constructor(e){super(e)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}_make_func(){const e=(0,l.use_strict)(this.code);return new Function("tick","index","ticks",...this.names,e)}doFormat(e,t){const i=this._make_func().bind({});return e.map(((e,t,s)=>`${i(e,t,s,...this.values)}`))}}i.FuncTickFormatter=c,o=c,c.__name__="FuncTickFormatter",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){var o;s();const r=(0,e(1).__importStar)(e(153)),a=e(131),l=e(20);class c extends a.TickFormatter{constructor(e){super(e)}get _rounding_fn(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}doFormat(e,t){const{format:i,language:s,_rounding_fn:n}=this;return e.map((e=>r.format(e,i,s,n)))}}i.NumeralTickFormatter=c,o=c,c.__name__="NumeralTickFormatter",o.define((({String:e})=>({format:[e,"0,0"],language:[e,"en"],rounding:[l.RoundingFunction,"round"]})))},function(e,t,i,s,n){var o;s();const r=e(131),a=e(152);class l extends r.TickFormatter{constructor(e){super(e)}doFormat(e,t){return e.map((e=>(0,a.sprintf)(this.format,e)))}}i.PrintfTickFormatter=l,o=l,l.__name__="PrintfTickFormatter",o.define((({String:e})=>({format:[e,"%s"]})))},function(e,t,i,s,n){s(),n("CategoricalColorMapper",e(197).CategoricalColorMapper),n("CategoricalMarkerMapper",e(199).CategoricalMarkerMapper),n("CategoricalPatternMapper",e(200).CategoricalPatternMapper),n("ContinuousColorMapper",e(172).ContinuousColorMapper),n("ColorMapper",e(173).ColorMapper),n("LinearColorMapper",e(201).LinearColorMapper),n("LogColorMapper",e(202).LogColorMapper),n("ScanningColorMapper",e(171).ScanningColorMapper),n("EqHistColorMapper",e(203).EqHistColorMapper)},function(e,t,i,s,n){var o;s();const r=e(198),a=e(173),l=e(67);class c extends a.ColorMapper{constructor(e){super(e)}_v_compute(e,t,i,{nan_color:s}){(0,r.cat_v_compute)(e,this.factors,i,t,this.start,this.end,s)}}i.CategoricalColorMapper=c,o=c,c.__name__="CategoricalColorMapper",o.define((({Number:e,Nullable:t})=>({factors:[l.FactorSeq],start:[e,0],end:[t(e),null]})))},function(e,t,i,s,n){s();const o=e(12),r=e(8);function a(e,t){if(e.length!=t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(e[i]!==t[i])return!1;return!0}i._cat_equals=a,i.cat_v_compute=function(e,t,i,s,n,l,c){const h=e.length;for(let _=0;_<h;_++){let h,u,d=e[_];(0,r.isString)(d)?h=(0,o.index_of)(t,d):(null!=n?d=null!=l?d.slice(n,l):d.slice(n):null!=l&&(d=d.slice(0,l)),h=1==d.length?(0,o.index_of)(t,d[0]):(0,o.find_index)(t,(e=>a(e,d)))),u=h<0||h>=i.length?c:i[h],s[_]=u}}},function(e,t,i,s,n){var o;s();const r=e(198),a=e(67),l=e(174),c=e(20);class h extends l.Mapper{constructor(e){super(e)}v_compute(e){const t=new Array(e.length);return(0,r.cat_v_compute)(e,this.factors,this.markers,t,this.start,this.end,this.default_value),t}}i.CategoricalMarkerMapper=h,o=h,h.__name__="CategoricalMarkerMapper",o.define((({Number:e,Array:t,Nullable:i})=>({factors:[a.FactorSeq],markers:[t(c.MarkerType)],start:[e,0],end:[i(e),null],default_value:[c.MarkerType,"circle"]})))},function(e,t,i,s,n){var o;s();const r=e(198),a=e(67),l=e(174),c=e(20);class h extends l.Mapper{constructor(e){super(e)}v_compute(e){const t=new Array(e.length);return(0,r.cat_v_compute)(e,this.factors,this.patterns,t,this.start,this.end,this.default_value),t}}i.CategoricalPatternMapper=h,o=h,h.__name__="CategoricalPatternMapper",o.define((({Number:e,Array:t,Nullable:i})=>({factors:[a.FactorSeq],patterns:[t(c.HatchPatternType)],start:[e,0],end:[i(e),null],default_value:[c.HatchPatternType," "]})))},function(e,t,i,s,n){s();const o=e(172),r=e(12);class a extends o.ContinuousColorMapper{constructor(e){super(e)}scan(e,t){const i=null!=this.low?this.low:(0,r.min)(e),s=null!=this.high?this.high:(0,r.max)(e);return{max:s,min:i,norm_factor:1/(s-i),normed_interval:1/t}}cmap(e,t,i,s,n){const o=t.length-1;if(e==n.max)return t[o];const r=(e-n.min)*n.norm_factor,a=Math.floor(r/n.normed_interval);return a<0?i:a>o?s:t[a]}}i.LinearColorMapper=a,a.__name__="LinearColorMapper"},function(e,t,i,s,n){s();const o=e(172),r=e(12);class a extends o.ContinuousColorMapper{constructor(e){super(e)}scan(e,t){const i=null!=this.low?this.low:(0,r.min)(e),s=null!=this.high?this.high:(0,r.max)(e);return{max:s,min:i,scale:t/(Math.log(s)-Math.log(i))}}cmap(e,t,i,s,n){const o=t.length-1;if(e>n.max)return s;if(e==n.max)return t[o];if(e<n.min)return i;const r=Math.log(e)-Math.log(n.min);let a=Math.floor(r*n.scale);return a>o&&(a=o),t[a]}}i.LogColorMapper=a,a.__name__="LogColorMapper"},function(e,t,i,s,n){var o;s();const r=e(171),a=e(12),l=e(9);class c extends r.ScanningColorMapper{constructor(e){super(e)}scan(e,t){let i=null!=this.low?this.low:(0,a.min)(e);const s=null!=this.high?this.high:(0,a.max)(e),n=this.bins,o=(0,l.linspace)(i,s,n+1),r=(0,a.bin_counts)(e,o);let c=0;for(let a=0;a<n;a++)0!=r[a]&&c++;const h=new Array(c+1),_=new Array(c+1);for(let a=0,l=1;a<n;a++)0!=r[a]&&(h[l]=r[a],_[l]=(o[a]+o[a+1])/2,l++);h[0]=0,_[0]=2*_[1]-_[c];const u=(0,l.cumsum)(h),d=u[1],p=u[c]-d;for(let a=1;a<=c;a++)u[a]=(u[a]-d)/p;u[0]=-1;let m=0;if(this.rescale_discrete_levels){const e=-.5/98,t=e*c+(1.5-2*e);t>1&&(m=1-t)}const g=(0,l.linspace)(m,1,t+1),f=(0,a.interpolate)(g,u,_);return this.rescale_discrete_levels?i=f[0]:f[0]=i,f[f.length-1]=s,{min:i,max:s,binning:f}}}i.EqHistColorMapper=c,o=c,c.__name__="EqHistColorMapper",o.define((({Boolean:e,Int:t})=>({bins:[t,65536],rescale_discrete_levels:[e,!1]})))},function(e,t,i,s,n){s(),n("CategoricalScale",e(62).CategoricalScale),n("ContinuousScale",e(60).ContinuousScale),n("LinearScale",e(59).LinearScale),n("LinearInterpolationScale",e(205).LinearInterpolationScale),n("LogScale",e(61).LogScale),n("Scale",e(55).Scale)},function(e,t,i,s,n){var o;s();const r=e(55),a=e(59),l=e(12);class c extends r.Scale{constructor(e){super(e)}connect_signals(){super.connect_signals();const{source_range:e,target_range:t}=this.properties;this.on_change([e,t],(()=>{this.linear_scale=new a.LinearScale({source_range:this.source_range,target_range:this.target_range})}))}get s_compute(){throw new Error("not implemented")}get s_invert(){throw new Error("not implemented")}compute(e){return e}v_compute(e){const{binning:t}=this,{start:i,end:s}=this.source_range,n=i,o=s,r=t.length,a=(s-i)/(r-1),c=new Float64Array(r);for(let l=0;l<r;l++)c[l]=i+l*a;const h=(0,l.map)(e,(e=>{if(e<n)return n;if(e>o)return o;const i=(0,l.left_edge_index)(e,t);if(-1==i)return n;if(i>=r-1)return o;const s=t[i],a=(e-s)/(t[i+1]-s),h=c[i];return h+a*(c[i+1]-h)}));return this.linear_scale.v_compute(h)}invert(e){return e}v_invert(e){return new Float64Array(e)}}i.LinearInterpolationScale=c,o=c,c.__name__="LinearInterpolationScale",o.internal((({Arrayable:e,Ref:t})=>({binning:[e],linear_scale:[t(a.LinearScale),e=>new a.LinearScale({source_range:e.source_range,target_range:e.target_range})]})))},function(e,t,i,s,n){s(),n("DataRange",e(64).DataRange),n("DataRange1d",e(63).DataRange1d),n("FactorRange",e(67).FactorRange),n("Range",e(57).Range),n("Range1d",e(58).Range1d)},function(e,t,i,s,n){s();var o=e(124);n("Sizeable",o.Sizeable),n("SizingPolicy",o.SizingPolicy);var r=e(125);n("Layoutable",r.Layoutable),n("LayoutItem",r.LayoutItem);var a=e(208);n("HStack",a.HStack),n("VStack",a.VStack);var l=e(209);n("Grid",l.Grid),n("Row",l.Row),n("Column",l.Column);var c=e(210);n("ContentBox",c.ContentBox),n("VariadicBox",c.VariadicBox)},function(e,t,i,s,n){s();const o=e(125),r=e(65);class a extends o.Layoutable{constructor(){super(...arguments),this.children=[]}*[Symbol.iterator](){yield*this.children}}i.Stack=a,a.__name__="Stack";class l extends a{_measure(e){let t=0,i=0;for(const s of this.children){const e=s.measure({width:0,height:0});t+=e.width,i=Math.max(i,e.height)}return{width:t,height:i}}_set_geometry(e,t){super._set_geometry(e,t);const i=this.absolute?e.top:0;let s=this.absolute?e.left:0;const{height:n}=e;for(const o of this.children){const{width:e}=o.measure({width:0,height:0});o.set_geometry(new r.BBox({left:s,width:e,top:i,height:n})),s+=e}}}i.HStack=l,l.__name__="HStack";class c extends a{_measure(e){let t=0,i=0;for(const s of this.children){const e=s.measure({width:0,height:0});t=Math.max(t,e.width),i+=e.height}return{width:t,height:i}}_set_geometry(e,t){super._set_geometry(e,t);const i=this.absolute?e.left:0;let s=this.absolute?e.top:0;const{width:n}=e;for(const o of this.children){const{height:e}=o.measure({width:0,height:0});o.set_geometry(new r.BBox({top:s,height:e,left:i,width:n})),s+=e}}}i.VStack=c,c.__name__="VStack";class h extends o.Layoutable{constructor(){super(...arguments),this.children=[]}*[Symbol.iterator](){yield*this.children}_measure(e){const{width_policy:t,height_policy:i}=this.sizing,{min:s,max:n}=Math;let o=0,r=0;for(const a of this.children){const{width:t,height:i}=a.measure(e);o=n(o,t),r=n(r,i)}return{width:(()=>{const{width:i}=this.sizing;if(e.width==1/0)return"fixed"==t&&null!=i?i:o;switch(t){case"fixed":return null!=i?i:o;case"min":return o;case"fit":return null!=i?s(e.width,i):e.width;case"max":return null!=i?n(e.width,i):e.width}})(),height:(()=>{const{height:t}=this.sizing;if(e.height==1/0)return"fixed"==i&&null!=t?t:r;switch(i){case"fixed":return null!=t?t:r;case"min":return r;case"fit":return null!=t?s(e.height,t):e.height;case"max":return null!=t?n(e.height,t):e.height}})()}}_set_geometry(e,t){super._set_geometry(e,t);const i=this.absolute?e:e.relative(),{left:s,right:n,top:o,bottom:a}=i,l=Math.round(i.vcenter),c=Math.round(i.hcenter);for(const h of this.children){const{margin:t,halign:i,valign:_}=h.sizing,{width:u,height:d,inner:p}=h.measure(e),m=(()=>{switch(`${_}_${i}`){case"start_start":return new r.BBox({left:s+t.left,top:o+t.top,width:u,height:d});case"start_center":return new r.BBox({hcenter:c,top:o+t.top,width:u,height:d});case"start_end":return new r.BBox({right:n-t.right,top:o+t.top,width:u,height:d});case"center_start":return new r.BBox({left:s+t.left,vcenter:l,width:u,height:d});case"center_center":return new r.BBox({hcenter:c,vcenter:l,width:u,height:d});case"center_end":return new r.BBox({right:n-t.right,vcenter:l,width:u,height:d});case"end_start":return new r.BBox({left:s+t.left,bottom:a-t.bottom,width:u,height:d});case"end_center":return new r.BBox({hcenter:c,bottom:a-t.bottom,width:u,height:d});case"end_end":return new r.BBox({right:n-t.right,bottom:a-t.bottom,width:u,height:d})}})(),g=null==p?m:new r.BBox({left:m.left+p.left,top:m.top+p.top,right:m.right-p.right,bottom:m.bottom-p.bottom});h.set_geometry(m,g)}}}i.NodeLayout=h,h.__name__="NodeLayout"},function(e,t,i,s,n){s();const o=e(124),r=e(125),a=e(8),l=e(65),c=e(9),{max:h,round:_}=Math;class u{constructor(e){this.def=e,this._map=new Map}get(e){let t=this._map.get(e);return void 0===t&&(t=this.def(),this._map.set(e,t)),t}apply(e,t){const i=this.get(e);this._map.set(e,t(i))}}u.__name__="DefaultMap";class d{constructor(){this._items=[],this._nrows=0,this._ncols=0}get nrows(){return this._nrows}get ncols(){return this._ncols}add(e,t){const{r1:i,c1:s}=e;this._nrows=h(this._nrows,i+1),this._ncols=h(this._ncols,s+1),this._items.push({span:e,data:t})}at(e,t){return this._items.filter((({span:i})=>i.r0<=e&&e<=i.r1&&i.c0<=t&&t<=i.c1)).map((({data:e})=>e))}row(e){return this._items.filter((({span:t})=>t.r0<=e&&e<=t.r1)).map((({data:e})=>e))}col(e){return this._items.filter((({span:t})=>t.c0<=e&&e<=t.c1)).map((({data:e})=>e))}foreach(e){for(const{span:t,data:i}of this._items)e(t,i)}map(e){const t=new d;for(const{span:i,data:s}of this._items)t.add(i,e(i,s));return t}}d.__name__="Container";class p extends r.Layoutable{constructor(e=[]){super(),this.items=e,this.rows="auto",this.cols="auto",this.spacing=0}*[Symbol.iterator](){for(const{layout:e}of this.items)yield e}is_width_expanding(){if(super.is_width_expanding())return!0;if("fixed"==this.sizing.width_policy)return!1;const{cols:e}=this._state;return(0,c.some)(e,(e=>"max"==e.policy))}is_height_expanding(){if(super.is_height_expanding())return!0;if("fixed"==this.sizing.height_policy)return!1;const{rows:e}=this._state;return(0,c.some)(e,(e=>"max"==e.policy))}_init(){var e,t,i,s;super._init();const n=new d;for(const{layout:a,row:c,col:d,row_span:p,col_span:m}of this.items)if(a.sizing.visible){const e=c,t=d,i=c+(null!=p?p:1)-1,s=d+(null!=m?m:1)-1;n.add({r0:e,c0:t,r1:i,c1:s},a)}const{nrows:o,ncols:r}=n,l=new Array(o);for(let d=0;d<o;d++){const i=(()=>{var e;const t=(0,a.isPlainObject)(this.rows)?null!==(e=this.rows[d])&&void 0!==e?e:this.rows["*"]:this.rows;return null==t?{policy:"auto"}:(0,a.isNumber)(t)?{policy:"fixed",height:t}:(0,a.isString)(t)?{policy:t}:t})(),s=null!==(e=i.align)&&void 0!==e?e:"auto";if("fixed"==i.policy)l[d]={policy:"fixed",height:i.height,align:s};else if("min"==i.policy)l[d]={policy:"min",align:s};else if("fit"==i.policy||"max"==i.policy)l[d]={policy:i.policy,flex:null!==(t=i.flex)&&void 0!==t?t:1,align:s};else{if("auto"!=i.policy)throw new Error("unrechable");(0,c.some)(n.row(d),(e=>e.is_height_expanding()))?l[d]={policy:"max",flex:1,align:s}:l[d]={policy:"min",align:s}}}const h=new Array(r);for(let d=0;d<r;d++){const e=(()=>{var e;const t=(0,a.isPlainObject)(this.cols)?null!==(e=this.cols[d])&&void 0!==e?e:this.cols["*"]:this.cols;return null==t?{policy:"auto"}:(0,a.isNumber)(t)?{policy:"fixed",width:t}:(0,a.isString)(t)?{policy:t}:t})(),t=null!==(i=e.align)&&void 0!==i?i:"auto";if("fixed"==e.policy)h[d]={policy:"fixed",width:e.width,align:t};else if("min"==e.policy)h[d]={policy:"min",align:t};else if("fit"==e.policy||"max"==e.policy)h[d]={policy:e.policy,flex:null!==(s=e.flex)&&void 0!==s?s:1,align:t};else{if("auto"!=e.policy)throw new Error("unrechable");(0,c.some)(n.col(d),(e=>e.is_width_expanding()))?h[d]={policy:"max",flex:1,align:t}:h[d]={policy:"min",align:t}}}const[_,u]=(0,a.isNumber)(this.spacing)?[this.spacing,this.spacing]:this.spacing;this._state={items:n,nrows:o,ncols:r,rows:l,cols:h,rspacing:_,cspacing:u}}_measure_totals(e,t){const{nrows:i,ncols:s,rspacing:n,cspacing:o}=this._state;return{height:(0,c.sum)(e)+(i-1)*n,width:(0,c.sum)(t)+(s-1)*o}}_measure_cells(e){const{items:t,nrows:i,ncols:s,rows:n,cols:r,rspacing:a,cspacing:l}=this._state,c=new Array(i);for(let o=0;o<i;o++){const e=n[o];c[o]="fixed"==e.policy?e.height:0}const u=new Array(s);for(let o=0;o<s;o++){const e=r[o];u[o]="fixed"==e.policy?e.width:0}const p=new d;return t.foreach(((t,i)=>{const{r0:s,c0:d,r1:m,c1:g}=t,f=(m-s)*a,b=(g-d)*l;let y=0;for(let n=s;n<=m;n++)y+=e(n,d).height;y+=f;let v=0;for(let n=d;n<=g;n++)v+=e(s,n).width;v+=b;const x=i.measure({width:v,height:y});p.add(t,{layout:i,size_hint:x});const w=new o.Sizeable(x).grow_by(i.sizing.margin);w.height-=f,w.width-=b;const A=[];for(let e=s;e<=m;e++){const t=n[e];"fixed"==t.policy?w.height-=t.height:A.push(e)}if(w.height>0){const e=_(w.height/A.length);for(const t of A)c[t]=h(c[t],e)}const k=[];for(let e=d;e<=g;e++){const t=r[e];"fixed"==t.policy?w.width-=t.width:k.push(e)}if(w.width>0){const e=_(w.width/k.length);for(const t of k)u[t]=h(u[t],e)}})),{size:this._measure_totals(c,u),row_heights:c,col_widths:u,size_hints:p}}_measure_grid(e){const{nrows:t,ncols:i,rows:s,cols:n,rspacing:o,cspacing:r}=this._state,a=this._measure_cells(((e,t)=>{const i=s[e],o=n[t];return{width:"fixed"==o.policy?o.width:1/0,height:"fixed"==i.policy?i.height:1/0}}));let l;l="fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:e.height!=1/0&&this.is_height_expanding()?e.height:a.size.height;let c,u=0;for(let h=0;h<t;h++){const e=s[h];"fit"==e.policy||"max"==e.policy?u+=e.flex:l-=a.row_heights[h]}if(l-=(t-1)*o,0!=u&&l>0)for(let h=0;h<t;h++){const e=s[h];if("fit"==e.policy||"max"==e.policy){const t=_(l*(e.flex/u));l-=t,a.row_heights[h]=t,u-=e.flex}}else if(l<0){let e=0;for(let n=0;n<t;n++)"fixed"!=s[n].policy&&e++;let i=-l;for(let n=0;n<t;n++)if("fixed"!=s[n].policy){const t=a.row_heights[n],s=_(i/e);a.row_heights[n]=h(t-s,0),i-=s>t?t:s,e--}}c="fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:e.width!=1/0&&this.is_width_expanding()?e.width:a.size.width;let d=0;for(let h=0;h<i;h++){const e=n[h];"fit"==e.policy||"max"==e.policy?d+=e.flex:c-=a.col_widths[h]}if(c-=(i-1)*r,0!=d&&c>0)for(let h=0;h<i;h++){const e=n[h];if("fit"==e.policy||"max"==e.policy){const t=_(c*(e.flex/d));c-=t,a.col_widths[h]=t,d-=e.flex}}else if(c<0){let e=0;for(let s=0;s<i;s++)"fixed"!=n[s].policy&&e++;let t=-c;for(let s=0;s<i;s++)if("fixed"!=n[s].policy){const i=a.col_widths[s],n=_(t/e);a.col_widths[s]=h(i-n,0),t-=n>i?i:n,e--}}const{row_heights:p,col_widths:m,size_hints:g}=this._measure_cells(((e,t)=>({width:a.col_widths[t],height:a.row_heights[e]})));return{size:this._measure_totals(p,m),row_heights:p,col_widths:m,size_hints:g}}_measure(e){const{size:t}=this._measure_grid(e);return t}_set_geometry(e,t){super._set_geometry(e,t);const{nrows:i,ncols:s,rspacing:n,cspacing:o}=this._state,{row_heights:r,col_widths:a,size_hints:c}=this._measure_grid(e),d=this._state.rows.map(((e,t)=>Object.assign(Object.assign({},e),{top:0,height:r[t],get bottom(){return this.top+this.height}}))),p=this._state.cols.map(((e,t)=>Object.assign(Object.assign({},e),{left:0,width:a[t],get right(){return this.left+this.width}}))),m=c.map(((e,t)=>Object.assign(Object.assign({},t),{outer:new l.BBox,inner:new l.BBox})));for(let l=0,h=this.absolute?e.top:0;l<i;l++){const e=d[l];e.top=h,h+=e.height+n}for(let l=0,h=this.absolute?e.left:0;l<s;l++){const e=p[l];e.left=h,h+=e.width+o}m.foreach((({r0:e,c0:t,r1:i,c1:s},r)=>{const{layout:a,size_hint:c}=r,{sizing:h}=a,{width:u,height:m}=c,g=function(e,t){let i=(t-e)*o;for(let s=e;s<=t;s++)i+=p[s].width;return i}(t,s),f=function(e,t){let i=(t-e)*n;for(let s=e;s<=t;s++)i+=d[s].height;return i}(e,i),b=t==s&&"auto"!=p[t].align?p[t].align:h.halign,y=e==i&&"auto"!=d[e].align?d[e].align:h.valign;let v=p[t].left;"start"==b?v+=h.margin.left:"center"==b?v+=_((g-u)/2):"end"==b&&(v+=g-h.margin.right-u);let x=d[e].top;"start"==y?x+=h.margin.top:"center"==y?x+=_((f-m)/2):"end"==y&&(x+=f-h.margin.bottom-m),r.outer=new l.BBox({left:v,top:x,width:u,height:m})}));const g=d.map((()=>({start:new u((()=>0)),end:new u((()=>0))}))),f=p.map((()=>({start:new u((()=>0)),end:new u((()=>0))})));m.foreach((({r0:e,c0:t,r1:i,c1:s},{size_hint:n,outer:o})=>{const{inner:r}=n;null!=r&&(g[e].start.apply(o.top,(e=>h(e,r.top))),g[i].end.apply(d[i].bottom-o.bottom,(e=>h(e,r.bottom))),f[t].start.apply(o.left,(e=>h(e,r.left))),f[s].end.apply(p[s].right-o.right,(e=>h(e,r.right))))})),m.foreach((({r0:e,c0:t,r1:i,c1:s},n)=>{const{size_hint:o,outer:r}=n,a=e=>{const t=this.absolute?r:r.relative(),i=t.left+e.left,s=t.top+e.top,n=t.right-e.right,o=t.bottom-e.bottom;return new l.BBox({left:i,top:s,right:n,bottom:o})};if(null!=o.inner){let l=a(o.inner);if(!1!==o.align){const n=g[e].start.get(r.top),o=g[i].end.get(d[i].bottom-r.bottom),c=f[t].start.get(r.left),h=f[s].end.get(p[s].right-r.right);try{l=a({top:n,bottom:o,left:c,right:h})}catch(e){}}n.inner=l}else n.inner=r})),m.foreach(((e,{layout:t,outer:i,inner:s})=>{t.set_geometry(i,s)}))}}i.Grid=p,p.__name__="Grid";class m extends p{constructor(e){super(),this.items=e.map(((e,t)=>({layout:e,row:0,col:t}))),this.rows="fit"}}i.Row=m,m.__name__="Row";class g extends p{constructor(e){super(),this.items=e.map(((e,t)=>({layout:e,row:t,col:0}))),this.cols="fit"}}i.Column=g,g.__name__="Column"},function(e,t,i,s,n){s();const o=e(125),r=e(124),a=e(43);class l extends o.ContentLayoutable{constructor(e){super(),this.content_size=(0,a.unsized)(e,(()=>new r.Sizeable((0,a.size)(e))))}_content_size(){return this.content_size}}i.ContentBox=l,l.__name__="ContentBox";class c extends o.Layoutable{constructor(e){super(),this.el=e}_measure(e){const t=new r.Sizeable(e).bounded_to(this.sizing.size);return(0,a.sized)(this.el,t,(()=>{const e=new r.Sizeable((0,a.content_size)(this.el)),{border:t,padding:i}=(0,a.extents)(this.el);return e.grow_by(t).grow_by(i).map(Math.ceil)}))}}i.VariadicBox=c,c.__name__="VariadicBox";class h extends c{constructor(e){super(e),this._cache=new Map}_measure(e){const{width:t,height:i}=e,s=`${t},${i}`;let n=this._cache.get(s);return null==n&&(n=super._measure(e),this._cache.set(s,n)),n}invalidate_cache(){this._cache.clear()}}i.CachedVariadicBox=h,h.__name__="CachedVariadicBox"},function(e,t,i,s,n){s();const o=e(124),r=e(125),a=e(65);class l extends r.Layoutable{constructor(){super(...arguments),this.min_border={left:0,top:0,right:0,bottom:0},this.padding={left:0,top:0,right:0,bottom:0}}*[Symbol.iterator](){yield this.top_panel,yield this.bottom_panel,yield this.left_panel,yield this.right_panel,yield this.center_panel}_measure(e){e=new o.Sizeable({width:"fixed"==this.sizing.width_policy||e.width==1/0?this.sizing.width:e.width,height:"fixed"==this.sizing.height_policy||e.height==1/0?this.sizing.height:e.height});const t=this.left_panel.measure({width:0,height:e.height}),i=Math.max(t.width,this.min_border.left)+this.padding.left,s=this.right_panel.measure({width:0,height:e.height}),n=Math.max(s.width,this.min_border.right)+this.padding.right,r=this.top_panel.measure({width:e.width,height:0}),a=Math.max(r.height,this.min_border.top)+this.padding.top,l=this.bottom_panel.measure({width:e.width,height:0}),c=Math.max(l.height,this.min_border.bottom)+this.padding.bottom,h=new o.Sizeable(e).shrink_by({left:i,right:n,top:a,bottom:c}),_=this.center_panel.measure(h);return{width:i+_.width+n,height:a+_.height+c,inner:{left:i,right:n,top:a,bottom:c},align:(()=>{const{width_policy:e,height_policy:t}=this.center_panel.sizing;return"fixed"!=e&&"fixed"!=t})()}}_set_geometry(e,t){super._set_geometry(e,t),this.center_panel.set_geometry(t);const i=this.left_panel.measure({width:0,height:e.height}),s=this.right_panel.measure({width:0,height:e.height}),n=this.top_panel.measure({width:e.width,height:0}),o=this.bottom_panel.measure({width:e.width,height:0}),{left:r,top:l,right:c,bottom:h}=t;this.top_panel.set_geometry(new a.BBox({left:r,right:c,bottom:l,height:n.height})),this.bottom_panel.set_geometry(new a.BBox({left:r,right:c,top:h,height:o.height})),this.left_panel.set_geometry(new a.BBox({top:l,bottom:h,right:r,width:i.width})),this.right_panel.set_geometry(new a.BBox({top:l,bottom:h,left:c,width:s.width}))}}i.BorderLayout=l,l.__name__="BorderLayout"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(119),l=e(10),c=e(20),h=e(120),_=e(123),u=(0,o.__importStar)(e(48));class d extends a.TextAnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new _.SideLayout(e,(()=>this.get_size()),!1):void 0}_get_size(){const{text:e}=this.model,t=new h.TextBox({text:e}),{angle:i,angle_units:s}=this.model;t.angle=(0,l.resolve_angle)(i,s),t.visuals=this.visuals.text.values();const{width:n,height:o}=t.size();return{width:n,height:o}}_render(){const{angle:e,angle_units:t}=this.model,i=(0,l.resolve_angle)(e,t),s=null!=this.layout?this.layout:this.plot_view.frame,n=this.coordinates.x_scale,o=this.coordinates.y_scale;let r="data"==this.model.x_units?n.compute(this.model.x):s.bbox.xview.compute(this.model.x),a="data"==this.model.y_units?o.compute(this.model.y):s.bbox.yview.compute(this.model.y);r+=this.model.x_offset,a-=this.model.y_offset,("canvas"==this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,this.model.text,r,a,i)}}i.LabelView=d,d.__name__="LabelView";class p extends a.TextAnnotation{constructor(e){super(e)}}i.Label=p,r=p,p.__name__="Label",r.prototype.default_view=d,r.mixins([u.Text,["border_",u.Line],["background_",u.Fill]]),r.define((({Number:e,String:t,Angle:i})=>({x:[e],x_units:[c.SpatialUnits,"data"],y:[e],y_units:[c.SpatialUnits,"data"],text:[t,""],angle:[i,0],angle_units:[c.AngleUnits,"rad"],x_offset:[e,0],y_offset:[e,0]}))),r.override({background_fill_color:null,border_line_color:null})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(69),l=(0,o.__importStar)(e(48)),c=e(20),h=e(43),_=e(120),u=(0,o.__importStar)(e(18)),d=e(11);class p extends a.DataAnnotationView{set_data(e){var t;if(super.set_data(e),null===(t=this.els)||void 0===t||t.forEach((e=>(0,h.remove)(e))),"css"==this.model.render_mode){const e=this.els=[...this.text].map((()=>(0,h.div)({style:{display:"none"}})));for(const t of e)this.plot_view.canvas_view.add_overlay(t)}else delete this.els}remove(){var e;null===(e=this.els)||void 0===e||e.forEach((e=>(0,h.remove)(e))),super.remove()}_rerender(){"css"==this.model.render_mode?this.render():this.request_render()}map_data(){const{x_scale:e,y_scale:t}=this.coordinates,i=null!=this.layout?this.layout:this.plot_view.frame;this.sx="data"==this.model.x_units?e.v_compute(this._x):i.bbox.xview.v_compute(this._x),this.sy="data"==this.model.y_units?t.v_compute(this._y):i.bbox.yview.v_compute(this._y)}paint(){const e="canvas"==this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),{ctx:t}=this.layer;for(let i=0,s=this.text.length;i<s;i++){const s=this.x_offset.get(i),n=this.y_offset.get(i),o=this.sx[i]+s,r=this.sy[i]-n,a=this.angle.get(i);e(t,i,this.text.get(i),o,r,a)}}_v_canvas_text(e,t,i,s,n,o){const r=new _.TextBox({text:i});r.angle=o,r.position={sx:s,sy:n},r.visuals=this.visuals.text.values(t);const{background_fill:a,border_line:l}=this.visuals;if(a.doit||l.doit){const{p0:i,p1:s,p2:n,p3:o}=r.rect();e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.lineTo(n.x,n.y),e.lineTo(o.x,o.y),e.closePath(),this.visuals.background_fill.apply(e,t),this.visuals.border_line.apply(e,t)}this.visuals.text.doit&&r.paint(e)}_v_css_text(e,t,i,s,n,o){(0,d.assert)(null!=this.els);const r=this.els[t];r.textContent=i,this.visuals.text.set_vectorize(e,t),r.style.position="absolute",r.style.left=`${s}px`,r.style.top=`${n}px`,r.style.color=e.fillStyle,r.style.font=e.font,r.style.lineHeight="normal",r.style.whiteSpace="pre";const[a,l]=(()=>{switch(this.visuals.text.text_align.get(t)){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[c,_]=(()=>{switch(this.visuals.text.text_baseline.get(t)){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}})();let u=`translate(${l}, ${_})`;o&&(u+=`rotate(${o}rad)`),r.style.transformOrigin=`${a} ${c}`,r.style.transform=u,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(e,t),r.style.backgroundColor=e.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(e,t),r.style.borderStyle=e.lineDash.length<2?"solid":"dashed",r.style.borderWidth=`${e.lineWidth}px`,r.style.borderColor=e.strokeStyle),(0,h.display)(r)}}i.LabelSetView=p,p.__name__="LabelSetView";class m extends a.DataAnnotation{constructor(e){super(e)}}i.LabelSet=m,r=m,m.__name__="LabelSet",r.prototype.default_view=p,r.mixins([l.TextVector,["border_",l.LineVector],["background_",l.FillVector]]),r.define((()=>({x:[u.XCoordinateSpec,{field:"x"}],y:[u.YCoordinateSpec,{field:"y"}],x_units:[c.SpatialUnits,"data"],y_units:[c.SpatialUnits,"data"],text:[u.StringSpec,{field:"text"}],angle:[u.AngleSpec,0],x_offset:[u.NumberSpec,{value:0}],y_offset:[u.NumberSpec,{value:0}],render_mode:[c.RenderMode,"canvas"]}))),r.override({background_fill_color:null,border_line_color:null})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=e(215),c=e(20),h=(0,o.__importStar)(e(48)),_=e(15),u=e(123),d=e(121),p=e(65),m=e(9),g=e(8),f=e(11);class b extends a.AnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new u.SideLayout(e,(()=>this.get_size())):void 0}cursor(e,t){return"none"==this.model.click_policy?null:"pointer"}get legend_padding(){return null!=this.model.border_line_color?this.model.padding:0}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render())),this.connect(this.model.item_change,(()=>this.request_render()))}compute_legend_bbox(){const e=this.model.get_legend_names(),{glyph_height:t,glyph_width:i}=this.model,{label_height:s,label_width:n}=this.model;this.max_label_height=(0,m.max)([(0,d.font_metrics)(this.visuals.label_text.font_value()).height,s,t]);const{ctx:o}=this.layer;o.save(),this.visuals.label_text.set_value(o),this.text_widths=new Map;for(const d of e)this.text_widths.set(d,(0,m.max)([o.measureText(d).width,n]));this.visuals.title_text.set_value(o),this.title_height=this.model.title?(0,d.font_metrics)(this.visuals.title_text.font_value()).height+this.model.title_standoff:0,this.title_width=this.model.title?o.measureText(this.model.title).width:0,o.restore();const r=Math.max((0,m.max)([...this.text_widths.values()]),0),a=this.model.margin,{legend_padding:l}=this,c=this.model.spacing,{label_standoff:h}=this.model;let _,u;if("vertical"==this.model.orientation)_=e.length*this.max_label_height+Math.max(e.length-1,0)*c+2*l+this.title_height,u=(0,m.max)([r+i+h+2*l,this.title_width+2*l]);else{let t=2*l+Math.max(e.length-1,0)*c;for(const[,e]of this.text_widths)t+=(0,m.max)([e,n])+i+h;u=(0,m.max)([this.title_width+2*l,t]),_=this.max_label_height+this.title_height+2*l}const b=null!=this.layout?this.layout:this.plot_view.frame,[y,v]=b.bbox.ranges,{location:x}=this.model;let w,A;if((0,g.isString)(x))switch(x){case"top_left":w=y.start+a,A=v.start+a;break;case"top":case"top_center":w=(y.end+y.start)/2-u/2,A=v.start+a;break;case"top_right":w=y.end-a-u,A=v.start+a;break;case"bottom_right":w=y.end-a-u,A=v.end-a-_;break;case"bottom":case"bottom_center":w=(y.end+y.start)/2-u/2,A=v.end-a-_;break;case"bottom_left":w=y.start+a,A=v.end-a-_;break;case"left":case"center_left":w=y.start+a,A=(v.end+v.start)/2-_/2;break;case"center":case"center_center":w=(y.end+y.start)/2-u/2,A=(v.end+v.start)/2-_/2;break;case"right":case"center_right":w=y.end-a-u,A=(v.end+v.start)/2-_/2}else if((0,g.isArray)(x)&&2==x.length){const[e,t]=x;w=b.bbox.xview.compute(e),A=b.bbox.yview.compute(t)-_}else(0,f.unreachable)();return new p.BBox({left:w,top:A,width:u,height:_})}interactive_bbox(){return this.compute_legend_bbox()}interactive_hit(e,t){return this.interactive_bbox().contains(e,t)}on_hit(e,t){let i;const{glyph_width:s}=this.model,{legend_padding:n}=this,o=this.model.spacing,{label_standoff:r}=this.model;let a=i=n;const l=this.compute_legend_bbox(),c="vertical"==this.model.orientation;for(const h of this.model.items){const _=h.get_labels_list_from_label_prop();for(const u of _){const _=l.x+a,d=l.y+i+this.title_height;let m,g;if([m,g]=c?[l.width-2*n,this.max_label_height]:[this.text_widths.get(u)+s+r,this.max_label_height],new p.BBox({left:_,top:d,width:m,height:g}).contains(e,t)){switch(this.model.click_policy){case"hide":for(const e of h.renderers)e.visible=!e.visible;break;case"mute":for(const e of h.renderers)e.muted=!e.muted}return!0}c?i+=this.max_label_height+o:a+=this.text_widths.get(u)+s+r+o}}return!1}_render(){if(0==this.model.items.length)return;if(!(0,m.some)(this.model.items,(e=>e.visible)))return;for(const i of this.model.items)i.legend=this.model;const{ctx:e}=this.layer,t=this.compute_legend_bbox();e.save(),this._draw_legend_box(e,t),this._draw_legend_items(e,t),this._draw_title(e,t),e.restore()}_draw_legend_box(e,t){e.beginPath(),e.rect(t.x,t.y,t.width,t.height),this.visuals.background_fill.apply(e),this.visuals.border_line.apply(e)}_draw_legend_items(e,t){const{glyph_width:i,glyph_height:s}=this.model,{legend_padding:n}=this,o=this.model.spacing,{label_standoff:r}=this.model;let a=n,l=n;const c="vertical"==this.model.orientation;for(const h of this.model.items){if(!h.visible)continue;const _=h.get_labels_list_from_label_prop(),u=h.get_field_from_label_prop();if(0==_.length)continue;const d=(()=>{switch(this.model.click_policy){case"none":return!0;case"hide":return(0,m.every)(h.renderers,(e=>e.visible));case"mute":return(0,m.every)(h.renderers,(e=>!e.muted))}})();for(const p of _){const _=t.x+a,m=t.y+l+this.title_height,g=_+i,f=m+s;c?l+=this.max_label_height+o:a+=this.text_widths.get(p)+i+r+o,this.visuals.label_text.set_value(e),e.fillText(p,g+r,m+this.max_label_height/2);for(const t of h.renderers){const i=this.plot_view.renderer_view(t);null==i||i.draw_legend(e,_,g,m,f,u,p,h.index)}if(!d){let s,o;[s,o]=c?[t.width-2*n,this.max_label_height]:[this.text_widths.get(p)+i+r,this.max_label_height],e.beginPath(),e.rect(_,m,s,o),this.visuals.inactive_fill.set_value(e),e.fill()}}}}_draw_title(e,t){const{title:i}=this.model;i&&this.visuals.title_text.doit&&(e.save(),e.translate(t.x0,t.y0+this.title_height),this.visuals.title_text.set_value(e),e.fillText(i,this.legend_padding,this.legend_padding-this.model.title_standoff),e.restore())}_get_size(){const{width:e,height:t}=this.compute_legend_bbox();return{width:e+2*this.model.margin,height:t+2*this.model.margin}}}i.LegendView=b,b.__name__="LegendView";class y extends a.Annotation{constructor(e){super(e)}initialize(){super.initialize(),this.item_change=new _.Signal0(this,"item_change")}get_legend_names(){const e=[];for(const t of this.items){const i=t.get_labels_list_from_label_prop();e.push(...i)}return e}}i.Legend=y,r=y,y.__name__="Legend",r.prototype.default_view=b,r.mixins([["label_",h.Text],["title_",h.Text],["inactive_",h.Fill],["border_",h.Line],["background_",h.Fill]]),r.define((({Number:e,String:t,Array:i,Tuple:s,Or:n,Ref:o,Nullable:r})=>({orientation:[c.Orientation,"vertical"],location:[n(c.LegendLocation,s(e,e)),"top_right"],title:[r(t),null],title_standoff:[e,5],label_standoff:[e,5],glyph_height:[e,20],glyph_width:[e,20],label_height:[e,20],label_width:[e,20],margin:[e,10],padding:[e,10],spacing:[e,3],items:[i(o(l.LegendItem)),[]],click_policy:[c.LegendClickPolicy,"none"]}))),r.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:"13px",label_text_baseline:"middle",title_text_font_size:"13px",title_text_font_style:"italic"})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(53),l=e(175),c=e(70),h=e(216),_=(0,o.__importStar)(e(18)),u=e(19),d=e(9);class p extends a.Model{constructor(e){super(e)}_check_data_sources_on_renderers(){if(null!=this.get_field_from_label_prop()){if(this.renderers.length<1)return!1;const e=this.renderers[0].data_source;if(null!=e)for(const t of this.renderers)if(t.data_source!=e)return!1}return!0}_check_field_label_on_data_source(){const e=this.get_field_from_label_prop();if(null!=e){if(this.renderers.length<1)return!1;const t=this.renderers[0].data_source;if(null!=t&&!(0,d.includes)(t.columns(),e))return!1}return!0}initialize(){super.initialize(),this.legend=null,this.connect(this.change,(()=>{var e;return null===(e=this.legend)||void 0===e?void 0:e.item_change.emit()})),this._check_data_sources_on_renderers()||u.logger.error("Non matching data sources on legend item renderers"),this._check_field_label_on_data_source()||u.logger.error(`Bad column name on label: ${this.label}`)}get_field_from_label_prop(){const{label:e}=this;return(0,h.isField)(e)?e.field:null}get_labels_list_from_label_prop(){if(!this.visible)return[];if((0,h.isValue)(this.label)){const{value:e}=this.label;return null!=e?[e]:[]}const e=this.get_field_from_label_prop();if(null!=e){let t;if(!this.renderers[0]||null==this.renderers[0].data_source)return["No source found"];if(t=this.renderers[0].data_source,t instanceof c.ColumnarDataSource){const i=t.get_column(e);return null!=i?(0,d.uniq)(Array.from(i)):["Invalid field"]}}return[]}}i.LegendItem=p,r=p,p.__name__="LegendItem",r.define((({Boolean:e,Int:t,Array:i,Ref:s,Nullable:n})=>({label:[_.NullStringSpec,null],renderers:[i(s(l.GlyphRenderer)),[]],index:[n(t),null],visible:[e,!0]})))},function(e,t,i,s,n){s();const o=e(8);i.isValue=function(e){return(0,o.isPlainObject)(e)&&"value"in e},i.isField=function(e){return(0,o.isPlainObject)(e)&&"field"in e},i.isExpr=function(e){return(0,o.isPlainObject)(e)&&"expr"in e}},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=(0,o.__importStar)(e(48)),c=e(20);class h extends a.AnnotationView{connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_render(){const{xs:e,ys:t}=this.model;if(e.length!=t.length)return;const i=e.length;if(i<3)return;const{frame:s}=this.plot_view,{ctx:n}=this.layer,o=this.coordinates.x_scale,r=this.coordinates.y_scale,{screen:a}=this.model;function l(e,t,i,s){return a?e:"data"==t?i.v_compute(e):s.v_compute(e)}const c=l(e,this.model.xs_units,o,s.bbox.xview),h=l(t,this.model.ys_units,r,s.bbox.yview);n.beginPath();for(let _=0;_<i;_++)n.lineTo(c[_],h[_]);n.closePath(),this.visuals.fill.apply(n),this.visuals.hatch.apply(n),this.visuals.line.apply(n)}}i.PolyAnnotationView=h,h.__name__="PolyAnnotationView";class _ extends a.Annotation{constructor(e){super(e)}update({xs:e,ys:t}){this.setv({xs:e,ys:t,screen:!0},{check_eq:!1})}}i.PolyAnnotation=_,r=_,_.__name__="PolyAnnotation",r.prototype.default_view=h,r.mixins([l.Line,l.Fill,l.Hatch]),r.define((({Number:e,Array:t})=>({xs:[t(e),[]],xs_units:[c.SpatialUnits,"data"],ys:[t(e),[]],ys_units:[c.SpatialUnits,"data"]}))),r.internal((({Boolean:e})=>({screen:[e,!1]}))),r.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=(0,o.__importStar)(e(48));class c extends a.AnnotationView{connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_render(){const{gradient:e,y_intercept:t}=this.model;if(null==e||null==t)return;const{frame:i}=this.plot_view,s=this.coordinates.x_scale,n=this.coordinates.y_scale;let o,r,a,l;if(0==e)o=n.compute(t),r=o,a=i.bbox.left,l=a+i.bbox.width;else{o=i.bbox.top,r=o+i.bbox.height;const c=(n.invert(o)-t)/e,h=(n.invert(r)-t)/e;a=s.compute(c),l=s.compute(h)}const{ctx:c}=this.layer;c.save(),c.beginPath(),this.visuals.line.set_value(c),c.moveTo(a,o),c.lineTo(l,r),c.stroke(),c.restore()}}i.SlopeView=c,c.__name__="SlopeView";class h extends a.Annotation{constructor(e){super(e)}}i.Slope=h,r=h,h.__name__="Slope",r.prototype.default_view=c,r.mixins(l.Line),r.define((({Number:e,Nullable:t})=>({gradient:[t(e),null],y_intercept:[t(e),null]}))),r.override({line_color:"black"})},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=(0,o.__importStar)(e(48)),c=e(20);class h extends a.AnnotationView{connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.plot_view.request_paint(this)))}_render(){const{location:e}=this.model;if(null==e)return;const{frame:t}=this.plot_view,i=this.coordinates.x_scale,s=this.coordinates.y_scale,n=(t,i)=>"data"==this.model.location_units?t.compute(e):this.model.for_hover?e:i.compute(e);let o,r,a,l;"width"==this.model.dimension?(a=n(s,t.bbox.yview),r=t.bbox.left,l=t.bbox.width,o=this.model.line_width):(a=t.bbox.top,r=n(i,t.bbox.xview),l=this.model.line_width,o=t.bbox.height);const{ctx:c}=this.layer;c.save(),c.beginPath(),this.visuals.line.set_value(c),c.moveTo(r,a),"width"==this.model.dimension?c.lineTo(r+l,a):c.lineTo(r,a+o),c.stroke(),c.restore()}}i.SpanView=h,h.__name__="SpanView";class _ extends a.Annotation{constructor(e){super(e)}}i.Span=_,r=_,_.__name__="Span",r.prototype.default_view=h,r.mixins(l.Line),r.define((({Number:e,Nullable:t})=>({render_mode:[c.RenderMode,"canvas"],location:[t(e),null],location_units:[c.SpatialUnits,"data"],dimension:[c.Dimension,"width"]}))),r.internal((({Boolean:e})=>({for_hover:[e,!1]}))),r.override({line_color:"black"})},function(e,t,i,s,n){var o;s();const r=e(40),a=e(221),l=e(113),c=e(43),h=e(123),_=e(65);class u extends r.AnnotationView{constructor(){super(...arguments),this._invalidate_toolbar=!0,this._previous_bbox=new _.BBox}update_layout(){this.layout=new h.SideLayout(this.panel,(()=>this.get_size()),!0)}initialize(){super.initialize(),this.el=(0,c.div)(),this.plot_view.canvas_view.add_event(this.el)}async lazy_initialize(){await super.lazy_initialize(),this._toolbar_view=await(0,l.build_view)(this.model.toolbar,{parent:this}),this.plot_view.visibility_callbacks.push((e=>this._toolbar_view.set_visibility(e)))}remove(){this._toolbar_view.remove(),(0,c.remove)(this.el),super.remove()}render(){this.model.visible||(0,c.undisplay)(this.el),super.render()}_render(){const{bbox:e}=this.layout;this._previous_bbox.equals(e)||((0,c.position)(this.el,e),this._previous_bbox=e,this._invalidate_toolbar=!0),this._invalidate_toolbar&&(this.el.style.position="absolute",this.el.style.overflow="hidden",(0,c.empty)(this.el),this.el.appendChild(this._toolbar_view.el),this._toolbar_view.layout.bbox=e,this._toolbar_view.render(),this._invalidate_toolbar=!1),(0,c.display)(this.el)}_get_size(){const{tools:e,logo:t}=this.model.toolbar;return{width:30*e.length+(null!=t?25:0)+15,height:30}}}i.ToolbarPanelView=u,u.__name__="ToolbarPanelView";class d extends r.Annotation{constructor(e){super(e)}}i.ToolbarPanel=d,o=d,d.__name__="ToolbarPanel",o.prototype.default_view=u,o.define((({Ref:e})=>({toolbar:[e(a.Toolbar)]})))},function(e,t,i,s,n){var o;s();const r=e(8),a=e(9),l=e(13),c=e(222),h=e(223),_=e(232),u=e(233);function d(e){switch(e){case"tap":return"active_tap";case"pan":return"active_drag";case"pinch":case"scroll":return"active_scroll";case"multi":return"active_multi"}return null}function p(e){return"tap"==e||"pan"==e}i.Drag=c.Tool,i.Inspection=c.Tool,i.Scroll=c.Tool,i.Tap=c.Tool;class m extends u.ToolbarBase{constructor(e){super(e)}connect_signals(){super.connect_signals();const{tools:e,active_drag:t,active_inspect:i,active_scroll:s,active_tap:n,active_multi:o}=this.properties;this.on_change([e,t,i,s,n,o],(()=>this._init_tools()))}_init_tools(){if(super._init_tools(),"auto"==this.active_inspect);else if(this.active_inspect instanceof _.InspectTool){let e=!1;for(const t of this.inspectors)t!=this.active_inspect?t.active=!1:e=!0;e||(this.active_inspect=null)}else if((0,r.isArray)(this.active_inspect)){const e=(0,a.intersection)(this.active_inspect,this.inspectors);e.length!=this.active_inspect.length&&(this.active_inspect=e);for(const t of this.inspectors)(0,a.includes)(this.active_inspect,t)||(t.active=!1)}else if(null==this.active_inspect)for(const t of this.inspectors)t.active=!1;const e=e=>{e.active?this._active_change(e):e.active=!0};for(const t of(0,l.values)(this.gestures)){t.tools=(0,a.sort_by)(t.tools,(e=>e.default_order));for(const e of t.tools)this.connect(e.properties.active.change,(()=>this._active_change(e)))}for(const[t,i]of(0,l.entries)(this.gestures)){const s=d(t);if(s){const n=this[s];"auto"==n?0!=i.tools.length&&p(t)&&e(i.tools[0]):null!=n&&((0,a.includes)(this.tools,n)?e(n):this[s]=null)}}}}i.Toolbar=m,o=m,m.__name__="Toolbar",o.prototype.default_view=u.ToolbarBaseView,o.define((({Or:e,Ref:t,Auto:s,Null:n})=>({active_drag:[e(t(i.Drag),s,n),"auto"],active_inspect:[e(t(i.Inspection),s,n),"auto"],active_scroll:[e(t(i.Scroll),s,n),"auto"],active_tap:[e(t(i.Tap),s,n),"auto"],active_multi:[e(t(h.GestureTool),s,n),"auto"]})))},function(e,t,i,s,n){var o;s();const r=e(42),a=e(9),l=e(53);class c extends r.View{get plot_view(){return this.parent}get plot_model(){return this.parent.model}connect_signals(){super.connect_signals(),this.connect(this.model.properties.active.change,(()=>{this.model.active?this.activate():this.deactivate()}))}activate(){}deactivate(){}}i.ToolView=c,c.__name__="ToolView";class h extends l.Model{constructor(e){super(e)}get synthetic_renderers(){return[]}_get_dim_limits([e,t],[i,s],n,o){const r=n.bbox.h_range;let l;"width"==o||"both"==o?(l=[(0,a.min)([e,i]),(0,a.max)([e,i])],l=[(0,a.max)([l[0],r.start]),(0,a.min)([l[1],r.end])]):l=[r.start,r.end];const c=n.bbox.v_range;let h;return"height"==o||"both"==o?(h=[(0,a.min)([t,s]),(0,a.max)([t,s])],h=[(0,a.max)([h[0],c.start]),(0,a.min)([h[1],c.end])]):h=[c.start,c.end],[l,h]}static register_alias(e,t){this.prototype._known_aliases.set(e,t)}static from_string(e){const t=this.prototype._known_aliases.get(e);if(null!=t)return t();{const t=[...this.prototype._known_aliases.keys()];throw new Error(`unexpected tool name '${e}', possible tools are ${t.join(", ")}`)}}}i.Tool=h,o=h,h.__name__="Tool",o.prototype._known_aliases=new Map,o.define((({String:e,Nullable:t})=>({description:[t(e),null]}))),o.internal((({Boolean:e})=>({active:[e,!1]})))},function(e,t,i,s,n){s();const o=e(224),r=e(231);class a extends o.ButtonToolView{}i.GestureToolView=a,a.__name__="GestureToolView";class l extends o.ButtonTool{constructor(e){super(e),this.button_view=r.OnOffButtonView}}i.GestureTool=l,l.__name__="GestureTool"},function(e,t,i,s,n){s();const o=e(1);var r;const a=(0,o.__importDefault)(e(225)),l=e(226),c=e(222),h=e(43),_=e(34),u=e(8),d=e(9),p=(0,o.__importStar)(e(227)),m=p,g=(0,o.__importDefault)(e(228)),f=(0,o.__importDefault)(e(229)),b=e(230);class y extends l.DOMView{initialize(){super.initialize();const e=this.model.menu;if(null!=e){const t=this.parent.model.toolbar_location,i="left"==t||"above"==t,s=this.parent.model.horizontal?"vertical":"horizontal";this._menu=new b.ContextMenu(i?(0,d.reversed)(e):e,{orientation:s,prevent_hide:e=>e.target==this.el})}this._hammer=new a.default(this.el,{touchAction:"auto",inputClass:a.default.TouchMouseInput}),this.connect(this.model.change,(()=>this.render())),this._hammer.on("tap",(e=>{var t;(null===(t=this._menu)||void 0===t?void 0:t.is_open)?this._menu.hide():e.target==this.el&&this._clicked()})),this._hammer.on("press",(()=>this._pressed())),this.el.addEventListener("keydown",(e=>{e.keyCode==h.Keys.Enter&&this._clicked()}))}remove(){var e;this._hammer.destroy(),null===(e=this._menu)||void 0===e||e.remove(),super.remove()}styles(){return[...super.styles(),p.default,g.default,f.default]}css_classes(){return super.css_classes().concat(m.toolbar_button)}render(){(0,h.empty)(this.el);const e=this.model.computed_icon;(0,u.isString)(e)&&((0,_.startsWith)(e,"data:image")?this.el.style.backgroundImage=`url("${e}")`:this.el.classList.add(e)),this.el.title=this.model.tooltip,this.el.tabIndex=0,null!=this._menu&&this.root.el.appendChild(this._menu.el)}_pressed(){var e;const t=(()=>{switch(this.parent.model.toolbar_location){case"right":return{left_of:this.el};case"left":return{right_of:this.el};case"above":return{below:this.el};case"below":return{above:this.el}}})();null===(e=this._menu)||void 0===e||e.toggle(t)}}i.ButtonToolButtonView=y,y.__name__="ButtonToolButtonView";class v extends c.ToolView{}i.ButtonToolView=v,v.__name__="ButtonToolView";class x extends c.Tool{constructor(e){super(e)}_get_dim_tooltip(e){const{description:t,tool_name:i}=this;return null!=t?t:"both"==e?i:`${i} (${"width"==e?"x":"y"}-axis)`}get tooltip(){var e;return null!==(e=this.description)&&void 0!==e?e:this.tool_name}get computed_icon(){return this.icon}get menu(){return null}}i.ButtonTool=x,r=x,x.__name__="ButtonTool",r.internal((({Boolean:e})=>({disabled:[e,!1]})))},function(e,t,s,n,o){!function(e,s,n,o){var r,a=["","webkit","Moz","MS","ms","o"],l=s.createElement("div"),c=Math.round,h=Math.abs,_=Date.now;function u(e,t,i){return setTimeout(y(e,i),t)}function d(e,t,i){return!!Array.isArray(e)&&(p(e,i[t],i),!0)}function p(e,t,i){var s;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==o)for(s=0;s<e.length;)t.call(i,e[s],s,e),s++;else for(s in e)e.hasOwnProperty(s)&&t.call(i,e[s],s,e)}function m(t,i,s){var n="DEPRECATED METHOD: "+i+"\n"+s+" AT \n";return function(){var i=new Error("get-stack-trace"),s=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,n,s),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===o||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!==o&&null!==s)for(var n in s)s.hasOwnProperty(n)&&(t[n]=s[n])}return t}:Object.assign;var g=m((function(e,t,i){for(var s=Object.keys(t),n=0;n<s.length;)(!i||i&&e[s[n]]===o)&&(e[s[n]]=t[s[n]]),n++;return e}),"extend","Use `assign`."),f=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function b(e,t,i){var s,n=t.prototype;(s=e.prototype=Object.create(n)).constructor=e,s._super=n,i&&r(s,i)}function y(e,t){return function(){return e.apply(t,arguments)}}function v(e,t){return"function"==typeof e?e.apply(t&&t[0]||o,t):e}function x(e,t){return e===o?t:e}function w(e,t,i){p(T(t),(function(t){e.addEventListener(t,i,!1)}))}function A(e,t,i){p(T(t),(function(t){e.removeEventListener(t,i,!1)}))}function k(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function T(e){return e.trim().split(/\s+/g)}function C(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var s=0;s<e.length;){if(i&&e[s][i]==t||!i&&e[s]===t)return s;s++}return-1}function M(e){return Array.prototype.slice.call(e,0)}function z(e,t,i){for(var s=[],n=[],o=0;o<e.length;){var r=t?e[o][t]:e[o];C(n,r)<0&&s.push(e[o]),n[o]=r,o++}return i&&(s=t?s.sort((function(e,i){return e[t]>i[t]})):s.sort()),s}function E(e,t){for(var i,s,n=t[0].toUpperCase()+t.slice(1),r=0;r<a.length;){if((s=(i=a[r])?i+n:t)in e)return s;r++}return o}var R=1;function B(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var N="ontouchstart"in e,O=E(e,"PointerEvent")!==o,D=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",P="mouse",V=["x","y"],L=["clientX","clientY"];function j(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){v(e.options.enable,[e])&&i.handler(t)},this.init()}function U(e,t,i){var s=i.pointers.length,n=i.changedPointers.length,r=1&t&&s-n==0,a=12&t&&s-n==0;i.isFirst=!!r,i.isFinal=!!a,r&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,s=t.pointers,n=s.length;i.firstInput||(i.firstInput=F(t)),n>1&&!i.firstMultiple?i.firstMultiple=F(t):1===n&&(i.firstMultiple=!1);var r=i.firstInput,a=i.firstMultiple,l=a?a.center:r.center,c=t.center=G(s);t.timeStamp=_(),t.deltaTime=t.timeStamp-r.timeStamp,t.angle=W(l,c),t.distance=J(l,c),function(e,t){var i=t.center,s=e.offsetDelta||{},n=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(n=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},s=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-s.x),t.deltaY=n.y+(i.y-s.y)}(i,t),t.offsetDirection=Y(t.deltaX,t.deltaY);var u,d,p=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=p.x,t.overallVelocityY=p.y,t.overallVelocity=h(p.x)>h(p.y)?p.x:p.y,t.scale=a?(u=a.pointers,J((d=s)[0],d[1],L)/J(u[0],u[1],L)):1,t.rotation=a?function(e,t){return W(t[1],t[0],L)+W(e[1],e[0],L)}(a.pointers,s):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,s,n,r,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===o)){var c=t.deltaX-a.deltaX,_=t.deltaY-a.deltaY,u=H(l,c,_);s=u.x,n=u.y,i=h(u.x)>h(u.y)?u.x:u.y,r=Y(c,_),e.lastInterval=t}else i=a.velocity,s=a.velocityX,n=a.velocityY,r=a.direction;t.velocity=i,t.velocityX=s,t.velocityY=n,t.direction=r}(i,t);var m=e.element;k(t.srcEvent.target,m)&&(m=t.srcEvent.target),t.target=m}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function F(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:c(e.pointers[i].clientX),clientY:c(e.pointers[i].clientY)},i++;return{timeStamp:_(),pointers:t,center:G(t),deltaX:e.deltaX,deltaY:e.deltaY}}function G(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var i=0,s=0,n=0;n<t;)i+=e[n].clientX,s+=e[n].clientY,n++;return{x:c(i/t),y:c(s/t)}}function H(e,t,i){return{x:t/e||0,y:i/e||0}}function Y(e,t){return e===t?1:h(e)>=h(t)?e<0?2:4:t<0?8:16}function J(e,t,i){i||(i=V);var s=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(s*s+n*n)}function W(e,t,i){i||(i=V);var s=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,s)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(B(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&A(this.element,this.evEl,this.domHandler),this.evTarget&&A(this.target,this.evTarget,this.domHandler),this.evWin&&A(B(this.element),this.evWin,this.domHandler)}};var q={mousedown:1,mousemove:2,mouseup:4},X="mousedown",Z="mousemove mouseup";function K(){this.evEl=X,this.evWin=Z,this.pressed=!1,j.apply(this,arguments)}b(K,j,{handler:function(e){var t=q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Q={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},$={2:I,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ie(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),b(ie,j,{handler:function(e){var t=this.store,i=!1,s=e.type.toLowerCase().replace("ms",""),n=Q[s],o=$[e.pointerType]||e.pointerType,r=o==I,a=C(t,e.pointerId,"pointerId");1&n&&(0===e.button||r)?a<0&&(t.push(e),a=t.length-1):12&n&&(i=!0),a<0||(t[a]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),i&&t.splice(a,1))}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ne(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function oe(e,t){var i=M(e.touches),s=M(e.changedTouches);return 12&t&&(i=z(i.concat(s),"identifier",!0)),[i,s]}b(ne,j,{handler:function(e){var t=se[e.type];if(1===t&&(this.started=!0),this.started){var i=oe.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:I,srcEvent:e})}}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},j.apply(this,arguments)}function ce(e,t){var i=M(e.touches),s=this.targetIds;if(3&t&&1===i.length)return s[i[0].identifier]=!0,[i,i];var n,o,r=M(e.changedTouches),a=[],l=this.target;if(o=i.filter((function(e){return k(e.target,l)})),1===t)for(n=0;n<o.length;)s[o[n].identifier]=!0,n++;for(n=0;n<r.length;)s[r[n].identifier]&&a.push(r[n]),12&t&&delete s[r[n].identifier],n++;return a.length?[z(o.concat(a),"identifier",!0),a]:void 0}function he(){j.apply(this,arguments);var e=y(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new K(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ue.call(this,t)):12&e&&ue.call(this,t)}function ue(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var s=this.lastTouches;setTimeout((function(){var e=s.indexOf(i);e>-1&&s.splice(e,1)}),2500)}}function de(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,s=0;s<this.lastTouches.length;s++){var n=this.lastTouches[s],o=Math.abs(t-n.x),r=Math.abs(i-n.y);if(o<=25&&r<=25)return!0}return!1}b(le,j,{handler:function(e){var t=re[e.type],i=ce.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:I,srcEvent:e})}}),b(he,j,{handler:function(e,t,i){var s=i.pointerType==I,n=i.pointerType==P;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(s)_e.call(this,t,i);else if(n&&de.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(l.style,"touchAction"),me=pe!==o,ge="compute",fe="auto",be="manipulation",ye="none",ve="pan-x",xe="pan-y",we=function(){if(!me)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(s){t[s]=!i||e.CSS.supports("touch-action",s)})),t}();function Ae(e,t){this.manager=e,this.set(t)}Ae.prototype={set:function(e){e==ge&&(e=this.compute()),me&&this.manager.element.style&&we[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){v(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,ye))return ye;var t=S(e,ve),i=S(e,xe);return t&&i?ye:t||i?t?ve:xe:S(e,be)?be:fe}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var s=this.actions,n=S(s,ye)&&!we.none,o=S(s,xe)&&!we["pan-y"],r=S(s,ve)&&!we["pan-x"];if(n){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!r||!o)return n||o&&6&i||r&&24&i?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ke=32;function Se(e){this.options=r({},this.defaults,e||{}),this.id=R++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Te(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ce(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Me(e,t){var i=t.manager;return i?i.get(e):e}function ze(){Se.apply(this,arguments)}function Ee(){ze.apply(this,arguments),this.pX=null,this.pY=null}function Re(){ze.apply(this,arguments)}function Be(){Se.apply(this,arguments),this._timer=null,this._input=null}function Ne(){ze.apply(this,arguments)}function Oe(){ze.apply(this,arguments)}function De(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ie(e,t){return(t=t||{}).recognizers=x(t.recognizers,Ie.defaults.preset),new Pe(e,t)}function Pe(e,t){this.options=r({},Ie.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(O?ie:D?le:N?he:K))(this,U),this.touchAction=new Ae(this,this.options.touchAction),Ve(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ve(e,t){var i,s=e.element;s.style&&(p(e.options.cssProps,(function(n,o){i=E(s.style,o),t?(e.oldCssProps[i]=s.style[i],s.style[i]=n):s.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}Se.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Me(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Me(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=Me(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Me(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function s(i){t.manager.emit(i,e)}i<8&&s(t.options.event+Te(i)),s(t.options.event),e.additionalEvent&&s(e.additionalEvent),i>=8&&s(t.options.event+Te(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=ke},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!v(this.options.enable,[this,t]))return this.reset(),void(this.state=ke);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},b(ze,Se,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,s=6&t,n=this.attrTest(e);return s&&(8&i||!n)?16|t:s||n?4&i?8|t:2&t?4|t:2:ke}}),b(Ee,ze,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(xe),24&e&&t.push(ve),t},directionTest:function(e){var t=this.options,i=!0,s=e.distance,n=e.direction,o=e.deltaX,r=e.deltaY;return n&t.direction||(6&t.direction?(n=0===o?1:o<0?2:4,i=o!=this.pX,s=Math.abs(e.deltaX)):(n=0===r?1:r<0?8:16,i=r!=this.pY,s=Math.abs(e.deltaY))),e.direction=n,i&&s>t.threshold&&n&t.direction},attrTest:function(e){return ze.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ce(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Re,ze,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Be,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[fe]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,s=e.distance<t.threshold,n=e.deltaTime>t.time;if(this._input=e,!s||!i||12&e.eventType&&!n)this.reset();else if(1&e.eventType)this.reset(),this._timer=u((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return ke},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=_(),this.manager.emit(this.options.event,this._input)))}}),b(Ne,ze,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(Oe,ze,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ee.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:24&i&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ce(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(De,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,s=e.distance<t.threshold,n=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(s&&n&&i){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,r=!this.pCenter||J(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,r&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=u((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return ke},failTimeout:function(){return this._timer=u((function(){this.state=ke}),this.options.interval,this),ke},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ie.VERSION="2.0.7",Ie.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ne,{enable:!1}],[Re,{enable:!1},["rotate"]],[Oe,{direction:6}],[Ee,{direction:6},["swipe"]],[De],[De,{event:"doubletap",taps:2},["tap"]],[Be]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Pe.prototype={set:function(e){return r(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var s=this.recognizers,n=t.curRecognizer;(!n||n&&8&n.state)&&(n=t.curRecognizer=null);for(var o=0;o<s.length;)i=s[o],2===t.stopped||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(e),!n&&14&i.state&&(n=t.curRecognizer=i),o++}},get:function(e){if(e instanceof Se)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=C(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==o&&t!==o){var i=this.handlers;return p(T(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==o){var i=this.handlers;return p(T(e),(function(e){t?i[e]&&i[e].splice(C(i[e],t),1):delete i[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](t),n++}},destroy:function(){this.element&&Ve(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(Ie,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ke,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Pe,Input:j,TouchAction:Ae,TouchInput:le,MouseInput:K,PointerEventInput:ie,TouchMouseInput:he,SingleTouchInput:ne,Recognizer:Se,AttrRecognizer:ze,Tap:De,Pan:Ee,Swipe:Oe,Pinch:Re,Rotate:Ne,Press:Be,on:w,off:A,each:p,merge:f,extend:g,assign:r,inherit:b,bindFn:y,prefixed:E}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Ie,"function"==typeof define&&i.amdO?define((function(){return Ie})):void 0!==t&&t.exports?t.exports=Ie:e.Hammer=Ie}(window,document)},function(e,t,i,s,n){s();const o=e(42),r=e(43);class a extends o.View{initialize(){super.initialize(),this.el=this._createElement()}remove(){(0,r.remove)(this.el),super.remove()}css_classes(){return[]}render(){}renderTo(e){e.appendChild(this.el),this.render(),this._has_finished=!0,this.notify_finished()}_createElement(){return(0,r.createElement)(this.constructor.tag_name,{class:this.css_classes()})}}i.DOMView=a,a.__name__="DOMView",a.tag_name="div"},function(e,t,i,s,n){s(),i.root="bk-root",i.toolbar_hidden="bk-toolbar-hidden",i.toolbar="bk-toolbar",i.logo="bk-logo",i.above="bk-above",i.below="bk-below",i.left="bk-left",i.right="bk-right",i.toolbar_button="bk-toolbar-button",i.tool_overflow="bk-tool-overflow",i.active="bk-active",i.divider="bk-divider",i.horizontal="bk-horizontal",i.vertical="bk-vertical",i.default='.bk-root .bk-toolbar-hidden{visibility:hidden;opacity:0;transition:visibility 0.3s linear, opacity 0.3s linear;}.bk-root .bk-toolbar{display:flex;flex-wrap:nowrap;align-items:center;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-toolbar .bk-logo{flex-shrink:0;}.bk-root .bk-toolbar.bk-above,.bk-root .bk-toolbar.bk-below{flex-direction:row;justify-content:flex-end;}.bk-root .bk-toolbar.bk-above .bk-logo,.bk-root .bk-toolbar.bk-below .bk-logo{order:1;margin-left:5px;margin-right:0px;}.bk-root .bk-toolbar.bk-left,.bk-root .bk-toolbar.bk-right{flex-direction:column;justify-content:flex-start;}.bk-root .bk-toolbar.bk-left .bk-logo,.bk-root .bk-toolbar.bk-right .bk-logo{order:0;margin-bottom:5px;margin-top:0px;}.bk-root .bk-toolbar-button{width:30px;height:30px;cursor:pointer;background-size:60% 60%;background-origin:border-box;background-color:transparent;background-repeat:no-repeat;background-position:center center;}.bk-root .bk-toolbar-button:hover,.bk-root .bk-tool-overflow:hover{background-color:rgba(192, 192, 192, 0.15);}.bk-root .bk-toolbar-button:focus,.bk-root .bk-tool-overflow:focus,.bk-root .bk-toolbar-button:focus-visible,.bk-root .bk-tool-overflow:focus-visible{outline:1px dotted #26aae1;outline-offset:-1px;}.bk-root .bk-toolbar-button::-moz-focus-inner,.bk-root .bk-tool-overflow::-moz-focus-inner{border:0;}.bk-root .bk-above .bk-toolbar-button{border-bottom:2px solid transparent;}.bk-root .bk-above .bk-toolbar-button.bk-active{border-bottom-color:#26aae1;}.bk-root .bk-below .bk-toolbar-button{border-top:2px solid transparent;}.bk-root .bk-below .bk-toolbar-button.bk-active{border-top-color:#26aae1;}.bk-root .bk-right .bk-toolbar-button{border-left:2px solid transparent;}.bk-root .bk-right .bk-toolbar-button.bk-active{border-left-color:#26aae1;}.bk-root .bk-left .bk-toolbar-button{border-right:2px solid transparent;}.bk-root .bk-left .bk-toolbar-button.bk-active{border-right-color:#26aae1;}.bk-root .bk-divider{content:" ";display:inline-block;background-color:lightgray;}.bk-root .bk-above .bk-divider,.bk-root .bk-below .bk-divider{height:10px;width:1px;}.bk-root .bk-left .bk-divider,.bk-root .bk-right .bk-divider{height:1px;width:10px;}.bk-root .bk-tool-overflow{color:gray;display:flex;align-items:center;}.bk-root .bk-above .bk-tool-overflow,.bk-root .bk-below .bk-tool-overflow,.bk-root .bk-horizontal .bk-tool-overflow{width:15px;height:30px;flex-direction:row;}.bk-root .bk-left .bk-tool-overflow,.bk-root .bk-right .bk-tool-overflow,.bk-root .bk-vertical .bk-tool-overflow{width:30px;height:15px;flex-direction:column;}'},function(e,t,i,s,n){s(),i.root="bk-root",i.tool_icon_copy_to_clipboard="bk-tool-icon-copy-to-clipboard",i.tool_icon_replace_mode="bk-tool-icon-replace-mode",i.tool_icon_append_mode="bk-tool-icon-append-mode",i.tool_icon_intersect_mode="bk-tool-icon-intersect-mode",i.tool_icon_subtract_mode="bk-tool-icon-subtract-mode",i.tool_icon_clear_selection="bk-tool-icon-clear-selection",i.tool_icon_box_select="bk-tool-icon-box-select",i.tool_icon_box_zoom="bk-tool-icon-box-zoom",i.tool_icon_zoom_in="bk-tool-icon-zoom-in",i.tool_icon_zoom_out="bk-tool-icon-zoom-out",i.tool_icon_help="bk-tool-icon-help",i.tool_icon_hover="bk-tool-icon-hover",i.tool_icon_crosshair="bk-tool-icon-crosshair",i.tool_icon_lasso_select="bk-tool-icon-lasso-select",i.tool_icon_pan="bk-tool-icon-pan",i.tool_icon_xpan="bk-tool-icon-xpan",i.tool_icon_ypan="bk-tool-icon-ypan",i.tool_icon_range="bk-tool-icon-range",i.tool_icon_polygon_select="bk-tool-icon-polygon-select",i.tool_icon_redo="bk-tool-icon-redo",i.tool_icon_reset="bk-tool-icon-reset",i.tool_icon_save="bk-tool-icon-save",i.tool_icon_tap_select="bk-tool-icon-tap-select",i.tool_icon_undo="bk-tool-icon-undo",i.tool_icon_wheel_pan="bk-tool-icon-wheel-pan",i.tool_icon_wheel_zoom="bk-tool-icon-wheel-zoom",i.tool_icon_box_edit="bk-tool-icon-box-edit",i.tool_icon_freehand_draw="bk-tool-icon-freehand-draw",i.tool_icon_poly_draw="bk-tool-icon-poly-draw",i.tool_icon_point_draw="bk-tool-icon-point-draw",i.tool_icon_poly_edit="bk-tool-icon-poly-edit",i.tool_icon_line_edit="bk-tool-icon-line-edit",i.default='.bk-root .bk-tool-icon-copy-to-clipboard{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUSDBoBvcHQeQAAAG9JREFUWMNjXLhsJcNAAiaGAQYwB/xHwh/Q+ITEkfHQCwEWND4jmeb8H/JpgBwfI6cNBhLSEkqaGXRpgFRAcZoZsmlg1AGjDhh1wKgDRh0w6gCaVcf/R2wIkNqw+D9s0wADvUNiyIYA47BJAwPuAAAj/Cjd0TCN6wAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-replace-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxokK3gniQAAAHpJREFUWMNjXLhsJcNAAiaGAQajDhhwB7DgEP+PxmeksvjgDwFcLmYkUh2hkBj8IcBIZXsYh1w2/I8v3sgAOM0bLYhGc8GgrwuICgldfQO88pcvXvg/aOuCUQeM5oLRuoCFCJcTbOMh5XOiW0JDNhdQS3y0IBp1ABwAAF8KGrhC1Eg6AAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-append-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkZWD04WwAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAoUlEQVRYw+1WQQ6AIAwrhO8Y/bIXEz9jIMSDr8ETCUEPQzA4pMeFLKNbu4l5WR0CDOMEALBGIzMuQIBEZQjPgP9JLjwTfBjY9sO9lZsFA9IafZng3BlIyVefgd8XQFZBAWe8jfNxwsDhir6rzoCiPiy1K+J8/FRQemv2XfAdFcQ9znU4Viqg9ta1qYJ+D1BnAIBrkgGVOrXNqUA9rbyZm/AEzFh4jEeY/soAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-intersect-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkrkOpp2wAAAPhJREFUWMPtV1EKwjAMTUavI3oawR/vtn5srJdREfzwMvHHQlcT2mpdMzFfWxiP5r2+JMN+mAiCOB72CABgR1cln4oOGocJnuMTSxWk8jMm7OggYkYXA9gPE3uyd8NXHONJ+eYMdE/NqCJmEZ5ZqlJJ4sUksKN7cYSaPoCZFWR1QI+Xm1fBACU63Cw22x0AAJxudwrffVwvZ+JmQdAHZkw0d4EpAMCw8k87pMdbnwtizQumJYv3nwV6XOA1qbUT/oQLUJgFRbsiNwFVucBIlyR3p0tdMp+XmFjfLKi1LatyAXtCRjPWBdL3Ke3VuACJKFfDr/xFN2fgAR/Go0qaLlmEAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-subtract-mode{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxgsF5XNOQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABFUlEQVRYw9VWUQqDMAxNpWfxQxD1MoP97G7zQ5mH2RTZYLtM9lWoMbXtxLXNX4OG9r28l4hrd0PQoqxqAACYpxH25C/nkwCHyCBwSPoS09k1T5Fo+4EiExcC4v584xGFmyIXHBLRISAVZyZufUPVa4rcrwmPDgr93ylo+2GliLRUYHK6th/o/6r7nfLpqaCsagEA8Hh9FmcNKeRmgeYDC+SCq0B6FFi8/BcV6BdR9cL3gCv3ijPKOacsn3rBEcjmaVxpfGcg4wHxzgJJnc6241Hn23DERFRAu1bNcWa3Q0uXi62XR6sCaWoSejbtdLYmU3kTEunNgj0bUbQqYG/IcMaqwPS9jftoVCAQ0ZVDJwf0zQdH4AsyW6fpQu4YegAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-clear-selection{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUGEhcuan3d3wAAAoRJREFUWMPtlzFP3EAQhd+b3TNSzg0N5TWXLkJQUUaKhIQ4fgP/g5ArrriE/I3opEgRrZtIVJR0FJQ010SioUmEZHtnUpwN9gWHGA5BJCy58MraffvmfZ41v3z9hqe8BE98vQh4cgG+Ydzmnrng8efvQJNi/uN7dznx/B3ggtfhf4ehNdUttRzBDIm/2VTiiWCG1HK0nc+3UWtq8BQIiEEakEQOADBIA4QCQmBqoHBhFNR27ikQSmGdYCdTqCpEHMDZmEKRWUBEv1gBDg5SzRJnpopILWICgWuRYflLamuzxB2BmtYqSRIka5VWU8QduXO+1hRc5YZu5GAwmP2ZJzND0IBu5HCV2+NQcAhAVRsnC2IbPzPdSjzd6to6VtfWkXi6YLaVWr7xoAwkfpb8MnC3SH7rKSMBe4M0jA/OTicFIbtCGRIyNbURhcf3ErCd6YwA1m0HgAxhw1NGQnlXBHG4kylVlSJuH0RfIP2CkL2I/qS1gIAAQiBl1QwFggIHtyxgrxK5PgyfC0JWKoT0HLh8LwoietB4TYKaIl7yeNURxB05UtMxDOcVQlZIrlRKdK6m47gjR/fuBRQihyLArtNeJD50Izcx2Eczu7iFkIug4VM3cpOr3MKDekFED0fWUHv9Zq0kpLnridjhY3XDg7NTN0jDrhO3X7O9Wg7wwyANu4mnayNg3gmbu0tCNoUyBNGv2l4rB9EXynA7082FOxAQLhU6rQVO9T2AvWowFToNCJcPORGxIRcnpjZSKATSU9NxvOQnAPArDSaQoUKnNI4iufkGtD4P3EHIcWZhz4HLceSOyrR3Izf5memPAL2cX3yhAkonysZVaWLBkd9dw1Ivv2a/AYPkK+ty1U1DAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-box-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg0kduFrowAAAIdJREFUWMPtVtEKwCAI9KL//4e9DPZ3+wP3KgOjNZouFYI4C8q7s7DtB1lGIeMoRMRinCLXg/ML3EcFqpjjloOyZxRntxpwQ8HsgHYARKFAtSFrCg3TCdMFCE1BuuALEXJLjC4qENsFVXCESZw38/kWLOkC/K4PcOc/Hj03WkoDT3EaWW9egQul6CUbq90JTwAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-box-zoom{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg82t254aQAAAkBJREFUWMPN11+E1FEUB/DPTFn2qaeIpcSwr5NlUyJiKWVXWUqvlUh/iE3RY9mUekkPPURtLKNRrFJEeuphGfUUaVliiX1aVjGs6aG7+XX9ZnZ+d2fTl2vmnHvPPfeee/79Sk+may2/UQq/q7Qu+bAJoxjHIKqB/wlfUMcMVqI9bLZ+DGIKwzlzQ2GcxCx2xwvKOUKlaHTiX8bHNspjDONHkOmJBW5jIof/FvPh/06MZOb6cRc7cGn1AKUE5cdzlM/gAr5F/O24H3xkFRfxAbVygvK+cIsspjGWo1zgjeFpxL+BvnLw7laBA4xjIFJwrgu52DoVjKdY4HBEX8dSF3JLYe1fe6UcYCii3xWQjdfuSTnAtoheKCC7GNED5Zx4L4qt61jbTLHA94geKSC7P7ZeShQ0Inoi1IJuEOeORooFXkV0FZNdZs5qvFfKAeqYy7nZ6yg//HG0MBfffh71lFrQDCW2EvEP4mt4okZUDftz9rmGZkotmMxJRtlisy+MTniAWrty3AlXw0hFM2TD89l+oNsoOJXjbIs4EpqNtTCLXbiZ0g+M4mFObj8U3vsNjoZCVcmk60ZwthpepLZkB/AsivWfOJZxtpUQHfWib7KWDwzjeegBZJSdKFiE2qJTFFTwElsi/unQ/awXrU4WGMD7nOJxBY/1EO2iYConq93CHT1GOwucjdqnRyFz+VcHmMNefMY9nNkA3SWUOoXhQviSWQ4huLIRFlirFixnQq/XaKXUgg2xQNGv4V7x/RcW+AXPB3h7H1PaiQAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgsUBmL8iQAAA2JJREFUWMO9l12IlFUYx3//MzPrLpSjkm5oN4FFIWVEl66IQlFYwtLOzozsjHdGRSCRF0sfBEXRVV0FQuQiLm5CZNBFgRRaRLVFhbJ2EdiN5gbK7toObTPn6eYdPTvNzPvOBz5Xh/ec5/n/n89zXtEHmZqeSXSuXBz/3zfdKvBWJHQrwZuRcP0El+QkbQXeBX6WZEgm6TtJk5lM5o4Lc+cV6qpf4Ga20Tm338zeATItVK9Ker6yvPzp4NDQ3+XieGsCU9MzTYumGbhz7m4ze9/MHgvBgItACrgfGAj2jgAvAYs3wlEujjc13kii8YyZrXXOfWhmo9GnFUlvOOemarVapVqtkslksmb2KjARqL62ecuWN9NxbRInzrldAXhV0uFSIfdew7G/gNLU9MwS8CwSmE3Oz88fcXG5blfpqVRq0Ix8VIAAX0XgrVL7HDCHGcCaWrV60LUBN8Dae58aQIxEqcA592I9M610JL0cpG/U9TIHJNKY3RV5z0R+7Nd4HZ0P1g/2RMBuegLAsRMnb4vT8d5vqKfMzOgtAlADrkmqGywmiMBTwfr3dC9j1Xv/r6Tvg/5/5ejxE6cO7M9faVbQZrYNOFSPmqQvVo9FKexvi5uWX58943aM7DwAfBDY+FbSCxP5sdkGx55GeguzrUEXPaSo2pFkAbiSZQCAzZJOmdkjwd6SpB/M7KykQTPbA2wDhoIzRzcNDx9MJwGNIXdJ0mEzmwbujL7dbma7gd03A7lKfnTOvf74nl0r6bonTUbujRSUCrm2d4L3/kvn3JPe+8+BDW2i9o+kT7z3kxP5sYsA6W47oE64TsR7P9tQL4vA2mh9WdIscKxUyJ0M7aR7acOGzikD65EQLEjaa2ZXzMwDFeB6qZBbbLTRE4EGeSaozNOZgYFf8qP7lmIvs354n0qlHpB0T7B9Ogl4IgJJrmjv/SiQjbrkD+BMUkfSbYATPdckrTOzkciWAXOlQu5cYgLdPEIapud9wMOR9zVJH3ViKx333mtHMJvNuoWFhZ3A+ojMcja77njXBEKwJJfTcqUyCIQ34Mf7nnh0paMnXacFuGoC1mr3AtuDfLzd8Zuyl+rfuGn4HLAD+Az4qZQf+61TAj0Noj8vX6oC35SL43u7teG6rf5+iXppwW7/JUL5D03qaFRvvUe+AAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgsHgty9VwAAA0FJREFUWMO9l09oXFUUxn/fmXlpItppi22k7UJBRSlVkCytSAuKUloIdjKT0El3FXVXdVFKRVAQV7qQohsNwdA0UFvBhYtqUVyIVlRaogtFQVq7qSTVjA3z3nHzBq/jvPmTN/Ss7rv3nvN99/y794kByMzcfE/7picn/jenmwWeRUI3E7wdCRskuCSTdDfwBvCtJEdySV9KOhpF0e0/LF5SqKtBgbv7ZjObcvfXgShD9Zqk5+orKx8Oj4z8NT05kU1gZm6+bdK0Azezu9z9hLs/HoIBvwAF4H5gKFh7B3gBWFY3460kWve4+3oze9fdx9OpVUmvmNlMHMf1RqNBFEUldz8OHAxUX9q6bduryut+Sfvc/Wz62ZD0fK1afjND9y3gGSRwv1GMojstTxUUCoVhdyopEYDzKXjWwZ4FFnEHWBc3Goet00m7lZlZYQixKw0FZnakGZksHUnHgvCN5/KARBH37enpOVg58H13HV0Kxg/kIuD/ngSA2ZMLt3bTSZJkUzNk7k4+D0AM/CGpaXCyBw/sC8Y/qZd2GpZiuL9YLN4Sx/HpoP5/c/exQ1OVq+1yyt13SLoArEsJnMjlgfOffvK3u58Kprab2QezJxfG2iTzUzI70wRPG9jbmpmb95SNB9mpzp7/j2yVdNbdx4K565K+cvfPJQ27+x5gBzAS7Hlvy+jo4WIvoC3kWpcvS3rR3eeAO9K529x9N7C7zX6AC2b28hN7Hl1Vt44niVq13LUjmtlYkiQfA5s6eO+GpDNJkhw9NFX5ueNt2ARodyF1IHIN2JiOl4H16fiKpK+B2Vq1vBAqFAf4IJkGNiIhWJK0192vunsC1IE/a9XycquNXARa5OnApeeioaHvKuP7r3dTGsiLqFAo7JR0T7B8rhfwXARa2us4UEqr5Ffgs151i/08oTNKdIO770ptObBYq5Yv5ibQq/sl3Qc8lJ4+lnSqH1vFfp9koZRKJVtaWnqkWXqSVkqlDe+vmUDWpZMlK/X6MBDegKf3P/nYaj8ErN9fqZBYEsf3Ag8G8Xit33BaniTcvGX0IvAw8BHwTa1y4Md+CeRqRL9fudwAvpienNi7Vhu21uwflOT+L+i1X2TJP57iUvUFtHWsAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-help{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAABltpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPHRpZmY6Q29tcHJlc3Npb24+NTwvdGlmZjpDb21wcmVzc2lvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MzI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjE8L2V4aWY6Q29sb3JTcGFjZT4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDpBODVDNDBDMzIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHhtcE1NOkRvY3VtZW50SUQ+eG1wLmRpZDpBODVDNDBDNDIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkRlcml2ZWRGcm9tIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgPHN0UmVmOmluc3RhbmNlSUQ+eG1wLmlpZDpBODVDNDBDMTIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpBODVDNDBDMjIwQjMxMUU0ODREQUYzNzM5QTM2MjBCRTwvc3RSZWY6ZG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPGRjOnN1YmplY3Q+CiAgICAgICAgICAgIDxyZGY6U2VxLz4KICAgICAgICAgPC9kYzpzdWJqZWN0PgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxNjoxMToyOCAxMToxMTo4MjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjY8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cphjt2AAAAT7SURBVFgJxRdbaFxFdGb2bhui227BWrsVKYgf2kJUbP9EUPuzEB803WTXJjH61Q/7Ya1+CMYKEVTsh4J/EpvY7BoabUiNiA8s1p+4KIhpoUUEselHqyS76TbZ3HuP58ydc3d2u4+IkQxczpz3mZkzZ86VYpXjvenpjZsLhUcliE4AuUuASAgptmt1EFdwPiclzIIUUwubNn17OJlcXo1p2UpodHRiux9xB1Eug1+slbzhFxGOKc851tu7/0oznYYBDA8Pt0U2tL8KQryIq2tvZqQhD0QJHRz3yqWhgYGBpXpydQMwqz6NCnurleCSADkJEfgKfOePqL80R/wV1ZaQyr1LenKfkPCkEPKeaj0xg7vxVL3duCmA0Vyuw/fl52hgBxsBED+h4Cv9z3R/zbRm8MTJTx7HQN7GQB6w5C4L4SX7M5lfLBpurjXMyvNIShiyi0l1pL8n9b7EDGPR8fHxzSsQ6XDB3618/xqo6Pk25V5MpVJllgHM1BO58RdQ612kOYZ+GXdij70TYQB05mpj+1kU5G2fB+l3PZtOf8NGx6ambnMXb3yAxg8wjSEG6OKKR9oicBQD+ZvpH2Wzj0lQpxCPG9qMv1x6hHNCsSAlHM7ZOa682vlI9tRDbvHGbD3nZAPpDoD/3JIrLpAs26UFkC3EMUA99hpfGtEBfJjNJnS2Gwnadnvl+Xw+iuc3DAJuNyIaSCHpilVldyDjjUxj3WDZIAhxhHHyRcdNuA7AAfUaXzVKODpzFiZ4/uLvh5G+m2no+C/pyIf7MqlEJB7bpqR6nXkEUfbeawuLaZsW2ISfNQ2vtaktQlGFQyIVGT0o2+2EC4iQNGwjBIN9qdQ5Qg4mk4X4rW3vCClLtowE2FOFUxKDfNmiZci3ovKKRFPh4FK9q4Zbdr+lKKJiA13TcHR2dmLBgdmQ0GAS2MZaEowY+XbAk09IvgtYZGp16SyvFhaHcIUh645t8T9DBCcnz5zZ4hZLu3DzK2QlL1QQa0Y+pHiJKPSuOGj3PmZTheM5w2TwqBxnvBZOTk7G5gvXJ5Aelms8wnJURL+olSWcfEhf6gDoUXPMq6ZlqbzWU2pE+3hi4s6F68tfIj9cBMlikr7Z0/P0b/X0yIcUXsDCF1WhtL4OROHaXk+xlkbV0Cu732Nmhc4peaWSg73pA8dq5RkvO37ldUTfXCKZv2q45MkhvG87WQEzpCCUSvV1d9GONBy3lMvgKSwrZig8gjAietWY0QriylO2jIo4yVbOSb7KB/qmI9BPKjHpSSXYauRyn92Nq9/Kcrj13x3s3v8D481glQ/0raiNYgX9njPSBOImbrHZePl+tfFmc9sH+Xaoh8NjOKSVdDMhjjYzQLy+dFceH5+IJQf9VYXX4tROg4ZFU8m31M3mfPEqUoJqCGJfvWpo2xnNfdrhC28n06SCeSzNZxlvBINGRXCtKS7EY1uV6V7HWAm38y1cXaXsMcOCvr9ySPj+af7A1U2HJXHzVNvUXVLIGyPf+jV0pf8GHoN+TLAyPkidTCi2RpPApmnR0Bd1zGRaB/B8Oj2HSw7LLbVR1MmskW8RdEWVXSJf3JbpAMgRtc4IZoxTh9qotQjCasm46M0YX9pV1VmbpvRH5OwwgdRtSg2vKaAz/1dNKVtb17Y8DCL4HVufHxMOYl1/zTgIgiYvBnFKfaNp3YjTdPz3n9Na8//X7/k/O1tdwopcZlcAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4oVHp0SwAAAQJJREFUWMPtlsENgzAMRb8RQ5VJItFDOgaZAMaAA0iZpN3KPZSoEEHSQBCViI/G8pfNt/KAFFcPshPdoAGgZkYVVYjQAFCyFLN8tlAbXRwAxp61nc9XCkGERpZCxRDvBl0zoxp7K98GAACxxH29srNNmPsK2l7zHoHHXZDr+/9vwDfB3kgeSB5IHkgeOH0DmesJjSXi6pUvkYt5u9teVy6aWREDM0D0BRvmGRV5N6DsQkMzI64FidtI5t3AOKWaFhuioY8dlYf9TO1PREUh/9HVeAqzIThHgWZ6MuNmC1jiL1mK4pAzlKUojEmNsxcmL0J60tazWjLZFpClPbd9BMJfL95145YajN5RHQAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-crosshair{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADEUlEQVRYR81XXVIaQRCeHqug8CXmBNETaE4gniDwIgpVspxAbxC9ATkBkCpQ8gKeQDiB5AQxNyAvUlrldr7eHxyGXZi1rMJ5opbp7m++7un+htSGF204vsoMoNXrlzSpfWa1oxQfhAegCZGaEtPorHo8znIoJwCt6+td8uk7ApUQCIHTF4BNAWzImq8ap6cP68CsBdDp9i9ZqXM7ML79g/EnCWD+jgMKENKqWT+tXK0CkQqgNRjs0OxpQIqKhoMxaG6/6JeRnK7T6yO2UvVqhYSlLX+ryORfgKn9ORDFIy7ky41yGcwsr0QAQfDH5zucOswx819fs4egI9OFCcD8DjBF7VNbEX0JzdWEt3NHSSASAcCxBDqMgt/623kvyTgNgNjJIfTjk4D4FqaJR1715MjmYAmA5Bx3AwUXQL+t105KaTlcBSC26XRvhjEIoLiq1yqXpr8FAGG16/ug4IT27fxBWu7EiQuAiImJpEMKE6nYM30uAIDDttSUOPfJP7JzbjPhAiBIh9QE67vIvoOi9WJfCwDavf40ulpjbCqmUf+W753ezURuh7Dg1SqflwAEHU6pgfyBq9Y4qx0LG++2fnZ/eUzcstmdM2AWH+jfc+liWdBJfSENf8Lifi3GVwC9mybOfi5dzatWVrbbLIHNva8p5h/16gkaFiLGGxbufkoE6XguwePiXLF3XmMfCUCUAqtKXU7sumd1CowOuJEi3Pg1FBpjitIGhyvVSfvmjci6ZR+rFQfDiPVE2jFYeICQ+PoewwjC5h7CZld6DBdyu6nDSKgzOyIMhmhK5TTqXYbRorZYM46TmpKAAOrGWwSJJekSB1yqJNOzp1Gs7YJ0EDeySDIMtJbQHh6Kf/uFfNFZkolJICRmz0P8DKWZuIG2g1hpok+Mk0Qphs0h9lzMtWRoNvYLuVImUWrmPJDlBKeRBDfATGOpHkhw670QSHWGLLckmF1PTsMlYqMJpyUbiO0weiMMceqLVTcotnMCYAYJJbcuQrVgZFP0NOOJYpr62pf3AmrHfWUG4O7abefGAfwH7EXSMJafOlYAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-lasso-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgwlGP1qdAAABMBJREFUWMO9V1uIVVUY/r61z57ZMx4DnbzgkbQXL5iCJphlWdpIGY4jpFBkEiU9ZNaDRRcITcIwMwgxoQtU2IMXdAZfMjFvpERXYiSbysyBEXFmyuHMnLP32uvrwT2xnY5nxvHQ93Jg7fWv71/r//7L4a59TRgqJk+Z6v3a+sv0OI5nk5wu6VaSVZImAThHsgjgrKTvM5nMUWvtmf5n8HodCIKgOgzDhc65pSTrJQWDsSNpJX1ljHnDOfdT37oZLLHv+8OMMasKhcIJ59xHAJYMlhwAJGUAzJfUTHLFuFzOG5QDU6dNMyQfs9Yedc5tBpAD4IYYNQGoBrDtQnt7/b0LFrJsCHzfn2itfQfAnZLiazytA3AaQAuAiwDaEgeNpGkkswAWSBqRONB38b88z5uTKePt6iiKXkk8jq+iJC5LOmiMaTLGHLPWhmWeHr7vV0dRtATAapAzIVmSo51zyzIlbm2stesFPA6pKk0r6Ryg93y/ek8YFvPOOTg3cDSiKCoC2OP7/rEoirYm4rUkF12lAWNM1lr7lqQn0+QA8gI2jBg5cj6Aj8OwmB+KAKIoukhyp6SRJAUgl0ndPLDWPi9pJQCbuviXvu+/GIZhW1dnJ24UJFuTjCCA2ADA8sYGWmsXS3qmL94kDYAtkh4Nw7ANlQJ5U6INT1KrAYC9zQdykl7nFSj5fXp5Y8NWVBhy7mUAjqShMYdMXV2dJ2klyRwAJ8lIeuGWCRMP7N7frEqSG2OmAFhKshNAp5wrmO7u7jEAngPQm1S2z2pqapr+OPt7XEly0oxwzq2RdFmSD2AMgKKJouhhAL4kA+Cs53l7e3t7uytJHgRBreTWkXwkKVJnJD0B4GAGwIJE9R6AFufc6UqSZ7PZbD6ff5dkA4CQZEHSqwAOISmXtwGIE+F1SeqqIP8d+Xz+C0mLJYWSAODteXffczjdDQNJ0BWMCoLg5gqIbRTJNwHsljQhUb0luWPM2LE7Thw/9m/5NCT/TByxAOYWi8X6/gdWV1dnfN8fNRBxJpMZTXKdc+6IpFVJWAEgkvSJpA0X2tvtVTaSjgOYBCAEEADYSHK87/sfhmEYA9gShuEDkgzJHyWtB/B1irQ2juP7ADxkrX0wOUOpzmdpzEY590HJ7Ni1r2kSyZOSiv2+hSRjSTXp/QAukzySNJOJkmalyNIl10hqMcasdc61XDNcQRD8BnITgNp+36r6kfcNFMMlLQGwTNLMEuQGQBfJl2bdPru+HDkAZAqFQux53jZHEsC6aw0eg2gylNRBcqcx5v04ji999+03AwsWAOI4Lsy9a94WkisAnE5a5WCJYwCfA1g7LJudI2lTHMeXBm1faiQzxkyRtF3S5CTupeAB+KG2tnZFT0/P30NO2VKLzrmfAbwGMipjG5Oc0dPTc0Md05SZ5U4Q2FxChErtEYD7jTGNQ3UgM8Asv90Yc9I5LSKRlXSI5CxJa0jWSALJjKRnAewfkniT+vwf7N7fXHK9rq7O7+jo+BTA/NRrdBpjnnLOnUrvXd7YMPQXSBunneno6IhIHgYwW1JtkgmBpBkATlVMAwOk3nFJ+VSoqgCMr6gIy2FcLtdKspAedyQN/98caDt/3kpyabUmf8WvG/8A1vODTBVE/0MAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-pan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4lKssI9gAAAOtJREFUWMPVll0KwyAMgNPgoc0JzDX2Mtgp3csKErSamGabIEUo/T6bHz0ezxdsjPJ5kvUDaROem7VJAp3gufkbtwtI+JYEOsHNEugIN0mgM1wtsVoF1MnyKtZHZBW4DVxoMh6jaAW0MTfnBAbALyUwCD6UwEB4VyJN4FXx4aqUAACgFLjzrsRP9AECAP4Cm88QtJeJrGivdeNdPpko+j1H7XzUB+6WYHmo4eDk4wj41XFMEfBZGXpK0F/eB+QhVcXslVo7i6eANjF5NYSojCN7wi05MJNgbfKiMaPZA75TBVKCrWWbnGrb3DPePZ9Bcbe/QecAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-xpan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4X4hxZdgAAAMpJREFUWMPtlsEKwjAMhr/pwOOedINJe/PobWXCfAIvgo/nA4heOiilZQqN2yE5lpD/I38SWt3uD9aMHSuHAiiAAmwaYCqoM/0KMABtQYDW11wEaHyiEei28bWb8LGOkk5C4iEEgE11YBQWDyHGuAMD0CeS30IQPfACbC3o+Vd2bOIOWMCtoO1mC+ap3CfmoCokFs/SZd6E0ILjnzrhvFbyEJ2FIZzXyB6iZ3AkjITn8WOdSbbAoaD4NSW+tIZdQYBOPyQKoAAKkIsPv0se4A/1UC0AAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-ypan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4anK0lywAAAMVJREFUWMPtlzEKwzAMRX/S7rlpIMXeOnaLaME36FLo8XqCdNFghGljyc4kgQi2Q/SUj0F/eL7eMMTKz6j9wNlYPGRrFcSoLH4XxQPvdQeYuPOlcLbw2dRTgqvoXEaolWM0aP4LYm0NkHYWzyFSSwlmzjw2sR6OvAXNwgEcwAEcwAEcwAEcoGYk20SiMCHlmVoCzACoojEqjHBmCeJOCOo1lgPA7Q8E8TvdjMmHuzsV3NFD4w+1t+Ai/gTx3qHuOFqdMQB8ASMwJX0IEHOeAAAAAElFTkSuQmCC");}.bk-root .bk-tool-icon-range{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAABCJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjU8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOlhSZXNvbHV0aW9uPjcyPC90aWZmOlhSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4zMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxkYzpzdWJqZWN0PgogICAgICAgICAgICA8cmRmOkJhZy8+CiAgICAgICAgIDwvZGM6c3ViamVjdD4KICAgICAgICAgPHhtcDpNb2RpZnlEYXRlPjIwMTgtMDQtMjhUMTQ6MDQ6NDk8L3htcDpNb2RpZnlEYXRlPgogICAgICAgICA8eG1wOkNyZWF0b3JUb29sPlBpeGVsbWF0b3IgMy43PC94bXA6Q3JlYXRvclRvb2w+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrsrWBhAAAD60lEQVRYCcVWv2scRxSemZ097SHbSeWkcYwwclDhzr1Q5T6QE1LghP6BGNIYJGRWNlaZItiFK1mr+JAu4HQu0kjpU8sgF3ITAsaFg0hOvt2Zyfvmdsa7a610Unx44Zgf773vvfneezPHNzrbhn3CT3xC3wPXYOC8LDzqdi8YY/gwh4BeknS/2th6dr2kf94AOp3OFyWgMyziOPbMDxV9FTtJnl1ut795Xd0/YQ0/vtYQwMT1KXWCfr2IjOWwtNehwN4xL9ykTrm6Pzl58yLn3J+mKh9mXbT3uRjGEDph+O8/TjfP5dBp7Ha7AX7O3o5nZeD/0E/OGyXntDgzA0X6qmCnrVutVlrUWV9f/3xo+pwhGDhvEPHOjoxnZjJggXmMHzBQ7NGNp9vxk61fr0HR7e/u7pZzCGHlc7qwBYYTT7tJYSx1AQzppyFPft5apta9w7SKcn0b7P7+/jCsDQ5mbc0dCmIJGDN0ehdcjsmkm6A6KUeKFOTE11PLxrC7Ukqh3ylL2fT0NAP9q6ur6rRCJJYsbKB0JsbCKMuy+xREePDyxQPCz+Crlw062QcA5wBOOt1l6vIl2WiI9F1fN6Q+BBqit6hEC4Hk08GQJMn4myjSP7RavVxgdaVUh/3U6HCMsPr9pYnJKRziHtWQ+un58+hGs6nsjQSjpuTyKGN3CX+FBwHXSiEVgjP+O8X6N12kIePES+GzTKAkGbNp8yJsGUMVzz8jPKReiyAQRimy5/cjye5RpF8utFp/+nwmT7d/NMzcFkS7yjJNGDaPURQxIQThEQy0SyF4l5WJYYhBa816vZ6dU7A6CAhbZVow/pDe0O9hVOoCi13r4BgBAvJHqMSQL2vE/iH6IAXEwgrRVUmBoRRwnwJQT98xEeVeSUyB4dJ5nwJBKdCFFGRmUCcu7rwIYypCTblaChuNBhWODrman5ub+4v0rMNBt8z6Ezh7GksJQpCbm79cMQE7QBFm/X6f0rjWnv8WRYg/QdbUpwDAEBy8vPyA8rNGzg3a8MiElwiM7dAtRqNoNptjGPM1laVxP9umWEMGLOKhKUOJDtBwDmzsw9fC/CzHr9SGuCTi2LbbKvVtmqXpCjMihBFa79Wrt5fGx9PDzc3fmu32Lf8qFliwU9emKhBSp+kRKn/hu9k1COEDbFdt/BoKWOAkuEbdVYyoIXv8+I/QK9dMHEb1Knb7MHOv8LFFOsjzCVHWOD7Ltn+MXCRF4729vWMDK+p8rLkvwjLg4N4v741m5YuwCI9CvHp1Ha8gFdBoPnQAkGsYYGxxcfEI7QQlFCTGUXwjAz4tWF+EpymOWu7fglE7qsOvrYE6g4+9/x/vhRbMdLOCFgAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-polygon-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEjc1OfiVKAAAAe1JREFUWMPt1r9rU1EUB/DPK0XbqphFHETo4OCiFhwF0V1KHbRSROLqon+AUMVRRFBwEbRFMBiV+mMW/wIxi5OD1kERRVKRJHUwLvfBTZrU5OWBGXLgQu7Jfe98z/ec7z0vKa88b2q1BDtRHdAPBaylm1NzsxsOjPnPNt6WSWprbft+/c3I3zOAjhT1Y4+fvcjEQJIXnVECSa+AhqIHqlHH5lWCZoe+Gk4GRgDG86j9SAUdlDBSQaZhlOkuHyoVdJmsw98D1S5fM4NYM1LCpqM+Lwa240oLgmZzpVZvzKT75VLZcqksSZKWlQeAy/iORVwIvh31xvotvK7VG3Px4aWHj3Jl4C2uYSvq+Bn8v6LLbaVWb9zsBiKLCvbiNG7gLm7jAYqbPHMJMziZ9lsKoh8GtqCEVVzHftwJn+TFHp4/hg8BSCYVfMOZoPEv2NZGdy9WCGUr9toDR3E2/H4V6nwRe/BmgN65H1ZhvMuB3XiKIyFoGefwO6ysVkUlrNUNsyAK/jli533Q+Y8cJFvAeXyMS1CI/jiMr/gUtD2LQwMGr4R3p7bY3oQHQ5b38CT4D2AXXg6YcQXHpyYnlqKsi5iOAVSwL9zd7zJ09r+Cpwq72omFMazjT9Dnibym0dTkRDUKrrgwH7MwXVyYB38BstaGDfLUTsgAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-redo{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4itK+dVQAAAaFJREFUWMPt1L1rFFEUBfDfJDaBBSslIFjbaSFp1FJQFMVCHkzhKIqdUYOCoBgErVz8rCwiTDMwBCIKipDWyip/gxAIWAmBgBC0eYFh2Gx2l9lFcA5M8e59782Zc84dWrT435Hs1siLchqn43MS0zgW22vYxjesYjVLw3YjBPKinMUTBOwf8J5fKLGYpWFjJAJ5Uc7gIW6jM6Kim3iNZ1katgYmEL/6I+YasvY7Lg6iRpIX5VF8wuEe/XV8wGf8jN6LWTiAc7iEQ7ucPZ+lYW0vAtfwvlbfwCKW9gpXDOv1mJvZHiSO91MiyYsyiQSuxtpXXM7SsDmM5nlRdrCMMz3sOJWl4Xevc/vwBzdwAl+yNNwZxfRI+GxelK9ikHcwh8d4NNR/YFRES1ZwoTYdR7I0rNf3TzVNIGbmSvR/Bx08mIgCFSVu4l2ltIWD9WxNGR+W8KOynqnZ0rwCeVG+wa0hjrxtWoF5dAfc28V8Mib/n+Nev5dnabg/zgw87aNEN/bHOwVRiRe4Wym9zNKwMKkpgIWKEt24njxiJlq0aPFv4i9ZWXMSPPhE/QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-reset{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4gWqH8eQAABLdJREFUWMPtlktsVGUUx3/nfvfOlLQaY2IiRRMQIRpI0PjamJhoVASDvNpCpYw1vJQYSVwZwIVQF6wwRHmkAUof9ElrI6VqDAXcID4TF0IiYQMkSlTokNCZ+b7jove2t+NMH7rQBWd3v+989/zP+Z8X3Jb/WGQySvUNTQBJESkNguAVYIWqzhaRhwBU9WcR+QXoymazn6jqzUQiMQSQzWZRVdal1vwzAI2tHQBPOuc2AbWTdOyQ53n7nHNfRwee51GzqoIQMCLDpr3x/tLQ0oZzrk5Vj0/BOEBt+KYuOlBVGlrahr0Wob27t3gEjnZ2AyQzmUwHsDgP6J/AYRE553neDwDOuUdU9QngNeCumK4TkRMhZUORcYC1qysLA6iuSQHIwkWLD6lqapQsuSmwTVV3h99I7EcAR462A2xR2Ilq6ehTaejvO1774kuLNALR33eclsaGsQDe3fYegHl43vyNwEeqGl1963mm2jl7YZRTQ82qlWP4HM6ZToC5ztkW4LHQoALru7s6Di5dvlIj/e6ujrEAWoZDn8hmMjXATMACGaAVuBjXTVVXFc/AxhaA+4zvn1DV+eHxVWPMAmvtb5GeMWZyZVhI2rt7qVy2pOh9U1snwIPW2vMi4oWJuBPYHkVAVScPoKmtkzVVK6cEMsyJraHhiCqJqJUwj/JRz7TW1iSSyR2rVyylqa0Ta+24Ic8vXaAEmDFc/l5Z2A/80OibuVyuz/f9ElUdHCmvw82t5HK5h6y1PYhsz2YyGw43t2KtBZHIGwB6+j4rCkBVUdV7gXrggnPuu8h4eP+xMeZS2D0rJYZ6AdAMzAt1b4nI26p6IFZOY8pugijcKSIHVLUK0LyST4vnrVfnWr3mjmP4QTATaERkXkypRFX3isjmuHdRJEK6Ckqquopp06bdKCkp2Sgi7XnGLcg7gzeutwNIiPYc8HixqIrIOlU9ONVIhHPEd851icgSVXUiskVV94gIqoonIt0i8gfQCfwae38e6BWRXuBZz5jZ8VbaOE4EIqlZVUEQBLlkMplS1QER2RwkEnsSyaREDUzyeNsvIhvCMqkH1kdIJ2o+k8iJB1LVVRfjZ6nqqlEAIbdVQGto8Lrv+/dbawcjAL7vc+6bs+zetetfLSHxniIFGofGGsU2oC7eOCbDfZ7nQawBOSAX74SF9oEPImOq+r7nmVmxb5raukZa8UReGmNmhbMkAwwBH467EYVZe49z7kdgenj8k7V2oTHm8kgdWcvrNdVFjR8cHkYzjDH9wLjDaEwEzpwa4MypgWvAjtjxfGNMj4jMiT+M+kFsZI/Q6Pv+HGNMT8w4wI7TAyevxXVPD5z8+zD64tRXAMHVK1eaVLUyVvuDqroV2BOnJF4ZIedviUidqt4Re9s+vbx8zZXLl7PR2+nl5Tz/zNOFp2FzxzGAklw22wUsLLaSKXwf8vhosZUM6PeDYEUum70VHfpBwKsVyyfeikOP6oBNwN1TrLbfgX3A1kKLzKeff8nLLzw38T5wZDgxn1LnNk5lLRfP26/OnR2hwfNYW2Atn9RCsrf+EECyrKysDFimqhXhyjY3VLkAXBKRDqA7nU6nS0tLhyIj6XSaN9bVclv+l/IXAmkwvZc+jNUAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-save{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4UexUIzAAAAIRJREFUWMNjXLhs5X+GAQRMDAMMWJDYjGhyf7CoIQf8x2H+f0KGM9M7BBio5FNcITo408CoA0YdQM1cwEhtB/ylgqMkCJmFLwrOQguj/xTg50hmkeyARAYGhlNUCIXjDAwM0eREwTUGBgbz0Ww46oBRB4w6YNQBow4YdcCIahP+H5EhAAAH2R8hH3Rg0QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-tap-select{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo3NzIwRUFGMDYyMjE2ODExOTdBNUNBNjVEQTY5OTRDRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCOTJBQzE0RDQ0RDUxMUU0QTE0ODk2NTE1M0M0MkZENCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCOTJBQzE0QzQ0RDUxMUU0QTE0ODk2NTE1M0M0MkZENCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgTWFjaW50b3NoIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OTQ0QzIwMUM1RjIxNjgxMUE3QkFFMzhGRjc2NTI3MjgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzcyMEVBRjA2MjIxNjgxMTk3QTVDQTY1REE2OTk0Q0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6eYZ88AAADLklEQVR42rSXf2TUYRzHv7tuGcfE6Vwb5zLSSjEj7Y9KWqfEmFZJP+yPMdKKmUrrn0iUfjhWlLFi6YfNrF+StBoTo39iYkTGco4xxxG59P7k/T2PT8/37nu3bx9ezvPj+zyf5/PreS78bGLS8SmrwE6yje3NHJsDBTALpknBz6JhH3NiYAB0gHqPOVv52wJ6QQ48BzdAttTioRJjdeA8mAHHS2xuk3p+M8M16ipVQE49Ds6CiFO9RLjGONf05QLx6wPQaBlbBlPgJVgkP0ETiIJ2sB/E1XfimjfgBOOlKDUqCGOcqBcQnw6BYW5YTo4wbvQhMmCfGRemC2rBiGXzWUb+kM/NRZ6CHWBM9ce5R61NgX6ayhSJ5EPlItlDRNkz4JbFHf06BkSzHjXxM+gDv1S/mPUo2AXWgt9UUHL/IVhS8yUV1/EbV3o4N+NaoE9Fu/i827K5pNYHnqAVJECShWmAaddpscYFFXwR7vnXBRGlnUN/L6kqKJlxnRUuDbaDBiL+vst5d4gpcpBrqk/2jIgCKVUolhntplzivHmwh4stGOPfwBWwl/2dpp8p7xjQZqFLiQJtauKkivYm+kzccpK57yXfOUe+P23JqAnVbhMFmlXntCWnxbT31am9ZJ4BJifsUmNTqt0cYhA5ypympPg7VkEKunPbVb8cIG+0kyHLJZNR7fUMooUKFHAPkfQo58VLK+RzwRDd4FdWG9mjpaAXzqkJa1R7kQttqEABWXMjOOxxVRfnhRm5URX1prk/0pQHwNcKlchZ+jdpC+hFdVqO0my9Hj5dkYgCn1Rfh/KdlNDHrJhPqlDih+IfBd6qwpOgEqYMsorJ2HtWxtagLJDn/W3KRfPOZhoeBJfZPgVeGKeKrkQBh5dLXl25Ny3pc4/1fkTdbvFqFQgbxWeYD0hXulhQ0pYiM1jG547fcbMQpVnHTZEn9W3ljsCzwHxCdVteNHIZvQa7/7cC7nV6zHIfyFP9EXjFa7YxKAVqPP4bxhhoLWW+z9JyCb6M/MREg59/RlmmXbmneIybB+YC/ay+yrffqEddDzwGvKxxDmzhc0tc80XVgblqFfgjwAAPubcGjAOl1wAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-undo{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4em8Dh0gAAAatJREFUWMPt1rFrFFEQBvDfGhACASshkL/ALpWVrSAKEQV5sIULWlgZNSgIFkGIVQ412gkBt1lYLERREFJqJRaW1oHAoZUQsDqwecWy7N3tbe6C4H2wxc682Zn3zTfvLXPM8b8j6RqYF+UCzsfnHBawGt3fMcAX7GEvS8NgKgXkRbmMxwg41TLsN0psZmnodyogL8pFPMIdLHUk7hA7eJKl4U/rAuKu3+HslFr/FZezNPSTFslX8QErDe4DvMVH/Iq9F7VwGpdwZUjsPtaSFjv/1vCBPjaxO0xcNbHejLpZrrlvJCMCT+JzA+2fcC1Lw+GE4l3CG1yIptfjCtiKoqtiJ0vD3aM0Py/K57iIMxgkQxat4EdN7e9xdRzlk+LEEPvDWvIDXJ928sYxjL36icWK+VaWhlezOIqbGFirJd/H7szugrwoX+D2BDEvszSsT5OBdfRaru/F9dPXQF6U27g/KnmWhgctxqyzBrZGMNGL/rHI0nDkKXiKexXTsywNGx0OnFbFNk3BRoWJXnw//j+ivCi32/S8CxPVNiWOAdUiJtXITIqYY45/Cn8B2D97FYW2H+IAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-wheel-pan{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgswOmEYWAAABddJREFUWMO9l09oXNcVxn/n3vc0fzRjj2RHyIZ6ERuy6CarxJtS0pQSCsXNpqGFWK5tTHAwyqIGN7VdEts1LV04BEoxdlJnUbfNogtDCYWQRZOSxtAUCoFiJY0pWJVUjeTKM9LMe+9+Xcyb8ZMychuofeHCffeee7/vnXvOuefYlV/+mv932//tb91z/Y2rvxmMHQ+4FcEfOIGN4A+UwDDwoQScc7vM7AIwB8yZ2QXn3K77Ab6OgJnVgeOSbkqaBiaACUnTkm4Cx3OZzwf+qzcRQup1zNZ9RwDe+0YI4YKZTUn6zCGSMLOfAF/03r+QZdnyfwO+ePEiI6N1nPMgMDMkETLRbd2mXG8gCbd9YiIKIUxLKoLfBN7I+80+CUlTIYTp7RMT0b3Af37p8kh5y9gZcy4Fzt+5szqSaxkzUR7dwtrKMmaGW242d0t6vrD/He/90865o865o977p4F3Ctp4frnZ3L0Z+OryUrVSrZ0z8ZxhHjhcq1XPrS43q/0flDlK9XpPA2ma7gMeyvfPx3H8TJZlH4YQWiGEVpZlH8Zx/Awwn8s8lKbpvmq1ahvB641SXNk6dhLskNA2MIBtwKHK1vGTW8bKMRbAMgyPqWeETxUM8VSSJAv52JmZA0iSZMHMThWwnipXKp8hsLLcSaIR92oU8xjSayCQXotiHotG3Ku3m+0EOQwPQCDggMf7BzQajSs5eAk4B5zLx4O1vD2eJMmAQKliscgASJMw21pansFs1swQ/DNLmUmTMNuXX+taXHTDaj5OW612R1JZ0nFJJ/J+XFJ5aWmpA6S5bHV8fHsPHFU6q3pJCjtFxtrKMuXRLUUXXxdrRLazFOtUolZlsGhmACsgnHPTwJnCnjP5HMBKLotzxsTE9rgDL0t6LoriKsDIaB31ZEK+JxQJRHFUBR2NqLw8OTkZR0OC0ntm9k1JWU7OA4vD/mZ+YfElsANmNEKi75vztzB5M8uAr+bx48me88g757PQ1U5zNg52YH7hX8l6f+4Fi3c3BqHNmkI4YQOV2MGCNu9qHPYCewfzbrC+XSGcWEcgTRKA3wFfyzdDz5d+D3x9CIcfA4eBbQS9LscskgfLnHNPAnslvS/pbZDHLLPADpx9N9fqpSIBH8cxWZY9m6bpb4Ev5fN/iKLo2TRNgdx/eo8Wk5O7Ts/N/SOSdMjHdj4kmgkIEJLJzPZKetvMTkIvFLsR25Ml2gfuF5M7vnA66sdooJYkCSGERe/9VAjhzRxoKk3Tvg3U8nulVqvx8cyNpER2umM+SdOkbc5B8JhpqBdIgTRR24h+lpKen731aRIN7thscH9Zlv0d2F8YD2TIX7F2uw3A7ZWV1a0TYz9ca8cJZHRbuRuaDfUCw9/qJHamPOKToAwHtHN6lMvlSkH2o7wDMDo6WuGuQbbn5+YAKNcb3J5fSvrhtTY+vsOPuD1IOyRhMOkj9kSx29HfXB5RUnS964NT2+3vbGbxG9auO2cDNuV6A8NTb5TitBuOpQkfYD2vwOxgmvBB2g3Hto5X42EJyVsFlztbKpXGNgqVSqUxSWcLU2+tdToa9hasLjfPYlwGa+bTi8Dl1dvNsyvNtQQL9MO2w+HM7BqwlAtPdrvdq9773WAVsIr3fne3270KTOYyS2Z2bbXdHhogKmPj7YWF+VOSXs/v/9KdO+0fVBrjbRkgB/KIDBnYu9f/7D+ZmfmRxPd6qwB8YmZXcq1MAQ/nJhTM+OnDe/a8+PGNG9lm19V/D1Qw7HXZlcRa69+U6w38l5/4ipxzf5X0CPBILjcGPJH34pVcc8692FxcXLlXRnTwwH7+9P4f8aWe3fY59LIqo1NMyQBCCHNmdgx4BegUWefjDvCKmR0LIcz9L8nokSNH+PRvH4HC3YQ098pSbevg24qlmZmNmtmjkg4D3+j/tZldkvQXSa3PW5ptlpL3ZaIN99OS9F7+IgKUgSyEkNyv2nHT7DZX0dr9rpjua2l2r4rogRAYVqZvnPsPqVnpEXjEaB4AAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-wheel-zoom{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEgskILvMJQAABTtJREFUWMPdl1+MXVUVxn/fPvf2zrSFmUKnoBCUdjRoVaIxEpO2JhilMYBCtBQS2hejpg1Uo2NUrIFAoyGmtiE+GHwQGtvQJhqDmKYRBv+URFsFDNCSptH60DJTO3dKnX/33rM/H7rvsDu9M20fDMaVnGTvtb69z7fWXmvtc/TEzqd4OyXwNsv/FwFJQVI/sA14SZKRLOlPkr5TrVYXHz70quYkEEK4TtI2YAgYkrQthHDdhV5uuw+43/ZrwCbgRttgY/tjtrc0m83X3/f+D6ydnJhYcB4BSZcBA7aP2d4ELAGW2N5k+xgwkDB0IH19CGGH7R8B1aQeAf4KvAw0ku4K2zu7uru3ApdPEyiKohd4TNKjtjt5h6RHgccSNrddbvuHtm9Jqoak7xVF8WFgdavV+pSk5cCObNmXgK++85prCj3z28HKqZMnH7D9YAY4BvwujT8BvCuL1INX9vVt+dfwcCvNb7f9q2RuSfrGvWu/sL2Nf3LX7pzvj4ENSGBPVarVd4fRkZFltjdmoMGiKO4IIWwIIWwoiuIOYDDzeOPoyMiyFLkum7WJCMDztrcrTTrIRuAQZ6NcK1utL4dWq/VZoC8BhqvV6l1lWb4YYxyLMY6VZflitVq9CxhOmL60hhCKeYiV7WMKIXw9jT1HpXw3c+bOAKzOjJubzebJrKQCQLPZPClpc7bP6rMYKtjXth2OMf7tIkr11Wz8oQDc1Fb09vY+kQw1YAuwJY2nbUluAnCWpKkaFl6IQIzxivaR2SYA89sJVK/Xp2x32R6w/a30DNjuqtfrU0ArYecDCEqgLqm94T0dEm9mBG7PxkdDlkBnkhebgIezNQ8nHcCZPL9ijE1Jf/bZZoPtzbavmqNZLbf9tSxq+yoduuJ+SZ+zXSZyBXCqU+d8fvC5yRUrV+0G2j3g2hDCLyXd/+Su3QdnvP/zCuH72LWsgf2k0oHlH2c2odlkxcpVEdgr6aDtjyb8x20/J+mA7T9I6rL9SWA5dne2/GdXLl58qNJh398An85yTMA+4DOz8Dgu6Zu2dwJXJ91ltm8Gbp7Fgb+EEB4aHhpq5CEtACqVyr3AC0AlPS8k3TSmQ2YPhhBuS/1/LpmS9JTtNTHGfwBU2uUALARotVqniqJYH2Pck85pfavVaufAwnQvnHc0McaDKVptebN94QAnJB0EdtjekydyZXqjs/0ZgLIs/w6sy8bnYGYJ63pgERKC05JutT1kOwITwL9tvzlzUQUYB+Zjs2DBgu6xsbGJZHstByZbezregcBXeCsEz1bnzXt5anLyzLq71zDLxTRdVgemdx0fv2e2w5thO5DbiqL4oKT3ZKpnpyYnz+SY2ZpTAPZmJfdIrVZbNBNUq9UW2X4kU+2dcf53Aj1pj2PA7y/6m1DS00A9za9uNBq7iqJYBuoGdRdFsazRaOzKSqye1rTbaa/tlbYrqXQP2X4FIA9/J1l39xrC0v7+w5IeB8XkwS1lWe6TGJAYKMty31tfO4qSHl/a3384I3CDpI+kzC4lnRfrue6GytEjR8oQwlY73gC0L4qlth/q0M1/LYWtR48cKQF6enrC6dOnVwGLEpnxnp7en4+O1i/tszzGOCTpPmB7ahb57QUwBWyXdF+McWg6MScmuoA8OX8xOlpvXGz422XYTsB/SnpA0h7bX5R0WzI9HUL4qe2XbI+dk3xl+V7gxoztD5jRI+YK/zkEEokx2/uB/RdzIfUtueqVN04cXwF8G3iHY3z9Urw/j8ClyhsnjrcS2Vv/J/8NLxT+/zqBTkcxU/cfEkyEAu3kmjAAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-box-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4QfHjM1QAAAGRJREFUWMNjXLhsJcNAAiaGAQYsDAwM/+lsJ+OgCwGsLqMB+D8o08CoA0YdMOqAUQewDFQdMBoFIyoN/B/U7YFRB7DQIc7xyo9GwbBMA4xDqhxgISH1klXbDYk0QOseEeOgDgEAIS0JQleje6IAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-freehand-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADTElEQVRYCeWWTWwMYRjH/88721X1lZJIGxJxcEE4OOiBgzjXWh8TJKR76kWacOBGxdEJIdk4VChZI/phidRBHMRRIr7DSUiaSCRFRM3u88gz+o7Z6bBTdjmYZPf9eJ55fv/5zzvvDPC/H9QsA66Olo9Ga+/MdR+Ljm2/KQIULsz9FqItGdOfJKLhApLgVkiSCGODjWit7QpKWy+TNrFeXvzKVUT8NiTVaIgDcbiCFJ7GiT8WkARXAdYBK0Lbhi/CenArRNskuM7/tgNp4ArQ42dwjf3WY5gWTqC7O/NbNn2Xkfw/YwdSw/We14HP2IEZwX+y9cZ9SH0LmgFP7UCz4KkENBNeV0Cz4b8U8DfgKiDxMWwUXETqLvJpCQpXZfawbzS7t9v5pL19cHBwfja7YA0y/lyCM0+E5hv5+piZXwKYcF23as+37bTXsQVqgkL0p/34fHR7DcBtbetFsBmGDwMOJCggYG55yw7dMlk6DuC1Bdu2RsCU9TYWQq2IoGbsreZ5NzvEqfSBsIsIy8OTbcdgiRHeh4o8AFAEwDakbY2AaCCpH7V9aGhoUUUy3UyVbkPYFuYLDlUZH8XBpwxkK0Dbgxg5HcVi0ent7a0RULMIozaHBSMfF9b2SzdutFcFB2FkwMIJOG6qfteXOa1nHZ48tyefuwyfT9s6wtzZ3t7eZse2DR2I228TtHXzuWCx9g8MtK5cuHCZTH4tiHEOa4xFngvTyS8f35d6enomiCi4/foEXBkZaQuukChL4FYA2Whd7YcC4gEdW3CpdL3LtGAVCVYJywEyTpAuJKeMOKXZs/Bw947C50KhUFOG4cwz35cjWNBlHGeD53n3xsfHP/T19U1qciggar8Fa4I3PHobIotBWBtc2hSiChyZxVzM53Pv7FVH6Tp3uVy+g0r1ImD2GjIrQGYIxjnfuXTZGICS5k/bBwJoubwEFX4TLah9EXomJGMA3za+f9913Yl4TnzsDQ+vE6YTZOjHh4ngibstt1pzQwd04F0bPStEBpXqRoBeQ/AKghfBnOEKgS+Q7z91Xfdz/HGKg8Ox7z8iYD9z6wqTkZFgnvhMGP9VZ2or1XVkPM9z0mytSfVsHa1RLBZbLoyNzUnK+ydz3wC6I9x+lwbngwAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-poly-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEjglo9eZgwAAAc5JREFUWMPt1zFrU1EUB/DfS4OmVTGDIChCP4BgnQXRxVHqIJUupp9AB8VBQcRBQUXIB9DWQoMRiXZzcnQSA34A7aAuHSJKkgo2LvfBrU3aJnlYkBy4vHcP557zP/9z3r33JdXa647N0kHSZd5Nn0rSxc8G3cXp85sMcnZZ8vge3osZ+l3vB8CWFA0iL14t79h210swAjACMAIwAjACkB90D/8/GchI9ve4nPwTBh5E9ws7OepzGWb9EddSn51Op9ZstadSg4VK1UKlKkmSDSMLALewiuNh/hVJq71Wxttmqz0dG88vPc+MgWP4grvYG3SLOBrZFFFrttqPe4HIDxh4GSei+98iSlusuYopXEAjBtEPA3tQwUpwluAbDm4TPJUz+BTW9l2Ce6G7L0X/Bw8D3T/7SKKIDzHg7QCcxjvcQAEtXAnrrg/RP0/DKPbqgcN4iVOR7gcO4dcQgRuoh7HSqwlP4n20m63jJu5n8MkWMYfP3UowhzdR8FU8w9iQwevBdyq3/27CMRzAE5yLuvsRLg+ZcR1nJ8YL81HWJUzGAPaFZwe/Q5MdyYDyNHgjzO90YyGHtVDncuiJchaHw8R4oREFV5qdiVmYLM3OgD9k5209/atmIAAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-point-draw{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEiERGWPELgAAA4RJREFUWMO1lr1uG1cQhb9ztdRSP7AF1QxgwKlcuZSqRC9gWUUUINWqTh5AnaFOnVPEteQmRuhCURqWsSqqc9IolREXdEvQBElxtdw7KURSFEVKu4w8wAKLxdw9Z+bMnRmZGXfZ29//II8th4WwGVNyIoQLYB5vxA9Caq04iUd9A+7ZlsNC2I7TdSd2hZXMJKlnTqp9jtl/GBaqoyQ0noFKpUIzBicYYc+DEFpxkglc4oVJa5gvDn8v1xV2irG3FM4NSVwjUKlUaMcpJhCGmSEJQ6QGD8M5WnHCd8+f3QCXpPLx8WNwv0j6Bm9FMK7FJ3WBE+R/2t7c/GBmFvSBrzRTCsyTDjXrxUgEMtpxynJYmJoBJ4VAybwVARgvL7Oik0okCodnKpVKX7P0leiVMb0VvbJT+upznK4vh0GIeQwwQStJkHQD3MwsCALTJRG7Qrdrj5m/djgYaIa0hlkRdJk26XEgC9txurccBtVW3IudBImmZuACUP+ZlIDBt9FKcubYNTcAH/X0RYM1E7utJPlqe+uZzPxUcEkiSS4sTT95n15Mud0xWC0o2PAWOCdK3KYZlFxfM+tHOcnMzNr1es18ug+cgsVjP4yBU/Ppfrter1m/+l0+zYygML1xRVHU7TSb1cSzBzoBzszsH+AMdJJ49jrNZjWKou6wBnwOzcyndBpNbuueURR1Dw8Pq35p9cc5p/Dy9Dypt7jXrtdGwQECS9NPhr6Gq6txUzNigE6zydLK6lTw12/KT4FGFEUfJX2YJNONq5tVs4ODA7sD/DnwJ/BoADZuE3tHFs12dna6d4C/BI6AlbyzI8ii2TTw12/KK33gb2cdXsNZoAntbZC2SeO4c9592k/5eNQbiwvFd1kJuFGwLJr1wSPg/SwpvyFBHufOeXcFeAlE97U/uCxOY+P3b+Bn4B3Q+L8EdJfD4a+/AbC4UBzPxiPg3wlHZquB28Cn2IuR9x3gr3uV4DbwfvSDOvi4uFA8BDZmIRHkjHpS9Ht9iRqd8+5G3g05mAGcQbsdiX5QJ428G7Kygo8XYdb1/K4NWVmjzkNge2sz84bs+ELmpDDLtqWsNZBXgvmw8CTtpWVMT7x5YWBjLARnwZfKQNYN2U2LPvrh+5nBt7c2M2/It9bArCTKR8eZN+SJ13AScPnoODeRdqNenH+wul5w2gUr2WUjMFAt8bZ/0axX/wNnv4H8vTFb1QAAAABJRU5ErkJggg==");}.bk-root .bk-tool-icon-poly-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gELFi46qJmxxAAABV9JREFUWMOdl19vFFUYxn9n9u9sCyylUIzWUoMQBAWCMdEEIt6xIRQSLIEKtvHe6AcA4yeQb7CAUNJy0daLeomJN8SEULAC2kBBapBKoLvbmdl/c14vdmY7u91tF95kknPOnHmf95znPc97Ro2OTeBbdjFDT3c32ZxVHUOE9kSMB0/m6ExuoJn1H+ur6Y+OTfD50SMN5168OgrAlyf7CfuD+z7+iDs3p8hkLUQ0iFQ/yFl5Nm/qonfHVva+s32Zw9GxCYILsZ08tpNfBhbs+1YN4OH9+7huGdECSBVfqUosbsllfmauBqiR+cCNwOr7AEo8pPHJnymXykhg5fUWjoQpl0vVvhZhbSzGoUOHqgBlt6B6uruj2Zy1E9jo0fhfeyL2x4Mnc8VErK0KUEOB64JSyptfG4RSytsJjUJVxw2lsFy3urL9nx1Qd25ObctkrVMi+jQivd7U2ZyV/3Hzpq7h3h1b/7p9Y0o8v8rwAbTWrGpSocN/FGDlbAI0Rl23PCBan0Ok158H9Ipwzi25A/Mzc9Gl/BYx/E4kYqC1NKRARNAaDCNUM27Z+Zr+ouXs0q4+LSLBHPYCFkTkC6uU39kwCdsS7WRKmaYUiAhdnZ3MPX2K4+QjQI+C94A93rMzm8ltMwyDeDzWjMZeEb2pYQDdW3vITU2jtUZ5QThOPgm8C7wP7J15OPsBsB3oWpGnVWisCeDS1VHj4vBI92+/3tgB7Ab2AruAXiDBK5oIOkhtkEYRNRuJhObrd8Dl9ewf4D5wG7hVLpen29vb5wzD+BrkbBMaL3d1dk5nsrnlFDTTFWAWmAZueWD3gCemGde2k2fw1Al1YXhEvjozoO49eczdqekrWmsc2zlrmvEKOGoW1GUjFLqSk2KpJrCLwyMCPAP+BO54QL8DM6YZX/ClsP9YnwKkXnIBP4jdIpJRpdJTCYdMwwi98KU0Hjc/dDILNyUcwTCWdOSMJ0TRmBktGRhLugu0xyLk7CIqVNm+0bGJptl1YXikD0grpY4Rjc4a8Fbgdab/6OGbAJeCUuyJnnHmZH9pbSyGuBXV8NUwlUpR1EWyixmSyTWEwqGlJ2Swbo2JXbAAfgDGgGQA9I1A9t1tlq0AxrXxn0ilUpw4fhQqYkH/sT41OTnJJwf2s6FjI5mshdYa7bqVR2uezr9MJmJt14FvGrh/O9D+e6UkM/xyCuCqEKCYnJyUTKFQrZDHjxzGshwWLQcRsOz8Hi85P23id0ug/XilAMLBmm4tPGdoaKjSH5+oAGrhwvBI9SjZTn4QSK9yenoD7dlrExPoJlXW8G8ytpNHxRKk02lGxsdRKFwXLNvx5yY94HQLGhGk4LFCYQSqaE0AwWM1eOoEbR0dKBSW7bC4mKuffxs4D/wCLKwQQPAUzIkslfp6cVomROWSolh0GjldAM4nzDi2k9/i5UAzC9aKfwNJ3zgJg9YEvN6+C7SHgKm69+sD7RfNnKTTaZRPQfAut4oFV//IS7gkcB34VlVo8kGzphlfB+DU+TfNGBpZtRastvrvARJmfMF28ge9sc2B9/PNnCilMIDwK6y8/ow/Ai4kvILTljAXvDvEvrqKSUs60KolzPjBxspavQD2tKqCAGF/Ba+xE/Wbilu54wZV8NEKF5fXzQHl/bh4hUsE0WAXSlDMYcQSrQXgCmsTseXHsJkNnjqBFGwKJaHsKlxtUHYVhbLCzr1kaOA4bcn1y1Swmb+iLpJKpVrfgdpfsiVVCYcgluwgnU7jEgJ4s5UkLFtWYyHyEg0/N1q1tmQH+YXnAMFr97Nmv3p+0QsHQRsF8qpBOE5+rb9Nkaj50tVQKjqh4OU3GNL/1/So3vuUgbAAAAAASUVORK5CYII=");}.bk-root .bk-tool-icon-line-edit{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAG/3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVdpknSpDfzPKXwEJBDLccQW4Rv4+E4BtXR198znCdeLLijgQUoppWg3//Pv5f6FDwefXJRcUk3J4xNrrKzoFH8+pyUf9/f+8J3C7y/j7jnBGApow/mZ5l2vGJfXCzne8fZ13OV+9yl3ozvx2DDYyXbauCDvRoHPON3frl5Imt7MuX8hH0seiz9/xwxnDMFgYMczUPD7m89J4fwp/iK+OVRbiMf6gm8K4bv/3NN1Pzjw2fvwn+93PLzccTZ6mJU+/HTHSX723/bSOyLi58n8jmiqz/798+a/tUZZax7rNCKOakzXqIcpu4eFDe483kh4Mv4E/byfiqd49R2OHzC1Od/woxLD44siDVJaNHfbqQNi5MkZLXPnsMdKyFy5gwwCHXhocXahhhEK+OhgLmCYn1hon1vtPBxWcPIgrGTCZrR5fHvc58A/fb5stJaFOZEvT18BF1t8AYYxZ99YBUJoXZ/K9i+50/jPjxEbwKBsNxcYqL6dLZrQK7bC5jl4cVga/Ql5yuNuABfhbAEYCmDAJwpCiXxmzkTwYwE/CuQcIjcwQOKEB1ByDCGBnMJ2Nt7JtNey8BmGvIAICSlkUFODgqwYJSbkW0EIqZMgUUSSZClSRVNIMUlKKSfTKc0hxyw55ZxLrllLKLFISSWXUmrRyjVAxsTVVHMttVZVHKpRsZdivWKgcQstNmmp5VZabdoRPj126annXnrtOniEAQlwI408yqhDJ02E0oxTZpp5llmnLsTaCisuWWnlVVZd+mTtsvqVtU/m/po1uqzxJsrW5RdrGM75sQWZnIhxBsY4EhjPxgACmo0zXyhGNuaMM185uBCEgVKMnEHGGBiMk1gWPbl7Mfcrbw7e/V9545+Yc0bd/4M5Z9S9Mfedtx9YG7rlNmyCLAvhUyhkQPrNhvO5AJFnrZIR0plaLL5liQYdDi5TubaIokFDkmoFEB8CzxZVxemssDqthPhUblPgW1iQU5g6XwNwyVI7bUFRm035iNziMkgWvEso2SXnsJfveR0Y4SlVF8YWC1pVQhJiQa8JwDvlMNIxAfq3F7GDObHU1LlhzlZaWwNp6BvACxAgInGXlllMGZCpEnZHrGA6GM2718xuFcz7YdUQxzEEfjdWz4GlkcwaonT0pgA6mB25grPILtnSMhuCpsGhmMU6uJbixJs4lbKHqh+wos1jW2rchyGRCIvN9MXu+KAmMSfAlIKVvi/tybhCPJZCu2Ow9pLdyo427+X2ovMBmKNu8PA0zgl3fS0PB1DWWkVYB47bkyiJHhkFPzTzCjzn4Dq1mqoIWzCmcDGsHQmQAQdEHsixK1IXESd5rLU7THVJNV8obHS8sZeN0G5Jdt5pQTVKCCbgK1hItTS8o92iEZpuWJ/oC2r/0+zTmhvFXoaMVKRe27altDtid6OvG1hENVwBnC61KKugNoemOiPCCNb3GoHAZOFuDxxPsD+07nbSPcr/o1Zmc4jARhotrA5F5ZcjP9rPk90vR8A+k028A+8+5wKlHVID542sMzMCuXktkRzUCpE+xCBZywjNcJITx0II9x5948CekBl4XaC5OCX2nCyObdwN3HwQh5DWL/BBEkhDYHn/vpXNgZkVTZs8rj+HO8JFC6qvDVhgAEQSYCDyC86rMhG1WPzAVB9ZldDWG6EzDcFiqJBDvFS8mXDv3SK2LPoguVB2kwUx7UL5KqZWiEzocsbvSjNnaYDNtcYJuA5cDcsrvHd6yCxGjqvl9+wh3Qh8Kc9py8sNW8ncU8qwxdPj1qIGfrPqlXeoS4/JLa/LwRLTCtxuSoZUT+2Su6kXW3QNacYQbId6NUKVbROpviybFSPQQL9lhB2MamEnFyB9Y+hrG1+xBg+L0QG2TZdTdlcsBdq9oHdt9Bu5/IM9+Nfh1AwrSqlboTA6Bgq568A7UfbaMrZjoQZhQphofvNw93+bN+5X7FYKBgLmRid+tSdV6c02A4R0cHwKobmoMt5+6WI9XNISFIywpf6RMd5/a91vE78FzVHIFmxud4woyJx76OMTCa4yhgN3iJO2VfRPFMv9sYTxFzU+1eWeYS52pwOoSJldZY6koib4P1O427rbeUrNZfu44hWjz5ZSuu/vKPpimoXbLkfxWSPetvxDWG5jQSaZCxA3ad+p6rlttDhK+YwwK1LHVe0drDtorc5vnQ1247g58vewDtU7L3DRwrG4dhCUDRKKOtYr2dXHtpt+33d1WZmfkAHdl7Q8ENF+CNgB+nOw29n5F7SeNo/ckbu4laLTCdqJLHjmhJbKzmrCEX7zULrhefuHmu0V/1nbP1pnb6FaT7sOxn4pvWkfrYhYtCeJ4Xv+kOXrroIs1eHWXN1/AfzaY94ms5vaAAABg2lDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV/TSkUqDnYQUchQnSyIijhqFYpQIdQKrTqYXPoFTRqSFBdHwbXg4Mdi1cHFWVcHV0EQ/ABxcnRSdJES/5cUWsR4cNyPd/ced+8AoVFhmhUaBzTdNtPJhJjNrYrhV4QwjAgGIMrMMuYkKQXf8XWPAF/v4jzL/9yfo1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx4z6YLEj1xXPH7jXHRZ4JlRM5OeJ44Si8UOVjqYlUyNeIo4pmo65QtZj1XOW5y1So217slfGMnrK8tcpzmEJBaxBAkiFNRQRgU24rTqpFhI037Cxz/o+iVyKeQqg5FjAVVokF0/+B/87tYqTE54SZEE0PXiOB8jQHgXaNYd5/vYcZonQPAZuNLb/moDmPkkvd7WYkdA3zZwcd3WlD3gcgcYeDJkU3alIE2hUADez+ibckD/LdCz5vXW2sfpA5ChrlI3wMEhMFqk7HWfd3d39vbvmVZ/P2aecqIM1FFZAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AQdDBkQmV+argAABM5JREFUWMOtl9trHFUcxz9n9jYzm7Tb9JIWGtqUllLwVgRBQWl90S6lTaGmF6E2/4H+A4r+A0offdlWodL4kEZw9bG+iC9iKqLF0os0EBq02dtcdmdnfj7szGZ2M5vulv5g4JwzZ873+7ufUfMLi0RSa1TZNzVFrW511xBhzMxx79EyOwrbGSSzZ073zOcXFnlv5lTi3mvfzAPwwYVZ0tHiq6+/xu+/LlGtWYgEINL9oG657N41yfSRgxw9cHjDgfMLi8QVsR0X23E3gMXnkXQJ3L9zB99vI4EA0sVXqsPF93xW7y73ACVJBJwE1j8HUBIi3Sz/QNtrIzHN+yWdSdNue915IMKWXI4TJ050Adp+U+2bmkrV6tZeYAXwEJExMyf3Hi0rM5fvAvS4wPdBKRW6vZeEUiq0RIBCddddpymu0+rRbPvEzkPVmmWLBA1EdGAbYNctt7V712QwfeSgd/uXJQnPVVoEEAQBTxXpuEMELNtNNFW1WrsrQdBCRImQEeE/wBUh53v+7tW7y5n1+BZRIoJSioXvy3itdgclURSZTBrP87AdV57G1TT0d4GPgC+Bw8Ca7bifATsTgzBvjlH1qgNdICJM7tjB8soKw4jtuD+Gw3c229e1wF+P/uHPpT86rhBBRHActwAcAl4EjgIvAYcFJnlOoq5dv6EBU8AR4OUQ6AVgGjATwuC5YUdZ4A+z+1mBTUM/AKwqpZSIpPfu2VP7+/6DYEMMPE9N83lzq23ZWwxDd4GaQnmgUloqperSCpKC8HGCXz8G7NANU8CWUKPzsUDbyLPVyjYC39e0VMZx3Ccoha4b4lQqbUlnsBqNWCXpEMgKfA38DNSBcdPQr4zlMtTtFiqlulmQmJv9ks2idUZGZMjZmZMAfBUvxWHR0y5dmPV2FcbPG9ncFdPQS3nTuAJQLBZpBS1qjSqFwjipdGr9SWlsHTewm9ZmnngMKAaV9nBd+/bmdxSLRc6dnemm3+yZ06pcLvPGW2+yfWIn1ZpFEAQEvt95goCV1TXMXH4zAt4woaRF7RTAVylAUS6Xpdpsdjvk2VMnsSyHhuVEZTh+xgywBhwLfZIdKRfj7dWqPGFubq7T428ukslkaHttLNsZ9P3nwIfh+DhwS4EO9DA0zByBCE2n1fPxpQuznSCaX1js9nFp2pjbtqGhobQ0jUY9CbgALERah3IM+El1rNqTaqaph5W1uYGAFrfA5YvnyE9MoFBYtjMI/BXgQR/4pqVDZL3V9/cYrX+x7SnsXh/H5TLwW2iBQbVLNgn65CDsrSPOIJOXwmdQ4fRHrZilUqmXwNXrNzbbfxv4ArgFVBLeJ95oDEMHwHHcvvUcRqEwuBf0SSUEB9gfxsAgAkO1kcj/WvwKPaR8EhvPAUvRtdIMtR1FtBH37w8DEeChaehXw/xfAnzHcVOjEkhHrIe0Qlz7T8PuWLEd9+2w9KphgUUgQJ7JAgAPDT13NTrJyOYqIilrlEwQv/NPMTSByxfPIU37eCqtq2zWmPYDjbavaLYVdn2NuffPjqRJK2hRLBaHzoK+X7L1QE+nIFeYoFQqkTVMaTn2UOe1LWtwEJqGzqgRnS9M4Fb+3XBJGfSrFzW9dBw0icioJBzHzUXdMJM18APwWo6Kmy1O6X+V8UHDotBqogAAAABJRU5ErkJggg==");}'},function(e,t,i,s,n){s(),i.root="bk-root",i.menu_icon="bk-menu-icon",i.context_menu="bk-context-menu",i.horizontal="bk-horizontal",i.vertical="bk-vertical",i.divider="bk-divider",i.active="bk-active",i.menu="bk-menu",i.above="bk-above",i.below="bk-below",i.caret="bk-caret",i.down="bk-down",i.up="bk-up",i.left="bk-left",i.right="bk-right",i.default=".bk-root .bk-menu-icon{width:28px;height:28px;background-size:60%;background-color:transparent;background-repeat:no-repeat;background-position:center center;}.bk-root .bk-context-menu{position:absolute;display:inline-flex;flex-wrap:nowrap;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;width:auto;height:auto;z-index:100;cursor:pointer;font-size:12px;background-color:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);}.bk-root .bk-context-menu.bk-horizontal{flex-direction:row;}.bk-root .bk-context-menu.bk-vertical{flex-direction:column;}.bk-root .bk-context-menu > .bk-divider{cursor:default;overflow:hidden;background-color:#e5e5e5;}.bk-root .bk-context-menu.bk-horizontal > .bk-divider{width:1px;margin:5px 0;}.bk-root .bk-context-menu.bk-vertical > .bk-divider{height:1px;margin:0 5px;}.bk-root .bk-context-menu > :not(.bk-divider){border:1px solid transparent;}.bk-root .bk-context-menu > :not(.bk-divider).bk-active{border-color:#26aae1;}.bk-root .bk-context-menu > :not(.bk-divider):hover{background-color:#f9f9f9;}.bk-root .bk-context-menu > :not(.bk-divider):focus,.bk-root .bk-context-menu > :not(.bk-divider):focus-visible{outline:1px dotted #26aae1;outline-offset:-1px;}.bk-root .bk-context-menu > :not(.bk-divider)::-moz-focus-inner{border:0;}.bk-root .bk-context-menu.bk-horizontal > :not(.bk-divider):first-child{border-top-left-radius:4px;border-bottom-left-radius:4px;}.bk-root .bk-context-menu.bk-horizontal > :not(.bk-divider):last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;}.bk-root .bk-context-menu.bk-vertical > :not(.bk-divider):first-child{border-top-left-radius:4px;border-top-right-radius:4px;}.bk-root .bk-context-menu.bk-vertical > :not(.bk-divider):last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;}.bk-root .bk-menu{position:absolute;left:0;width:100%;z-index:100;cursor:pointer;font-size:12px;background-color:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);}.bk-root .bk-menu.bk-above{bottom:100%;}.bk-root .bk-menu.bk-below{top:100%;}.bk-root .bk-menu > .bk-divider{height:1px;margin:7.5px 0;overflow:hidden;background-color:#e5e5e5;}.bk-root .bk-menu > :not(.bk-divider){padding:6px 12px;}.bk-root .bk-menu > :not(.bk-divider):hover,.bk-root .bk-menu > :not(.bk-divider).bk-active{background-color:#e6e6e6;}.bk-root .bk-caret{display:inline-block;vertical-align:middle;width:0;height:0;margin:0 5px;}.bk-root .bk-caret.bk-down{border-top:4px solid;}.bk-root .bk-caret.bk-up{border-bottom:4px solid;}.bk-root .bk-caret.bk-down,.bk-root .bk-caret.bk-up{border-right:4px solid transparent;border-left:4px solid transparent;}.bk-root .bk-caret.bk-left{border-right:4px solid;}.bk-root .bk-caret.bk-right{border-left:4px solid;}.bk-root .bk-caret.bk-left,.bk-root .bk-caret.bk-right{border-top:4px solid transparent;border-bottom:4px solid transparent;}"},function(e,t,i,s,n){s();const o=e(1),r=e(43),a=e(9),l=(0,o.__importStar)(e(229));class c{constructor(e,t={}){var i,s;this.items=e,this.el=(0,r.div)(),this._open=!1,this._item_click=e=>{var t;null===(t=e.handler)||void 0===t||t.call(e),this.hide()},this._on_mousedown=e=>{var t;const{target:i}=e;i instanceof Node&&this.el.contains(i)||(null===(t=this.prevent_hide)||void 0===t?void 0:t.call(this,e))||this.hide()},this._on_keydown=e=>{e.keyCode==r.Keys.Esc&&this.hide()},this._on_blur=()=>{this.hide()},this.orientation=null!==(i=t.orientation)&&void 0!==i?i:"vertical",this.reversed=null!==(s=t.reversed)&&void 0!==s&&s,this.prevent_hide=t.prevent_hide,(0,r.undisplay)(this.el)}get is_open(){return this._open}get can_open(){return 0!=this.items.length}remove(){(0,r.remove)(this.el),this._unlisten()}_listen(){document.addEventListener("mousedown",this._on_mousedown),document.addEventListener("keydown",this._on_keydown),window.addEventListener("blur",this._on_blur)}_unlisten(){document.removeEventListener("mousedown",this._on_mousedown),document.removeEventListener("keydown",this._on_keydown),window.removeEventListener("blur",this._on_blur)}_position(e){const t=this.el.parentElement;if(null!=t){const i=(()=>{if("left_of"in e){const{left:t,top:i}=e.left_of.getBoundingClientRect();return{right:t,top:i}}if("right_of"in e){const{top:t,right:i}=e.right_of.getBoundingClientRect();return{left:i,top:t}}if("below"in e){const{left:t,bottom:i}=e.below.getBoundingClientRect();return{left:t,top:i}}if("above"in e){const{left:t,top:i}=e.above.getBoundingClientRect();return{left:t,bottom:i}}return e})(),s=t.getBoundingClientRect();this.el.style.left=null!=i.left?i.left-s.left+"px":"",this.el.style.top=null!=i.top?i.top-s.top+"px":"",this.el.style.right=null!=i.right?s.right-i.right+"px":"",this.el.style.bottom=null!=i.bottom?s.bottom-i.bottom+"px":""}}render(){var e;(0,r.empty)(this.el,!0),(0,r.classes)(this.el).add("bk-context-menu",`bk-${this.orientation}`);const t=this.reversed?(0,a.reversed)(this.items):this.items;for(const i of t){let t;if(null==i)t=(0,r.div)({class:l.divider});else{if(null!=i.if&&!i.if())continue;if(null!=i.content)t=i.content;else{const s=null!=i.icon?(0,r.div)({class:["bk-menu-icon",i.icon]}):null,n=[(null===(e=i.active)||void 0===e?void 0:e.call(i))?"bk-active":null,i.class];t=(0,r.div)({class:n,title:i.tooltip,tabIndex:0},s,i.label,i.content),t.addEventListener("click",(()=>{this._item_click(i)})),t.addEventListener("keydown",(e=>{e.keyCode==r.Keys.Enter&&this._item_click(i)}))}}this.el.appendChild(t)}}show(e){if(0!=this.items.length&&!this._open){if(this.render(),0==this.el.children.length)return;this._position(null!=e?e:{left:0,top:0}),(0,r.display)(this.el),this._listen(),this._open=!0}}hide(){this._open&&(this._open=!1,this._unlisten(),(0,r.undisplay)(this.el))}toggle(e){this._open?this.hide():this.show(e)}}i.ContextMenu=c,c.__name__="ContextMenu"},function(e,t,i,s,n){s();const o=e(1),r=e(224),a=(0,o.__importStar)(e(227)),l=e(43);class c extends r.ButtonToolButtonView{render(){super.render(),(0,l.classes)(this.el).toggle(a.active,this.model.active)}_clicked(){const{active:e}=this.model;this.model.active=!e}}i.OnOffButtonView=c,c.__name__="OnOffButtonView"},function(e,t,i,s,n){var o;s();const r=e(224),a=e(231);class l extends r.ButtonToolView{}i.InspectToolView=l,l.__name__="InspectToolView";class c extends r.ButtonTool{constructor(e){super(e),this.event_type="move"}}i.InspectTool=c,o=c,c.__name__="InspectTool",o.prototype.button_view=a.OnOffButtonView,o.define((({Boolean:e})=>({toggleable:[e,!0]}))),o.override({active:!0})},function(e,t,i,s,n){s();const o=e(1);var r,a;const l=e(19),c=e(43),h=e(113),_=e(226),u=e(20),d=e(9),p=e(234),m=e(13),g=e(8),f=e(235),b=e(65),y=e(53),v=e(222),x=e(223),w=e(238),A=e(239),k=e(232),S=e(230),T=(0,o.__importStar)(e(227)),C=T,M=(0,o.__importStar)(e(240)),z=M;class E extends y.Model{constructor(e){super(e)}get visible(){var e;return!this.autohide||null!==(e=this._visible)&&void 0!==e&&e}}i.ToolbarViewModel=E,r=E,E.__name__="ToolbarViewModel",r.define((({Boolean:e})=>({autohide:[e,!1]}))),r.internal((({Boolean:e,Nullable:t})=>({_visible:[t(e),null]})));class R extends _.DOMView{constructor(){super(...arguments),this.layout={bbox:new b.BBox}}initialize(){super.initialize(),this._tool_button_views=new Map,this._toolbar_view_model=new E({autohide:this.model.autohide});const{toolbar_location:e}=this.model,t="left"==e||"above"==e,i=this.model.horizontal?"vertical":"horizontal";this._overflow_menu=new S.ContextMenu([],{orientation:i,reversed:t})}async lazy_initialize(){await super.lazy_initialize(),await this._build_tool_button_views()}connect_signals(){super.connect_signals(),this.connect(this.model.properties.tools.change,(async()=>{await this._build_tool_button_views(),this.render()})),this.connect(this.model.properties.autohide.change,(()=>{this._toolbar_view_model.autohide=this.model.autohide,this._on_visible_change()})),this.connect(this._toolbar_view_model.properties._visible.change,(()=>this._on_visible_change()))}styles(){return[...super.styles(),T.default,M.default]}remove(){(0,h.remove_views)(this._tool_button_views),super.remove()}async _build_tool_button_views(){const e=null!=this.model._proxied_tools?this.model._proxied_tools:this.model.tools;await(0,h.build_views)(this._tool_button_views,e,{parent:this},(e=>e.button_view))}set_visibility(e){e!=this._toolbar_view_model._visible&&(this._toolbar_view_model._visible=e)}_on_visible_change(){const{visible:e}=this._toolbar_view_model;(0,c.classes)(this.el).toggle(C.toolbar_hidden,!e)}render(){(0,c.empty)(this.el),this.el.classList.add(C.toolbar),this.el.classList.add(C[this.model.toolbar_location]),this._toolbar_view_model.autohide=this.model.autohide,this._on_visible_change();const{horizontal:e}=this.model;let t=0;if(null!=this.model.logo){const i="grey"===this.model.logo?z.grey:null,s=(0,c.a)({href:"https://bokeh.org/",target:"_blank",class:[z.logo,z.logo_small,i]});this.el.appendChild(s);const{width:n,height:o}=s.getBoundingClientRect();t+=e?n:o}for(const[,c]of this._tool_button_views)c.render();const i=[],s=e=>this._tool_button_views.get(e).el,{gestures:n}=this.model;for(const c of(0,m.values)(n))i.push(c.tools.map(s));i.push(this.model.actions.map(s)),i.push(this.model.inspectors.filter((e=>e.toggleable)).map(s));const o=i.filter((e=>0!=e.length)),r=()=>(0,c.div)({class:C.divider}),{bbox:a}=this.layout;let l=!1;this.root.el.appendChild(this._overflow_menu.el);const h=(0,c.div)({class:C.tool_overflow,tabIndex:0},e?"\u22ee":"\u22ef"),_=()=>{const e=(()=>{switch(this.model.toolbar_location){case"right":return{left_of:h};case"left":return{right_of:h};case"above":return{below:h};case"below":return{above:h}}})();this._overflow_menu.toggle(e)};h.addEventListener("click",(()=>{_()})),h.addEventListener("keydown",(e=>{e.keyCode==c.Keys.Enter&&_()}));for(const c of(0,p.join)(o,r))if(l)this._overflow_menu.items.push({content:c,class:e?C.right:C.above});else{this.el.appendChild(c);const{width:i,height:s}=c.getBoundingClientRect();if(t+=e?i:s,l=e?t>a.width-15:t>a.height-15,l){this.el.removeChild(c),this.el.appendChild(h);const{items:e}=this._overflow_menu;e.splice(0,e.length),e.push({content:c})}}}update_layout(){}update_position(){}after_layout(){this._has_finished=!0}export(e,t=!0){const i="png"==e?"canvas":"svg",s=new f.CanvasLayer(i,t);return s.resize(0,0),s}}function B(){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},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}}}i.ToolbarBaseView=R,R.__name__="ToolbarBaseView";class N extends y.Model{constructor(e){super(e)}initialize(){super.initialize(),this._init_tools()}_init_tools(){const e=function(e,t){if(e.length!=t.length)return!0;const i=new Set(t.map((e=>e.id)));return(0,d.some)(e,(e=>!i.has(e.id)))},t=this.tools.filter((e=>e instanceof k.InspectTool));e(this.inspectors,t)&&(this.inspectors=t);const i=this.tools.filter((e=>e instanceof A.HelpTool));e(this.help,i)&&(this.help=i);const s=this.tools.filter((e=>e instanceof w.ActionTool));e(this.actions,s)&&(this.actions=s);const n=(e,t)=>{e in this.gestures||l.logger.warn(`Toolbar: unknown event type '${e}' for tool: ${t}`)},o={pan:{tools:[],active:null},scroll:{tools:[],active:null},pinch:{tools:[],active:null},tap:{tools:[],active:null},doubletap:{tools:[],active:null},press:{tools:[],active:null},pressup:{tools:[],active:null},rotate:{tools:[],active:null},move:{tools:[],active:null},multi:{tools:[],active:null}};for(const r of this.tools)if(r instanceof x.GestureTool&&r.event_type)if((0,g.isString)(r.event_type))o[r.event_type].tools.push(r),n(r.event_type,r);else{o.multi.tools.push(r);for(const e of r.event_type)n(e,r)}for(const r of Object.keys(o)){const t=this.gestures[r];e(t.tools,o[r].tools)&&(t.tools=o[r].tools),t.active&&(0,d.every)(t.tools,(e=>e.id!=t.active.id))&&(t.active=null)}}get horizontal(){return"above"===this.toolbar_location||"below"===this.toolbar_location}get vertical(){return"left"===this.toolbar_location||"right"===this.toolbar_location}_active_change(e){const{event_type:t}=e;if(null==t)return;const i=(0,g.isString)(t)?[t]:t;for(const s of i)if(e.active){const t=this.gestures[s].active;null!=t&&e!=t&&(l.logger.debug(`Toolbar: deactivating tool: ${t} for event type '${s}'`),t.active=!1),this.gestures[s].active=e,l.logger.debug(`Toolbar: activating tool: ${e} for event type '${s}'`)}else this.gestures[s].active=null}}i.ToolbarBase=N,a=N,N.__name__="ToolbarBase",a.prototype.default_view=R,a.define((({Boolean:e,Array:t,Ref:i,Nullable:s})=>({tools:[t(i(v.Tool)),[]],logo:[s(u.Logo),"normal"],autohide:[e,!1]}))),a.internal((({Array:e,Struct:t,Ref:i,Nullable:s})=>{const n=t({tools:e(i(x.GestureTool)),active:s(i(v.Tool))});return{gestures:[t({pan:n,scroll:n,pinch:n,tap:n,doubletap:n,press:n,pressup:n,rotate:n,move:n,multi:n}),B],actions:[e(i(w.ActionTool)),[]],inspectors:[e(i(k.InspectTool)),[]],help:[e(i(A.HelpTool)),[]],toolbar_location:[u.Location,"right"]}}))},function(e,t,i,s,n){s();const o=e(9);function*r(e,t){const i=e.length;if(t>i)return;const s=(0,o.range)(t);for(yield s.map((t=>e[t]));;){let n;for(const e of(0,o.reversed)((0,o.range)(t)))if(s[e]!=e+i-t){n=e;break}if(null==n)return;s[n]+=1;for(const e of(0,o.range)(n+1,t))s[e]=s[e-1]+1;yield s.map((t=>e[t]))}}i.enumerate=function*(e){let t=0;for(const i of e)yield[i,t++]},i.join=function*(e,t){let i=!0;for(const s of e)i?i=!1:null!=t&&(yield t()),yield*s},i.combinations=r,i.subsets=function*(e){for(const t of(0,o.range)(e.length+1))yield*r(e,t)}},function(e,t,i,s,n){s();const o=e(236),r=e(65),a=e(43);const l={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"};class c{constructor(e,t){switch(this.backend=e,this.hidpi=t,this.pixel_ratio=1,this.bbox=new r.BBox,e){case"webgl":case"canvas":{this._el=this._canvas=(0,a.canvas)({style:l});const e=this.canvas.getContext("2d");if(null==e)throw new Error("unable to obtain 2D rendering context");this._ctx=e,t&&(this.pixel_ratio=devicePixelRatio);break}case"svg":{const e=new o.SVGRenderingContext2D;this._ctx=e,this._canvas=e.get_svg(),this._el=(0,a.div)({style:l},this._canvas);break}}this._ctx.layer=this,function(e){!function(e){void 0===e.lineDash&&Object.defineProperty(e,"lineDash",{get:()=>e.getLineDash(),set:t=>e.setLineDash(t)})}(e),function(e){e.setImageSmoothingEnabled=t=>{e.imageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.oImageSmoothingEnabled=t,e.webkitImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t},e.getImageSmoothingEnabled=()=>{const t=e.imageSmoothingEnabled;return null==t||t}}(e),function(e){e.ellipse||(e.ellipse=function(t,i,s,n,o,r,a,l=!1){const c=.551784;e.translate(t,i),e.rotate(o);let h=s,_=n;l&&(h=-s,_=-n),e.moveTo(-h,0),e.bezierCurveTo(-h,_*c,-h*c,_,0,_),e.bezierCurveTo(h*c,_,h,_*c,h,0),e.bezierCurveTo(h,-_*c,h*c,-_,0,-_),e.bezierCurveTo(-h*c,-_,-h,-_*c,-h,0),e.rotate(-o),e.translate(-t,-i)})}(e)}(this._ctx)}get canvas(){return this._canvas}get ctx(){return this._ctx}get el(){return this._el}resize(e,t){this.bbox=new r.BBox({left:0,top:0,width:e,height:t});const i=this._ctx instanceof o.SVGRenderingContext2D?this._ctx:this.canvas;i.width=e*this.pixel_ratio,i.height=t*this.pixel_ratio}undo_transform(e){const{ctx:t}=this;if(void 0===t.getTransform)e(t);else{const i=t.getTransform();t.setTransform(this._base_transform);try{e(t)}finally{t.setTransform(i)}}}prepare(){const{ctx:e,hidpi:t,pixel_ratio:i}=this;e.save(),t&&(e.scale(i,i),e.translate(.5,.5)),void 0!==e.getTransform&&(this._base_transform=e.getTransform()),this.clear()}clear(){const{x:e,y:t,width:i,height:s}=this.bbox;this.ctx.clearRect(e,t,i,s)}finish(){this.ctx.restore()}to_blob(){const{_canvas:e}=this;if(e instanceof HTMLCanvasElement)return null!=e.msToBlob?Promise.resolve(e.msToBlob()):new Promise(((t,i)=>{e.toBlob((e=>null!=e?t(e):i()),"image/png")}));{const e=this._ctx.get_serialized_svg(!0),t=new Blob([e],{type:"image/svg+xml"});return Promise.resolve(t)}}}i.CanvasLayer=c,c.__name__="CanvasLayer"},function(e,t,i,s,n){s();const o=e(122),r=e(8),a=e(237),l=e(10),c=e(43);function h(e){var t;const i={left:"start",right:"end",center:"middle",start:"start",end:"end"};return null!==(t=i[e])&&void 0!==t?t:i.start}function _(e){var t;const i={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return null!==(t=i[e])&&void 0!==t?t:i.alphabetic}const u=function(e,t){const i=new Map,s="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".split(",");t=null!=t?t:10;for(let n=0;n<s.length;n+=2){const e=`&${s[n+1]};`,o=parseInt(s[n],t);i.set(e,`&#${o};`)}return i.set("\\xa0"," "),i}(0,32),d={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class p{constructor(e,t){this.__root=e,this.__ctx=t}addColorStop(e,t){if("linearGradient"===this.__root.nodeName&&this.__root.getAttribute("x1")===this.__root.getAttribute("x2")&&this.__root.getAttribute("y1")===this.__root.getAttribute("y2"))return;if("radialGradient"===this.__root.nodeName&&this.__root.getAttribute("cx")===this.__root.getAttribute("fx")&&this.__root.getAttribute("cy")===this.__root.getAttribute("fy")&&this.__root.getAttribute("r")===this.__root.getAttribute("r0"))return;const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",`${e}`),-1!==t.indexOf("rgba")){const e=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),[,s,n,o,r]=e;i.setAttribute("stop-color",`rgb(${s},${n},${o})`),i.setAttribute("stop-opacity",r)}else i.setAttribute("stop-color",t);this.__root.appendChild(i)}}p.__name__="CanvasGradient";class m{constructor(e,t){this.__root=e,this.__ctx=t}setTransform(e){throw new Error("not implemented")}}m.__name__="CanvasPattern";class g{constructor(e){var t,i,s;this.__currentPosition=null,this._transform=new o.AffineTransform,this._clip_path=null,this.__document=null!==(t=null==e?void 0:e.document)&&void 0!==t?t:document,(null==e?void 0:e.ctx)?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__stack=[],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.width=null!==(i=null==e?void 0:e.width)&&void 0!==i?i:500,this.height=null!==(s=null==e?void 0:e.height)&&void 0!==s?s:500,this.__ids=new Set,this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs)}get canvas(){return this}get width(){return this._width}set width(e){this._width=e,this.__root.setAttribute("width",`${e}`)}get height(){return this._height}set height(e){this._height=e,this.__root.setAttribute("height",`${e}`)}_random_string(){let e;do{e=g.__random.choices(12,"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz").join("")}while(this.__ids.has(e));return e}__createElement(e,t={},i=!1){const s=this.__document.createElementNS("http://www.w3.org/2000/svg",e);i&&(s.setAttribute("fill","none"),s.setAttribute("stroke","none"));const n=Object.keys(t);for(const o of n)s.setAttribute(o,`${t[o]}`);return s}__setDefaultStyles(){const e=Object.keys(d),t=this;for(let i=0;i<e.length;i++){const s=e[i];t[s]=d[s].canvas}}__applyStyleState(e){const t=Object.keys(e),i=this;for(let s=0;s<t.length;s++){const n=t[s];i[n]=e[n]}}__getStyleState(){const e=Object.keys(d),t={};for(let i=0;i<e.length;i++){const s=e[i];t[s]=this[s]}return t}__applyStyleToCurrentElement(e){var t;const i=this.__currentElement,s=Object.keys(d);for(let n=0;n<s.length;n++){const o=d[s[n]],a=this[s[n]];if(null===(t=o.apply)||void 0===t?void 0:t.includes(e))if(a instanceof m){for(const t of[...a.__ctx.__defs.childNodes])if(t instanceof Element){const e=t.getAttribute("id");this.__ids.add(e),this.__defs.appendChild(t)}const e=a.__root.getAttribute("id");i.setAttribute(o.apply,`url(#${e})`)}else if(a instanceof p){const e=a.__root.getAttribute("id");i.setAttribute(o.apply,`url(#${e})`)}else if(o.svg!==a)if("stroke"!==o.svgAttr&&"fill"!==o.svgAttr||!(0,r.isString)(a)||-1===a.indexOf("rgba")){let t=o.svgAttr;if("globalAlpha"===s[n]&&(t=`${e}-${o.svgAttr}`,i.getAttribute(t)))continue;i.setAttribute(t,`${a}`)}else{const e=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a),[,t,s,n,r]=e;i.setAttribute(o.svgAttr,`rgb(${t},${s},${n})`);let l=parseFloat(r);const c=this.globalAlpha;null!=c&&(l*=c),i.setAttribute(`${o.svgAttr}-opacity`,`${l}`)}}}get_serialized_svg(e=!1){let t=(new XMLSerializer).serializeToString(this.__root);if(e)for(const[i,s]of u){const e=new RegExp(i,"gi");e.test(t)&&(t=t.replace(e,s))}return t}get_svg(){return this.__root}save(){this.__stack.push({transform:this._transform,clip_path:this._clip_path,attributes:this.__getStyleState()}),this._transform=this._transform.clone()}restore(){if(0==this.__stack.length)return;const{transform:e,clip_path:t,attributes:i}=this.__stack.pop();this._transform=e,this._clip_path=t,this.__applyStyleState(i)}_apply_transform(e,t=this._transform){t.is_identity||e.setAttribute("transform",t.toString())}scale(e,t){isFinite(e)&&(null==t||isFinite(t))&&this._transform.scale(e,null!=t?t:e)}rotate(e){isFinite(e)&&this._transform.rotate(e)}translate(e,t){isFinite(e+t)&&this._transform.translate(e,t)}transform(e,t,i,s,n,o){isFinite(e+t+i+s+n+o)&&this._transform.transform(e,t,i,s,n,o)}beginPath(){this.__currentDefaultPath="",this.__currentPosition=null,this.__init_element()}__init_element(){const e=this.__createElement("path",{},!0);this.__root.appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){const e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e,t,i){const s=this.__currentDefaultPath?" ":"";this.__currentDefaultPath+=s+i,this.__currentPosition={x:e,y:t}}get _hasCurrentDefaultPath(){return!!this.__currentDefaultPath}moveTo(e,t){if(!isFinite(e+t))return;const i=this.__currentElement;i&&"path"===i.nodeName||this.beginPath();const[s,n]=this._transform.apply(e,t);this.__addPathCommand(s,n,`M ${s} ${n}`)}closePath(){this._hasCurrentDefaultPath&&this.__addPathCommand(NaN,NaN,"Z")}lineTo(e,t){if(isFinite(e+t))if(this._hasCurrentDefaultPath){const[i,s]=this._transform.apply(e,t);this.__addPathCommand(i,s,`L ${i} ${s}`)}else this.moveTo(e,t)}bezierCurveTo(e,t,i,s,n,o){if(!isFinite(e+t+i+s+n+o))return;const[r,a]=this._transform.apply(n,o),[l,c]=this._transform.apply(e,t),[h,_]=this._transform.apply(i,s);this.__addPathCommand(r,a,`C ${l} ${c} ${h} ${_} ${r} ${a}`)}quadraticCurveTo(e,t,i,s){if(!isFinite(e+t+i+s))return;const[n,o]=this._transform.apply(i,s),[r,a]=this._transform.apply(e,t);this.__addPathCommand(n,o,`Q ${r} ${a} ${n} ${o}`)}arcTo(e,t,i,s,n){if(!isFinite(e+t+i+s+n))return;if(null==this.__currentPosition)return;const o=this.__currentPosition.x,r=this.__currentPosition.y;if(n<0)throw new Error(`IndexSizeError: The radius provided (${n}) is negative.`);if(o===e&&r===t||e===i&&t===s||0===n)return void this.lineTo(e,t);function a([e,t]){const i=Math.sqrt(e**2+t**2);return[e/i,t/i]}const l=a([o-e,r-t]),c=a([i-e,s-t]);if(l[0]*c[1]==l[1]*c[0])return void this.lineTo(e,t);const h=l[0]*c[0]+l[1]*c[1],_=Math.acos(Math.abs(h)),u=a([l[0]+c[0],l[1]+c[1]]),d=n/Math.sin(_/2),p=e+d*u[0],m=t+d*u[1],g=[-l[1],l[0]],f=[c[1],-c[0]];function b(e){const t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)}const y=b(g),v=b(f);this.lineTo(p+g[0]*n,m+g[1]*n),this.arc(p,m,n,y,v)}stroke(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke"),null!=this._clip_path&&this.__currentElement.setAttribute("clip-path",this._clip_path)}fill(e,t){let i=null;if(e instanceof Path2D)i=e;else{if("evenodd"!=e&&"nonzero"!=e&&null!=e||null!=t)throw new Error("invalid arguments");t=e}if(null!=i)throw new Error("not implemented");"none"!=this.__currentElement.getAttribute("fill")&&this.__init_element(),"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill"),null!=t&&this.__currentElement.setAttribute("fill-rule",t),null!=this._clip_path&&this.__currentElement.setAttribute("clip-path",this._clip_path)}rect(e,t,i,s){isFinite(e+t+i+s)&&(this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.lineTo(e,t))}fillRect(e,t,i,s){isFinite(e+t+i+s)&&(this.beginPath(),this.rect(e,t,i,s),this.fill())}strokeRect(e,t,i,s){isFinite(e+t+i+s)&&(this.beginPath(),this.rect(e,t,i,s),this.stroke())}__clearCanvas(){(0,c.empty)(this.__defs),(0,c.empty)(this.__root),this.__root.appendChild(this.__defs),this.__currentElement=this.__root}clearRect(e,t,i,s){if(!isFinite(e+t+i+s))return;if(0===e&&0===t&&i===this.width&&s===this.height)return void this.__clearCanvas();const n=this.__createElement("rect",{x:e,y:t,width:i,height:s,fill:"#FFFFFF"},!0);this._apply_transform(n),this.__root.appendChild(n)}createLinearGradient(e,t,i,s){if(!isFinite(e+t+i+s))throw new Error("The provided double value is non-finite");const[n,o]=this._transform.apply(e,t),[r,a]=this._transform.apply(i,s),l=this.__createElement("linearGradient",{id:this._random_string(),x1:`${n}px`,x2:`${r}px`,y1:`${o}px`,y2:`${a}px`,gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(l),new p(l,this)}createRadialGradient(e,t,i,s,n,o){if(!isFinite(e+t+i+s+n+o))throw new Error("The provided double value is non-finite");const[r,a]=this._transform.apply(e,t),[l,c]=this._transform.apply(s,n),h=this.__createElement("radialGradient",{id:this._random_string(),cx:`${l}px`,cy:`${c}px`,r:`${o}px`,r0:`${i}px`,fx:`${r}px`,fy:`${a}px`,gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(h),new p(h,this)}__parseFont(){var e,t,i,s,n;const o=/^\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);return{style:null!==(e=o[1])&&void 0!==e?e:"normal",size:null!==(t=o[4])&&void 0!==t?t:"10px",family:null!==(i=o[6])&&void 0!==i?i:"sans-serif",weight:null!==(s=o[3])&&void 0!==s?s:"normal",decoration:null!==(n=o[2])&&void 0!==n?n:"normal"}}__applyText(e,t,i,s){const n=this.__parseFont(),o=this.__createElement("text",{"font-family":n.family,"font-size":n.size,"font-style":n.style,"font-weight":n.weight,"text-decoration":n.decoration,x:t,y:i,"text-anchor":h(this.textAlign),"dominant-baseline":_(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(e)),this._apply_transform(o),this.__currentElement=o,this.__applyStyleToCurrentElement(s);const r=(()=>{if(null!=this._clip_path){const e=this.__createElement("g");return e.setAttribute("clip-path",this._clip_path),e.appendChild(o),e}return o})();this.__root.appendChild(r)}fillText(e,t,i){null!=e&&isFinite(t+i)&&this.__applyText(e,t,i,"fill")}strokeText(e,t,i){null!=e&&isFinite(t+i)&&this.__applyText(e,t,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,t,i,s,n,o=!1){this.ellipse(e,t,i,i,0,s,n,o)}ellipse(e,t,i,s,n,o,r,a=!1){if(!isFinite(e+t+i+s+n+o+r))return;if(i<0||s<0)throw new DOMException("IndexSizeError, radius can't be negative");const c=a?r-o:o-r;o%=2*Math.PI,r%=2*Math.PI;const h=e+i*Math.cos(o),_=t+s*Math.sin(o);this.lineTo(h,_);const u=180*n/Math.PI,d=a?0:1;if(Math.abs(o-r)<2*l.float32_epsilon&&!(Math.abs(c)<2*l.float32_epsilon&&c<0)){const n=e+i*Math.cos(o+Math.PI),r=t+s*Math.sin(o+Math.PI),[a,l]=this._transform.apply(h,_),[c,p]=this._transform.apply(n,r);this.__addPathCommand(a,l,`A ${i} ${s} ${u} 0 ${d} ${c} ${p} A ${i} ${s} ${u} 0 ${d} ${a} ${l}`)}else{const n=e+i*Math.cos(r),l=t+s*Math.sin(r);let c=r-o;c<0&&(c+=2*Math.PI);const h=a!==c>Math.PI?1:0,[_,p]=this._transform.apply(n,l);this.__addPathCommand(_,p,`A ${i} ${s} ${u} ${h} ${d} ${_} ${p}`)}}clip(){const e=this.__createElement("clipPath"),t=this._random_string();this.__applyCurrentDefaultPath(),e.setAttribute("id",t),e.appendChild(this.__currentElement),this.__defs.appendChild(e),this._clip_path=`url(#${t})`}drawImage(e,...t){let i,s,n,o,r,a,l,c;if(2==t.length){if([i,s]=t,!isFinite(i+s))return;r=0,a=0,l=e.width,c=e.height,n=l,o=c}else if(4==t.length){if([i,s,n,o]=t,!isFinite(i+s+n+o))return;r=0,a=0,l=e.width,c=e.height}else{if(8!==t.length)throw new Error(`Inavlid number of arguments passed to drawImage: ${arguments.length}`);if([r,a,l,c,i,s,n,o]=t,!isFinite(r+a+l+c+i+s+n+o))return}const h=this.__root,_=this._transform.clone().translate(i,s);if(e instanceof g||e instanceof SVGSVGElement){const t=(e instanceof SVGSVGElement?e:e.get_svg()).cloneNode(!0);let i;_.is_identity&&1==this.globalAlpha&&null==this._clip_path?i=h:(i=this.__createElement("g"),_.is_identity||this._apply_transform(i,_),1!=this.globalAlpha&&i.setAttribute("opacity",`${this.globalAlpha}`),null!=this._clip_path&&i.setAttribute("clip-path",this._clip_path),h.appendChild(i));for(const e of[...t.childNodes])if(e instanceof SVGDefsElement){for(const t of[...e.childNodes])if(t instanceof Element){const e=t.getAttribute("id");this.__ids.add(e),this.__defs.appendChild(t.cloneNode(!0))}}else i.appendChild(e.cloneNode(!0))}else if(e instanceof HTMLImageElement||e instanceof SVGImageElement){const t=this.__createElement("image");if(t.setAttribute("width",`${n}`),t.setAttribute("height",`${o}`),t.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&t.setAttribute("opacity",`${this.globalAlpha}`),r||a||l!==e.width||c!==e.height){const t=this.__document.createElement("canvas");t.width=n,t.height=o,t.getContext("2d").drawImage(e,r,a,l,c,0,0,n,o),e=t}this._apply_transform(t,_);const i=e instanceof HTMLCanvasElement?e.toDataURL():e.getAttribute("src");if(t.setAttribute("href",i),null!=this._clip_path){const e=this.__createElement("g");e.setAttribute("clip-path",this._clip_path),e.appendChild(t),h.appendChild(e)}else h.appendChild(t)}else if(e instanceof HTMLCanvasElement){const t=this.__createElement("image");t.setAttribute("width",`${n}`),t.setAttribute("height",`${o}`),t.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&t.setAttribute("opacity",`${this.globalAlpha}`);const i=this.__document.createElement("canvas");i.width=n,i.height=o;const s=i.getContext("2d");if(s.imageSmoothingEnabled=!1,s.drawImage(e,r,a,l,c,0,0,n,o),e=i,this._apply_transform(t,_),t.setAttribute("href",e.toDataURL()),null!=this._clip_path){const e=this.__createElement("g");e.setAttribute("clip-path",this._clip_path),e.appendChild(t),h.appendChild(e)}else h.appendChild(t)}}createPattern(e,t){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),s=this._random_string();if(i.setAttribute("id",s),i.setAttribute("width",`${this._to_number(e.width)}`),i.setAttribute("height",`${this._to_number(e.height)}`),i.setAttribute("patternUnits","userSpaceOnUse"),e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof SVGImageElement){const t=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s=e instanceof HTMLCanvasElement?e.toDataURL():e.getAttribute("src");t.setAttribute("href",s),i.appendChild(t),this.__defs.appendChild(i)}else if(e instanceof g){for(const t of[...e.__root.childNodes])t instanceof SVGDefsElement||i.appendChild(t.cloneNode(!0));this.__defs.appendChild(i)}else{if(!(e instanceof SVGSVGElement))throw new Error("unsupported");for(const t of[...e.childNodes])t instanceof SVGDefsElement||i.appendChild(t.cloneNode(!0));this.__defs.appendChild(i)}return new m(i,this)}getLineDash(){const{lineDash:e}=this;return(0,r.isString)(e)?e.split(",").map((e=>parseInt(e))):null==e?[]:e}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}_to_number(e){return(0,r.isNumber)(e)?e:e.baseVal.value}getTransform(){return this._transform.to_DOMMatrix()}setTransform(...e){let t;t=(0,r.isNumber)(e[0])?new DOMMatrix(e):e[0]instanceof DOMMatrix?e[0]:new DOMMatrix(Object.values(!e[0])),this._transform=o.AffineTransform.from_DOMMatrix(t)}resetTransform(){this._transform=new o.AffineTransform}isPointInPath(...e){throw new Error("not implemented")}isPointInStroke(...e){throw new Error("not implemented")}createImageData(...e){throw new Error("not implemented")}getImageData(e,t,i,s){throw new Error("not implemented")}putImageData(...e){throw new Error("not implemented")}drawFocusIfNeeded(...e){throw new Error("not implemented")}scrollPathIntoView(...e){throw new Error("not implemented")}}i.SVGRenderingContext2D=g,g.__name__="SVGRenderingContext2D",g.__random=a.random},function(e,t,i,s,n){s();const o=2147483647;class r{constructor(e){this.seed=e%o,this.seed<=0&&(this.seed+=2147483646)}integer(){return this.seed=48271*this.seed%o,this.seed}float(){return(this.integer()-1)/2147483646}floats(e,t=0,i=1){const s=new Array(e);for(let n=0;n<e;n++)s[n]=t+this.float()*(i-t);return s}choices(e,t){const i=t.length,s=new Array(e);for(let n=0;n<e;n++)s[n]=t[this.integer()%i];return s}}i.Random=r,r.__name__="Random",i.random=new r(Date.now())},function(e,t,i,s,n){s();const o=e(224),r=e(15);class a extends o.ButtonToolButtonView{_clicked(){this.model.do.emit(void 0)}}i.ActionToolButtonView=a,a.__name__="ActionToolButtonView";class l extends o.ButtonToolView{connect_signals(){super.connect_signals(),this.connect(this.model.do,(e=>this.doit(e)))}}i.ActionToolView=l,l.__name__="ActionToolView";class c extends o.ButtonTool{constructor(e){super(e),this.button_view=a,this.do=new r.Signal(this,"do")}}i.ActionTool=c,c.__name__="ActionTool"},function(e,t,i,s,n){var o;s();const r=e(238),a=e(228);class l extends r.ActionToolView{doit(){window.open(this.model.redirect)}}i.HelpToolView=l,l.__name__="HelpToolView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Help",this.icon=a.tool_icon_help}}i.HelpTool=c,o=c,c.__name__="HelpTool",o.prototype.default_view=l,o.define((({String:e})=>({redirect:[e,"https://docs.bokeh.org/en/latest/docs/user_guide/tools.html"]}))),o.override({description:"Click the question mark to learn more about Bokeh plot tools."}),o.register_alias("help",(()=>new c))},function(e,t,i,s,n){s(),i.root="bk-root",i.logo="bk-logo",i.grey="bk-grey",i.logo_small="bk-logo-small",i.logo_notebook="bk-logo-notebook",i.default=".bk-root .bk-logo{margin:5px;position:relative;display:block;background-repeat:no-repeat;}.bk-root .bk-logo.bk-grey{filter:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale\");filter:gray;-webkit-filter:grayscale(100%);}.bk-root .bk-logo-small{width:20px;height:20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAOkSURBVDiNjZRtaJVlGMd/1/08zzln5zjP1LWcU9N0NkN8m2CYjpgQYQXqSs0I84OLIC0hkEKoPtiH3gmKoiJDU7QpLgoLjLIQCpEsNJ1vqUOdO7ppbuec5+V+rj4ctwzd8IIbbi6u+8f1539dt3A78eXC7QizUF7gyV1fD1Yqg4JWz84yffhm0qkFqBogB9rM8tZdtwVsPUhWhGcFJngGeWrPzHm5oaMmkfEg1usvLFyc8jLRqDOMru7AyC8saQr7GG7f5fvDeH7Ej8CM66nIF+8yngt6HWaKh7k49Soy9nXurCi1o3qUbS3zWfrYeQDTB/Qj6kX6Ybhw4B+bOYoLKCC9H3Nu/leUTZ1JdRWkkn2ldcCamzrcf47KKXdAJllSlxAOkRgyHsGC/zRday5Qld9DyoM4/q/rUoy/CXh3jzOu3bHUVZeU+DEn8FInkPBFlu3+nW3Nw0mk6vCDiWg8CeJaxEwuHS3+z5RgY+YBR6V1Z1nxSOfoaPa4LASWxxdNp+VWTk7+4vzaou8v8PN+xo+KY2xsw6une2frhw05CTYOmQvsEhjhWjn0bmXPjpE1+kplmmkP3suftwTubK9Vq22qKmrBhpY4jvd5afdRA3wGjFAgcnTK2s4hY0/GPNIb0nErGMCRxWOOX64Z8RAC4oCXdklmEvcL8o0BfkNK4lUg9HTl+oPlQxdNo3Mg4Nv175e/1LDGzZen30MEjRUtmXSfiTVu1kK8W4txyV6BMKlbgk3lMwYCiusNy9fVfvvwMxv8Ynl6vxoByANLTWplvuj/nF9m2+PDtt1eiHPBr1oIfhCChQMBw6Aw0UulqTKZdfVvfG7VcfIqLG9bcldL/+pdWTLxLUy8Qq38heUIjh4XlzZxzQm19lLFlr8vdQ97rjZVOLf8nclzckbcD4wxXMidpX30sFd37Fv/GtwwhzhxGVAprjbg0gCAEeIgwCZyTV2Z1REEW8O4py0wsjeloKoMr6iCY6dP92H6Vw/oTyICIthibxjm/DfN9lVz8IqtqKYLUXfoKVMVQVVJOElGjrnnUt9T9wbgp8AyYKaGlqingHZU/uG2NTZSVqwHQTWkx9hxjkpWDaCg6Ckj5qebgBVbT3V3NNXMSiWSDdGV3hrtzla7J+duwPOToIg42ChPQOQjspnSlp1V+Gjdged7+8UN5CRAV7a5EdFNwCjEaBR27b3W890TE7g24NAP/mMDXRWrGoFPQI9ls/MWO2dWFAar/xcOIImbbpA3zgAAAABJRU5ErkJggg==);}.bk-root .bk-logo-notebook{display:inline-block;vertical-align:middle;margin-right:5px;}"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(40),l=e(20),c=e(43),h=(0,o.__importStar)(e(242)),_=h;class u extends a.AnnotationView{initialize(){super.initialize(),this.el=(0,c.div)({class:_.tooltip}),(0,c.undisplay)(this.el),this.plot_view.canvas_view.add_overlay(this.el)}remove(){(0,c.remove)(this.el),super.remove()}connect_signals(){super.connect_signals(),this.connect(this.model.properties.content.change,(()=>this.render())),this.connect(this.model.properties.position.change,(()=>this._reposition()))}styles(){return[...super.styles(),h.default]}render(){this.model.visible||(0,c.undisplay)(this.el),super.render()}_render(){const{content:e}=this.model;null!=e?((0,c.empty)(this.el),(0,c.classes)(this.el).toggle("bk-tooltip-custom",this.model.custom),this.el.appendChild(e),this.model.show_arrow&&this.el.classList.add(_.tooltip_arrow)):(0,c.undisplay)(this.el)}_reposition(){const{position:e}=this.model;if(null==e)return void(0,c.undisplay)(this.el);const[t,i]=e,s=(()=>{const e=this.parent.layout.bbox.relative(),{attachment:s}=this.model;switch(s){case"horizontal":return t<e.hcenter?"right":"left";case"vertical":return i<e.vcenter?"below":"above";default:return s}})();let n;this.el.classList.remove(_.right),this.el.classList.remove(_.left),this.el.classList.remove(_.above),this.el.classList.remove(_.below),(0,c.display)(this.el);let o=null,r=null;switch(s){case"right":this.el.classList.add(_.left),o=t+(this.el.offsetWidth-this.el.clientWidth)+10,n=i-this.el.offsetHeight/2;break;case"left":this.el.classList.add(_.right),r=this.plot_view.layout.bbox.width-t+10,n=i-this.el.offsetHeight/2;break;case"below":this.el.classList.add(_.above),n=i+(this.el.offsetHeight-this.el.clientHeight)+10,o=Math.round(t-this.el.offsetWidth/2);break;case"above":this.el.classList.add(_.below),n=i-this.el.offsetHeight-10,o=Math.round(t-this.el.offsetWidth/2)}this.el.style.top=`${n}px`,this.el.style.left=null!=o?`${o}px`:"auto",this.el.style.right=null!=r?`${r}px`:"auto"}}i.TooltipView=u,u.__name__="TooltipView";class d extends a.Annotation{constructor(e){super(e)}clear(){this.position=null}}i.Tooltip=d,r=d,d.__name__="Tooltip",r.prototype.default_view=u,r.define((({Boolean:e})=>({attachment:[l.TooltipAttachment,"horizontal"],inner_only:[e,!0],show_arrow:[e,!0]}))),r.internal((({Boolean:e,Number:t,Tuple:i,Ref:s,Nullable:n})=>({position:[n(i(t,t)),null],content:[s(HTMLElement),()=>(0,c.div)()],custom:[e]}))),r.override({level:"overlay"})},function(e,t,i,s,n){s(),i.root="bk-root",i.tooltip="bk-tooltip",i.left="bk-left",i.tooltip_arrow="bk-tooltip-arrow",i.right="bk-right",i.above="bk-above",i.below="bk-below",i.tooltip_row_label="bk-tooltip-row-label",i.tooltip_row_value="bk-tooltip-row-value",i.tooltip_color_block="bk-tooltip-color-block",i.default='.bk-root{}.bk-root .bk-tooltip{font-weight:300;font-size:12px;position:absolute;padding:5px;border:1px solid #e5e5e5;color:#2f2f2f;background-color:white;pointer-events:none;opacity:0.95;z-index:100;}.bk-root .bk-tooltip > div:not(:first-child){margin-top:5px;border-top:#e5e5e5 1px dashed;}.bk-root .bk-tooltip.bk-left.bk-tooltip-arrow::before{position:absolute;margin:-7px 0 0 0;top:50%;width:0;height:0;border-style:solid;border-width:7px 0 7px 0;border-color:transparent;content:" ";display:block;left:-10px;border-right-width:10px;border-right-color:#909599;}.bk-root .bk-tooltip.bk-left::before{left:-10px;border-right-width:10px;border-right-color:#909599;}.bk-root .bk-tooltip.bk-right.bk-tooltip-arrow::after{position:absolute;margin:-7px 0 0 0;top:50%;width:0;height:0;border-style:solid;border-width:7px 0 7px 0;border-color:transparent;content:" ";display:block;right:-10px;border-left-width:10px;border-left-color:#909599;}.bk-root .bk-tooltip.bk-right::after{right:-10px;border-left-width:10px;border-left-color:#909599;}.bk-root .bk-tooltip.bk-above::before{position:absolute;margin:0 0 0 -7px;left:50%;width:0;height:0;border-style:solid;border-width:0 7px 0 7px;border-color:transparent;content:" ";display:block;top:-10px;border-bottom-width:10px;border-bottom-color:#909599;}.bk-root .bk-tooltip.bk-below::after{position:absolute;margin:0 0 0 -7px;left:50%;width:0;height:0;border-style:solid;border-width:0 7px 0 7px;border-color:transparent;content:" ";display:block;bottom:-10px;border-top-width:10px;border-top-color:#909599;}.bk-root .bk-tooltip-row-label{text-align:right;color:#26aae1;}.bk-root .bk-tooltip-row-value{color:default;}.bk-root .bk-tooltip-color-block{width:12px;height:12px;margin-left:5px;margin-right:5px;outline:#dddddd solid 1px;display:inline-block;}'},function(e,t,i,s,n){var o;s();const r=e(115),a=e(112),l=e(113),c=e(48);class h extends r.UpperLowerView{async lazy_initialize(){await super.lazy_initialize();const{lower_head:e,upper_head:t}=this.model;null!=e&&(this.lower_head=await(0,l.build_view)(e,{parent:this})),null!=t&&(this.upper_head=await(0,l.build_view)(t,{parent:this}))}set_data(e){var t,i;super.set_data(e),null===(t=this.lower_head)||void 0===t||t.set_data(e),null===(i=this.upper_head)||void 0===i||i.set_data(e)}paint(e){if(this.visuals.line.doit)for(let i=0,s=this._lower_sx.length;i<s;i++)this.visuals.line.set_vectorize(e,i),e.beginPath(),e.moveTo(this._lower_sx[i],this._lower_sy[i]),e.lineTo(this._upper_sx[i],this._upper_sy[i]),e.stroke();const t="height"==this.model.dimension?0:Math.PI/2;if(null!=this.lower_head)for(let i=0,s=this._lower_sx.length;i<s;i++)e.save(),e.translate(this._lower_sx[i],this._lower_sy[i]),e.rotate(t+Math.PI),this.lower_head.render(e,i),e.restore();if(null!=this.upper_head)for(let i=0,s=this._upper_sx.length;i<s;i++)e.save(),e.translate(this._upper_sx[i],this._upper_sy[i]),e.rotate(t),this.upper_head.render(e,i),e.restore()}}i.WhiskerView=h,h.__name__="WhiskerView";class _ extends r.UpperLower{constructor(e){super(e)}}i.Whisker=_,o=_,_.__name__="Whisker",o.prototype.default_view=h,o.mixins(c.LineVector),o.define((({Ref:e,Nullable:t})=>({lower_head:[t(e(a.ArrowHead)),()=>new a.TeeHead({size:10})],upper_head:[t(e(a.ArrowHead)),()=>new a.TeeHead({size:10})]}))),o.override({level:"underlay"})},function(e,t,i,s,n){s(),n("CustomJS",e(245).CustomJS),n("OpenURL",e(247).OpenURL)},function(e,t,i,s,n){var o;s();const r=e(246),a=e(13),l=e(34);class c extends r.Callback{constructor(e){super(e)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}get func(){const e=(0,l.use_strict)(this.code);return new Function(...this.names,"cb_obj","cb_data",e)}execute(e,t={}){return this.func.apply(e,this.values.concat(e,t))}}i.CustomJS=c,o=c,c.__name__="CustomJS",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{constructor(e){super(e)}}i.Callback=r,r.__name__="Callback"},function(e,t,i,s,n){var o;s();const r=e(246),a=e(152),l=e(8);class c extends r.Callback{constructor(e){super(e)}navigate(e){this.same_tab?window.location.href=e:window.open(e)}execute(e,{source:t}){const i=e=>{const i=(0,a.replace_placeholders)(this.url,t,e,void 0,void 0,encodeURI);if(!(0,l.isString)(i))throw new Error("HTML output is not supported in this context");this.navigate(i)},{selected:s}=t;for(const n of s.indices)i(n);for(const n of s.line_indices)i(n)}}i.OpenURL=c,o=c,c.__name__="OpenURL",o.define((({Boolean:e,String:t})=>({url:[t,"http://"],same_tab:[e,!1]})))},function(e,t,i,s,n){s(),n("Canvas",e(249).Canvas),n("CartesianFrame",e(126).CartesianFrame),n("CoordinateMapping",e(54).CoordinateMapping)},function(e,t,i,s,n){var o,r=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return a(t,e),t};s();const c=e(14),h=e(28),_=e(226),u=e(19),d=e(43),p=e(20),m=e(13),g=e(250),f=e(65),b=e(138),y=e(235),v=(()=>{let t;return async()=>void 0!==t?t:t=await async function(){const t=document.createElement("canvas"),i=t.getContext("webgl",{premultipliedAlpha:!0});if(null!=i){const s=await(0,b.load_module)(Promise.resolve().then((()=>l(e(410)))));if(null!=s){const e=s.get_regl(i);if(e.has_webgl)return{canvas:t,regl_wrapper:e};u.logger.trace("WebGL is supported, but not the required extensions")}else u.logger.trace("WebGL is supported, but bokehjs(.min).js bundle is not available")}else u.logger.trace("WebGL is not supported");return null}()})(),x={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"};class w extends _.DOMView{constructor(){super(...arguments),this.bbox=new f.BBox,this.webgl=null}initialize(){super.initialize(),this.underlays_el=(0,d.div)({style:x}),this.primary=this.create_layer(),this.overlays=this.create_layer(),this.overlays_el=(0,d.div)({style:x}),this.events_el=(0,d.div)({class:"bk-canvas-events",style:x});const e=[this.underlays_el,this.primary.el,this.overlays.el,this.overlays_el,this.events_el];(0,m.extend)(this.el.style,x),(0,d.append)(this.el,...e),this.ui_event_bus=new g.UIEventBus(this)}async lazy_initialize(){if(await super.lazy_initialize(),"webgl"==this.model.output_backend&&(this.webgl=await v(),h.settings.force_webgl&&null==this.webgl))throw new Error("webgl is not available")}remove(){this.ui_event_bus.destroy(),super.remove()}add_underlay(e){this.underlays_el.appendChild(e)}add_overlay(e){this.overlays_el.appendChild(e)}add_event(e){this.events_el.appendChild(e)}get pixel_ratio(){return this.primary.pixel_ratio}resize(e,t){this.bbox=new f.BBox({left:0,top:0,width:e,height:t}),this.primary.resize(e,t),this.overlays.resize(e,t)}prepare_webgl(e){const{webgl:t}=this;if(null!=t){const{width:i,height:s}=this.bbox;t.canvas.width=this.pixel_ratio*i,t.canvas.height=this.pixel_ratio*s;const[n,o,r,a]=e,{xview:l,yview:c}=this.bbox,h=l.compute(n),_=c.compute(o+a),u=this.pixel_ratio;t.regl_wrapper.set_scissor(u*h,u*_,u*r,u*a),this._clear_webgl()}}blit_webgl(e){const{webgl:t}=this;if(null!=t){if(u.logger.debug("Blitting WebGL canvas"),e.restore(),e.drawImage(t.canvas,0,0),e.save(),this.model.hidpi){const t=this.pixel_ratio;e.scale(t,t),e.translate(.5,.5)}this._clear_webgl()}}_clear_webgl(){const{webgl:e}=this;if(null!=e){const{regl_wrapper:t,canvas:i}=e;t.clear(i.width,i.height)}}compose(){const e=this.create_layer(),{width:t,height:i}=this.bbox;return e.resize(t,i),e.ctx.drawImage(this.primary.canvas,0,0),e.ctx.drawImage(this.overlays.canvas,0,0),e}create_layer(){const{output_backend:e,hidpi:t}=this.model;return new y.CanvasLayer(e,t)}to_blob(){return this.compose().to_blob()}}i.CanvasView=w,w.__name__="CanvasView";class A extends c.HasProps{constructor(e){super(e)}}i.Canvas=A,o=A,A.__name__="Canvas",o.prototype.default_view=w,o.internal((({Boolean:e})=>({hidpi:[e,!0],output_backend:[p.OutputBackend,"canvas"]})))},function(e,t,i,s,n){s();const o=e(1),r=(0,o.__importDefault)(e(225)),a=e(15),l=e(19),c=e(43),h=(0,o.__importStar)(e(251)),_=e(252),u=e(9),d=e(8),p=e(27),m=e(230);class g{constructor(e){this.canvas_view=e,this.pan_start=new a.Signal(this,"pan:start"),this.pan=new a.Signal(this,"pan"),this.pan_end=new a.Signal(this,"pan:end"),this.pinch_start=new a.Signal(this,"pinch:start"),this.pinch=new a.Signal(this,"pinch"),this.pinch_end=new a.Signal(this,"pinch:end"),this.rotate_start=new a.Signal(this,"rotate:start"),this.rotate=new a.Signal(this,"rotate"),this.rotate_end=new a.Signal(this,"rotate:end"),this.tap=new a.Signal(this,"tap"),this.doubletap=new a.Signal(this,"doubletap"),this.press=new a.Signal(this,"press"),this.pressup=new a.Signal(this,"pressup"),this.move_enter=new a.Signal(this,"move:enter"),this.move=new a.Signal(this,"move"),this.move_exit=new a.Signal(this,"move:exit"),this.scroll=new a.Signal(this,"scroll"),this.keydown=new a.Signal(this,"keydown"),this.keyup=new a.Signal(this,"keyup"),this.hammer=new r.default(this.hit_area,{touchAction:"auto",inputClass:r.default.TouchMouseInput}),this._prev_move=null,this._curr_pan=null,this._curr_pinch=null,this._curr_rotate=null,this._configure_hammerjs(),this.hit_area.addEventListener("mousemove",(e=>this._mouse_move(e))),this.hit_area.addEventListener("mouseenter",(e=>this._mouse_enter(e))),this.hit_area.addEventListener("mouseleave",(e=>this._mouse_exit(e))),this.hit_area.addEventListener("contextmenu",(e=>this._context_menu(e))),this.hit_area.addEventListener("wheel",(e=>this._mouse_wheel(e))),document.addEventListener("keydown",this),document.addEventListener("keyup",this),this.menu=new m.ContextMenu([],{prevent_hide:e=>2==e.button&&e.target==this.hit_area}),this.hit_area.appendChild(this.menu.el)}get hit_area(){return this.canvas_view.events_el}destroy(){this.menu.remove(),this.hammer.destroy(),document.removeEventListener("keydown",this),document.removeEventListener("keyup",this)}handleEvent(e){"keydown"==e.type?this._key_down(e):"keyup"==e.type&&this._key_up(e)}_configure_hammerjs(){this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",(e=>this._doubletap(e))),this.hammer.on("tap",(e=>this._tap(e))),this.hammer.on("press",(e=>this._press(e))),this.hammer.on("pressup",(e=>this._pressup(e))),this.hammer.get("pan").set({direction:r.default.DIRECTION_ALL}),this.hammer.on("panstart",(e=>this._pan_start(e))),this.hammer.on("pan",(e=>this._pan(e))),this.hammer.on("panend",(e=>this._pan_end(e))),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",(e=>this._pinch_start(e))),this.hammer.on("pinch",(e=>this._pinch(e))),this.hammer.on("pinchend",(e=>this._pinch_end(e))),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",(e=>this._rotate_start(e))),this.hammer.on("rotate",(e=>this._rotate(e))),this.hammer.on("rotateend",(e=>this._rotate_end(e)))}register_tool(e){const t=e.model.event_type;null!=t&&((0,d.isString)(t)?this._register_tool(e,t):t.forEach(((t,i)=>this._register_tool(e,t,i<1))))}_register_tool(e,t,i=!0){const s=e,{id:n}=s.model,o=e=>t=>{t.id==n&&e(t.e)},r=e=>t=>{e(t.e)};switch(t){case"pan":null!=s._pan_start&&s.connect(this.pan_start,o(s._pan_start.bind(s))),null!=s._pan&&s.connect(this.pan,o(s._pan.bind(s))),null!=s._pan_end&&s.connect(this.pan_end,o(s._pan_end.bind(s)));break;case"pinch":null!=s._pinch_start&&s.connect(this.pinch_start,o(s._pinch_start.bind(s))),null!=s._pinch&&s.connect(this.pinch,o(s._pinch.bind(s))),null!=s._pinch_end&&s.connect(this.pinch_end,o(s._pinch_end.bind(s)));break;case"rotate":null!=s._rotate_start&&s.connect(this.rotate_start,o(s._rotate_start.bind(s))),null!=s._rotate&&s.connect(this.rotate,o(s._rotate.bind(s))),null!=s._rotate_end&&s.connect(this.rotate_end,o(s._rotate_end.bind(s)));break;case"move":null!=s._move_enter&&s.connect(this.move_enter,o(s._move_enter.bind(s))),null!=s._move&&s.connect(this.move,o(s._move.bind(s))),null!=s._move_exit&&s.connect(this.move_exit,o(s._move_exit.bind(s)));break;case"tap":null!=s._tap&&s.connect(this.tap,o(s._tap.bind(s))),null!=s._doubletap&&s.connect(this.doubletap,o(s._doubletap.bind(s)));break;case"press":null!=s._press&&s.connect(this.press,o(s._press.bind(s))),null!=s._pressup&&s.connect(this.pressup,o(s._pressup.bind(s)));break;case"scroll":null!=s._scroll&&s.connect(this.scroll,o(s._scroll.bind(s)));break;default:throw new Error(`unsupported event_type: ${t}`)}i&&(null!=s._keydown&&s.connect(this.keydown,r(s._keydown.bind(s))),null!=s._keyup&&s.connect(this.keyup,r(s._keyup.bind(s))),p.is_mobile&&null!=s._scroll&&"pinch"==t&&(l.logger.debug("Registering scroll on touch screen"),s.connect(this.scroll,o(s._scroll.bind(s)))))}_hit_test_renderers(e,t,i){var s;const n=e.get_renderer_views();for(const o of(0,u.reversed)(n))if(null===(s=o.interactive_hit)||void 0===s?void 0:s.call(o,t,i))return o;return null}set_cursor(e="default"){this.hit_area.style.cursor=e}_hit_test_frame(e,t,i){return e.frame.bbox.contains(t,i)}_hit_test_canvas(e,t,i){return e.layout.bbox.contains(t,i)}_hit_test_plot(e,t){for(const i of this.canvas_view.plot_views)if(i.layout.bbox.relative().contains(e,t))return i;return null}_trigger(e,t,i){var s;const{sx:n,sy:o}=t,r=this._hit_test_plot(n,o),a=e=>{const[i,s]=[n,o];return Object.assign(Object.assign({},t),{sx:i,sy:s})};if("panstart"==t.type||"pan"==t.type||"panend"==t.type){let s;if("panstart"==t.type&&null!=r?(this._curr_pan={plot_view:r},s=r):"pan"==t.type&&null!=this._curr_pan?s=this._curr_pan.plot_view:"panend"==t.type&&null!=this._curr_pan?(s=this._curr_pan.plot_view,this._curr_pan=null):s=null,null!=s){const t=a();this.__trigger(s,e,t,i)}}else if("pinchstart"==t.type||"pinch"==t.type||"pinchend"==t.type){let s;if("pinchstart"==t.type&&null!=r?(this._curr_pinch={plot_view:r},s=r):"pinch"==t.type&&null!=this._curr_pinch?s=this._curr_pinch.plot_view:"pinchend"==t.type&&null!=this._curr_pinch?(s=this._curr_pinch.plot_view,this._curr_pinch=null):s=null,null!=s){const t=a();this.__trigger(s,e,t,i)}}else if("rotatestart"==t.type||"rotate"==t.type||"rotateend"==t.type){let s;if("rotatestart"==t.type&&null!=r?(this._curr_rotate={plot_view:r},s=r):"rotate"==t.type&&null!=this._curr_rotate?s=this._curr_rotate.plot_view:"rotateend"==t.type&&null!=this._curr_rotate?(s=this._curr_rotate.plot_view,this._curr_rotate=null):s=null,null!=s){const t=a();this.__trigger(s,e,t,i)}}else if("mouseenter"==t.type||"mousemove"==t.type||"mouseleave"==t.type){const l=null===(s=this._prev_move)||void 0===s?void 0:s.plot_view;if(null!=l&&("mouseleave"==t.type||l!=r)){const{sx:e,sy:t}=a();this.__trigger(l,this.move_exit,{type:"mouseleave",sx:e,sy:t,shiftKey:!1,ctrlKey:!1},i)}if(null!=r&&("mouseenter"==t.type||l!=r)){const{sx:e,sy:t}=a();this.__trigger(r,this.move_enter,{type:"mouseenter",sx:e,sy:t,shiftKey:!1,ctrlKey:!1},i)}if(null!=r&&"mousemove"==t.type){const t=a();this.__trigger(r,e,t,i)}this._prev_move={sx:n,sy:o,plot_view:r}}else if(null!=r){const t=a();this.__trigger(r,e,t,i)}}__trigger(e,t,i,s){var n,o,r;const a=e.model.toolbar.gestures,l=t.name.split(":")[0],c=this._hit_test_renderers(e,i.sx,i.sy),h=this._hit_test_canvas(e,i.sx,i.sy);switch(l){case"move":{const s=a.move.active;null!=s&&this.trigger(t,i,s.id);const o=e.model.toolbar.inspectors.filter((e=>e.active));let r="default";null!=c?(r=null!==(n=c.cursor(i.sx,i.sy))&&void 0!==n?n:r,(0,u.is_empty)(o)||(t=this.move_exit)):this._hit_test_frame(e,i.sx,i.sy)&&((0,u.is_empty)(o)||(r="crosshair")),this.set_cursor(r),e.set_toolbar_visibility(h),o.map((e=>this.trigger(t,i,e.id)));break}case"tap":{const{target:n}=s;if(null!=n&&n!=this.hit_area)return;if(null===(o=null==c?void 0:c.on_hit)||void 0===o||o.call(c,i.sx,i.sy),this._hit_test_frame(e,i.sx,i.sy)){const e=a.tap.active;null!=e&&this.trigger(t,i,e.id)}break}case"doubletap":if(this._hit_test_frame(e,i.sx,i.sy)){const e=null!==(r=a.doubletap.active)&&void 0!==r?r:a.tap.active;null!=e&&this.trigger(t,i,e.id)}break;case"scroll":{const e=a[p.is_mobile?"pinch":"scroll"].active;null!=e&&(s.preventDefault(),s.stopPropagation(),this.trigger(t,i,e.id));break}case"pan":{const e=a.pan.active;null!=e&&(s.preventDefault(),this.trigger(t,i,e.id));break}default:{const e=a[l].active;null!=e&&this.trigger(t,i,e.id)}}this._trigger_bokeh_event(e,i)}trigger(e,t,i=null){e.emit({id:i,e:t})}_trigger_bokeh_event(e,t){const i=(()=>{const{sx:i,sy:s}=t,n=e.frame.x_scale.invert(i),o=e.frame.y_scale.invert(s);switch(t.type){case"wheel":return new h.MouseWheel(i,s,n,o,t.delta);case"mousemove":return new h.MouseMove(i,s,n,o);case"mouseenter":return new h.MouseEnter(i,s,n,o);case"mouseleave":return new h.MouseLeave(i,s,n,o);case"tap":return new h.Tap(i,s,n,o);case"doubletap":return new h.DoubleTap(i,s,n,o);case"press":return new h.Press(i,s,n,o);case"pressup":return new h.PressUp(i,s,n,o);case"pan":return new h.Pan(i,s,n,o,t.deltaX,t.deltaY);case"panstart":return new h.PanStart(i,s,n,o);case"panend":return new h.PanEnd(i,s,n,o);case"pinch":return new h.Pinch(i,s,n,o,t.scale);case"pinchstart":return new h.PinchStart(i,s,n,o);case"pinchend":return new h.PinchEnd(i,s,n,o);case"rotate":return new h.Rotate(i,s,n,o,t.rotation);case"rotatestart":return new h.RotateStart(i,s,n,o);case"rotateend":return new h.RotateEnd(i,s,n,o);default:return}})();null!=i&&e.model.trigger_event(i)}_get_sxy(e){const{pageX:t,pageY:i}=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(e)?(0!=e.touches.length?e.touches:e.changedTouches)[0]:e,{left:s,top:n}=(0,c.offset)(this.hit_area);return{sx:t-s,sy:i-n}}_pan_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{deltaX:e.deltaX,deltaY:e.deltaY,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}_pinch_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{scale:e.scale,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}_rotate_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{rotation:e.rotation,shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}_tap_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e.srcEvent)),{shiftKey:e.srcEvent.shiftKey,ctrlKey:e.srcEvent.ctrlKey})}_move_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e)),{shiftKey:e.shiftKey,ctrlKey:e.ctrlKey})}_scroll_event(e){return Object.assign(Object.assign({type:e.type},this._get_sxy(e)),{delta:(0,_.getDeltaY)(e),shiftKey:e.shiftKey,ctrlKey:e.ctrlKey})}_key_event(e){return{type:e.type,keyCode:e.keyCode}}_pan_start(e){const t=this._pan_event(e);t.sx-=e.deltaX,t.sy-=e.deltaY,this._trigger(this.pan_start,t,e.srcEvent)}_pan(e){this._trigger(this.pan,this._pan_event(e),e.srcEvent)}_pan_end(e){this._trigger(this.pan_end,this._pan_event(e),e.srcEvent)}_pinch_start(e){this._trigger(this.pinch_start,this._pinch_event(e),e.srcEvent)}_pinch(e){this._trigger(this.pinch,this._pinch_event(e),e.srcEvent)}_pinch_end(e){this._trigger(this.pinch_end,this._pinch_event(e),e.srcEvent)}_rotate_start(e){this._trigger(this.rotate_start,this._rotate_event(e),e.srcEvent)}_rotate(e){this._trigger(this.rotate,this._rotate_event(e),e.srcEvent)}_rotate_end(e){this._trigger(this.rotate_end,this._rotate_event(e),e.srcEvent)}_tap(e){this._trigger(this.tap,this._tap_event(e),e.srcEvent)}_doubletap(e){this._trigger(this.doubletap,this._tap_event(e),e.srcEvent)}_press(e){this._trigger(this.press,this._tap_event(e),e.srcEvent)}_pressup(e){this._trigger(this.pressup,this._tap_event(e),e.srcEvent)}_mouse_enter(e){this._trigger(this.move_enter,this._move_event(e),e)}_mouse_move(e){this._trigger(this.move,this._move_event(e),e)}_mouse_exit(e){this._trigger(this.move_exit,this._move_event(e),e)}_mouse_wheel(e){this._trigger(this.scroll,this._scroll_event(e),e)}_context_menu(e){!this.menu.is_open&&this.menu.can_open&&e.preventDefault();const{sx:t,sy:i}=this._get_sxy(e);this.menu.toggle({left:t,top:i})}_key_down(e){this.trigger(this.keydown,this._key_event(e))}_key_up(e){this.trigger(this.keyup,this._key_event(e))}}i.UIEventBus=g,g.__name__="UIEventBus"},function(e,t,i,s,n){s();var o=this&&this.__decorate||function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};function r(e){return function(t){t.prototype.event_name=e}}class a{to_json(){const{event_name:e}=this;return{event_name:e,event_values:this._to_json()}}}i.BokehEvent=a,a.__name__="BokehEvent";class l extends a{constructor(){super(...arguments),this.origin=null}_to_json(){return{model:this.origin}}}i.ModelEvent=l,l.__name__="ModelEvent";let c=class extends a{_to_json(){return{}}};i.DocumentReady=c,c.__name__="DocumentReady",i.DocumentReady=c=o([r("document_ready")],c);let h=class extends l{};i.ButtonClick=h,h.__name__="ButtonClick",i.ButtonClick=h=o([r("button_click")],h);let _=class extends l{constructor(e){super(),this.item=e}_to_json(){const{item:e}=this;return Object.assign(Object.assign({},super._to_json()),{item:e})}};i.MenuItemClick=_,_.__name__="MenuItemClick",i.MenuItemClick=_=o([r("menu_item_click")],_);class u extends l{}i.UIEvent=u,u.__name__="UIEvent";let d=class extends u{};i.LODStart=d,d.__name__="LODStart",i.LODStart=d=o([r("lodstart")],d);let p=class extends u{};i.LODEnd=p,p.__name__="LODEnd",i.LODEnd=p=o([r("lodend")],p);let m=class extends u{constructor(e,t,i,s){super(),this.x0=e,this.x1=t,this.y0=i,this.y1=s}_to_json(){const{x0:e,x1:t,y0:i,y1:s}=this;return Object.assign(Object.assign({},super._to_json()),{x0:e,x1:t,y0:i,y1:s})}};i.RangesUpdate=m,m.__name__="RangesUpdate",i.RangesUpdate=m=o([r("rangesupdate")],m);let g=class extends u{constructor(e,t){super(),this.geometry=e,this.final=t}_to_json(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super._to_json()),{geometry:e,final:t})}};i.SelectionGeometry=g,g.__name__="SelectionGeometry",i.SelectionGeometry=g=o([r("selectiongeometry")],g);let f=class extends u{};i.Reset=f,f.__name__="Reset",i.Reset=f=o([r("reset")],f);class b extends u{constructor(e,t,i,s){super(),this.sx=e,this.sy=t,this.x=i,this.y=s}_to_json(){const{sx:e,sy:t,x:i,y:s}=this;return Object.assign(Object.assign({},super._to_json()),{sx:e,sy:t,x:i,y:s})}}i.PointEvent=b,b.__name__="PointEvent";let y=class extends b{constructor(e,t,i,s,n,o){super(e,t,i,s),this.delta_x=n,this.delta_y=o}_to_json(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super._to_json()),{delta_x:e,delta_y:t})}};i.Pan=y,y.__name__="Pan",i.Pan=y=o([r("pan")],y);let v=class extends b{constructor(e,t,i,s,n){super(e,t,i,s),this.scale=n}_to_json(){const{scale:e}=this;return Object.assign(Object.assign({},super._to_json()),{scale:e})}};i.Pinch=v,v.__name__="Pinch",i.Pinch=v=o([r("pinch")],v);let x=class extends b{constructor(e,t,i,s,n){super(e,t,i,s),this.rotation=n}_to_json(){const{rotation:e}=this;return Object.assign(Object.assign({},super._to_json()),{rotation:e})}};i.Rotate=x,x.__name__="Rotate",i.Rotate=x=o([r("rotate")],x);let w=class extends b{constructor(e,t,i,s,n){super(e,t,i,s),this.delta=n}_to_json(){const{delta:e}=this;return Object.assign(Object.assign({},super._to_json()),{delta:e})}};i.MouseWheel=w,w.__name__="MouseWheel",i.MouseWheel=w=o([r("wheel")],w);let A=class extends b{};i.MouseMove=A,A.__name__="MouseMove",i.MouseMove=A=o([r("mousemove")],A);let k=class extends b{};i.MouseEnter=k,k.__name__="MouseEnter",i.MouseEnter=k=o([r("mouseenter")],k);let S=class extends b{};i.MouseLeave=S,S.__name__="MouseLeave",i.MouseLeave=S=o([r("mouseleave")],S);let T=class extends b{};i.Tap=T,T.__name__="Tap",i.Tap=T=o([r("tap")],T);let C=class extends b{};i.DoubleTap=C,C.__name__="DoubleTap",i.DoubleTap=C=o([r("doubletap")],C);let M=class extends b{};i.Press=M,M.__name__="Press",i.Press=M=o([r("press")],M);let z=class extends b{};i.PressUp=z,z.__name__="PressUp",i.PressUp=z=o([r("pressup")],z);let E=class extends b{};i.PanStart=E,E.__name__="PanStart",i.PanStart=E=o([r("panstart")],E);let R=class extends b{};i.PanEnd=R,R.__name__="PanEnd",i.PanEnd=R=o([r("panend")],R);let B=class extends b{};i.PinchStart=B,B.__name__="PinchStart",i.PinchStart=B=o([r("pinchstart")],B);let N=class extends b{};i.PinchEnd=N,N.__name__="PinchEnd",i.PinchEnd=N=o([r("pinchend")],N);let O=class extends b{};i.RotateStart=O,O.__name__="RotateStart",i.RotateStart=O=o([r("rotatestart")],O);let D=class extends b{};i.RotateEnd=D,D.__name__="RotateEnd",i.RotateEnd=D=o([r("rotateend")],D)},function(e,t,i,s,n){function o(e){const t=getComputedStyle(e).fontSize;return null!=t?parseInt(t,10):null}s(),i.getDeltaY=function(e){let t=-e.deltaY;if(e.target instanceof HTMLElement)switch(e.deltaMode){case e.DOM_DELTA_LINE:t*=null!==(r=null!==(n=o(null!==(s=(i=e.target).offsetParent)&&void 0!==s?s:document.body))&&void 0!==n?n:o(i))&&void 0!==r?r:16;break;case e.DOM_DELTA_PAGE:t*=function(e){return e.clientHeight}(e.target)}var i,s,n,r;return t}},function(e,t,i,s,n){s(),n("Expression",e(254).Expression),n("CustomJSExpr",e(255).CustomJSExpr),n("Stack",e(256).Stack),n("CumSum",e(257).CumSum),n("ScalarExpression",e(254).ScalarExpression),n("Minimum",e(258).Minimum),n("Maximum",e(259).Maximum);var o=e(260);n("XComponent",o.XComponent),n("YComponent",o.YComponent),n("PolarTransform",e(261).PolarTransform)},function(e,t,i,s,n){s();const o=e(53);class r extends o.Model{constructor(e){super(e)}initialize(){super.initialize(),this._result=new Map}v_compute(e){let t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._v_compute(e),this._result.set(e,t)),t}}i.Expression=r,r.__name__="Expression";class a extends o.Model{constructor(e){super(e)}initialize(){super.initialize(),this._result=new Map}compute(e){let t=this._result.get(e);return(void 0===t||e.changed_for(this))&&(t=this._compute(e),this._result.set(e,t)),t}}i.ScalarExpression=a,a.__name__="ScalarExpression"},function(e,t,i,s,n){var o;s();const r=e(14),a=e(254),l=e(24),c=e(9),h=e(13),_=e(34),u=e(8);class d extends a.Expression{constructor(e){super(e)}connect_signals(){super.connect_signals();for(const e of(0,h.values)(this.args))e instanceof r.HasProps&&e.change.connect((()=>{this._result.clear(),this.change.emit()}))}get names(){return(0,h.keys)(this.args)}get values(){return(0,h.values)(this.args)}get func(){const e=(0,_.use_strict)(this.code);return new l.GeneratorFunction(...this.names,e)}_v_compute(e){const t=this.func.apply(e,this.values);let i=t.next();if(i.done&&void 0!==i.value){const{value:t}=i;return(0,u.isArray)(t)||(0,u.isTypedArray)(t)?t:(0,u.isIterable)(t)?[...t]:(0,c.repeat)(t,e.length)}{const e=[];do{e.push(i.value),i=t.next()}while(!i.done);return e}}}i.CustomJSExpr=d,o=d,d.__name__="CustomJSExpr",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){var o;s();const r=e(254);class a extends r.Expression{constructor(e){super(e)}_v_compute(e){var t;const i=null!==(t=e.get_length())&&void 0!==t?t:0,s=new Float64Array(i);for(const n of this.fields){const t=e.data[n];if(null!=t){const e=Math.min(i,t.length);for(let i=0;i<e;i++)s[i]+=t[i]}}return s}}i.Stack=a,o=a,a.__name__="Stack",o.define((({String:e,Array:t})=>({fields:[t(e),[]]})))},function(e,t,i,s,n){var o;s();const r=e(254);class a extends r.Expression{constructor(e){super(e)}_v_compute(e){var t;const i=new Float64Array(null!==(t=e.get_length())&&void 0!==t?t:0),s=e.data[this.field],n=this.include_zero?1:0;i[0]=this.include_zero?0:s[0];for(let o=1;o<i.length;o++)i[o]=i[o-1]+s[o-n];return i}}i.CumSum=a,o=a,a.__name__="CumSum",o.define((({Boolean:e,String:t})=>({field:[t],include_zero:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(254),a=e(9);class l extends r.ScalarExpression{constructor(e){super(e)}_compute(e){var t,i;const s=null!==(t=e.data[this.field])&&void 0!==t?t:[];return Math.min(null!==(i=this.initial)&&void 0!==i?i:1/0,(0,a.min)(s))}}i.Minimum=l,o=l,l.__name__="Minimum",o.define((({Number:e,String:t,Nullable:i})=>({field:[t],initial:[i(e),null]})))},function(e,t,i,s,n){var o;s();const r=e(254),a=e(9);class l extends r.ScalarExpression{constructor(e){super(e)}_compute(e){var t,i;const s=null!==(t=e.data[this.field])&&void 0!==t?t:[];return Math.max(null!==(i=this.initial)&&void 0!==i?i:-1/0,(0,a.max)(s))}}i.Maximum=l,o=l,l.__name__="Maximum",o.define((({Number:e,String:t,Nullable:i})=>({field:[t],initial:[i(e),null]})))},function(e,t,i,s,n){var o;s();const r=e(254);class a extends r.Expression{constructor(e){super(e)}get x(){return new c({transform:this})}get y(){return new h({transform:this})}}i.CoordinateTransform=a,a.__name__="CoordinateTransform";class l extends r.Expression{constructor(e){super(e)}}i.XYComponent=l,o=l,l.__name__="XYComponent",o.define((({Ref:e})=>({transform:[e(a)]})));class c extends l{constructor(e){super(e)}_v_compute(e){return this.transform.v_compute(e).x}}i.XComponent=c,c.__name__="XComponent";class h extends l{constructor(e){super(e)}_v_compute(e){return this.transform.v_compute(e).y}}i.YComponent=h,h.__name__="YComponent"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(260),l=e(20),c=(0,o.__importStar)(e(18));class h extends a.CoordinateTransform{constructor(e){super(e)}_v_compute(e){const t=this.properties.radius.uniform(e),i=this.properties.angle.uniform(e),s="anticlock"==this.direction?-1:1,n=Math.min(t.length,i.length),o=new Float64Array(n),r=new Float64Array(n);for(let a=0;a<n;a++){const e=t.get(a),n=i.get(a)*s;o[a]=e*Math.cos(n),r[a]=e*Math.sin(n)}return{x:o,y:r}}}i.PolarTransform=h,r=h,h.__name__="PolarTransform",r.define((({})=>({radius:[c.DistanceSpec,{field:"radius"}],angle:[c.AngleSpec,{field:"angle"}],direction:[l.Direction,"anticlock"]})))},function(e,t,i,s,n){s(),n("BooleanFilter",e(263).BooleanFilter),n("CustomJSFilter",e(264).CustomJSFilter),n("Filter",e(191).Filter),n("GroupFilter",e(265).GroupFilter),n("IndexFilter",e(266).IndexFilter)},function(e,t,i,s,n){var o;s();const r=e(191),a=e(24);class l extends r.Filter{constructor(e){super(e)}compute_indices(e){const t=e.length,{booleans:i}=this;return null==i?a.Indices.all_set(t):a.Indices.from_booleans(t,i)}}i.BooleanFilter=l,o=l,l.__name__="BooleanFilter",o.define((({Boolean:e,Array:t,Nullable:i})=>({booleans:[i(t(e)),null]})))},function(e,t,i,s,n){var o;s();const r=e(191),a=e(24),l=e(13),c=e(8),h=e(34);class _ extends r.Filter{constructor(e){super(e)}get names(){return(0,l.keys)(this.args)}get values(){return(0,l.values)(this.args)}get func(){const e=(0,h.use_strict)(this.code);return new Function(...this.names,"source",e)}compute_indices(e){const t=e.length,i=this.func(...this.values,e);if(null==i)return a.Indices.all_set(t);if((0,c.isArrayOf)(i,c.isInteger))return a.Indices.from_indices(t,i);if((0,c.isArrayOf)(i,c.isBoolean))return a.Indices.from_booleans(t,i);throw new Error(`expect an array of integers or booleans, or null, got ${i}`)}}i.CustomJSFilter=_,o=_,_.__name__="CustomJSFilter",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){var o;s();const r=e(191),a=e(24),l=e(19);class c extends r.Filter{constructor(e){super(e)}compute_indices(e){const t=e.get_column(this.column_name);if(null==t)return l.logger.warn(`${this}: groupby column '${this.column_name}' not found in the data source`),new a.Indices(e.length,1);{const i=new a.Indices(e.length);for(let e=0;e<i.size;e++)t[e]===this.group&&i.set(e);return i}}}i.GroupFilter=c,o=c,c.__name__="GroupFilter",o.define((({String:e})=>({column_name:[e],group:[e]})))},function(e,t,i,s,n){var o;s();const r=e(191),a=e(24);class l extends r.Filter{constructor(e){super(e)}compute_indices(e){const t=e.length,{indices:i}=this;return null==i?a.Indices.all_set(t):a.Indices.from_indices(t,i)}}i.IndexFilter=l,o=l,l.__name__="IndexFilter",o.define((({Int:e,Array:t,Nullable:i})=>({indices:[i(t(e)),null]})))},function(e,t,i,s,n){s(),n("AnnularWedge",e(268).AnnularWedge),n("Annulus",e(269).Annulus),n("Arc",e(270).Arc),n("Bezier",e(271).Bezier),n("Circle",e(272).Circle),n("Ellipse",e(273).Ellipse),n("EllipseOval",e(274).EllipseOval),n("Glyph",e(179).Glyph),n("HArea",e(187).HArea),n("HBar",e(276).HBar),n("HexTile",e(278).HexTile),n("Image",e(279).Image),n("ImageRGBA",e(281).ImageRGBA),n("ImageURL",e(282).ImageURL),n("Line",e(177).Line),n("MultiLine",e(283).MultiLine),n("MultiPolygons",e(284).MultiPolygons),n("Oval",e(285).Oval),n("Patch",e(186).Patch),n("Patches",e(286).Patches),n("Quad",e(287).Quad),n("Quadratic",e(288).Quadratic),n("Ray",e(289).Ray),n("Rect",e(290).Rect),n("Scatter",e(291).Scatter),n("Segment",e(294).Segment),n("Spline",e(295).Spline),n("Step",e(297).Step),n("Text",e(298).Text),n("VArea",e(189).VArea),n("VBar",e(299).VBar),n("Wedge",e(300).Wedge)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=e(48),h=e(24),_=e(20),u=(0,o.__importStar)(e(18)),d=e(10),p=e(72),m=e(12);class g extends a.XYGlyphView{_map_data(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this.inner_radius):this.sinner_radius=(0,h.to_screen)(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=(0,h.to_screen)(this.outer_radius),this.max_souter_radius=(0,m.max)(this.souter_radius)}_render(e,t,i){const{sx:s,sy:n,start_angle:o,end_angle:r,sinner_radius:a,souter_radius:l}=null!=i?i:this,c="anticlock"==this.model.direction;for(const h of t){const t=s[h],i=n[h],_=a[h],u=l[h],d=o.get(h),p=r.get(h);if(!isFinite(t+i+_+u+d+p))continue;const m=p-d;e.translate(t,i),e.rotate(d),e.beginPath(),e.moveTo(u,0),e.arc(0,0,u,0,m,c),e.rotate(m),e.lineTo(_,0),e.arc(0,0,_,0,-m,!c),e.closePath(),e.rotate(-m-d),e.translate(-t,-i),this.visuals.fill.apply(e,h),this.visuals.hatch.apply(e,h),this.visuals.line.apply(e,h)}}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=t-this.max_souter_radius,r=t+this.max_souter_radius,[a,l]=this.renderer.xscale.r_invert(o,r),c=i-this.max_souter_radius,h=i+this.max_souter_radius,[_,u]=this.renderer.yscale.r_invert(c,h),m=[];for(const d of this.index.indices({x0:a,x1:l,y0:_,y1:u})){const e=this.souter_radius[d]**2,t=this.sinner_radius[d]**2,[i,o]=this.renderer.xscale.r_compute(s,this._x[d]),[r,a]=this.renderer.yscale.r_compute(n,this._y[d]),l=(i-o)**2+(r-a)**2;l<=e&&l>=t&&m.push(d)}const g="anticlock"==this.model.direction,f=[];for(const p of m){const e=Math.atan2(i-this.sy[p],t-this.sx[p]);(0,d.angle_between)(-e,-this.start_angle.get(p),-this.end_angle.get(p),g)&&f.push(p)}return new p.Selection({indices:f})}draw_legend_for_index(e,t,i){(0,l.generic_area_vector_legend)(this.visuals,e,t,i)}scenterxy(e){const t=(this.sinner_radius[e]+this.souter_radius[e])/2,i=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+t*Math.cos(i),this.sy[e]+t*Math.sin(i)]}}i.AnnularWedgeView=g,g.__name__="AnnularWedgeView";class f extends a.XYGlyph{constructor(e){super(e)}}i.AnnularWedge=f,r=f,f.__name__="AnnularWedge",r.prototype.default_view=g,r.mixins([c.LineVector,c.FillVector,c.HatchVector]),r.define((({})=>({direction:[_.Direction,"anticlock"],inner_radius:[u.DistanceSpec,{field:"inner_radius"}],outer_radius:[u.DistanceSpec,{field:"outer_radius"}],start_angle:[u.AngleSpec,{field:"start_angle"}],end_angle:[u.AngleSpec,{field:"end_angle"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(24),c=e(48),h=(0,o.__importStar)(e(18)),_=e(27),u=e(72);class d extends a.XYGlyphView{_map_data(){"data"==this.model.properties.inner_radius.units?this.sinner_radius=this.sdist(this.renderer.xscale,this._x,this.inner_radius):this.sinner_radius=(0,l.to_screen)(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=(0,l.to_screen)(this.outer_radius)}_render(e,t,i){const{sx:s,sy:n,sinner_radius:o,souter_radius:r}=null!=i?i:this;for(const a of t){const t=s[a],i=n[a],l=o[a],c=r[a];if(isFinite(t+i+l+c)){if(e.beginPath(),_.is_ie)for(const s of[!1,!0])e.moveTo(t,i),e.arc(t,i,l,0,Math.PI,s),e.moveTo(t+c,i),e.arc(t,i,c,Math.PI,0,!s);else e.arc(t,i,l,0,2*Math.PI,!0),e.moveTo(t+c,i),e.arc(t,i,c,2*Math.PI,0,!1);this.visuals.fill.apply(e,a),this.visuals.hatch.apply(e,a),this.visuals.line.apply(e,a)}}}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i);let o,r,a,l;if("data"==this.model.properties.outer_radius.units)o=s-this.max_outer_radius,a=s+this.max_outer_radius,r=n-this.max_outer_radius,l=n+this.max_outer_radius;else{const e=t-this.max_outer_radius,s=t+this.max_outer_radius;[o,a]=this.renderer.xscale.r_invert(e,s);const n=i-this.max_outer_radius,c=i+this.max_outer_radius;[r,l]=this.renderer.yscale.r_invert(n,c)}const c=[];for(const h of this.index.indices({x0:o,x1:a,y0:r,y1:l})){const e=this.souter_radius[h]**2,t=this.sinner_radius[h]**2,[i,o]=this.renderer.xscale.r_compute(s,this._x[h]),[r,a]=this.renderer.yscale.r_compute(n,this._y[h]),l=(i-o)**2+(r-a)**2;l<=e&&l>=t&&c.push(h)}return new u.Selection({indices:c})}draw_legend_for_index(e,{x0:t,y0:i,x1:s,y1:n},o){const r=o+1,a=new Array(r);a[o]=(t+s)/2;const l=new Array(r);l[o]=(i+n)/2;const c=.5*Math.min(Math.abs(s-t),Math.abs(n-i)),h=new Array(r);h[o]=.4*c;const _=new Array(r);_[o]=.8*c,this._render(e,[o],{sx:a,sy:l,sinner_radius:h,souter_radius:_})}}i.AnnulusView=d,d.__name__="AnnulusView";class p extends a.XYGlyph{constructor(e){super(e)}}i.Annulus=p,r=p,p.__name__="Annulus",r.prototype.default_view=d,r.mixins([c.LineVector,c.FillVector,c.HatchVector]),r.define((({})=>({inner_radius:[h.DistanceSpec,{field:"inner_radius"}],outer_radius:[h.DistanceSpec,{field:"outer_radius"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=e(48),h=e(24),_=e(20),u=(0,o.__importStar)(e(18));class d extends a.XYGlyphView{_map_data(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,h.to_screen)(this.radius)}_render(e,t,i){if(this.visuals.line.doit){const{sx:s,sy:n,sradius:o,start_angle:r,end_angle:a}=null!=i?i:this,l="anticlock"==this.model.direction;for(const i of t){const t=s[i],c=n[i],h=o[i],_=r.get(i),u=a.get(i);isFinite(t+c+h+_+u)&&(e.beginPath(),e.arc(t,c,h,_,u,l),this.visuals.line.set_vectorize(e,i),e.stroke())}}}draw_legend_for_index(e,t,i){(0,l.generic_line_vector_legend)(this.visuals,e,t,i)}}i.ArcView=d,d.__name__="ArcView";class p extends a.XYGlyph{constructor(e){super(e)}}i.Arc=p,r=p,p.__name__="Arc",r.prototype.default_view=d,r.mixins(c.LineVector),r.define((({})=>({direction:[_.Direction,"anticlock"],radius:[u.DistanceSpec,{field:"radius"}],start_angle:[u.AngleSpec,{field:"start_angle"}],end_angle:[u.AngleSpec,{field:"end_angle"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(48),l=e(179),c=e(184),h=e(78),_=(0,o.__importStar)(e(18));function u(e,t,i,s,n,o,r,a){const l=[],c=[[],[]];for(let u=0;u<=2;u++){let c,h,_;if(0===u?(h=6*e-12*i+6*n,c=-3*e+9*i-9*n+3*r,_=3*i-3*e):(h=6*t-12*s+6*o,c=-3*t+9*s-9*o+3*a,_=3*s-3*t),Math.abs(c)<1e-12){if(Math.abs(h)<1e-12)continue;const e=-_/h;0<e&&e<1&&l.push(e);continue}const d=h*h-4*_*c,p=Math.sqrt(d);if(d<0)continue;const m=(-h+p)/(2*c);0<m&&m<1&&l.push(m);const g=(-h-p)/(2*c);0<g&&g<1&&l.push(g)}let h=l.length;const _=h;for(;h--;){const _=l[h],u=1-_,d=u*u*u*e+3*u*u*_*i+3*u*_*_*n+_*_*_*r;c[0][h]=d;const p=u*u*u*t+3*u*u*_*s+3*u*_*_*o+_*_*_*a;c[1][h]=p}return c[0][_]=e,c[1][_]=t,c[0][_+1]=r,c[1][_+1]=a,[Math.min(...c[0]),Math.max(...c[1]),Math.max(...c[0]),Math.min(...c[1])]}class d extends l.GlyphView{_project_data(){h.inplace.project_xy(this._x0,this._y0),h.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{data_size:t,_x0:i,_y0:s,_x1:n,_y1:o,_cx0:r,_cy0:a,_cx1:l,_cy1:c}=this;for(let h=0;h<t;h++){const t=i[h],_=s[h],d=n[h],p=o[h],m=r[h],g=a[h],f=l[h],b=c[h];if(isFinite(t+d+_+p+m+g+f+b)){const[i,s,n,o]=u(t,_,d,p,m,g,f,b);e.add_rect(i,s,n,o)}else e.add_empty()}}_render(e,t,i){if(this.visuals.line.doit){const{sx0:s,sy0:n,sx1:o,sy1:r,scx0:a,scy0:l,scx1:c,scy1:h}=null!=i?i:this;for(const i of t){const t=s[i],_=n[i],u=o[i],d=r[i],p=a[i],m=l[i],g=c[i],f=h[i];isFinite(t+_+u+d+p+m+g+f)&&(e.beginPath(),e.moveTo(t,_),e.bezierCurveTo(p,m,g,f,u,d),this.visuals.line.set_vectorize(e,i),e.stroke())}}}draw_legend_for_index(e,t,i){(0,c.generic_line_vector_legend)(this.visuals,e,t,i)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}i.BezierView=d,d.__name__="BezierView";class p extends l.Glyph{constructor(e){super(e)}}i.Bezier=p,r=p,p.__name__="Bezier",r.prototype.default_view=d,r.define((({})=>({x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}],cx0:[_.XCoordinateSpec,{field:"cx0"}],cy0:[_.YCoordinateSpec,{field:"cy0"}],cx1:[_.XCoordinateSpec,{field:"cx1"}],cy1:[_.YCoordinateSpec,{field:"cy1"}]}))),r.mixins(a.LineVector)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(48),c=e(24),h=e(20),_=(0,o.__importStar)(e(185)),u=(0,o.__importStar)(e(18)),d=e(9),p=e(12),m=e(72);class g extends a.XYGlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{CircleGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(423))));this.glglyph=new i(t.regl_wrapper,this)}}get use_radius(){return!(this.radius.is_Scalar()&&isNaN(this.radius.value))}_set_data(e){super._set_data(e);const t=(()=>{if(this.use_radius)return 2*this.max_radius;{const{size:e}=this;return e.is_Scalar()?e.value:(0,p.max)(e.array)}})();this._configure("max_size",{value:t})}_map_data(){if(this.use_radius)if("data"==this.model.properties.radius.units)switch(this.model.radius_dimension){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);break;case"max":{const e=this.sdist(this.renderer.xscale,this._x,this.radius),t=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,p.map)(e,((e,i)=>Math.max(e,t[i])));break}case"min":{const e=this.sdist(this.renderer.xscale,this._x,this.radius),t=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,p.map)(e,((e,i)=>Math.min(e,t[i])));break}}else this.sradius=(0,c.to_screen)(this.radius);else{const e=c.ScreenArray.from(this.size);this.sradius=(0,p.map)(e,(e=>e/2))}}_mask_data(){const{frame:e}=this.renderer.plot_view,t=e.x_target,i=e.y_target;let s,n;return this.use_radius&&"data"==this.model.properties.radius.units?(s=t.map((e=>this.renderer.xscale.invert(e))).widen(this.max_radius),n=i.map((e=>this.renderer.yscale.invert(e))).widen(this.max_radius)):(s=t.widen(this.max_size).map((e=>this.renderer.xscale.invert(e))),n=i.widen(this.max_size).map((e=>this.renderer.yscale.invert(e)))),this.index.indices({x0:s.start,x1:s.end,y0:n.start,y1:n.end})}_render(e,t,i){const{sx:s,sy:n,sradius:o}=null!=i?i:this;for(const r of t){const t=s[r],i=n[r],a=o[r];isFinite(t+i+a)&&(e.beginPath(),e.arc(t,i,a,0,2*Math.PI,!1),this.visuals.fill.apply(e,r),this.visuals.hatch.apply(e,r),this.visuals.line.apply(e,r))}}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),{hit_dilation:o}=this.model;let r,a,l,c;if(this.use_radius&&"data"==this.model.properties.radius.units)r=s-this.max_radius*o,a=s+this.max_radius*o,l=n-this.max_radius*o,c=n+this.max_radius*o;else{const e=t-this.max_size*o,s=t+this.max_size*o;[r,a]=this.renderer.xscale.r_invert(e,s);const n=i-this.max_size*o,h=i+this.max_size*o;[l,c]=this.renderer.yscale.r_invert(n,h)}const h=this.index.indices({x0:r,x1:a,y0:l,y1:c}),_=[];if(this.use_radius&&"data"==this.model.properties.radius.units)for(const u of h){const e=(this.sradius[u]*o)**2,[t,i]=this.renderer.xscale.r_compute(s,this._x[u]),[r,a]=this.renderer.yscale.r_compute(n,this._y[u]);(t-i)**2+(r-a)**2<=e&&_.push(u)}else for(const u of h){const e=(this.sradius[u]*o)**2;(this.sx[u]-t)**2+(this.sy[u]-i)**2<=e&&_.push(u)}return new m.Selection({indices:_})}_hit_span(e){const{sx:t,sy:i}=e,s=this.bounds();let n,o,r,a;if("h"==e.direction){let e,i;if(r=s.y0,a=s.y1,this.use_radius&&"data"==this.model.properties.radius.units)e=t-this.max_radius,i=t+this.max_radius,[n,o]=this.renderer.xscale.r_invert(e,i);else{const s=this.max_size/2;e=t-s,i=t+s,[n,o]=this.renderer.xscale.r_invert(e,i)}}else{let e,t;if(n=s.x0,o=s.x1,this.use_radius&&"data"==this.model.properties.radius.units)e=i-this.max_radius,t=i+this.max_radius,[r,a]=this.renderer.yscale.r_invert(e,t);else{const s=this.max_size/2;e=i-s,t=i+s,[r,a]=this.renderer.yscale.r_invert(e,t)}}const l=[...this.index.indices({x0:n,x1:o,y0:r,y1:a})];return new m.Selection({indices:l})}_hit_rect(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,[o,r]=this.renderer.xscale.r_invert(t,i),[a,l]=this.renderer.yscale.r_invert(s,n),c=[...this.index.indices({x0:o,x1:r,y0:a,y1:l})];return new m.Selection({indices:c})}_hit_poly(e){const{sx:t,sy:i}=e,s=(0,d.range)(0,this.sx.length),n=[];for(let o=0,r=s.length;o<r;o++){const e=s[o];_.point_in_poly(this.sx[o],this.sy[o],t,i)&&n.push(e)}return new m.Selection({indices:n})}draw_legend_for_index(e,{x0:t,y0:i,x1:s,y1:n},o){const r=o+1,a=new Array(r);a[o]=(t+s)/2;const l=new Array(r);l[o]=(i+n)/2;const c=new Array(r);c[o]=.2*Math.min(Math.abs(s-t),Math.abs(n-i)),this._render(e,[o],{sx:a,sy:l,sradius:c})}}i.CircleView=g,g.__name__="CircleView";class f extends a.XYGlyph{constructor(e){super(e)}}i.Circle=f,r=f,f.__name__="Circle",r.prototype.default_view=g,r.mixins([l.LineVector,l.FillVector,l.HatchVector]),r.define((({Number:e})=>({angle:[u.AngleSpec,0],size:[u.ScreenSizeSpec,{value:4}],radius:[u.NullDistanceSpec,null],radius_dimension:[h.RadiusDimension,"x"],hit_dilation:[e,1]})))},function(e,t,i,s,n){var o;s();const r=e(274);class a extends r.EllipseOvalView{}i.EllipseView=a,a.__name__="EllipseView";class l extends r.EllipseOval{constructor(e){super(e)}}i.Ellipse=l,o=l,l.__name__="Ellipse",o.prototype.default_view=a},function(e,t,i,s,n){s();const o=e(1),r=e(275),a=(0,o.__importStar)(e(185)),l=e(24),c=e(72),h=(0,o.__importStar)(e(18));class _ extends r.CenterRotatableView{_map_data(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.width,"center"):this.sw=(0,l.to_screen)(this.width),"data"==this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.height,"center"):this.sh=(0,l.to_screen)(this.height)}_render(e,t,i){const{sx:s,sy:n,sw:o,sh:r,angle:a}=null!=i?i:this;for(const l of t){const t=s[l],i=n[l],c=o[l],h=r[l],_=a.get(l);isFinite(t+i+c+h+_)&&(e.beginPath(),e.ellipse(t,i,c/2,h/2,_,0,2*Math.PI),this.visuals.fill.apply(e,l),this.visuals.hatch.apply(e,l),this.visuals.line.apply(e,l))}}_hit_point(e){let t,i,s,n,o,r,l,h,_;const{sx:u,sy:d}=e,p=this.renderer.xscale.invert(u),m=this.renderer.yscale.invert(d);"data"==this.model.properties.width.units?(t=p-this.max_width,i=p+this.max_width):(r=u-this.max_width,l=u+this.max_width,[t,i]=this.renderer.xscale.r_invert(r,l)),"data"==this.model.properties.height.units?(s=m-this.max_height,n=m+this.max_height):(h=d-this.max_height,_=d+this.max_height,[s,n]=this.renderer.yscale.r_invert(h,_));const g=this.index.indices({x0:t,x1:i,y0:s,y1:n}),f=[];for(const c of g)o=a.point_in_ellipse(u,d,this.angle.get(c),this.sh[c]/2,this.sw[c]/2,this.sx[c],this.sy[c]),o&&f.push(c);return new c.Selection({indices:f})}draw_legend_for_index(e,{x0:t,y0:i,x1:s,y1:n},o){const r=o+1,a=new Array(r);a[o]=(t+s)/2;const l=new Array(r);l[o]=(i+n)/2;const c=this.sw[o]/this.sh[o],_=.8*Math.min(Math.abs(s-t),Math.abs(n-i)),u=new Array(r),d=new Array(r);c>1?(u[o]=_,d[o]=_/c):(u[o]=_*c,d[o]=_);const p=new h.UniformScalar(0,r);this._render(e,[o],{sx:a,sy:l,sw:u,sh:d,angle:p})}}i.EllipseOvalView=_,_.__name__="EllipseOvalView";class u extends r.CenterRotatable{constructor(e){super(e)}}i.EllipseOval=u,u.__name__="EllipseOval"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(48),c=(0,o.__importStar)(e(18));class h extends a.XYGlyphView{get max_w2(){return"data"==this.model.properties.width.units?this.max_width/2:0}get max_h2(){return"data"==this.model.properties.height.units?this.max_height/2:0}_bounds({x0:e,x1:t,y0:i,y1:s}){const{max_w2:n,max_h2:o}=this;return{x0:e-n,x1:t+n,y0:i-o,y1:s+o}}}i.CenterRotatableView=h,h.__name__="CenterRotatableView";class _ extends a.XYGlyph{constructor(e){super(e)}}i.CenterRotatable=_,r=_,_.__name__="CenterRotatable",r.mixins([l.LineVector,l.FillVector,l.HatchVector]),r.define((({})=>({angle:[c.AngleSpec,0],width:[c.DistanceSpec,{field:"width"}],height:[c.DistanceSpec,{field:"height"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(277),l=e(24),c=(0,o.__importStar)(e(18));class h extends a.BoxView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(427))));this.glglyph=new i(t.regl_wrapper,this)}}scenterxy(e){return[(this.sleft[e]+this.sright[e])/2,this.sy[e]]}_lrtb(e){const t=this._left[e],i=this._right[e],s=this._y[e],n=this.height.get(e)/2;return[Math.min(t,i),Math.max(t,i),s+n,s-n]}_map_data(){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);const e=this.sy.length;this.stop=new l.ScreenArray(e),this.sbottom=new l.ScreenArray(e);for(let t=0;t<e;t++)this.stop[t]=this.sy[t]-this.sh[t]/2,this.sbottom[t]=this.sy[t]+this.sh[t]/2;this._clamp_viewport()}}i.HBarView=h,h.__name__="HBarView";class _ extends a.Box{constructor(e){super(e)}}i.HBar=_,r=_,_.__name__="HBar",r.prototype.default_view=h,r.define((({})=>({left:[c.XCoordinateSpec,{value:0}],y:[c.YCoordinateSpec,{field:"y"}],height:[c.NumberSpec,{value:1}],right:[c.XCoordinateSpec,{field:"right"}]})))},function(e,t,i,s,n){var o;s();const r=e(48),a=e(179),l=e(184),c=e(72);class h extends a.GlyphView{get_anchor_point(e,t,i){const s=Math.min(this.sleft[t],this.sright[t]),n=Math.max(this.sright[t],this.sleft[t]),o=Math.min(this.stop[t],this.sbottom[t]),r=Math.max(this.sbottom[t],this.stop[t]);switch(e){case"top_left":return{x:s,y:o};case"top":case"top_center":return{x:(s+n)/2,y:o};case"top_right":return{x:n,y:o};case"bottom_left":return{x:s,y:r};case"bottom":case"bottom_center":return{x:(s+n)/2,y:r};case"bottom_right":return{x:n,y:r};case"left":case"center_left":return{x:s,y:(o+r)/2};case"center":case"center_center":return{x:(s+n)/2,y:(o+r)/2};case"right":case"center_right":return{x:n,y:(o+r)/2}}}_index_data(e){const{min:t,max:i}=Math,{data_size:s}=this;for(let n=0;n<s;n++){const[s,o,r,a]=this._lrtb(n);e.add_rect(t(s,o),t(r,a),i(o,s),i(r,a))}}_render(e,t,i){const{sleft:s,sright:n,stop:o,sbottom:r}=null!=i?i:this;for(const a of t){const t=s[a],i=o[a],l=n[a],c=r[a];isFinite(t+i+l+c)&&(e.beginPath(),e.rect(t,i,l-t,c-i),this.visuals.fill.apply(e,a),this.visuals.hatch.apply(e,a),this.visuals.line.apply(e,a))}}_clamp_viewport(){const e=this.renderer.plot_view.frame.bbox.h_range,t=this.renderer.plot_view.frame.bbox.v_range,i=this.stop.length;for(let s=0;s<i;s++)this.stop[s]=Math.max(this.stop[s],t.start),this.sbottom[s]=Math.min(this.sbottom[s],t.end),this.sleft[s]=Math.max(this.sleft[s],e.start),this.sright[s]=Math.min(this.sright[s],e.end)}_hit_rect(e){return this._hit_rect_against_index(e)}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=[...this.index.indices({x0:s,y0:n,x1:s,y1:n})];return new c.Selection({indices:o})}_hit_span(e){const{sx:t,sy:i}=e;let s;if("v"==e.direction){const e=this.renderer.yscale.invert(i),t=this.renderer.plot_view.frame.bbox.h_range,[n,o]=this.renderer.xscale.r_invert(t.start,t.end);s=[...this.index.indices({x0:n,y0:e,x1:o,y1:e})]}else{const e=this.renderer.xscale.invert(t),i=this.renderer.plot_view.frame.bbox.v_range,[n,o]=this.renderer.yscale.r_invert(i.start,i.end);s=[...this.index.indices({x0:e,y0:n,x1:e,y1:o})]}return new c.Selection({indices:s})}draw_legend_for_index(e,t,i){(0,l.generic_area_vector_legend)(this.visuals,e,t,i)}}i.BoxView=h,h.__name__="BoxView";class _ extends a.Glyph{constructor(e){super(e)}}i.Box=_,o=_,_.__name__="Box",o.mixins([r.LineVector,r.FillVector,r.HatchVector])},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(179),l=(0,o.__importStar)(e(185)),c=(0,o.__importStar)(e(18)),h=e(48),_=e(20),u=e(78),d=e(184),p=e(72);class m extends a.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{HexTileGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(425))));this.glglyph=new i(t.regl_wrapper,this)}}scenterxy(e){return[this.sx[e],this.sy[e]]}_set_data(){const{orientation:e,size:t,aspect_scale:i}=this.model,{q:s,r:n}=this,o=this.q.length;this._x=new Float64Array(o),this._y=new Float64Array(o);const{_x:r,_y:a}=this,l=Math.sqrt(3);if("pointytop"==e)for(let c=0;c<o;c++){const e=s.get(c),o=n.get(c)/2;r[c]=t*l*(e+o)/i,a[c]=-3*t*o}else for(let c=0;c<o;c++){const e=s.get(c)/2,o=n.get(c);r[c]=3*t*e,a[c]=-t*l*(o+e)*i}}_project_data(){u.inplace.project_xy(this._x,this._y)}_index_data(e){let t=this.model.size,i=Math.sqrt(3)*t/2;"flattop"==this.model.orientation?([i,t]=[t,i],t*=this.model.aspect_scale):i/=this.model.aspect_scale;const{data_size:s}=this;for(let n=0;n<s;n++){const s=this._x[n],o=this._y[n];e.add_rect(s-i,o-t,s+i,o+t)}}map_data(){var e;[this.sx,this.sy]=this.renderer.coordinates.map_to_screen(this._x,this._y),[this.svx,this.svy]=this._get_unscaled_vertices(),null===(e=this.glglyph)||void 0===e||e.set_data_changed()}_get_unscaled_vertices(){const e=this.model.size,t=this.model.aspect_scale;if("pointytop"==this.model.orientation){const i=this.renderer.yscale,s=this.renderer.xscale,n=Math.abs(i.compute(0)-i.compute(e)),o=Math.sqrt(3)/2*Math.abs(s.compute(0)-s.compute(e))/t,r=n/2;return[[0,-o,-o,0,o,o],[n,r,-r,-n,-r,r]]}{const i=this.renderer.xscale,s=this.renderer.yscale,n=Math.abs(i.compute(0)-i.compute(e)),o=Math.sqrt(3)/2*Math.abs(s.compute(0)-s.compute(e))*t,r=n/2;return[[n,r,-r,-n,-r,r],[0,-o,-o,0,o,o]]}}_render(e,t,i){const{sx:s,sy:n,svx:o,svy:r,scale:a}=null!=i?i:this;for(const l of t){const t=s[l],i=n[l],c=a.get(l);if(isFinite(t+i+c)){e.translate(t,i),e.beginPath();for(let t=0;t<6;t++)e.lineTo(o[t]*c,r[t]*c);e.closePath(),e.translate(-t,-i),this.visuals.fill.apply(e,l),this.visuals.hatch.apply(e,l),this.visuals.line.apply(e,l)}}}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=this.index.indices({x0:s,y0:n,x1:s,y1:n}),r=[];for(const a of o)l.point_in_poly(t-this.sx[a],i-this.sy[a],this.svx,this.svy)&&r.push(a);return new p.Selection({indices:r})}_hit_span(e){const{sx:t,sy:i}=e;let s;if("v"==e.direction){const e=this.renderer.yscale.invert(i),t=this.renderer.plot_view.frame.bbox.h_range,[n,o]=this.renderer.xscale.r_invert(t.start,t.end);s=[...this.index.indices({x0:n,y0:e,x1:o,y1:e})]}else{const e=this.renderer.xscale.invert(t),i=this.renderer.plot_view.frame.bbox.v_range,[n,o]=this.renderer.yscale.r_invert(i.start,i.end);s=[...this.index.indices({x0:e,y0:n,x1:e,y1:o})]}return new p.Selection({indices:s})}_hit_rect(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,[o,r]=this.renderer.xscale.r_invert(t,i),[a,l]=this.renderer.yscale.r_invert(s,n),c=[...this.index.indices({x0:o,x1:r,y0:a,y1:l})];return new p.Selection({indices:c})}draw_legend_for_index(e,t,i){(0,d.generic_area_vector_legend)(this.visuals,e,t,i)}}i.HexTileView=m,m.__name__="HexTileView";class g extends a.Glyph{constructor(e){super(e)}}i.HexTile=g,r=g,g.__name__="HexTile",r.prototype.default_view=m,r.mixins([h.LineVector,h.FillVector,h.HatchVector]),r.define((({Number:e})=>({r:[c.NumberSpec,{field:"r"}],q:[c.NumberSpec,{field:"q"}],scale:[c.NumberSpec,1],size:[e,1],aspect_scale:[e,1],orientation:[_.HexTileOrientation,"pointytop"]}))),r.override({line_color:null})},function(e,t,i,s,n){var o;s();const r=e(280),a=e(173),l=e(201);class c extends r.ImageBaseView{connect_signals(){super.connect_signals(),this.connect(this.model.color_mapper.change,(()=>this._update_image()))}_update_image(){null!=this.image_data&&(this._set_data(null),this.renderer.request_render())}_flat_img_to_buf8(e){return this.model.color_mapper.rgba_mapper.v_compute(e)}}i.ImageView=c,c.__name__="ImageView";class h extends r.ImageBase{constructor(e){super(e)}}i.Image=h,o=h,h.__name__="Image",o.prototype.default_view=c,o.define((({Ref:e})=>({color_mapper:[e(a.ColorMapper),()=>new l.LinearColorMapper({palette:["#000000","#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0","#ffffff"]})]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(24),c=(0,o.__importStar)(e(18)),h=e(72),_=e(9),u=e(29),d=e(11);class p extends a.XYGlyphView{connect_signals(){super.connect_signals(),this.connect(this.model.properties.global_alpha.change,(()=>this.renderer.request_render()))}_render(e,t,i){const{image_data:s,sx:n,sy:o,sw:r,sh:a,global_alpha:l}=null!=i?i:this,c=e.getImageSmoothingEnabled();e.setImageSmoothingEnabled(!1);const h=l.is_Scalar();h&&(e.globalAlpha=l.value);for(const _ of t){const t=s[_],i=n[_],l=o[_],c=r[_],u=a[_],d=this.global_alpha.get(_);if(null==t||!isFinite(i+l+c+u+d))continue;h||(e.globalAlpha=d);const p=l;e.translate(0,p),e.scale(1,-1),e.translate(0,-p),e.drawImage(t,0|i,0|l,c,u),e.translate(0,p),e.scale(1,-1),e.translate(0,-p)}e.setImageSmoothingEnabled(c)}_set_data(e){this._set_width_heigh_data();for(let t=0,i=this.image.length;t<i;t++){if(null!=e&&e.indexOf(t)<0)continue;const i=this.image.get(t);let s;(0,u.is_NDArray)(i)?((0,d.assert)(2==i.dimension,"expected a 2D array"),s=i,this._height[t]=i.shape[0],this._width[t]=i.shape[1]):(s=(0,_.concat)(i),this._height[t]=i.length,this._width[t]=i[0].length);const n=this._flat_img_to_buf8(s);this._set_image_data_from_buffer(t,n)}}_index_data(e){const{data_size:t}=this;for(let i=0;i<t;i++){const[t,s,n,o]=this._lrtb(i);e.add_rect(t,o,s,n)}}_lrtb(e){const t=this.dw.get(e),i=this.dh.get(e),s=this.renderer.xscale.source_range,n=this._x[e],o=s.is_reversed?n-t:n+t,r=this.renderer.yscale.source_range,a=this._y[e],l=r.is_reversed?a-i:a+i,[c,h]=n<o?[n,o]:[o,n],[_,u]=a<l?[a,l]:[l,a];return[c,h,u,_]}_set_width_heigh_data(){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 Uint32Array(this.image.length)),null!=this._height&&this._height.length==this.image.length||(this._height=new Uint32Array(this.image.length))}_get_or_create_canvas(e){const t=this.image_data[e];if(null!=t&&t.width==this._width[e]&&t.height==this._height[e])return t;{const t=document.createElement("canvas");return t.width=this._width[e],t.height=this._height[e],t}}_set_image_data_from_buffer(e,t){const i=this._get_or_create_canvas(e),s=i.getContext("2d"),n=s.getImageData(0,0,this._width[e],this._height[e]);n.data.set(t),s.putImageData(n,0,0),this.image_data[e]=i}_map_data(){"data"==this.model.properties.dw.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.dw,"edge",this.model.dilate):this.sw=(0,l.to_screen)(this.dw),"data"==this.model.properties.dh.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.dh,"edge",this.model.dilate):this.sh=(0,l.to_screen)(this.dh)}_image_index(e,t,i){const[s,n,o,r]=this._lrtb(e),a=this._width[e],l=this._height[e],c=(n-s)/a,h=(o-r)/l;let _=Math.floor((t-s)/c),u=Math.floor((i-r)/h);return this.renderer.xscale.source_range.is_reversed&&(_=a-_-1),this.renderer.yscale.source_range.is_reversed&&(u=l-u-1),{index:e,dim1:_,dim2:u,flat_index:u*a+_}}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=this.index.indices({x0:s,x1:s,y0:n,y1:n}),r=new h.Selection;for(const a of o)t!=1/0&&i!=1/0&&r.image_indices.push(this._image_index(a,s,n));return r}}i.ImageBaseView=p,p.__name__="ImageBaseView";class m extends a.XYGlyph{constructor(e){super(e)}}i.ImageBase=m,r=m,m.__name__="ImageBase",r.define((({Boolean:e})=>({image:[c.NDArraySpec,{field:"image"}],dw:[c.DistanceSpec,{field:"dw"}],dh:[c.DistanceSpec,{field:"dh"}],global_alpha:[c.NumberSpec,{value:1}],dilate:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(280),a=e(8);class l extends r.ImageBaseView{_flat_img_to_buf8(e){let t;return t=(0,a.isArray)(e)?new Uint32Array(e):e,new Uint8ClampedArray(t.buffer)}}i.ImageRGBAView=l,l.__name__="ImageRGBAView";class c extends r.ImageBase{constructor(e){super(e)}}i.ImageRGBA=c,o=c,c.__name__="ImageRGBA",o.prototype.default_view=l},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(24),c=e(20),h=(0,o.__importStar)(e(18)),_=e(12),u=e(136);class d extends a.XYGlyphView{constructor(){super(...arguments),this._images_rendered=!1,this._set_data_iteration=0}connect_signals(){super.connect_signals(),this.connect(this.model.properties.global_alpha.change,(()=>this.renderer.request_render()))}_index_data(e){const{data_size:t}=this;for(let i=0;i<t;i++)e.add_empty()}_set_data(){this._set_data_iteration++;const e=this.url.length;this.image=new Array(e);const{retry_attempts:t,retry_timeout:i}=this.model,{_set_data_iteration:s}=this;for(let l=0;l<e;l++){const e=this.url.get(l);e&&new u.ImageLoader(e,{loaded:e=>{this._set_data_iteration==s&&(this.image[l]=e,this.renderer.request_render())},attempts:t+1,timeout:i})}const n="data"==this.model.properties.w.units,o="data"==this.model.properties.h.units,r=this._x.length,a=new l.ScreenArray(n?2*r:r),c=new l.ScreenArray(o?2*r:r),{anchor:h}=this.model;function d(e,t){switch(h){case"top_left":case"bottom_left":case"left":case"center_left":return[e,e+t];case"top":case"top_center":case"bottom":case"bottom_center":case"center":case"center_center":return[e-t/2,e+t/2];case"top_right":case"bottom_right":case"right":case"center_right":return[e-t,e]}}function p(e,t){switch(h){case"top_left":case"top":case"top_center":case"top_right":return[e,e-t];case"bottom_left":case"bottom":case"bottom_center":case"bottom_right":return[e+t,e];case"left":case"center_left":case"center":case"center_center":case"right":case"center_right":return[e+t/2,e-t/2]}}if(n)for(let l=0;l<r;l++)[a[l],a[r+l]]=d(this._x[l],this.w.get(l));else a.set(this._x,0);if(o)for(let l=0;l<r;l++)[c[l],c[r+l]]=p(this._y[l],this.h.get(l));else c.set(this._y,0);const[m,g]=(0,_.minmax)(a),[f,b]=(0,_.minmax)(c);this._bounds_rect={x0:m,x1:g,y0:f,y1:b}}has_finished(){return super.has_finished()&&1==this._images_rendered}_map_data(){"data"==this.model.properties.w.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.w,"edge",this.model.dilate):this.sw=(0,l.to_screen)(this.w),"data"==this.model.properties.h.units?this.sh=this.sdist(this.renderer.yscale,this._y,this.h,"edge",this.model.dilate):this.sh=(0,l.to_screen)(this.h)}_render(e,t,i){const{image:s,sx:n,sy:o,sw:r,sh:a,angle:l,global_alpha:c}=null!=i?i:this,{frame:h}=this.renderer.plot_view;e.beginPath(),e.rect(h.bbox.left+1,h.bbox.top+1,h.bbox.width-2,h.bbox.height-2),e.clip();let _=!0;for(const u of t){if(!isFinite(n[u]+o[u]+l.get(u)+c.get(u)))continue;const t=s[u];null!=t?this._render_image(e,u,t,n,o,r,a,l,c):_=!1}_&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())}_final_sx_sy(e,t,i,s,n){switch(e){case"top_left":return[t,i];case"top":case"top_center":return[t-s/2,i];case"top_right":return[t-s,i];case"right":case"center_right":return[t-s,i-n/2];case"bottom_right":return[t-s,i-n];case"bottom":case"bottom_center":return[t-s/2,i-n];case"bottom_left":return[t,i-n];case"left":case"center_left":return[t,i-n/2];case"center":case"center_center":return[t-s/2,i-n/2]}}_render_image(e,t,i,s,n,o,r,a,l){isFinite(o[t])||(o[t]=i.width),isFinite(r[t])||(r[t]=i.height);const c=o[t],h=r[t],{anchor:_}=this.model,[u,d]=this._final_sx_sy(_,s[t],n[t],c,h),p=a.get(t),m=l.get(t);e.save(),e.globalAlpha=m;const g=c/2,f=h/2;p?(e.translate(u,d),e.translate(g,f),e.rotate(p),e.translate(-g,-f),e.drawImage(i,0,0,c,h),e.translate(g,f),e.rotate(-p),e.translate(-g,-f),e.translate(-u,-d)):e.drawImage(i,u,d,c,h),e.restore()}bounds(){return this._bounds_rect}}i.ImageURLView=d,d.__name__="ImageURLView";class p extends a.XYGlyph{constructor(e){super(e)}}i.ImageURL=p,r=p,p.__name__="ImageURL",r.prototype.default_view=d,r.define((({Boolean:e,Int:t})=>({url:[h.StringSpec,{field:"url"}],anchor:[c.Anchor,"top_left"],global_alpha:[h.NumberSpec,{value:1}],angle:[h.AngleSpec,0],w:[h.NullDistanceSpec,null],h:[h.NullDistanceSpec,null],dilate:[e,!1],retry_attempts:[t,0],retry_timeout:[t,0]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(78),l=e(48),c=(0,o.__importStar)(e(185)),h=(0,o.__importStar)(e(18)),_=e(12),u=e(13),d=e(179),p=e(184),m=e(72);class g extends d.GlyphView{_project_data(){a.inplace.project_xy(this._xs.array,this._ys.array)}_index_data(e){const{data_size:t}=this;for(let i=0;i<t;i++){const t=this._xs.get(i),s=this._ys.get(i),[n,o,r,a]=(0,_.minmax2)(t,s);e.add_rect(n,r,o,a)}}_render(e,t,i){const{sxs:s,sys:n}=null!=i?i:this;for(const o of t){const t=s.get(o),i=n.get(o),r=Math.min(t.length,i.length);let a=!0;e.beginPath();for(let s=0;s<r;s++){const n=t[s],o=i[s];isFinite(n+o)?a?(e.moveTo(n,o),a=!1):e.lineTo(n,o):a=!0}this.visuals.line.set_vectorize(e,o),e.stroke()}}_hit_point(e){const t={x:e.sx,y:e.sy};let i=9999;const s=new Map;for(let n=0,o=this.sxs.length;n<o;n++){const e=Math.max(2,this.line_width.get(n)/2),o=this.sxs.get(n),r=this.sys.get(n);let a=null;for(let s=0,n=o.length-1;s<n;s++){const n={x:o[s],y:r[s]},l={x:o[s+1],y:r[s+1]},h=c.dist_to_segment(t,n,l);h<e&&h<i&&(i=h,a=[s])}null!=a&&s.set(n,a)}return new m.Selection({indices:[...s.keys()],multiline_indices:(0,u.to_object)(s)})}_hit_span(e){const{sx:t,sy:i}=e;let s,n;"v"==e.direction?(s=this.renderer.yscale.invert(i),n=this._ys):(s=this.renderer.xscale.invert(t),n=this._xs);const o=new Map;for(let r=0,a=n.length;r<a;r++){const e=n.get(r),t=[];for(let i=0,n=e.length-1;i<n;i++)e[i]<=s&&s<=e[i+1]&&t.push(i);t.length>0&&o.set(r,t)}return new m.Selection({indices:[...o.keys()],multiline_indices:(0,u.to_object)(o)})}get_interpolation_hit(e,t,i){const s=this._xs.get(e),n=this._ys.get(e),o=s[t],r=n[t],a=s[t+1],l=n[t+1];return(0,p.line_interpolation)(this.renderer,i,o,r,a,l)}draw_legend_for_index(e,t,i){(0,p.generic_line_vector_legend)(this.visuals,e,t,i)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}i.MultiLineView=g,g.__name__="MultiLineView";class f extends d.Glyph{constructor(e){super(e)}}i.MultiLine=f,r=f,f.__name__="MultiLine",r.prototype.default_view=g,r.define((({})=>({xs:[h.XCoordinateSeqSpec,{field:"xs"}],ys:[h.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins(l.LineVector)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(181),l=e(179),c=e(184),h=e(12),_=e(12),u=e(48),d=(0,o.__importStar)(e(185)),p=(0,o.__importStar)(e(18)),m=e(72),g=e(11);class f extends l.GlyphView{_project_data(){}_index_data(e){const{min:t,max:i}=Math,{data_size:s}=this;for(let n=0;n<s;n++){const s=this._xs[n],o=this._ys[n];if(0==s.length||0==o.length){e.add_empty();continue}let r=1/0,a=-1/0,l=1/0,c=-1/0;for(let e=0,n=s.length;e<n;e++){const n=s[e][0],_=o[e][0];if(0!=n.length&&0!=_.length){const[e,s]=(0,h.minmax)(n),[o,u]=(0,h.minmax)(_);r=t(r,e),a=i(a,s),l=t(l,o),c=i(c,u)}}e.add_rect(r,l,a,c)}this._hole_index=this._index_hole_data()}_index_hole_data(){const{min:e,max:t}=Math,{data_size:i}=this,s=new a.SpatialIndex(i);for(let n=0;n<i;n++){const i=this._xs[n],o=this._ys[n];if(0==i.length||0==o.length){s.add_empty();continue}let r=1/0,a=-1/0,l=1/0,c=-1/0;for(let s=0,n=i.length;s<n;s++){const n=i[s],_=o[s];if(n.length>1&&_.length>1)for(let i=1,s=n.length;i<s;i++){const[s,o]=(0,h.minmax)(n[i]),[u,d]=(0,h.minmax)(_[i]);r=e(r,s),a=t(a,o),l=e(l,u),c=t(c,d)}}s.add_rect(r,l,a,c)}return s.finish(),s}_mask_data(){const{x_range:e,y_range:t}=this.renderer.plot_view.frame;return this.index.indices({x0:e.min,x1:e.max,y0:t.min,y1:t.max})}_render(e,t,i){if(this.visuals.fill.doit||this.visuals.line.doit){const{sxs:s,sys:n}=null!=i?i:this;for(const i of t){e.beginPath();const t=s[i],o=n[i],r=Math.min(t.length,o.length);for(let i=0;i<r;i++){const s=t[i],n=o[i],r=Math.min(s.length,n.length);for(let t=0;t<r;t++){const i=s[t],o=n[t],r=Math.min(i.length,o.length);for(let t=0;t<r;t++){const s=i[t],n=o[t];0==t?e.moveTo(s,n):e.lineTo(s,n)}e.closePath()}}this.visuals.fill.apply(e,i,"evenodd"),this.visuals.hatch.apply(e,i,"evenodd"),this.visuals.line.apply(e,i)}}}_hit_rect(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,o=[t,i,i,t],r=[s,s,n,n],[a,l]=this.renderer.xscale.r_invert(t,i),[c,h]=this.renderer.yscale.r_invert(s,n),_=this.index.indices({x0:a,x1:l,y0:c,y1:h}),u=[];for(const p of _){const e=this.sxs[p],t=this.sys[p];let i=!0;for(let s=0,n=e.length;s<n;s++){for(let n=0,a=e[s][0].length;n<a;n++){const a=e[s][0][n],l=t[s][0][n];if(!d.point_in_poly(a,l,o,r)){i=!1;break}}if(!i)break}i&&u.push(p)}return new m.Selection({indices:u})}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=this.index.indices({x0:s,y0:n,x1:s,y1:n}),r=this._hole_index.indices({x0:s,y0:n,x1:s,y1:n}),a=[];for(const l of o){const e=this.sxs[l],s=this.sys[l];for(let n=0,o=e.length;n<o;n++){const o=e[n].length;if(d.point_in_poly(t,i,e[n][0],s[n][0]))if(1==o)a.push(l);else if(r.get(l)){if(o>1){let r=!1;for(let a=1;a<o;a++){const o=e[n][a],l=s[n][a];if(d.point_in_poly(t,i,o,l)){r=!0;break}}r||a.push(l)}}else a.push(l)}}return new m.Selection({indices:a})}_get_snap_coord(e){return(0,_.sum)(e)/e.length}scenterxy(e,t,i){if(1==this.sxs[e].length)return[this._get_snap_coord(this.sxs[e][0][0]),this._get_snap_coord(this.sys[e][0][0])];{const s=this.sxs[e],n=this.sys[e];for(let e=0,o=s.length;e<o;e++)if(d.point_in_poly(t,i,s[e][0],n[e][0]))return[this._get_snap_coord(s[e][0]),this._get_snap_coord(n[e][0])]}(0,g.unreachable)()}map_data(){const e=this._xs.length;this.sxs=new Array(e),this.sys=new Array(e);for(let t=0;t<e;t++){const e=this._xs[t].length;this.sxs[t]=new Array(e),this.sys[t]=new Array(e);for(let i=0;i<e;i++){const e=this._xs[t][i].length;this.sxs[t][i]=new Array(e),this.sys[t][i]=new Array(e);for(let s=0;s<e;s++){const[e,n]=this.renderer.coordinates.map_to_screen(this._xs[t][i][s],this._ys[t][i][s]);this.sxs[t][i][s]=e,this.sys[t][i][s]=n}}}}draw_legend_for_index(e,t,i){(0,c.generic_area_vector_legend)(this.visuals,e,t,i)}}i.MultiPolygonsView=f,f.__name__="MultiPolygonsView";class b extends l.Glyph{constructor(e){super(e)}}i.MultiPolygons=b,r=b,b.__name__="MultiPolygons",r.prototype.default_view=f,r.define((({})=>({xs:[p.XCoordinateSeqSeqSeqSpec,{field:"xs"}],ys:[p.YCoordinateSeqSeqSeqSpec,{field:"ys"}]}))),r.mixins([u.LineVector,u.FillVector,u.HatchVector])},function(e,t,i,s,n){var o;s();const r=e(274),a=e(12);class l extends r.EllipseOvalView{_map_data(){super._map_data(),(0,a.mul)(this.sw,.75)}}i.OvalView=l,l.__name__="OvalView";class c extends r.EllipseOval{constructor(e){super(e)}}i.Oval=c,o=c,c.__name__="Oval",o.prototype.default_view=l},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(179),l=e(184),c=e(12),h=e(48),_=(0,o.__importStar)(e(185)),u=(0,o.__importStar)(e(18)),d=e(72),p=e(11),m=e(78);class g extends a.GlyphView{_project_data(){m.inplace.project_xy(this._xs.array,this._ys.array)}_index_data(e){const{data_size:t}=this;for(let i=0;i<t;i++){const t=this._xs.get(i),s=this._ys.get(i),[n,o,r,a]=(0,c.minmax2)(t,s);e.add_rect(n,r,o,a)}}_mask_data(){const{x_range:e,y_range:t}=this.renderer.plot_view.frame;return this.index.indices({x0:e.min,x1:e.max,y0:t.min,y1:t.max})}_render(e,t,i){const{sxs:s,sys:n}=null!=i?i:this;for(const o of t){const t=s.get(o),i=n.get(o);let r=!0;e.beginPath();const a=Math.min(t.length,i.length);for(let s=0;s<a;s++){const n=t[s],o=i[s];isFinite(n+o)?r?(e.moveTo(n,o),r=!1):e.lineTo(n,o):(e.closePath(),r=!0)}e.closePath(),this.visuals.fill.apply(e,o),this.visuals.hatch.apply(e,o),this.visuals.line.apply(e,o)}}_hit_rect(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,o=[t,i,i,t],r=[s,s,n,n],[a,l]=this.renderer.xscale.r_invert(t,i),[c,h]=this.renderer.yscale.r_invert(s,n),u=this.index.indices({x0:a,x1:l,y0:c,y1:h}),p=[];for(const d of u){const e=this.sxs.get(d),t=this.sys.get(d);let i=!0;for(let s=0,n=e.length;s<n;s++){const n=e[s],a=t[s];if(!_.point_in_poly(n,a,o,r)){i=!1;break}}i&&p.push(d)}return new d.Selection({indices:p})}_hit_point(e){const{sx:t,sy:i}=e,s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=this.index.indices({x0:s,y0:n,x1:s,y1:n}),r=[];for(const a of o){const e=this.sxs.get(a),s=this.sys.get(a),n=e.length;for(let o=0,l=0;;l++){if(isNaN(e[l])||l==n){const n=e.subarray(o,l),c=s.subarray(o,l);if(_.point_in_poly(t,i,n,c)){r.push(a);break}o=l+1}if(l==n)break}}return new d.Selection({indices:r})}_get_snap_coord(e){return(0,c.sum)(e)/e.length}scenterxy(e,t,i){const s=this.sxs.get(e),n=this.sys.get(e),o=s.length;let r=!1;for(let a=0,l=0;;l++){const e=isNaN(s[l]);if(r=r||e,l==o&&!r)return[this._get_snap_coord(s),this._get_snap_coord(n)];if(e||l==o){const e=s.subarray(a,l),o=n.subarray(a,l);if(_.point_in_poly(t,i,e,o))return[this._get_snap_coord(e),this._get_snap_coord(o)];a=l+1}if(l==o)break}(0,p.unreachable)()}draw_legend_for_index(e,t,i){(0,l.generic_area_vector_legend)(this.visuals,e,t,i)}}i.PatchesView=g,g.__name__="PatchesView";class f extends a.Glyph{constructor(e){super(e)}}i.Patches=f,r=f,f.__name__="Patches",r.prototype.default_view=g,r.define((({})=>({xs:[u.XCoordinateSeqSpec,{field:"xs"}],ys:[u.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins([h.LineVector,h.FillVector,h.HatchVector])},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(277),l=(0,o.__importStar)(e(18));class c extends a.BoxView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(427))));this.glglyph=new i(t.regl_wrapper,this)}}scenterxy(e){return[this.sleft[e]/2+this.sright[e]/2,this.stop[e]/2+this.sbottom[e]/2]}_lrtb(e){return[this._left[e],this._right[e],this._top[e],this._bottom[e]]}}i.QuadView=c,c.__name__="QuadView";class h extends a.Box{constructor(e){super(e)}}i.Quad=h,r=h,h.__name__="Quad",r.prototype.default_view=c,r.define((({})=>({right:[l.XCoordinateSpec,{field:"right"}],bottom:[l.YCoordinateSpec,{field:"bottom"}],left:[l.XCoordinateSpec,{field:"left"}],top:[l.YCoordinateSpec,{field:"top"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(48),l=e(78),c=e(179),h=e(184),_=(0,o.__importStar)(e(18));function u(e,t,i){if(t==(e+i)/2)return[e,i];{const s=(e-t)/(e-2*t+i),n=e*(1-s)**2+2*t*(1-s)*s+i*s**2;return[Math.min(e,i,n),Math.max(e,i,n)]}}class d extends c.GlyphView{_project_data(){l.inplace.project_xy(this._x0,this._y0),l.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{_x0:t,_x1:i,_y0:s,_y1:n,_cx:o,_cy:r,data_size:a}=this;for(let l=0;l<a;l++){const a=t[l],c=i[l],h=s[l],_=n[l],d=o[l],p=r[l];if(isFinite(a+c+h+_+d+p)){const[t,i]=u(a,d,c),[s,n]=u(h,p,_);e.add_rect(t,s,i,n)}else e.add_empty()}}_render(e,t,i){if(this.visuals.line.doit){const{sx0:s,sy0:n,sx1:o,sy1:r,scx:a,scy:l}=null!=i?i:this;for(const i of t){const t=s[i],c=n[i],h=o[i],_=r[i],u=a[i],d=l[i];isFinite(t+c+h+_+u+d)&&(e.beginPath(),e.moveTo(t,c),e.quadraticCurveTo(u,d,h,_),this.visuals.line.set_vectorize(e,i),e.stroke())}}}draw_legend_for_index(e,t,i){(0,h.generic_line_vector_legend)(this.visuals,e,t,i)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}i.QuadraticView=d,d.__name__="QuadraticView";class p extends c.Glyph{constructor(e){super(e)}}i.Quadratic=p,r=p,p.__name__="Quadratic",r.prototype.default_view=d,r.define((({})=>({x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}],cx:[_.XCoordinateSpec,{field:"cx"}],cy:[_.YCoordinateSpec,{field:"cy"}]}))),r.mixins(a.LineVector)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=e(48),h=e(24),_=(0,o.__importStar)(e(18));class u extends a.XYGlyphView{_map_data(){"data"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this.length):this.slength=(0,h.to_screen)(this.length);const{width:e,height:t}=this.renderer.plot_view.frame.bbox,i=2*(e+t),{slength:s}=this;for(let n=0,o=s.length;n<o;n++)0==s[n]&&(s[n]=i)}_render(e,t,i){const{sx:s,sy:n,slength:o,angle:r}=null!=i?i:this;if(this.visuals.line.doit)for(const a of t){const t=s[a],i=n[a],l=r.get(a),c=o[a];isFinite(t+i+l+c)&&(e.translate(t,i),e.rotate(l),e.beginPath(),e.moveTo(0,0),e.lineTo(c,0),this.visuals.line.set_vectorize(e,a),e.stroke(),e.rotate(-l),e.translate(-t,-i))}}draw_legend_for_index(e,t,i){(0,l.generic_line_vector_legend)(this.visuals,e,t,i)}}i.RayView=u,u.__name__="RayView";class d extends a.XYGlyph{constructor(e){super(e)}}i.Ray=d,r=d,d.__name__="Ray",r.prototype.default_view=u,r.mixins(c.LineVector),r.define((({})=>({length:[_.DistanceSpec,0],angle:[_.AngleSpec,0]})))},function(e,t,i,s,n){var o,r=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return a(t,e),t};s();const c=e(275),h=e(184),_=e(24),u=e(12),d=e(72);class p extends c.CenterRotatableView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null==t?void 0:t.regl_wrapper.has_webgl){const{RectGL:i}=await Promise.resolve().then((()=>l(e(429))));this.glglyph=new i(t.regl_wrapper,this)}}_map_data(){if("data"==this.model.properties.width.units)[this.sw,this.sx0]=this._map_dist_corner_for_data_side_length(this._x,this.width,this.renderer.xscale);else{this.sw=(0,_.to_screen)(this.width);const e=this.sx.length;this.sx0=new _.ScreenArray(e);for(let t=0;t<e;t++)this.sx0[t]=this.sx[t]-this.sw[t]/2}if("data"==this.model.properties.height.units)[this.sh,this.sy1]=this._map_dist_corner_for_data_side_length(this._y,this.height,this.renderer.yscale);else{this.sh=(0,_.to_screen)(this.height);const e=this.sy.length;this.sy1=new _.ScreenArray(e);for(let t=0;t<e;t++)this.sy1[t]=this.sy[t]-this.sh[t]/2}const e=this.sw.length;this.ssemi_diag=new _.ScreenArray(e);for(let t=0;t<e;t++)this.ssemi_diag[t]=Math.sqrt(this.sw[t]/2*this.sw[t]/2+this.sh[t]/2*this.sh[t]/2)}_render(e,t,i){const{sx:s,sy:n,sx0:o,sy1:r,sw:a,sh:l,angle:c}=null!=i?i:this;for(const h of t){const t=s[h],i=n[h],_=o[h],u=r[h],d=a[h],p=l[h],m=c.get(h);isFinite(t+i+_+u+d+p+m)&&0!=d&&0!=p&&(e.beginPath(),m?(e.translate(t,i),e.rotate(m),e.rect(-d/2,-p/2,d,p),e.rotate(-m),e.translate(-t,-i)):e.rect(_,u,d,p),this.visuals.fill.apply(e,h),this.visuals.hatch.apply(e,h),this.visuals.line.apply(e,h))}}_hit_rect(e){return this._hit_rect_against_index(e)}_hit_point(e){let{sx:t,sy:i}=e;const s=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(i),o=this.sx0.length,r=new _.ScreenArray(o);for(let _=0;_<o;_++)r[_]=this.sx0[_]+this.sw[_]/2;const a=new _.ScreenArray(o);for(let _=0;_<o;_++)a[_]=this.sy1[_]+this.sh[_]/2;const l=(0,u.max)(this._ddist(0,r,this.ssemi_diag)),c=(0,u.max)(this._ddist(1,a,this.ssemi_diag)),h=s-l,p=s+l,m=n-c,g=n+c;let f,b;const y=[];for(const _ of this.index.indices({x0:h,x1:p,y0:m,y1:g})){const e=this.angle.get(_);if(e){const s=Math.sin(-e),n=Math.cos(-e),o=n*(t-this.sx[_])-s*(i-this.sy[_])+this.sx[_],r=s*(t-this.sx[_])+n*(i-this.sy[_])+this.sy[_];t=o,i=r,f=Math.abs(this.sx[_]-t)<=this.sw[_]/2,b=Math.abs(this.sy[_]-i)<=this.sh[_]/2}else{const e=t-this.sx0[_],s=i-this.sy1[_];f=0<=e&&e<=this.sw[_],b=0<=s&&s<=this.sh[_]}f&&b&&y.push(_)}return new d.Selection({indices:y})}_map_dist_corner_for_data_side_length(e,t,i){const s=e.length,n=new Float64Array(s),o=new Float64Array(s);for(let h=0;h<s;h++){const i=e[h],s=t.get(h)/2;n[h]=i-s,o[h]=i+s}const r=i.v_compute(n),a=i.v_compute(o),l=this.sdist(i,n,t,"edge",this.model.dilate);let c=r;for(let h=0;h<s;h++){const e=r[h],t=a[h];if(!isNaN(e+t)&&e!=t){c=e<t?r:a;break}}return[l,c]}_ddist(e,t,i){const s=(0,_.infer_type)(t,i),n=0==e?this.renderer.xscale:this.renderer.yscale,o=t,r=o.length,a=new s(r);for(let _=0;_<r;_++)a[_]=o[_]+i[_];const l=n.v_invert(o),c=n.v_invert(a),h=l.length,u=new s(h);for(let _=0;_<h;_++)u[_]=Math.abs(c[_]-l[_]);return u}draw_legend_for_index(e,t,i){(0,h.generic_area_vector_legend)(this.visuals,e,t,i)}}i.RectView=p,p.__name__="RectView";class m extends c.CenterRotatable{constructor(e){super(e)}}i.Rect=m,o=m,m.__name__="Rect",o.prototype.default_view=p,o.define((({Boolean:e})=>({dilate:[e,!1]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(292),l=e(293),c=(0,o.__importStar)(e(18));class h extends a.MarkerView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{MultiMarkerGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(428))));this.glglyph=new i(t.regl_wrapper,this)}}_render(e,t,i){const{sx:s,sy:n,size:o,angle:r,marker:a}=null!=i?i:this;for(const c of t){const t=s[c],i=n[c],h=o.get(c),_=r.get(c),u=a.get(c);if(!isFinite(t+i+h+_)||null==u)continue;const d=h/2;e.beginPath(),e.translate(t,i),_&&e.rotate(_),l.marker_funcs[u](e,c,d,this.visuals),_&&e.rotate(-_),e.translate(-t,-i)}}draw_legend_for_index(e,{x0:t,x1:i,y0:s,y1:n},o){const r=o+1,a=this.marker.get(o),l=Object.assign(Object.assign({},this._get_legend_args({x0:t,x1:i,y0:s,y1:n},o)),{marker:new c.UniformScalar(a,r)});this._render(e,[o],l)}}i.ScatterView=h,h.__name__="ScatterView";class _ extends a.Marker{constructor(e){super(e)}}i.Scatter=_,r=_,_.__name__="Scatter",r.prototype.default_view=h,r.define((()=>({marker:[c.MarkerSpec,{value:"circle"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(48),c=(0,o.__importStar)(e(185)),h=(0,o.__importStar)(e(18)),_=e(9),u=e(72);class d extends a.XYGlyphView{_render(e,t,i){const{sx:s,sy:n,size:o,angle:r}=null!=i?i:this;for(const a of t){const t=s[a],i=n[a],l=o.get(a),c=r.get(a);if(!isFinite(t+i+l+c))continue;const h=l/2;e.beginPath(),e.translate(t,i),c&&e.rotate(c),this._render_one(e,a,h,this.visuals),c&&e.rotate(-c),e.translate(-t,-i)}}_mask_data(){const{x_target:e,y_target:t}=this.renderer.plot_view.frame,i=e.widen(this.max_size).map((e=>this.renderer.xscale.invert(e))),s=t.widen(this.max_size).map((e=>this.renderer.yscale.invert(e)));return this.index.indices({x0:i.start,x1:i.end,y0:s.start,y1:s.end})}_hit_point(e){const{sx:t,sy:i}=e,{max_size:s}=this,{hit_dilation:n}=this.model,o=t-s*n,r=t+s*n,[a,l]=this.renderer.xscale.r_invert(o,r),c=i-s*n,h=i+s*n,[_,d]=this.renderer.yscale.r_invert(c,h),p=this.index.indices({x0:a,x1:l,y0:_,y1:d}),m=[];for(const u of p){const e=this.size.get(u)/2*n;Math.abs(this.sx[u]-t)<=e&&Math.abs(this.sy[u]-i)<=e&&m.push(u)}return new u.Selection({indices:m})}_hit_span(e){const{sx:t,sy:i}=e,s=this.bounds(),n=this.max_size/2;let o,r,a,l;if("h"==e.direction){a=s.y0,l=s.y1;const e=t-n,i=t+n;[o,r]=this.renderer.xscale.r_invert(e,i)}else{o=s.x0,r=s.x1;const e=i-n,t=i+n;[a,l]=this.renderer.yscale.r_invert(e,t)}const c=[...this.index.indices({x0:o,x1:r,y0:a,y1:l})];return new u.Selection({indices:c})}_hit_rect(e){const{sx0:t,sx1:i,sy0:s,sy1:n}=e,[o,r]=this.renderer.xscale.r_invert(t,i),[a,l]=this.renderer.yscale.r_invert(s,n),c=[...this.index.indices({x0:o,x1:r,y0:a,y1:l})];return new u.Selection({indices:c})}_hit_poly(e){const{sx:t,sy:i}=e,s=(0,_.range)(0,this.sx.length),n=[];for(let o=0,r=s.length;o<r;o++){const e=s[o];c.point_in_poly(this.sx[o],this.sy[o],t,i)&&n.push(e)}return new u.Selection({indices:n})}_get_legend_args({x0:e,x1:t,y0:i,y1:s},n){const o=n+1,r=new Array(o),a=new Array(o);r[n]=(e+t)/2,a[n]=(i+s)/2;const l=.4*Math.min(Math.abs(t-e),Math.abs(s-i));return{sx:r,sy:a,size:new h.UniformScalar(l,o),angle:new h.UniformScalar(0,o)}}draw_legend_for_index(e,{x0:t,x1:i,y0:s,y1:n},o){const r=this._get_legend_args({x0:t,x1:i,y0:s,y1:n},o);this._render(e,[o],r)}}i.MarkerView=d,d.__name__="MarkerView";class p extends a.XYGlyph{constructor(e){super(e)}}i.Marker=p,r=p,p.__name__="Marker",r.mixins([l.LineVector,l.FillVector,l.HatchVector]),r.define((({Number:e})=>({size:[h.ScreenSizeSpec,{value:4}],angle:[h.AngleSpec,0],hit_dilation:[e,1]})))},function(e,t,i,s,n){s();const o=Math.sqrt(3),r=Math.sqrt(5),a=(r+1)/4,l=Math.sqrt((5-r)/8),c=(r-1)/4,h=Math.sqrt((5+r)/8);function _(e,t){e.rotate(Math.PI/4),d(e,t),e.rotate(-Math.PI/4)}function u(e,t){const i=t*o,s=i/3;e.moveTo(-i/2,-s),e.lineTo(0,0),e.lineTo(i/2,-s),e.lineTo(0,0),e.lineTo(0,t)}function d(e,t){e.moveTo(0,t),e.lineTo(0,-t),e.moveTo(-t,0),e.lineTo(t,0)}function p(e,t){e.moveTo(0,t),e.lineTo(t/1.5,0),e.lineTo(0,-t),e.lineTo(-t/1.5,0),e.closePath()}function m(e,t){const i=t*o,s=i/3;e.moveTo(-t,s),e.lineTo(t,s),e.lineTo(0,s-i),e.closePath()}function g(e,t,i,s){e.arc(0,0,i,0,2*Math.PI,!1),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}function f(e,t,i,s){p(e,i),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}function b(e,t,i,s){!function(e,t){e.beginPath(),e.arc(0,0,t/4,0,2*Math.PI,!1),e.closePath()}(e,i),s.line.set_vectorize(e,t),e.fillStyle=e.strokeStyle,e.fill()}function y(e,t,i,s){!function(e,t){const i=t/2,s=o*i;e.moveTo(t,0),e.lineTo(i,-s),e.lineTo(-i,-s),e.lineTo(-t,0),e.lineTo(-i,s),e.lineTo(i,s),e.closePath()}(e,i),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}function v(e,t,i,s){const n=2*i;e.rect(-i,-i,n,n),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}function x(e,t,i,s){!function(e,t){const i=Math.sqrt(5-2*r)*t;e.moveTo(0,-t),e.lineTo(i*c,i*h-t),e.lineTo(i*(1+c),i*h-t),e.lineTo(i*(1+c-a),i*(h+l)-t),e.lineTo(i*(1+2*c-a),i*(2*h+l)-t),e.lineTo(0,2*i*h-t),e.lineTo(-i*(1+2*c-a),i*(2*h+l)-t),e.lineTo(-i*(1+c-a),i*(h+l)-t),e.lineTo(-i*(1+c),i*h-t),e.lineTo(-i*c,i*h-t),e.closePath()}(e,i),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}function w(e,t,i,s){m(e,i),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)}i.marker_funcs={asterisk:function(e,t,i,s){d(e,i),_(e,i),s.line.apply(e,t)},circle:g,circle_cross:function(e,t,i,s){e.arc(0,0,i,0,2*Math.PI,!1),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),d(e,i),e.stroke())},circle_dot:function(e,t,i,s){g(e,t,i,s),b(e,t,i,s)},circle_y:function(e,t,i,s){e.arc(0,0,i,0,2*Math.PI,!1),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),u(e,i),e.stroke())},circle_x:function(e,t,i,s){e.arc(0,0,i,0,2*Math.PI,!1),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),_(e,i),e.stroke())},cross:function(e,t,i,s){d(e,i),s.line.apply(e,t)},diamond:f,diamond_dot:function(e,t,i,s){f(e,t,i,s),b(e,t,i,s)},diamond_cross:function(e,t,i,s){p(e,i),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),e.moveTo(0,i),e.lineTo(0,-i),e.moveTo(-i/1.5,0),e.lineTo(i/1.5,0),e.stroke())},dot:b,hex:y,hex_dot:function(e,t,i,s){y(e,t,i,s),b(e,t,i,s)},inverted_triangle:function(e,t,i,s){e.rotate(Math.PI),m(e,i),e.rotate(-Math.PI),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)},plus:function(e,t,i,s){const n=3*i/8,o=[n,n,i,i,n,n,-n,-n,-i,-i,-n,-n],r=[i,n,n,-n,-n,-i,-i,-n,-n,n,n,i];e.beginPath();for(let a=0;a<12;a++)e.lineTo(o[a],r[a]);e.closePath(),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)},square:v,square_cross:function(e,t,i,s){const n=2*i;e.rect(-i,-i,n,n),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),d(e,i),e.stroke())},square_dot:function(e,t,i,s){v(e,t,i,s),b(e,t,i,s)},square_pin:function(e,t,i,s){const n=3*i/8;e.moveTo(-i,-i),e.quadraticCurveTo(0,-n,i,-i),e.quadraticCurveTo(n,0,i,i),e.quadraticCurveTo(0,n,-i,i),e.quadraticCurveTo(-n,0,-i,-i),e.closePath(),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)},square_x:function(e,t,i,s){const n=2*i;e.rect(-i,-i,n,n),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.doit&&(s.line.set_vectorize(e,t),e.moveTo(-i,i),e.lineTo(i,-i),e.moveTo(-i,-i),e.lineTo(i,i),e.stroke())},star:x,star_dot:function(e,t,i,s){x(e,t,i,s),b(e,t,i,s)},triangle:w,triangle_dot:function(e,t,i,s){w(e,t,i,s),b(e,t,i,s)},triangle_pin:function(e,t,i,s){const n=i*o,r=n/3,a=3*r/8;e.moveTo(-i,r),e.quadraticCurveTo(0,a,i,r),e.quadraticCurveTo(o*a/2,a/2,0,r-n),e.quadraticCurveTo(-o*a/2,a/2,-i,r),e.closePath(),s.fill.apply(e,t),s.hatch.apply(e,t),s.line.apply(e,t)},dash:function(e,t,i,s){!function(e,t){e.moveTo(-t,0),e.lineTo(t,0)}(e,i),s.line.apply(e,t)},x:function(e,t,i,s){_(e,i),s.line.apply(e,t)},y:function(e,t,i,s){u(e,i),s.line.apply(e,t)}}},function(e,t,i,s,n){s();const o=e(1);var r;const a=(0,o.__importStar)(e(185)),l=(0,o.__importStar)(e(18)),c=e(48),h=e(78),_=e(179),u=e(184),d=e(72);class p extends _.GlyphView{_project_data(){h.inplace.project_xy(this._x0,this._y0),h.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{min:t,max:i}=Math,{_x0:s,_x1:n,_y0:o,_y1:r,data_size:a}=this;for(let l=0;l<a;l++){const a=s[l],c=n[l],h=o[l],_=r[l];e.add_rect(t(a,c),t(h,_),i(a,c),i(h,_))}}_render(e,t,i){if(this.visuals.line.doit){const{sx0:s,sy0:n,sx1:o,sy1:r}=null!=i?i:this;for(const i of t){const t=s[i],a=n[i],l=o[i],c=r[i];isFinite(t+a+l+c)&&(e.beginPath(),e.moveTo(t,a),e.lineTo(l,c),this.visuals.line.set_vectorize(e,i),e.stroke())}}}_hit_point(e){const{sx:t,sy:i}=e,s={x:t,y:i},[n,o]=this.renderer.xscale.r_invert(t-2,t+2),[r,l]=this.renderer.yscale.r_invert(i-2,i+2),c=this.index.indices({x0:n,y0:r,x1:o,y1:l}),h=[];for(const _ of c){const e=Math.max(2,this.line_width.get(_)/2)**2,t={x:this.sx0[_],y:this.sy0[_]},i={x:this.sx1[_],y:this.sy1[_]};a.dist_to_segment_squared(s,t,i)<e&&h.push(_)}return new d.Selection({indices:h})}_hit_span(e){const[t,i]=this.renderer.plot_view.frame.bbox.ranges,{sx:s,sy:n}=e;let o,r,a;"v"==e.direction?(a=this.renderer.yscale.invert(n),[o,r]=[this._y0,this._y1]):(a=this.renderer.xscale.invert(s),[o,r]=[this._x0,this._x1]);const l=[],[c,h]=this.renderer.xscale.r_invert(t.start,t.end),[_,u]=this.renderer.yscale.r_invert(i.start,i.end),p=this.index.indices({x0:c,y0:_,x1:h,y1:u});for(const d of p){(o[d]<=a&&a<=r[d]||r[d]<=a&&a<=o[d])&&l.push(d);const t=1.5+this.line_width.get(d)/2;o[d]==r[d]&&("h"==e.direction?Math.abs(this.sx0[d]-s)<=t&&l.push(d):Math.abs(this.sy0[d]-n)<=t&&l.push(d))}return new d.Selection({indices:l})}scenterxy(e){return[this.sx0[e]/2+this.sx1[e]/2,this.sy0[e]/2+this.sy1[e]/2]}draw_legend_for_index(e,t,i){(0,u.generic_line_vector_legend)(this.visuals,e,t,i)}}i.SegmentView=p,p.__name__="SegmentView";class m extends _.Glyph{constructor(e){super(e)}}i.Segment=m,r=m,m.__name__="Segment",r.prototype.default_view=p,r.define((({})=>({x0:[l.XCoordinateSpec,{field:"x0"}],y0:[l.YCoordinateSpec,{field:"y0"}],x1:[l.XCoordinateSpec,{field:"x1"}],y1:[l.YCoordinateSpec,{field:"y1"}]}))),r.mixins(c.LineVector)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=(0,o.__importStar)(e(48)),c=e(296);class h extends a.XYGlyphView{_set_data(){const{tension:e,closed:t}=this.model;[this._xt,this._yt]=(0,c.catmullrom_spline)(this._x,this._y,20,e,t)}_map_data(){const{x_scale:e,y_scale:t}=this.renderer.coordinates;this.sxt=e.v_compute(this._xt),this.syt=t.v_compute(this._yt)}_render(e,t,i){const{sxt:s,syt:n}=null!=i?i:this;let o=!0;e.beginPath();const r=s.length;for(let a=0;a<r;a++){const t=s[a],i=n[a];isFinite(t+i)?o?(e.moveTo(t,i),o=!1):e.lineTo(t,i):o=!0}this.visuals.line.set_value(e),e.stroke()}}i.SplineView=h,h.__name__="SplineView";class _ extends a.XYGlyph{constructor(e){super(e)}}i.Spline=_,r=_,_.__name__="Spline",r.prototype.default_view=h,r.mixins(l.LineScalar),r.define((({Boolean:e,Number:t})=>({tension:[t,.5],closed:[e,!1]})))},function(e,t,i,s,n){s();const o=e(24),r=e(11);i.catmullrom_spline=function(e,t,i=10,s=.5,n=!1){(0,r.assert)(e.length==t.length);const a=e.length,l=n?a+1:a,c=(0,o.infer_type)(e,t),h=new c(l+2),_=new c(l+2);h.set(e,1),_.set(t,1),n?(h[0]=e[a-1],_[0]=t[a-1],h[l]=e[0],_[l]=t[0],h[l+1]=e[1],_[l+1]=t[1]):(h[0]=e[0],_[0]=t[0],h[l+1]=e[a-1],_[l+1]=t[a-1]);const u=new c(4*(i+1));for(let o=0,r=0;o<=i;o++){const e=o/i,t=e**2,s=e*t;u[r++]=2*s-3*t+1,u[r++]=-2*s+3*t,u[r++]=s-2*t+e,u[r++]=s-t}const d=new c((l-1)*(i+1)),p=new c((l-1)*(i+1));for(let o=1,r=0;o<l;o++){const e=(h[o+1]-h[o-1])*s,t=(_[o+1]-_[o-1])*s,n=(h[o+2]-h[o])*s,a=(_[o+2]-_[o])*s;for(let s=0;s<=4*i;r++){const i=u[s++],l=u[s++],c=u[s++],m=u[s++];d[r]=i*h[o]+l*h[o+1]+c*e+m*n,p[r]=i*_[o]+l*_[o+1]+c*t+m*a}}return[d,p]}},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=(0,o.__importStar)(e(48)),h=e(20),_=e(11);class u extends a.XYGlyphView{_render(e,t,i){const{sx:s,sy:n}=null!=i?i:this;let o=!1,r=null;this.visuals.line.set_value(e);const a=t.length;if(!(a<2)){e.beginPath(),e.moveTo(s[0],n[0]);for(const i of t){let t,a,l,c;switch(this.model.mode){case"before":[t,l]=[s[i-1],n[i]],[a,c]=[s[i],n[i]];break;case"after":[t,l]=[s[i],n[i-1]],[a,c]=[s[i],n[i]];break;case"center":{const e=(s[i-1]+s[i])/2;[t,l]=[e,n[i-1]],[a,c]=[e,n[i]];break}default:(0,_.unreachable)()}if(o){if(!isFinite(s[i]+n[i])){e.stroke(),e.beginPath(),o=!1,r=i;continue}null!=r&&i-r>1&&(e.stroke(),o=!1)}o?(e.lineTo(t,l),e.lineTo(a,c)):(e.beginPath(),e.moveTo(s[i],n[i]),o=!0),r=i}e.lineTo(s[a-1],n[a-1]),e.stroke()}}draw_legend_for_index(e,t,i){(0,l.generic_line_scalar_legend)(this.visuals,e,t)}}i.StepView=u,u.__name__="StepView";class d extends a.XYGlyph{constructor(e){super(e)}}i.Step=d,r=d,d.__name__="Step",r.prototype.default_view=u,r.mixins(c.LineScalar),r.define((()=>({mode:[h.StepMode,"before"]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(48),c=(0,o.__importStar)(e(185)),h=(0,o.__importStar)(e(18)),_=e(121),u=e(11),d=e(72);class p extends a.XYGlyphView{_rotate_point(e,t,i,s,n){return[(e-i)*Math.cos(n)-(t-s)*Math.sin(n)+i,(e-i)*Math.sin(n)+(t-s)*Math.cos(n)+s]}_text_bounds(e,t,i,s){return[[e,e+i,e+i,e,e],[t,t,t-s,t-s,t]]}_render(e,t,i){const{sx:s,sy:n,x_offset:o,y_offset:r,angle:a,text:l}=null!=i?i:this;this._sys=[],this._sxs=[];for(const c of t){const t=this._sxs[c]=[],i=this._sys[c]=[],h=s[c],u=n[c],d=o.get(c),p=r.get(c),m=a.get(c),g=l.get(c);if(isFinite(h+u+d+p+m)&&null!=g&&this.visuals.text.doit){const s=`${g}`;e.save(),e.translate(h+d,u+p),e.rotate(m),this.visuals.text.set_vectorize(e,c);const n=this.visuals.text.font_value(c),{height:o}=(0,_.font_metrics)(n),r=this.text_line_height.get(c)*o;if(-1==s.indexOf("\n")){e.fillText(s,0,0);const n=h+d,o=u+p,a=e.measureText(s).width,[l,c]=this._text_bounds(n,o,a,r);t.push(l),i.push(c)}else{const n=s.split("\n"),o=r*n.length,a=this.text_baseline.get(c);let l;switch(a){case"top":l=0;break;case"middle":l=-o/2+r/2;break;case"bottom":l=-o+r;break;default:l=0,console.warn(`'${a}' baseline not supported with multi line text`)}for(const s of n){e.fillText(s,0,l);const n=h+d,o=l+u+p,a=e.measureText(s).width,[c,_]=this._text_bounds(n,o,a,r);t.push(c),i.push(_),l+=r}}e.restore()}}}_hit_point(e){const{sx:t,sy:i}=e,s=[];for(let n=0;n<this._sxs.length;n++){const e=this._sxs[n],o=this._sys[n],r=e.length;for(let a=0,l=r;a<l;a++){const[l,h]=this._rotate_point(t,i,e[r-1][0],o[r-1][0],-this.angle.get(n));c.point_in_poly(l,h,e[a],o[a])&&s.push(n)}}return new d.Selection({indices:s})}scenterxy(e){const t=this._sxs[e],i=this._sys[e];(0,u.assert)(0!=t.length&&0!=i.length);const s=t[0][0],n=i[0][0],o=(t[0][2]+s)/2,r=(i[0][2]+n)/2,[a,l]=this._rotate_point(o,r,s,n,this.angle.get(e));return[a,l]}}i.TextView=p,p.__name__="TextView";class m extends a.XYGlyph{constructor(e){super(e)}}i.Text=m,r=m,m.__name__="Text",r.prototype.default_view=p,r.mixins(l.TextVector),r.define((({})=>({text:[h.NullStringSpec,{field:"text"}],angle:[h.AngleSpec,0],x_offset:[h.NumberSpec,0],y_offset:[h.NumberSpec,0]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(277),l=e(24),c=(0,o.__importStar)(e(18));class h extends a.BoxView{async lazy_initialize(){await super.lazy_initialize();const{webgl:t}=this.renderer.plot_view.canvas_view;if(null!=t&&t.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>(0,o.__importStar)(e(427))));this.glglyph=new i(t.regl_wrapper,this)}}scenterxy(e){return[this.sx[e],(this.stop[e]+this.sbottom[e])/2]}_lrtb(e){const t=this.width.get(e)/2,i=this._x[e],s=this._top[e],n=this._bottom[e];return[i-t,i+t,Math.max(s,n),Math.min(s,n)]}_map_data(){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);const e=this.sx.length;this.sleft=new l.ScreenArray(e),this.sright=new l.ScreenArray(e);for(let t=0;t<e;t++)this.sleft[t]=this.sx[t]-this.sw[t]/2,this.sright[t]=this.sx[t]+this.sw[t]/2;this._clamp_viewport()}}i.VBarView=h,h.__name__="VBarView";class _ extends a.Box{constructor(e){super(e)}}i.VBar=_,r=_,_.__name__="VBar",r.prototype.default_view=h,r.define((({})=>({x:[c.XCoordinateSpec,{field:"x"}],bottom:[c.YCoordinateSpec,{value:0}],width:[c.NumberSpec,{value:1}],top:[c.YCoordinateSpec,{field:"top"}]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(178),l=e(184),c=e(48),h=e(24),_=e(20),u=(0,o.__importStar)(e(18)),d=e(10),p=e(72),m=e(12);class g extends a.XYGlyphView{_map_data(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,h.to_screen)(this.radius),this.max_sradius=(0,m.max)(this.sradius)}_render(e,t,i){const{sx:s,sy:n,sradius:o,start_angle:r,end_angle:a}=null!=i?i:this,l="anticlock"==this.model.direction;for(const c of t){const t=s[c],i=n[c],h=o[c],_=r.get(c),u=a.get(c);isFinite(t+i+h+_+u)&&(e.beginPath(),e.arc(t,i,h,_,u,l),e.lineTo(t,i),e.closePath(),this.visuals.fill.apply(e,c),this.visuals.hatch.apply(e,c),this.visuals.line.apply(e,c))}}_hit_point(e){let t,i,s,n,o;const{sx:r,sy:a}=e,l=this.renderer.xscale.invert(r),c=this.renderer.yscale.invert(a);i=r-this.max_sradius,s=r+this.max_sradius;const[h,_]=this.renderer.xscale.r_invert(i,s);n=a-this.max_sradius,o=a+this.max_sradius;const[u,m]=this.renderer.yscale.r_invert(n,o),g=[];for(const d of this.index.indices({x0:h,x1:_,y0:u,y1:m})){const e=this.sradius[d]**2;[i,s]=this.renderer.xscale.r_compute(l,this._x[d]),[n,o]=this.renderer.yscale.r_compute(c,this._y[d]),t=(i-s)**2+(n-o)**2,t<=e&&g.push(d)}const f="anticlock"==this.model.direction,b=[];for(const p of g){const e=Math.atan2(a-this.sy[p],r-this.sx[p]);(0,d.angle_between)(-e,-this.start_angle.get(p),-this.end_angle.get(p),f)&&b.push(p)}return new p.Selection({indices:b})}draw_legend_for_index(e,t,i){(0,l.generic_area_vector_legend)(this.visuals,e,t,i)}scenterxy(e){const t=this.sradius[e]/2,i=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+t*Math.cos(i),this.sy[e]+t*Math.sin(i)]}}i.WedgeView=g,g.__name__="WedgeView";class f extends a.XYGlyph{constructor(e){super(e)}}i.Wedge=f,r=f,f.__name__="Wedge",r.prototype.default_view=g,r.mixins([c.LineVector,c.FillVector,c.HatchVector]),r.define((({})=>({direction:[_.Direction,"anticlock"],radius:[u.DistanceSpec,{field:"radius"}],start_angle:[u.AngleSpec,{field:"start_angle"}],end_angle:[u.AngleSpec,{field:"end_angle"}]})))},function(e,t,i,s,n){s();const o=e(1);(0,o.__exportStar)(e(302),i),(0,o.__exportStar)(e(303),i),(0,o.__exportStar)(e(304),i)},function(e,t,i,s,n){s();const o=e(53),r=e(12),a=e(9),l=e(72);class c extends o.Model{constructor(e){super(e)}_hit_test(e,t,i){if(!t.model.visible)return null;const s=i.glyph.hit_test(e);return null==s?null:i.model.view.convert_selection_from_subset(s)}}i.GraphHitTestPolicy=c,c.__name__="GraphHitTestPolicy";class h extends c{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.edge_view)}do_selection(e,t,i,s){if(null==e)return!1;const n=t.edge_renderer.data_source.selected;return n.update(e,i,s),t.edge_renderer.data_source._select.emit(),!n.is_empty()}do_inspection(e,t,i,s,n){if(null==e)return!1;const{edge_renderer:o}=i.model,r=o.get_selection_manager().get_or_create_inspector(i.edge_view.model);return r.update(e,s,n),i.edge_view.model.data_source.setv({inspected:r},{silent:!0}),i.edge_view.model.data_source.inspect.emit([i.edge_view.model,{geometry:t}]),!r.is_empty()}}i.EdgesOnly=h,h.__name__="EdgesOnly";class _ extends c{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.node_view)}do_selection(e,t,i,s){if(null==e)return!1;const n=t.node_renderer.data_source.selected;return n.update(e,i,s),t.node_renderer.data_source._select.emit(),!n.is_empty()}do_inspection(e,t,i,s,n){if(null==e)return!1;const{node_renderer:o}=i.model,r=o.get_selection_manager().get_or_create_inspector(i.node_view.model);return r.update(e,s,n),i.node_view.model.data_source.setv({inspected:r},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view.model,{geometry:t}]),!r.is_empty()}}i.NodesOnly=_,_.__name__="NodesOnly";class u extends c{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.node_view)}get_linked_edges(e,t,i){let s=[];"selection"==i?s=e.selected.indices.map((t=>e.data.index[t])):"inspection"==i&&(s=e.inspected.indices.map((t=>e.data.index[t])));const n=[];for(let r=0;r<t.data.start.length;r++)((0,a.contains)(s,t.data.start[r])||(0,a.contains)(s,t.data.end[r]))&&n.push(r);const o=new l.Selection;for(const r of n)o.multiline_indices[r]=[0];return o.indices=n,o}do_selection(e,t,i,s){if(null==e)return!1;const n=t.node_renderer.data_source.selected;n.update(e,i,s);const o=t.edge_renderer.data_source.selected,r=this.get_linked_edges(t.node_renderer.data_source,t.edge_renderer.data_source,"selection");return o.update(r,i,s),t.node_renderer.data_source._select.emit(),!n.is_empty()}do_inspection(e,t,i,s,n){if(null==e)return!1;const o=i.node_view.model.data_source.selection_manager.get_or_create_inspector(i.node_view.model);o.update(e,s,n),i.node_view.model.data_source.setv({inspected:o},{silent:!0});const r=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 r.update(a,s,n),i.edge_view.model.data_source.setv({inspected:r},{silent:!0}),i.node_view.model.data_source.inspect.emit([i.node_view.model,{geometry:t}]),!o.is_empty()}}i.NodesAndLinkedEdges=u,u.__name__="NodesAndLinkedEdges";class d extends c{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.edge_view)}get_linked_nodes(e,t,i){let s=[];"selection"==i?s=t.selected.indices:"inspection"==i&&(s=t.inspected.indices);const n=[];for(const r of s)n.push(t.data.start[r]),n.push(t.data.end[r]);const o=(0,a.uniq)(n).map((t=>(0,r.indexOf)(e.data.index,t)));return new l.Selection({indices:o})}do_selection(e,t,i,s){if(null==e)return!1;const n=t.edge_renderer.data_source.selected;n.update(e,i,s);const o=t.node_renderer.data_source.selected,r=this.get_linked_nodes(t.node_renderer.data_source,t.edge_renderer.data_source,"selection");return o.update(r,i,s),t.edge_renderer.data_source._select.emit(),!n.is_empty()}do_inspection(e,t,i,s,n){if(null==e)return!1;const o=i.edge_view.model.data_source.selection_manager.get_or_create_inspector(i.edge_view.model);o.update(e,s,n),i.edge_view.model.data_source.setv({inspected:o},{silent:!0});const r=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 r.update(a,s,n),i.node_view.model.data_source.setv({inspected:r},{silent:!0}),i.edge_view.model.data_source.inspect.emit([i.edge_view.model,{geometry:t}]),!o.is_empty()}}i.EdgesAndLinkedNodes=d,d.__name__="EdgesAndLinkedNodes"},function(e,t,i,s,n){var o;s();const r=e(53),a=e(260);class l extends r.Model{constructor(e){super(e)}get node_coordinates(){return new h({layout:this})}get edge_coordinates(){return new _({layout:this})}}i.LayoutProvider=l,l.__name__="LayoutProvider";class c extends a.CoordinateTransform{constructor(e){super(e)}}i.GraphCoordinates=c,o=c,c.__name__="GraphCoordinates",o.define((({Ref:e})=>({layout:[e(l)]})));class h extends c{constructor(e){super(e)}_v_compute(e){const[t,i]=this.layout.get_node_coordinates(e);return{x:t,y:i}}}i.NodeCoordinates=h,h.__name__="NodeCoordinates";class _ extends c{constructor(e){super(e)}_v_compute(e){const[t,i]=this.layout.get_edge_coordinates(e);return{x:t,y:i}}}i.EdgeCoordinates=_,_.__name__="EdgeCoordinates"},function(e,t,i,s,n){var o;s();const r=e(303);class a extends r.LayoutProvider{constructor(e){super(e)}get_node_coordinates(e){var t;const i=null!==(t=e.data.index)&&void 0!==t?t:[],s=i.length,n=new Float64Array(s),o=new Float64Array(s);for(let r=0;r<s;r++){const e=this.graph_layout[i[r]],[t,s]=null!=e?e:[NaN,NaN];n[r]=t,o[r]=s}return[n,o]}get_edge_coordinates(e){var t,i;const s=null!==(t=e.data.start)&&void 0!==t?t:[],n=null!==(i=e.data.end)&&void 0!==i?i:[],o=Math.min(s.length,n.length),r=[],a=[],l=null!=e.data.xs&&null!=e.data.ys;for(let c=0;c<o;c++){const t=null!=this.graph_layout[s[c]]&&null!=this.graph_layout[n[c]];if(l&&t)r.push(e.data.xs[c]),a.push(e.data.ys[c]);else{let e,i;t?(e=this.graph_layout[s[c]],i=this.graph_layout[n[c]]):(e=[NaN,NaN],i=[NaN,NaN]),r.push([e[0],i[0]]),a.push([e[1],i[1]])}}return[r,a]}}i.StaticLayoutProvider=a,o=a,a.__name__="StaticLayoutProvider",o.define((({Number:e,Tuple:t,Dict:i})=>({graph_layout:[i(t(e,e)),{}]})))},function(e,t,i,s,n){s(),n("Grid",e(306).Grid)},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(127),l=e(129),c=e(130),h=(0,o.__importStar)(e(48)),_=e(8);class u extends l.GuideRendererView{_render(){const e=this.layer.ctx;e.save(),this._draw_regions(e),this._draw_minor_grids(e),this._draw_grids(e),e.restore()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_draw_regions(e){if(!this.visuals.band_fill.doit&&!this.visuals.band_hatch.doit)return;const[t,i]=this.grid_coords("major",!1);for(let s=0;s<t.length-1;s++){if(s%2!=1)continue;const[n,o]=this.coordinates.map_to_screen(t[s],i[s]),[r,a]=this.coordinates.map_to_screen(t[s+1],i[s+1]);e.beginPath(),e.rect(n[0],o[0],r[1]-n[0],a[1]-o[0]),this.visuals.band_fill.apply(e),this.visuals.band_hatch.apply(e)}}_draw_grids(e){if(!this.visuals.grid_line.doit)return;const[t,i]=this.grid_coords("major");this._draw_grid_helper(e,this.visuals.grid_line,t,i)}_draw_minor_grids(e){if(!this.visuals.minor_grid_line.doit)return;const[t,i]=this.grid_coords("minor");this._draw_grid_helper(e,this.visuals.minor_grid_line,t,i)}_draw_grid_helper(e,t,i,s){t.set_value(e),e.beginPath();for(let n=0;n<i.length;n++){const[t,o]=this.coordinates.map_to_screen(i[n],s[n]);e.moveTo(Math.round(t[0]),Math.round(o[0]));for(let i=1;i<t.length;i++)e.lineTo(Math.round(t[i]),Math.round(o[i]))}e.stroke()}ranges(){const e=this.model.dimension,t=(e+1)%2,{ranges:i}=this.coordinates;return[i[e],i[t]]}computed_bounds(){const[e]=this.ranges(),t=this.model.bounds,i=[e.min,e.max];let s,n;if((0,_.isArray)(t))s=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),s<i[0]&&(s=i[0]),n>i[1]&&(n=i[1]);else{[s,n]=i;for(const e of this.plot_view.axis_views)e.dimension==this.model.dimension&&e.model.x_range_name==this.model.x_range_name&&e.model.y_range_name==this.model.y_range_name&&([s,n]=e.computed_bounds)}return[s,n]}grid_coords(e,t=!0){const i=this.model.dimension,s=(i+1)%2,[n,o]=this.ranges();let[r,a]=this.computed_bounds();[r,a]=[Math.min(r,a),Math.max(r,a)];const l=[[],[]],c=this.model.get_ticker();if(null==c)return l;const h=c.get_ticks(r,a,n,o.min)[e],_=n.min,u=n.max,d=o.min,p=o.max;t||(h[0]!=_&&h.splice(0,0,_),h[h.length-1]!=u&&h.push(u));for(let m=0;m<h.length;m++){if((h[m]==_||h[m]==u)&&t)continue;const e=[],n=[],o=2;for(let t=0;t<o;t++){const i=d+(p-d)/(o-1)*t;e.push(h[m]),n.push(i)}l[i].push(e),l[s].push(n)}return l}}i.GridView=u,u.__name__="GridView";class d extends l.GuideRenderer{constructor(e){super(e)}get_ticker(){return null!=this.ticker?this.ticker:null!=this.axis?this.axis.ticker:null}}i.Grid=d,r=d,d.__name__="Grid",r.prototype.default_view=u,r.mixins([["grid_",h.Line],["minor_grid_",h.Line],["band_",h.Fill],["band_",h.Hatch]]),r.define((({Number:e,Auto:t,Enum:i,Ref:s,Tuple:n,Or:o,Nullable:r})=>({bounds:[o(n(e,e),t),"auto"],dimension:[i(0,1),0],axis:[r(s(a.Axis)),null],ticker:[r(s(c.Ticker)),null]}))),r.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},function(e,t,i,s,n){s(),n("Box",e(308).Box),n("Column",e(310).Column),n("GridBox",e(311).GridBox),n("HTMLBox",e(312).HTMLBox),n("LayoutDOM",e(309).LayoutDOM),n("Panel",e(313).Panel),n("Row",e(314).Row),n("Spacer",e(315).Spacer),n("Tabs",e(316).Tabs),n("WidgetBox",e(319).WidgetBox)},function(e,t,i,s,n){var o;s();const r=e(309);class a extends r.LayoutDOMView{connect_signals(){super.connect_signals(),this.connect(this.model.properties.children.change,(()=>this.rebuild()))}get child_models(){return this.model.children}}i.BoxView=a,a.__name__="BoxView";class l extends r.LayoutDOM{constructor(e){super(e)}}i.Box=l,o=l,l.__name__="Box",o.define((({Number:e,Array:t,Ref:i})=>({children:[t(i(r.LayoutDOM)),[]],spacing:[e,0]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(20),l=e(43),c=e(19),h=e(8),_=e(22),u=e(121),d=e(113),p=e(226),m=e(207),g=e(44),f=e(235);class b extends p.DOMView{constructor(){super(...arguments),this._offset_parent=null,this._viewport={}}get is_layout_root(){return this.is_root||!(this.parent instanceof b)}get base_font_size(){const e=getComputedStyle(this.el).fontSize,t=(0,u.parse_css_font_size)(e);if(null!=t){const{value:e,unit:i}=t;if("px"==i)return e}return null}initialize(){super.initialize(),this.el.style.position=this.is_layout_root?"relative":"absolute",this._child_views=new Map}async lazy_initialize(){await super.lazy_initialize(),await this.build_child_views()}remove(){for(const e of this.child_views)e.remove();this._child_views.clear(),super.remove()}connect_signals(){super.connect_signals(),this.is_layout_root&&(this._on_resize=()=>this.resize_layout(),window.addEventListener("resize",this._on_resize),this._parent_observer=setInterval((()=>{const e=this.el.offsetParent;this._offset_parent!=e&&(this._offset_parent=e,null!=e&&(this.compute_viewport(),this.invalidate_layout()))}),250));const e=this.model.properties;this.on_change([e.width,e.height,e.min_width,e.min_height,e.max_width,e.max_height,e.margin,e.width_policy,e.height_policy,e.sizing_mode,e.aspect_ratio,e.visible],(()=>this.invalidate_layout())),this.on_change([e.background,e.css_classes],(()=>this.invalidate_render()))}disconnect_signals(){null!=this._parent_observer&&clearTimeout(this._parent_observer),null!=this._on_resize&&window.removeEventListener("resize",this._on_resize),super.disconnect_signals()}css_classes(){return super.css_classes().concat(this.model.css_classes)}get child_views(){return this.child_models.map((e=>this._child_views.get(e)))}async build_child_views(){await(0,d.build_views)(this._child_views,this.child_models,{parent:this})}render(){super.render(),(0,l.empty)(this.el);const{background:e}=this.model;this.el.style.backgroundColor=null!=e?(0,_.color2css)(e):"",(0,l.classes)(this.el).clear().add(...this.css_classes());for(const t of this.child_views)this.el.appendChild(t.el),t.render()}update_layout(){for(const e of this.child_views)e.update_layout();this._update_layout()}update_position(){this.el.style.display=this.model.visible?"block":"none";const e=this.is_layout_root?this.layout.sizing.margin:void 0;(0,l.position)(this.el,this.layout.bbox,e);for(const t of this.child_views)t.update_position()}after_layout(){for(const e of this.child_views)e.after_layout();this._has_finished=!0}compute_viewport(){this._viewport=this._viewport_size()}renderTo(e){e.appendChild(this.el),this._offset_parent=this.el.offsetParent,this.compute_viewport(),this.build(),this.notify_finished()}build(){if(!this.is_layout_root)throw new Error(`${this.toString()} is not a root layout`);return this.render(),this.update_layout(),this.compute_layout(),this}async rebuild(){await this.build_child_views(),this.invalidate_render()}compute_layout(){const e=Date.now();this.layout.compute(this._viewport),this.update_position(),this.after_layout(),c.logger.debug(`layout computed in ${Date.now()-e} ms`)}resize_layout(){this.root.compute_viewport(),this.root.compute_layout()}invalidate_layout(){this.root.update_layout(),this.root.compute_layout()}invalidate_render(){this.render(),this.invalidate_layout()}has_finished(){if(!super.has_finished())return!1;for(const e of this.child_views)if(!e.has_finished())return!1;return!0}_width_policy(){return null!=this.model.width?"fixed":"fit"}_height_policy(){return null!=this.model.height?"fixed":"fit"}box_sizing(){let{width_policy:e,height_policy:t,aspect_ratio:i}=this.model;"auto"==e&&(e=this._width_policy()),"auto"==t&&(t=this._height_policy());const{sizing_mode:s}=this.model;if(null!=s)if("fixed"==s)e=t="fixed";else if("stretch_both"==s)e=t="max";else if("stretch_width"==s)e="max";else if("stretch_height"==s)t="max";else switch(null==i&&(i="auto"),s){case"scale_width":e="max",t="min";break;case"scale_height":e="min",t="max";break;case"scale_both":e="max",t="max"}const n={width_policy:e,height_policy:t},{min_width:o,min_height:r}=this.model;null!=o&&(n.min_width=o),null!=r&&(n.min_height=r);const{width:a,height:l}=this.model;null!=a&&(n.width=a),null!=l&&(n.height=l);const{max_width:c,max_height:_}=this.model;null!=c&&(n.max_width=c),null!=_&&(n.max_height=_),"auto"==i&&null!=a&&null!=l?n.aspect=a/l:(0,h.isNumber)(i)&&(n.aspect=i);const{margin:u}=this.model;if(null!=u)if((0,h.isNumber)(u))n.margin={top:u,right:u,bottom:u,left:u};else if(2==u.length){const[e,t]=u;n.margin={top:e,right:t,bottom:e,left:t}}else{const[e,t,i,s]=u;n.margin={top:e,right:t,bottom:i,left:s}}n.visible=this.model.visible;const{align:d}=this.model;return(0,h.isArray)(d)?[n.halign,n.valign]=d:n.halign=n.valign=d,n}_viewport_size(){return(0,l.undisplayed)(this.el,(()=>{let e=this.el;for(;e=e.parentElement;){if(e.classList.contains(g.root))continue;if(e==document.body){const{margin:{left:e,right:t,top:i,bottom:s}}=(0,l.extents)(document.body);return{width:Math.ceil(document.documentElement.clientWidth-e-t),height:Math.ceil(document.documentElement.clientHeight-i-s)}}const{padding:{left:t,right:i,top:s,bottom:n}}=(0,l.extents)(e),{width:o,height:r}=e.getBoundingClientRect(),a=Math.ceil(o-t-i),c=Math.ceil(r-s-n);if(a>0||c>0)return{width:a>0?a:void 0,height:c>0?c:void 0}}return{}}))}export(e,t=!0){const i="png"==e?"canvas":"svg",s=new f.CanvasLayer(i,t),{width:n,height:o}=this.layout.bbox;s.resize(n,o);for(const r of this.child_views){const i=r.export(e,t),{x:n,y:o}=r.layout.bbox;s.ctx.drawImage(i.canvas,n,o)}return s}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.layout.bbox.box,children:this.child_views.map((e=>e.serializable_state()))})}}i.LayoutDOMView=b,b.__name__="LayoutDOMView";class y extends r.Model{constructor(e){super(e)}}i.LayoutDOM=y,o=y,y.__name__="LayoutDOM",o.define((e=>{const{Boolean:t,Number:i,String:s,Auto:n,Color:o,Array:r,Tuple:l,Or:c,Null:h,Nullable:_}=e,u=l(i,i),d=l(i,i,i,i);return{width:[_(i),null],height:[_(i),null],min_width:[_(i),null],min_height:[_(i),null],max_width:[_(i),null],max_height:[_(i),null],margin:[_(c(i,u,d)),[0,0,0,0]],width_policy:[c(m.SizingPolicy,n),"auto"],height_policy:[c(m.SizingPolicy,n),"auto"],aspect_ratio:[c(i,n,h),null],sizing_mode:[_(a.SizingMode),null],visible:[t,!0],disabled:[t,!1],align:[c(a.Align,l(a.Align,a.Align)),"start"],background:[_(o),null],css_classes:[r(s),[]]}}))},function(e,t,i,s,n){var o;s();const r=e(308),a=e(209);class l extends r.BoxView{_update_layout(){const e=this.child_views.map((e=>e.layout));this.layout=new a.Column(e),this.layout.rows=this.model.rows,this.layout.spacing=[this.model.spacing,0],this.layout.set_sizing(this.box_sizing())}}i.ColumnView=l,l.__name__="ColumnView";class c extends r.Box{constructor(e){super(e)}}i.Column=c,o=c,c.__name__="Column",o.prototype.default_view=l,o.define((({Any:e})=>({rows:[e,"auto"]})))},function(e,t,i,s,n){var o;s();const r=e(309),a=e(209);class l extends r.LayoutDOMView{connect_signals(){super.connect_signals();const{children:e,rows:t,cols:i,spacing:s}=this.model.properties;this.on_change([e,t,i,s],(()=>this.rebuild()))}get child_models(){return this.model.children.map((([e])=>e))}_update_layout(){this.layout=new a.Grid,this.layout.rows=this.model.rows,this.layout.cols=this.model.cols,this.layout.spacing=this.model.spacing;for(const[e,t,i,s,n]of this.model.children){const o=this._child_views.get(e);this.layout.items.push({layout:o.layout,row:t,col:i,row_span:s,col_span:n})}this.layout.set_sizing(this.box_sizing())}}i.GridBoxView=l,l.__name__="GridBoxView";class c extends r.LayoutDOM{constructor(e){super(e)}}i.GridBox=c,o=c,c.__name__="GridBox",o.prototype.default_view=l,o.define((({Any:e,Int:t,Number:i,Tuple:s,Array:n,Ref:o,Or:a,Opt:l})=>({children:[n(s(o(r.LayoutDOM),t,t,l(t),l(t))),[]],rows:[e,"auto"],cols:[e,"auto"],spacing:[a(i,s(i,i)),0]})))},function(e,t,i,s,n){s();const o=e(309),r=e(207);class a extends o.LayoutDOMView{get child_models(){return[]}_update_layout(){this.layout=new r.ContentBox(this.el),this.layout.set_sizing(this.box_sizing())}}i.HTMLBoxView=a,a.__name__="HTMLBoxView";class l extends o.LayoutDOM{constructor(e){super(e)}}i.HTMLBox=l,l.__name__="HTMLBox"},function(e,t,i,s,n){var o;s();const r=e(53),a=e(309);class l extends r.Model{constructor(e){super(e)}}i.Panel=l,o=l,l.__name__="Panel",o.define((({Boolean:e,String:t,Ref:i})=>({title:[t,""],child:[i(a.LayoutDOM)],closable:[e,!1],disabled:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(308),a=e(209);class l extends r.BoxView{_update_layout(){const e=this.child_views.map((e=>e.layout));this.layout=new a.Row(e),this.layout.cols=this.model.cols,this.layout.spacing=[0,this.model.spacing],this.layout.set_sizing(this.box_sizing())}}i.RowView=l,l.__name__="RowView";class c extends r.Box{constructor(e){super(e)}}i.Row=c,o=c,c.__name__="Row",o.prototype.default_view=l,o.define((({Any:e})=>({cols:[e,"auto"]})))},function(e,t,i,s,n){var o;s();const r=e(309),a=e(207);class l extends r.LayoutDOMView{get child_models(){return[]}_update_layout(){this.layout=new a.LayoutItem,this.layout.set_sizing(this.box_sizing())}}i.SpacerView=l,l.__name__="SpacerView";class c extends r.LayoutDOM{constructor(e){super(e)}}i.Spacer=c,o=c,c.__name__="Spacer",o.prototype.default_view=l},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(207),l=e(43),c=e(9),h=e(10),_=e(20),u=e(309),d=e(313),p=(0,o.__importStar)(e(317)),m=p,g=(0,o.__importStar)(e(318)),f=g,b=(0,o.__importStar)(e(229)),y=b;class v extends u.LayoutDOMView{constructor(){super(...arguments),this._scroll_index=0}connect_signals(){super.connect_signals(),this.connect(this.model.properties.tabs.change,(()=>this.rebuild())),this.connect(this.model.properties.active.change,(()=>this.on_active_change()))}styles(){return[...super.styles(),g.default,b.default,p.default]}get child_models(){return this.model.tabs.map((e=>e.child))}_update_layout(){const e=this.model.tabs_location,t="above"==e||"below"==e,{scroll_el:i,headers_el:s}=this;this.header=new class extends a.ContentBox{_measure(e){const n=(0,l.size)(i),o=(0,l.children)(s).slice(0,3).map((e=>(0,l.size)(e))),{width:r,height:a}=super._measure(e);if(t){const t=n.width+(0,c.sum)(o.map((e=>e.width)));return{width:e.width!=1/0?e.width:t,height:a}}{const t=n.height+(0,c.sum)(o.map((e=>e.height)));return{width:r,height:e.height!=1/0?e.height:t}}}}(this.header_el),t?this.header.set_sizing({width_policy:"fit",height_policy:"fixed"}):this.header.set_sizing({width_policy:"fixed",height_policy:"fit"});let n=1,o=1;switch(e){case"above":n-=1;break;case"below":n+=1;break;case"left":o-=1;break;case"right":o+=1}const r={layout:this.header,row:n,col:o},h=this.child_views.map((e=>({layout:e.layout,row:1,col:1})));this.layout=new a.Grid([r,...h]),this.layout.set_sizing(this.box_sizing())}update_position(){super.update_position(),this.header_el.style.position="absolute",(0,l.position)(this.header_el,this.header.bbox);const e=this.model.tabs_location,t="above"==e||"below"==e,i=(0,l.size)(this.scroll_el),s=(0,l.scroll_size)(this.headers_el);if(t){const{width:e}=this.header.bbox;s.width>e?(this.wrapper_el.style.maxWidth=e-i.width+"px",(0,l.display)(this.scroll_el),this.do_scroll(this.model.active)):(this.wrapper_el.style.maxWidth="",(0,l.undisplay)(this.scroll_el))}else{const{height:e}=this.header.bbox;s.height>e?(this.wrapper_el.style.maxHeight=e-i.height+"px",(0,l.display)(this.scroll_el),this.do_scroll(this.model.active)):(this.wrapper_el.style.maxHeight="",(0,l.undisplay)(this.scroll_el))}const{child_views:n}=this;for(const r of n)(0,l.hide)(r.el);const o=n[this.model.active];null!=o&&(0,l.show)(o.el)}render(){super.render();const{active:e}=this.model,t=this.model.tabs.map(((t,i)=>{const s=(0,l.div)({class:[m.tab,i==e?m.active:null]},t.title);if(s.addEventListener("click",(e=>{this.model.disabled||e.target==e.currentTarget&&this.change_active(i)})),t.closable){const e=(0,l.div)({class:m.close});e.addEventListener("click",(e=>{if(e.target==e.currentTarget){this.model.tabs=(0,c.remove_at)(this.model.tabs,i);const e=this.model.tabs.length;this.model.active>e-1&&(this.model.active=e-1)}})),s.appendChild(e)}return(this.model.disabled||t.disabled)&&s.classList.add(m.disabled),s}));this.headers_el=(0,l.div)({class:[m.headers]},t),this.wrapper_el=(0,l.div)({class:m.headers_wrapper},this.headers_el),this.left_el=(0,l.div)({class:[f.btn,f.btn_default],disabled:""},(0,l.div)({class:[y.caret,m.left]})),this.right_el=(0,l.div)({class:[f.btn,f.btn_default]},(0,l.div)({class:[y.caret,m.right]})),this.left_el.addEventListener("click",(()=>this.do_scroll("left"))),this.right_el.addEventListener("click",(()=>this.do_scroll("right"))),this.scroll_el=(0,l.div)({class:f.btn_group},this.left_el,this.right_el);const i=this.model.tabs_location;this.header_el=(0,l.div)({class:[m.tabs_header,m[i]]},this.scroll_el,this.wrapper_el),this.el.appendChild(this.header_el)}do_scroll(e){const t=this.model.tabs.length;"left"==e?this._scroll_index-=1:"right"==e?this._scroll_index+=1:this._scroll_index=e,this._scroll_index=(0,h.clamp)(this._scroll_index,0,t-1),0==this._scroll_index?this.left_el.setAttribute("disabled",""):this.left_el.removeAttribute("disabled"),this._scroll_index==t-1?this.right_el.setAttribute("disabled",""):this.right_el.removeAttribute("disabled");const i=(0,l.children)(this.headers_el).slice(0,this._scroll_index).map((e=>e.getBoundingClientRect())),s=this.model.tabs_location;if("above"==s||"below"==s){const e=-(0,c.sum)(i.map((e=>e.width)));this.headers_el.style.left=`${e}px`}else{const e=-(0,c.sum)(i.map((e=>e.height)));this.headers_el.style.top=`${e}px`}}change_active(e){e!=this.model.active&&(this.model.active=e)}on_active_change(){const e=this.model.active,t=(0,l.children)(this.headers_el);for(const s of t)s.classList.remove(m.active);t[e].classList.add(m.active);const{child_views:i}=this;for(const s of i)(0,l.hide)(s.el);(0,l.show)(i[e].el)}}i.TabsView=v,v.__name__="TabsView";class x extends u.LayoutDOM{constructor(e){super(e)}}i.Tabs=x,r=x,x.__name__="Tabs",r.prototype.default_view=v,r.define((({Int:e,Array:t,Ref:i})=>({tabs:[t(i(d.Panel)),[]],tabs_location:[_.Location,"above"],active:[e,0]})))},function(e,t,i,s,n){s(),i.root="bk-root",i.tabs_header="bk-tabs-header",i.btn_group="bk-btn-group",i.btn="bk-btn",i.headers_wrapper="bk-headers-wrapper",i.above="bk-above",i.right="bk-right",i.below="bk-below",i.left="bk-left",i.headers="bk-headers",i.tab="bk-tab",i.active="bk-active",i.close="bk-close",i.disabled="bk-disabled",i.default='.bk-root .bk-tabs-header{display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-tabs-header .bk-btn-group{height:auto;margin-right:5px;}.bk-root .bk-tabs-header .bk-btn-group > .bk-btn{flex-grow:0;height:auto;padding:4px 4px;}.bk-root .bk-tabs-header .bk-headers-wrapper{flex-grow:1;overflow:hidden;color:#666666;}.bk-root .bk-tabs-header.bk-above .bk-headers-wrapper{border-bottom:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-right .bk-headers-wrapper{border-left:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-below .bk-headers-wrapper{border-top:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-left .bk-headers-wrapper{border-right:1px solid #e6e6e6;}.bk-root .bk-tabs-header.bk-above,.bk-root .bk-tabs-header.bk-below{flex-direction:row;}.bk-root .bk-tabs-header.bk-above .bk-headers,.bk-root .bk-tabs-header.bk-below .bk-headers{flex-direction:row;}.bk-root .bk-tabs-header.bk-left,.bk-root .bk-tabs-header.bk-right{flex-direction:column;}.bk-root .bk-tabs-header.bk-left .bk-headers,.bk-root .bk-tabs-header.bk-right .bk-headers{flex-direction:column;}.bk-root .bk-tabs-header .bk-headers{position:relative;display:flex;flex-wrap:nowrap;align-items:center;}.bk-root .bk-tabs-header .bk-tab{padding:4px 8px;border:solid transparent;white-space:nowrap;cursor:pointer;}.bk-root .bk-tabs-header .bk-tab:hover{background-color:#f2f2f2;}.bk-root .bk-tabs-header .bk-tab.bk-active{color:#4d4d4d;background-color:white;border-color:#e6e6e6;}.bk-root .bk-tabs-header .bk-tab .bk-close{margin-left:10px;}.bk-root .bk-tabs-header .bk-tab.bk-disabled{cursor:not-allowed;pointer-events:none;opacity:0.65;}.bk-root .bk-tabs-header.bk-above .bk-tab{border-width:3px 1px 0px 1px;border-radius:4px 4px 0 0;}.bk-root .bk-tabs-header.bk-right .bk-tab{border-width:1px 3px 1px 0px;border-radius:0 4px 4px 0;}.bk-root .bk-tabs-header.bk-below .bk-tab{border-width:0px 1px 3px 1px;border-radius:0 0 4px 4px;}.bk-root .bk-tabs-header.bk-left .bk-tab{border-width:1px 0px 1px 3px;border-radius:4px 0 0 4px;}.bk-root .bk-close{display:inline-block;width:10px;height:10px;vertical-align:middle;background-image:url(\'data:image/svg+xml;utf8, <svg viewPort="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg"> <line x1="1" y1="9" x2="9" y2="1" stroke="gray" stroke-width="2"/> <line x1="1" y1="1" x2="9" y2="9" stroke="gray" stroke-width="2"/> </svg>\');}.bk-root .bk-close:hover{background-image:url(\'data:image/svg+xml;utf8, <svg viewPort="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg"> <line x1="1" y1="9" x2="9" y2="1" stroke="red" stroke-width="2"/> <line x1="1" y1="1" x2="9" y2="9" stroke="red" stroke-width="2"/> </svg>\');}'},function(e,t,i,s,n){s(),i.root="bk-root",i.btn="bk-btn",i.active="bk-active",i.btn_default="bk-btn-default",i.btn_primary="bk-btn-primary",i.btn_success="bk-btn-success",i.btn_warning="bk-btn-warning",i.btn_danger="bk-btn-danger",i.btn_light="bk-btn-light",i.btn_group="bk-btn-group",i.vertical="bk-vertical",i.horizontal="bk-horizontal",i.dropdown_toggle="bk-dropdown-toggle",i.default=".bk-root .bk-btn{height:100%;display:inline-block;text-align:center;vertical-align:middle;white-space:nowrap;cursor:pointer;padding:6px 12px;font-size:12px;border:1px solid transparent;border-radius:4px;outline:0;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;}.bk-root .bk-btn:hover,.bk-root .bk-btn:focus{text-decoration:none;}.bk-root .bk-btn:active,.bk-root .bk-btn.bk-active{background-image:none;box-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);}.bk-root .bk-btn[disabled]{cursor:not-allowed;pointer-events:none;opacity:0.65;box-shadow:none;}.bk-root .bk-btn-default{color:#333;background-color:#fff;border-color:#ccc;}.bk-root .bk-btn-default:hover{background-color:#f5f5f5;border-color:#b8b8b8;}.bk-root .bk-btn-default.bk-active{background-color:#ebebeb;border-color:#adadad;}.bk-root .bk-btn-default[disabled],.bk-root .bk-btn-default[disabled]:hover,.bk-root .bk-btn-default[disabled]:focus,.bk-root .bk-btn-default[disabled]:active,.bk-root .bk-btn-default[disabled].bk-active{background-color:#e6e6e6;border-color:#ccc;}.bk-root .bk-btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd;}.bk-root .bk-btn-primary:hover{background-color:#3681c1;border-color:#2c699e;}.bk-root .bk-btn-primary.bk-active{background-color:#3276b1;border-color:#285e8e;}.bk-root .bk-btn-primary[disabled],.bk-root .bk-btn-primary[disabled]:hover,.bk-root .bk-btn-primary[disabled]:focus,.bk-root .bk-btn-primary[disabled]:active,.bk-root .bk-btn-primary[disabled].bk-active{background-color:#506f89;border-color:#357ebd;}.bk-root .bk-btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c;}.bk-root .bk-btn-success:hover{background-color:#4eb24e;border-color:#409240;}.bk-root .bk-btn-success.bk-active{background-color:#47a447;border-color:#398439;}.bk-root .bk-btn-success[disabled],.bk-root .bk-btn-success[disabled]:hover,.bk-root .bk-btn-success[disabled]:focus,.bk-root .bk-btn-success[disabled]:active,.bk-root .bk-btn-success[disabled].bk-active{background-color:#667b66;border-color:#4cae4c;}.bk-root .bk-btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236;}.bk-root .bk-btn-warning:hover{background-color:#eea43b;border-color:#e89014;}.bk-root .bk-btn-warning.bk-active{background-color:#ed9c28;border-color:#d58512;}.bk-root .bk-btn-warning[disabled],.bk-root .bk-btn-warning[disabled]:hover,.bk-root .bk-btn-warning[disabled]:focus,.bk-root .bk-btn-warning[disabled]:active,.bk-root .bk-btn-warning[disabled].bk-active{background-color:#c89143;border-color:#eea236;}.bk-root .bk-btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a;}.bk-root .bk-btn-danger:hover{background-color:#d5433e;border-color:#bd2d29;}.bk-root .bk-btn-danger.bk-active{background-color:#d2322d;border-color:#ac2925;}.bk-root .bk-btn-danger[disabled],.bk-root .bk-btn-danger[disabled]:hover,.bk-root .bk-btn-danger[disabled]:focus,.bk-root .bk-btn-danger[disabled]:active,.bk-root .bk-btn-danger[disabled].bk-active{background-color:#a55350;border-color:#d43f3a;}.bk-root .bk-btn-light{color:#333;background-color:#fff;border-color:#ccc;border-color:transparent;}.bk-root .bk-btn-light:hover{background-color:#f5f5f5;border-color:#b8b8b8;}.bk-root .bk-btn-light.bk-active{background-color:#ebebeb;border-color:#adadad;}.bk-root .bk-btn-light[disabled],.bk-root .bk-btn-light[disabled]:hover,.bk-root .bk-btn-light[disabled]:focus,.bk-root .bk-btn-light[disabled]:active,.bk-root .bk-btn-light[disabled].bk-active{background-color:#e6e6e6;border-color:#ccc;}.bk-root .bk-btn-group{height:100%;display:flex;flex-wrap:nowrap;align-items:center;}.bk-root .bk-btn-group:not(.bk-vertical),.bk-root .bk-btn-group.bk-horizontal{flex-direction:row;}.bk-root .bk-btn-group.bk-vertical{flex-direction:column;}.bk-root .bk-btn-group > .bk-btn{flex-grow:1;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn + .bk-btn{margin-left:-1px;}.bk-root .bk-btn-group.bk-vertical > .bk-btn + .bk-btn{margin-top:-1px;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;}.bk-root .bk-btn-group:not(.bk-vertical) > .bk-btn:not(:first-child):last-child{border-bottom-left-radius:0;border-top-left-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn:not(:first-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}.bk-root .bk-btn-group > .bk-btn:not(:first-child):not(:last-child){border-radius:0;}.bk-root .bk-btn-group.bk-vertical > .bk-btn{width:100%;}.bk-root .bk-btn-group .bk-dropdown-toggle{flex:0 0 0;padding:6px 6px;}"},function(e,t,i,s,n){var o;s();const r=e(310);class a extends r.ColumnView{}i.WidgetBoxView=a,a.__name__="WidgetBoxView";class l extends r.Column{constructor(e){super(e)}}i.WidgetBox=l,o=l,l.__name__="WidgetBox",o.prototype.default_view=a},function(e,t,i,s,n){s();var o=e(135);n("MathText",o.MathText),n("Ascii",o.Ascii),n("MathML",o.MathML),n("TeX",o.TeX),n("PlainText",e(139).PlainText)},function(e,t,i,s,n){s(),n("CustomJSTransform",e(322).CustomJSTransform),n("Dodge",e(323).Dodge),n("Interpolator",e(325).Interpolator),n("Jitter",e(326).Jitter),n("LinearInterpolator",e(327).LinearInterpolator),n("StepInterpolator",e(328).StepInterpolator),n("Transform",e(56).Transform)},function(e,t,i,s,n){var o;s();const r=e(56),a=e(13),l=e(34);class c extends r.Transform{constructor(e){super(e)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}_make_transform(e,t){return new Function(...this.names,e,(0,l.use_strict)(t))}get scalar_transform(){return this._make_transform("x",this.func)}get vector_transform(){return this._make_transform("xs",this.v_func)}compute(e){return this.scalar_transform(...this.values,e)}v_compute(e){return this.vector_transform(...this.values,e)}}i.CustomJSTransform=c,o=c,c.__name__="CustomJSTransform",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],func:[t,""],v_func:[t,""]})))},function(e,t,i,s,n){var o;s();const r=e(324);class a extends r.RangeTransform{constructor(e){super(e)}_compute(e){return e+this.value}}i.Dodge=a,o=a,a.__name__="Dodge",o.define((({Number:e})=>({value:[e,0]})))},function(e,t,i,s,n){var o;s();const r=e(56),a=e(57),l=e(67),c=e(24),h=e(8),_=e(11);class u extends r.Transform{constructor(e){super(e)}v_compute(e){let t;this.range instanceof l.FactorRange?t=this.range.v_synthetic(e):(0,h.isArrayableOf)(e,h.isNumber)?t=e:(0,_.unreachable)();const i=new((0,c.infer_type)(t))(t.length);for(let s=0;s<t.length;s++){const e=t[s];i[s]=this._compute(e)}return i}compute(e){return this.range instanceof l.FactorRange?this._compute(this.range.synthetic(e)):(0,h.isNumber)(e)?this._compute(e):void(0,_.unreachable)()}}i.RangeTransform=u,o=u,u.__name__="RangeTransform",o.define((({Ref:e,Nullable:t})=>({range:[t(e(a.Range)),null]})))},function(e,t,i,s,n){var o;s();const r=e(56),a=e(70),l=e(24),c=e(9),h=e(8);class _ extends r.Transform{constructor(e){super(e),this._sorted_dirty=!0}connect_signals(){super.connect_signals(),this.connect(this.change,(()=>this._sorted_dirty=!0))}v_compute(e){const t=new((0,l.infer_type)(e))(e.length);for(let i=0;i<e.length;i++){const s=e[i];t[i]=this.compute(s)}return t}sort(e=!1){if(!this._sorted_dirty)return;let t,i;if((0,h.isString)(this.x)&&(0,h.isString)(this.y)&&null!=this.data){const e=this.data.columns();if(!(0,c.includes)(e,this.x))throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(!(0,c.includes)(e,this.y))throw new Error("The y parameter does not correspond to a valid column name defined in the data parameter");t=this.data.get_column(this.x),i=this.data.get_column(this.y)}else{if(!(0,h.isArray)(this.x)||!(0,h.isArray)(this.y))throw new Error("parameters 'x' and 'y' must be both either string fields or arrays");t=this.x,i=this.y}if(t.length!==i.length)throw new Error("The length for x and y do not match");if(t.length<2)throw new Error("x and y must have at least two elements to support interpolation");const s=t.length,n=new Uint32Array(s);for(let r=0;r<s;r++)n[r]=r;const o=e?-1:1;n.sort(((e,i)=>o*(t[e]-t[i]))),this._x_sorted=new((0,l.infer_type)(t))(s),this._y_sorted=new((0,l.infer_type)(i))(s);for(let r=0;r<s;r++)this._x_sorted[r]=t[n[r]],this._y_sorted[r]=i[n[r]];this._sorted_dirty=!1}}i.Interpolator=_,o=_,_.__name__="Interpolator",o.define((({Boolean:e,Number:t,String:i,Ref:s,Array:n,Or:o,Nullable:r})=>({x:[o(i,n(t))],y:[o(i,n(t))],data:[r(s(a.ColumnarDataSource)),null],clip:[e,!0]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(324),l=e(67),c=e(20),h=e(8),_=e(12),u=(0,o.__importStar)(e(10)),d=e(11);class p extends a.RangeTransform{constructor(e){super(e)}v_compute(e){var t;let i;this.range instanceof l.FactorRange?i=this.range.v_synthetic(e):(0,h.isArrayableOf)(e,h.isNumber)?i=e:(0,d.unreachable)();const s=i.length;(null===(t=this.previous_offsets)||void 0===t?void 0:t.length)!=s&&(this.previous_offsets=new Array(s),this.previous_offsets=(0,_.map)(this.previous_offsets,(()=>this._compute())));const n=this.previous_offsets;return(0,_.map)(i,((e,t)=>n[t]+e))}_compute(){switch(this.distribution){case"uniform":return this.mean+(u.random()-.5)*this.width;case"normal":return u.rnorm(this.mean,this.width)}}}i.Jitter=p,r=p,p.__name__="Jitter",r.define((({Number:e})=>({mean:[e,0],width:[e,1],distribution:[c.Distribution,"uniform"]})))},function(e,t,i,s,n){s();const o=e(9),r=e(325);class a extends r.Interpolator{constructor(e){super(e)}compute(e){if(this.sort(!1),this.clip){if(e<this._x_sorted[0]||e>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(e<this._x_sorted[0])return this._y_sorted[0];if(e>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}if(e==this._x_sorted[0])return this._y_sorted[0];const t=(0,o.find_last_index)(this._x_sorted,(t=>t<e)),i=this._x_sorted[t],s=this._x_sorted[t+1],n=this._y_sorted[t],r=this._y_sorted[t+1];return n+(e-i)/(s-i)*(r-n)}}i.LinearInterpolator=a,a.__name__="LinearInterpolator"},function(e,t,i,s,n){var o;s();const r=e(325),a=e(20),l=e(9);class c extends r.Interpolator{constructor(e){super(e)}compute(e){if(this.sort(!1),this.clip){if(e<this._x_sorted[0]||e>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(e<this._x_sorted[0])return this._y_sorted[0];if(e>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}let t;switch(this.mode){case"after":t=(0,l.find_last_index)(this._x_sorted,(t=>e>=t));break;case"before":t=(0,l.find_index)(this._x_sorted,(t=>e<=t));break;case"center":{const i=(0,l.map)(this._x_sorted,(t=>Math.abs(t-e))),s=(0,l.min)(i);t=(0,l.find_index)(i,(e=>s===e));break}default:throw new Error(`unknown mode: ${this.mode}`)}return-1!=t?this._y_sorted[t]:NaN}}i.StepInterpolator=c,o=c,c.__name__="StepInterpolator",o.define((()=>({mode:[a.StepMode,"after"]})))},function(e,t,i,s,n){s(),n("MapOptions",e(330).MapOptions),n("GMapOptions",e(330).GMapOptions),n("GMapPlot",e(330).GMapPlot),n("Plot",e(331).Plot)},function(e,t,i,s,n){var o,r,a;s();const l=e(331),c=e(53),h=e(58),_=e(336);n("GMapPlotView",_.GMapPlotView);class u extends c.Model{constructor(e){super(e)}}i.MapOptions=u,o=u,u.__name__="MapOptions",o.define((({Int:e,Number:t})=>({lat:[t],lng:[t],zoom:[e,12]})));class d extends u{constructor(e){super(e)}}i.GMapOptions=d,r=d,d.__name__="GMapOptions",r.define((({Boolean:e,Int:t,String:i})=>({map_type:[i,"roadmap"],scale_control:[e,!1],styles:[i],tilt:[t,45]})));class p extends l.Plot{constructor(e){super(e),this.use_map=!0}}i.GMapPlot=p,a=p,p.__name__="GMapPlot",a.prototype.default_view=_.GMapPlotView,a.define((({String:e,Ref:t})=>({map_options:[t(d)],api_key:[e],api_version:[e,"weekly"]}))),a.override({x_range:()=>new h.Range1d,y_range:()=>new h.Range1d})},function(e,t,i,s,n){s();const o=e(1);var r;const a=(0,o.__importStar)(e(48)),l=(0,o.__importStar)(e(18)),c=e(15),h=e(20),_=e(9),u=e(13),d=e(8),p=e(309),m=e(128),g=e(306),f=e(40),b=e(118),y=e(59),v=e(221),x=e(57),w=e(55),A=e(75),k=e(41),S=e(176),T=e(175),C=e(63),M=e(332);n("PlotView",M.PlotView);class z extends p.LayoutDOM{constructor(e){super(e),this.use_map=!1}_doc_attached(){super._doc_attached(),this._push_changes([[this.properties.inner_height,null,this.inner_height],[this.properties.inner_width,null,this.inner_width]])}initialize(){super.initialize(),this.reset=new c.Signal0(this,"reset");for(const e of(0,u.values)(this.extra_x_ranges).concat(this.x_range)){let t=e.plots;(0,d.isArray)(t)&&(t=t.concat(this),e.setv({plots:t},{silent:!0}))}for(const e of(0,u.values)(this.extra_y_ranges).concat(this.y_range)){let t=e.plots;(0,d.isArray)(t)&&(t=t.concat(this),e.setv({plots:t},{silent:!0}))}}add_layout(e,t="center"){const i=this.properties[t].get_value();this.setv({[t]:[...i,e]})}remove_layout(e){const t=t=>{(0,_.remove_by)(t,(t=>t==e))};t(this.left),t(this.right),t(this.above),t(this.below),t(this.center)}get data_renderers(){return this.renderers.filter((e=>e instanceof S.DataRenderer))}add_renderers(...e){this.renderers=this.renderers.concat(e)}add_glyph(e,t=new A.ColumnDataSource,i={}){const s=new T.GlyphRenderer(Object.assign(Object.assign({},i),{data_source:t,glyph:e}));return this.add_renderers(s),s}add_tools(...e){this.toolbar.tools=this.toolbar.tools.concat(e)}get panels(){return[...this.side_panels,...this.center]}get side_panels(){const{above:e,below:t,left:i,right:s}=this;return(0,_.concat)([e,t,i,s])}}i.Plot=z,r=z,z.__name__="Plot",r.prototype.default_view=M.PlotView,r.mixins([["outline_",a.Line],["background_",a.Fill],["border_",a.Fill]]),r.define((({Boolean:e,Number:t,String:i,Array:s,Dict:n,Or:o,Ref:r,Null:a,Nullable:c})=>({toolbar:[r(v.Toolbar),()=>new v.Toolbar],toolbar_location:[c(h.Location),"right"],toolbar_sticky:[e,!0],plot_width:[l.Alias("width")],plot_height:[l.Alias("height")],frame_width:[c(t),null],frame_height:[c(t),null],title:[o(r(b.Title),i,a),"",{convert:e=>(0,d.isString)(e)?new b.Title({text:e}):e}],title_location:[c(h.Location),"above"],above:[s(o(r(f.Annotation),r(m.Axis))),[]],below:[s(o(r(f.Annotation),r(m.Axis))),[]],left:[s(o(r(f.Annotation),r(m.Axis))),[]],right:[s(o(r(f.Annotation),r(m.Axis))),[]],center:[s(o(r(f.Annotation),r(g.Grid))),[]],renderers:[s(r(k.Renderer)),[]],x_range:[r(x.Range),()=>new C.DataRange1d],y_range:[r(x.Range),()=>new C.DataRange1d],x_scale:[r(w.Scale),()=>new y.LinearScale],y_scale:[r(w.Scale),()=>new y.LinearScale],extra_x_ranges:[n(r(x.Range)),{}],extra_y_ranges:[n(r(x.Range)),{}],extra_x_scales:[n(r(w.Scale)),{}],extra_y_scales:[n(r(w.Scale)),{}],lod_factor:[t,10],lod_interval:[t,300],lod_threshold:[c(t),2e3],lod_timeout:[t,500],hidpi:[e,!0],output_backend:[h.OutputBackend,"canvas"],min_border:[c(t),5],min_border_top:[c(t),null],min_border_left:[c(t),null],min_border_bottom:[c(t),null],min_border_right:[c(t),null],inner_width:[t,0],inner_height:[t,0],outer_width:[t,0],outer_height:[t,0],match_aspect:[e,!1],aspect_scale:[t,1],reset_policy:[h.ResetPolicy,"standard"]}))),r.override({width:600,height:600,outline_line_color:"#e5e5e5",border_fill_color:"#ffffff",background_fill_color:"#ffffff"})},function(e,t,i,s,n){s();const o=e(1),r=e(126),a=e(249),l=e(309),c=e(40),h=e(118),_=e(128),u=e(220),d=e(251),p=e(113),m=e(45),g=e(19),f=e(251),b=e(333),y=e(8),v=e(9),x=e(235),w=e(208),A=e(211),k=e(209),S=e(123),T=e(65),C=e(334),M=e(335),z=e(28);class E extends l.LayoutDOMView{constructor(){super(...arguments),this._outer_bbox=new T.BBox,this._inner_bbox=new T.BBox,this._needs_paint=!0,this._needs_layout=!1,this._invalidated_painters=new Set,this._invalidate_all=!0,this._needs_notify=!1}get canvas(){return this.canvas_view}get state(){return this._state_manager}set invalidate_dataranges(e){this._range_manager.invalidate_dataranges=e}renderer_view(e){const t=this.renderer_views.get(e);if(null==t)for(const[,i]of this.renderer_views){const t=i.renderer_view(e);if(null!=t)return t}return t}get is_paused(){return null!=this._is_paused&&0!==this._is_paused}get child_models(){return[]}pause(){null==this._is_paused?this._is_paused=1:this._is_paused+=1}unpause(e=!1){if(null==this._is_paused)throw new Error("wasn't paused");this._is_paused-=1,0!=this._is_paused||e||this.request_paint("everything")}notify_finished_after_paint(){this._needs_notify=!0}request_render(){this.request_paint("everything")}request_paint(e){this.invalidate_painters(e),this.schedule_paint()}invalidate_painters(e){if("everything"==e)this._invalidate_all=!0;else if((0,y.isArray)(e))for(const t of e)this._invalidated_painters.add(t);else this._invalidated_painters.add(e)}schedule_paint(){if(!this.is_paused){const e=this.throttled_paint();this._ready=this._ready.then((()=>e))}}request_layout(){this._needs_layout=!0,this.request_paint("everything")}reset(){"standard"==this.model.reset_policy&&(this.state.clear(),this.reset_range(),this.reset_selection()),this.model.trigger_event(new d.Reset)}remove(){(0,p.remove_views)(this.renderer_views),(0,p.remove_views)(this.tool_views),this.canvas_view.remove(),super.remove()}render(){super.render(),this.el.appendChild(this.canvas_view.el),this.canvas_view.render()}initialize(){this.pause(),super.initialize(),this.lod_started=!1,this.visuals=new m.Visuals(this),this._initial_state={selection:new Map,dimensions:{width:0,height:0}},this.visibility_callbacks=[],this.renderer_views=new Map,this.tool_views=new Map,this.frame=new r.CartesianFrame(this.model.x_scale,this.model.y_scale,this.model.x_range,this.model.y_range,this.model.extra_x_ranges,this.model.extra_y_ranges,this.model.extra_x_scales,this.model.extra_y_scales),this._range_manager=new C.RangeManager(this),this._state_manager=new M.StateManager(this,this._initial_state),this.throttled_paint=(0,b.throttle)((()=>this.repaint()),1e3/60);const{title_location:e,title:t}=this.model;null!=e&&null!=t&&(this._title=t instanceof h.Title?t:new h.Title({text:t}));const{toolbar_location:i,toolbar:s}=this.model;null!=i&&null!=s&&(this._toolbar=new u.ToolbarPanel({toolbar:s}),s.toolbar_location=i)}async lazy_initialize(){await super.lazy_initialize();const{hidpi:e,output_backend:t}=this.model,i=new a.Canvas({hidpi:e,output_backend:t});this.canvas_view=await(0,p.build_view)(i,{parent:this}),this.canvas_view.plot_views=[this],await this.build_renderer_views(),await this.build_tool_views(),this._range_manager.update_dataranges(),this.unpause(!0),g.logger.debug("PlotView initialized")}_width_policy(){return null==this.model.frame_width?super._width_policy():"min"}_height_policy(){return null==this.model.frame_height?super._height_policy():"min"}_update_layout(){var e,t,i,s,n;this.layout=new A.BorderLayout,this.layout.set_sizing(this.box_sizing());const o=(0,v.copy)(this.model.above),r=(0,v.copy)(this.model.below),a=(0,v.copy)(this.model.left),l=(0,v.copy)(this.model.right),_=e=>{switch(e){case"above":return o;case"below":return r;case"left":return a;case"right":return l}},{title_location:d,title:p}=this.model;null!=d&&null!=p&&_(d).push(this._title);const{toolbar_location:m,toolbar:g}=this.model;if(null!=m&&null!=g){const e=_(m);let t=!0;if(this.model.toolbar_sticky)for(let i=0;i<e.length;i++){const s=e[i];if(s instanceof h.Title){e[i]="above"==m||"below"==m?[s,this._toolbar]:[this._toolbar,s],t=!1;break}}t&&e.push(this._toolbar)}const f=(e,t)=>{var i;const s=this.renderer_view(t);return s.panel=new S.Panel(e),null===(i=s.update_layout)||void 0===i||i.call(s),s.layout},b=(e,t)=>{const i="above"==e||"below"==e,s=[];for(const n of t)if((0,y.isArray)(n)){const t=n.map((t=>{const s=f(e,t);if(t instanceof u.ToolbarPanel){const e=i?"width_policy":"height_policy";s.set_sizing(Object.assign(Object.assign({},s.sizing),{[e]:"min"}))}return s}));let o;i?(o=new k.Row(t),o.set_sizing({width_policy:"max",height_policy:"min"})):(o=new k.Column(t),o.set_sizing({width_policy:"min",height_policy:"max"})),o.absolute=!0,s.push(o)}else s.push(f(e,n));return s},x=null!==(e=this.model.min_border)&&void 0!==e?e:0;this.layout.min_border={left:null!==(t=this.model.min_border_left)&&void 0!==t?t:x,top:null!==(i=this.model.min_border_top)&&void 0!==i?i:x,right:null!==(s=this.model.min_border_right)&&void 0!==s?s:x,bottom:null!==(n=this.model.min_border_bottom)&&void 0!==n?n:x};const T=new w.NodeLayout,C=new w.VStack,M=new w.VStack,z=new w.HStack,E=new w.HStack;T.absolute=!0,C.absolute=!0,M.absolute=!0,z.absolute=!0,E.absolute=!0,T.children=this.model.center.filter((e=>e instanceof c.Annotation)).map((e=>{var t;const i=this.renderer_view(e);return null===(t=i.update_layout)||void 0===t||t.call(i),i.layout})).filter((e=>null!=e));const{frame_width:R,frame_height:B}=this.model;T.set_sizing(Object.assign(Object.assign({},null!=R?{width_policy:"fixed",width:R}:{width_policy:"fit"}),null!=B?{height_policy:"fixed",height:B}:{height_policy:"fit"})),T.on_resize((e=>this.frame.set_geometry(e))),C.children=(0,v.reversed)(b("above",o)),M.children=b("below",r),z.children=(0,v.reversed)(b("left",a)),E.children=b("right",l),C.set_sizing({width_policy:"fit",height_policy:"min"}),M.set_sizing({width_policy:"fit",height_policy:"min"}),z.set_sizing({width_policy:"min",height_policy:"fit"}),E.set_sizing({width_policy:"min",height_policy:"fit"}),this.layout.center_panel=T,this.layout.top_panel=C,this.layout.bottom_panel=M,this.layout.left_panel=z,this.layout.right_panel=E}get axis_views(){const e=[];for(const[,t]of this.renderer_views)t instanceof _.AxisView&&e.push(t);return e}set_toolbar_visibility(e){for(const t of this.visibility_callbacks)t(e)}update_range(e,t){this.pause(),this._range_manager.update(e,t),this.unpause()}reset_range(){this.update_range(null),this.trigger_ranges_update_event()}trigger_ranges_update_event(){const{x_range:e,y_range:t}=this.model;this.model.trigger_event(new f.RangesUpdate(e.start,e.end,t.start,t.end))}get_selection(){const e=new Map;for(const t of this.model.data_renderers){const{selected:i}=t.selection_manager.source;e.set(t,i)}return e}update_selection(e){for(const t of this.model.data_renderers){const i=t.selection_manager.source;if(null!=e){const s=e.get(t);null!=s&&i.selected.update(s,!0)}else i.selection_manager.clear()}}reset_selection(){this.update_selection(null)}_invalidate_layout(){(()=>{var e;for(const t of this.model.side_panels){const i=this.renderer_views.get(t);if(null===(e=i.layout)||void 0===e?void 0:e.has_size_changed())return this.invalidate_painters(i),!0}return!1})()&&this.root.compute_layout()}get_renderer_views(){return this.computed_renderers.map((e=>this.renderer_views.get(e)))}*_compute_renderers(){const{above:e,below:t,left:i,right:s,center:n,renderers:o}=this.model;yield*o,yield*e,yield*t,yield*i,yield*s,yield*n,null!=this._title&&(yield this._title),null!=this._toolbar&&(yield this._toolbar);for(const r of this.model.toolbar.tools)null!=r.overlay&&(yield r.overlay),yield*r.synthetic_renderers}async build_renderer_views(){this.computed_renderers=[...this._compute_renderers()],await(0,p.build_views)(this.renderer_views,this.computed_renderers,{parent:this})}async build_tool_views(){const e=this.model.toolbar.tools;(await(0,p.build_views)(this.tool_views,e,{parent:this})).map((e=>this.canvas_view.ui_event_bus.register_tool(e)))}connect_signals(){super.connect_signals();const{x_ranges:e,y_ranges:t}=this.frame;for(const[,l]of e)this.connect(l.change,(()=>{this._needs_layout=!0,this.request_paint("everything")}));for(const[,l]of t)this.connect(l.change,(()=>{this._needs_layout=!0,this.request_paint("everything")}));const{above:i,below:s,left:n,right:o,center:r,renderers:a}=this.model.properties;this.on_change([i,s,n,o,r,a],(async()=>await this.build_renderer_views())),this.connect(this.model.toolbar.properties.tools.change,(async()=>{await this.build_renderer_views(),await this.build_tool_views()})),this.connect(this.model.change,(()=>this.request_paint("everything"))),this.connect(this.model.reset,(()=>this.reset()))}has_finished(){if(!super.has_finished())return!1;if(this.model.visible)for(const[,e]of this.renderer_views)if(!e.has_finished())return!1;return!0}after_layout(){var e;super.after_layout();for(const[,i]of this.renderer_views)i instanceof c.AnnotationView&&(null===(e=i.after_layout)||void 0===e||e.call(i));if(this._needs_layout=!1,this.model.setv({inner_width:Math.round(this.frame.bbox.width),inner_height:Math.round(this.frame.bbox.height),outer_width:Math.round(this.layout.bbox.width),outer_height:Math.round(this.layout.bbox.height)},{no_change:!0}),!1!==this.model.match_aspect&&(this.pause(),this._range_manager.update_dataranges(),this.unpause(!0)),!this._outer_bbox.equals(this.layout.bbox)){const{width:e,height:t}=this.layout.bbox;this.canvas_view.resize(e,t),this._outer_bbox=this.layout.bbox,this._invalidate_all=!0,this._needs_paint=!0}const{inner_bbox:t}=this.layout;this._inner_bbox.equals(t)||(this._inner_bbox=t,this._needs_paint=!0),this._needs_paint&&this.paint()}repaint(){this._needs_layout&&this._invalidate_layout(),this.paint()}paint(){this.is_paused||(this.model.visible&&(g.logger.trace(`${this.toString()}.paint()`),this._actual_paint()),this._needs_notify&&(this._needs_notify=!1,this.notify_finished()))}_actual_paint(){var e;const{document:t}=this.model;if(null!=t){const e=t.interactive_duration();e>=0&&e<this.model.lod_interval?setTimeout((()=>{t.interactive_duration()>this.model.lod_timeout&&t.interactive_stop(),this.request_paint("everything")}),this.model.lod_timeout):t.interactive_stop()}this._range_manager.invalidate_dataranges&&(this._range_manager.update_dataranges(),this._invalidate_layout());let i=!1,s=!1;if(this._invalidate_all)i=!0,s=!0;else for(const a of this._invalidated_painters){const{level:e}=a.model;if("overlay"!=e?i=!0:s=!0,i&&s)break}this._invalidated_painters.clear(),this._invalidate_all=!1;const n=[this.frame.bbox.left,this.frame.bbox.top,this.frame.bbox.width,this.frame.bbox.height],{primary:o,overlays:r}=this.canvas_view;i&&(o.prepare(),this.canvas_view.prepare_webgl(n),this._map_hook(o.ctx,n),this._paint_empty(o.ctx,n),this._paint_outline(o.ctx,n),this._paint_levels(o.ctx,"image",n,!0),this._paint_levels(o.ctx,"underlay",n,!0),this._paint_levels(o.ctx,"glyph",n,!0),this._paint_levels(o.ctx,"guide",n,!1),this._paint_levels(o.ctx,"annotation",n,!1),o.finish()),(s||z.settings.wireframe)&&(r.prepare(),this._paint_levels(r.ctx,"overlay",n,!1),z.settings.wireframe&&this._paint_layout(r.ctx,this.layout),r.finish()),null==this._initial_state.range&&(this._initial_state.range=null!==(e=this._range_manager.compute_initial())&&void 0!==e?e:void 0),this._needs_paint=!1}_paint_levels(e,t,i,s){for(const n of this.computed_renderers){if(n.level!=t)continue;const o=this.renderer_views.get(n);e.save(),(s||o.needs_clip)&&(e.beginPath(),e.rect(...i),e.clip()),o.render(),e.restore(),o.has_webgl&&o.needs_webgl_blit&&this.canvas_view.blit_webgl(e)}}_paint_layout(e,t){const{x:i,y:s,width:n,height:o}=t.bbox;e.strokeStyle="blue",e.strokeRect(i,s,n,o);for(const r of t)e.save(),t.absolute||e.translate(i,s),this._paint_layout(e,r),e.restore()}_map_hook(e,t){}_paint_empty(e,t){const[i,s,n,o]=[0,0,this.layout.bbox.width,this.layout.bbox.height],[r,a,l,c]=t;this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(e),e.fillRect(i,s,n,o),e.clearRect(r,a,l,c)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(r,a,l,c))}_paint_outline(e,t){if(this.visuals.outline_line.doit){e.save(),this.visuals.outline_line.set_value(e);let[i,s,n,o]=t;i+n==this.layout.bbox.width&&(n-=1),s+o==this.layout.bbox.height&&(o-=1),e.strokeRect(i,s,n,o),e.restore()}}to_blob(){return this.canvas_view.to_blob()}export(e,t=!0){const i="png"==e?"canvas":"svg",s=new x.CanvasLayer(i,t),{width:n,height:o}=this.layout.bbox;s.resize(n,o);const{canvas:r}=this.canvas_view.compose();return s.ctx.drawImage(r,0,0),s}serializable_state(){const e=super.serializable_state(),{children:t}=e,i=(0,o.__rest)(e,["children"]),s=this.get_renderer_views().map((e=>e.serializable_state())).filter((e=>null!=e.bbox));return Object.assign(Object.assign({},i),{children:[...null!=t?t:[],...s]})}}i.PlotView=E,E.__name__="PlotView"},function(e,t,i,s,n){s(),i.throttle=function(e,t){let i=null,s=0,n=!1;return function(){return new Promise(((o,r)=>{const a=function(){s=Date.now(),i=null,n=!1;try{e(),o()}catch(e){r(e)}},l=Date.now(),c=t-(l-s);c<=0&&!n?(null!=i&&clearTimeout(i),n=!0,requestAnimationFrame(a)):i||n?o():i=setTimeout((()=>requestAnimationFrame(a)),c)}))}}},function(e,t,i,s,n){s();const o=e(63),r=e(19);class a{constructor(e){this.parent=e,this.invalidate_dataranges=!0}get frame(){return this.parent.frame}update(e,t){const{x_ranges:i,y_ranges:s}=this.frame;if(null==e){for(const[,e]of i)e.reset();for(const[,e]of s)e.reset();this.update_dataranges()}else{const n=[];for(const[t,s]of i)n.push([s,e.xrs.get(t)]);for(const[t,i]of s)n.push([i,e.yrs.get(t)]);(null==t?void 0:t.scrolling)&&this._update_ranges_together(n),this._update_ranges_individually(n,t)}}reset(){this.update(null)}_update_dataranges(e){const t=new Map,i=new Map;let s=!1;for(const[,r]of e.x_ranges)r instanceof o.DataRange1d&&"log"==r.scale_hint&&(s=!0);for(const[,r]of e.y_ranges)r instanceof o.DataRange1d&&"log"==r.scale_hint&&(s=!0);for(const o of this.parent.model.data_renderers){const e=this.parent.renderer_view(o);if(null==e)continue;const n=e.glyph_view.bounds();if(null!=n&&t.set(o,n),s){const t=e.glyph_view.log_bounds();null!=t&&i.set(o,t)}}let n=!1,a=!1;const l=e.x_target.span,c=e.y_target.span;let h;!1!==this.parent.model.match_aspect&&0!=l&&0!=c&&(h=1/this.parent.model.aspect_scale*(l/c));for(const[,r]of e.x_ranges){if(r instanceof o.DataRange1d){const e="log"==r.scale_hint?i:t;r.update(e,0,this.parent.model,h),r.follow&&(n=!0)}null!=r.bounds&&(a=!0)}for(const[,r]of e.y_ranges){if(r instanceof o.DataRange1d){const e="log"==r.scale_hint?i:t;r.update(e,1,this.parent.model,h),r.follow&&(n=!0)}null!=r.bounds&&(a=!0)}if(n&&a){r.logger.warn("Follow enabled so bounds are unset.");for(const[,t]of e.x_ranges)t.bounds=null;for(const[,t]of e.y_ranges)t.bounds=null}}update_dataranges(){this._update_dataranges(this.frame);for(const e of this.parent.model.renderers){const{coordinates:t}=e;null!=t&&this._update_dataranges(t)}null!=this.compute_initial()&&(this.invalidate_dataranges=!1)}compute_initial(){let e=!0;const{x_ranges:t,y_ranges:i}=this.frame,s=new Map,n=new Map;for(const[o,r]of t){const{start:t,end:i}=r;if(null==t||null==i||isNaN(t+i)){e=!1;break}s.set(o,{start:t,end:i})}if(e)for(const[o,r]of i){const{start:t,end:i}=r;if(null==t||null==i||isNaN(t+i)){e=!1;break}n.set(o,{start:t,end:i})}return e?{xrs:s,yrs:n}:(r.logger.warn("could not set initial ranges"),null)}_update_ranges_together(e){let t=1;for(const[i,s]of e)t=Math.min(t,this._get_weight_to_constrain_interval(i,s));if(t<1)for(const[i,s]of e)s.start=t*s.start+(1-t)*i.start,s.end=t*s.end+(1-t)*i.end}_update_ranges_individually(e,t){const i=!!(null==t?void 0:t.panning),s=!!(null==t?void 0:t.scrolling);let n=!1;for(const[o,r]of e){if(!s){const e=this._get_weight_to_constrain_interval(o,r);e<1&&(r.start=e*r.start+(1-e)*o.start,r.end=e*r.end+(1-e)*o.end)}if(null!=o.bounds&&"auto"!=o.bounds){const[e,t]=o.bounds,a=Math.abs(r.end-r.start);o.is_reversed?(null!=e&&e>r.end&&(n=!0,r.end=e,(i||s)&&(r.start=e+a)),null!=t&&t<r.start&&(n=!0,r.start=t,(i||s)&&(r.end=t-a))):(null!=e&&e>r.start&&(n=!0,r.start=e,(i||s)&&(r.end=e+a)),null!=t&&t<r.end&&(n=!0,r.end=t,(i||s)&&(r.start=t-a)))}}if(!(s&&n&&(null==t?void 0:t.maintain_focus)))for(const[o,r]of e)o.have_updated_interactively=!0,o.start==r.start&&o.end==r.end||o.setv(r)}_get_weight_to_constrain_interval(e,t){const{min_interval:i}=e;let{max_interval:s}=e;if(null!=e.bounds&&"auto"!=e.bounds){const[t,i]=e.bounds;if(null!=t&&null!=i){const e=Math.abs(i-t);s=null!=s?Math.min(s,e):e}}let n=1;if(null!=i||null!=s){const o=Math.abs(e.end-e.start),r=Math.abs(t.end-t.start);null!=i&&i>0&&r<i&&(n=(o-i)/(o-r)),null!=s&&s>0&&r>s&&(n=(s-o)/(r-o)),n=Math.max(0,Math.min(1,n))}return n}}i.RangeManager=a,a.__name__="RangeManager"},function(e,t,i,s,n){s();const o=e(15);class r{constructor(e,t){this.parent=e,this.initial_state=t,this.changed=new o.Signal0(this.parent,"state_changed"),this.history=[],this.index=-1}_do_state_change(e){const t=null!=this.history[e]?this.history[e].state:this.initial_state;return null!=t.range&&this.parent.update_range(t.range),null!=t.selection&&this.parent.update_selection(t.selection),t}push(e,t){const{history:i,index:s}=this,n=null!=i[s]?i[s].state:{},o=Object.assign(Object.assign(Object.assign({},this.initial_state),n),t);this.history=this.history.slice(0,this.index+1),this.history.push({type:e,state:o}),this.index=this.history.length-1,this.changed.emit()}clear(){this.history=[],this.index=-1,this.changed.emit()}undo(){if(this.can_undo){this.index-=1;const e=this._do_state_change(this.index);return this.changed.emit(),e}return null}redo(){if(this.can_redo){this.index+=1;const e=this._do_state_change(this.index);return this.changed.emit(),e}return null}get can_undo(){return this.index>=0}get can_redo(){return this.index<this.history.length-1}}i.StateManager=r,r.__name__="StateManager"},function(e,t,i,s,n){s();const o=e(19),r=e(15),a=e(43),l=e(78),c=e(22),h=e(332),_=new r.Signal0({},"gmaps_ready");class u extends h.PlotView{initialize(){this.pause(),super.initialize(),this._tiles_loaded=!1,this.zoom_count=0;const{zoom:e,lat:t,lng:i}=this.model.map_options;if(this.initial_zoom=e,this.initial_lat=t,this.initial_lng=i,!this.model.api_key){const e="https://developers.google.com/maps/documentation/javascript/get-api-key";o.logger.error(`api_key is required. See ${e} for more information on how to obtain your own.`)}if("undefined"==typeof google||null==google.maps){if(void 0===window._bokeh_gmaps_callback){const{api_key:e,api_version:t}=this.model;!function(e,t){window._bokeh_gmaps_callback=()=>_.emit();const i=encodeURIComponent,s=document.createElement("script");s.type="text/javascript",s.src=`https://maps.googleapis.com/maps/api/js?v=${i(t)}&key=${i(e)}&callback=_bokeh_gmaps_callback`,document.body.appendChild(s)}(e,t)}_.connect((()=>this.request_paint("everything")))}this.unpause()}remove(){(0,a.remove)(this.map_el),super.remove()}update_range(e,t){var i,s;if(null==e)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),super.update_range(null,t);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(null!==(i=e.sdx)&&void 0!==i?i:0,null!==(s=e.sdy)&&void 0!==s?s:0),super.update_range(e,t);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),super.update_range(e,t);const i=e.factor<0?-1:1,s=this.map.getZoom();if(null!=s){const e=s+i;if(e>=2){this.map.setZoom(e);const[t,i]=this._get_projected_bounds();i-t<0&&this.map.setZoom(s)}}this.unpause()}this._set_bokeh_ranges()}_build_map(){const{maps:e}=google;this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID};const t=this.model.map_options,i={center:new e.LatLng(t.lat,t.lng),zoom:t.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[t.map_type],scaleControl:t.scale_control,tilt:t.tilt};null!=t.styles&&(i.styles=JSON.parse(t.styles)),this.map_el=(0,a.div)({style:{position:"absolute"}}),this.canvas_view.add_underlay(this.map_el),this.map=new e.Map(this.map_el,i),e.event.addListener(this.map,"idle",(()=>this._set_bokeh_ranges())),e.event.addListener(this.map,"bounds_changed",(()=>this._set_bokeh_ranges())),e.event.addListenerOnce(this.map,"tilesloaded",(()=>this._render_finished())),this.connect(this.model.properties.map_options.change,(()=>this._update_options())),this.connect(this.model.map_options.properties.styles.change,(()=>this._update_styles())),this.connect(this.model.map_options.properties.lat.change,(()=>this._update_center("lat"))),this.connect(this.model.map_options.properties.lng.change,(()=>this._update_center("lng"))),this.connect(this.model.map_options.properties.zoom.change,(()=>this._update_zoom())),this.connect(this.model.map_options.properties.map_type.change,(()=>this._update_map_type())),this.connect(this.model.map_options.properties.scale_control.change,(()=>this._update_scale_control())),this.connect(this.model.map_options.properties.tilt.change,(()=>this._update_tilt()))}_render_finished(){this._tiles_loaded=!0,this.notify_finished()}has_finished(){return super.has_finished()&&!0===this._tiles_loaded}_get_latlon_bounds(){const e=this.map.getBounds(),t=e.getNorthEast(),i=e.getSouthWest();return[i.lng(),t.lng(),i.lat(),t.lat()]}_get_projected_bounds(){const[e,t,i,s]=this._get_latlon_bounds(),[n,o]=l.wgs84_mercator.compute(e,i),[r,a]=l.wgs84_mercator.compute(t,s);return[n,r,o,a]}_set_bokeh_ranges(){const[e,t,i,s]=this._get_projected_bounds();this.frame.x_range.setv({start:e,end:t}),this.frame.y_range.setv({start:i,end:s})}_update_center(e){var t;const i=null===(t=this.map.getCenter())||void 0===t?void 0:t.toJSON();null!=i&&(i[e]=this.model.map_options[e],this.map.setCenter(i),this._set_bokeh_ranges())}_update_map_type(){this.map.setOptions({mapTypeId:this.map_types[this.model.map_options.map_type]})}_update_scale_control(){this.map.setOptions({scaleControl:this.model.map_options.scale_control})}_update_tilt(){this.map.setOptions({tilt:this.model.map_options.tilt})}_update_options(){this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()}_update_styles(){this.map.setOptions({styles:JSON.parse(this.model.map_options.styles)})}_update_zoom(){this.map.setOptions({zoom:this.model.map_options.zoom}),this._set_bokeh_ranges()}_map_hook(e,t){if(null==this.map&&"undefined"!=typeof google&&null!=google.maps&&this._build_map(),null!=this.map_el){const[e,i,s,n]=t;this.map_el.style.top=`${i}px`,this.map_el.style.left=`${e}px`,this.map_el.style.width=`${s}px`,this.map_el.style.height=`${n}px`}}_paint_empty(e,t){const i=this.layout.bbox.width,s=this.layout.bbox.height,[n,o,r,a]=t;e.clearRect(0,0,i,s),e.beginPath(),e.moveTo(0,0),e.lineTo(0,s),e.lineTo(i,s),e.lineTo(i,0),e.lineTo(0,0),e.moveTo(n,o),e.lineTo(n+r,o),e.lineTo(n+r,o+a),e.lineTo(n,o+a),e.lineTo(n,o),e.closePath(),null!=this.model.border_fill_color&&(e.fillStyle=(0,c.color2css)(this.model.border_fill_color),e.fill())}}i.GMapPlotView=u,u.__name__="GMapPlotView"},function(e,t,i,s,n){s(),(0,e(1).__exportStar)(e(132),i)},function(e,t,i,s,n){s(),n("GlyphRenderer",e(175).GlyphRenderer),n("GraphRenderer",e(339).GraphRenderer),n("GuideRenderer",e(129).GuideRenderer);var o=e(41);n("Renderer",o.Renderer),n("RendererGroup",o.RendererGroup)},function(e,t,i,s,n){var o;s();const r=e(176),a=e(175),l=e(303),c=e(302),h=e(113),_=e(178),u=e(283),d=e(286);class p extends r.DataRendererView{get glyph_view(){return this.node_view.glyph}async lazy_initialize(){await super.lazy_initialize(),this.apply_coordinates();const{parent:e}=this,{edge_renderer:t,node_renderer:i}=this.model;this.edge_view=await(0,h.build_view)(t,{parent:e}),this.node_view=await(0,h.build_view)(i,{parent:e})}connect_signals(){super.connect_signals(),this.connect(this.model.layout_provider.change,(()=>{this.apply_coordinates(),this.edge_view.set_data(),this.node_view.set_data(),this.request_render()}))}apply_coordinates(){const{edge_renderer:e,node_renderer:t}=this.model;if(!(e.glyph instanceof u.MultiLine||e.glyph instanceof d.Patches))throw new Error(`${this}.edge_renderer.glyph must be a MultiLine glyph`);if(!(t.glyph instanceof _.XYGlyph))throw new Error(`${this}.node_renderer.glyph must be a XYGlyph glyph`);const i=this.model.layout_provider.edge_coordinates,s=this.model.layout_provider.node_coordinates;e.glyph.properties.xs.internal=!0,e.glyph.properties.ys.internal=!0,t.glyph.properties.x.internal=!0,t.glyph.properties.y.internal=!0,e.glyph.xs={expr:i.x},e.glyph.ys={expr:i.y},t.glyph.x={expr:s.x},t.glyph.y={expr:s.y}}remove(){this.edge_view.remove(),this.node_view.remove(),super.remove()}_render(){this.edge_view.render(),this.node_view.render()}renderer_view(e){if(e instanceof a.GlyphRenderer){if(e==this.edge_view.model)return this.edge_view;if(e==this.node_view.model)return this.node_view}return super.renderer_view(e)}}i.GraphRendererView=p,p.__name__="GraphRendererView";class m extends r.DataRenderer{constructor(e){super(e)}get_selection_manager(){return this.node_renderer.data_source.selection_manager}}i.GraphRenderer=m,o=m,m.__name__="GraphRenderer",o.prototype.default_view=p,o.define((({Ref:e})=>({layout_provider:[e(l.LayoutProvider)],node_renderer:[e(a.GlyphRenderer)],edge_renderer:[e(a.GlyphRenderer)],selection_policy:[e(c.GraphHitTestPolicy),()=>new c.NodesOnly],inspection_policy:[e(c.GraphHitTestPolicy),()=>new c.NodesOnly]})))},function(e,t,i,s,n){s(),(0,e(1).__exportStar)(e(74),i),n("Selection",e(72).Selection)},function(e,t,i,s,n){s(),n("ServerSentDataSource",e(342).ServerSentDataSource),n("AjaxDataSource",e(344).AjaxDataSource),n("ColumnDataSource",e(75).ColumnDataSource),n("ColumnarDataSource",e(70).ColumnarDataSource),n("CDSView",e(190).CDSView),n("DataSource",e(71).DataSource),n("GeoJSONDataSource",e(345).GeoJSONDataSource),n("WebDataSource",e(343).WebDataSource)},function(e,t,i,s,n){s();const o=e(343);class r extends o.WebDataSource{constructor(e){super(e),this.initialized=!1}setup(){this.initialized||(this.initialized=!0,new EventSource(this.data_url).onmessage=e=>{var t;this.load_data(JSON.parse(e.data),this.mode,null!==(t=this.max_size)&&void 0!==t?t:void 0)})}}i.ServerSentDataSource=r,r.__name__="ServerSentDataSource"},function(e,t,i,s,n){var o;s();const r=e(75),a=e(20);class l extends r.ColumnDataSource{constructor(e){super(e)}get_column(e){const t=this.data[e];return null!=t?t:[]}get_length(){var e;return null!==(e=super.get_length())&&void 0!==e?e:0}initialize(){super.initialize(),this.setup()}load_data(e,t,i){const{adapter:s}=this;let n;switch(n=null!=s?s.execute(this,{response:e}):e,t){case"replace":this.data=n;break;case"append":{const e=this.data;for(const t of this.columns()){const s=Array.from(e[t]),o=Array.from(n[t]),r=s.concat(o);n[t]=null!=i?r.slice(-i):r}this.data=n;break}}}}i.WebDataSource=l,o=l,l.__name__="WebDataSource",o.define((({Any:e,Int:t,String:i,Nullable:s})=>({max_size:[s(t),null],mode:[a.UpdateMode,"replace"],adapter:[s(e),null],data_url:[i]})))},function(e,t,i,s,n){var o;s();const r=e(343),a=e(20),l=e(19),c=e(13);class h extends r.WebDataSource{constructor(e){super(e),this.interval=null,this.initialized=!1}destroy(){null!=this.interval&&clearInterval(this.interval),super.destroy()}setup(){if(!this.initialized&&(this.initialized=!0,this.get_data(this.mode),null!=this.polling_interval)){const e=()=>this.get_data(this.mode,this.max_size,this.if_modified);this.interval=setInterval(e,this.polling_interval)}}get_data(e,t=null,i=!1){const s=this.prepare_request();s.addEventListener("load",(()=>this.do_load(s,e,null!=t?t:void 0))),s.addEventListener("error",(()=>this.do_error(s))),s.send()}prepare_request(){const e=new XMLHttpRequest;e.open(this.method,this.data_url,!0),e.withCredentials=!1,e.setRequestHeader("Content-Type",this.content_type);const t=this.http_headers;for(const[i,s]of(0,c.entries)(t))e.setRequestHeader(i,s);return e}do_load(e,t,i){if(200===e.status){const s=JSON.parse(e.responseText);this.load_data(s,t,i)}}do_error(e){l.logger.error(`Failed to fetch JSON from ${this.data_url} with code ${e.status}`)}}i.AjaxDataSource=h,o=h,h.__name__="AjaxDataSource",o.define((({Boolean:e,Int:t,String:i,Dict:s,Nullable:n})=>({polling_interval:[n(t),null],content_type:[i,"application/json"],http_headers:[s(i),{}],method:[a.HTTPMethod,"POST"],if_modified:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(70),a=e(19),l=e(9),c=e(13);function h(e){return null!=e?e:NaN}const{hasOwnProperty:_}=Object.prototype;class u extends r.ColumnarDataSource{constructor(e){super(e)}initialize(){super.initialize(),this._update_data()}connect_signals(){super.connect_signals(),this.connect(this.properties.geojson.change,(()=>this._update_data()))}_update_data(){this.data=this.geojson_to_column_data()}_get_new_list_array(e){return(0,l.range)(0,e).map((e=>[]))}_get_new_nan_array(e){return(0,l.range)(0,e).map((e=>NaN))}_add_properties(e,t,i,s){var n;const o=null!==(n=e.properties)&&void 0!==n?n:{};for(const[r,a]of(0,c.entries)(o))_.call(t,r)||(t[r]=this._get_new_nan_array(s)),t[r][i]=h(a)}_add_geometry(e,t,i){function s(e,t){return e.concat([[NaN,NaN,NaN]]).concat(t)}switch(e.type){case"Point":{const[s,n,o]=e.coordinates;t.x[i]=s,t.y[i]=n,t.z[i]=h(o);break}case"LineString":{const{coordinates:s}=e;for(let e=0;e<s.length;e++){const[n,o,r]=s[e];t.xs[i][e]=n,t.ys[i][e]=o,t.zs[i][e]=h(r)}break}case"Polygon":{e.coordinates.length>1&&a.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used.");const s=e.coordinates[0];for(let e=0;e<s.length;e++){const[n,o,r]=s[e];t.xs[i][e]=n,t.ys[i][e]=o,t.zs[i][e]=h(r)}break}case"MultiPoint":a.logger.warn("MultiPoint not supported in Bokeh");break;case"MultiLineString":{const n=e.coordinates.reduce(s);for(let e=0;e<n.length;e++){const[s,o,r]=n[e];t.xs[i][e]=s,t.ys[i][e]=o,t.zs[i][e]=h(r)}break}case"MultiPolygon":{const n=[];for(const t of e.coordinates)t.length>1&&a.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),n.push(t[0]);const o=n.reduce(s);for(let e=0;e<o.length;e++){const[s,n,r]=o[e];t.xs[i][e]=s,t.ys[i][e]=n,t.zs[i][e]=h(r)}break}default:throw new Error(`Invalid GeoJSON geometry type: ${e.type}`)}}geojson_to_column_data(){const e=JSON.parse(this.geojson);let t;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")}let i=0;for(const o of t){const e="Feature"===o.type?o.geometry:o;"GeometryCollection"==e.type?i+=e.geometries.length:i+=1}const s={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)};let n=0;for(const o of t){const e="Feature"==o.type?o.geometry:o;if("GeometryCollection"==e.type)for(const t of e.geometries)this._add_geometry(t,s,n),"Feature"===o.type&&this._add_properties(o,s,n,i),n+=1;else this._add_geometry(e,s,n),"Feature"===o.type&&this._add_properties(o,s,n,i),n+=1}return s}}i.GeoJSONDataSource=u,o=u,u.__name__="GeoJSONDataSource",o.define((({String:e})=>({geojson:[e]}))),o.internal((({Dict:e,Arrayable:t})=>({data:[e(t),{}]})))},function(e,t,i,s,n){s(),n("BBoxTileSource",e(347).BBoxTileSource),n("MercatorTileSource",e(348).MercatorTileSource),n("QUADKEYTileSource",e(351).QUADKEYTileSource),n("TileRenderer",e(352).TileRenderer),n("TileSource",e(349).TileSource),n("TMSTileSource",e(355).TMSTileSource),n("WMTSTileSource",e(353).WMTSTileSource)},function(e,t,i,s,n){var o;s();const r=e(348);class a extends r.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,i){const s=this.string_lookup_replace(this.url,this.extra_url_vars);let n,o,r,a;return this.use_latlon?[o,a,n,r]=this.get_tile_geographic_bounds(e,t,i):[o,a,n,r]=this.get_tile_meter_bounds(e,t,i),s.replace("{XMIN}",o.toString()).replace("{YMIN}",a.toString()).replace("{XMAX}",n.toString()).replace("{YMAX}",r.toString())}}i.BBoxTileSource=a,o=a,a.__name__="BBoxTileSource",o.define((({Boolean:e})=>({use_latlon:[e,!1]})))},function(e,t,i,s,n){var o;s();const r=e(349),a=e(9),l=e(350);class c extends r.TileSource{constructor(e){super(e)}initialize(){super.initialize(),this._resolutions=(0,a.range)(this.min_zoom,this.max_zoom+1).map((e=>this.get_resolution(e)))}_computed_initial_resolution(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size}is_valid_tile(e,t,i){return!(!this.wrap_around&&(e<0||e>=2**i))&&!(t<0||t>=2**i)}parent_by_tile_xyz(e,t,i){const s=this.tile_xyz_to_quadkey(e,t,i),n=s.substring(0,s.length-1);return this.quadkey_to_tile_xyz(n)}get_resolution(e){return this._computed_initial_resolution()/2**e}get_resolution_by_extent(e,t,i){return[(e[2]-e[0])/i,(e[3]-e[1])/t]}get_level_by_extent(e,t,i){const s=(e[2]-e[0])/i,n=(e[3]-e[1])/t,o=Math.max(s,n);let r=0;for(const a of this._resolutions){if(o>a){if(0==r)return 0;if(r>0)return r-1}r+=1}return r-1}get_closest_level_by_extent(e,t,i){const s=(e[2]-e[0])/i,n=(e[3]-e[1])/t,o=Math.max(s,n),r=this._resolutions.reduce((function(e,t){return Math.abs(t-o)<Math.abs(e-o)?t:e}));return this._resolutions.indexOf(r)}snap_to_zoom_level(e,t,i,s){const[n,o,r,a]=e,l=this._resolutions[s];let c=i*l,h=t*l;if(!this.snap_to_zoom){const e=(r-n)/c,t=(a-o)/h;e>t?(c=r-n,h*=e):(c*=t,h=a-o)}const _=(c-(r-n))/2,u=(h-(a-o))/2;return[n-_,o-u,r+_,a+u]}tms_to_wmts(e,t,i){return[e,2**i-1-t,i]}wmts_to_tms(e,t,i){return[e,2**i-1-t,i]}pixels_to_meters(e,t,i){const s=this.get_resolution(i);return[e*s-this.x_origin_offset,t*s-this.y_origin_offset]}meters_to_pixels(e,t,i){const s=this.get_resolution(i);return[(e+this.x_origin_offset)/s,(t+this.y_origin_offset)/s]}pixels_to_tile(e,t){let i=Math.ceil(e/this.tile_size);return i=0===i?i:i-1,[i,Math.max(Math.ceil(t/this.tile_size)-1,0)]}pixels_to_raster(e,t,i){return[e,(this.tile_size<<i)-t]}meters_to_tile(e,t,i){const[s,n]=this.meters_to_pixels(e,t,i);return this.pixels_to_tile(s,n)}get_tile_meter_bounds(e,t,i){const[s,n]=this.pixels_to_meters(e*this.tile_size,t*this.tile_size,i),[o,r]=this.pixels_to_meters((e+1)*this.tile_size,(t+1)*this.tile_size,i);return[s,n,o,r]}get_tile_geographic_bounds(e,t,i){const s=this.get_tile_meter_bounds(e,t,i),[n,o,r,a]=(0,l.meters_extent_to_geographic)(s);return[n,o,r,a]}get_tiles_by_extent(e,t,i=1){const[s,n,o,r]=e;let[a,l]=this.meters_to_tile(s,n,t),[c,h]=this.meters_to_tile(o,r,t);a-=i,l-=i,c+=i,h+=i;const _=[];for(let u=h;u>=l;u--)for(let e=a;e<=c;e++)this.is_valid_tile(e,u,t)&&_.push([e,u,t,this.get_tile_meter_bounds(e,u,t)]);return this.sort_tiles_from_center(_,[a,l,c,h]),_}quadkey_to_tile_xyz(e){let t=0,i=0;const s=e.length;for(let n=s;n>0;n--){const o=1<<n-1;switch(e.charAt(s-n)){case"0":continue;case"1":t|=o;break;case"2":i|=o;break;case"3":t|=o,i|=o;break;default:throw new TypeError(`Invalid Quadkey: ${e}`)}}return[t,i,s]}tile_xyz_to_quadkey(e,t,i){let s="";for(let n=i;n>0;n--){const i=1<<n-1;let o=0;0!=(e&i)&&(o+=1),0!=(t&i)&&(o+=2),s+=o.toString()}return s}children_by_tile_xyz(e,t,i){const s=this.tile_xyz_to_quadkey(e,t,i),n=[];for(let o=0;o<=3;o++){const[e,t,i]=this.quadkey_to_tile_xyz(s+o.toString()),r=this.get_tile_meter_bounds(e,t,i);n.push([e,t,i,r])}return n}get_closest_parent_by_tile_xyz(e,t,i){const s=this.calculate_world_x_by_tile_xyz(e,t,i);[e,t,i]=this.normalize_xyz(e,t,i);let n=this.tile_xyz_to_quadkey(e,t,i);for(;n.length>0;)if(n=n.substring(0,n.length-1),[e,t,i]=this.quadkey_to_tile_xyz(n),[e,t,i]=this.denormalize_xyz(e,t,i,s),this.tiles.has(this.tile_xyz_to_key(e,t,i)))return[e,t,i];return[0,0,0]}normalize_xyz(e,t,i){if(this.wrap_around){const s=2**i;return[(e%s+s)%s,t,i]}return[e,t,i]}denormalize_xyz(e,t,i,s){return[e+s*2**i,t,i]}denormalize_meters(e,t,i,s){return[e+2*s*Math.PI*6378137,t]}calculate_world_x_by_tile_xyz(e,t,i){return Math.floor(e/2**i)}}i.MercatorTileSource=c,o=c,c.__name__="MercatorTileSource",o.define((({Boolean:e})=>({snap_to_zoom:[e,!1],wrap_around:[e,!0]}))),o.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(e,t,i,s,n){var o;s();const r=e(53),a=e(13);class l extends r.Model{constructor(e){super(e)}initialize(){super.initialize(),this.tiles=new Map,this._normalize_case()}connect_signals(){super.connect_signals(),this.connect(this.change,(()=>this._clear_cache()))}string_lookup_replace(e,t){let i=e;for(const[s,n]of(0,a.entries)(t))i=i.replace(`{${s}}`,n);return i}_normalize_case(){const e=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=e}_clear_cache(){this.tiles=new Map}tile_xyz_to_key(e,t,i){return`${e}:${t}:${i}`}key_to_tile_xyz(e){const[t,i,s]=e.split(":").map((e=>parseInt(e)));return[t,i,s]}sort_tiles_from_center(e,t){const[i,s,n,o]=t,r=(n-i)/2+i,a=(o-s)/2+s;e.sort((function(e,t){return Math.sqrt((r-e[0])**2+(a-e[1])**2)-Math.sqrt((r-t[0])**2+(a-t[1])**2)}))}get_image_url(e,t,i){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",i.toString())}}i.TileSource=l,o=l,l.__name__="TileSource",o.define((({Number:e,String:t,Dict:i,Nullable:s})=>({url:[t,""],tile_size:[e,256],max_zoom:[e,30],min_zoom:[e,0],extra_url_vars:[i(t),{}],attribution:[t,""],x_origin_offset:[e],y_origin_offset:[e],initial_resolution:[s(e),null]})))},function(e,t,i,s,n){s();const o=e(78);function r(e,t){return o.wgs84_mercator.compute(e,t)}function a(e,t){return o.wgs84_mercator.invert(e,t)}i.geographic_to_meters=r,i.meters_to_geographic=a,i.geographic_extent_to_meters=function(e){const[t,i,s,n]=e,[o,a]=r(t,i),[l,c]=r(s,n);return[o,a,l,c]},i.meters_extent_to_geographic=function(e){const[t,i,s,n]=e,[o,r]=a(t,i),[l,c]=a(s,n);return[o,r,l,c]}},function(e,t,i,s,n){s();const o=e(348);class r extends o.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,i){const s=this.string_lookup_replace(this.url,this.extra_url_vars),[n,o,r]=this.tms_to_wmts(e,t,i),a=this.tile_xyz_to_quadkey(n,o,r);return s.replace("{Q}",a)}}i.QUADKEYTileSource=r,r.__name__="QUADKEYTileSource"},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(349),l=e(353),c=e(41),h=e(58),_=e(43),u=e(136),d=e(9),p=e(8),m=(0,o.__importStar)(e(354));class g extends c.RendererView{initialize(){this._tiles=[],super.initialize()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render())),this.connect(this.model.tile_source.change,(()=>this.request_render()))}remove(){null!=this.attribution_el&&(0,_.removeElement)(this.attribution_el),super.remove()}styles(){return[...super.styles(),m.default]}get_extent(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]}get map_plot(){return this.plot_model}get map_canvas(){return this.layer.ctx}get map_frame(){return this.plot_view.frame}get x_range(){return this.map_plot.x_range}get y_range(){return this.map_plot.y_range}_set_data(){this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0}_update_attribution(){null!=this.attribution_el&&(0,_.removeElement)(this.attribution_el);const{attribution:e}=this.model.tile_source;if((0,p.isString)(e)&&e.length>0){const{layout:t,frame:i}=this.plot_view,s=t.bbox.width-i.bbox.right,n=t.bbox.height-i.bbox.bottom,o=i.bbox.width;this.attribution_el=(0,_.div)({class:m.tile_attribution,style:{position:"absolute",right:`${s}px`,bottom:`${n}px`,"max-width":o-4+"px",padding:"2px","background-color":"rgba(255,255,255,0.5)","font-size":"9px","line-height":"1.05","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}),this.plot_view.canvas_view.add_event(this.attribution_el),this.attribution_el.innerHTML=e,this.attribution_el.title=this.attribution_el.textContent.replace(/\s*\n\s*/g," ")}}_map_data(){this.initial_extent=this.get_extent();const e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width),t=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width,e);this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this.x_range instanceof h.Range1d&&(this.x_range.reset_start=t[0],this.x_range.reset_end=t[2]),this.y_range instanceof h.Range1d&&(this.y_range.reset_start=t[1],this.y_range.reset_end=t[3]),this._update_attribution()}_create_tile(e,t,i,s,n=!1){const o=this.model.tile_source.tile_xyz_to_quadkey(e,t,i),r=this.model.tile_source.tile_xyz_to_key(e,t,i);if(this.model.tile_source.tiles.has(r))return;const[a,l,c]=this.model.tile_source.normalize_xyz(e,t,i),h=this.model.tile_source.get_image_url(a,l,c),_={img:void 0,tile_coords:[e,t,i],normalized_coords:[a,l,c],quadkey:o,cache_key:r,bounds:s,loaded:!1,finished:!1,x_coord:s[0],y_coord:s[3]};this.model.tile_source.tiles.set(r,_),this._tiles.push(_),new u.ImageLoader(h,{loaded:e=>{Object.assign(_,{img:e,loaded:!0}),n?(_.finished=!0,this.notify_finished()):this.request_render()},failed(){_.finished=!0}})}_enforce_aspect_ratio(){if(this._last_height!==this.map_frame.bbox.height||this._last_width!==this.map_frame.bbox.width){const e=this.get_extent(),t=this.model.tile_source.get_level_by_extent(e,this.map_frame.bbox.height,this.map_frame.bbox.width),i=this.model.tile_source.snap_to_zoom_level(e,this.map_frame.bbox.height,this.map_frame.bbox.width,t);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.bbox.height,this._last_width=this.map_frame.bbox.width}}has_finished(){if(!super.has_finished())return!1;if(0==this._tiles.length)return!1;for(const e of this._tiles)if(!e.finished)return!1;return!0}_render(){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()}_draw_tile(e){const t=this.model.tile_source.tiles.get(e);if(null!=t&&t.loaded){const[[e],[i]]=this.coordinates.map_to_screen([t.bounds[0]],[t.bounds[3]]),[[s],[n]]=this.coordinates.map_to_screen([t.bounds[2]],[t.bounds[1]]),o=s-e,r=n-i,a=e,l=i,c=this.map_canvas.getImageSmoothingEnabled();this.map_canvas.setImageSmoothingEnabled(this.model.smoothing),this.map_canvas.drawImage(t.img,a,l,o,r),this.map_canvas.setImageSmoothingEnabled(c),t.finished=!0}}_set_rect(){const e=this.plot_model.outline_line_width,t=this.map_frame.bbox.left+e/2,i=this.map_frame.bbox.top+e/2,s=this.map_frame.bbox.width-e,n=this.map_frame.bbox.height-e;this.map_canvas.rect(t,i,s,n),this.map_canvas.clip()}_render_tiles(e){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(const t of e)this._draw_tile(t);this.map_canvas.restore()}_prefetch_tiles(){const{tile_source:e}=this.model,t=this.get_extent(),i=this.map_frame.bbox.height,s=this.map_frame.bbox.width,n=this.model.tile_source.get_level_by_extent(t,i,s),o=this.model.tile_source.get_tiles_by_extent(t,n);for(let r=0,a=Math.min(10,o.length);r<a;r++){const[t,i,s]=o[r],n=this.model.tile_source.children_by_tile_xyz(t,i,s);for(const o of n){const[t,i,s,n]=o;e.tiles.has(e.tile_xyz_to_key(t,i,s))||this._create_tile(t,i,s,n,!0)}}}_fetch_tiles(e){for(const t of e){const[e,i,s,n]=t;this._create_tile(e,i,s,n)}}_update(){const{tile_source:e}=this.model,{min_zoom:t}=e,{max_zoom:i}=e;let s=this.get_extent();const n=this.extent[2]-this.extent[0]<s[2]-s[0],o=this.map_frame.bbox.height,r=this.map_frame.bbox.width;let a=e.get_level_by_extent(s,o,r),l=!1;a<t?(s=this.extent,a=t,l=!0):a>i&&(s=this.extent,a=i,l=!0),l&&(this.x_range.setv({start:s[0],end:s[2]}),this.y_range.setv({start:s[1],end:s[3]})),this.extent=s;const c=e.get_tiles_by_extent(s,a),h=[],_=[],u=[],p=[];for(const m of c){const[t,i,s]=m,o=e.tile_xyz_to_key(t,i,s),r=e.tiles.get(o);if(null!=r&&r.loaded)_.push(o);else if(this.model.render_parents){const[o,r,a]=e.get_closest_parent_by_tile_xyz(t,i,s),l=e.tile_xyz_to_key(o,r,a),c=e.tiles.get(l);if(null!=c&&c.loaded&&!(0,d.includes)(u,l)&&u.push(l),n){const n=e.children_by_tile_xyz(t,i,s);for(const[t,i,s]of n){const n=e.tile_xyz_to_key(t,i,s);e.tiles.has(n)&&p.push(n)}}}null==r&&h.push(m)}this._render_tiles(u),this._render_tiles(p),this._render_tiles(_),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout((()=>this._fetch_tiles(h)),65)}}i.TileRendererView=g,g.__name__="TileRendererView";class f extends c.Renderer{constructor(e){super(e)}}i.TileRenderer=f,r=f,f.__name__="TileRenderer",r.prototype.default_view=g,r.define((({Boolean:e,Number:t,Ref:i})=>({alpha:[t,1],smoothing:[e,!0],tile_source:[i(a.TileSource),()=>new l.WMTSTileSource],render_parents:[e,!0]}))),r.override({level:"image"})},function(e,t,i,s,n){s();const o=e(348);class r extends o.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,i){const s=this.string_lookup_replace(this.url,this.extra_url_vars),[n,o,r]=this.tms_to_wmts(e,t,i);return s.replace("{X}",n.toString()).replace("{Y}",o.toString()).replace("{Z}",r.toString())}}i.WMTSTileSource=r,r.__name__="WMTSTileSource"},function(e,t,i,s,n){s(),i.root="bk-root",i.tile_attribution="bk-tile-attribution",i.default=".bk-root .bk-tile-attribution a{color:black;}"},function(e,t,i,s,n){s();const o=e(348);class r extends o.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,i){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",i.toString())}}i.TMSTileSource=r,r.__name__="TMSTileSource"},function(e,t,i,s,n){s(),n("CanvasTexture",e(357).CanvasTexture),n("ImageURLTexture",e(359).ImageURLTexture),n("Texture",e(358).Texture)},function(e,t,i,s,n){var o;s();const r=e(358),a=e(34);class l extends r.Texture{constructor(e){super(e)}get func(){const e=(0,a.use_strict)(this.code);return new Function("ctx","color","scale","weight",e)}get_pattern(e,t,i){const s=document.createElement("canvas");s.width=t,s.height=t;const n=s.getContext("2d");return this.func.call(this,n,e,t,i),s}}i.CanvasTexture=l,o=l,l.__name__="CanvasTexture",o.define((({String:e})=>({code:[e]})))},function(e,t,i,s,n){var o;s();const r=e(53),a=e(20);class l extends r.Model{constructor(e){super(e)}}i.Texture=l,o=l,l.__name__="Texture",o.define((()=>({repetition:[a.TextureRepetition,"repeat"]})))},function(e,t,i,s,n){var o;s();const r=e(358),a=e(136);class l extends r.Texture{constructor(e){super(e)}initialize(){super.initialize(),this._loader=new a.ImageLoader(this.url)}get_pattern(e,t,i){const{_loader:s}=this;return this._loader.finished?s.image:s.promise}}i.ImageURLTexture=l,o=l,l.__name__="ImageURLTexture",o.define((({String:e})=>({url:[e]})))},function(e,t,i,s,n){s(),n("ActionTool",e(238).ActionTool),n("CustomAction",e(361).CustomAction),n("HelpTool",e(239).HelpTool),n("RedoTool",e(362).RedoTool),n("ResetTool",e(363).ResetTool),n("SaveTool",e(364).SaveTool),n("UndoTool",e(365).UndoTool),n("ZoomInTool",e(366).ZoomInTool),n("ZoomOutTool",e(369).ZoomOutTool),n("ButtonTool",e(224).ButtonTool),n("EditTool",e(370).EditTool),n("BoxEditTool",e(371).BoxEditTool),n("FreehandDrawTool",e(372).FreehandDrawTool),n("PointDrawTool",e(373).PointDrawTool),n("PolyDrawTool",e(374).PolyDrawTool),n("PolyTool",e(375).PolyTool),n("PolyEditTool",e(376).PolyEditTool),n("BoxSelectTool",e(377).BoxSelectTool),n("BoxZoomTool",e(379).BoxZoomTool),n("GestureTool",e(223).GestureTool),n("LassoSelectTool",e(380).LassoSelectTool),n("LineEditTool",e(382).LineEditTool),n("PanTool",e(384).PanTool),n("PolySelectTool",e(381).PolySelectTool),n("RangeTool",e(385).RangeTool),n("SelectTool",e(378).SelectTool),n("TapTool",e(386).TapTool),n("WheelPanTool",e(387).WheelPanTool),n("WheelZoomTool",e(388).WheelZoomTool),n("CrosshairTool",e(389).CrosshairTool),n("CustomJSHover",e(390).CustomJSHover),n("HoverTool",e(391).HoverTool),n("InspectTool",e(232).InspectTool),n("Tool",e(222).Tool),n("ToolProxy",e(394).ToolProxy),n("Toolbar",e(221).Toolbar),n("ToolbarBase",e(233).ToolbarBase),n("ProxyToolbar",e(395).ProxyToolbar),n("ToolbarBox",e(395).ToolbarBox)},function(e,t,i,s,n){var o;s();const r=e(238);class a extends r.ActionToolButtonView{css_classes(){return super.css_classes().concat("bk-toolbar-button-custom-action")}}i.CustomActionButtonView=a,a.__name__="CustomActionButtonView";class l extends r.ActionToolView{doit(){var e;null===(e=this.model.callback)||void 0===e||e.execute(this.model)}}i.CustomActionView=l,l.__name__="CustomActionView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Custom Action",this.button_view=a}}i.CustomAction=c,o=c,c.__name__="CustomAction",o.prototype.default_view=l,o.define((({Any:e,String:t,Nullable:i})=>({callback:[i(e)],icon:[t]}))),o.override({description:"Perform a Custom Action"})},function(e,t,i,s,n){var o;s();const r=e(238),a=e(228);class l extends r.ActionToolView{connect_signals(){super.connect_signals(),this.connect(this.plot_view.state.changed,(()=>this.model.disabled=!this.plot_view.state.can_redo))}doit(){const e=this.plot_view.state.redo();null!=(null==e?void 0:e.range)&&this.plot_view.trigger_ranges_update_event()}}i.RedoToolView=l,l.__name__="RedoToolView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Redo",this.icon=a.tool_icon_redo}}i.RedoTool=c,o=c,c.__name__="RedoTool",o.prototype.default_view=l,o.override({disabled:!0}),o.register_alias("redo",(()=>new c))},function(e,t,i,s,n){var o;s();const r=e(238),a=e(228);class l extends r.ActionToolView{doit(){this.plot_view.reset()}}i.ResetToolView=l,l.__name__="ResetToolView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Reset",this.icon=a.tool_icon_reset}}i.ResetTool=c,o=c,c.__name__="ResetTool",o.prototype.default_view=l,o.register_alias("reset",(()=>new c))},function(e,t,i,s,n){var o;s();const r=e(238),a=e(228);class l extends r.ActionToolView{async copy(){const e=await this.plot_view.to_blob(),t=new ClipboardItem({[e.type]:Promise.resolve(e)});await navigator.clipboard.write([t])}async save(e){const t=await this.plot_view.to_blob(),i=document.createElement("a");i.href=URL.createObjectURL(t),i.download=e,i.target="_blank",i.dispatchEvent(new MouseEvent("click"))}doit(e="save"){switch(e){case"save":this.save("bokeh_plot");break;case"copy":this.copy()}}}i.SaveToolView=l,l.__name__="SaveToolView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Save",this.icon=a.tool_icon_save}get menu(){return[{icon:"bk-tool-icon-copy-to-clipboard",tooltip:"Copy image to clipboard",if:()=>"undefined"!=typeof ClipboardItem,handler:()=>{this.do.emit("copy")}}]}}i.SaveTool=c,o=c,c.__name__="SaveTool",o.prototype.default_view=l,o.register_alias("save",(()=>new c))},function(e,t,i,s,n){var o;s();const r=e(238),a=e(228);class l extends r.ActionToolView{connect_signals(){super.connect_signals(),this.connect(this.plot_view.state.changed,(()=>this.model.disabled=!this.plot_view.state.can_undo))}doit(){const e=this.plot_view.state.undo();null!=(null==e?void 0:e.range)&&this.plot_view.trigger_ranges_update_event()}}i.UndoToolView=l,l.__name__="UndoToolView";class c extends r.ActionTool{constructor(e){super(e),this.tool_name="Undo",this.icon=a.tool_icon_undo}}i.UndoTool=c,o=c,c.__name__="UndoTool",o.prototype.default_view=l,o.override({disabled:!0}),o.register_alias("undo",(()=>new c))},function(e,t,i,s,n){var o;s();const r=e(367),a=e(228);class l extends r.ZoomBaseToolView{}i.ZoomInToolView=l,l.__name__="ZoomInToolView";class c extends r.ZoomBaseTool{constructor(e){super(e),this.sign=1,this.tool_name="Zoom In",this.icon=a.tool_icon_zoom_in}}i.ZoomInTool=c,o=c,c.__name__="ZoomInTool",o.prototype.default_view=l,o.register_alias("zoom_in",(()=>new c({dimensions:"both"}))),o.register_alias("xzoom_in",(()=>new c({dimensions:"width"}))),o.register_alias("yzoom_in",(()=>new c({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(238),a=e(20),l=e(368);class c extends r.ActionToolView{doit(){var e;const t=this.plot_view.frame,i=this.model.dimensions,s="width"==i||"both"==i,n="height"==i||"both"==i,o=(0,l.scale_range)(t,this.model.sign*this.model.factor,s,n);this.plot_view.state.push("zoom_out",{range:o}),this.plot_view.update_range(o,{scrolling:!0,maintain_focus:this.model.maintain_focus}),null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_model),this.plot_view.trigger_ranges_update_event()}}i.ZoomBaseToolView=c,c.__name__="ZoomBaseToolView";class h extends r.ActionTool{constructor(e){super(e),this.maintain_focus=!0}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.ZoomBaseTool=h,o=h,h.__name__="ZoomBaseTool",o.define((({Percent:e})=>({factor:[e,.1],dimensions:[a.Dimensions,"both"]})))},function(e,t,i,s,n){s();const o=e(10);function r(e,t,i){const[s,n]=[e.start,e.end],o=null!=i?i:(n+s)/2;return[s-(s-o)*t,n-(n-o)*t]}function a(e,[t,i]){const s=new Map;for(const[n,o]of e){const[e,r]=o.r_invert(t,i);s.set(n,{start:e,end:r})}return s}i.scale_highlow=r,i.get_info=a,i.scale_range=function(e,t,i=!0,s=!0,n){t=(0,o.clamp)(t,-.9,.9);const l=i?t:0,[c,h]=r(e.bbox.h_range,l,null!=n?n.x:void 0),_=a(e.x_scales,[c,h]),u=s?t:0,[d,p]=r(e.bbox.v_range,u,null!=n?n.y:void 0);return{xrs:_,yrs:a(e.y_scales,[d,p]),factor:t}}},function(e,t,i,s,n){var o;s();const r=e(367),a=e(228);class l extends r.ZoomBaseToolView{}i.ZoomOutToolView=l,l.__name__="ZoomOutToolView";class c extends r.ZoomBaseTool{constructor(e){super(e),this.sign=-1,this.tool_name="Zoom Out",this.icon=a.tool_icon_zoom_out}}i.ZoomOutTool=c,o=c,c.__name__="ZoomOutTool",o.prototype.default_view=l,o.define((({Boolean:e})=>({maintain_focus:[e,!0]}))),o.register_alias("zoom_out",(()=>new c({dimensions:"both"}))),o.register_alias("xzoom_out",(()=>new c({dimensions:"width"}))),o.register_alias("yzoom_out",(()=>new c({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(9),a=e(8),l=e(11),c=e(175),h=e(223);class _ extends h.GestureToolView{constructor(){super(...arguments),this._mouse_in_frame=!0}_select_mode(e){const{shiftKey:t,ctrlKey:i}=e;return t||i?t&&!i?"append":!t&&i?"intersect":t&&i?"subtract":void(0,l.unreachable)():"replace"}_move_enter(e){this._mouse_in_frame=!0}_move_exit(e){this._mouse_in_frame=!1}_map_drag(e,t,i){if(!this.plot_view.frame.bbox.contains(e,t))return null;const s=this.plot_view.renderer_view(i);return null==s?null:[s.coordinates.x_scale.invert(e),s.coordinates.y_scale.invert(t)]}_delete_selected(e){const t=e.data_source,i=t.selected.indices;i.sort();for(const s of t.columns()){const e=t.get_array(s);for(let t=0;t<i.length;t++){const s=i[t];e.splice(s-t,1)}}this._emit_cds_changes(t)}_pop_glyphs(e,t){const i=e.columns();if(t&&i.length)for(const s of i){let i=e.get_array(s);const n=i.length-t+1;n<1||((0,a.isArray)(i)||(i=Array.from(i),e.data[s]=i),i.splice(0,n))}}_emit_cds_changes(e,t=!0,i=!0,s=!0){i&&e.selection_manager.clear(),t&&e.change.emit(),s&&(e.data=e.data,e.properties.data.change.emit())}_drag_points(e,t,i="both"){if(null==this._basepoint)return;const[s,n]=this._basepoint;for(const o of t){const t=this._map_drag(s,n,o),r=this._map_drag(e.sx,e.sy,o);if(null==r||null==t)continue;const[a,l]=r,[c,h]=t,[_,u]=[a-c,l-h],d=o.glyph,p=o.data_source,[m,g]=[d.x.field,d.y.field];for(const e of p.selected.indices)!m||"width"!=i&&"both"!=i||(p.data[m][e]+=_),!g||"height"!=i&&"both"!=i||(p.data[g][e]+=u);p.change.emit()}this._basepoint=[e.sx,e.sy]}_pad_empty_columns(e,t){for(const i of e.columns())(0,r.includes)(t,i)||e.get_array(i).push(this.model.empty_value)}_select_event(e,t,i){const s=this.plot_view.frame,{sx:n,sy:o}=e;if(!s.bbox.contains(n,o))return[];const r={type:"point",sx:n,sy:o},a=[];for(const l of i){const e=l.get_selection_manager(),i=l.data_source,s=this.plot_view.renderer_view(l);null!=s&&(e.select([s],r,!0,t)&&a.push(l),i.properties.selected.change.emit())}return a}}i.EditToolView=_,_.__name__="EditToolView";class u extends h.GestureTool{constructor(e){super(e)}get computed_icon(){var e;return null!==(e=this.custom_icon)&&void 0!==e?e:this.icon}}i.EditTool=u,o=u,u.__name__="EditTool",o.define((({Unknown:e,String:t,Array:i,Ref:s,Nullable:n})=>({custom_icon:[n(t),null],empty_value:[e],renderers:[i(s(c.GlyphRenderer)),[]]})))},function(e,t,i,s,n){var o;s();const r=e(43),a=e(20),l=e(370),c=e(228);class h extends l.EditToolView{_tap(e){null==this._draw_basepoint&&null==this._basepoint&&this._select_event(e,this._select_mode(e),this.model.renderers)}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const t of this.model.renderers)e.keyCode===r.Keys.Backspace?this._delete_selected(t):e.keyCode==r.Keys.Esc&&t.data_source.selection_manager.clear()}_set_extent([e,t],[i,s],n,o=!1){const r=this.model.renderers[0],a=this.plot_view.renderer_view(r);if(null==a)return;const l=r.glyph,c=r.data_source,[h,_]=a.coordinates.x_scale.r_invert(e,t),[u,d]=a.coordinates.y_scale.r_invert(i,s),[p,m]=[(h+_)/2,(u+d)/2],[g,f]=[_-h,d-u],[b,y]=[l.x.field,l.y.field],[v,x]=[l.width.field,l.height.field];if(n)this._pop_glyphs(c,this.model.num_objects),b&&c.get_array(b).push(p),y&&c.get_array(y).push(m),v&&c.get_array(v).push(g),x&&c.get_array(x).push(f),this._pad_empty_columns(c,[b,y,v,x]);else{const e=c.data[b].length-1;b&&(c.data[b][e]=p),y&&(c.data[y][e]=m),v&&(c.data[v][e]=g),x&&(c.data[x][e]=f)}this._emit_cds_changes(c,!0,!1,o)}_update_box(e,t=!1,i=!1){if(null==this._draw_basepoint)return;const s=[e.sx,e.sy],n=this.plot_view.frame,o=this.model.dimensions,r=this.model._get_dim_limits(this._draw_basepoint,s,n,o);if(null!=r){const[e,s]=r;this._set_extent(e,s,t,i)}}_doubletap(e){this.model.active&&(null!=this._draw_basepoint?(this._update_box(e,!1,!0),this._draw_basepoint=null):(this._draw_basepoint=[e.sx,e.sy],this._select_event(e,"append",this.model.renderers),this._update_box(e,!0,!1)))}_move(e){this._update_box(e,!1,!1)}_pan_start(e){if(e.shiftKey){if(null!=this._draw_basepoint)return;this._draw_basepoint=[e.sx,e.sy],this._update_box(e,!0,!1)}else{if(null!=this._basepoint)return;this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy]}}_pan(e,t=!1,i=!1){if(e.shiftKey){if(null==this._draw_basepoint)return;this._update_box(e,t,i)}else{if(null==this._basepoint)return;this._drag_points(e,this.model.renderers)}}_pan_end(e){if(this._pan(e,!1,!0),e.shiftKey)this._draw_basepoint=null;else{this._basepoint=null;for(const e of this.model.renderers)this._emit_cds_changes(e.data_source,!1,!0,!0)}}}i.BoxEditToolView=h,h.__name__="BoxEditToolView";class _ extends l.EditTool{constructor(e){super(e),this.tool_name="Box Edit Tool",this.icon=c.tool_icon_box_edit,this.event_type=["tap","pan","move"],this.default_order=1}}i.BoxEditTool=_,o=_,_.__name__="BoxEditTool",o.prototype.default_view=h,o.define((({Int:e})=>({dimensions:[a.Dimensions,"both"],num_objects:[e,0]})))},function(e,t,i,s,n){var o;s();const r=e(43),a=e(8),l=e(370),c=e(228);class h extends l.EditToolView{_draw(e,t,i=!1){if(!this.model.active)return;const s=this.model.renderers[0],n=this._map_drag(e.sx,e.sy,s);if(null==n)return;const[o,r]=n,l=s.data_source,c=s.glyph,[h,_]=[c.xs.field,c.ys.field];if("new"==t)this._pop_glyphs(l,this.model.num_objects),h&&l.get_array(h).push([o]),_&&l.get_array(_).push([r]),this._pad_empty_columns(l,[h,_]);else if("add"==t){if(h){const e=l.data[h].length-1;let t=l.get_array(h)[e];(0,a.isArray)(t)||(t=Array.from(t),l.data[h][e]=t),t.push(o)}if(_){const e=l.data[_].length-1;let t=l.get_array(_)[e];(0,a.isArray)(t)||(t=Array.from(t),l.data[_][e]=t),t.push(r)}}this._emit_cds_changes(l,!0,!0,i)}_pan_start(e){this._draw(e,"new")}_pan(e){this._draw(e,"add")}_pan_end(e){this._draw(e,"add",!0)}_tap(e){this._select_event(e,this._select_mode(e),this.model.renderers)}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const t of this.model.renderers)e.keyCode===r.Keys.Esc?t.data_source.selection_manager.clear():e.keyCode===r.Keys.Backspace&&this._delete_selected(t)}}i.FreehandDrawToolView=h,h.__name__="FreehandDrawToolView";class _ extends l.EditTool{constructor(e){super(e),this.tool_name="Freehand Draw Tool",this.icon=c.tool_icon_freehand_draw,this.event_type=["pan","tap"],this.default_order=3}}i.FreehandDrawTool=_,o=_,_.__name__="FreehandDrawTool",o.prototype.default_view=h,o.define((({Int:e})=>({num_objects:[e,0]}))),o.register_alias("freehand_draw",(()=>new _))},function(e,t,i,s,n){var o;s();const r=e(43),a=e(370),l=e(228);class c extends a.EditToolView{_tap(e){if(this._select_event(e,this._select_mode(e),this.model.renderers).length||!this.model.add)return;const t=this.model.renderers[0],i=this._map_drag(e.sx,e.sy,t);if(null==i)return;const s=t.glyph,n=t.data_source,[o,r]=[s.x.field,s.y.field],[a,l]=i;this._pop_glyphs(n,this.model.num_objects),o&&n.get_array(o).push(a),r&&n.get_array(r).push(l),this._pad_empty_columns(n,[o,r]),n.change.emit(),n.data=n.data,n.properties.data.change.emit()}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const t of this.model.renderers)e.keyCode===r.Keys.Backspace?this._delete_selected(t):e.keyCode==r.Keys.Esc&&t.data_source.selection_manager.clear()}_pan_start(e){this.model.drag&&(this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy])}_pan(e){this.model.drag&&null!=this._basepoint&&this._drag_points(e,this.model.renderers)}_pan_end(e){if(this.model.drag){this._pan(e);for(const e of this.model.renderers)this._emit_cds_changes(e.data_source,!1,!0,!0);this._basepoint=null}}}i.PointDrawToolView=c,c.__name__="PointDrawToolView";class h extends a.EditTool{constructor(e){super(e),this.tool_name="Point Draw Tool",this.icon=l.tool_icon_point_draw,this.event_type=["tap","pan","move"],this.default_order=2}}i.PointDrawTool=h,o=h,h.__name__="PointDrawTool",o.prototype.default_view=c,o.define((({Boolean:e,Int:t})=>({add:[e,!0],drag:[e,!0],num_objects:[t,0]})))},function(e,t,i,s,n){var o;s();const r=e(43),a=e(8),l=e(375),c=e(228);class h extends l.PolyToolView{constructor(){super(...arguments),this._drawing=!1,this._initialized=!1}_tap(e){this._drawing?this._draw(e,"add",!0):this._select_event(e,this._select_mode(e),this.model.renderers)}_draw(e,t,i=!1){const s=this.model.renderers[0],n=this._map_drag(e.sx,e.sy,s);if(this._initialized||this.activate(),null==n)return;const[o,r]=this._snap_to_vertex(e,...n),l=s.data_source,c=s.glyph,[h,_]=[c.xs.field,c.ys.field];if("new"==t)this._pop_glyphs(l,this.model.num_objects),h&&l.get_array(h).push([o,o]),_&&l.get_array(_).push([r,r]),this._pad_empty_columns(l,[h,_]);else if("edit"==t){if(h){const e=l.data[h][l.data[h].length-1];e[e.length-1]=o}if(_){const e=l.data[_][l.data[_].length-1];e[e.length-1]=r}}else if("add"==t){if(h){const e=l.data[h].length-1;let t=l.get_array(h)[e];const i=t[t.length-1];t[t.length-1]=o,(0,a.isArray)(t)||(t=Array.from(t),l.data[h][e]=t),t.push(i)}if(_){const e=l.data[_].length-1;let t=l.get_array(_)[e];const i=t[t.length-1];t[t.length-1]=r,(0,a.isArray)(t)||(t=Array.from(t),l.data[_][e]=t),t.push(i)}}this._emit_cds_changes(l,!0,!1,i)}_show_vertices(){if(!this.model.active)return;const e=[],t=[];for(let i=0;i<this.model.renderers.length;i++){const s=this.model.renderers[i],n=s.data_source,o=s.glyph,[r,a]=[o.xs.field,o.ys.field];if(r)for(const t of n.get_array(r))e.push(...t);if(a)for(const e of n.get_array(a))t.push(...e);this._drawing&&i==this.model.renderers.length-1&&(e.splice(e.length-1,1),t.splice(t.length-1,1))}this._set_vertices(e,t)}_doubletap(e){this.model.active&&(this._drawing?(this._drawing=!1,this._draw(e,"edit",!0)):(this._drawing=!0,this._draw(e,"new",!0)))}_move(e){this._drawing&&this._draw(e,"edit")}_remove(){const e=this.model.renderers[0],t=e.data_source,i=e.glyph,[s,n]=[i.xs.field,i.ys.field];if(s){const e=t.data[s].length-1,i=t.get_array(s)[e];i.splice(i.length-1,1)}if(n){const e=t.data[n].length-1,i=t.get_array(n)[e];i.splice(i.length-1,1)}this._emit_cds_changes(t)}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const t of this.model.renderers)e.keyCode===r.Keys.Backspace?this._delete_selected(t):e.keyCode==r.Keys.Esc&&(this._drawing&&(this._remove(),this._drawing=!1),t.data_source.selection_manager.clear())}_pan_start(e){this.model.drag&&(this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy])}_pan(e){if(null==this._basepoint||!this.model.drag)return;const[t,i]=this._basepoint;for(const s of this.model.renderers){const n=this._map_drag(t,i,s),o=this._map_drag(e.sx,e.sy,s);if(null==o||null==n)continue;const r=s.data_source,a=s.glyph,[l,c]=[a.xs.field,a.ys.field];if(!l&&!c)continue;const[h,_]=o,[u,d]=n,[p,m]=[h-u,_-d];for(const e of r.selected.indices){let t,i,s;l&&(i=r.data[l][e]),c?(s=r.data[c][e],t=s.length):t=i.length;for(let e=0;e<t;e++)i&&(i[e]+=p),s&&(s[e]+=m)}r.change.emit()}this._basepoint=[e.sx,e.sy]}_pan_end(e){if(this.model.drag){this._pan(e);for(const e of this.model.renderers)this._emit_cds_changes(e.data_source);this._basepoint=null}}activate(){if(this.model.vertex_renderer&&this.model.active){if(this._show_vertices(),!this._initialized)for(const e of this.model.renderers){const t=e.data_source;t.connect(t.properties.data.change,(()=>this._show_vertices()))}this._initialized=!0}}deactivate(){this._drawing&&(this._remove(),this._drawing=!1),this.model.vertex_renderer&&this._hide_vertices()}}i.PolyDrawToolView=h,h.__name__="PolyDrawToolView";class _ extends l.PolyTool{constructor(e){super(e),this.tool_name="Polygon Draw Tool",this.icon=c.tool_icon_poly_draw,this.event_type=["pan","tap","move"],this.default_order=3}}i.PolyDrawTool=_,o=_,_.__name__="PolyDrawTool",o.prototype.default_view=h,o.define((({Boolean:e,Int:t})=>({drag:[e,!0],num_objects:[t,0]})))},function(e,t,i,s,n){var o;s();const r=e(8),a=e(370);class l extends a.EditToolView{_set_vertices(e,t){const i=this.model.vertex_renderer.glyph,s=this.model.vertex_renderer.data_source,[n,o]=[i.x.field,i.y.field];n&&((0,r.isArray)(e)?s.data[n]=e:i.x={value:e}),o&&((0,r.isArray)(t)?s.data[o]=t:i.y={value:t}),this._emit_cds_changes(s,!0,!0,!1)}_hide_vertices(){this._set_vertices([],[])}_snap_to_vertex(e,t,i){if(this.model.vertex_renderer){const s=this._select_event(e,"replace",[this.model.vertex_renderer]),n=this.model.vertex_renderer.data_source,o=this.model.vertex_renderer.glyph,[r,a]=[o.x.field,o.y.field];if(s.length){const e=n.selected.indices[0];r&&(t=n.data[r][e]),a&&(i=n.data[a][e]),n.selection_manager.clear()}}return[t,i]}}i.PolyToolView=l,l.__name__="PolyToolView";class c extends a.EditTool{constructor(e){super(e)}}i.PolyTool=c,o=c,c.__name__="PolyTool",o.define((({AnyRef:e})=>({vertex_renderer:[e()]})))},function(e,t,i,s,n){var o;s();const r=e(43),a=e(8),l=e(375),c=e(228);class h extends l.PolyToolView{constructor(){super(...arguments),this._drawing=!1,this._cur_index=null}_doubletap(e){if(!this.model.active)return;const t=this._map_drag(e.sx,e.sy,this.model.vertex_renderer);if(null==t)return;const[i,s]=t,n=this._select_event(e,"replace",[this.model.vertex_renderer]),o=this.model.vertex_renderer.data_source,r=this.model.vertex_renderer.glyph,[a,l]=[r.x.field,r.y.field];if(n.length&&null!=this._selected_renderer){const e=o.selected.indices[0];this._drawing?(this._drawing=!1,o.selection_manager.clear()):(o.selected.indices=[e+1],a&&o.get_array(a).splice(e+1,0,i),l&&o.get_array(l).splice(e+1,0,s),this._drawing=!0),o.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}else this._show_vertices(e)}_show_vertices(e){if(!this.model.active)return;const t=this.model.renderers[0],i=()=>this._update_vertices(t),s=null==t?void 0:t.data_source,n=this._select_event(e,"replace",this.model.renderers);if(!n.length)return this._set_vertices([],[]),this._selected_renderer=null,this._drawing=!1,this._cur_index=null,void(null!=s&&s.disconnect(s.properties.data.change,i));null!=s&&s.connect(s.properties.data.change,i),this._cur_index=n[0].data_source.selected.indices[0],this._update_vertices(n[0])}_update_vertices(e){const t=e.glyph,i=e.data_source,s=this._cur_index,[n,o]=[t.xs.field,t.ys.field];if(this._drawing)return;if(null==s&&(n||o))return;let r,l;n&&null!=s?(r=i.data[n][s],(0,a.isArray)(r)||(i.data[n][s]=r=Array.from(r))):r=t.xs.value,o&&null!=s?(l=i.data[o][s],(0,a.isArray)(l)||(i.data[o][s]=l=Array.from(l))):l=t.ys.value,this._selected_renderer=e,this._set_vertices(r,l)}_move(e){if(this._drawing&&null!=this._selected_renderer){const t=this.model.vertex_renderer,i=t.data_source,s=t.glyph,n=this._map_drag(e.sx,e.sy,t);if(null==n)return;let[o,r]=n;const a=i.selected.indices;[o,r]=this._snap_to_vertex(e,o,r),i.selected.indices=a;const[l,c]=[s.x.field,s.y.field],h=a[0];l&&(i.data[l][h]=o),c&&(i.data[c][h]=r),i.change.emit(),this._selected_renderer.data_source.change.emit()}}_tap(e){const t=this.model.vertex_renderer,i=this._map_drag(e.sx,e.sy,t);if(null==i)return;if(this._drawing&&this._selected_renderer){let[s,n]=i;const o=t.data_source,r=t.glyph,[a,l]=[r.x.field,r.y.field],c=o.selected.indices;[s,n]=this._snap_to_vertex(e,s,n);const h=c[0];if(o.selected.indices=[h+1],a){const e=o.get_array(a),t=e[h];e[h]=s,e.splice(h+1,0,t)}if(l){const e=o.get_array(l),t=e[h];e[h]=n,e.splice(h+1,0,t)}return o.change.emit(),void this._emit_cds_changes(this._selected_renderer.data_source,!0,!1,!0)}const s=this._select_mode(e);this._select_event(e,s,[t]),this._select_event(e,s,this.model.renderers)}_remove_vertex(){if(!this._drawing||!this._selected_renderer)return;const e=this.model.vertex_renderer,t=e.data_source,i=e.glyph,s=t.selected.indices[0],[n,o]=[i.x.field,i.y.field];n&&t.get_array(n).splice(s,1),o&&t.get_array(o).splice(s,1),t.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}_pan_start(e){this._select_event(e,"append",[this.model.vertex_renderer]),this._basepoint=[e.sx,e.sy]}_pan(e){null!=this._basepoint&&(this._drag_points(e,[this.model.vertex_renderer]),this._selected_renderer&&this._selected_renderer.data_source.change.emit())}_pan_end(e){null!=this._basepoint&&(this._drag_points(e,[this.model.vertex_renderer]),this._emit_cds_changes(this.model.vertex_renderer.data_source,!1,!0,!0),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null)}_keyup(e){if(!this.model.active||!this._mouse_in_frame)return;let t;t=this._selected_renderer?[this.model.vertex_renderer]:this.model.renderers;for(const i of t)e.keyCode===r.Keys.Backspace?(this._delete_selected(i),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source)):e.keyCode==r.Keys.Esc&&(this._drawing?(this._remove_vertex(),this._drawing=!1):this._selected_renderer&&this._hide_vertices(),i.data_source.selection_manager.clear())}deactivate(){this._selected_renderer&&(this._drawing&&(this._remove_vertex(),this._drawing=!1),this._hide_vertices())}}i.PolyEditToolView=h,h.__name__="PolyEditToolView";class _ extends l.PolyTool{constructor(e){super(e),this.tool_name="Poly Edit Tool",this.icon=c.tool_icon_poly_edit,this.event_type=["tap","pan","move"],this.default_order=4}}i.PolyEditTool=_,o=_,_.__name__="PolyEditTool",o.prototype.default_view=h},function(e,t,i,s,n){var o;s();const r=e(378),a=e(116),l=e(20),c=e(228);class h extends r.SelectToolView{_compute_limits(e){const t=this.plot_view.frame,i=this.model.dimensions;let s=this._base_point;if("center"==this.model.origin){const[t,i]=s,[n,o]=e;s=[t-(n-t),i-(o-i)]}return this.model._get_dim_limits(s,e,t,i)}_pan_start(e){const{sx:t,sy:i}=e;this._base_point=[t,i]}_pan(e){const{sx:t,sy:i}=e,s=[t,i],[n,o]=this._compute_limits(s);this.model.overlay.update({left:n[0],right:n[1],top:o[0],bottom:o[1]}),this.model.select_every_mousemove&&this._do_select(n,o,!1,this._select_mode(e))}_pan_end(e){const{sx:t,sy:i}=e,s=[t,i],[n,o]=this._compute_limits(s);this._do_select(n,o,!0,this._select_mode(e)),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.state.push("box_select",{selection:this.plot_view.get_selection()})}_do_select([e,t],[i,s],n,o="replace"){const r={type:"rect",sx0:e,sx1:t,sy0:i,sy1:s};this._select(r,n,o)}}i.BoxSelectToolView=h,h.__name__="BoxSelectToolView";const _=()=>new a.BoxAnnotation({level:"overlay",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class u extends r.SelectTool{constructor(e){super(e),this.tool_name="Box Select",this.icon=c.tool_icon_box_select,this.event_type="pan",this.default_order=30}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.BoxSelectTool=u,o=u,u.__name__="BoxSelectTool",o.prototype.default_view=h,o.define((({Boolean:e,Ref:t})=>({dimensions:[l.Dimensions,"both"],select_every_mousemove:[e,!1],overlay:[t(a.BoxAnnotation),_],origin:[l.BoxOrigin,"corner"]}))),o.register_alias("box_select",(()=>new u)),o.register_alias("xbox_select",(()=>new u({dimensions:"width"}))),o.register_alias("ybox_select",(()=>new u({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(223),a=e(175),l=e(339),c=e(176),h=e(66),_=e(20),u=e(43),d=e(251),p=e(15),m=e(11);class g extends r.GestureToolView{connect_signals(){super.connect_signals(),this.model.clear.connect((()=>this._clear()))}get computed_renderers(){const{renderers:e,names:t}=this.model,i=this.plot_model.data_renderers;return(0,h.compute_renderers)(e,i,t)}_computed_renderers_by_data_source(){var e;const t=new Map;for(const i of this.computed_renderers){let s;if(i instanceof a.GlyphRenderer)s=i.data_source;else{if(!(i instanceof l.GraphRenderer))continue;s=i.node_renderer.data_source}const n=null!==(e=t.get(s))&&void 0!==e?e:[];t.set(s,[...n,i])}return t}_select_mode(e){const{shiftKey:t,ctrlKey:i}=e;return t||i?t&&!i?"append":!t&&i?"intersect":t&&i?"subtract":void(0,m.unreachable)():this.model.mode}_keyup(e){e.keyCode==u.Keys.Esc&&this._clear()}_clear(){for(const t of this.computed_renderers)t.get_selection_manager().clear();const e=this.computed_renderers.map((e=>this.plot_view.renderer_view(e)));this.plot_view.request_paint(e)}_select(e,t,i){const s=this._computed_renderers_by_data_source();for(const[,n]of s){const s=n[0].get_selection_manager(),o=[];for(const e of n){const t=this.plot_view.renderer_view(e);null!=t&&o.push(t)}s.select(o,e,t,i)}null!=this.model.callback&&this._emit_callback(e),this._emit_selection_event(e,t)}_emit_selection_event(e,t=!0){const{x_scale:i,y_scale:s}=this.plot_view.frame;let n;switch(e.type){case"point":{const{sx:t,sy:o}=e,r=i.invert(t),a=s.invert(o);n=Object.assign(Object.assign({},e),{x:r,y:a});break}case"span":{const{sx:t,sy:o}=e,r=i.invert(t),a=s.invert(o);n=Object.assign(Object.assign({},e),{x:r,y:a});break}case"rect":{const{sx0:t,sx1:o,sy0:r,sy1:a}=e,[l,c]=i.r_invert(t,o),[h,_]=s.r_invert(r,a);n=Object.assign(Object.assign({},e),{x0:l,y0:h,x1:c,y1:_});break}case"poly":{const{sx:t,sy:o}=e,r=i.v_invert(t),a=s.v_invert(o);n=Object.assign(Object.assign({},e),{x:r,y:a});break}}this.plot_model.trigger_event(new d.SelectionGeometry(n,t))}}i.SelectToolView=g,g.__name__="SelectToolView";class f extends r.GestureTool{constructor(e){super(e)}initialize(){super.initialize(),this.clear=new p.Signal0(this,"clear")}get menu(){return[{icon:"bk-tool-icon-replace-mode",tooltip:"Replace the current selection",active:()=>"replace"==this.mode,handler:()=>{this.mode="replace",this.active=!0}},{icon:"bk-tool-icon-append-mode",tooltip:"Append to the current selection (Shift)",active:()=>"append"==this.mode,handler:()=>{this.mode="append",this.active=!0}},{icon:"bk-tool-icon-intersect-mode",tooltip:"Intersect with the current selection (Ctrl)",active:()=>"intersect"==this.mode,handler:()=>{this.mode="intersect",this.active=!0}},{icon:"bk-tool-icon-subtract-mode",tooltip:"Subtract from the current selection (Shift+Ctrl)",active:()=>"subtract"==this.mode,handler:()=>{this.mode="subtract",this.active=!0}},null,{icon:"bk-tool-icon-clear-selection",tooltip:"Clear the current selection (Esc)",handler:()=>{this.clear.emit()}}]}}i.SelectTool=f,o=f,f.__name__="SelectTool",o.define((({String:e,Array:t,Ref:i,Or:s,Auto:n})=>({renderers:[s(t(i(c.DataRenderer)),n),"auto"],names:[t(e),[]],mode:[_.SelectionMode,"replace"]})))},function(e,t,i,s,n){var o;s();const r=e(223),a=e(116),l=e(20),c=e(228);class h extends r.GestureToolView{_match_aspect(e,t,i){const s=i.bbox.aspect,n=i.bbox.h_range.end,o=i.bbox.h_range.start,r=i.bbox.v_range.end,a=i.bbox.v_range.start;let l=Math.abs(e[0]-t[0]),c=Math.abs(e[1]-t[1]);const h=0==c?0:l/c,[_]=h>=s?[1,h/s]:[s/h,1];let u,d,p,m;return e[0]<=t[0]?(u=e[0],d=e[0]+l*_,d>n&&(d=n)):(d=e[0],u=e[0]-l*_,u<o&&(u=o)),l=Math.abs(d-u),e[1]<=t[1]?(m=e[1],p=e[1]+l/s,p>r&&(p=r)):(p=e[1],m=e[1]-l/s,m<a&&(m=a)),c=Math.abs(p-m),e[0]<=t[0]?d=e[0]+s*c:u=e[0]-s*c,[[u,d],[m,p]]}_compute_limits(e){const t=this.plot_view.frame,i=this.model.dimensions;let s,n,o=this._base_point;if("center"==this.model.origin){const[t,i]=o,[s,n]=e;o=[t-(s-t),i-(n-i)]}return this.model.match_aspect&&"both"==i?[s,n]=this._match_aspect(o,e,t):[s,n]=this.model._get_dim_limits(o,e,t,i),[s,n]}_pan_start(e){this._base_point=[e.sx,e.sy]}_pan(e){const t=[e.sx,e.sy],[i,s]=this._compute_limits(t);this.model.overlay.update({left:i[0],right:i[1],top:s[0],bottom:s[1]})}_pan_end(e){const t=[e.sx,e.sy],[i,s]=this._compute_limits(t);this._update(i,s),this.model.overlay.update({left:null,right:null,top:null,bottom:null}),this._base_point=null,this.plot_view.trigger_ranges_update_event()}_update([e,t],[i,s]){if(Math.abs(t-e)<=5||Math.abs(s-i)<=5)return;const{x_scales:n,y_scales:o}=this.plot_view.frame,r=new Map;for(const[c,h]of n){const[i,s]=h.r_invert(e,t);r.set(c,{start:i,end:s})}const a=new Map;for(const[c,h]of o){const[e,t]=h.r_invert(i,s);a.set(c,{start:e,end:t})}const l={xrs:r,yrs:a};this.plot_view.state.push("box_zoom",{range:l}),this.plot_view.update_range(l)}}i.BoxZoomToolView=h,h.__name__="BoxZoomToolView";const _=()=>new a.BoxAnnotation({level:"overlay",top_units:"screen",left_units:"screen",bottom_units:"screen",right_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class u extends r.GestureTool{constructor(e){super(e),this.tool_name="Box Zoom",this.icon=c.tool_icon_box_zoom,this.event_type="pan",this.default_order=20}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.BoxZoomTool=u,o=u,u.__name__="BoxZoomTool",o.prototype.default_view=h,o.define((({Boolean:e,Ref:t})=>({dimensions:[l.Dimensions,"both"],overlay:[t(a.BoxAnnotation),_],match_aspect:[e,!1],origin:[l.BoxOrigin,"corner"]}))),o.register_alias("box_zoom",(()=>new u({dimensions:"both"}))),o.register_alias("xbox_zoom",(()=>new u({dimensions:"width"}))),o.register_alias("ybox_zoom",(()=>new u({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(378),a=e(217),l=e(381),c=e(43),h=e(228);class _ extends r.SelectToolView{constructor(){super(...arguments),this.sxs=[],this.sys=[]}connect_signals(){super.connect_signals(),this.connect(this.model.properties.active.change,(()=>this._active_change()))}_active_change(){this.model.active||this._clear_overlay()}_keyup(e){e.keyCode==c.Keys.Enter&&this._clear_overlay()}_pan_start(e){this.sxs=[],this.sys=[];const{sx:t,sy:i}=e;this._append_overlay(t,i)}_pan(e){const[t,i]=this.plot_view.frame.bbox.clip(e.sx,e.sy);this._append_overlay(t,i),this.model.select_every_mousemove&&this._do_select(this.sxs,this.sys,!1,this._select_mode(e))}_pan_end(e){const{sxs:t,sys:i}=this;this._clear_overlay(),this._do_select(t,i,!0,this._select_mode(e)),this.plot_view.state.push("lasso_select",{selection:this.plot_view.get_selection()})}_append_overlay(e,t){const{sxs:i,sys:s}=this;i.push(e),s.push(t),this.model.overlay.update({xs:i,ys:s})}_clear_overlay(){this.sxs=[],this.sys=[],this.model.overlay.update({xs:this.sxs,ys:this.sys})}_do_select(e,t,i,s){const n={type:"poly",sx:e,sy:t};this._select(n,i,s)}}i.LassoSelectToolView=_,_.__name__="LassoSelectToolView";class u extends r.SelectTool{constructor(e){super(e),this.tool_name="Lasso Select",this.icon=h.tool_icon_lasso_select,this.event_type="pan",this.default_order=12}}i.LassoSelectTool=u,o=u,u.__name__="LassoSelectTool",o.prototype.default_view=_,o.define((({Boolean:e,Ref:t})=>({select_every_mousemove:[e,!0],overlay:[t(a.PolyAnnotation),l.DEFAULT_POLY_OVERLAY]}))),o.register_alias("lasso_select",(()=>new u))},function(e,t,i,s,n){var o;s();const r=e(378),a=e(217),l=e(43),c=e(9),h=e(228);class _ extends r.SelectToolView{initialize(){super.initialize(),this.data={sx:[],sy:[]}}connect_signals(){super.connect_signals(),this.connect(this.model.properties.active.change,(()=>this._active_change()))}_active_change(){this.model.active||this._clear_data()}_keyup(e){e.keyCode==l.Keys.Enter&&this._clear_data()}_doubletap(e){this._do_select(this.data.sx,this.data.sy,!0,this._select_mode(e)),this.plot_view.state.push("poly_select",{selection:this.plot_view.get_selection()}),this._clear_data()}_clear_data(){this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})}_tap(e){const{sx:t,sy:i}=e;this.plot_view.frame.bbox.contains(t,i)&&(this.data.sx.push(t),this.data.sy.push(i),this.model.overlay.update({xs:(0,c.copy)(this.data.sx),ys:(0,c.copy)(this.data.sy)}))}_do_select(e,t,i,s){const n={type:"poly",sx:e,sy:t};this._select(n,i,s)}}i.PolySelectToolView=_,_.__name__="PolySelectToolView",i.DEFAULT_POLY_OVERLAY=()=>new a.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class u extends r.SelectTool{constructor(e){super(e),this.tool_name="Poly Select",this.icon=h.tool_icon_polygon_select,this.event_type="tap",this.default_order=11}}i.PolySelectTool=u,o=u,u.__name__="PolySelectTool",o.prototype.default_view=_,o.define((({Ref:e})=>({overlay:[e(a.PolyAnnotation),i.DEFAULT_POLY_OVERLAY]}))),o.register_alias("poly_select",(()=>new u))},function(e,t,i,s,n){var o;s();const r=e(20),a=e(383),l=e(228);class c extends a.LineToolView{constructor(){super(...arguments),this._drawing=!1}_doubletap(e){if(!this.model.active)return;const t=this.model.renderers;for(const i of t)1==this._select_event(e,"replace",[i]).length&&(this._selected_renderer=i);this._show_intersections(),this._update_line_cds()}_show_intersections(){if(!this.model.active)return;if(null==this._selected_renderer)return;if(!this.model.renderers.length)return this._set_intersection([],[]),this._selected_renderer=null,void(this._drawing=!1);const e=this._selected_renderer.data_source,t=this._selected_renderer.glyph,[i,s]=[t.x.field,t.y.field],n=e.get_array(i),o=e.get_array(s);this._set_intersection(n,o)}_tap(e){const t=this.model.intersection_renderer;if(null==this._map_drag(e.sx,e.sy,t))return;if(this._drawing&&this._selected_renderer){const i=this._select_mode(e);if(0==this._select_event(e,i,[t]).length)return}const i=this._select_mode(e);this._select_event(e,i,[t]),this._select_event(e,i,this.model.renderers)}_update_line_cds(){if(null==this._selected_renderer)return;const e=this.model.intersection_renderer.glyph,t=this.model.intersection_renderer.data_source,[i,s]=[e.x.field,e.y.field];if(i&&s){const e=t.data[i],n=t.data[s];this._selected_renderer.data_source.data[i]=e,this._selected_renderer.data_source.data[s]=n}this._emit_cds_changes(this._selected_renderer.data_source,!0,!0,!1)}_pan_start(e){this._select_event(e,"append",[this.model.intersection_renderer]),this._basepoint=[e.sx,e.sy]}_pan(e){null!=this._basepoint&&(this._drag_points(e,[this.model.intersection_renderer],this.model.dimensions),this._selected_renderer&&this._selected_renderer.data_source.change.emit())}_pan_end(e){null!=this._basepoint&&(this._drag_points(e,[this.model.intersection_renderer]),this._emit_cds_changes(this.model.intersection_renderer.data_source,!1,!0,!0),this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null)}activate(){this._drawing=!0}deactivate(){this._selected_renderer&&(this._drawing&&(this._drawing=!1),this._hide_intersections())}}i.LineEditToolView=c,c.__name__="LineEditToolView";class h extends a.LineTool{constructor(e){super(e),this.tool_name="Line Edit Tool",this.icon=l.tool_icon_line_edit,this.event_type=["tap","pan","move"],this.default_order=4}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.LineEditTool=h,o=h,h.__name__="LineEditTool",o.prototype.default_view=c,o.define((()=>({dimensions:[r.Dimensions,"both"]})))},function(e,t,i,s,n){var o;s();const r=e(8),a=e(370);class l extends a.EditToolView{_set_intersection(e,t){const i=this.model.intersection_renderer.glyph,s=this.model.intersection_renderer.data_source,[n,o]=[i.x.field,i.y.field];n&&((0,r.isArray)(e)?s.data[n]=e:i.x={value:e}),o&&((0,r.isArray)(t)?s.data[o]=t:i.y={value:t}),this._emit_cds_changes(s,!0,!0,!1)}_hide_intersections(){this._set_intersection([],[])}}i.LineToolView=l,l.__name__="LineToolView";class c extends a.EditTool{constructor(e){super(e)}}i.LineTool=c,o=c,c.__name__="LineTool",o.define((({AnyRef:e})=>({intersection_renderer:[e()]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(223),l=e(20),c=(0,o.__importStar)(e(228));function h(e,t,i){const s=new Map;for(const[n,o]of e){const[e,r]=o.r_invert(t,i);s.set(n,{start:e,end:r})}return s}i.update_ranges=h;class _ extends a.GestureToolView{_pan_start(e){var t;this.last_dx=0,this.last_dy=0;const{sx:i,sy:s}=e,n=this.plot_view.frame.bbox;if(!n.contains(i,s)){const e=n.h_range,t=n.v_range;(i<e.start||i>e.end)&&(this.v_axis_only=!0),(s<t.start||s>t.end)&&(this.h_axis_only=!0)}null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model)}_pan(e){var t;this._update(e.deltaX,e.deltaY),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model)}_pan_end(e){this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info&&this.plot_view.state.push("pan",{range:this.pan_info}),this.plot_view.trigger_ranges_update_event()}_update(e,t){const i=this.plot_view.frame,s=e-this.last_dx,n=t-this.last_dy,o=i.bbox.h_range,r=o.start-s,a=o.end-s,l=i.bbox.v_range,c=l.start-n,_=l.end-n,u=this.model.dimensions;let d,p,m,g,f,b;"width"!=u&&"both"!=u||this.v_axis_only?(d=o.start,p=o.end,m=0):(d=r,p=a,m=-s),"height"!=u&&"both"!=u||this.h_axis_only?(g=l.start,f=l.end,b=0):(g=c,f=_,b=-n),this.last_dx=e,this.last_dy=t;const{x_scales:y,y_scales:v}=i,x=h(y,d,p),w=h(v,g,f);this.pan_info={xrs:x,yrs:w,sdx:m,sdy:b},this.plot_view.update_range(this.pan_info,{panning:!0})}}i.PanToolView=_,_.__name__="PanToolView";class u extends a.GestureTool{constructor(e){super(e),this.tool_name="Pan",this.event_type="pan",this.default_order=10}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.PanTool=u,r=u,u.__name__="PanTool",r.prototype.default_view=_,r.define((()=>({dimensions:[l.Dimensions,"both",{on_update(e,t){switch(e){case"both":t.icon=c.tool_icon_pan;break;case"width":t.icon=c.tool_icon_xpan;break;case"height":t.icon=c.tool_icon_ypan}}}]}))),r.register_alias("pan",(()=>new u({dimensions:"both"}))),r.register_alias("xpan",(()=>new u({dimensions:"width"}))),r.register_alias("ypan",(()=>new u({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(116),a=e(58),l=e(19),c=e(223),h=e(228);function _(e){switch(e){case 1:return 2;case 2:return 1;case 4:return 5;case 5:return 4;default:return e}}function u(e,t,i,s){if(null==t)return!1;const n=i.compute(t);return Math.abs(e-n)<s}function d(e,t,i,s,n){let o=!0;if(null!=n.left&&null!=n.right){const t=i.invert(e);(t<n.left||t>n.right)&&(o=!1)}if(null!=n.bottom&&null!=n.top){const e=s.invert(t);(e<n.bottom||e>n.top)&&(o=!1)}return o}function p(e,t,i){let s=0;return e>=i.start&&e<=i.end&&(s+=1),t>=i.start&&t<=i.end&&(s+=1),s}function m(e,t,i,s){const n=t.compute(e),o=t.invert(n+i);return o>=s.start&&o<=s.end?o:e}function g(e,t,i){return e>t.start?(t.end=e,i):(t.end=t.start,t.start=e,_(i))}function f(e,t,i){return e<t.end?(t.start=e,i):(t.start=t.end,t.end=e,_(i))}function b(e,t,i,s){const[n,o]=t.r_compute(e.start,e.end),[r,a]=t.r_invert(n+i,o+i),l=p(e.start,e.end,s);p(r,a,s)>=l&&(e.start=r,e.end=a)}i.flip_side=_,i.is_near=u,i.is_inside=d,i.sides_inside=p,i.compute_value=m,i.update_range_end_side=g,i.update_range_start_side=f,i.update_range=b;class y extends c.GestureToolView{initialize(){super.initialize(),this.side=0,this.model.update_overlay_from_ranges()}connect_signals(){super.connect_signals(),null!=this.model.x_range&&this.connect(this.model.x_range.change,(()=>this.model.update_overlay_from_ranges())),null!=this.model.y_range&&this.connect(this.model.y_range.change,(()=>this.model.update_overlay_from_ranges()))}_pan_start(e){this.last_dx=0,this.last_dy=0;const t=this.model.x_range,i=this.model.y_range,{frame:s}=this.plot_view,n=s.x_scale,o=s.y_scale,a=this.model.overlay,{left:l,right:c,top:h,bottom:_}=a,p=this.model.overlay.line_width+r.EDGE_TOLERANCE;null!=t&&this.model.x_interaction&&(u(e.sx,l,n,p)?this.side=1:u(e.sx,c,n,p)?this.side=2:d(e.sx,e.sy,n,o,a)&&(this.side=3)),null!=i&&this.model.y_interaction&&(0==this.side&&u(e.sy,_,o,p)&&(this.side=4),0==this.side&&u(e.sy,h,o,p)?this.side=5:d(e.sx,e.sy,n,o,this.model.overlay)&&(3==this.side?this.side=7:this.side=6))}_pan(e){const t=this.plot_view.frame,i=e.deltaX-this.last_dx,s=e.deltaY-this.last_dy,n=this.model.x_range,o=this.model.y_range,r=t.x_scale,a=t.y_scale;if(null!=n)if(3==this.side||7==this.side)b(n,r,i,t.x_range);else if(1==this.side){const e=m(n.start,r,i,t.x_range);this.side=f(e,n,this.side)}else if(2==this.side){const e=m(n.end,r,i,t.x_range);this.side=g(e,n,this.side)}if(null!=o)if(6==this.side||7==this.side)b(o,a,s,t.y_range);else if(4==this.side){const e=m(o.start,a,s,t.y_range);this.side=f(e,o,this.side)}else if(5==this.side){const e=m(o.end,a,s,t.y_range);this.side=g(e,o,this.side)}this.last_dx=e.deltaX,this.last_dy=e.deltaY}_pan_end(e){this.side=0,this.plot_view.trigger_ranges_update_event()}}i.RangeToolView=y,y.__name__="RangeToolView";const v=()=>new r.BoxAnnotation({level:"overlay",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:.5,line_dash:[2,2]});class x extends c.GestureTool{constructor(e){super(e),this.tool_name="Range Tool",this.icon=h.tool_icon_range,this.event_type="pan",this.default_order=1}initialize(){super.initialize(),this.overlay.in_cursor="grab",this.overlay.ew_cursor=null!=this.x_range&&this.x_interaction?"ew-resize":null,this.overlay.ns_cursor=null!=this.y_range&&this.y_interaction?"ns-resize":null}update_overlay_from_ranges(){null==this.x_range&&null==this.y_range&&(this.overlay.left=null,this.overlay.right=null,this.overlay.bottom=null,this.overlay.top=null,l.logger.warn("RangeTool not configured with any Ranges.")),null==this.x_range?(this.overlay.left=null,this.overlay.right=null):(this.overlay.left=this.x_range.start,this.overlay.right=this.x_range.end),null==this.y_range?(this.overlay.bottom=null,this.overlay.top=null):(this.overlay.bottom=this.y_range.start,this.overlay.top=this.y_range.end)}}i.RangeTool=x,o=x,x.__name__="RangeTool",o.prototype.default_view=y,o.define((({Boolean:e,Ref:t,Nullable:i})=>({x_range:[i(t(a.Range1d)),null],x_interaction:[e,!0],y_range:[i(t(a.Range1d)),null],y_interaction:[e,!0],overlay:[t(r.BoxAnnotation),v]})))},function(e,t,i,s,n){var o;s();const r=e(378),a=e(20),l=e(228);class c extends r.SelectToolView{_tap(e){"tap"==this.model.gesture&&this._handle_tap(e)}_doubletap(e){"doubletap"==this.model.gesture&&this._handle_tap(e)}_handle_tap(e){const{sx:t,sy:i}=e,s={type:"point",sx:t,sy:i};this._select(s,!0,this._select_mode(e))}_select(e,t,i){const{callback:s}=this.model;if("select"==this.model.behavior){const n=this._computed_renderers_by_data_source();for(const[,o]of n){const n=o[0].get_selection_manager(),r=o.map((e=>this.plot_view.renderer_view(e))).filter((e=>null!=e));if(n.select(r,e,t,i)&&null!=s){const t=r[0].coordinates.x_scale.invert(e.sx),i=r[0].coordinates.y_scale.invert(e.sy),o={geometries:Object.assign(Object.assign({},e),{x:t,y:i}),source:n.source};s.execute(this.model,o)}}this._emit_selection_event(e),this.plot_view.state.push("tap",{selection:this.plot_view.get_selection()})}else for(const n of this.computed_renderers){const t=this.plot_view.renderer_view(n);if(null==t)continue;const i=n.get_selection_manager();if(i.inspect(t,e)&&null!=s){const n=t.coordinates.x_scale.invert(e.sx),o=t.coordinates.y_scale.invert(e.sy),r={geometries:Object.assign(Object.assign({},e),{x:n,y:o}),source:i.source};s.execute(this.model,r)}}}}i.TapToolView=c,c.__name__="TapToolView";class h extends r.SelectTool{constructor(e){super(e),this.tool_name="Tap",this.icon=l.tool_icon_tap_select,this.event_type="tap",this.default_order=10}}i.TapTool=h,o=h,h.__name__="TapTool",o.prototype.default_view=c,o.define((({Any:e,Enum:t,Nullable:i})=>({behavior:[a.TapBehavior,"select"],gesture:[t("tap","doubletap"),"tap"],callback:[i(e)]}))),o.register_alias("click",(()=>new h({behavior:"inspect"}))),o.register_alias("tap",(()=>new h)),o.register_alias("doubletap",(()=>new h({gesture:"doubletap"})))},function(e,t,i,s,n){var o;s();const r=e(223),a=e(20),l=e(228),c=e(384);class h extends r.GestureToolView{_scroll(e){let t=this.model.speed*e.delta;t>.9?t=.9:t<-.9&&(t=-.9),this._update_ranges(t)}_update_ranges(e){var t;const{frame:i}=this.plot_view,s=i.bbox.h_range,n=i.bbox.v_range,[o,r]=[s.start,s.end],[a,l]=[n.start,n.end];let h,_,u,d;switch(this.model.dimension){case"height":{const t=Math.abs(l-a);h=o,_=r,u=a-t*e,d=l-t*e;break}case"width":{const t=Math.abs(r-o);h=o-t*e,_=r-t*e,u=a,d=l;break}}const{x_scales:p,y_scales:m}=i,g={xrs:(0,c.update_ranges)(p,h,_),yrs:(0,c.update_ranges)(m,u,d),factor:e};this.plot_view.state.push("wheel_pan",{range:g}),this.plot_view.update_range(g,{scrolling:!0}),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model,(()=>this.plot_view.trigger_ranges_update_event()))}}i.WheelPanToolView=h,h.__name__="WheelPanToolView";class _ extends r.GestureTool{constructor(e){super(e),this.tool_name="Wheel Pan",this.icon=l.tool_icon_wheel_pan,this.event_type="scroll",this.default_order=12}get tooltip(){return this._get_dim_tooltip(this.dimension)}}i.WheelPanTool=_,o=_,_.__name__="WheelPanTool",o.prototype.default_view=h,o.define((()=>({dimension:[a.Dimension,"width"]}))),o.internal((({Number:e})=>({speed:[e,.001]}))),o.register_alias("xwheel_pan",(()=>new _({dimension:"width"}))),o.register_alias("ywheel_pan",(()=>new _({dimension:"height"})))},function(e,t,i,s,n){var o;s();const r=e(223),a=e(368),l=e(20),c=e(27),h=e(228);class _ extends r.GestureToolView{_pinch(e){const{sx:t,sy:i,scale:s,ctrlKey:n,shiftKey:o}=e;let r;r=s>=1?20*(s-1):-20/s,this._scroll({type:"wheel",sx:t,sy:i,delta:r,ctrlKey:n,shiftKey:o})}_scroll(e){var t;const{frame:i}=this.plot_view,s=i.bbox.h_range,n=i.bbox.v_range,{sx:o,sy:r}=e,l=this.model.dimensions,c=("width"==l||"both"==l)&&s.start<o&&o<s.end,h=("height"==l||"both"==l)&&n.start<r&&r<n.end;if(!(c&&h||this.model.zoom_on_axis))return;const _=this.model.speed*e.delta,u=(0,a.scale_range)(i,_,c,h,{x:o,y:r});this.plot_view.state.push("wheel_zoom",{range:u});const{maintain_focus:d}=this.model;this.plot_view.update_range(u,{scrolling:!0,maintain_focus:d}),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_model,(()=>this.plot_view.trigger_ranges_update_event()))}}i.WheelZoomToolView=_,_.__name__="WheelZoomToolView";class u extends r.GestureTool{constructor(e){super(e),this.tool_name="Wheel Zoom",this.icon=h.tool_icon_wheel_zoom,this.event_type=c.is_mobile?"pinch":"scroll",this.default_order=10}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.WheelZoomTool=u,o=u,u.__name__="WheelZoomTool",o.prototype.default_view=_,o.define((({Boolean:e,Number:t})=>({dimensions:[l.Dimensions,"both"],maintain_focus:[e,!0],zoom_on_axis:[e,!0],speed:[t,1/600]}))),o.register_alias("wheel_zoom",(()=>new u({dimensions:"both"}))),o.register_alias("xwheel_zoom",(()=>new u({dimensions:"width"}))),o.register_alias("ywheel_zoom",(()=>new u({dimensions:"height"})))},function(e,t,i,s,n){var o;s();const r=e(232),a=e(219),l=e(20),c=e(13),h=e(228);class _ extends r.InspectToolView{_move(e){if(!this.model.active)return;const{sx:t,sy:i}=e;this.plot_view.frame.bbox.contains(t,i)?this._update_spans(t,i):this._update_spans(null,null)}_move_exit(e){this._update_spans(null,null)}_update_spans(e,t){const i=this.model.dimensions;"width"!=i&&"both"!=i||(this.model.spans.width.location=t),"height"!=i&&"both"!=i||(this.model.spans.height.location=e)}}i.CrosshairToolView=_,_.__name__="CrosshairToolView";class u extends r.InspectTool{constructor(e){super(e),this.tool_name="Crosshair",this.icon=h.tool_icon_crosshair}get tooltip(){return this._get_dim_tooltip(this.dimensions)}get synthetic_renderers(){return(0,c.values)(this.spans)}}i.CrosshairTool=u,o=u,u.__name__="CrosshairTool",(()=>{function e(e,t){return new a.Span({for_hover:!0,dimension:t,location_units:"screen",level:"overlay",line_color:e.line_color,line_width:e.line_width,line_alpha:e.line_alpha})}o.prototype.default_view=_,o.define((({Alpha:e,Number:t,Color:i})=>({dimensions:[l.Dimensions,"both"],line_color:[i,"black"],line_width:[t,1],line_alpha:[e,1]}))),o.internal((({Struct:t,Ref:i})=>({spans:[t({width:i(a.Span),height:i(a.Span)}),t=>({width:e(t,"width"),height:e(t,"height")})]}))),o.register_alias("crosshair",(()=>new u))})()},function(e,t,i,s,n){var o;s();const r=e(53),a=e(13),l=e(34);class c extends r.Model{constructor(e){super(e)}get values(){return(0,a.values)(this.args)}_make_code(e,t,i,s){return new Function(...(0,a.keys)(this.args),e,t,i,(0,l.use_strict)(s))}format(e,t,i){return this._make_code("value","format","special_vars",this.code)(...this.values,e,t,i)}}i.CustomJSHover=c,o=c,c.__name__="CustomJSHover",o.define((({Unknown:e,String:t,Dict:i})=>({args:[i(e),{}],code:[t,""]})))},function(e,t,i,s,n){s();const o=e(1);var r;const a=e(232),l=e(390),c=e(241),h=e(175),_=e(339),u=e(176),d=e(177),p=e(283),m=e(186),g=e(187),f=e(189),b=(0,o.__importStar)(e(185)),y=e(152),v=e(43),x=e(22),w=e(13),A=e(234),k=e(8),S=e(113),T=e(20),C=e(228),M=e(15),z=e(66),E=(0,o.__importStar)(e(242)),R=e(392);function B(e,t,i,s,n,o){const r={x:n[e],y:o[e]},a={x:n[e+1],y:o[e+1]};let l,c;if("span"==t.type)"h"==t.direction?(l=Math.abs(r.x-i),c=Math.abs(a.x-i)):(l=Math.abs(r.y-s),c=Math.abs(a.y-s));else{const e={x:i,y:s};l=b.dist_2_pts(r,e),c=b.dist_2_pts(a,e)}return l<c?[[r.x,r.y],e]:[[a.x,a.y],e+1]}function N(e,t,i){return[[e[i],t[i]],i]}i._nearest_line_hit=B,i._line_hit=N;class O extends a.InspectToolView{initialize(){super.initialize(),this._ttmodels=new Map,this._ttviews=new Map}async lazy_initialize(){await super.lazy_initialize(),await this._update_ttmodels();const{tooltips:e}=this.model;e instanceof R.Template&&(this._template_view=await(0,S.build_view)(e,{parent:this}),this._template_view.render())}remove(){var e;null===(e=this._template_view)||void 0===e||e.remove(),(0,S.remove_views)(this._ttviews),super.remove()}connect_signals(){super.connect_signals();const e=this.plot_model.properties.renderers,{renderers:t,tooltips:i}=this.model.properties;this.on_change(i,(()=>delete this._template_el)),this.on_change([e,t,i],(async()=>await this._update_ttmodels()))}async _update_ttmodels(){const{_ttmodels:e,computed_renderers:t}=this;e.clear();const{tooltips:i}=this.model;if(null!=i)for(const r of this.computed_renderers){const t=new c.Tooltip({custom:(0,k.isString)(i)||(0,k.isFunction)(i),attachment:this.model.attachment,show_arrow:this.model.show_arrow});r instanceof h.GlyphRenderer?e.set(r,t):r instanceof _.GraphRenderer&&(e.set(r.node_renderer,t),e.set(r.edge_renderer,t))}const s=await(0,S.build_views)(this._ttviews,[...e.values()],{parent:this.plot_view});for(const r of s)r.render();const n=[...function*(){for(const e of t)e instanceof h.GlyphRenderer?yield e:e instanceof _.GraphRenderer&&(yield e.node_renderer,yield e.edge_renderer)}()],o=this._slots.get(this._update);if(null!=o){const e=new Set(n.map((e=>e.data_source)));M.Signal.disconnect_receiver(this,o,e)}for(const r of n)this.connect(r.data_source.inspect,this._update)}get computed_renderers(){const{renderers:e,names:t}=this.model,i=this.plot_model.data_renderers;return(0,z.compute_renderers)(e,i,t)}get ttmodels(){return this._ttmodels}_clear(){this._inspect(1/0,1/0);for(const[,e]of this.ttmodels)e.clear()}_move(e){if(!this.model.active)return;const{sx:t,sy:i}=e;this.plot_view.frame.bbox.contains(t,i)?this._inspect(t,i):this._clear()}_move_exit(){this._clear()}_inspect(e,t){let i;i="mouse"==this.model.mode?{type:"point",sx:e,sy:t}:{type:"span",direction:"vline"==this.model.mode?"h":"v",sx:e,sy:t};for(const s of this.computed_renderers){const e=s.get_selection_manager(),t=this.plot_view.renderer_view(s);null!=t&&e.inspect(t,i)}this._emit_callback(i)}_update([e,{geometry:t}]){var i,s;if(!this.model.active)return;if("point"!=t.type&&"span"!=t.type)return;if(!(e instanceof h.GlyphRenderer))return;if("ignore"==this.model.muted_policy&&e.muted)return;const n=this.ttmodels.get(e);if(null==n)return;const o=e.get_selection_manager(),r=o.inspectors.get(e),a=e.view.convert_selection_to_subset(r);if(r.is_empty()&&null==r.view)return void n.clear();const l=o.source,c=this.plot_view.renderer_view(e);if(null==c)return;const{sx:_,sy:u}=t,b=c.coordinates.x_scale,y=c.coordinates.y_scale,x=b.invert(_),A=y.invert(u),{glyph:k}=c,S=[];if(k instanceof m.PatchView){const[t,i]=[_,u],s={x:x,y:A,sx:_,sy:u,rx:t,ry:i,name:e.name};S.push([t,i,this._render_tooltips(l,-1,s)])}if(k instanceof g.HAreaView)for(const h of a.line_indices){const t=k._x1,i=k._x2,s=k._y,[n,o]=[_,u],r={index:h,x:x,y:A,sx:_,sy:u,data_x1:t,data_x2:i,data_y:s,rx:n,ry:o,indices:a.line_indices,name:e.name};S.push([n,o,this._render_tooltips(l,h,r)])}if(k instanceof f.VAreaView)for(const h of a.line_indices){const t=k._x,i=k._y1,s=k._y2,[n,o]=[_,u],r={index:h,x:x,y:A,sx:_,sy:u,data_x:t,data_y1:i,data_y2:s,rx:n,ry:o,indices:a.line_indices,name:e.name};S.push([n,o,this._render_tooltips(l,h,r)])}if(k instanceof d.LineView)for(const h of a.line_indices){let i,s,n=k._x[h+1],o=k._y[h+1],r=h;switch(this.model.line_policy){case"interp":[n,o]=k.get_interpolation_hit(h,t),i=b.compute(n),s=y.compute(o);break;case"prev":[[i,s],r]=N(k.sx,k.sy,h);break;case"next":[[i,s],r]=N(k.sx,k.sy,h+1);break;case"nearest":[[i,s],r]=B(h,t,_,u,k.sx,k.sy),n=k._x[r],o=k._y[r];break;default:[i,s]=[_,u]}const c={index:r,x:x,y:A,sx:_,sy:u,data_x:n,data_y:o,rx:i,ry:s,indices:a.line_indices,name:e.name};S.push([i,s,this._render_tooltips(l,r,c)])}for(const h of r.image_indices){const t={index:h.index,x:x,y:A,sx:_,sy:u,name:e.name},i=this._render_tooltips(l,h,t);S.push([_,u,i])}for(const d of a.indices)if(k instanceof p.MultiLineView&&!(0,w.isEmpty)(a.multiline_indices))for(const i of a.multiline_indices[d.toString()]){let s,n,o,r=k._xs.get(d)[i],c=k._ys.get(d)[i],p=i;switch(this.model.line_policy){case"interp":[r,c]=k.get_interpolation_hit(d,i,t),s=b.compute(r),n=y.compute(c);break;case"prev":[[s,n],p]=N(k.sxs.get(d),k.sys.get(d),i);break;case"next":[[s,n],p]=N(k.sxs.get(d),k.sys.get(d),i+1);break;case"nearest":[[s,n],p]=B(i,t,_,u,k.sxs.get(d),k.sys.get(d)),r=k._xs.get(d)[p],c=k._ys.get(d)[p];break;default:throw new Error("shouldn't have happened")}o=e instanceof h.GlyphRenderer?e.view.convert_indices_from_subset([d])[0]:d;const m={index:o,x:x,y:A,sx:_,sy:u,data_x:r,data_y:c,segment_index:p,indices:a.multiline_indices,name:e.name};S.push([s,n,this._render_tooltips(l,o,m)])}else{const t=null===(i=k._x)||void 0===i?void 0:i[d],n=null===(s=k._y)||void 0===s?void 0:s[d];let o,r,c;if("snap_to_data"==this.model.point_policy){let e=k.get_anchor_point(this.model.anchor,d,[_,u]);if(null==e&&(e=k.get_anchor_point("center",d,[_,u]),null==e))continue;o=e.x,r=e.y}else[o,r]=[_,u];c=e instanceof h.GlyphRenderer?e.view.convert_indices_from_subset([d])[0]:d;const p={index:c,x:x,y:A,sx:_,sy:u,data_x:t,data_y:n,indices:a.indices,name:e.name};S.push([o,r,this._render_tooltips(l,c,p)])}if(0==S.length)n.clear();else{const{content:e}=n;(0,v.empty)(n.content);for(const[,,s]of S)null!=s&&e.appendChild(s);const[t,i]=S[S.length-1];n.setv({position:[t,i]},{check_eq:!1})}}_emit_callback(e){const{callback:t}=this.model;if(null!=t)for(const i of this.computed_renderers){if(!(i instanceof h.GlyphRenderer))continue;const s=this.plot_view.renderer_view(i);if(null==s)continue;const{x_scale:n,y_scale:o}=s.coordinates,r=n.invert(e.sx),a=o.invert(e.sy),l=i.data_source.inspected;t.execute(this.model,{geometry:Object.assign({x:r,y:a},e),renderer:i,index:l})}}_create_template(e){const t=(0,v.div)({style:{display:"table",borderSpacing:"2px"}});for(const[i]of e){const e=(0,v.div)({style:{display:"table-row"}});t.appendChild(e);const s=(0,v.div)({style:{display:"table-cell"},class:E.tooltip_row_label},0!=i.length?`${i}: `:"");e.appendChild(s);const n=(0,v.span)();n.dataset.value="";const o=(0,v.span)({class:E.tooltip_color_block}," ");o.dataset.swatch="",(0,v.undisplay)(o);const r=(0,v.div)({style:{display:"table-cell"},class:E.tooltip_row_value},n,o);e.appendChild(r)}return t}_render_template(e,t,i,s,n){const o=e.cloneNode(!0),r=o.querySelectorAll("[data-value]"),a=o.querySelectorAll("[data-swatch]"),l=/\$color(\[.*\])?:(\w*)/,c=/\$swatch:(\w*)/;for(const[[,h],_]of(0,A.enumerate)(t)){const e=h.match(c),t=h.match(l);if(null!=e||null!=t){if(null!=e){const[,t]=e,n=i.get_column(t);if(null==n)r[_].textContent=`${t} unknown`;else{const e=(0,k.isNumber)(s)?n[s]:null;null!=e&&(a[_].style.backgroundColor=(0,x.color2css)(e),(0,v.display)(a[_]))}}if(null!=t){const[,e="",n]=t,o=i.get_column(n);if(null==o){r[_].textContent=`${n} unknown`;continue}const l=e.indexOf("hex")>=0,c=e.indexOf("swatch")>=0,h=(0,k.isNumber)(s)?o[s]:null;if(null==h){r[_].textContent="(null)";continue}r[_].textContent=l?(0,x.color2hex)(h):(0,x.color2css)(h),c&&(a[_].style.backgroundColor=(0,x.color2css)(h),(0,v.display)(a[_]))}}else{const e=(0,y.replace_placeholders)(h.replace("$~","$data_"),i,s,this.model.formatters,n);if((0,k.isString)(e))r[_].textContent=e;else for(const t of e)r[_].appendChild(t)}}return o}_render_tooltips(e,t,i){var s;const{tooltips:n}=this.model;if((0,k.isString)(n)){const s=(0,y.replace_placeholders)({html:n},e,t,this.model.formatters,i);return(0,v.div)(s)}if((0,k.isFunction)(n))return n(e,i);if(n instanceof R.Template)return this._template_view.update(e,t,i),this._template_view.el;if(null!=n){const o=null!==(s=this._template_el)&&void 0!==s?s:this._template_el=this._create_template(n);return this._render_template(o,n,e,t,i)}return null}}i.HoverToolView=O,O.__name__="HoverToolView";class D extends a.InspectTool{constructor(e){super(e),this.tool_name="Hover",this.icon=C.tool_icon_hover}}i.HoverTool=D,r=D,D.__name__="HoverTool",r.prototype.default_view=O,r.define((({Any:e,Boolean:t,String:i,Array:s,Tuple:n,Dict:o,Or:r,Ref:a,Function:c,Auto:h,Nullable:_})=>({tooltips:[_(r(a(R.Template),i,s(n(i,i)),c())),[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[o(r(a(l.CustomJSHover),y.FormatterType)),{}],renderers:[r(s(a(u.DataRenderer)),h),"auto"],names:[s(i),[]],mode:[T.HoverMode,"mouse"],muted_policy:[T.MutedPolicy,"show"],point_policy:[T.PointPolicy,"snap_to_data"],line_policy:[T.LinePolicy,"nearest"],show_arrow:[t,!0],anchor:[T.Anchor,"center"],attachment:[T.TooltipAttachment,"horizontal"],callback:[_(e)]}))),r.register_alias("hover",(()=>new D))},function(e,t,i,s,n){s();const o=e(1);var r,a,l,c,h,_,u,d,p,m,g,f,b;const y=e(53),v=e(309),x=e(393);n("Styles",x.Styles);const w=e(43),A=e(42),k=e(226),S=e(113),T=e(8),C=e(13),M=(0,o.__importStar)(e(242)),z=e(152);class E extends k.DOMView{}i.DOMNodeView=E,E.__name__="DOMNodeView";class R extends y.Model{constructor(e){super(e)}}i.DOMNode=R,R.__name__="DOMNode",R.__module__="bokeh.models.dom";class B extends E{render(){super.render(),this.el.textContent=this.model.content}_createElement(){return document.createTextNode("")}}i.TextView=B,B.__name__="TextView";class N extends R{constructor(e){super(e)}}i.Text=N,r=N,N.__name__="Text",r.prototype.default_view=B,r.define((({String:e})=>({content:[e,""]})));class O extends E{}i.PlaceholderView=O,O.__name__="PlaceholderView",O.tag_name="span";class D extends R{constructor(e){super(e)}}i.Placeholder=D,a=D,D.__name__="Placeholder",a.define((({})=>({})));class I extends O{update(e,t,i){this.el.textContent=t.toString()}}i.IndexView=I,I.__name__="IndexView";class P extends D{constructor(e){super(e)}}i.Index=P,l=P,P.__name__="Index",l.prototype.default_view=I,l.define((({})=>({})));class V extends O{update(e,t,i){const s=(0,z._get_column_value)(this.model.field,e,t),n=null==s?"???":`${s}`;this.el.textContent=n}}i.ValueRefView=V,V.__name__="ValueRefView";class L extends D{constructor(e){super(e)}}i.ValueRef=L,c=L,L.__name__="ValueRef",c.prototype.default_view=V,c.define((({String:e})=>({field:[e]})));class j extends V{render(){super.render(),this.value_el=(0,w.span)(),this.swatch_el=(0,w.span)({class:M.tooltip_color_block}," "),this.el.appendChild(this.value_el),this.el.appendChild(this.swatch_el)}update(e,t,i){const s=(0,z._get_column_value)(this.model.field,e,t),n=null==s?"???":`${s}`;this.el.textContent=n}}i.ColorRefView=j,j.__name__="ColorRefView";class U extends L{constructor(e){super(e)}}i.ColorRef=U,h=U,U.__name__="ColorRef",h.prototype.default_view=j,h.define((({Boolean:e})=>({hex:[e,!0],swatch:[e,!0]})));class F extends E{constructor(){super(...arguments),this.child_views=new Map}async lazy_initialize(){await super.lazy_initialize();const e=this.model.children.filter((e=>e instanceof y.Model));await(0,S.build_views)(this.child_views,e,{parent:this})}render(){super.render();const{style:e}=this.model;if(null!=e)if(e instanceof x.Styles)for(const t of e){const e=t.get_value();if((0,T.isString)(e)){const i=t.attr.replace(/_/g,"-");this.el.style.hasOwnProperty(i)&&this.el.style.setProperty(i,e)}}else for(const[t,i]of(0,C.entries)(e)){const e=t.replace(/_/g,"-");this.el.style.hasOwnProperty(e)&&this.el.style.setProperty(e,i)}for(const t of this.model.children)if((0,T.isString)(t)){const e=document.createTextNode(t);this.el.appendChild(e)}else this.child_views.get(t).renderTo(this.el)}}i.DOMElementView=F,F.__name__="DOMElementView";class G extends R{constructor(e){super(e)}}i.DOMElement=G,_=G,G.__name__="DOMElement",_.define((({String:e,Array:t,Dict:i,Or:s,Nullable:n,Ref:o})=>({style:[n(s(o(x.Styles),i(e))),null],children:[t(s(e,o(R),o(v.LayoutDOM))),[]]})));class H extends A.View{}i.ActionView=H,H.__name__="ActionView";class Y extends y.Model{constructor(e){super(e)}}i.Action=Y,u=Y,Y.__name__="Action",Y.__module__="bokeh.models.dom",u.define((({})=>({})));class J extends F{constructor(){super(...arguments),this.action_views=new Map}async lazy_initialize(){await super.lazy_initialize(),await(0,S.build_views)(this.action_views,this.model.actions,{parent:this})}remove(){(0,S.remove_views)(this.action_views),super.remove()}update(e,t,i={}){!function s(n){for(const o of n.child_views.values())o instanceof O?o.update(e,t,i):o instanceof F&&s(o)}(this);for(const s of this.action_views.values())s.update(e,t,i)}}i.TemplateView=J,J.__name__="TemplateView",J.tag_name="div";class W extends G{}i.Template=W,d=W,W.__name__="Template",d.prototype.default_view=J,d.define((({Array:e,Ref:t})=>({actions:[e(t(Y)),[]]})));class q extends F{}i.SpanView=q,q.__name__="SpanView",q.tag_name="span";class X extends G{}i.Span=X,p=X,X.__name__="Span",p.prototype.default_view=q;class Z extends F{}i.DivView=Z,Z.__name__="DivView",Z.tag_name="div";class K extends G{}i.Div=K,m=K,K.__name__="Div",m.prototype.default_view=Z;class Q extends F{}i.TableView=Q,Q.__name__="TableView",Q.tag_name="table";class $ extends G{}i.Table=$,g=$,$.__name__="Table",g.prototype.default_view=Q;class ee extends F{}i.TableRowView=ee,ee.__name__="TableRowView",ee.tag_name="tr";class te extends G{}i.TableRow=te,f=te,te.__name__="TableRow",f.prototype.default_view=ee;const ie=e(41),se=e(234);class ne extends H{update(e,t,i){for(const[s,n]of(0,se.enumerate)(this.model.groups))s.visible=t==n}}i.ToggleGroupView=ne,ne.__name__="ToggleGroupView";class oe extends Y{constructor(e){super(e)}}i.ToggleGroup=oe,b=oe,oe.__name__="ToggleGroup",b.prototype.default_view=ne,b.define((({Array:e,Ref:t})=>({groups:[e(t(ie.RendererGroup)),[]]})))},function(e,t,i,s,n){var o;s();const r=e(53);class a extends r.Model{constructor(e){super(e)}}i.Styles=a,o=a,a.__name__="Styles",a.__module__="bokeh.models.css",o.define((({String:e,Nullable:t})=>({align_content:[t(e),null],align_items:[t(e),null],align_self:[t(e),null],alignment_baseline:[t(e),null],all:[t(e),null],animation:[t(e),null],animation_delay:[t(e),null],animation_direction:[t(e),null],animation_duration:[t(e),null],animation_fill_mode:[t(e),null],animation_iteration_count:[t(e),null],animation_name:[t(e),null],animation_play_state:[t(e),null],animation_timing_function:[t(e),null],backface_visibility:[t(e),null],background:[t(e),null],background_attachment:[t(e),null],background_clip:[t(e),null],background_color:[t(e),null],background_image:[t(e),null],background_origin:[t(e),null],background_position:[t(e),null],background_position_x:[t(e),null],background_position_y:[t(e),null],background_repeat:[t(e),null],background_size:[t(e),null],baseline_shift:[t(e),null],block_size:[t(e),null],border:[t(e),null],border_block_end:[t(e),null],border_block_end_color:[t(e),null],border_block_end_style:[t(e),null],border_block_end_width:[t(e),null],border_block_start:[t(e),null],border_block_start_color:[t(e),null],border_block_start_style:[t(e),null],border_block_start_width:[t(e),null],border_bottom:[t(e),null],border_bottom_color:[t(e),null],border_bottom_left_radius:[t(e),null],border_bottom_right_radius:[t(e),null],border_bottom_style:[t(e),null],border_bottom_width:[t(e),null],border_collapse:[t(e),null],border_color:[t(e),null],border_image:[t(e),null],border_image_outset:[t(e),null],border_image_repeat:[t(e),null],border_image_slice:[t(e),null],border_image_source:[t(e),null],border_image_width:[t(e),null],border_inline_end:[t(e),null],border_inline_end_color:[t(e),null],border_inline_end_style:[t(e),null],border_inline_end_width:[t(e),null],border_inline_start:[t(e),null],border_inline_start_color:[t(e),null],border_inline_start_style:[t(e),null],border_inline_start_width:[t(e),null],border_left:[t(e),null],border_left_color:[t(e),null],border_left_style:[t(e),null],border_left_width:[t(e),null],border_radius:[t(e),null],border_right:[t(e),null],border_right_color:[t(e),null],border_right_style:[t(e),null],border_right_width:[t(e),null],border_spacing:[t(e),null],border_style:[t(e),null],border_top:[t(e),null],border_top_color:[t(e),null],border_top_left_radius:[t(e),null],border_top_right_radius:[t(e),null],border_top_style:[t(e),null],border_top_width:[t(e),null],border_width:[t(e),null],bottom:[t(e),null],box_shadow:[t(e),null],box_sizing:[t(e),null],break_after:[t(e),null],break_before:[t(e),null],break_inside:[t(e),null],caption_side:[t(e),null],caret_color:[t(e),null],clear:[t(e),null],clip:[t(e),null],clip_path:[t(e),null],clip_rule:[t(e),null],color:[t(e),null],color_interpolation:[t(e),null],color_interpolation_filters:[t(e),null],column_count:[t(e),null],column_fill:[t(e),null],column_gap:[t(e),null],column_rule:[t(e),null],column_rule_color:[t(e),null],column_rule_style:[t(e),null],column_rule_width:[t(e),null],column_span:[t(e),null],column_width:[t(e),null],columns:[t(e),null],content:[t(e),null],counter_increment:[t(e),null],counter_reset:[t(e),null],css_float:[t(e),null],css_text:[t(e),null],cursor:[t(e),null],direction:[t(e),null],display:[t(e),null],dominant_baseline:[t(e),null],empty_cells:[t(e),null],fill:[t(e),null],fill_opacity:[t(e),null],fill_rule:[t(e),null],filter:[t(e),null],flex:[t(e),null],flex_basis:[t(e),null],flex_direction:[t(e),null],flex_flow:[t(e),null],flex_grow:[t(e),null],flex_shrink:[t(e),null],flex_wrap:[t(e),null],float:[t(e),null],flood_color:[t(e),null],flood_opacity:[t(e),null],font:[t(e),null],font_family:[t(e),null],font_feature_settings:[t(e),null],font_kerning:[t(e),null],font_size:[t(e),null],font_size_adjust:[t(e),null],font_stretch:[t(e),null],font_style:[t(e),null],font_synthesis:[t(e),null],font_variant:[t(e),null],font_variant_caps:[t(e),null],font_variant_east_asian:[t(e),null],font_variant_ligatures:[t(e),null],font_variant_numeric:[t(e),null],font_variant_position:[t(e),null],font_weight:[t(e),null],gap:[t(e),null],glyph_orientation_vertical:[t(e),null],grid:[t(e),null],grid_area:[t(e),null],grid_auto_columns:[t(e),null],grid_auto_flow:[t(e),null],grid_auto_rows:[t(e),null],grid_column:[t(e),null],grid_column_end:[t(e),null],grid_column_gap:[t(e),null],grid_column_start:[t(e),null],grid_gap:[t(e),null],grid_row:[t(e),null],grid_row_end:[t(e),null],grid_row_gap:[t(e),null],grid_row_start:[t(e),null],grid_template:[t(e),null],grid_template_areas:[t(e),null],grid_template_columns:[t(e),null],grid_template_rows:[t(e),null],height:[t(e),null],hyphens:[t(e),null],image_orientation:[t(e),null],image_rendering:[t(e),null],inline_size:[t(e),null],justify_content:[t(e),null],justify_items:[t(e),null],justify_self:[t(e),null],left:[t(e),null],letter_spacing:[t(e),null],lighting_color:[t(e),null],line_break:[t(e),null],line_height:[t(e),null],list_style:[t(e),null],list_style_image:[t(e),null],list_style_position:[t(e),null],list_style_type:[t(e),null],margin:[t(e),null],margin_block_end:[t(e),null],margin_block_start:[t(e),null],margin_bottom:[t(e),null],margin_inline_end:[t(e),null],margin_inline_start:[t(e),null],margin_left:[t(e),null],margin_right:[t(e),null],margin_top:[t(e),null],marker:[t(e),null],marker_end:[t(e),null],marker_mid:[t(e),null],marker_start:[t(e),null],mask:[t(e),null],mask_composite:[t(e),null],mask_image:[t(e),null],mask_position:[t(e),null],mask_repeat:[t(e),null],mask_size:[t(e),null],mask_type:[t(e),null],max_block_size:[t(e),null],max_height:[t(e),null],max_inline_size:[t(e),null],max_width:[t(e),null],min_block_size:[t(e),null],min_height:[t(e),null],min_inline_size:[t(e),null],min_width:[t(e),null],object_fit:[t(e),null],object_position:[t(e),null],opacity:[t(e),null],order:[t(e),null],orphans:[t(e),null],outline:[t(e),null],outline_color:[t(e),null],outline_offset:[t(e),null],outline_style:[t(e),null],outline_width:[t(e),null],overflow:[t(e),null],overflow_anchor:[t(e),null],overflow_wrap:[t(e),null],overflow_x:[t(e),null],overflow_y:[t(e),null],overscroll_behavior:[t(e),null],overscroll_behavior_block:[t(e),null],overscroll_behavior_inline:[t(e),null],overscroll_behavior_x:[t(e),null],overscroll_behavior_y:[t(e),null],padding:[t(e),null],padding_block_end:[t(e),null],padding_block_start:[t(e),null],padding_bottom:[t(e),null],padding_inline_end:[t(e),null],padding_inline_start:[t(e),null],padding_left:[t(e),null],padding_right:[t(e),null],padding_top:[t(e),null],page_break_after:[t(e),null],page_break_before:[t(e),null],page_break_inside:[t(e),null],paint_order:[t(e),null],perspective:[t(e),null],perspective_origin:[t(e),null],place_content:[t(e),null],place_items:[t(e),null],place_self:[t(e),null],pointer_events:[t(e),null],position:[t(e),null],quotes:[t(e),null],resize:[t(e),null],right:[t(e),null],rotate:[t(e),null],row_gap:[t(e),null],ruby_align:[t(e),null],ruby_position:[t(e),null],scale:[t(e),null],scroll_behavior:[t(e),null],shape_rendering:[t(e),null],stop_color:[t(e),null],stop_opacity:[t(e),null],stroke:[t(e),null],stroke_dasharray:[t(e),null],stroke_dashoffset:[t(e),null],stroke_linecap:[t(e),null],stroke_linejoin:[t(e),null],stroke_miterlimit:[t(e),null],stroke_opacity:[t(e),null],stroke_width:[t(e),null],tab_size:[t(e),null],table_layout:[t(e),null],text_align:[t(e),null],text_align_last:[t(e),null],text_anchor:[t(e),null],text_combine_upright:[t(e),null],text_decoration:[t(e),null],text_decoration_color:[t(e),null],text_decoration_line:[t(e),null],text_decoration_style:[t(e),null],text_emphasis:[t(e),null],text_emphasis_color:[t(e),null],text_emphasis_position:[t(e),null],text_emphasis_style:[t(e),null],text_indent:[t(e),null],text_justify:[t(e),null],text_orientation:[t(e),null],text_overflow:[t(e),null],text_rendering:[t(e),null],text_shadow:[t(e),null],text_transform:[t(e),null],text_underline_position:[t(e),null],top:[t(e),null],touch_action:[t(e),null],transform:[t(e),null],transform_box:[t(e),null],transform_origin:[t(e),null],transform_style:[t(e),null],transition:[t(e),null],transition_delay:[t(e),null],transition_duration:[t(e),null],transition_property:[t(e),null],transition_timing_function:[t(e),null],translate:[t(e),null],unicode_bidi:[t(e),null],user_select:[t(e),null],vertical_align:[t(e),null],visibility:[t(e),null],white_space:[t(e),null],widows:[t(e),null],width:[t(e),null],will_change:[t(e),null],word_break:[t(e),null],word_spacing:[t(e),null],word_wrap:[t(e),null],writing_mode:[t(e),null],z_index:[t(e),null]})))},function(e,t,i,s,n){var o;s();const r=e(15),a=e(53),l=e(224),c=e(232),h=e(234);class _ extends a.Model{constructor(e){super(e)}get button_view(){return this.tools[0].button_view}get event_type(){return this.tools[0].event_type}get tooltip(){return this.tools[0].tooltip}get tool_name(){return this.tools[0].tool_name}get icon(){return this.tools[0].computed_icon}get computed_icon(){return this.icon}get toggleable(){const e=this.tools[0];return e instanceof c.InspectTool&&e.toggleable}initialize(){super.initialize(),this.do=new r.Signal0(this,"do")}connect_signals(){super.connect_signals(),this.connect(this.do,(()=>this.doit())),this.connect(this.properties.active.change,(()=>this.set_active()));for(const e of this.tools)this.connect(e.properties.active.change,(()=>{this.active=e.active}))}doit(){for(const e of this.tools)e.do.emit()}set_active(){for(const e of this.tools)e.active=this.active}get menu(){const{menu:e}=this.tools[0];if(null==e)return null;const t=[];for(const[i,s]of(0,h.enumerate)(e))if(null==i)t.push(null);else{const e=()=>{var e,t,i;for(const n of this.tools)null===(i=null===(t=null===(e=n.menu)||void 0===e?void 0:e[s])||void 0===t?void 0:t.handler)||void 0===i||i.call(t)};t.push(Object.assign(Object.assign({},i),{handler:e}))}return t}}i.ToolProxy=_,o=_,_.__name__="ToolProxy",o.define((({Boolean:e,Array:t,Ref:i})=>({tools:[t(i(l.ButtonTool)),[]],active:[e,!1],disabled:[e,!1]})))},function(e,t,i,s,n){var o,r;s();const a=e(20),l=e(9),c=e(13),h=e(233),_=e(221),u=e(394),d=e(309),p=e(207);class m extends h.ToolbarBase{constructor(e){super(e)}initialize(){super.initialize(),this._merge_tools()}_merge_tools(){this._proxied_tools=[];const e={},t={},i={},s=[],n=[];for(const r of this.help)(0,l.includes)(n,r.redirect)||(s.push(r),n.push(r.redirect));this._proxied_tools.push(...s),this.help=s;for(const[r,a]of(0,c.entries)(this.gestures)){r in i||(i[r]={});for(const e of a.tools)e.type in i[r]||(i[r][e.type]=[]),i[r][e.type].push(e)}for(const r of this.inspectors)r.type in e||(e[r.type]=[]),e[r.type].push(r);for(const r of this.actions)r.type in t||(t[r.type]=[]),t[r.type].push(r);const o=(e,t=!1)=>{const i=new u.ToolProxy({tools:e,active:t});return this._proxied_tools.push(i),i};for(const r of(0,c.keys)(i)){const e=this.gestures[r];e.tools=[];for(const t of(0,c.keys)(i[r])){const s=i[r][t];if(s.length>0)if("multi"==r)for(const t of s){const i=o([t]);e.tools.push(i),this.connect(i.properties.active.change,(()=>this._active_change(i)))}else{const t=o(s);e.tools.push(t),this.connect(t.properties.active.change,(()=>this._active_change(t)))}}}this.actions=[];for(const[r,a]of(0,c.entries)(t))if("CustomAction"==r)for(const e of a)this.actions.push(o([e]));else a.length>0&&this.actions.push(o(a));this.inspectors=[];for(const r of(0,c.values)(e))r.length>0&&this.inspectors.push(o(r,!0));for(const[r,a]of(0,c.entries)(this.gestures))0!=a.tools.length&&(a.tools=(0,l.sort_by)(a.tools,(e=>e.default_order)),"pinch"!=r&&"scroll"!=r&&"multi"!=r&&(a.tools[0].active=!0))}}i.ProxyToolbar=m,o=m,m.__name__="ProxyToolbar",o.define((({Array:e,Ref:t})=>({toolbars:[e(t(_.Toolbar)),[]]})));class g extends d.LayoutDOMView{initialize(){this.model.toolbar.toolbar_location=this.model.toolbar_location,super.initialize()}get child_models(){return[this.model.toolbar]}_update_layout(){this.layout=new p.ContentBox(this.child_views[0].el);const{toolbar:e}=this.model;e.horizontal?this.layout.set_sizing({width_policy:"fit",min_width:100,height_policy:"fixed"}):this.layout.set_sizing({width_policy:"fixed",height_policy:"fit",min_height:100})}after_layout(){super.after_layout();const e=this.child_views[0];e.layout.bbox=this.layout.bbox,e.render()}}i.ToolbarBoxView=g,g.__name__="ToolbarBoxView";class f extends d.LayoutDOM{constructor(e){super(e)}}i.ToolbarBox=f,r=f,f.__name__="ToolbarBox",r.prototype.default_view=g,r.define((({Ref:e})=>({toolbar:[e(h.ToolbarBase)],toolbar_location:[a.Location,"right"]})))},function(e,t,i,s,n){s();const o=e(1),r=e(53),a=(0,o.__importStar)(e(21)),l=e(8),c=e(13);i.resolve_defs=function(e,t){var i,s,n,o;function h(e){return null!=e.module?`${e.module}.${e.name}`:e.name}function _(e){if((0,l.isString)(e))switch(e){case"Any":return a.Any;case"Unknown":return a.Unknown;case"Boolean":return a.Boolean;case"Number":return a.Number;case"Int":return a.Int;case"String":return a.String;case"Null":return a.Null}else switch(e[0]){case"Nullable":{const[,t]=e;return a.Nullable(_(t))}case"Or":{const[,...t]=e;return a.Or(...t.map(_))}case"Tuple":{const[,t,...i]=e;return a.Tuple(_(t),...i.map(_))}case"Array":{const[,t]=e;return a.Array(_(t))}case"Struct":{const[,...t]=e,i=t.map((([e,t])=>[e,_(t)]));return a.Struct((0,c.to_object)(i))}case"Dict":{const[,t]=e;return a.Dict(_(t))}case"Map":{const[,t,i]=e;return a.Map(_(t),_(i))}case"Enum":{const[,...t]=e;return a.Enum(...t)}case"Ref":{const[,i]=e,s=t.get(h(i));if(null!=s)return a.Ref(s);throw new Error(`${h(i)} wasn't defined before referencing it`)}case"AnyRef":return a.AnyRef()}}for(const a of e){const e=(()=>{if(null==a.extends)return r.Model;{const e=t.get(h(a.extends));if(null!=e)return e;throw new Error(`base model ${h(a.extends)} of ${h(a)} is not defined`)}})(),l=((o=class extends e{}).__name__=a.name,o.__module__=a.module,o);for(const t of null!==(i=a.properties)&&void 0!==i?i:[]){const e=_(null!==(s=t.kind)&&void 0!==s?s:"Unknown");l.define({[t.name]:[e,t.default]})}for(const t of null!==(n=a.overrides)&&void 0!==n?n:[])l.override({[t.name]:t.default});t.register(l)}}},function(e,t,i,s,n){s();const o=e(5),r=e(226),a=e(113),l=e(43),c=e(398);i.index={},i.add_document_standalone=async function(e,t,s=[],n=!1){const h=new Map;async function _(n){let o;const _=e.roots().indexOf(n),u=s[_];null!=u?o=u:t.classList.contains(c.BOKEH_ROOT)?o=t:(o=(0,l.div)({class:c.BOKEH_ROOT}),t.appendChild(o));const d=await(0,a.build_view)(n,{parent:null});return d instanceof r.DOMView&&d.renderTo(o),h.set(n,d),i.index[n.id]=d,d}for(const i of e.roots())await _(i);return n&&(window.document.title=e.title()),e.on_change((e=>{e instanceof o.RootAddedEvent?_(e.model):e instanceof o.RootRemovedEvent?function(e){const t=h.get(e);null!=t&&(t.remove(),h.delete(e),delete i.index[e.id])}(e.model):n&&e instanceof o.TitleChangedEvent&&(window.document.title=e.title)})),[...h.values()]}},function(e,t,i,s,n){s();const o=e(43),r=e(44);function a(e){let t=document.getElementById(e);if(null==t)throw new Error(`Error rendering Bokeh model: could not find #${e} HTML tag`);if(!document.body.contains(t))throw new Error(`Error rendering Bokeh model: element #${e} must be under <body>`);if("SCRIPT"==t.tagName){const e=(0,o.div)({class:i.BOKEH_ROOT});(0,o.replaceWith)(t,e),t=e}return t}i.BOKEH_ROOT=r.root,i._resolve_element=function(e){const{elementid:t}=e;return null!=t?a(t):document.body},i._resolve_root_elements=function(e){const t=[];if(null!=e.root_ids&&null!=e.roots)for(const i of e.root_ids)t.push(a(e.roots[i]));return t}},function(e,t,i,s,n){s();const o=e(400),r=e(19),a=e(397);i._get_ws_url=function(e,t){let i,s="ws:";return"https:"==window.location.protocol&&(s="wss:"),null!=t?(i=document.createElement("a"),i.href=t):i=window.location,null!=e?"/"==e&&(e=""):e=i.pathname.replace(/\/+$/,""),`${s}//${i.host}${e}/ws`};const l={};i.add_document_from_session=async function(e,t,i,s=[],n=!1){const c=window.location.search.substr(1);let h;try{h=await function(e,t,i){const s=(0,o.parse_token)(t).session_id;e in l||(l[e]={});const n=l[e];return s in n||(n[s]=(0,o.pull_session)(e,t,i)),n[s]}(e,t,c)}catch(e){const i=(0,o.parse_token)(t).session_id;throw r.logger.error(`Failed to load Bokeh session ${i}: ${e}`),e}return(0,a.add_document_standalone)(h.document,i,s,n)}},function(e,t,i,s,n){s();const o=e(19),r=e(5),a=e(401),l=e(402),c=e(403);i.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",i.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";let h=0;function _(e){let t=e.split(".")[0];const i=t.length%4;return 0!=i&&(t+="=".repeat(4-i)),JSON.parse(atob(t.replace(/_/g,"/").replace(/-/g,"+")))}i.parse_token=_;class u{constructor(e=i.DEFAULT_SERVER_WEBSOCKET_URL,t=i.DEFAULT_TOKEN,s=null){this.url=e,this.token=t,this.args_string=s,this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_replies=new Map,this._pending_messages=[],this._receiver=new l.Receiver,this.id=_(t).session_id.split(".")[0],o.logger.debug(`Creating websocket ${this._number} to '${this.url}' session '${this.id}'`)}async connect(){if(this.closed_permanently)throw new Error("Cannot connect() a closed ClientConnection");if(null!=this.socket)throw new Error("Already connected");this._current_handler=null,this._pending_replies.clear(),this._pending_messages=[];try{let e=`${this.url}`;return null!=this.args_string&&this.args_string.length>0&&(e+=`?${this.args_string}`),this.socket=new WebSocket(e,["bokeh",this.token]),new Promise(((e,t)=>{this.socket.binaryType="arraybuffer",this.socket.onopen=()=>this._on_open(e,t),this.socket.onmessage=e=>this._on_message(e),this.socket.onclose=e=>this._on_close(e,t),this.socket.onerror=()=>this._on_error(t)}))}catch(e){throw o.logger.error(`websocket creation failed to url: ${this.url}`),o.logger.error(` - ${e}`),e}}close(){this.closed_permanently||(o.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())}_schedule_reconnect(e){setTimeout((()=>{this.closed_permanently||o.logger.info(`Websocket connection ${this._number} disconnected, will not attempt to reconnect`)}),e)}send(e){if(null==this.socket)throw new Error(`not connected so cannot send ${e}`);e.send(this.socket)}async send_with_reply(e){const t=await new Promise(((t,i)=>{this._pending_replies.set(e.msgid(),{resolve:t,reject:i}),this.send(e)}));if("ERROR"===t.msgtype())throw new Error(`Error reply ${t.content.text}`);return t}async _pull_doc_json(){const e=a.Message.create("PULL-DOC-REQ",{}),t=await this.send_with_reply(e);if(!("doc"in t.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return t.content.doc}async _repull_session_doc(e,t){var i;o.logger.debug(this.session?"Repulling session":"Pulling session for first time");try{const i=await this._pull_doc_json();if(null==this.session)if(this.closed_permanently)o.logger.debug("Got new document after connection was already closed"),t(new Error("The connection has been closed"));else{const t=r.Document.from_json(i),s=r.Document._compute_patch_since_json(i,t);if(s.events.length>0){o.logger.debug(`Sending ${s.events.length} changes from model construction back to server`);const e=a.Message.create("PATCH-DOC",{},s);this.send(e)}this.session=new c.ClientSession(this,t,this.id);for(const e of this._pending_messages)this.session.handle(e);this._pending_messages=[],o.logger.debug("Created a new session from new pulled doc"),e(this.session)}else this.session.document.replace_with_json(i),o.logger.debug("Updated existing session with new pulled doc")}catch(e){null===(i=console.trace)||void 0===i||i.call(console,e),o.logger.error(`Failed to repull session ${e}`),t(e instanceof Error?e:`${e}`)}}_on_open(e,t){o.logger.info(`Websocket connection ${this._number} is now open`),this._current_handler=i=>{this._awaiting_ack_handler(i,e,t)}}_on_message(e){null==this._current_handler&&o.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol(`${e}`)}const t=this._receiver.message;if(null!=t){const e=t.problem();null!=e&&this._close_bad_protocol(e),this._current_handler(t)}}_on_close(e,t){o.logger.info(`Lost websocket ${this._number} connection, ${e.code} (${e.reason})`),this.socket=null,this._pending_replies.forEach((e=>e.reject("Disconnected"))),this._pending_replies.clear(),this.closed_permanently||this._schedule_reconnect(2e3),t(new Error(`Lost websocket connection, ${e.code} (${e.reason})`))}_on_error(e){o.logger.debug(`Websocket error on socket ${this._number}`);const t="Could not open websocket";o.logger.error(`Failed to connect to Bokeh server: ${t}`),e(new Error(t))}_close_bad_protocol(e){o.logger.error(`Closing connection: ${e}`),null!=this.socket&&this.socket.close(1002,e)}_awaiting_ack_handler(e,t,i){"ACK"===e.msgtype()?(this._current_handler=e=>this._steady_state_handler(e),this._repull_session_doc(t,i)):this._close_bad_protocol("First message was not an ACK")}_steady_state_handler(e){const t=e.reqid(),i=this._pending_replies.get(t);i?(this._pending_replies.delete(t),i.resolve(e)):this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}i.ClientConnection=u,u.__name__="ClientConnection",i.pull_session=function(e,t,i){return new u(e,t,i).connect()}},function(e,t,i,s,n){s();const o=e(34);class r{constructor(e,t,i){this.header=e,this.metadata=t,this.content=i,this.buffers=new Map}static assemble(e,t,i){const s=JSON.parse(e),n=JSON.parse(t),o=JSON.parse(i);return new r(s,n,o)}assemble_buffer(e,t){const i=null!=this.header.num_buffers?this.header.num_buffers:0;if(i<=this.buffers.size)throw new Error(`too many buffers received, expecting ${i}`);const{id:s}=JSON.parse(e);this.buffers.set(s,t)}static create(e,t,i={}){const s=r.create_header(e);return new r(s,t,i)}static create_header(e){return{msgid:(0,o.uniqueId)(),msgtype:e}}complete(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(null==this.header.num_buffers||this.buffers.size==this.header.num_buffers)}send(e){if((null!=this.header.num_buffers?this.header.num_buffers:0)>0)throw new Error("BokehJS only supports receiving buffers, not sending");const t=JSON.stringify(this.header),i=JSON.stringify(this.metadata),s=JSON.stringify(this.content);e.send(t),e.send(i),e.send(s)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}i.Message=r,r.__name__="Message"},function(e,t,i,s,n){s();const o=e(401),r=e(8);class a{constructor(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}consume(e){this._current_consumer(e)}_HEADER(e){this._assume_text(e),this.message=null,this._partial=null,this._fragments=[e],this._buf_header=null,this._current_consumer=this._METADATA}_METADATA(e){this._assume_text(e),this._fragments.push(e),this._current_consumer=this._CONTENT}_CONTENT(e){this._assume_text(e),this._fragments.push(e);const[t,i,s]=this._fragments.slice(0,3);this._partial=o.Message.assemble(t,i,s),this._check_complete()}_BUFFER_HEADER(e){this._assume_text(e),this._buf_header=e,this._current_consumer=this._BUFFER_PAYLOAD}_BUFFER_PAYLOAD(e){this._assume_binary(e),this._partial.assemble_buffer(this._buf_header,e),this._check_complete()}_assume_text(e){if(!(0,r.isString)(e))throw new Error("Expected text fragment but received binary fragment")}_assume_binary(e){if(!(e instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")}_check_complete(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER}}i.Receiver=a,a.__name__="Receiver"},function(e,t,i,s,n){s();const o=e(5),r=e(401),a=e(19);class l{constructor(e,t,i){this._connection=e,this.document=t,this.id=i,this._document_listener=e=>{this._document_changed(e)},this.document.on_change(this._document_listener,!0)}handle(e){const t=e.msgtype();"PATCH-DOC"===t?this._handle_patch(e):"OK"===t?this._handle_ok(e):"ERROR"===t?this._handle_error(e):a.logger.debug(`Doing nothing with message ${e.msgtype()}`)}close(){this._connection.close()}_connection_closed(){this.document.remove_on_change(this._document_listener)}async request_server_info(){const e=r.Message.create("SERVER-INFO-REQ",{});return(await this._connection.send_with_reply(e)).content}async force_roundtrip(){await this.request_server_info()}_document_changed(e){if(e.setter_id===this.id)return;const t=e instanceof o.DocumentEventBatch?e.events:[e],i=this.document.create_json_patch(t),s=r.Message.create("PATCH-DOC",{},i);this._connection.send(s)}_handle_patch(e){this.document.apply_json_patch(e.content,e.buffers,this.id)}_handle_ok(e){a.logger.trace(`Unhandled OK reply to ${e.reqid()}`)}_handle_error(e){a.logger.error(`Unhandled ERROR reply to ${e.reqid()}: ${e.content.text}`)}}i.ClientSession=l,l.__name__="ClientSession"},function(e,t,i,s,n){s();const o=e(1),r=e(5),a=e(402),l=e(19),c=e(43),h=e(13),_=e(397),u=e(398),d=(0,o.__importDefault)(e(44)),p=(0,o.__importDefault)(e(240)),m=(0,o.__importDefault)(e(405));function g(e,t){t.buffers.length>0?e.consume(t.buffers[0].buffer):e.consume(t.content.data);const i=e.message;null!=i&&this.apply_json_patch(i.content,i.buffers)}function f(e,t){if("undefined"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){l.logger.info(`Registering Jupyter comms for target ${e}`);const i=Jupyter.notebook.kernel.comm_manager;try{i.register_target(e,(i=>{l.logger.info(`Registering Jupyter comms for target ${e}`);const s=new a.Receiver;i.on_msg(g.bind(t,s))}))}catch(e){l.logger.warn(`Jupyter comms failed to register. push_notebook() will not function. (exception reported: ${e})`)}}else if(t.roots()[0].id in i.kernels){l.logger.info(`Registering JupyterLab comms for target ${e}`);const s=i.kernels[t.roots()[0].id];try{s.registerCommTarget(e,(i=>{l.logger.info(`Registering JupyterLab comms for target ${e}`);const s=new a.Receiver;i.onMsg=g.bind(t,s)}))}catch(e){l.logger.warn(`Jupyter comms failed to register. push_notebook() will not function. (exception reported: ${e})`)}}else if("undefined"!=typeof google&&null!=google.colab.kernel){l.logger.info(`Registering Google Colab comms for target ${e}`);const i=google.colab.kernel.comms;try{i.registerTarget(e,(async i=>{var s,n,r;l.logger.info(`Registering Google Colab comms for target ${e}`);const c=new a.Receiver;try{for(var h,_=(0,o.__asyncValues)(i.messages);!(h=await _.next()).done;){const e=h.value,i={data:e.data},s=[];for(const t of null!==(r=e.buffers)&&void 0!==r?r:[])s.push(new DataView(t));const n={content:i,buffers:s};g.bind(t)(c,n)}}catch(e){s={error:e}}finally{try{h&&!h.done&&(n=_.return)&&await n.call(_)}finally{if(s)throw s.error}}}))}catch(e){l.logger.warn(`Google Colab comms failed to register. push_notebook() will not function. (exception reported: ${e})`)}}else console.warn("Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest @bokeh/jupyter_bokeh extension is installed. In an exported notebook this warning is expected.")}c.stylesheet.append(d.default),c.stylesheet.append(p.default),c.stylesheet.append(m.default),i.kernels={},i.embed_items_notebook=function(e,t){if(1!=(0,h.size)(e))throw new Error("embed_items_notebook expects exactly one document in docs_json");const i=r.Document.from_json((0,h.values)(e)[0]);for(const s of t){null!=s.notebook_comms_target&&f(s.notebook_comms_target,i);const e=(0,u._resolve_element)(s),t=(0,u._resolve_root_elements)(s);(0,_.add_document_standalone)(i,e,t)}}},function(e,t,i,s,n){s(),i.root="bk-root",i.tooltip="bk-tooltip",i.default=".rendered_html .bk-root .bk-tooltip table,.rendered_html .bk-root .bk-tooltip tr,.rendered_html .bk-root .bk-tooltip th,.rendered_html .bk-root .bk-tooltip td{border:none;padding:1px;}"},function(e,t,i,s,n){s();const o=e(1);(0,o.__exportStar)(e(401),i),(0,o.__exportStar)(e(402),i)},function(e,t,i,s,n){function o(){const e=document.getElementsByTagName("body")[0],t=document.getElementsByClassName("bokeh-test-div");1==t.length&&(e.removeChild(t[0]),delete t[0]);const i=document.createElement("div");i.classList.add("bokeh-test-div"),i.style.display="none",e.insertBefore(i,e.firstChild)}s(),i.results={},i.init=function(){o()},i.record0=function(e,t){i.results[e]=t},i.record=function(e,t){i.results[e]=t,o()},i.count=function(e){null==i.results[e]&&(i.results[e]=0),i.results[e]+=1,o()}},function(e,t,i,s,n){s(),i.safely=function(e,t=!1){try{return e()}catch(e){if(function(e){const t=document.createElement("div");t.style.backgroundColor="#f2dede",t.style.border="1px solid #a94442",t.style.borderRadius="4px",t.style.display="inline-block",t.style.fontFamily="sans-serif",t.style.marginTop="5px",t.style.minWidth="200px",t.style.padding="5px 5px 5px 10px",t.classList.add("bokeh-error-box-into-flames");const 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",(()=>o.removeChild(t)));const s=document.createElement("h3");s.style.color="#a94442",s.style.margin="8px 0px 0px 0px",s.style.padding="0px",s.appendChild(document.createTextNode("Bokeh Error"));const n=document.createElement("pre");n.style.whiteSpace="unset",n.style.overflowX="auto",n.appendChild(document.createTextNode(e)),t.appendChild(i),t.appendChild(s),t.appendChild(n);const o=document.getElementsByTagName("body")[0];o.insertBefore(t,o.firstChild)}(e instanceof Error&&e.stack?e.stack:`${e}`),t)return;throw e}}}],0,{main:0,tslib:1,index:2,version:3,"embed/index":4,"document/index":5,"document/document":6,base:7,"core/util/types":8,"core/util/array":9,"core/util/math":10,"core/util/assert":11,"core/util/arrayable":12,"core/util/object":13,"core/has_props":14,"core/signaling":15,"core/util/defer":16,"core/util/refs":17,"core/properties":18,"core/logging":19,"core/enums":20,"core/kinds":21,"core/util/color":22,"core/util/svg_colors":23,"core/types":24,"core/util/bitset":25,"core/util/eq":26,"core/util/platform":27,"core/settings":28,"core/util/ndarray":29,"core/serializer":30,"core/util/serialization":31,"core/util/buffer":32,"core/uniforms":33,"core/util/string":34,"document/events":35,"core/util/pretty":36,"core/util/cloneable":37,"models/index":38,"models/annotations/index":39,"models/annotations/annotation":40,"models/renderers/renderer":41,"core/view":42,"core/dom":43,"styles/root.css":44,"core/visuals/index":45,"core/visuals/line":46,"core/visuals/visual":47,"core/property_mixins":48,"core/visuals/fill":49,"core/visuals/text":50,"core/visuals/hatch":51,"core/visuals/patterns":52,model:53,"models/canvas/coordinates":54,"models/scales/scale":55,"models/transforms/transform":56,"models/ranges/range":57,"models/ranges/range1d":58,"models/scales/linear_scale":59,"models/scales/continuous_scale":60,"models/scales/log_scale":61,"models/scales/categorical_scale":62,"models/ranges/data_range1d":63,"models/ranges/data_range":64,"core/util/bbox":65,"models/util":66,"models/ranges/factor_range":67,"models/annotations/arrow":68,"models/annotations/data_annotation":69,"models/sources/columnar_data_source":70,"models/sources/data_source":71,"models/selections/selection":72,"core/selection_manager":73,"models/selections/interaction_policy":74,"models/sources/column_data_source":75,"core/util/typed_array":76,"core/util/set":77,"core/util/projections":78,"models/annotations/arrow_head":112,"core/build_views":113,"models/annotations/band":114,"models/annotations/upper_lower":115,"models/annotations/box_annotation":116,"models/annotations/color_bar":117,"models/annotations/title":118,"models/annotations/text_annotation":119,"core/graphics":120,"core/util/text":121,"core/util/affine":122,"core/layout/side_panel":123,"core/layout/types":124,"core/layout/layoutable":125,"models/canvas/cartesian_frame":126,"models/axes/index":127,"models/axes/axis":128,"models/renderers/guide_renderer":129,"models/tickers/ticker":130,"models/formatters/tick_formatter":131,"models/policies/labeling":132,"models/text/base_text":133,"models/text/utils":134,"models/text/math_text":135,"core/util/image":136,"models/text/providers":137,"core/util/modules":138,"models/text/plain_text":139,"models/axes/categorical_axis":140,"models/tickers/categorical_ticker":141,"models/formatters/categorical_tick_formatter":142,"models/axes/continuous_axis":143,"models/axes/datetime_axis":144,"models/axes/linear_axis":145,"models/formatters/basic_tick_formatter":146,"models/tickers/basic_ticker":147,"models/tickers/adaptive_ticker":148,"models/tickers/continuous_ticker":149,"models/formatters/datetime_tick_formatter":150,"core/util/templating":152,"models/tickers/datetime_ticker":155,"models/tickers/composite_ticker":156,"models/tickers/days_ticker":157,"models/tickers/single_interval_ticker":158,"models/tickers/util":159,"models/tickers/months_ticker":160,"models/tickers/years_ticker":161,"models/axes/log_axis":162,"models/formatters/log_tick_formatter":163,"models/tickers/log_ticker":164,"models/axes/mercator_axis":165,"models/formatters/mercator_tick_formatter":166,"models/tickers/mercator_ticker":167,"models/tickers/index":168,"models/tickers/fixed_ticker":169,"models/tickers/binned_ticker":170,"models/mappers/scanning_color_mapper":171,"models/mappers/continuous_color_mapper":172,"models/mappers/color_mapper":173,"models/mappers/mapper":174,"models/renderers/glyph_renderer":175,"models/renderers/data_renderer":176,"models/glyphs/line":177,"models/glyphs/xy_glyph":178,"models/glyphs/glyph":179,"core/util/ragged_array":180,"core/util/spatial":181,"models/glyphs/utils":184,"core/hittest":185,"models/glyphs/patch":186,"models/glyphs/harea":187,"models/glyphs/area":188,"models/glyphs/varea":189,"models/sources/cds_view":190,"models/filters/filter":191,"models/formatters/index":192,"models/formatters/func_tick_formatter":193,"models/formatters/numeral_tick_formatter":194,"models/formatters/printf_tick_formatter":195,"models/mappers/index":196,"models/mappers/categorical_color_mapper":197,"models/mappers/categorical_mapper":198,"models/mappers/categorical_marker_mapper":199,"models/mappers/categorical_pattern_mapper":200,"models/mappers/linear_color_mapper":201,"models/mappers/log_color_mapper":202,"models/mappers/eqhist_color_mapper":203,"models/scales/index":204,"models/scales/linear_interpolation_scale":205,"models/ranges/index":206,"core/layout/index":207,"core/layout/alignments":208,"core/layout/grid":209,"core/layout/html":210,"core/layout/border":211,"models/annotations/label":212,"models/annotations/label_set":213,"models/annotations/legend":214,"models/annotations/legend_item":215,"core/vectorization":216,"models/annotations/poly_annotation":217,"models/annotations/slope":218,"models/annotations/span":219,"models/annotations/toolbar_panel":220,"models/tools/toolbar":221,"models/tools/tool":222,"models/tools/gestures/gesture_tool":223,"models/tools/button_tool":224,"core/dom_view":226,"styles/toolbar.css":227,"styles/icons.css":228,"styles/menus.css":229,"core/util/menus":230,"models/tools/on_off_button":231,"models/tools/inspectors/inspect_tool":232,"models/tools/toolbar_base":233,"core/util/iterator":234,"core/util/canvas":235,"core/util/svg":236,"core/util/random":237,"models/tools/actions/action_tool":238,"models/tools/actions/help_tool":239,"styles/logo.css":240,"models/annotations/tooltip":241,"styles/tooltips.css":242,"models/annotations/whisker":243,"models/callbacks/index":244,"models/callbacks/customjs":245,"models/callbacks/callback":246,"models/callbacks/open_url":247,"models/canvas/index":248,"models/canvas/canvas":249,"core/ui_events":250,"core/bokeh_events":251,"core/util/wheel":252,"models/expressions/index":253,"models/expressions/expression":254,"models/expressions/customjs_expr":255,"models/expressions/stack":256,"models/expressions/cumsum":257,"models/expressions/minimum":258,"models/expressions/maximum":259,"models/expressions/coordinate_transform":260,"models/expressions/polar":261,"models/filters/index":262,"models/filters/boolean_filter":263,"models/filters/customjs_filter":264,"models/filters/group_filter":265,"models/filters/index_filter":266,"models/glyphs/index":267,"models/glyphs/annular_wedge":268,"models/glyphs/annulus":269,"models/glyphs/arc":270,"models/glyphs/bezier":271,"models/glyphs/circle":272,"models/glyphs/ellipse":273,"models/glyphs/ellipse_oval":274,"models/glyphs/center_rotatable":275,"models/glyphs/hbar":276,"models/glyphs/box":277,"models/glyphs/hex_tile":278,"models/glyphs/image":279,"models/glyphs/image_base":280,"models/glyphs/image_rgba":281,"models/glyphs/image_url":282,"models/glyphs/multi_line":283,"models/glyphs/multi_polygons":284,"models/glyphs/oval":285,"models/glyphs/patches":286,"models/glyphs/quad":287,"models/glyphs/quadratic":288,"models/glyphs/ray":289,"models/glyphs/rect":290,"models/glyphs/scatter":291,"models/glyphs/marker":292,"models/glyphs/defs":293,"models/glyphs/segment":294,"models/glyphs/spline":295,"core/util/interpolation":296,"models/glyphs/step":297,"models/glyphs/text":298,"models/glyphs/vbar":299,"models/glyphs/wedge":300,"models/graphs/index":301,"models/graphs/graph_hit_test_policy":302,"models/graphs/layout_provider":303,"models/graphs/static_layout_provider":304,"models/grids/index":305,"models/grids/grid":306,"models/layouts/index":307,"models/layouts/box":308,"models/layouts/layout_dom":309,"models/layouts/column":310,"models/layouts/grid_box":311,"models/layouts/html_box":312,"models/layouts/panel":313,"models/layouts/row":314,"models/layouts/spacer":315,"models/layouts/tabs":316,"styles/tabs.css":317,"styles/buttons.css":318,"models/layouts/widget_box":319,"models/text/index":320,"models/transforms/index":321,"models/transforms/customjs_transform":322,"models/transforms/dodge":323,"models/transforms/range_transform":324,"models/transforms/interpolator":325,"models/transforms/jitter":326,"models/transforms/linear_interpolator":327,"models/transforms/step_interpolator":328,"models/plots/index":329,"models/plots/gmap_plot":330,"models/plots/plot":331,"models/plots/plot_canvas":332,"core/util/throttle":333,"models/plots/range_manager":334,"models/plots/state_manager":335,"models/plots/gmap_plot_canvas":336,"models/policies/index":337,"models/renderers/index":338,"models/renderers/graph_renderer":339,"models/selections/index":340,"models/sources/index":341,"models/sources/server_sent_data_source":342,"models/sources/web_data_source":343,"models/sources/ajax_data_source":344,"models/sources/geojson_data_source":345,"models/tiles/index":346,"models/tiles/bbox_tile_source":347,"models/tiles/mercator_tile_source":348,"models/tiles/tile_source":349,"models/tiles/tile_utils":350,"models/tiles/quadkey_tile_source":351,"models/tiles/tile_renderer":352,"models/tiles/wmts_tile_source":353,"styles/tiles.css":354,"models/tiles/tms_tile_source":355,"models/textures/index":356,"models/textures/canvas_texture":357,"models/textures/texture":358,"models/textures/image_url_texture":359,"models/tools/index":360,"models/tools/actions/custom_action":361,"models/tools/actions/redo_tool":362,"models/tools/actions/reset_tool":363,"models/tools/actions/save_tool":364,"models/tools/actions/undo_tool":365,"models/tools/actions/zoom_in_tool":366,"models/tools/actions/zoom_base_tool":367,"core/util/zoom":368,"models/tools/actions/zoom_out_tool":369,"models/tools/edit/edit_tool":370,"models/tools/edit/box_edit_tool":371,"models/tools/edit/freehand_draw_tool":372,"models/tools/edit/point_draw_tool":373,"models/tools/edit/poly_draw_tool":374,"models/tools/edit/poly_tool":375,"models/tools/edit/poly_edit_tool":376,"models/tools/gestures/box_select_tool":377,"models/tools/gestures/select_tool":378,"models/tools/gestures/box_zoom_tool":379,"models/tools/gestures/lasso_select_tool":380,"models/tools/gestures/poly_select_tool":381,"models/tools/edit/line_edit_tool":382,"models/tools/edit/line_tool":383,"models/tools/gestures/pan_tool":384,"models/tools/gestures/range_tool":385,"models/tools/gestures/tap_tool":386,"models/tools/gestures/wheel_pan_tool":387,"models/tools/gestures/wheel_zoom_tool":388,"models/tools/inspectors/crosshair_tool":389,"models/tools/inspectors/customjs_hover":390,"models/tools/inspectors/hover_tool":391,"models/dom/index":392,"models/dom/styles":393,"models/tools/tool_proxy":394,"models/tools/toolbar_box":395,"document/defs":396,"embed/standalone":397,"embed/dom":398,"embed/server":399,"client/connection":400,"protocol/message":401,"protocol/receiver":402,"client/session":403,"embed/notebook":404,"styles/notebook.css":405,"protocol/index":406,testing:407,safely:408},{});var r=i(96266);const a=(0,n.Z)((function(e){let{width:t,element:i,height:n}=e;const a="bokeh-chart-".concat(i.elementId),l=(0,s.useCallback)((()=>JSON.parse(i.figure)),[i]),c=(0,s.useCallback)((e=>{let s=e.attributes.plot_width,o=e.attributes.plot_height;return n?(s=t,o=n):i.useContainerWidth&&(s=t),{chartWidth:s,chartHeight:o}}),[i.useContainerWidth,n,t]),h=(0,s.useCallback)((e=>{const t=document.getElementById(a),i=e&&e.doc&&e.doc.roots&&e.doc.roots.references?e.doc.roots.references.find((e=>"Plot"===e.type)):void 0;if(i){const{chartWidth:e,chartHeight:t}=c(i);e>0&&(i.attributes.plot_width=e),t>0&&(i.attributes.plot_height=t)}null!==t&&((e=>{for(;e.lastChild;)e.lastChild.remove()})(t),o.embed.embed_item(e,a))}),[a,c]);return(0,s.useEffect)((()=>{h(l())}),[t,n,i,l,h]),(0,r.jsx)("div",{id:a,className:"stBokehChart"})}))}}]);
|