-
Notifications
You must be signed in to change notification settings - Fork 2
/
rain_totbal_pct_2022.html
768 lines (741 loc) · 984 KB
/
rain_totbal_pct_2022.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bokeh Plot</title>
<style>
html, body {
box-sizing: border-box;
display: flow-root;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script type="text/javascript">
/* BEGIN bokeh.min.js */
/*!
* Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of Anaconda nor the names of any contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
(function(root, factory) {
const bokeh = factory();
bokeh.__bokeh__ = true;
if (typeof root.Bokeh === "undefined" || typeof root.Bokeh.__bokeh__ === "undefined") {
root.Bokeh = bokeh;
}
const Bokeh = root.Bokeh;
Bokeh[bokeh.version] = bokeh;
})(this, function() {
let define;
const parent_require = typeof require === "function" && require
return (function(modules, entry, aliases, externals) {
if (aliases === undefined) aliases = {};
if (externals === undefined) externals = {};
const cache = {};
const normalize = function(name) {
if (typeof name === "number")
return name;
if (name === "bokehjs")
return entry;
if (!externals[name]) {
const prefix = "@bokehjs/"
if (name.slice(0, prefix.length) === prefix)
name = name.slice(prefix.length)
}
const alias = aliases[name]
if (alias != null)
return alias;
const trailing = name.length > 0 && name[name.lenght-1] === "/";
const index = aliases[name + (trailing ? "" : "/") + "index"];
if (index != null)
return index;
return name;
}
const require = function(name) {
let mod = cache[name];
if (!mod) {
const id = normalize(name);
mod = cache[id];
if (!mod) {
if (!modules[id]) {
if (externals[id] === false || (externals[id] == true && parent_require)) {
try {
mod = {exports: externals[id] ? parent_require(id) : {}};
cache[id] = cache[name] = mod;
return mod.exports;
} catch (e) {}
}
const err = new Error("Cannot find module '" + name + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
}
mod = {exports: {}};
cache[id] = cache[name] = mod;
function __esModule() {
Object.defineProperty(mod.exports, "__esModule", {value: true});
}
function __esExport(name, value) {
Object.defineProperty(mod.exports, name, {
enumerable: true, get: function () { return value; }
});
}
modules[id].call(mod.exports, require, mod, mod.exports, __esModule, __esExport);
} else {
cache[name] = mod;
}
}
return mod.exports;
}
require.resolve = function(name) {
return ""
}
const main = require(entry);
main.require = require;
if (typeof Proxy !== "undefined") {
// allow Bokeh.loader["@bokehjs/module/name"] syntax
main.loader = new Proxy({}, {
get: function(_obj, module) {
return require(module);
}
});
}
main.register_plugin = function(plugin_modules, plugin_entry, plugin_aliases, plugin_externals) {
if (plugin_aliases === undefined) plugin_aliases = {};
if (plugin_externals === undefined) plugin_externals = {};
for (let name in plugin_modules) {
modules[name] = plugin_modules[name];
}
for (let name in plugin_aliases) {
aliases[name] = plugin_aliases[name];
}
for (let name in plugin_externals) {
externals[name] = plugin_externals[name];
}
const plugin = require(plugin_entry);
for (let name in plugin) {
main[name] = plugin[name];
}
return plugin;
}
return main;
})
([
function _(t,_,n,o,r){o();t(1).__exportStar(t(2),n),t(70)},
function _(e,t,r,n,o){n();var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}r.__extends=i;function c(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function s(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function u(e,t){return function(r,n){t(r,n,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function c(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}s((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}function y(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||(0,r.__createBinding)(t,e,n)}function _(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function h(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e}function b(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n}function v(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function w(e){return this instanceof w?(this.v=e,this):new w(e)}function m(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof w?Promise.resolve(r.value.v).then(s,u):f(a[0][2],r)}catch(e){f(a[0][3],e)}var r}function s(e){c("next",e)}function u(e){c("throw",e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function g(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:w(e[n](t)),done:!1}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=_(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function j(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}r.__assign=function(){return r.__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.__assign.apply(this,arguments)},r.__rest=c,r.__decorate=s,r.__param=u,r.__esDecorate=function(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,s=n.kind,u="getter"===s?"get":"setter"===s?"set":"value",f=!t&&e?n.static?e:e.prototype:null,l=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),p=!1,y=r.length-1;y>=0;y--){var _={};for(var d in n)_[d]="access"===d?{}:n[d];for(var d in n.access)_.access[d]=n.access[d];_.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var h=(0,r[y])("accessor"===s?{get:l.get,set:l.set}:l[u],_);if("accessor"===s){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(c=i(h.get))&&(l.get=c),(c=i(h.set))&&(l.set=c),(c=i(h.init))&&o.unshift(c)}else(c=i(h))&&("field"===s?o.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),p=!0},r.__runInitializers=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0},r.__propKey=function(e){return"symbol"==typeof e?e:"".concat(e)},r.__setFunctionName=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},r.__metadata=f,r.__awaiter=l,r.__generator=p,r.__createBinding=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},r.__exportStar=y,r.__values=_,r.__read=d,r.__spread=h,r.__spreadArrays=b,r.__spreadArray=v,r.__await=w,r.__asyncGenerator=m,r.__asyncDelegator=g,r.__asyncValues=O,r.__makeTemplateObject=j;var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&(0,r.__createBinding)(t,e,n);return P(t,e),t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function T(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function I(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}r.__importStar=S,r.__importDefault=E,r.__classPrivateFieldGet=x,r.__classPrivateFieldSet=T,r.__classPrivateFieldIn=D,r.__addDisposableResource=I;var k="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function R(e){function t(t){e.error=e.hasError?new k(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}r.__disposeResources=R,r.default={__extends:i,__assign:r.__assign,__rest:c,__decorate:s,__param:u,__metadata:f,__awaiter:l,__generator:p,__createBinding:r.__createBinding,__exportStar:y,__values:_,__read:d,__spread:h,__spreadArrays:b,__spreadArray:v,__await:w,__asyncGenerator:m,__asyncDelegator:g,__asyncValues:O,__makeTemplateObject:j,__importStar:S,__importDefault:E,__classPrivateFieldGet:x,__classPrivateFieldSet:T,__classPrivateFieldIn:D,__addDisposableResource:I,__disposeResources:R}},
function _(e,t,o,s,l){s();const r=e(1);l("version",e(3).version),l("index",e(4).index),o.embed=r.__importStar(e(4)),o.protocol=r.__importStar(e(67)),o._testing=r.__importStar(e(68));var _=e(19);l("logger",_.logger),l("set_log_level",_.set_log_level),l("settings",e(29).settings),l("Models",e(7).default_resolver),l("documents",e(5).documents),l("safely",e(69).safely)},
function _(n,i,o,c,e){c(),o.version="3.3.0"},
function _(e,o,t,n,r){n();const s=e(5),d=e(29),i=e(19),_=e(40),c=e(9),a=e(8),u=e(16),l=e(53),m=e(60),f=e(65);var w=e(53);r("add_document_standalone",w.add_document_standalone),r("index",w.index),r("add_document_from_session",e(60).add_document_from_session);var g=e(66);async function k(e,o,t,n){(0,a.isString)(e)&&(e=JSON.parse((0,_.unescape)(e)));const r={};for(const[o,t]of(0,c.entries)(e))r[o]=s.Document.from_json(t);const u=[];for(const e of o){const o=(0,f._resolve_element)(e),s=(0,f._resolve_root_elements)(e);if(null!=e.docid)u.push(await(0,l.add_document_standalone)(r[e.docid],o,s,e.use_for_title));else{if(null==e.token)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const r=(0,m._get_ws_url)(t,n);i.logger.debug(`embed: computed ws url: ${r}`);try{u.push(await(0,m.add_document_from_session)(r,e.token,o,s,e.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(e){if(d.settings.dev)throw e;console.error("Error rendering Bokeh items:",e)}}}}return u}r("embed_items_notebook",g.embed_items_notebook),r("kernels",g.kernels),t.embed_item=async function(e,o){const t={},n=(0,_.uuid4)();t[n]=e.doc,null==o&&(o=e.target_id);const r={roots:{[e.root_id]:o},root_ids:[e.root_id],docid:n};await(0,u.defer)();const[s]=await k(t,[r]);return s},t.embed_items=async function(e,o,t,n){return await(0,u.defer)(),k(e,o,t,n)}},
function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(6),o),a.__exportStar(t(41),o)},
function _(e,t,s,o,n){o();const i=e(1),_=e(7),l=e(3),r=e(19),a=e(46),c=e(32),h=e(47),d=e(49),m=e(15),u=e(8),f=e(26),v=e(10),g=e(9),p=i.__importStar(e(44)),w=e(50),b=e(51),k=e(52),y=e(41);h.Deserializer.register("model",b.decode_def);class z{constructor(e){this.subscribed_models=new Set,this.document=e}send_event(e){if(e.publish){const t=new y.MessageSentEvent(this.document,"bokeh_event",e);this.document._trigger_on_change(t)}this.document._trigger_on_event(e)}trigger(e){for(const t of this.subscribed_models)null!=e.origin&&e.origin!=t||t._process_event(e)}}s.EventManager=z,z.__name__="EventManager",s.documents=[],s.DEFAULT_TITLE="Bokeh Application";class S{constructor(e={}){var t;s.documents.push(this),this._init_timestamp=Date.now(),this._resolver=null!==(t=e.resolver)&&void 0!==t?t:new a.ModelResolver(_.default_resolver),this._title=s.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._new_models=new Set,this._all_models_freeze_count=0,this._callbacks=new Map,this._document_callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new z(this),this.idle=new m.Signal0(this,"idle"),this._idle_roots=new WeakSet,this._interactive_timestamp=null,this._interactive_plot=null,null!=e.roots&&this._add_roots(...e.roots)}[f.equals](e,t){return this==e}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new k.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 k.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new k.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,v.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);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(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_roots(...e){if(0==(e=e.filter((e=>!this._roots.includes(e)))).length)return!1;this._push_all_models_freeze();try{this._roots.push(...e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e){this._add_roots(e)&&this._trigger_on_change(new y.RootAddedEvent(this,e))}remove_root(e){this._remove_root(e)&&this._trigger_on_change(new y.RootRemovedEvent(this,e))}set_title(e){this._set_title(e)&&this._trigger_on_change(new y.TitleChangedEvent(this,e))}title(){return this._title}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 s of this._all_models.values())s instanceof w.Model&&s.name==e&&t.push(s);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 s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){var s;null===(s=this._message_callbacks.get(e))||void 0===s||s.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(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,s]of this._callbacks)if(!s&&e instanceof y.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)s.execute(this,e)}on_event(e,...t){var s;const o=(0,u.isString)(e)?e:e.prototype.event_name,n=null!==(s=this._document_callbacks.get(o))&&void 0!==s?s:[],i=t.map((e=>(0,u.isFunction)(e)?{execute:e}:e));this._document_callbacks.set(o,[...n,...i])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return S.from_json(s,t)}static _handle_version(e){if(null!=e.version){const t=e.version,s=-1!==t.indexOf("+")||-1!==t.indexOf("-"),o=`Library versions: JS (${l.version}) / Python (${t})`;s||(0,d.pyify_version)(l.version)==t?r.logger.debug(o):(r.logger.warn("JS/Python version mismatch"),r.logger.warn(o))}else r.logger.warn("'version' field is missing")}static from_json(e,t){r.logger.debug("Creating Document from JSON"),S._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new h.Deserializer(s).decode(e.defs)}const o=new S({resolver:s});o._push_all_models_freeze();const n=e=>null==t?void 0:t.push(e);o.on_change(n,!0);const i=new h.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,g.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){S.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new h.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,cols:o,data:n}=e;if(null!=o){const e=t.property(s).get_value();for(const t in e)t in n||(n[t]=e[t])}t.setv({data:n},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this._add_roots(e.model);break;case"RootRemoved":this._remove_root(e.model);break;case"TitleChanged":this._set_title(e.title);break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=S,S.__name__="Document"},
function _(e,o,r,s,t){s();const l=e(8),n=e(9),a=e(14),f=e(46);r.default_resolver=new f.ModelResolver(null),r.register_models=function(e,o=!1){for(const t of(0,l.isArray)(e)?e:(0,n.values)(e))s=t,(0,l.isObject)(s)&&s.prototype instanceof a.HasProps&&r.default_resolver.register(t,o);var s}},
function _(n,t,r,e,i){e();
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
const o=Object.prototype.toString;function u(n){return null==n}function c(n){return!0===n||!1===n||"[object Boolean]"===o.call(n)}function s(n){return"[object Number]"===o.call(n)}function f(n){return"[object String]"===o.call(n)}function l(n){return"symbol"==typeof n}function a(n){const t=typeof n;return"function"===t||"object"===t&&!!n}function b(n){return a(n)&&Symbol.iterator in n}r.is_undefined=function(n){return void 0===n},r.is_defined=function(n){return void 0!==n},r.is_nullish=u,r.isNull=function(n){return null==n},r.isNotNull=function(n){return null!=n},r.isBoolean=c,r.isNumber=s,r.isInteger=function(n){return s(n)&&Number.isInteger(n)},r.isString=f,r.isSymbol=l,r.isPrimitive=function(n){return null===n||c(n)||s(n)||f(n)||l(n)},r.isFunction=function(n){switch(o.call(n)){case"[object Function]":case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":return!0;default:return!1}},r.isArray=function(n){return Array.isArray(n)},r.isArrayOf=function(n,t){for(const r of n)if(!t(r))return!1;return!0},r.isArrayableOf=function(n,t){for(const r of n)if(!t(r))return!1;return!0},r.isTypedArray=function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},r.isObject=a,r.isBasicObject=function(n){return a(n)&&u(n.constructor)},r.isPlainObject=function(n){return a(n)&&(u(n.constructor)||n.constructor===Object)},r.isIterable=b,r.isArrayable=function(n){return b(n)&&"length"in n}},
function _(t,e,s,n,i){var r;n();const o=t(10),{hasOwnProperty:c}=Object.prototype;function b(t){return Object.keys(t).length}s.keys=Object.keys,s.values=Object.values,s.entries=Object.entries,s.assign=Object.assign,s.to_object=Object.fromEntries,s.extend=s.assign,s.typed_keys=s.keys,s.typed_values=s.values,s.typed_entries=s.entries,s.clone=function(t){return Object.assign({},t)},s.merge=function(t,e){const s=Object.create(Object.prototype),n=(0,o.concat)([Object.keys(t),Object.keys(e)]);for(const i of n){const n=c.call(t,i)?t[i]:[],r=c.call(e,i)?e[i]:[];s[i]=(0,o.union)(n,r)}return s},s.size=b,s.is_empty=function(t){return 0==b(t)};class u{constructor(t){this[r]="Dict",this.obj=t}clear(){for(const t of(0,s.keys)(this.obj))delete this.obj[t]}delete(t){const e=t in this;return delete this.obj[t],e}get(t){return t in this.obj?this.obj[t]:void 0}has(t){return t in this.obj}set(t,e){return this.obj[t]=e,this}get size(){return b(this.obj)}get is_empty(){return 0==this.size}[(r=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){yield*(0,s.keys)(this.obj)}*values(){yield*(0,s.values)(this.obj)}*entries(){yield*(0,s.entries)(this.obj)}forEach(t,e){for(const[s,n]of this.entries())t.call(e,n,s,this)}}s.Dict=u,u.__name__="Dict",s.dict=function(t){return new u(t)}},
function _(n,t,e,r,o){r();
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
const i=n(11),c=n(12),u=n(8),s=n(13);var f=n(13);o("map",f.map),o("reduce",f.reduce),o("min",f.min),o("min_by",f.min_by),o("max",f.max),o("max_by",f.max_by),o("sum",f.sum),o("cumsum",f.cumsum),o("every",f.every),o("some",f.some),o("find",f.find),o("find_last",f.find_last),o("find_index",f.find_index),o("find_last_index",f.find_last_index),o("sorted_index",f.sorted_index),o("is_empty",f.is_empty),o("includes",f.includes),o("contains",f.contains),o("sort_by",f.sort_by);const l=Array.prototype.slice;function a(n){return l.call(n)}function m(n,t,e=1){(0,c.assert)(e>0,"'step' must be a positive number"),null==t&&(t=n,n=0);const{max:r,ceil:o,abs:i}=Math,u=n<=t?e:-e,s=r(o(i(t-n)/e),0),f=new Array(s);for(let t=0;t<s;t++,n+=u)f[t]=n;return f}function d(n){const t=new Set;for(const e of n)for(const n of e)t.add(n);return t}e.head=function(n){return n[0]},e.tail=function(n){return n[n.length-1]},e.last=function(n){return n[n.length-1]},e.copy=a,e.concat=function(n){return[].concat(...n)},e.nth=function(n,t){return n[t>=0?t:n.length+t]},e.zip=function(...n){if(0==n.length)return[];const t=(0,s.min)(n.map((n=>n.length))),e=n.length,r=new Array(t);for(let o=0;o<t;o++){r[o]=new Array(e);for(let t=0;t<e;t++)r[o][t]=n[t][o]}return r},e.unzip=function(n){const t=n.length;if(0==t)return[];const e=(0,s.min)(n.map((n=>n.length))),r=Array(e);for(let n=0;n<e;n++)r[n]=new Array(t);for(let o=0;o<t;o++)for(let t=0;t<e;t++)r[t][o]=n[o][t];return r},e.range=m,e.linspace=function(n,t,e=100){const r=1==e?0:(t-n)/(e-1),o=new Array(e);for(let t=0;t<e;t++)o[t]=n+r*t;return o},e.transpose=function(n){const t=n.length,e=n[0].length,r=[];for(let o=0;o<e;o++){r[o]=[];for(let e=0;e<t;e++)r[o][e]=n[e][o]}return r},e.argmin=function(n){return(0,s.min_by)(m(n.length),(t=>n[t]))},e.argmax=function(n){return(0,s.max_by)(m(n.length),(t=>n[t]))},e.uniq=function(n){const t=new Set;for(const e of n)t.add(e);return[...t]},e.uniq_by=function(n,t){const e=[],r=[];for(const o of n){const n=t(o);(0,s.includes)(r,n)||(r.push(n),e.push(o))}return e},e._union=d,e.union=function(...n){return[...d(n)]},e.intersection=function(n,...t){const e=[];n:for(const r of n)if(!(0,s.includes)(e,r)){for(const n of t)if(!(0,s.includes)(n,r))continue n;e.push(r)}return e},e.difference=function(n,...t){const e=d(t);return(0,s.filter)(n,(n=>!e.has(n)))},e.remove_at=function(n,t){(0,c.assert)((0,u.isInteger)(t)&&t>=0);const e=a(n);return e.splice(t,1),e},e.remove_by=function(n,t){for(let e=0;e<n.length;)t(n[e])?n.splice(e,1):e++},e.clear=function(n){n.splice(0,n.length)},e.split=function(n,t){const e=[],r=n.length;let o=0,i=0;for(;i<r;)n[i]===t?(e.push(n.slice(o,i)),o=++i):++i;return e.push(n.slice(o)),e},e.shuffle=function(n){const t=n.length,e=new Array(t);for(let r=0;r<t;r++){const t=(0,i.randomIn)(0,r);t!==r&&(e[r]=e[t]),e[t]=n[r]}return e},e.pairwise=function(n,t){const e=n.length,r=new Array(e-1);for(let o=0;o<e-1;o++)r[o]=t(n[o],n[o+1]);return r},e.reversed=function(n){const t=n.length,e=new Array(t);for(let r=0;r<t;r++)e[t-r-1]=n[r];return e},e.repeat=function(n,t){return new Array(t).fill(n)}},
function _(n,t,r,o,e){o();const a=n(8),c=n(12),{PI:u,abs:i,sign:f}=Math;function l(n){if(0==n)return 0;for(;n<=0;)n+=2*u;for(;n>2*u;)n-=2*u;return n}function s(n,t){return l(n-t)}function h(n){switch(n){case"deg":return u/180;case"rad":return 1;case"grad":return u/200;case"turn":return 2*u}}function m(n,t){for(n=Math.abs(n),t=Math.abs(t);0!=t;)[n,t]=[t,n%t];return n}r.angle_norm=l,r.angle_dist=s,r.angle_between=function(n,t,r,o=!1){const e=s(t,r);if(0==e)return!1;if(e==2*u)return!0;const a=l(n),c=s(t,a)<=e&&s(a,r)<=e;return o?!c:c},r.randomIn=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},r.atan2=function(n,t){return Math.atan2(t[1]-n[1],t[0]-n[0])},r.radians=function(n){return n*(u/180)},r.degrees=function(n){return n/(u/180)},r.compute_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n*h(t)},r.invert_angle=function(n,t,r="anticlock"){return-("anticlock"==r?1:-1)*n/h(t)},r.to_radians_coeff=h,r.minmax=function(n,t){return n<=t?[n,t]:[t,n]},r.clamp=function(n,t,r){return n<t?t:n>r?r:n},r.cycle=function(n,t,r){return n>r?t:n<t?r:n},r.log=function(n,t=Math.E){return Math.log(n)/Math.log(t)},r.gcd=m,r.lcm=function(n,...t){for(const r of t)n=Math.floor(n*r/m(n,r));return n},r.float=Symbol("float"),r.is_Floating=function(n){return(0,a.isObject)(n)&&r.float in n};class g{constructor(n,t){(0,c.assert)(0!=t,"Zero divisor");const r=m(n,t),o=f(n)*f(t);this.numer=o*i(n)/r,this.denom=i(t)/r}[r.float](){return this.numer/this.denom}toString(){return`${this.numer}/${this.denom}`}}function _(n){let t=1;for(let r=2;r<=n;r++)t*=r;return t}r.Fraction=g,g.__name__="Fraction",r.float32_epsilon=1.1920928955078125e-7,r.factorial=_,r.hermite=function(n){const t=new Array(n+1);t.fill(0);const r=_(n);for(let o=0;o<=Math.floor(n/2);o++){const e=(-1)**o*r/(_(o)*_(n-2*o))*2**(n-2*o);t[2*o]=e}return t},r.eval_poly=function(n,t){let r=0,o=1;for(let e=n.length-1;e>=0;e--)r+=o*n[e],o*=t;return r}},
function _(r,e,n,o,s){o();class a extends Error{}n.AssertionError=a,a.__name__="AssertionError";class t extends Error{}function c(r,e){if(!(!0===r||!1!==r&&r()))throw new a(null!=e?e:"Assertion failed")}n.UnreachableError=t,t.__name__="UnreachableError",n.assert=c,n.assert_debug=function(r,e){"undefined"!=typeof DEBUG&&DEBUG&&c(r,e)},n.unreachable=function(r){throw new t(`unreachable code${null!=r?`: ${r}`:""}`)}},
function _(n,t,e,r,o){r();const i=n(11),u=n(12),{floor:c}=Math;function f(n){const t=n.length;if(0==t)return!0;let e=n[0];for(let r=1;r<t;r++){const t=n[r];if(!(e<=t))return!1;e=t}return!0}function l(n,t,e,...r){const o=n.length;t<0&&(t+=o),t<0?t=0:t>o&&(t=o),null==e||e>o-t?e=o-t:e<0&&(e=0);const i=o-e+r.length,u=new n.constructor(i);let c=0;for(;c<t;c++)u[c]=n[c];for(const n of r)u[c++]=n;for(let r=t+e;r<o;r++)u[c++]=n[r];return u}function s(n,t){return l(n,t,n.length-t)}function a(n,t){return-1!==n.indexOf(t)}function h(n,t){const e=n.length,r=new n.constructor(e);for(let o=0;o<e;o++)r[o]=t(n[o],o,n);return r}function g(n,t,e){const r=n.length;if(void 0===e&&0==r)throw new Error("can't reduce an empty array without an initial value");let o,i;for(void 0===e?(o=n[0],i=1):(o=e,i=0);i<r;i++)o=t(o,n[i],i,n);return o}function d(n){return function(t,e){const r=t.length;let o=n>0?0:r-1;for(;o>=0&&o<r;o+=n)if(e(t[o]))return o;return-1}}function _(n,t,e,r=0,o=n.length){for((0,u.assert_debug)(f(n)),(0,u.assert)(0<=r&&o<=n.length);r<o;){const i=c((r+o)/2);e(n[i])<t?r=i+1:o=i}return r}function m(n,t,e,r=0,o=n.length){for((0,u.assert_debug)(f(n)),(0,u.assert)(0<=r&&o<=n.length);r<o;){const i=c((r+o)/2);e(n[i])<=t?r=i+1:o=i}return r}function y(n,t,e=0,r){return _(n,t,(n=>n),e,r)}function x(n,t,e,r,o){const i=(o-e)/(r-t);let u=i*(n-t)+e;return isFinite(u)||(u=i*(n-r)+o,isFinite(u)||e!=o||(u=e)),u}function w(n,t){if(n<t[0])return-1;if(n>t[t.length-1])return t.length;if(1==t.length)return 0;let e=0,r=t.length-1;for(;r-e!=1;){const o=e+Math.floor((r-e)/2);n>=t[o]?e=o:r=o}return e}e.is_empty=function(n){return 0==n.length},e.is_sorted=f,e.copy=function(n){return Array.isArray(n)?n.slice():new n.constructor(n)},e.splice=l,e.head=s,e.insert=function(n,t,e){return l(n,e,0,t)},e.append=function(n,t){return l(n,n.length,0,t)},e.prepend=function(n,t){return l(n,0,0,t)},e.index_of=function(n,t){return n.indexOf(t)},e.includes=a,e.contains=a,e.subselect=function(n,t){const e=t.length,r=new n.constructor(e);for(let o=0;o<e;o++)r[o]=n[t[o]];return r},e.mul=function(n,t,e){const r=n.length,o=null!=e?e:new n.constructor(r);for(let e=0;e<r;e++)o[e]=n[e]*t;return o},e.map=h,e.inplace_map=function(n,t,e){const r=n.length,o=null!=e?e:n;for(let e=0;e<r;e++)o[e]=t(n[e],e)},e.filter=function(n,t){const e=n.length,r=new n.constructor(e);let o=0;for(let i=0;i<e;i++){const e=n[i];t(e,i,n)&&(r[o++]=e)}return s(r,o)},e.reduce=g,e.sort_by=function(n,t){const e=Array.from(n,((n,e)=>({index:e,key:t(n)})));return e.sort(((n,t)=>{const e=n.key,r=t.key;if(e!==r){if(e>r)return 1;if(e<r)return-1}return n.index-t.index})),h(n,((t,r)=>n[e[r].index]))},e.min=function(n){let t=1/0;for(const e of n)!isNaN(e)&&e<t&&(t=e);return t},e.max=function(n){let t=-1/0;for(const e of n)!isNaN(e)&&e>t&&(t=e);return t},e.minmax=function(n){let t=1/0,e=-1/0;for(const r of n)isNaN(r)||(r<t&&(t=r),r>e&&(e=r));return[t,e]},e.minmax2=function(n,t){let e,r,o=1/0,i=-1/0,u=1/0,c=-1/0;const f=Math.min(n.length,t.length);for(let l=0;l<f;l++)e=n[l],r=t[l],isNaN(e)||isNaN(r)||(e<o&&(o=e),e>i&&(i=e),r<u&&(u=r),r>c&&(c=r));return[o,i,u,c]},e.min_by=function(n,t){if(0==n.length)throw new Error("min_by() called with an empty array");let e=n[0],r=t(e,0);for(let o=1,i=n.length;o<i;o++){const i=n[o],u=t(i,o);u<r&&(e=i,r=u)}return e},e.max_by=function(n,t){if(0==n.length)throw new Error("max_by() called with an empty array");let e=n[0],r=t(e,0);for(let o=1,i=n.length;o<i;o++){const i=n[o],u=t(i,o);u>r&&(e=i,r=u)}return e},e.sum=function(n){let t=0;for(let e=0,r=n.length;e<r;e++)t+=n[e];return t},e.cumsum=function(n){const t=new n.constructor(n.length);return g(n,((n,e,r)=>t[r]=n+e),0),t},e.every=function(n,t){for(const e of n)if(!t(e))return!1;return!0},e.some=function(n,t){for(const e of n)if(t(e))return!0;return!1},e.find_index=d(1),e.find_last_index=d(-1),e.find=function(n,t){const r=(0,e.find_index)(n,t);return-1==r?void 0:n[r]},e.find_last=function(n,t){const r=(0,e.find_last_index)(n,t);return-1==r?void 0:n[r]},e.bisect_left_by=_,e.bisect_right_by=m,e.bisect_left=y,e.bisect_right=function(n,t,e=0,r){return m(n,t,(n=>n),e,r)},e.binary_search=function(n,t){const e=y(n,t);return e!=n.length&&n[e]==t?e:null},e.sorted_index=y,e.bin_counts=function(n,t){const r=t.length-1,o=Array(r).fill(0);for(let u=0;u<n.length;u++){const c=n[u],f=(0,e.sorted_index)(t,c);o[(0,i.clamp)(f-1,0,r-1)]+=1}return o},e.interpolate=function(n,t,e){const r=n.length,o=new Array(r);for(let i=0;i<r;i++){const r=n[i];if(isNaN(r)||0==t.length){o[i]=NaN;continue}const u=w(r,t);if(-1==u)o[i]=e[0];else if(u==t.length)o[i]=e[e.length-1];else if(u==t.length-1||t[u]==r)o[i]=e[u];else{const n=t[u],c=e[u],f=t[u+1],l=e[u+1];o[i]=x(r,n,c,f,l)}}return o},e.left_edge_index=w,e.norm=function(n,t,e){const r=e-t;return h(n,(n=>(n-t)/r))}},
function _(t,e,s,n,i){var r;n();const o=t(1),c=t(15),a=t(17),h=o.__importStar(t(18)),_=o.__importStar(t(21)),l=t(12),u=t(40),f=t(9),p=t(8),d=t(26),g=t(32),y=t(41),m=t(26),v=t(42),w=t(31),b=o.__importStar(t(21)),S=t(28),$=t(43),j=new WeakMap;class x extends((0,c.Signalable)()){get is_syncable(){return!0}get type(){return this.constructor.__qualified__}static get __qualified__(){let t=j.get(this);if(null==t){const{__module__:e,__name__:s}=this;t=null!=e?`${e}.${s}`:s,j.set(this,t)}return t}static set __qualified__(t){j.set(this,t)}get[Symbol.toStringTag](){return this.constructor.__qualified__}static _fix_default(t,e){if(void 0===t||t===h.unset)return()=>h.unset;if((0,p.isFunction)(t))return t;if((0,p.isPrimitive)(t))return()=>t;{const e=new w.Cloner;return()=>e.clone(t)}}static define(t){for(const[e,s]of(0,f.entries)((0,p.isFunction)(t)?t(b):t)){if(e in this.prototype._props)throw new Error(`attempted to redefine property '${this.prototype.type}.${e}'`);if(e in this.prototype)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${e}'`);Object.defineProperty(this.prototype,e,{get(){return this.properties[e].get_value()},set(t){return this.setv({[e]:t}),this},configurable:!1,enumerable:!0});const[t,n,i={}]=s,r={type:t,default_value:this._fix_default(n,e),options:i};this.prototype._props=Object.assign(Object.assign({},this.prototype._props),{[e]:r})}}static internal(t){const e={};for(const[s,n]of(0,f.entries)((0,p.isFunction)(t)?t(b):t)){const[t,i,r={}]=n;e[s]=[t,i,Object.assign(Object.assign({},r),{internal:!0})]}this.define(e)}static mixins(t){function e(t,e){const s={};for(const[n,i]of(0,f.entries)(e))s[t+n]=i;return s}const s={},n=[];for(const i of(0,p.isArray)(t)?t:[t])if((0,p.isArray)(i)){const[t,r]=i;(0,f.extend)(s,e(t,r)),n.push([t,r])}else{const t=i;(0,f.extend)(s,t),n.push(["",t])}this.define(s),this.prototype._mixins=[...this.prototype._mixins,...n]}static override(t){for(const[e,s]of(0,f.entries)(t)){const t=this._fix_default(s,e);if(!(e in this.prototype._props))throw new Error(`attempted to override nonexistent '${this.prototype.type}.${e}'`);const n=this.prototype._props[e],i=Object.assign({},this.prototype._props);i[e]=Object.assign(Object.assign({},n),{default_value:t}),this.prototype._props=i}}static toString(){return this.__qualified__}toString(){return`${this.type}(${this.id})`}property(t){if(t in this.properties)return this.properties[t];throw new Error(`unknown property ${this.type}.${t}`)}get attributes(){const t={};for(const e of this)e.is_unset||(t[e.attr]=e.get_value());return t}[w.clone](t){const e=new Map;for(const s of this)s.dirty&&e.set(s.attr,t.clone(s.get_value()));return new this.constructor(e)}[m.equals](t,e){for(const s of this){const n=t.property(s.attr);if(!e.eq(s.get_value(),n.get_value()))return!1}return!0}[v.pretty](t){const e=t.token,s=[];for(const n of this)if(n.dirty){const i=n.get_value();s.push(`${n.attr}${e(":")} ${t.to_string(i)}`)}return`${this.constructor.__qualified__}${e("(")}${e("{")}${s.join(`${e(",")} `)}${e("}")}${e(")")}`}[g.serialize](t){const e=this.ref();t.add_ref(this,e);const s={};for(const e of this)if(e.syncable&&(t.include_defaults||e.dirty)&&(!e.readonly||!e.is_unset)){const n=e.get_value();s[e.attr]=t.encode(n)}const{type:n,id:i}=this,r={type:"object",name:n,id:i};return(0,f.is_empty)(s)?r:Object.assign(Object.assign({},r),{attributes:s})}constructor(t={}){super(),this.document=null,this.destroyed=new c.Signal0(this,"destroyed"),this.change=new c.Signal0(this,"change"),this.transformchange=new c.Signal0(this,"transformchange"),this.exprchange=new c.Signal0(this,"exprchange"),this.streaming=new c.Signal0(this,"streaming"),this.patching=new c.Signal(this,"patching"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const e=(0,p.isPlainObject)(t)&&"id"in t;this.id=e?t.id:(0,u.unique_id)();for(const[t,{type:e,default_value:s,options:n}]of(0,f.entries)(this._props)){let i;e instanceof h.PropertyAlias?Object.defineProperty(this.properties,t,{get:()=>this.properties[e.attr],configurable:!1,enumerable:!1}):(i=e instanceof _.Kind?new h.PrimitiveProperty(this,t,e,s,n):new e(this,t,_.Any,s,n),this.properties[t]=i)}if(e)(0,l.assert)(1==(0,f.keys)(t).length,"'id' cannot be used together with property initializers");else{const e=t instanceof Map?t:new f.Dict(t);this.initialize_props(e),this.finalize(),this.connect_signals()}}initialize_props(t){const e=new Set;for(const s of this){const n=t.get(s.attr);s.initialize(n),e.add(s.attr)}for(const s of t.keys())e.has(s)||this.property(s)}finalize(){this.initialize()}initialize(){}assert_initialized(){for(const t of this)t.syncable&&!t.readonly&&t.get_value()}connect_signals(){for(const t of this){if(!(t instanceof h.VectorSpec||t instanceof h.ScalarSpec))continue;if(t.is_unset)continue;const e=t.get_value();null!=e.transform&&this.connect(e.transform.change,(()=>this.transformchange.emit())),(0,S.isExpr)(e)&&this.connect(e.expr.change,(()=>this.exprchange.emit()))}}disconnect_signals(){c.Signal.disconnect_receiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return(new w.Cloner).clone(this)}_clear_watchers(){this._watchers=new WeakMap}changed_for(t){const e=this._watchers.get(t);return this._watchers.set(t,!1),null==e||e}_setv(t,e){var s;const n=e.check_eq,i=new Set,r=this._changing;this._changing=!0;for(const[e,s]of t)!1!==n&&!e.is_unset&&(0,d.is_equal)(e.get_value(),s)||(e.set_value(s),i.add(e));i.size>0&&(this._clear_watchers(),this._pending=!0);for(const t of i)t.change.emit();if(!r){if(null===(s=e.no_change)||void 0===s||!s)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}return i}setv(t,e={}){var s,n;const i=(0,f.entries)(t);if(0==i.length)return;if(null!==(s=e.silent)&&void 0!==s&&s){this._clear_watchers();for(const[t,e]of i)this.properties[t].set_value(e);return}const r=new Map,o=new Map;for(const[t,e]of i){const s=this.properties[t];r.set(s,e),o.set(s,s.is_unset?void 0:s.get_value())}const c=this._setv(r,e),{document:a}=this;if(null!=a){const t=[];for(const[e,s]of o)c.has(e)&&t.push([e,s,e.get_value()]);for(const[e,s,n]of t)if(e.may_have_refs&&this._needs_invalidate(s,n)){a._invalidate_all_models();break}(null===(n=e.sync)||void 0===n||n)&&this._push_changes(t)}}ref(){return{id:this.id}}*[Symbol.iterator](){yield*(0,f.values)(this.properties)}*syncable_properties(){for(const t of this)t.syncable&&(yield t)}static _value_record_references(t,e,s){if(!(0,p.isObject)(t)||!(0,a.may_have_refs)(t))return;const{recursive:n}=s;if(t instanceof r){if(!e.has(t)&&(e.add(t),n))for(const s of t.syncable_properties())if(!s.is_unset&&s.may_have_refs){const t=s.get_value();r._value_record_references(t,e,{recursive:n})}}else if((0,p.isIterable)(t))for(const s of t)r._value_record_references(s,e,{recursive:n});else if((0,p.isPlainObject)(t))for(const s of(0,f.values)(t))r._value_record_references(s,e,{recursive:n})}references(){const t=new Set;return r._value_record_references(this,t,{recursive:!0}),t}_doc_attached(){}_doc_detached(){}attach_document(t){if(null!=this.document){if(this.document==t)return;throw new Error("models must be owned by only a single document")}this.document=t,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(t,e){const s=new Set;r._value_record_references(e,s,{recursive:!1});const n=new Set;r._value_record_references(t,n,{recursive:!1});for(const t of s)if(!n.has(t))return!0;for(const t of n)if(!s.has(t))return!0;return!1}_push_changes(t){if(!this.is_syncable)return;const{document:e}=this;if(null==e)return;const s=[];for(const[n,,i]of t)n.syncable&&s.push(new y.ModelChangedEvent(e,this,n.attr,i));if(0!=s.length){let t;1==s.length?[t]=s:t=new y.DocumentEventBatch(e,s),e._trigger_on_change(t)}}on_change(t,e){for(const s of(0,p.isArray)(t)?t:[t])this.connect(s.change,e)}stream_to(t,e,s,{sync:n}={}){const i=t.get_value();if((0,$.stream_to_columns)(i,e,s),this._clear_watchers(),t.set_value(i),this.streaming.emit(),null!=this.document&&(null==n||n)){const n=new y.ColumnsStreamedEvent(this.document,this,t.attr,e,s);this.document._trigger_on_change(n)}}patch_to(t,e,{sync:s}={}){const n=t.get_value(),i=(0,$.patch_to_columns)(n,e);if(this._clear_watchers(),t.set_value(n),this.patching.emit([...i]),null!=this.document&&(null==s||s)){const s=new y.ColumnsPatchedEvent(this.document,this,t.attr,e);this.document._trigger_on_change(s)}}}s.HasProps=x,(r=x).prototype._props={},r.prototype._mixins=[]},
function _(n,e,t,s,l){s();const r=n(16),i=n(10);class o{constructor(n,e){this.sender=n,this.name=e}connect(n,e=null){t.receivers_for_sender.has(this.sender)||t.receivers_for_sender.set(this.sender,[]);const s=t.receivers_for_sender.get(this.sender);if(null!=f(s,this,n,e))return!1;const l=null!=e?e:n;u.has(l)||u.set(l,[]);const r=u.get(l),i={signal:this,slot:n,context:e};return s.push(i),r.push(i),!0}disconnect(n,e=null){const s=t.receivers_for_sender.get(this.sender);if(null==s||0===s.length)return!1;const l=f(s,this,n,e);if(null==l)return!1;const r=null!=e?e:n,i=u.get(r);return l.signal=null,g(s),g(i),!0}emit(n){var e;const s=null!==(e=t.receivers_for_sender.get(this.sender))&&void 0!==e?e:[];for(const{signal:e,slot:t,context:l}of s)e===this&&t.call(l,n,this.sender)}}t.Signal=o,o.__name__="Signal";class c extends o{emit(){super.emit(void 0)}}t.Signal0=c,c.__name__="Signal0",function(n){n.disconnect_between=function(n,e){const s=t.receivers_for_sender.get(n);if(null==s||0===s.length)return;const l=u.get(e);if(null!=l&&0!==l.length){for(const e of l){if(null==e.signal)return;e.signal.sender===n&&(e.signal=null)}g(s),g(l)}},n.disconnect_sender=function(n){var e;const s=t.receivers_for_sender.get(n);if(null!=s&&0!==s.length){for(const n of s){if(null==n.signal)return;const t=null!==(e=n.context)&&void 0!==e?e:n.slot;n.signal=null,g(u.get(t))}g(s)}},n.disconnect_receiver=function(n,e,s){const l=u.get(n);if(null!=l&&0!==l.length){for(const n of l){if(null==n.signal)return;if(null!=e&&n.slot!=e)continue;const l=n.signal.sender;null!=s&&s.has(l)||(n.signal=null,g(t.receivers_for_sender.get(l)))}g(l)}},n.disconnect_all=function(n){const e=t.receivers_for_sender.get(n);if(null!=e&&0!==e.length){for(const n of e)n.signal=null;g(e)}const s=u.get(n);if(null!=s&&0!==s.length){for(const n of s)n.signal=null;g(s)}}}(o||(t.Signal=o={})),t.Signalable=function(){return class{connect(n,e){return n.connect(e,this)}disconnect(n,e){return n.disconnect(e,this)}}},t.receivers_for_sender=new WeakMap;const u=new WeakMap;function f(n,e,t,s){return(0,i.find)(n,(n=>n.signal===e&&n.slot===t&&n.context===s))}const a=new Set;function g(n){0===a.size&&(async()=>{await(0,r.defer)(),function(){for(const n of a)(0,i.remove_by)(n,(n=>null==n.signal));a.clear()}()})(),a.add(n)}},
function _(e,n,t,r,o){r();const s=new MessageChannel,i=new Map;s.port1.onmessage=e=>{const n=e.data,t=i.get(n);if(null!=t)try{t()}finally{i.delete(n)}};let a=1;t.defer=function(){return new Promise((e=>{const n=a++;i.set(n,e),s.port2.postMessage(n)}))},t.delay=function(e){return new Promise((n=>setTimeout(n,e)))},t.paint=function(){return new Promise((e=>{requestAnimationFrame((()=>e()))}))},t.idle=function(){return new Promise((e=>{requestIdleCallback((()=>e()))}))}},
function _(s,n,r,e,t){e();const i=s(8);function f(s){return r.has_refs in s}r.is_ref=function(s){return(0,i.isPlainObject)(s)&&"id"in s&&!("type"in s)},r.has_refs=Symbol("has_refs"),r._is_HasRefs=f,r.is_HasRefs=function(s){return(0,i.isObject)(s)&&f(s)},r.may_have_refs=function(s){if(f(s))return s[r.has_refs];const n=s.constructor;return!f(n)||n[r.has_refs]}},
function _(e,t,r,n,a){n(),r.TextBaselineSpec=r.TextAlignSpec=r.FontStyleSpec=r.FontSizeSpec=r.FontSpec=r.LineDashSpec=r.LineCapSpec=r.LineJoinSpec=r.MarkerSpec=r.ArraySpec=r.NullStringSpec=r.StringSpec=r.AnySpec=void 0;const s=e(1),i=e(15),l=e(19),_=s.__importStar(e(20)),o=e(24),c=e(10),u=e(13),d=e(11),S=e(22),p=e(27),h=e(8),m=e(28),v=e(29),f=e(30),y=e(38),x=e(12),g=e(32),A=e(39);function w(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}function z(e){return(0,h.isPlainObject)(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)==1}a("Uniform",A.Uniform),a("UniformScalar",A.UniformScalar),a("UniformVector",A.UniformVector),r.isSpec=z;let b=null;r.use_theme=function(e=null){b=e},r.unset=Symbol("unset");class C extends Error{}r.UnsetValueError=C,C.__name__="UnsetValueError";class F{get syncable(){return!this.internal}get is_unset(){return this._value===r.unset}get initialized(){return this._initialized}initialize(e=r.unset){if(this._initialized)throw new Error("already initialized");let t=r.unset;if(e!==r.unset)t=e,this._dirty=!0;else{const e=this._default_override();if(e!==r.unset)t=e;else{let e=!1;if(null!=b){const r=b.get(this.obj,this.attr);void 0!==r&&(t=r,e=!0)}e||(t=this.default_value(this.obj))}}t!==r.unset?this._update(t):this._value=r.unset,this._initialized=!0}get_value(){if(this._value!==r.unset)return this._value;throw new C(`${this.obj}.${this.attr} is unset`)}set_value(e){this._initialized?(this._update(e),this._dirty=!0):this.initialize(e),y.diagnostics.report(this)}_default_override(){return r.unset}get dirty(){return this._dirty}constructor(e,t,n,a,s={}){var l,_;this._value=r.unset,this._initialized=!1,this._dirty=!1,this.obj=e,this.attr=t,this.kind=n,this.default_value=a,this.change=new i.Signal0(this.obj,"change"),this.internal=null!==(l=s.internal)&&void 0!==l&&l,this.readonly=null!==(_=s.readonly)&&void 0!==_&&_,this.convert=s.convert,this.on_update=s.on_update,this.may_have_refs=n.may_have_refs()}_update(e){var t;if(this.validate(e),null!=this.convert){const t=this.convert(e,this.obj);void 0!==t&&(e=t)}this._value=e,null===(t=this.on_update)||void 0===t||t.call(this,e,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, value: ${w(this._value)})`}normalize(e){return e}validate(e){if(!this.valid(e))throw new Error(`${this.obj}.${this.attr} given invalid value: ${w(e)}`)}valid(e){return this.kind.valid(e)}}r.Property=F,F.__name__="Property";class q{constructor(e){this.attr=e}}r.PropertyAlias=q,q.__name__="PropertyAlias",r.Alias=function(e){return new q(e)};class N extends F{}r.PrimitiveProperty=N,N.__name__="PrimitiveProperty";class U extends N{_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.Font=U,U.__name__="Font";class $ extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isExpr)(r)){const{expr:t,transform:a}=r;let s=t.compute(e);return null!=a&&(s=a.compute(s)),s=this.materialize(s),this.scalar(s,n)}{const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}}}r.ScalarSpec=$,$.__name__="ScalarSpec";class j extends ${}r.AnyScalar=j,j.__name__="AnyScalar";class B extends ${}r.ColorScalar=B,B.__name__="ColorScalar";class L extends ${}r.NumberScalar=L,L.__name__="NumberScalar";class D extends ${}r.StringScalar=D,D.__name__="StringScalar";class E extends ${}r.NullStringScalar=E,E.__name__="NullStringScalar";class P extends ${}r.ArrayScalar=P,P.__name__="ArrayScalar";class T extends ${}r.LineJoinScalar=T,T.__name__="LineJoinScalar";class V extends ${}r.LineCapScalar=V,V.__name__="LineCapScalar";class k extends ${}r.LineDashScalar=k,k.__name__="LineDashScalar";class J extends ${_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontScalar=J,J.__name__="FontScalar";class X extends ${}r.FontSizeScalar=X,X.__name__="FontSizeScalar";class Y extends ${}r.FontStyleScalar=Y,Y.__name__="FontStyleScalar";class G extends ${}r.TextAlignScalar=G,G.__name__="TextAlignScalar";class I extends ${}r.TextBaselineScalar=I,I.__name__="TextBaselineScalar";class O extends F{constructor(){super(...arguments),this._value=r.unset}get_value(){if(this._value!==r.unset)return this._value;throw new Error(`${this.obj}.${this.attr} is unset`)}_update(e){if(z(e)?this._value=e:this._value={value:e},(0,h.isPlainObject)(this._value)){const{_value:e}=this;this._value[g.serialize]=t=>{const{value:r,field:n,expr:a,transform:s,units:i}=e;return t.encode_struct(void 0!==r?{type:"value",value:r,transform:s,units:i}:void 0!==n?{type:"field",field:n,transform:s,units:i}:{type:"expr",expr:a,transform:s,units:i})}}(0,m.isValue)(this._value)&&this.validate(this._value.value)}materialize(e){return e}v_materialize(e){return e}scalar(e,t){return new A.UniformScalar(e,t)}vector(e){return new A.UniformVector(e)}uniform(e){var t;const r=this.get_value(),n=null!==(t=e.get_length())&&void 0!==t?t:1;if((0,m.isField)(r)){const{field:t,transform:a}=r;let s=e.get_column(t);return null!=s?(null!=a&&(s=a.v_compute(s)),s=this.v_materialize(s),this.vector(s)):(l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`),this.scalar(null,n))}if((0,m.isExpr)(r)){const{expr:t,transform:n}=r;let a=t.v_compute(e);return null!=n&&(a=n.v_compute(a)),a=this.v_materialize(a),this.vector(a)}if((0,m.isValue)(r)){const{value:e,transform:t}=r;let a=e;return null!=t&&(a=t.compute(a)),a=this.materialize(a),this.scalar(a,n)}(0,x.unreachable)()}array(e){var t;let r;const n=null!==(t=e.get_length())&&void 0!==t?t:1,a=this.get_value();if((0,m.isField)(a)){const{field:t}=a,s=e.get_column(t);if(null!=s)r=this.normalize(s);else{l.logger.warn(`attempted to retrieve property array for nonexistent field '${t}'`);const e=new Float64Array(n);e.fill(NaN),r=e}}else if((0,m.isExpr)(a)){const{expr:t}=a;r=this.normalize(t.v_compute(e))}else{const e=this.normalize([a.value])[0];if((0,h.isNumber)(e)){const t=new Float64Array(n);t.fill(e),r=t}else r=(0,c.repeat)(e,n)}const{transform:s}=a;return null!=s&&(r=s.v_compute(r)),r}}r.VectorSpec=O,O.__name__="VectorSpec";class R extends O{}r.DataSpec=R,R.__name__="DataSpec";class M extends O{constructor(){super(...arguments),this._value=r.unset}_update(e){if(super._update(e),this._value!==r.unset){const{units:e}=this._value;if(null!=e&&!(0,c.includes)(this.valid_units,e))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${e}`)}}get units(){var e;return this._value!==r.unset&&null!==(e=this._value.units)&&void 0!==e?e:this.default_units}set units(e){if(this._value===r.unset)throw new Error(`${this.obj}.${this.attr} is unset`);e!=this.default_units?this._value.units=e:delete this._value.units}}r.UnitsSpec=M,M.__name__="UnitsSpec";class H extends M{array(e){return new Float64Array(super.array(e))}}r.NumberUnitsSpec=H,H.__name__="NumberUnitsSpec";class K extends R{}r.BaseCoordinateSpec=K,K.__name__="BaseCoordinateSpec";class Q extends K{}r.CoordinateSpec=Q,Q.__name__="CoordinateSpec";class W extends K{}r.CoordinateSeqSpec=W,W.__name__="CoordinateSeqSpec";class Z extends K{}r.CoordinateSeqSeqSeqSpec=Z,Z.__name__="CoordinateSeqSeqSeqSpec";class ee extends Q{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSpec=ee,ee.__name__="XCoordinateSpec";class te extends Q{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSpec=te,te.__name__="YCoordinateSpec";class re extends W{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSpec=re,re.__name__="XCoordinateSeqSpec";class ne extends W{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSpec=ne,ne.__name__="YCoordinateSeqSpec";class ae extends Z{constructor(){super(...arguments),this.dimension="x"}}r.XCoordinateSeqSeqSeqSpec=ae,ae.__name__="XCoordinateSeqSeqSeqSpec";class se extends Z{constructor(){super(...arguments),this.dimension="y"}}r.YCoordinateSeqSeqSeqSpec=se,se.__name__="YCoordinateSeqSeqSeqSpec";class ie extends H{get default_units(){return"rad"}get valid_units(){return[..._.AngleUnits]}materialize(e){return e*-(0,d.to_radians_coeff)(this.units)}v_materialize(e){const t=-(0,d.to_radians_coeff)(this.units),r=new Float32Array(e.length);return(0,u.mul)(e,t,r),r}array(e){throw new Error("not supported")}}r.AngleSpec=ie,ie.__name__="AngleSpec";class le extends H{get default_units(){return"data"}get valid_units(){return[..._.SpatialUnits]}}r.DistanceSpec=le,le.__name__="DistanceSpec";class _e extends le{materialize(e){return null!=e?e:NaN}}r.NullDistanceSpec=_e,_e.__name__="NullDistanceSpec";class oe extends R{v_materialize(e){return new Uint8Array(e)}array(e){return new Uint8Array(super.array(e))}}r.BooleanSpec=oe,oe.__name__="BooleanSpec";class ce extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Int32Array(e)}array(e){return new Int32Array(super.array(e))}}r.IntSpec=ce,ce.__name__="IntSpec";class ue extends R{v_materialize(e){return(0,h.isTypedArray)(e)?e:new Float64Array(e)}array(e){return new Float64Array(super.array(e))}}r.NumberSpec=ue,ue.__name__="NumberSpec";class de extends ue{valid(e){return(0,h.isNumber)(e)&&e>=0}}r.ScreenSizeSpec=de,de.__name__="ScreenSizeSpec";class Se extends R{materialize(e){return(0,S.encode_rgba)((0,S.color2rgba)(e))}v_materialize(e){if(!(0,f.is_NDArray)(e))return this._from_css_array(e);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,r=new o.RGBAArray(4*t);let n=0;for(const t of e)r[n++]=t,r[n++]=t,r[n++]=t,r[n++]=255;return new o.ColorArray(r.buffer)}if("uint8"==e.dtype&&2==e.dimension){const[t,r]=e.shape;if(4==r)return new o.ColorArray(e.buffer);if(3==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a<r*t;)n[s++]=e[a++],n[s++]=e[a++],n[s++]=e[a++],n[s++]=255;return new o.ColorArray(n.buffer)}}else if("float32"!=e.dtype&&"float64"!=e.dtype||2!=e.dimension){if("object"==e.dtype&&1==e.dimension)return this._from_css_array(e)}else{const[t,r]=e.shape;if(3==r||4==r){const n=new o.RGBAArray(4*t);for(let a=0,s=0;a<r*t;)n[s++]=255*e[a++],n[s++]=255*e[a++],n[s++]=255*e[a++],n[s++]=255*(3==r?1:e[a++]);return new o.ColorArray(n.buffer)}}throw new Error("invalid color array")}_from_css_array(e){const t=e.length,r=new o.RGBAArray(4*t);let n=0;for(const t of e){const[e,a,s,i]=(0,S.color2rgba)(t);r[n++]=e,r[n++]=a,r[n++]=s,r[n++]=i}return new o.ColorArray(r.buffer)}vector(e){return new A.ColorUniformVector(e)}}r.ColorSpec=Se,Se.__name__="ColorSpec";class pe extends R{}r.NDArraySpec=pe,pe.__name__="NDArraySpec";class he extends R{}r.AnySpec=he,he.__name__="AnySpec";class me extends R{}r.StringSpec=me,me.__name__="StringSpec";class ve extends R{}r.NullStringSpec=ve,ve.__name__="NullStringSpec";class fe extends R{}r.ArraySpec=fe,fe.__name__="ArraySpec";class ye extends R{}r.MarkerSpec=ye,ye.__name__="MarkerSpec";class xe extends R{}r.LineJoinSpec=xe,xe.__name__="LineJoinSpec";class ge extends R{}r.LineCapSpec=ge,ge.__name__="LineCapSpec";class Ae extends R{}r.LineDashSpec=Ae,Ae.__name__="LineDashSpec";class we extends R{_default_override(){return v.settings.dev?"Bokeh":r.unset}}r.FontSpec=we,we.__name__="FontSpec";class ze extends R{}r.FontSizeSpec=ze,ze.__name__="FontSizeSpec";class be extends R{}r.FontStyleSpec=be,be.__name__="FontStyleSpec";class Ce extends R{}r.TextAlignSpec=Ce,Ce.__name__="TextAlignSpec";class Fe extends R{}r.TextBaselineSpec=Fe,Fe.__name__="TextBaselineSpec"},
function _(e,l,o,n,t){n();const s=e(8),g=e(9),r={};class i{constructor(e,l){this.name=e,this.level=l}}o.LogLevel=i,i.__name__="LogLevel";class v{static get levels(){return Object.keys(v.log_levels)}static get(e,l=v.INFO){if(e.length>0)return e in r?r[e]:r[e]=new v(e,l);throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}constructor(e,l=v.INFO){this._name=e,this.set_level(l)}get level(){return this.get_level()}get_level(){return this._log_level}set_level(e){if(e instanceof i)this._log_level=e;else{if(!(0,s.isString)(e)||!(e in v.log_levels))throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=v.log_levels[e]}const l=`[${this._name}]`;for(const[e,o]of(0,g.entries)(v.log_levels))o.level<this._log_level.level||this._log_level.level===v.OFF.level?this[e]=function(){}:this[e]=_(e,l)}trace(...e){}debug(...e){}info(...e){}warn(...e){}error(...e){}}function _(e,l){return null!=console[e]?console[e].bind(console,l):console.log.bind(console,l)}function c(e){const l=o.logger.level;return(0,s.isString)(e)&&!(e in v.log_levels)?(console.log(`[bokeh] unrecognized logging level '${e}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${v.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,s.isString)(e)?e:e.level}'`),o.logger.set_level(e)),l}o.Logger=v,v.__name__="Logger",v.TRACE=new i("trace",0),v.DEBUG=new i("debug",1),v.INFO=new i("info",2),v.WARN=new i("warn",6),v.ERROR=new i("error",7),v.FATAL=new i("fatal",8),v.OFF=new i("off",9),v.log_levels={trace:v.TRACE,debug:v.DEBUG,info:v.INFO,warn:v.WARN,error:v.ERROR,fatal:v.FATAL,off:v.OFF},o.logger=v.get("bokeh"),o.set_log_level=c,o.with_log_level=function(e,l){const o=c(e);try{l()}finally{c(o)}}},
function _(e,t,n,o,i){o(),n.ToolIcon=n.VerticalAlign=n.UpdateMode=n.TooltipAttachment=n.LabelOrientation=n.TextureRepetition=n.TextBaseline=n.TextAlign=n.TapGesture=n.TapBehavior=n.StepMode=n.StartEnd=n.SpatialUnits=void 0;const a=e(21);n.Align=(0,a.Enum)("start","center","end"),n.HAlign=(0,a.Enum)("left","center","right"),n.VAlign=(0,a.Enum)("top","center","bottom"),n.Anchor=(0,a.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),n.AngleUnits=(0,a.Enum)("deg","rad","grad","turn"),n.AlternationPolicy=(0,a.Enum)("none","even","odd","every"),n.BoxOrigin=(0,a.Enum)("corner","center"),n.ButtonType=(0,a.Enum)("default","primary","success","warning","danger","light"),n.CalendarPosition=(0,a.Enum)("auto","above","below"),n.Clock=(0,a.Enum)("12h","24h"),n.CoordinateUnits=(0,a.Enum)("canvas","screen","data"),n.ContextWhich=(0,a.Enum)("start","center","end","all"),n.Dimension=(0,a.Enum)("width","height"),n.Dimensions=(0,a.Enum)("width","height","both"),n.Direction=(0,a.Enum)("clock","anticlock"),n.Distribution=(0,a.Enum)("uniform","normal"),n.Face=(0,a.Enum)("front","back"),n.FlowMode=(0,a.Enum)("block","inline"),n.FontStyle=(0,a.Enum)("normal","italic","bold","bold italic"),n.HatchPatternType=(0,a.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",">","*"),n.HTTPMethod=(0,a.Enum)("POST","GET"),n.HexTileOrientation=(0,a.Enum)("pointytop","flattop"),n.HoverMode=(0,a.Enum)("mouse","hline","vline"),n.ImageOrigin=(0,a.Enum)("bottom_left","top_left","bottom_right","top_right"),n.LatLon=(0,a.Enum)("lat","lon"),n.LegendClickPolicy=(0,a.Enum)("none","hide","mute"),n.LegendLocation=n.Anchor,n.LineCap=(0,a.Enum)("butt","round","square"),n.LineDash=(0,a.Enum)("solid","dashed","dotted","dotdash","dashdot"),n.LineJoin=(0,a.Enum)("miter","round","bevel"),n.LinePolicy=(0,a.Enum)("prev","next","nearest","interp","none"),n.Location=(0,a.Enum)("above","below","left","right"),n.Logo=(0,a.Enum)("normal","grey"),n.MapType=(0,a.Enum)("satellite","roadmap","terrain","hybrid"),n.MarkerType=(0,a.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"),n.MutedPolicy=(0,a.Enum)("show","ignore"),n.Orientation=(0,a.Enum)("vertical","horizontal"),n.OutputBackend=(0,a.Enum)("canvas","svg","webgl"),n.PaddingUnits=(0,a.Enum)("percent","absolute"),n.Place=(0,a.Enum)("above","below","left","right","center"),n.PointPolicy=(0,a.Enum)("snap_to_data","follow_mouse","none"),n.RadiusDimension=(0,a.Enum)("x","y","max","min"),n.RenderLevel=(0,a.Enum)("image","underlay","glyph","guide","annotation","overlay"),n.ResetPolicy=(0,a.Enum)("standard","event_only"),n.RoundingFunction=(0,a.Enum)("round","nearest","floor","rounddown","ceil","roundup"),n.ScrollbarPolicy=(0,a.Enum)("auto","visible","hidden"),n.SelectionMode=(0,a.Enum)("replace","append","intersect","subtract"),n.Side=(0,a.Enum)("above","below","left","right"),n.SizingMode=(0,a.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed","inherit"),n.Sort=(0,a.Enum)("ascending","descending"),n.SpatialUnits=(0,a.Enum)("screen","data"),n.StartEnd=(0,a.Enum)("start","end"),n.StepMode=(0,a.Enum)("after","before","center"),n.TapBehavior=(0,a.Enum)("select","inspect"),n.TapGesture=(0,a.Enum)("tap","doubletap"),n.TextAlign=(0,a.Enum)("left","right","center"),n.TextBaseline=(0,a.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),n.TextureRepetition=(0,a.Enum)("repeat","repeat_x","repeat_y","no_repeat"),n.LabelOrientation=(0,a.Enum)("vertical","horizontal","parallel","normal"),n.TooltipAttachment=(0,a.Enum)("horizontal","vertical","left","right","above","below"),n.UpdateMode=(0,a.Enum)("replace","append"),n.VerticalAlign=(0,a.Enum)("top","middle","bottom"),n.ToolIcon=(0,a.Enum)("append_mode","box_edit","box_select","box_zoom","clear_selection","copy","crosshair","freehand_draw","help","hover","intersect_mode","lasso_select","line_edit","pan","point_draw","poly_draw","poly_edit","polygon_select","range","redo","replace_mode","reset","save","subtract_mode","tap_select","undo","wheel_pan","wheel_zoom","xpan","ypan","zoom_in","zoom_out")},
function _(e,t,r,n,s){n();const i=e(1).__importStar(e(8)),a=e(22),_=e(9),u=e(17),o=globalThis.Map,l=globalThis.Set,{hasOwnProperty:y}=Object.prototype;class c{}r.Kind=c,c.__name__="Kind",function(e){class t extends c{may_have_refs(){return!1}}t.__name__="Primitive",e.Primitive=t;class r extends t{valid(e){return void 0!==e}toString(){return"Any"}may_have_refs(){return!0}}r.__name__="Any",e.Any=r;class n extends t{valid(e){return void 0!==e}toString(){return"Unknown"}may_have_refs(){return!0}}n.__name__="Unknown",e.Unknown=n;class s extends t{valid(e){return i.isBoolean(e)}toString(){return"Boolean"}}s.__name__="Boolean",e.Boolean=s;class d extends c{constructor(e){super(),this.obj_type=e}valid(e){return e instanceof this.obj_type}toString(){var e;const t=this.obj_type;return`Ref(${null!==(e=t.__name__)&&void 0!==e?e:t.toString()})`}may_have_refs(){const{obj_type:e}=this;return!(u.has_refs in e)||e[u.has_refs]}}d.__name__="Ref",e.Ref=d;class h extends c{valid(e){return i.isObject(e)}toString(){return"AnyRef"}may_have_refs(){return!0}}h.__name__="AnyRef",e.AnyRef=h;class m extends t{valid(e){return i.isNumber(e)}toString(){return"Number"}}m.__name__="Number",e.Number=m;class p extends m{valid(e){return super.valid(e)&&i.isInteger(e)}toString(){return"Int"}}p.__name__="Int",e.Int=p;class v extends m{valid(e){return super.valid(e)&&0<=e&&e<=1}toString(){return"Percent"}}v.__name__="Percent",e.Percent=v;class f extends c{constructor(e){super(),this.types=e,this.types=e}valid(e){return this.types.some((t=>t.valid(e)))}toString(){return`Or(${this.types.map((e=>e.toString())).join(", ")})`}may_have_refs(){return this.types.some((e=>e.may_have_refs()))}}f.__name__="Or",e.Or=f;class S extends c{constructor(e){super(),this.types=e,this.types=e}valid(e){if(!i.isArray(e))return!1;for(let t=0;t<this.types.length;t++){const r=this.types[t],n=e[t];if(!r.valid(n))return!1}return!0}toString(){return`Tuple(${this.types.map((e=>e.toString())).join(", ")})`}may_have_refs(){return this.types.some((e=>e.may_have_refs()))}}S.__name__="Tuple",e.Tuple=S;class g extends c{constructor(e){super(),this.struct_type=e}valid(e){if(!i.isPlainObject(e))return!1;const{struct_type:t}=this;for(const r of(0,_.keys)(e))if(!y.call(t,r))return!1;for(const r in t)if(y.call(t,r)){const n=t[r],s=e[r];if(!n.valid(s))return!1}return!0}toString(){return`Struct({${(0,_.typed_entries)(this.struct_type).map((([e,t])=>`${e.toString()}: ${t}`)).join(", ")}})`}may_have_refs(){return(0,_.typed_values)(this.struct_type).some((e=>e.may_have_refs()))}}g.__name__="Struct",e.Struct=g;class b extends c{constructor(e){super(),this.struct_type=e}valid(e){if(!i.isPlainObject(e))return!1;const{struct_type:t}=this;for(const r of(0,_.keys)(e))if(!y.call(t,r))return!1;for(const r in t)if(y.call(e,r)&&y.call(t,r)){const n=t[r],s=e[r];if(!n.valid(s))return!1}return!0}toString(){return`Struct({${(0,_.typed_entries)(this.struct_type).map((([e,t])=>`${e.toString()}?: ${t}`)).join(", ")}})`}may_have_refs(){return(0,_.typed_values)(this.struct_type).some((e=>e.may_have_refs()))}}b.__name__="PartialStruct",e.PartialStruct=b;class x extends c{constructor(e){super(),this.item_type=e}valid(e){return i.isArray(e)||i.isTypedArray(e)}toString(){return`Arrayable(${this.item_type.toString()})`}may_have_refs(){return this.item_type.may_have_refs()}}x.__name__="Arrayable",e.Arrayable=x;class w extends c{constructor(e){super(),this.item_type=e}valid(e){return i.isArray(e)&&e.every((e=>this.item_type.valid(e)))}toString(){return`Array(${this.item_type.toString()})`}may_have_refs(){return this.item_type.may_have_refs()}}w.__name__="Array",e.Array=w;class K extends t{valid(e){return null===e}toString(){return"Null"}}K.__name__="Null",e.Null=K;class N extends c{constructor(e){super(),this.base_type=e}valid(e){return null===e||this.base_type.valid(e)}toString(){return`Nullable(${this.base_type.toString()})`}may_have_refs(){return this.base_type.may_have_refs()}}N.__name__="Nullable",e.Nullable=N;class A extends c{constructor(e){super(),this.base_type=e}valid(e){return void 0===e||this.base_type.valid(e)}toString(){return`Opt(${this.base_type.toString()})`}may_have_refs(){return this.base_type.may_have_refs()}}A.__name__="Opt",e.Opt=A;class O extends c{valid(e){return e instanceof ArrayBuffer}toString(){return"Bytes"}may_have_refs(){return!1}}O.__name__="Bytes",e.Bytes=O;class P extends t{valid(e){return i.isString(e)}toString(){return"String"}}P.__name__="String",e.String=P;class $ extends P{constructor(e){super(),this.regex=e}valid(e){return super.valid(e)&&this.regex.test(e)}toString(){return`Regex(${this.regex.toString()})`}}$.__name__="Regex",e.Regex=$;class R extends t{constructor(e){super(),this.values=new l(e)}valid(e){return this.values.has(e)}*[Symbol.iterator](){yield*this.values}toString(){return`Enum(${[...this.values].map((e=>e.toString())).join(", ")})`}}R.__name__="Enum",e.Enum=R;class j extends c{constructor(e){super(),this.item_type=e}valid(e){if(!i.isPlainObject(e))return!1;for(const t in e)if(y.call(e,t)){const r=e[t];if(!this.item_type.valid(r))return!1}return!0}toString(){return`Dict(${this.item_type.toString()})`}may_have_refs(){return this.item_type.may_have_refs()}}j.__name__="Dict",e.Dict=j;class B extends c{constructor(e,t){super(),this.key_type=e,this.item_type=t}valid(e){if(!(e instanceof o))return!1;for(const[t,r]of e.entries())if(!this.key_type.valid(t)||!this.item_type.valid(r))return!1;return!0}toString(){return`Map(${this.key_type.toString()}, ${this.item_type.toString()})`}may_have_refs(){return this.key_type.may_have_refs()||this.item_type.may_have_refs()}}B.__name__="Map",e.Map=B;class k extends c{constructor(e){super(),this.item_type=e}valid(e){if(!(e instanceof l))return!1;for(const t of e)if(!this.item_type.valid(t))return!1;return!0}toString(){return`Set(${this.item_type.toString()})`}may_have_refs(){return this.item_type.may_have_refs()}}k.__name__="Set",e.Set=k;class C extends c{valid(e){return(0,a.is_Color)(e)}toString(){return"Color"}may_have_refs(){return!1}}C.__name__="Color",e.Color=C;class M extends P{toString(){return"CSSLength"}}M.__name__="CSSLength",e.CSSLength=M;class D extends c{valid(e){return i.isFunction(e)}toString(){return"Function(...)"}may_have_refs(){return!1}}D.__name__="Function",e.Function=D;class F extends c{constructor(e){super(),this.base_type=e}valid(e){return this.base_type.valid(e)&&e>=0}toString(){return`NonNegative(${this.base_type.toString()})`}may_have_refs(){return this.base_type.may_have_refs()}}F.__name__="NonNegative",e.NonNegative=F;class T extends c{constructor(e){super(),this.base_type=e}valid(e){return this.base_type.valid(e)&&e>0}toString(){return`Positive(${this.base_type.toString()})`}may_have_refs(){return this.base_type.may_have_refs()}}T.__name__="Positive",e.Positive=T;class E extends c{valid(e){return e instanceof Node}toString(){return"DOMNode"}may_have_refs(){return!1}}E.__name__="DOMNode",e.DOMNode=E}(r.Kinds||(r.Kinds={})),r.Any=new r.Kinds.Any,r.Unknown=new r.Kinds.Unknown,r.Boolean=new r.Kinds.Boolean,r.Number=new r.Kinds.Number,r.Int=new r.Kinds.Int,r.Bytes=new r.Kinds.Bytes,r.String=new r.Kinds.String;r.Regex=e=>new r.Kinds.Regex(e),r.Null=new r.Kinds.Null;r.Nullable=e=>new r.Kinds.Nullable(e);r.Opt=e=>new r.Kinds.Opt(e);r.Or=(...e)=>new r.Kinds.Or(e);r.Tuple=(...e)=>new r.Kinds.Tuple(e);r.Struct=e=>new r.Kinds.Struct(e);r.PartialStruct=e=>new r.Kinds.PartialStruct(e);r.Arrayable=e=>new r.Kinds.Arrayable(e);r.Array=e=>new r.Kinds.Array(e);r.Dict=e=>new r.Kinds.Dict(e);r.Map=(e,t)=>new r.Kinds.Map(e,t);r.Set=e=>new r.Kinds.Set(e);r.Enum=(...e)=>new r.Kinds.Enum(e);r.Ref=e=>new r.Kinds.Ref(e);r.AnyRef=()=>new r.Kinds.AnyRef;r.Function=()=>new r.Kinds.Function,r.DOMNode=new r.Kinds.DOMNode;r.NonNegative=e=>new r.Kinds.NonNegative(e);r.Positive=e=>new r.Kinds.Positive(e),r.Percent=new r.Kinds.Percent,r.Alpha=r.Percent,r.Color=new r.Kinds.Color,r.Auto=(0,r.Enum)("auto"),r.CSSLength=new r.Kinds.CSSLength,r.FontSize=r.String,r.Font=r.String,r.Angle=r.Number},
function _(n,r,t,e,s){e();const u=n(23),i=n(11),c=n(8),{round:o,sqrt:l}=Math;function a(n){return(0,i.clamp)(o(n),0,255)}function f(){return[0,0,0,0]}function g(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}function b(n,r=1){const[t,e,s,u]=(()=>{var r;if(null==n)return[0,0,0,0];if((0,c.isInteger)(n))return g(n);if((0,c.isString)(n))return null!==(r=_(n))&&void 0!==r?r:[0,0,0,0];if(2==n.length){const[r,t]=n;return b(r,t)}{const[r,t,e,s=1]=n;return[r,t,e,a(255*s)]}})();return[t,e,s,a(r*u)]}t.byte=a,t.transparent=f,t.encode_rgba=function([n,r,t,e]){return n<<24|r<<16|t<<8|e},t.decode_rgba=g,t.color2rgba=b;const d={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 h(n){return d[n>>4]+d[15&n]}t.color2css=function(n,r){const[t,e,s,u]=b(n,r);return`rgba(${t}, ${e}, ${s}, ${u/255})`},t.color2hex=function(n,r){const[t,e,s,u]=b(n,r),i=`#${h(t)}${h(e)}${h(s)}`;return 255==u?i:`${i}${h(u)}`},t.color2hexrgb=function(n){const[r,t,e]=b(n);return`#${h(r)}${h(t)}${h(e)}`};const $=/^rgba?\(\s*(?<r>[^\s,]+?)\s+(?<g>[^\s,]+?)\s+(?<b>[^\s,]+?)(?:\s*\/\s*(?<a>[^\s,]+?))?\s*\)$/,m=/^rgba?\(\s*(?<r>[^\s,]+?)\s*,\s*(?<g>[^\s,]+?)\s*,\s*(?<b>[^\s,]+?)(?:\s*,\s*(?<a>[^\s,]+?))?\s*\)$/,N=(()=>{const n=document.createElement("canvas");n.width=1,n.height=1;const r=n.getContext("2d"),t=r.createLinearGradient(0,0,1,1);return n=>{r.fillStyle=t,r.fillStyle=n;const e=r.fillStyle;return e!=t?e:null}})();function _(n){var r;if(""==(n=n.trim().toLowerCase()))return null;if("transparent"==n)return[0,0,0,0];if((0,u.is_named_color)(n))return g(u.named_colors[n]);if("#"==n[0]){const r=Number(`0x${n.substring(1)}`);if(isNaN(r))return null;switch(n.length-1){case 3:{const n=r>>8&15,t=r>>4&15,e=r>>0&15;return[n<<4|n,t<<4|t,e<<4|e,255]}case 4:{const n=r>>12&15,t=r>>8&15,e=r>>4&15,s=r>>0&15;return[n<<4|n,t<<4|t,e<<4|e,s<<4|s]}case 6:return[r>>16&255,r>>8&255,r>>0&255,255];case 8:return[r>>24&255,r>>16&255,r>>8&255,r>>0&255]}}else if(n.startsWith("rgb")){const t=null!==(r=n.match($))&&void 0!==r?r:n.match(m);if(null!=(null==t?void 0:t.groups)){let{r:n,g:r,b:e,a:s="1"}=t.groups;const u=n.endsWith("%"),i=r.endsWith("%"),c=e.endsWith("%"),o=s.endsWith("%");if(!(u&&i&&c)&&(u||i||c))return null;u&&(n=n.slice(0,-1)),i&&(r=r.slice(0,-1)),c&&(e=e.slice(0,-1)),o&&(s=s.slice(0,-1));let l=Number(n),f=Number(r),g=Number(e),b=Number(s);return isNaN(l+f+g+b)?null:(u&&(l=l/100*255),i&&(f=f/100*255),c&&(g=g/100*255),b=255*(o?b/100:b),l=a(l),f=a(f),g=a(g),b=a(b),[l,f,g,b])}}else{const r=N(n);if(null!=r)return _(r)}return null}t.css4_parse=_,t.is_Color=function(n){return!!(0,c.isInteger)(n)||(!(!(0,c.isString)(n)||null==_(n))||!(!(0,c.isArray)(n)||3!=n.length&&4!=n.length))},t.is_dark=function([n,r,t]){return 1-(.299*n+.587*r+.114*t)/255>=.6},t.brightness=function(n){const[r,t,e]=b(n);return l(.299*r**2+.587*t**2+.114*e**2)/255}},
function _(e,r,l,a,i){a();l.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},l.is_named_color=function(e){return e in l.named_colors}},
function _(r,t,n,o,a){o();const e=r(1);n.GeneratorFunction=Object.getPrototypeOf((function*(){})).constructor,n.AsyncGeneratorFunction=Object.getPrototypeOf((function(){return e.__asyncGenerator(this,arguments,(function*(){}))})).constructor,n.ColorArray=Uint32Array,n.RGBAArray=Uint8ClampedArray,n.infer_type=function(r,t){return r instanceof Float64Array||r instanceof Array||t instanceof Float64Array||t instanceof Array?Float64Array:Float32Array},n.ScreenArray=Float32Array,n.to_screen=function(r){return r instanceof Float32Array?r:Float32Array.from(r)},a("Indices",r(25).BitSet)},
function _(t,s,r,e,i){var n,o;e();const _=t(26),h=t(12),a=t(17);class c{constructor(t,s=0){this[n]="BitSet",this._count=null,this.size=t,this._nwords=Math.ceil(t/c._word_length),0==s||1==s?(this._array=new Uint32Array(this._nwords),1==s&&this._array.fill(4294967295)):((0,h.assert)(s.length==this._nwords,"Initializer size mismatch"),this._array=s)}clone(){return new c(this.size,new Uint32Array(this._array))}[(n=Symbol.toStringTag,o=a.has_refs,_.equals)](t,s){if(!s.eq(this.size,t.size))return!1;const{_nwords:r}=this,e=this.size%c._word_length,i=0==e?r:r-1;for(let s=0;s<i;s++)if(this._array[s]!=t._array[s])return!1;if(0==e)return!0;{const s=1<<e-1,r=s-1^s;return(this._array[i]&r)==(t._array[i]&r)}}static all_set(t){return new c(t,1)}static all_unset(t){return new c(t,0)}static from_indices(t,s){const r=new c(t);for(const t of s)r.set(t);return r}static from_booleans(t,s){const r=new c(t),e=Math.min(t,s.length);for(let t=0;t<e;t++)s[t]&&r.set(t);return r}_check_bounds(t){(0,h.assert)(0<=t&&t<this.size,`Out of bounds: 0 <= ${t} < ${this.size}`)}get(t){this._check_bounds(t);const s=t>>>5,r=31&t;return 1==(this._array[s]>>r&1)}set(t,s=!0){this._check_bounds(t),this._count=null;const r=t>>>5,e=31&t;s?this._array[r]|=1<<e:this._array[r]&=~(1<<e)}unset(t){this.set(t,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let t=this._count;return null==t&&(this._count=t=this._get_count()),t}_get_count(){const{_array:t,_nwords:s,size:r}=this;let e=0;for(let i=0,n=0;n<s;n++){const s=t[n];if(0==s)i+=c._word_length;else for(let t=0;t<c._word_length&&i<r;t++,i++)1==(s>>>t&1)&&(e+=1)}return e}*ones(){const{_array:t,_nwords:s,size:r}=this;for(let e=0,i=0;i<s;i++){const s=t[i];if(0!=s)for(let t=0;t<c._word_length&&e<r;t++,e++)1==(s>>>t&1)&&(yield e);else e+=c._word_length}}*zeros(){const{_array:t,_nwords:s,size:r}=this;for(let e=0,i=0;i<s;i++){const s=t[i];if(4294967295!=s)for(let t=0;t<c._word_length&&e<r;t++,e++)0==(s>>>t&1)&&(yield e);else e+=c._word_length}}_check_size(t){(0,h.assert)(this.size==t.size,`Size mismatch (${this.size} != ${t.size})`)}invert(){for(let t=0;t<this._nwords;t++)this._array[t]=~this._array[t]>>>0}add(t){this._check_size(t);for(let s=0;s<this._nwords;s++)this._array[s]|=t._array[s]}intersect(t){this._check_size(t);for(let s=0;s<this._nwords;s++)this._array[s]&=t._array[s]}subtract(t){this._check_size(t);for(let s=0;s<this._nwords;s++){const r=this._array[s],e=t._array[s];this._array[s]=(r^e)&r}}symmetric_subtract(t){this._check_size(t);for(let s=0;s<this._nwords;s++)this._array[s]^=t._array[s]}inversion(){const t=this.clone();return t.invert(),t}union(t){const s=this.clone();return s.add(t),s}intersection(t){const s=this.clone();return s.intersect(t),s}difference(t){const s=this.clone();return s.subtract(t),s}symmetric_difference(t){const s=this.clone();return s.symmetric_subtract(t),s}select(t){(0,h.assert)(this.size<=t.length,"Size mismatch");const s=this.count,r=new t.constructor(s);let e=0;for(const s of this)r[e++]=t[s];return r}}r.BitSet=c,c.__name__="BitSet",c[o]=!1,c._word_length=32},
function _(t,e,r,s,n){s();const o=t(8),{hasOwnProperty:c}=Object.prototype;function a(t){return(0,o.isObject)(t)&&r.equals in t}r.equals=Symbol("equals"),r.wildcard=Symbol("wildcard");const i=Object.prototype.toString;class u{constructor(t){var e;this.a_stack=[],this.b_stack=[],this.structural=null!==(e=null==t?void 0:t.structural)&&void 0!==e&&e}eq(t,e){if(Object.is(t,e))return!0;if(t===r.wildcard||e===r.wildcard)return!0;if(null==t||null==e)return t===e;const s=i.call(t);if(s!=i.call(e))return!1;switch(s){case"[object Number]":return this.numbers(t,e);case"[object Symbol]":return t===e;case"[object RegExp]":case"[object String]":return`${t}`==`${e}`;case"[object Date]":case"[object Boolean]":return+t==+e}const{a_stack:n,b_stack:o}=this;let c=n.length;for(;c-- >0;)if(n[c]===t)return o[c]===e;n.push(t),o.push(e);const u=(()=>{if(a(t)&&a(e))return t[r.equals](e,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(t,e);case"[object Map]":return this.maps(t,e);case"[object Set]":return this.sets(t,e);case"[object Object]":if(t.constructor==e.constructor&&(null==t.constructor||t.constructor===Object))return this.objects(t,e);case"[object Function]":if(t.constructor==e.constructor&&t.constructor===Function)return this.eq(`${t}`,`${e}`)}if("undefined"!=typeof Node&&t instanceof Node)return this.nodes(t,e);throw Error(`can't compare objects of type ${s}`)})();return n.pop(),o.pop(),u}numbers(t,e){return Object.is(t,e)}arrays(t,e){const{length:r}=t;if(r!=e.length)return!1;for(let s=0;s<r;s++)if(!this.eq(t[s],e[s]))return!1;return!0}iterables(t,e){var r,s;const n=t[Symbol.iterator](),o=e[Symbol.iterator]();for(;;){const t=n.next(),e=o.next(),c=null!==(r=t.done)&&void 0!==r&&r,a=null!==(s=e.done)&&void 0!==s&&s;if(c&&a)return!0;if(c||a)return!1;if(!this.eq(t.value,e.value))return!1}}maps(t,e){if(t.size!=e.size)return!1;if(this.structural)return this.iterables(t.entries(),e.entries());for(const[r,s]of t)if(!e.has(r)||!this.eq(s,e.get(r)))return!1;return!0}sets(t,e){if(t.size!=e.size)return!1;if(this.structural)return this.iterables(t.entries(),e.entries());for(const r of t)if(!e.has(r))return!1;return!0}objects(t,e){const r=Object.keys(t);if(r.length!=Object.keys(e).length)return!1;for(const s of r)if(!c.call(e,s)||!this.eq(t[s],e[s]))return!1;return!0}nodes(t,e){return t.nodeType==e.nodeType&&(t.textContent==e.textContent&&!!this.iterables(t.childNodes,e.childNodes))}}r.Comparator=u,u.__name__="Comparator";const{abs:l}=Math;class b extends u{constructor(t=1e-4){super(),this.tolerance=t}numbers(t,e){return super.numbers(t,e)||l(t-e)<this.tolerance}}r.SimilarComparator=b,b.__name__="SimilarComparator",r.is_equal=function(t,e){return(new u).eq(t,e)},r.is_structurally_equal=function(t,e){return new u({structural:!0}).eq(t,e)},r.is_similar=function(t,e,r){return new b(r).eq(t,e)}},
function _(n,t,i,e,r){e(),i.is_mobile="ontouchstart"in globalThis||"undefined"!=typeof navigator&&navigator.maxTouchPoints>0,i.is_little_endian=(()=>{const n=new ArrayBuffer(4),t=new Uint8Array(n);new Uint32Array(n)[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(n){if(i.is_little_endian){const t=new Uint32Array(n.length),i=new DataView(t.buffer);let e=0;for(const t of n)i.setUint32(e,t),e+=4;return t}return n}},
function _(i,n,e,t,u){t();const c=i(8);e.isValue=function(i){return(0,c.isPlainObject)(i)&&"value"in i},e.isField=function(i){return(0,c.isPlainObject)(i)&&"field"in i},e.isExpr=function(i){return(0,c.isPlainObject)(i)&&"expr"in i}},
function _(e,t,r,s,_){s();class i{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}}r.Settings=i,i.__name__="Settings",r.settings=new i},
function _(e,t,s,r,n){var a,i,h,u,l,o,c,p,y,_;r();const A=e(8),d=e(27),g=e(26),f=e(31),m=e(32),w=Symbol("__ndarray__");function N(e,t){return{type:"ndarray",array:t.encode("object"==e.dtype?Array.from(e):e.buffer),order:d.BYTE_ORDER,dtype:e.dtype,shape:e.shape}}class D extends Uint8Array{constructor(e,t){super(e),this[a]=!0,this.dtype="bool",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(a=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new D(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return 1==this[e]}}s.BoolNDArray=D,D.__name__="BoolNDArray";class q extends Uint8Array{constructor(e,t){super(e),this[i]=!0,this.dtype="uint8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(i=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new q(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint8NDArray=q,q.__name__="Uint8NDArray";class b extends Int8Array{constructor(e,t){super(e),this[h]=!0,this.dtype="int8",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(h=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new b(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int8NDArray=b,b.__name__="Int8NDArray";class U extends Uint16Array{constructor(e,t){super(e),this[u]=!0,this.dtype="uint16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(u=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new U(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint16NDArray=U,U.__name__="Uint16NDArray";class I extends Int16Array{constructor(e,t){super(e),this[l]=!0,this.dtype="int16",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(l=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new I(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int16NDArray=I,I.__name__="Int16NDArray";class x extends Uint32Array{constructor(e,t){super(e),this[o]=!0,this.dtype="uint32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(o=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new x(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Uint32NDArray=x,x.__name__="Uint32NDArray";class z extends Int32Array{constructor(e,t){super(e),this[c]=!0,this.dtype="int32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(c=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new z(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Int32NDArray=z,z.__name__="Int32NDArray";class F extends Float32Array{constructor(e,t){super(e),this[p]=!0,this.dtype="float32",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(p=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new F(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float32NDArray=F,F.__name__="Float32NDArray";class j extends Float64Array{constructor(e,t){super(e),this[y]=!0,this.dtype="float64",this.shape=null!=t?t:v(e)?e.shape:[this.length],this.dimension=this.shape.length}[(y=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new j(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}s.Float64NDArray=j,j.__name__="Float64NDArray";class B extends Array{get shape(){var e;return null!==(e=this._shape)&&void 0!==e?e:[this.length]}get dimension(){return this.shape.length}constructor(e,t){const s=e instanceof ArrayBuffer?new Float64Array(e):e;if(super((0,A.isNumber)(s)?s:s.length),this[_]=!0,this.dtype="object",!(0,A.isNumber)(s))for(let e=0;e<s.length;e++)this[e]=s[e];this._shape=null!=t?t:v(s)?s.shape:void 0}[(_=w,g.equals)](e,t){return t.eq(this.shape,e.shape)&&t.arrays(this,e)}[f.clone](e){return new B(this,e.clone(this.shape))}[m.serialize](e){return N(this,e)}get(e){return this[e]}}function v(e){return(0,A.isObject)(e)&&w in e}s.ObjectNDArray=B,B.__name__="ObjectNDArray",s.is_NDArray=v,s.ndarray=function(e,{dtype:t,shape:s}={}){switch(null==t&&(t=(()=>{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 ArrayBuffer:case e instanceof Float64Array:return"float64";default:return"object"}})()),t){case"bool":return new D(e,s);case"uint8":return new q(e,s);case"int8":return new b(e,s);case"uint16":return new U(e,s);case"int16":return new I(e,s);case"uint32":return new x(e,s);case"int32":return new z(e,s);case"float32":return new F(e,s);case"float64":return new j(e,s);case"object":return new B(e,s)}}},
function _(n,e,t,o,r){o();const i=n(9),c=n(8);function l(n){return(0,c.isObject)(n)&&t.clone in n}t.clone=Symbol("clone"),t.is_Cloneable=l;class s extends Error{}t.CloningError=s,s.__name__="CloningError";class a{constructor(){}clone(n){if(l(n))return n[t.clone](this);if((0,c.isPrimitive)(n))return n;if((0,c.isArray)(n)){const e=n.length,t=new Array(e);for(let o=0;o<e;o++){const e=n[o];t[o]=this.clone(e)}return t}if((0,c.isPlainObject)(n)){const e={};for(const[t,o]of(0,i.entries)(n))e[t]=this.clone(o);return e}if(n instanceof Map)return new Map([...n].map((([n,e])=>[this.clone(n),this.clone(e)])));if(n instanceof Set)return new Set([...n].map((n=>this.clone(n))));throw new s(`${Object.prototype.toString.call(n)} is not cloneable`)}}t.Cloner=a,a.__name__="Cloner"},
function _(r,e,i,a,f){a();const o=r(1);var l=r(33);f("Serializer",l.Serializer),f("SerializationError",l.SerializationError),f("serialize",l.serialize);var t=r(35);f("Buffer",t.Buffer),f("Base64Buffer",t.Base64Buffer),o.__exportStar(r(37),i)},
function _(e,r,t,n,i){n();const s=e(12),a=e(9),o=e(8),c=e(34),l=e(27),u=e(35);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class y{constructor(e){this.value=e}to_json(){return JSON.stringify(this.value)}}y.__name__="Serialized";class d{constructor(e){var r,t;this._circular=new WeakSet,this.binary=null!==(r=null==e?void 0:e.binary)&&void 0!==r&&r,this.include_defaults=null!==(t=null==e?void 0:e.include_defaults)&&void 0!==t&&t;const n=null==e?void 0:e.references;this._references=null!=n?new Map(n):new Map}get_ref(e){return this._references.get(e)}add_ref(e,r){(0,s.assert)(!this._references.has(e)),this._references.set(e,r)}to_serializable(e){return new y(this.encode(e))}encode(e){const r=this.get_ref(e);if(null!=r)return r;if(!(0,o.isObject)(e))return this._encode(e);this._circular.has(e)&&this.error("circular reference"),this._circular.add(e);try{return this._encode(e)}finally{this._circular.delete(e)}}_encode(e){if(function(e){return(0,o.isObject)(e)&&t.serialize in e}(e))return e[t.serialize](this);if((0,o.isArray)(e)){const r=e.length,t=new Array(r);for(let n=0;n<r;n++){const r=e[n];t[n]=this.encode(r)}return t}if((0,o.isTypedArray)(e))return this._encode_typed_array(e);if(e instanceof ArrayBuffer){return{type:"bytes",data:this.binary?new u.Buffer(e):new u.Base64Buffer(e)}}if((0,o.isPlainObject)(e)){const r=(0,a.entries)(e);return 0==r.length?{type:"map"}:{type:"map",entries:[...(0,c.map)(r,(([e,r])=>[this.encode(e),this.encode(r)]))]}}if(null===e||(0,o.isBoolean)(e)||(0,o.isString)(e))return e;if((0,o.isNumber)(e))return isNaN(e)?{type:"number",value:"nan"}:isFinite(e)?e:{type:"number",value:(e<0?"-":"+")+"inf"};if(e instanceof Date){return{type:"date",iso:e.toISOString()}}if(e instanceof Set)return 0==e.size?{type:"set"}:{type:"set",entries:[...(0,c.map)(e.values(),(e=>this.encode(e)))]};if(e instanceof Map)return 0==e.size?{type:"map"}:{type:"map",entries:[...(0,c.map)(e.entries(),(([e,r])=>[this.encode(e),this.encode(r)]))]};if((0,o.isSymbol)(e)&&null!=e.description)return{type:"symbol",name:e.description};throw new f(`${Object.prototype.toString.call(e)} is not serializable`)}encode_struct(e){const r={};for(const[t,n]of(0,a.entries)(e))void 0!==n&&(r[t]=this.encode(n));return r}error(e){throw new f(e)}_encode_typed_array(e){const r=this.encode(e.buffer),t=(()=>{switch(e.constructor){case Uint8Array:return"uint8";case Int8Array:return"int8";case Uint16Array:return"uint16";case Int16Array:return"int16";case Uint32Array:return"uint32";case Int32Array:return"int32";case Float32Array:return"float32";case Float64Array:return"float64";default:this.error(`can't serialize typed array of type '${e[Symbol.toStringTag]}'`)}})();return{type:"typed_array",array:r,order:l.BYTE_ORDER,dtype:t}}}t.Serializer=d,d.__name__="Serializer"},
function _(n,o,t,e,f){e();const i=n(10),r=n(12);var l=n(13);function*c(n){const o=n.length;for(let t=0;t<o;t++)yield n[o-t-1]}function*s(n,o){(0,r.assert)(o>=0);for(const t of n)0==o?yield t:o-=1}function*a(n,o){const t=n.length;if(o>t)return;const e=(0,i.range)(o);for(yield e.map((o=>n[o]));;){let f;for(const n of c((0,i.range)(o)))if(e[n]!=n+t-o){f=n;break}if(null==f)return;e[f]+=1;for(const n of(0,i.range)(f+1,o))e[n]=e[n-1]+1;yield e.map((o=>n[o]))}}f("min",l.min),f("max",l.max),t.range=function*(n,o,t=1){(0,r.assert)(t>0);const{abs:e,ceil:f,max:i}=Math;null==o&&(o=n,n=0);const l=n<=o?t:-t,c=i(f(e(o-n)/t),0);for(let o=0;o<c;o++,n+=l)yield n},t.reverse=c,t.enumerate=function*(n){let o=0;for(const t of n)yield[t,o++]},t.take=function*(n,o){(0,r.assert)(o>=0);let t=0;for(const e of n){if(!(t++<o))break;yield e}},t.skip=s,t.tail=function*(n){yield*s(n,1)},t.join=function*(n,o){let t=!0;for(const e of n)t?t=!1:null!=o&&(yield o()),yield*e},t.zip=function*(n,o){const t=n[Symbol.iterator](),e=o[Symbol.iterator]();for(;;){const n=t.next(),o=e.next();if(!0===n.done||!0===o.done)break;yield[n.value,o.value]}},t.interleave=function*(n,o){let t=!0;for(const e of n)t?t=!1:yield o(),yield e},t.map=function*(n,o){let t=0;for(const e of n)yield o(e,t++)},t.flat_map=function*(n,o){let t=0;for(const e of n)yield*o(e,t++)},t.every=function(n,o){for(const t of n)if(!o(t))return!1;return!0},t.some=function(n,o){for(const t of n)if(o(t))return!0;return!1},t.combinations=a,t.subsets=function*(n){for(const o of(0,i.range)(n.length+1))yield*a(n,o)}},
function _(e,f,r,s,t){s();const u=e(36),_=e(26);class a{constructor(e){this.buffer=e}to_base64(){return(0,u.buffer_to_base64)(this.buffer)}[_.equals](e,f){return f.eq(this.buffer,e.buffer)}}r.Buffer=a,a.__name__="Buffer";class n extends a{toJSON(){return this.to_base64()}}r.Base64Buffer=n,n.__name__="Base64Buffer"},
function _(t,n,e,r,o){r(),e.buffer_to_base64=function(t){const n=new Uint8Array(t),e=Array.from(n).map((t=>String.fromCharCode(t)));return btoa(e.join(""))},e.base64_to_buffer=function(t){const n=atob(t),e=n.length,r=new Uint8Array(e);for(let t=0,o=e;t<o;t++)r[t]=n.charCodeAt(t);return r.buffer},e.swap=function(t,n){switch(n){case"uint16":case"int16":!function(t){const n=new Uint8Array(t);for(let t=0,e=n.length;t<e;t+=2){const e=n[t];n[t]=n[t+1],n[t+1]=e}}(t);break;case"uint32":case"int32":case"float32":!function(t){const n=new Uint8Array(t);for(let t=0,e=n.length;t<e;t+=4){let e=n[t];n[t]=n[t+3],n[t+3]=e,e=n[t+1],n[t+1]=n[t+2],n[t+2]=e}}(t);break;case"float64":!function(t){const n=new Uint8Array(t);for(let t=0,e=n.length;t<e;t+=8){let e=n[t];n[t]=n[t+7],n[t+7]=e,e=n[t+1],n[t+1]=n[t+6],n[t+6]=e,e=n[t+2],n[t+2]=n[t+5],n[t+5]=e,e=n[t+3],n[t+3]=n[t+4],n[t+4]=e}}(t)}}},
function _(n,c,f,i,o){i()},
function _(s,t,e,n,i){n();class c{constructor(){this.listeners=new Set}connect(s){this.listeners.add(s)}disconnect(s){this.listeners.delete(s)}report(s){for(const t of this.listeners)t(s)}}e.Diagnostics=c,c.__name__="Diagnostics",e.diagnostics=new c},
function _(t,r,e,a,s){a();const i=t(1),n=t(26),l=i.__importStar(t(13));class o{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}e.Uniform=o,o.__name__="Uniform";class c extends o{constructor(t,r){super(),this.is_scalar=!0,this.value=t,this.length=r}get(t){return this.value}*[Symbol.iterator](){const{length:t,value:r}=this;for(let e=0;e<t;e++)yield r}select(t){return new c(this.value,t.count)}[n.equals](t,r){return r.eq(this.length,t.length)&&r.eq(this.value,t.value)}}e.UniformScalar=c,c.__name__="UniformScalar";class h extends o{constructor(t){super(),this.is_scalar=!1,this.array=t,this.length=this.array.length}get(t){return this.array[t]}*[Symbol.iterator](){yield*this.array}select(t){const r=t.select(this.array);return new this.constructor(r)}[n.equals](t,r){return r.eq(this.length,t.length)&&r.eq(this.array,t.array)}}e.UniformVector=h,h.__name__="UniformVector";class u extends h{constructor(t){super(t),this.array=t,this._view=new DataView(t.buffer)}get(t){return this._view.getUint32(4*t)}*[Symbol.iterator](){const t=this.length;for(let r=0;r<t;r++)yield this.get(r)}}e.ColorUniformVector=u,u.__name__="ColorUniformVector",e.min=function(t){return t.is_Scalar()?t.value:l.min(t.array)},e.max=function(t){return t.is_Scalar()?t.value:l.max(t.array)}},
function _(e,t,r,n,u){n();const c=e(29);function s(){const e=new Array(32),t="0123456789ABCDEF";for(let r=0;r<32;r++)e[r]=t[Math.floor(16*Math.random())];return e[12]="4",e[16]=t[3&e[16].charCodeAt(0)|8],e.join("")}r.uuid4=s;let a=1e3;r.unique_id=function(e){const t=c.settings.dev?"j"+a++:s();return null!=e?`${e}-${t}`:t},r.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}}))},r.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}}))},r.use_strict=function(e){return`'use strict';\n${e}`},r.to_fixed=function(e,t){return e.toFixed(t).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")},r.insert_text_on_position=function(e,t,r){const n=[];return n.push(e.slice(0,t)),n.push(r),n.push(e.slice(t)),n.join("")}},
function _(e,t,s,n,a){n();const i=e(26),r=e(32);class d{constructor(e){this.document=e}get[Symbol.toStringTag](){return this.constructor.__name__}[i.equals](e,t){return t.eq(this.document,e.document)}}s.DocumentEvent=d,d.__name__="DocumentEvent";class o extends d{constructor(e,t){super(e),this.events=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.events,e.events)}}s.DocumentEventBatch=o,o.__name__="DocumentEventBatch";class l extends d{}s.DocumentChangedEvent=l,l.__name__="DocumentChangedEvent";class h extends l{constructor(e,t,s){super(e),this.kind="MessageSent",this.msg_type=t,this.msg_data=s}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.msg_type,e.msg_type)&&t.eq(this.msg_data,e.msg_data)}[r.serialize](e){return{kind:this.kind,msg_type:this.msg_type,msg_data:e.encode(this.msg_data)}}}s.MessageSentEvent=h,h.__name__="MessageSentEvent";class u extends l{constructor(e,t,s,n){super(e),this.kind="ModelChanged",this.model=t,this.attr=s,this.value=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.value,e.value)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,new:e.encode(this.value)}}}s.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class m extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnDataChanged",this.model=t,this.attr=s,this.data=n,this.cols=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.cols,e.cols)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),cols:this.cols}}}s.ColumnDataChangedEvent=m,m.__name__="ColumnDataChangedEvent";class c extends l{constructor(e,t,s,n,a){super(e),this.kind="ColumnsStreamed",this.model=t,this.attr=s,this.data=n,this.rollover=a}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.data,e.data)&&t.eq(this.rollover,e.rollover)}[r.serialize](e){return{kind:this.kind,model:this.model.ref(),attr:this.attr,data:e.encode(this.data),rollover:this.rollover}}}s.ColumnsStreamedEvent=c,c.__name__="ColumnsStreamedEvent";class _ extends l{constructor(e,t,s,n){super(e),this.kind="ColumnsPatched",this.model=t,this.attr=s,this.patches=n}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)&&t.eq(this.attr,e.attr)&&t.eq(this.patches,e.patches)}[r.serialize](e){return{kind:this.kind,attr:this.attr,model:this.model.ref(),patches:e.encode(this.patches)}}}s.ColumnsPatchedEvent=_,_.__name__="ColumnsPatchedEvent";class q extends l{constructor(e,t){super(e),this.kind="TitleChanged",this.title=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.title,e.title)}[r.serialize](e){return{kind:this.kind,title:this.title}}}s.TitleChangedEvent=q,q.__name__="TitleChangedEvent";class v extends l{constructor(e,t){super(e),this.kind="RootAdded",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:e.encode(this.model)}}}s.RootAddedEvent=v,v.__name__="RootAddedEvent";class p extends l{constructor(e,t){super(e),this.kind="RootRemoved",this.model=t}[i.equals](e,t){return super[i.equals](e,t)&&t.eq(this.model,e.model)}[r.serialize](e){return{kind:this.kind,model:this.model.ref()}}}s.RootRemovedEvent=p,p.__name__="RootRemovedEvent"},
function _(t,r,i,n,e){n();const s=t(8),o=t(9);i.pretty=Symbol("pretty");class u{constructor(t){this.visited=new Set,this.precision=null==t?void 0:t.precision}to_string(t){if((0,s.isObject)(t)){if(this.visited.has(t))return"<circular>";this.visited.add(t)}return function(t){return(0,s.isObject)(t)&&i.pretty in t}(t)?t[i.pretty](this):(0,s.isBoolean)(t)?this.boolean(t):(0,s.isNumber)(t)?this.number(t):(0,s.isString)(t)?this.string(t):(0,s.isArray)(t)?this.array(t):(0,s.isIterable)(t)?this.iterable(t):(0,s.isPlainObject)(t)?this.object(t):(0,s.isSymbol)(t)?this.symbol(t):t instanceof ArrayBuffer?this.array_buffer(t):`${t}`}token(t){return t}boolean(t){return`${t}`}number(t){return null!=this.precision?t.toFixed(this.precision):`${t}`}string(t){const r=t.includes("'"),i=t.includes('"');return r&&i?`\`${t.replace(/`/g,"\\`")}\``:i?`'${t}'`:`"${t}"`}symbol(t){return t.toString()}array(t){const r=this.token,i=[];for(const r of t)i.push(this.to_string(r));return`${r("[")}${i.join(`${r(",")} `)}${r("]")}`}iterable(t){var r;const i=this.token,n=null!==(r=Object(t)[Symbol.toStringTag])&&void 0!==r?r:"Object",e=this.array(t);return`${n}${i("(")}${e}${i(")")}`}object(t){const r=this.token,i=[];for(const[n,e]of(0,o.entries)(t))i.push(`${n}${r(":")} ${this.to_string(e)}`);return`${r("{")}${i.join(`${r(",")} `)}${r("}")}`}array_buffer(t){return`ArrayBuffer(#${t.byteLength})`}}i.Printer=u,u.__name__="Printer",i.to_string=function(t,r){return new u(r).to_string(t)}},
function _(t,r,n,e,o){e();const s=t(1),u=t(8),c=t(9),l=t(44),i=s.__importStar(t(45));function a(t,r,n){if((0,u.isArray)(t)&&(0,u.isArray)(r)){const e=t.concat(r);return null!=n&&e.length>n?e.slice(-n):e}const e=t.length+r.length;if(null!=n&&e>n){const o=e-n,s=t.length,c=(()=>{if(t.length<n){const e=new((()=>{if((0,u.isTypedArray)(t))return t.constructor;if((0,u.isTypedArray)(r))return r.constructor;throw new Error("unsupported array types")})())(n);return e.set(t,0),e}return t})();for(let t=o,r=s;t<r;t++)c[t-o]=c[t];for(let t=0,n=r.length;t<n;t++)c[t+(s-o)]=r[t];return c}{const n=(()=>{if((0,u.isTypedArray)(t))return t;if((0,u.isTypedArray)(r))return new r.constructor(t);throw new Error("unsupported array types")})();return i.concat(n,r)}}function f(t,r){let n,e,o;return(0,u.isNumber)(t)?(n=t,o=t+1,e=1):(n=null!=t.start?t.start:0,o=null!=t.stop?t.stop:r,e=null!=t.step?t.step:1),[n,o,e]}function p(t,r){const n=new Set;let e=!1;for(const[o,s]of r){let r,c,l,i;if((0,u.isArray)(o)){const[e]=o;n.add(e),r=t[e].shape,c=t[e],i=s,2===o.length?(r=[1,r[0]],l=[o[0],0,o[1]]):l=o}else(0,u.isNumber)(o)?(i=[s],n.add(o)):(i=s,e=!0),l=[0,0,o],r=[1,t.length],c=t;let a=0;const[p,y,h]=f(l[1],r[0]),[d,_,m]=f(l[2],r[1]);for(let t=p;t<y;t+=h)for(let o=d;o<_;o+=m)e&&n.add(o),c[t*r[1]+o]=i[a],a++}return n}n.stream_to_column=a,n.slice=f,n.patch_to_column=p,n.stream_to_columns=function(t,r,n){for(const[e,o]of(0,c.entries)(r))t[e]=a(t[e],o,n)},n.patch_to_columns=function(t,r){let n=new Set;for(const[e,o]of(0,c.entries)(r))n=(0,l.union)(n,p(t[e],o));return n}},
function _(n,o,t,e,f){function c(...n){const o=new Set;for(const t of n)for(const n of t)o.add(n);return o}e(),t.union=c,t.intersection=function(n,...o){const t=new Set;n:for(const e of n){for(const n of o)if(!n.has(e))continue n;t.add(e)}return t},t.difference=function(n,...o){const t=new Set(n);for(const n of c(...o))t.delete(n);return t}},
function _(t,n,o,e,c){e(),o.concat=function(t,...n){let o=t.length;for(const t of n)o+=t.length;const e=new t.constructor(o);e.set(t,0);let c=t.length;for(const t of n)e.set(t,c),c+=t.length;return e}},
function _(e,s,t,n,o){n();class l{constructor(e,s=[]){this._known_models=new Map,this.parent=e;for(const e of s)this.register(e)}get(e){var s,t,n;return null!==(n=null!==(s=this._known_models.get(e))&&void 0!==s?s:null===(t=this.parent)||void 0===t?void 0:t.get(e))&&void 0!==n?n:null}register(e,s=!1){const t=e.__qualified__;s||null==this.get(t)?this._known_models.set(t,e):console.warn(`Model '${t}' was already registered with this resolver`)}get names(){return[...this._known_models.keys()]}}t.ModelResolver=l,l.__name__="ModelResolver"},
function _(e,r,t,n,s){n();const i=e(19),d=e(17),o=e(30),a=e(9),c=e(10),_=e(27),u=e(36),l=e(8),f=e(48),h=new Map;class y extends Error{}t.DeserializationError=y,y.__name__="DeserializationError";class p{static register(e,r){if(h.has(e))throw new Error(`'${e}' already registered for decoding`);h.set(e,r)}constructor(e,r=new Map,t){this._decoding=!1,this._buffers=new Map,this._finalizable=new Set,this.resolver=e,this.references=r,this.finalize=t}decode(e,r){var t;if(null!=r)for(const[e,t]of r)this._buffers.set(e,t);if(this._decoding)return this._decode(e);let n;this._decoding=!0;const s=(()=>{try{return this._decode(e)}finally{n=new Set(this._finalizable),this._decoding=!1,this._buffers.clear(),this._finalizable.clear()}})();for(const e of n)null===(t=this.finalize)||void 0===t||t.call(this,e),e.finalize(),e.assert_initialized();for(const e of n)e.connect_signals();return s}_decode(e){if((0,l.isArray)(e))return this._decode_plain_array(e);if(!(0,l.isPlainObject)(e))return e;if(!(0,l.isString)(e.type))return(0,l.isString)(e.id)?this._decode_ref(e):this._decode_plain_object(e);{const r=h.get(e.type);if(null!=r)return r(e,this);switch(e.type){case"ref":return this._decode_ref(e);case"symbol":return this._decode_symbol(e);case"number":return this._decode_number(e);case"array":return this._decode_array(e);case"set":return this._decode_set(e);case"map":return this._decode_map(e);case"bytes":return this._decode_bytes(e);case"slice":return this._decode_slice(e);case"date":return this._decode_date(e);case"value":return this._decode_value(e);case"field":return this._decode_field(e);case"expr":return this._decode_expr(e);case"typed_array":return this._decode_typed_array(e);case"ndarray":return this._decode_ndarray(e);case"object":return(0,l.isString)(e.id)?this._decode_object_ref(e):this._decode_object(e);default:this.error(`unable to decode an object of type '${e.type}'`)}}}_decode_symbol(e){this.error(`can't resolve named symbol '${e.name}'`)}_decode_number(e){if("value"in e){const{value:r}=e;if((0,l.isString)(r))switch(r){case"nan":return NaN;case"+inf":return 1/0;case"-inf":return-1/0}else if((0,l.isNumber)(r))return r}this.error(`invalid number representation '${e}'`)}_decode_plain_array(e){return(0,c.map)(e,(e=>this._decode(e)))}_decode_plain_object(e){const r={};for(const[t,n]of(0,a.entries)(e))r[t]=this._decode(n);return r}_decode_array(e){var r;const t=[];for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.push(this._decode(n));return t}_decode_set(e){var r;const t=new Set;for(const n of null!==(r=e.entries)&&void 0!==r?r:[])t.add(this._decode(n));return t}_decode_map(e){var r;const t=(0,c.map)(null!==(r=e.entries)&&void 0!==r?r:[],(([e,r])=>[this._decode(e),this._decode(r)]));if((0,c.every)(t,(([e])=>(0,l.isString)(e)))){const e={};for(const[r,n]of t)e[r]=n;return e}return new Map(t)}_decode_bytes(e){const{data:r}=e;if(!(0,d.is_ref)(r))return(0,l.isString)(r)?(0,u.base64_to_buffer)(r):r.buffer;{const e=this._buffers.get(r.id);if(null!=e)return e;this.error(`buffer for id=${r.id} not found`)}}_decode_slice(e){const r=this._decode(e.start),t=this._decode(e.stop),n=this._decode(e.step);return new f.Slice({start:r,stop:t,step:n})}_decode_date(e){const r=this._decode(e.iso);return new Date(r)}_decode_value(e){return{value:this._decode(e.value),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_field(e){return{field:this._decode(e.field),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_expr(e){return{expr:this._decode(e.expr),transform:null!=e.transform?this._decode(e.transform):void 0,units:null!=e.units?this._decode(e.units):void 0}}_decode_typed_array(e){const{array:r,order:t,dtype:n}=e,s=this._decode(r);switch(t!=_.BYTE_ORDER&&(0,u.swap)(s,n),n){case"uint8":return new Uint8Array(s);case"int8":return new Int8Array(s);case"uint16":return new Uint16Array(s);case"int16":return new Int16Array(s);case"uint32":return new Uint32Array(s);case"int32":return new Int32Array(s);case"float32":return new Float32Array(s);case"float64":return new Float64Array(s);default:this.error(`unsupported dtype '${n}'`)}}_decode_ndarray(e){const{array:r,order:t,dtype:n,shape:s}=e,i=this._decode(r);return i instanceof ArrayBuffer&&t!=_.BYTE_ORDER&&(0,u.swap)(i,n),(0,o.ndarray)(i,{dtype:n,shape:s})}_decode_object(e){const{type:r,attributes:t}=e,n=this._resolve_type(r);return null!=t?new n(this._decode(t)):new n}_decode_ref(e){const r=this.references.get(e.id);if(null!=r)return r;this.error(`reference ${e.id} isn't known`)}_decode_object_ref(e){const r=this.references.get(e.id);if(null!=r)return this.warning(`reference already known '${e.id}'`),r;const{id:t,name:n,attributes:s}=e,i=new(this._resolve_type(n))({id:t});this.references.set(t,i);const d=this._decode(null!=s?s:{});return i.initialize_props(new a.Dict(d)),this._finalizable.add(i),i}error(e){throw new y(e)}warning(e){i.logger.warn(e)}_resolve_type(e){const r=this.resolver.get(e);if(null!=r)return r;this.error(`could not resolve type '${e}', which could be due to a widget or a custom model not being registered before first usage`)}}t.Deserializer=p,p.__name__="Deserializer"},
function _(t,s,e,l,n){l();const i=t(32);class c{constructor({start:t,stop:s,step:e}={}){this.start=null!=t?t:null,this.stop=null!=s?s:null,this.step=null!=e?e:null}[i.serialize](t){return{type:"slice",start:t.encode(this.start),stop:t.encode(this.stop),step:t.encode(this.step)}}}e.Slice=c,c.__name__="Slice"},
function _(n,e,r,c,i){c(),r.pyify_version=function(n){return n.replace(/-(dev|rc)\./,".$1")}},
function _(e,t,s,n,c){var i;n();const a=e(14),r=e(8),l=e(9),o=e(26),_=e(19);class h extends a.HasProps{get is_syncable(){return this.syncable}[o.equals](e,t){return(!!t.structural||t.eq(this.id,e.id))&&super[o.equals](e,t)}constructor(e){super(e)}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 s of null!==(t=(0,l.dict)(this.js_event_callbacks).get(e.event_name))&&void 0!==t?t:[])s.execute(e);null!=this.document&&this.subscribed_events.has(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):_.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const e=e=>{const[t,s=null]=e.split(":");return null!=s?this.properties[s][t]:this[t]};for(const[t,s]of this._js_callbacks){const n=e(t);for(const e of s)this.disconnect(n,e)}this._js_callbacks.clear();for(const[t,s]of(0,l.dict)(this.js_property_callbacks)){const n=s.map((e=>()=>e.execute(this)));this._js_callbacks.set(t,n);const c=e(t);for(const e of n)this.connect(c,e)}}_doc_attached(){(0,l.dict)(this.js_event_callbacks).is_empty&&0==this.subscribed_events.size||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(e){if((0,r.isString)(e))return[...this.references()].filter((t=>t instanceof i&&t.name===e));if((0,r.isPlainObject)(e)&&"type"in e)return[...this.references()].filter((t=>t.type==e.type));if(e.prototype instanceof a.HasProps)return[...this.references()].filter((t=>t instanceof e));throw new Error(`invalid selector ${e}`)}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 ${e}`)}}on_event(e,t){var s;const n=(0,r.isString)(e)?e:e.prototype.event_name;this.js_event_callbacks[n]=[...null!==(s=(0,l.dict)(this.js_event_callbacks).get(n))&&void 0!==s?s:[],(0,r.isFunction)(t)?{execute:t}:t]}}s.Model=h,i=h,h.__name__="Model",i.define((({Any:e,Unknown:t,Boolean:s,String:n,Array:c,Set:i,Dict:a,Nullable:r})=>({tags:[c(t),[]],name:[r(n),null],js_property_callbacks:[a(c(e)),{}],js_event_callbacks:[a(c(e)),{}],subscribed_events:[i(n),new globalThis.Set],syncable:[s,!0]})))},
function _(e,n,r,t,o){t();const s=e(1),c=e(50),u=s.__importStar(e(21)),a=e(8),i=e(9);r.decode_def=function(e,n){var r,t,o;function l(e){if((0,a.isString)(e))switch(e){case"Any":return u.Any;case"Unknown":return u.Unknown;case"Boolean":return u.Boolean;case"Number":return u.Number;case"Int":return u.Int;case"Bytes":return u.Bytes;case"String":return u.String;case"Null":return u.Null}else switch(e[0]){case"Regex":{const[,n,r]=e;return u.Regex(new RegExp(n,r))}case"Nullable":{const[,n]=e;return u.Nullable(l(n))}case"Or":{const[,n,...r]=e;return u.Or(l(n),...r.map(l))}case"Tuple":{const[,n,...r]=e;return u.Tuple(l(n),...r.map(l))}case"Array":{const[,n]=e;return u.Array(l(n))}case"Struct":{const[,...n]=e,r=n.map((([e,n])=>[e,l(n)]));return u.Struct((0,i.to_object)(r))}case"Dict":{const[,n]=e;return u.Dict(l(n))}case"Map":{const[,n,r]=e;return u.Map(l(n),l(r))}case"Enum":{const[,...n]=e;return u.Enum(...n)}case"Ref":{const[,r]=e,t=n.resolver.get(r.id);if(null!=t)return u.Ref(t);throw new Error(`${r.id} wasn't defined before referencing it`)}case"AnyRef":return u.AnyRef()}}const d=(()=>{var r,t;const o=null!==(t=null===(r=e.extends)||void 0===r?void 0:r.id)&&void 0!==t?t:"Model";if("Model"==o)return c.Model;const s=n.resolver.get(o);if(null!=s)return s;throw new Error(`base model ${o} of ${e.name} is not defined`)})(),f=(o=class extends d{},s.__setFunctionName(o,"model"),o.__qualified__=e.name,o);function m(e){return void 0===e?e:n.decode(e)}for(const n of null!==(r=e.properties)&&void 0!==r?r:[]){const e=l(n.kind);f.define({[n.name]:[e,m(n.default)]})}for(const n of null!==(t=e.overrides)&&void 0!==t?t:[])f.override({[n.name]:m(n.default)});return n.resolver.register(f),f}},
function _(e,t,s,n,a){var _,l,o,r,c,u,i,v,d,m,p,h,x,g,y,b,P,E,O,j,M,R,f,S,D,L,k,C;n();var B=this&&this.__decorate||function(e,t,s,n){var a,_=arguments.length,l=_<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(_<3?a(l):_>3?a(t,s,l):a(t,s))||l);return _>3&&l&&Object.defineProperty(t,s,l),l};const U=e(32),T=e(26),I=e(21);function w(e){return t=>{t.prototype.event_name=e}}s.KeyModifiers=(0,I.PartialStruct)({shift:I.Boolean,ctrl:I.Boolean,alt:I.Boolean});class G{[U.serialize](e){const{event_name:t,event_values:s}=this;return{type:"event",name:t,values:e.encode(s)}}[T.equals](e,t){return this.event_name==e.event_name&&t.eq(this.event_values,e.event_values)}}s.BokehEvent=G,_=G,G.__name__="BokehEvent",_.prototype.publish=!0;class V extends G{constructor(){super(...arguments),this.origin=null}get event_values(){return{model:this.origin}}}s.ModelEvent=V,V.__name__="ModelEvent";class W extends G{}s.DocumentEvent=W,W.__name__="DocumentEvent";let q=((l=class extends W{get event_values(){return{}}}).__name__="DocumentReady",l);s.DocumentReady=q,s.DocumentReady=q=B([w("document_ready")],q);class z extends W{}s.ConnectionEvent=z,z.__name__="ConnectionEvent";class K extends z{constructor(){super(...arguments),this.timestamp=new Date}get event_values(){const{timestamp:e}=this;return{timestamp:e}}}s.ConnectionLost=K,o=K,K.__name__="ConnectionLost",o.prototype.event_name="connection_lost",o.prototype.publish=!1;let A=((r=class extends V{}).__name__="ButtonClick",r);s.ButtonClick=A,s.ButtonClick=A=B([w("button_click")],A);let F=((c=class extends V{constructor(e){super(),this.item=e}get event_values(){const{item:e}=this;return Object.assign(Object.assign({},super.event_values),{item:e})}}).__name__="MenuItemClick",c);s.MenuItemClick=F,s.MenuItemClick=F=B([w("menu_item_click")],F);let H=((u=class extends V{constructor(e){super(),this.value=e}get event_values(){const{value:e}=this;return Object.assign(Object.assign({},super.event_values),{value:e})}}).__name__="ValueSubmit",u);s.ValueSubmit=H,s.ValueSubmit=H=B([w("value_submit")],H);class J extends V{}s.UIEvent=J,J.__name__="UIEvent";let N=((i=class extends J{}).__name__="LODStart",i);s.LODStart=N,s.LODStart=N=B([w("lodstart")],N);let Q=((v=class extends J{}).__name__="LODEnd",v);s.LODEnd=Q,s.LODEnd=Q=B([w("lodend")],Q);let X=((d=class extends J{constructor(e,t,s,n){super(),this.x0=e,this.x1=t,this.y0=s,this.y1=n}get event_values(){const{x0:e,x1:t,y0:s,y1:n}=this;return Object.assign(Object.assign({},super.event_values),{x0:e,x1:t,y0:s,y1:n})}}).__name__="RangesUpdate",d);s.RangesUpdate=X,s.RangesUpdate=X=B([w("rangesupdate")],X);let Y=((m=class extends J{constructor(e,t){super(),this.geometry=e,this.final=t}get event_values(){const{geometry:e,final:t}=this;return Object.assign(Object.assign({},super.event_values),{geometry:e,final:t})}}).__name__="SelectionGeometry",m);s.SelectionGeometry=Y,s.SelectionGeometry=Y=B([w("selectiongeometry")],Y);let Z=((p=class extends J{}).__name__="Reset",p);s.Reset=Z,s.Reset=Z=B([w("reset")],Z);class $ extends J{constructor(e,t,s,n,a){super(),this.sx=e,this.sy=t,this.x=s,this.y=n,this.modifiers=a}get event_values(){const{sx:e,sy:t,x:s,y:n,modifiers:a}=this;return Object.assign(Object.assign({},super.event_values),{sx:e,sy:t,x:s,y:n,modifiers:a})}}s.PointEvent=$,$.__name__="PointEvent";let ee=((h=class extends ${constructor(e,t,s,n,a,_,l){super(e,t,s,n,l),this.delta_x=a,this.delta_y=_}get event_values(){const{delta_x:e,delta_y:t}=this;return Object.assign(Object.assign({},super.event_values),{delta_x:e,delta_y:t})}}).__name__="Pan",h);s.Pan=ee,s.Pan=ee=B([w("pan")],ee);let te=((x=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.scale=a}get event_values(){const{scale:e}=this;return Object.assign(Object.assign({},super.event_values),{scale:e})}}).__name__="Pinch",x);s.Pinch=te,s.Pinch=te=B([w("pinch")],te);let se=((g=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.rotation=a}get event_values(){const{rotation:e}=this;return Object.assign(Object.assign({},super.event_values),{rotation:e})}}).__name__="Rotate",g);s.Rotate=se,s.Rotate=se=B([w("rotate")],se);let ne=((y=class extends ${constructor(e,t,s,n,a,_){super(e,t,s,n,_),this.delta=a}get event_values(){const{delta:e}=this;return Object.assign(Object.assign({},super.event_values),{delta:e})}}).__name__="MouseWheel",y);s.MouseWheel=ne,s.MouseWheel=ne=B([w("wheel")],ne);let ae=((b=class extends ${}).__name__="MouseMove",b);s.MouseMove=ae,s.MouseMove=ae=B([w("mousemove")],ae);let _e=((P=class extends ${}).__name__="MouseEnter",P);s.MouseEnter=_e,s.MouseEnter=_e=B([w("mouseenter")],_e);let le=((E=class extends ${}).__name__="MouseLeave",E);s.MouseLeave=le,s.MouseLeave=le=B([w("mouseleave")],le);let oe=((O=class extends ${}).__name__="Tap",O);s.Tap=oe,s.Tap=oe=B([w("tap")],oe);let re=((j=class extends ${}).__name__="DoubleTap",j);s.DoubleTap=re,s.DoubleTap=re=B([w("doubletap")],re);let ce=((M=class extends ${}).__name__="Press",M);s.Press=ce,s.Press=ce=B([w("press")],ce);let ue=((R=class extends ${}).__name__="PressUp",R);s.PressUp=ue,s.PressUp=ue=B([w("pressup")],ue);let ie=((f=class extends ${}).__name__="PanStart",f);s.PanStart=ie,s.PanStart=ie=B([w("panstart")],ie);let ve=((S=class extends ${}).__name__="PanEnd",S);s.PanEnd=ve,s.PanEnd=ve=B([w("panend")],ve);let de=((D=class extends ${}).__name__="PinchStart",D);s.PinchStart=de,s.PinchStart=de=B([w("pinchstart")],de);let me=((L=class extends ${}).__name__="PinchEnd",L);s.PinchEnd=me,s.PinchEnd=me=B([w("pinchend")],me);let pe=((k=class extends ${}).__name__="RotateStart",k);s.RotateStart=pe,s.RotateStart=pe=B([w("rotatestart")],pe);let he=((C=class extends ${}).__name__="RotateEnd",C);s.RotateEnd=he,s.RotateEnd=he=B([w("rotateend")],he)},
function _(e,n,t,i,o){i();const r=e(5),d=e(54),l=e(55),a=e(59),c=e(8);t.index=new Proxy(new d.ViewManager,{get(e,n){if((0,c.isString)(n)){const t=e.get_by_id(n);if(null!=t)return t}return Reflect.get(e,n)},has(e,n){if((0,c.isString)(n)){if(null!=e.get_by_id(n))return!0}return Reflect.has(e,n)},ownKeys:e=>e.roots.map((e=>e.model.id)),getOwnPropertyDescriptor(e,n){if((0,c.isString)(n)){const t=e.get_by_id(n);if(null!=t)return{configurable:!0,enumerable:!0,writable:!1,value:t}}return Reflect.getOwnPropertyDescriptor(e,n)}}),t.add_document_standalone=async function(e,n,i=[],o=!1){const c=new d.ViewManager([],s);async function u(o){null!=o.default_view?await async function(o){var r;const d=await(0,a.build_view)(o,{parent:null,owner:c});if(d instanceof l.DOMView){const t=e.roots().indexOf(o),l=null!==(r=i[t])&&void 0!==r?r:n;d.render_to(l)}c.add(d),t.index.add(d)}(o):e.notify_idle(o)}function s(e){e.remove(),c.delete(e),t.index.delete(e)}for(const n of e.roots())await u(n);return o&&(window.document.title=e.title()),e.on_change((e=>{e instanceof r.RootAddedEvent?u(e.model):e instanceof r.RootRemovedEvent?function(e){const n=c.get(e);null!=n&&s(n)}(e.model):o&&e instanceof r.TitleChangedEvent&&(window.document.title=e.title)})),c}},
function _(t,i,e,n,o){n();const s=t(15),r=t(8);class d{get ready(){return this._ready}*children(){}mark_finished(){this._has_finished=!0}connect(t,i){let e=this._slots.get(i);return null==e&&(e=(t,e)=>{const n=Promise.resolve(i.call(this,t,e));this._ready=this._ready.then((()=>n)),this.root!=this&&(this.root._ready=this.root._ready.then((()=>this._ready)))},this._slots.set(i,e)),t.connect(e,this)}disconnect(t,i){return t.disconnect(i,this)}constructor(t){this.removed=new s.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._removed=!1,this._idle_notified=!1;const{model:i,parent:e,owner:n}=t;this.model=i,this.parent=e,null==e?(this.root=this,this.owner=null!=n?n:new h([this])):(this.root=e.root,this.owner=this.root.owner)}initialize(){this._has_finished=!1}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit(),this._removed=!0}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(){s.Signal.disconnect_receiver(this)}on_change(t,i){for(const e of(0,r.isArray)(t)?t:[t])this.connect(e.change,i)}cursor(t,i){return null}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()}}e.View=d,d.__name__="View";class h{constructor(t=[],i){this.drop=i,this._roots=new Set(t)}toString(){return`ViewManager(${[...this._roots].map((t=>`${t}`)).join(", ")})`}get(t){for(const i of this._roots)if(i.model==t)return i;return null}get_by_id(t){for(const i of this._roots)if(i.model.id==t)return i;return null}add(t){this._roots.add(t)}delete(t){this._roots.delete(t)}clear(){var t;const i=null!==(t=this.drop)&&void 0!==t?t:t=>this.delete(t);for(const t of this)i(t)}get roots(){return[...this._roots]}*[Symbol.iterator](){yield*this._roots}*views(){yield*this.query((()=>!0))}*query(t){const i=new Set;function*e(n){if(!i.has(n)){i.add(n),t(n)&&(yield n);for(const t of n.children())yield*e(t)}}for(const t of this._roots)yield*e(t)}query_one(t){for(const i of this.query(t))return i;return null}*find(t){yield*this.query((i=>i.model==t))}*find_by_id(t){yield*this.query((i=>i.model.id==t))}find_one(t){for(const i of this.find(t))return i;return null}find_one_by_id(t){for(const i of this.find_by_id(t))return i;return null}get_one(t){const i=this.find_one(t);if(null!=i)return i;throw new Error(`cannot find a view for ${t}`)}get_one_by_id(t){const i=this.find_one_by_id(t);if(null!=i)return i;throw new Error(`cannot find a view for a model with '${t}' identity`)}find_all(t){return[...this.find(t)]}find_all_by_id(t){return[...this.find_by_id(t)]}}e.ViewManager=h,h.__name__="ViewManager"},
function _(s,e,t,i,l){i();const _=s(1),a=s(54),h=s(56),c=s(8),n=_.__importDefault(s(58));class p extends a.View{get children_el(){var s;return null!==(s=this.shadow_el)&&void 0!==s?s:this.el}initialize(){super.initialize(),this.el=this._createElement()}remove(){(0,h.remove)(this.el),super.remove()}stylesheets(){return[]}css_classes(){return[]}render_to(s){s.appendChild(this.el),this.render()}finish(){this._has_finished=!0,this.notify_finished()}_createElement(){return(0,h.createElement)(this.constructor.tag_name,{class:this.css_classes()})}}t.DOMView=p,p.__name__="DOMView",p.tag_name="div";class r extends p{initialize(){super.initialize(),this.class_list=new h.ClassList(this.el.classList)}}t.DOMElementView=r,r.__name__="DOMElementView";class d extends r{constructor(){super(...arguments),this._applied_stylesheets=[],this._applied_css_classes=[]}initialize(){super.initialize(),this.shadow_el=this.el.attachShadow({mode:"open"})}stylesheets(){return[...super.stylesheets(),n.default]}empty(){(0,h.empty)(this.shadow_el),this.class_list.clear(),this._applied_css_classes=[],this._applied_stylesheets=[]}render(){this.empty(),this._update_stylesheets(),this._update_css_classes()}*_stylesheets(){for(const s of this.stylesheets())yield(0,c.isString)(s)?new h.InlineStyleSheet(s):s}*_css_classes(){yield`bk-${this.model.type.replace(/\./g,"-")}`,yield*this.css_classes()}_apply_stylesheets(s){this._applied_stylesheets.push(...s),s.forEach((s=>s.install(this.shadow_el)))}_apply_css_classes(s){this._applied_css_classes.push(...s),this.class_list.add(...s)}_update_stylesheets(){this._applied_stylesheets.forEach((s=>s.uninstall())),this._applied_stylesheets=[],this._apply_stylesheets([...this._stylesheets()])}_update_css_classes(){this.class_list.remove(this._applied_css_classes),this._applied_css_classes=[],this._apply_css_classes([...this._css_classes()])}}t.DOMComponentView=d,d.__name__="DOMComponentView"},
function _(t,e,n,o,i){o(),n.supports_adopted_stylesheets=n.px=n.dom_ready=n.GlobalImportedStyleSheet=void 0;const s=t(8),l=t(9),r=t(57),c=t=>(e={},...n)=>{const o=document.createElement(t);(0,s.isPlainObject)(e)||(n=[e,...n],e={});for(let[t,n]of(0,l.entries)(e))if(null!=n&&(!(0,s.isBoolean)(n)||n))if("class"===t&&((0,s.isString)(n)&&(n=n.split(/\s+/)),(0,s.isArray)(n)))for(const t of n)null!=t&&o.classList.add(t);else if("style"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.style[t]=e;else if("data"===t&&(0,s.isPlainObject)(n))for(const[t,e]of(0,l.entries)(n))o.dataset[t]=e;else o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o};function a(t){return document.createTextNode(t)}function d(t){const e=t.parentNode;null!=e&&e.removeChild(t)}function h(t){const e=parseFloat(t);return isFinite(e)?e:0}function u(t){const e=getComputedStyle(t);return{border:{top:h(e.borderTopWidth),bottom:h(e.borderBottomWidth),left:h(e.borderLeftWidth),right:h(e.borderRightWidth)},margin:{top:h(e.marginTop),bottom:h(e.marginBottom),left:h(e.marginLeft),right:h(e.marginRight)},padding:{top:h(e.paddingTop),bottom:h(e.paddingBottom),left:h(e.paddingLeft),right:h(e.paddingRight)}}}function f(t){const e=t.getBoundingClientRect();return{width:Math.ceil(e.width),height:Math.ceil(e.height)}}n.createElement=function(t,e,...n){return c(t)(e,...n)},n.div=c("div"),n.span=c("span"),n.canvas=c("canvas"),n.link=c("link"),n.style=c("style"),n.a=c("a"),n.p=c("p"),n.i=c("i"),n.pre=c("pre"),n.button=c("button"),n.label=c("label"),n.legend=c("legend"),n.fieldset=c("fieldset"),n.input=c("input"),n.select=c("select"),n.option=c("option"),n.optgroup=c("optgroup"),n.textarea=c("textarea"),n.createSVGElement=function(t,e=null,...n){const o=document.createElementNS("http://www.w3.org/2000/svg",t);for(const[t,n]of(0,l.entries)(null!=e?e:{}))null!=n&&!1!==n&&o.setAttribute(t,n);function i(t){if((0,s.isString)(t))o.appendChild(document.createTextNode(t));else if(t instanceof Node)o.appendChild(t);else if(t instanceof NodeList||t instanceof HTMLCollection)for(const e of t)o.appendChild(e);else if(null!=t&&!1!==t)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(t)}`)}for(const t of n)if((0,s.isArray)(t))for(const e of t)i(e);else i(t);return o},n.text=a,n.nbsp=function(){return a("\xa0")},n.append=function(t,...e){for(const n of e)t.appendChild(n)},n.remove=d,n.replaceWith=function(t,e){const n=t.parentNode;null!=n&&n.replaceChild(e,t)},n.prepend=function(t,...e){const n=t.firstChild;for(const o of e)t.insertBefore(o,n)},n.empty=function(t,e=!1){let n;for(;null!=(n=t.firstChild);)t.removeChild(n);if(e&&t instanceof Element)for(const e of t.attributes)t.removeAttributeNode(e)},n.contains=function(t,e){let n=e;for(;null!=n.parentNode;){const e=n.parentNode;if(e==t)return!0;n=e instanceof ShadowRoot?e.host:e}return!1},n.display=function(t,e=!0){t.style.display=e?"":"none"},n.undisplay=function(t){t.style.display="none"},n.show=function(t){t.style.visibility=""},n.hide=function(t){t.style.visibility="hidden"},n.offset_bbox=function(t){const{top:e,left:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({left:n+scrollX-document.documentElement.clientLeft,top:e+scrollY-document.documentElement.clientTop,width:o,height:i})},n.parent=function(t,e){let n=t;for(;null!=(n=n.parentElement);)if(n.matches(e))return n;return null},n.extents=u,n.size=f,n.scroll_size=function(t){return{width:Math.ceil(t.scrollWidth),height:Math.ceil(t.scrollHeight)}},n.outer_size=function(t){const{margin:{left:e,right:n,top:o,bottom:i}}=u(t),{width:s,height:l}=f(t);return{width:Math.ceil(s+e+n),height:Math.ceil(l+o+i)}},n.content_size=function(t){var e;const{left:n,top:o}=t.getBoundingClientRect(),{padding:i}=u(t);let s=0,l=0;for(const r of(null!==(e=t.shadowRoot)&&void 0!==e?e:t).children){const t=r.getBoundingClientRect();s=Math.max(s,Math.ceil(t.left-n-i.left+t.width)),l=Math.max(l,Math.ceil(t.top-o-i.top+t.height))}return{width:s,height:l}},n.bounding_box=function(t){const{x:e,y:n,width:o,height:i}=t.getBoundingClientRect();return new r.BBox({x:e,y:n,width:o,height:i})},n.box_size=function(t){const{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}},n.position=function(t,e,n){const{style:o}=t;if(o.left=`${e.x}px`,o.top=`${e.y}px`,o.width=`${e.width}px`,o.height=`${e.height}px`,null==n)o.margin="";else{const{top:t,right:e,bottom:i,left:s}=n;o.margin=`${t}px ${e}px ${i}px ${s}px`}};class p{constructor(t){this.class_list=t}get values(){const t=[];for(let e=0;e<this.class_list.length;e++){const n=this.class_list.item(e);null!=n&&t.push(n)}return t}has(t){return this.class_list.contains(t)}add(...t){for(const e of t)this.class_list.add(e);return this}remove(...t){for(const e of t)(0,s.isArray)(e)?e.forEach((t=>this.class_list.remove(t))):this.class_list.remove(e);return this}clear(){for(const t of this.values)this.class_list.remove(t);return this}toggle(t,e){return(null!=e?e:!this.has(t))?this.add(t):this.remove(t),this}}var g;n.ClassList=p,p.__name__="ClassList",n.classes=function(t){return new p(t.classList)},n.toggle_attribute=function(t,e,n){null==n&&(n=!t.hasAttribute(e)),n?t.setAttribute(e,"true"):t.removeAttribute(e)},(g=n.MouseButton||(n.MouseButton={}))[g.None=0]="None",g[g.Primary=1]="Primary",g[g.Secondary=2]="Secondary",g[g.Auxiliary=4]="Auxiliary",g[g.Left=1]="Left",g[g.Right=2]="Right",g[g.Middle=4]="Middle";class m{install(t){t.append(this.el)}uninstall(){this.el.remove()}}n.StyleSheet=m,m.__name__="StyleSheet";class _ extends m{constructor(t){super(),this.el=(0,n.style)({type:"text/css"},t)}clear(){this.replace("")}*_to_rules(t){for(const[e,n]of(0,l.entries)(t))if(null!=n){const t=e.replace(/_/g,"-");yield`${t}: ${n};`}}_to_css(t,e){return null==e?t:`${t}{${[...this._to_rules(e)].join("")}}`}replace(t,e){this.el.textContent=this._to_css(t,e)}prepend(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${this._to_css(t,e)}\n${o}`}append(t,e){var n;const o=null!==(n=this.el.textContent)&&void 0!==n?n:"";this.el.textContent=`${o}\n${this._to_css(t,e)}`}remove(){d(this.el)}}n.InlineStyleSheet=_,_.__name__="InlineStyleSheet";class y extends _{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalInlineStyleSheet=y,y.__name__="GlobalInlineStyleSheet";class x extends m{constructor(t){super(),this.el=(0,n.link)({rel:"stylesheet",href:t})}replace(t){this.el.href=t}remove(){d(this.el)}}n.ImportedStyleSheet=x,x.__name__="ImportedStyleSheet";class b extends x{install(){this.el.isConnected||document.head.appendChild(this.el)}}n.GlobalImportedStyleSheet=b,b.__name__="GlobalImportedStyleSheet",n.dom_ready=async function(){if("loading"==document.readyState)return new Promise(((t,e)=>{document.addEventListener("DOMContentLoaded",(()=>t()),{once:!0})}))},n.px=function(t){return`${t}px`},n.supports_adopted_stylesheets="adoptedStyleSheets"in ShadowRoot.prototype},
function _(t,e,i,r,n){r();const h=t(24),s=t(26),o=t(13),{min:x,max:y,round:u}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:y(t,e)}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(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}};class c{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:i,x1:r,y1:n}=t;if(isFinite(e+i+r+n)){if(!(e<=r&&i<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${i}, x1: ${r}, y1: ${n}}`);this.x0=e,this.y0=i,this.x1=r,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:i,width:r,height:n}=t;if(!(r>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${i}, width: ${r}, height: ${n}}`);this.x0=e,this.y0=i,this.x1=e+r,this.y1=i+n}else{let i,r,n,h;if("width"in t)if("left"in t)i=t.left,r=i+t.width;else if("right"in t)r=t.right,i=r-t.width;else{const e=t.width/2;i=t.hcenter-e,r=t.hcenter+e}else i=t.left,r=t.right;if("height"in t)if("top"in t)n=t.top,h=n+t.height;else if("bottom"in t)h=t.bottom,n=h-t.height;else{const e=t.height/2;n=t.vcenter-e,h=t.vcenter+e}else n=t.top,h=t.bottom;if(i>r||n>h){if(!e)throw new Error(`invalid bbox {left: ${i}, top: ${n}, right: ${r}, bottom: ${h}}`);i>r&&(i=r),n>h&&(n=h)}this.x0=i,this.y0=n,this.x1=r,this.y1=h}}static from_lrtb({left:t,right:e,top:i,bottom:r}){return new c({x0:Math.min(t,e),y0:Math.min(i,r),x1:Math.max(t,e),y1:Math.max(i,r)})}clone(){return new c(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[s.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:i,y1:r}=this;return isFinite(t+e+i+r)}get is_empty(){const{x0:t,x1:e,y0:i,y1:r}=this;return 0==t&&0==e&&0==i&&0==r}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y: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:t,y0:e,x1:i,y1:r}=this;return{p0:{x:t,y:e},p1:{x:i,y:e},p2:{x:i,y:r},p3:{x:t,y:r}}}get box(){const{x:t,y:e,width:i,height:r}=this;return{x:t,y:e,width:i,height:r}}get lrtb(){const{left:t,right:e,top:i,bottom:r}=this;return{left:t,right:e,top:i,bottom:r}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_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}round(){return new c({x0:u(this.x0),x1:u(this.x1),y0:u(this.y0),y1:u(this.y1)})}relative(){const{width:t,height:e}=this;return new c({x:0,y:0,width:t,height:e})}translate(t,e){const{x:i,y:r,width:n,height:h}=this;return new c({x:t+i,y:e+r,width:n,height:h})}scale(t){return new c({x0:this.x0*t,x1:this.x1*t,y0:this.y0*t,y1:this.y1*t})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return t<this.x0?t=this.x0:t>this.x1&&(t=this.x1),e<this.y0?e=this.y0:e>this.y1&&(e=this.y1),[t,e]}grow_by(t){return new c({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new c({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new c({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:y(this.x1,t.x1),y1:y(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new c({x0:y(this.x0,t.x0),y0:y(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)}):null}intersects(t){return!(t.x1<this.x0||t.x0>this.x1||t.y1<this.y0||t.y0>this.y1)}get x_screen(){var t;const e=this;return null!==(t=this._x_screen)&&void 0!==t?t:this._x_screen={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_screen(){var t;const e=this;return null!==(t=this._y_screen)&&void 0!==t?t:this._y_screen={compute:t=>e.top+t,invert:t=>t-e.top,v_compute(t){const{top:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{top:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.y_range},get target_range(){return e.y_range}}}get x_view(){var t;const e=this;return null!==(t=this._x_view)&&void 0!==t?t:this._x_view={compute:t=>e.left+t,invert:t=>t-e.left,v_compute(t){const{left:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i+t)))},v_invert(t){const{left:i}=e;return(0,o.map)(t,(t=>t-i))},get source_range(){return e.x_range},get target_range(){return e.x_range}}}get y_view(){var t;const e=this;return null!==(t=this._y_view)&&void 0!==t?t:this._y_view={compute:t=>e.bottom-t,invert:t=>e.bottom-t,v_compute(t){const{bottom:i}=e;return new h.ScreenArray((0,o.map)(t,(t=>i-t)))},v_invert(t){const{bottom:i}=e;return(0,o.map)(t,(t=>i-t))},get source_range(){return e.y_range},get target_range(){return{start:e.bottom,end:e.top}}}}get xview(){return this.x_view}get yview(){return this.y_view}}i.BBox=c,c.__name__="BBox"},
function _(o,e,i,n,t){n(),i.default=":host{--base-font:var(--bokeh-base-font, Helvetica, Arial, sans-serif);--mono-font:var(--bokeh-mono-font, monospace);--font-size:12px;--line-height:calc(20 / 14);--line-height-computed:calc(var(--font-size) * var(--line-height));--border-radius:4px;--padding-vertical:6px;--padding-horizontal:12px;}:host{box-sizing:border-box;font-family:var(--base-font);font-size:13px;line-height:var(--line-height);}*,*:before,*:after{box-sizing:inherit;font-family:inherit;}pre,code{font-family:var(--mono-font);margin:0;}"},
function _(e,n,t,o,s){o();const i=e(10),c=e(12);async function a(e,n,t){(0,c.assert)(null!=e,"model doesn't implement a view");const o=new e(Object.assign(Object.assign({},t),{model:n}));return o.initialize(),await o.lazy_initialize(),o}t.build_view=async function(e,n={parent:null},t=(e=>e.default_view)){const o=await a(t(e),e,n);return o.connect_signals(),o},t.build_views=async function(e,n,t={parent:null},o=(e=>e.default_view)){const s=(0,i.difference)([...e.keys()],n),c=[];for(const n of s){const t=e.get(n);null!=t&&(e.delete(n),c.push(t),t.remove())}const l=[],r=n.filter((n=>!e.has(n)));for(const n of r){const s=await a(o(n),n,t);e.set(n,s),l.push(s)}for(const e of l)e.connect_signals();return{created:l,removed:c}},t.remove_views=function(e){for(const[n,t]of e)t.remove(),e.delete(n)}},
function _(n,t,o,e,s){e();const a=n(61),c=n(19),r=n(53);o._get_ws_url=function(n,t){let o,e="ws:";return"https:"==window.location.protocol&&(e="wss:"),null!=t?(o=document.createElement("a"),o.href=t):o=window.location,null!=n?"/"==n&&(n=""):n=o.pathname.replace(/\/+$/,""),`${e}//${o.host}${n}/ws`};const i=new Map;o.add_document_from_session=async function(n,t,o,e=[],s=!1){const l=window.location.search.substring(1);let d;try{d=await function(n,t,o){const e=(0,a.parse_token)(t).session_id;i.has(n)||i.set(n,new Map);const s=i.get(n);return s.has(e)||s.set(e,(0,a.pull_session)(n,t,o)),s.get(e)}(n,t,l)}catch(n){const o=(0,a.parse_token)(t).session_id;throw c.logger.error(`Failed to load Bokeh session ${o}: ${n}`),n}return(0,r.add_document_standalone)(d.document,o,e,s)}},
function _(e,s,n,t,o){t();const r=e(19),i=e(5),l=e(62),c=e(63),_=e(64);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";let h=0;function a(e){let s=e.split(".")[0];const n=s.length%4;return 0!=n&&(s+="=".repeat(4-n)),JSON.parse(atob(s.replace(/_/g,"/").replace(/-/g,"+")))}n.parse_token=a;class d{constructor(e=n.DEFAULT_SERVER_WEBSOCKET_URL,s=n.DEFAULT_TOKEN,t=null){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 c.Receiver,this.url=e,this.token=s,this.args_string=t,this.id=a(s).session_id.split(".")[0],r.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,s)=>{this.socket.binaryType="arraybuffer",this.socket.onopen=()=>this._on_open(e,s),this.socket.onmessage=e=>this._on_message(e),this.socket.onclose=e=>this._on_close(e,s),this.socket.onerror=()=>this._on_error(s)}))}catch(e){throw r.logger.error(`websocket creation failed to url: ${this.url}`),r.logger.error(` - ${e}`),e}}close(){this.closed_permanently||(r.logger.debug(`Permanently closing websocket connection ${this._number}`),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,`close method called on ClientConnection ${this._number}`),this.session._connection_closed())}_schedule_reconnect(e){setTimeout((()=>{var e;this.closed_permanently||(r.logger.info(`Websocket connection ${this._number} disconnected, will not attempt to reconnect`),null===(e=this.session)||void 0===e||e.notify_connection_lost())}),e)}send(e){null!=this.socket?e.send(this.socket):r.logger.error("not connected so cannot send",e)}async send_with_reply(e){const s=await new Promise(((s,n)=>{this._pending_replies.set(e.msgid(),{resolve:s,reject:n}),this.send(e)}));if("ERROR"==s.msgtype())throw new Error(`Error reply ${s.content.text}`);return s}async _pull_doc_json(){const e=l.Message.create("PULL-DOC-REQ",{},{}),s=await this.send_with_reply(e);if(!("doc"in s.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return s.content.doc}async _repull_session_doc(e,s){r.logger.debug(null!=this.session?"Repulling session":"Pulling session for first time");try{const n=await this._pull_doc_json();if(null==this.session)if(this.closed_permanently)r.logger.debug("Got new document after connection was already closed"),s(new Error("The connection has been closed"));else{const s=[],t=i.Document.from_json(n,s);this.session=new _.ClientSession(this,t);for(const e of s)t._trigger_on_change(e);for(const e of this._pending_messages)this.session.handle(e);this._pending_messages=[],r.logger.debug("Created a new session from new pulled doc"),e(this.session)}else this.session.document.replace_with_json(n),r.logger.debug("Updated existing session with new pulled doc")}catch(e){console.trace(e),r.logger.error(`Failed to repull session ${e}`),s(e instanceof Error?e:`${e}`)}}_on_open(e,s){r.logger.info(`Websocket connection ${this._number} is now open`),this._current_handler=n=>{this._awaiting_ack_handler(n,e,s)}}_on_message(e){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol(`${e}`)}const s=this._receiver.message;if(null!=s){const e=s.problem();null!=e&&this._close_bad_protocol(e),this._current_handler(s)}}_on_close(e,s){r.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),s(new Error(`Lost websocket connection, ${e.code} (${e.reason})`))}_on_error(e){r.logger.debug(`Websocket error on socket ${this._number}`);const s="Could not open websocket";r.logger.error(`Failed to connect to Bokeh server: ${s}`),e(new Error(s))}_close_bad_protocol(e){r.logger.error(`Closing connection: ${e}`),null!=this.socket&&this.socket.close(1002,e)}_awaiting_ack_handler(e,s,n){"ACK"===e.msgtype()?(this._current_handler=e=>this._steady_state_handler(e),this._repull_session_doc(s,n)):this._close_bad_protocol("First message was not an ACK")}_steady_state_handler(e){const s=e.reqid(),n=this._pending_replies.get(s);null!=n?(this._pending_replies.delete(s),n.resolve(e)):null!=this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}n.ClientConnection=d,d.__name__="ClientConnection",n.pull_session=function(e,s,n){return new d(e,s,n).connect()}},
function _(e,s,t,r,n){r();const i=e(32),a=e(40),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){var t;const r=null!==(t=this.header.num_buffers)&&void 0!==t?t:0;if(r<=this._buffers.size)throw new Error(`too many buffers received, expecting ${r}`);const{id:n}=JSON.parse(e);this._buffers.set(n,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}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"}}t.Message=f,f.__name__="Message"},
function _(t,e,s,_,r){_();const i=t(62),h=t(8),a=t(12);class n{constructor(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}consume(t){this._current_consumer(t)}_HEADER(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA}_METADATA(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT}_CONTENT(t){this._assume_text(t),this._fragments.push(t);const[e,s,_]=this._fragments;(0,a.assert)(null!=e&&null!=s&&null!=_),this._partial=i.Message.assemble(e,s,_),this._check_complete()}_BUFFER_HEADER(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD}_BUFFER_PAYLOAD(t){this._assume_binary(t),(0,a.assert)(null!=this._partial&&null!=this._buf_header),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()}_assume_text(t){if(!(0,h.isString)(t))throw new Error("Expected text fragment but received binary fragment")}_assume_binary(t){if(!(t 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}}s.Receiver=n,n.__name__="Receiver"},
function _(e,n,t,o,s){o();const c=e(5),_=e(52),i=e(62),r=e(19);class a{constructor(e,n){this._document_listener=e=>{this._document_changed(e)},this._connection=e,this.document=n,this.document.on_change(this._document_listener,!0)}get id(){return this._connection.id}handle(e){const n=e.msgtype();switch(n){case"PATCH-DOC":this._handle_patch(e);break;case"OK":this._handle_ok(e);break;case"ERROR":this._handle_error(e);break;default:r.logger.debug(`Doing nothing with message '${n}'`)}}notify_connection_lost(){this.document.event_manager.send_event(new _.ConnectionLost)}close(){this._connection.close()}_connection_closed(){this.document.remove_on_change(this._document_listener)}async request_server_info(){const e=i.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){const n=e instanceof c.DocumentEventBatch?e.events:[e],t=this.document.create_json_patch(n),o=i.Message.create("PATCH-DOC",{},t);this._connection.send(o)}_handle_patch(e){this.document.apply_json_patch(e.content,e.buffers)}_handle_ok(e){r.logger.trace(`Unhandled OK reply to ${e.reqid()}`)}_handle_error(e){r.logger.error(`Unhandled ERROR reply to ${e.reqid()}: ${e.content.text}`)}}t.ClientSession=a,a.__name__="ClientSession"},
function _(n,e,o,t,r){t();const i=n(56),l=n(8);function s(n){let e=(0,l.isString)(n)?document.getElementById(n):n;if(null==e)throw new Error(`Error rendering Bokeh model: could not find ${(0,l.isString)(n)?`#${n}`:n} HTML tag`);if(!(0,i.contains)(document.body,e))throw new Error(`Error rendering Bokeh model: element ${(0,l.isString)(n)?`#${n}`:n} must be under <body>`);if(e instanceof HTMLElement&&"SCRIPT"==e.tagName){const n=(0,i.div)();(0,i.replaceWith)(e,n),e=n}return e}o._resolve_element=function(n){const{elementid:e}=n;return null!=e?s(e):document.body},o._resolve_root_elements=function(n){const e=[];if(null!=n.root_ids&&null!=n.roots)for(const o of n.root_ids)e.push(s(n.roots[o]));return e}},
function _(e,o,t,n,r){n();const s=e(1),i=e(5),l=e(63),c=e(19),a=e(9),g=e(53),f=e(65);function u(e,o){o.buffers.length>0?e.consume(o.buffers[0].buffer):e.consume(o.content.data);const t=e.message;null!=t&&this.apply_json_patch(t.content,t.buffers)}function m(e,o){if("undefined"!=typeof Jupyter&&null!=Jupyter.notebook.kernel){c.logger.info(`Registering Jupyter comms for target ${e}`);const t=Jupyter.notebook.kernel.comm_manager;try{t.register_target(e,(t=>{c.logger.info(`Registering Jupyter comms for target ${e}`);const n=new l.Receiver;t.on_msg(u.bind(o,n))}))}catch(e){c.logger.warn(`Jupyter comms failed to register. push_notebook() will not function. (exception reported: ${e})`)}}else if(o.roots()[0].id in t.kernels){c.logger.info(`Registering JupyterLab comms for target ${e}`);const n=t.kernels[o.roots()[0].id];try{n.registerCommTarget(e,(t=>{c.logger.info(`Registering JupyterLab comms for target ${e}`);const n=new l.Receiver;t.onMsg=u.bind(o,n)}))}catch(e){c.logger.warn(`Jupyter comms failed to register. push_notebook() will not function. (exception reported: ${e})`)}}else if("undefined"!=typeof google&&null!=google.colab.kernel){c.logger.info(`Registering Google Colab comms for target ${e}`);const t=google.colab.kernel.comms;try{t.registerTarget(e,(async t=>{var n,r,i,a,g;c.logger.info(`Registering Google Colab comms for target ${e}`);const f=new l.Receiver;try{for(var m,b=!0,d=s.__asyncValues(t.messages);!(n=(m=await d.next()).done);b=!0){a=m.value,b=!1;const e=a,t={data:e.data},n=[];for(const o of null!==(g=e.buffers)&&void 0!==g?g:[])n.push(new DataView(o));const r={content:t,buffers:n};u.bind(o)(f,r)}}catch(e){r={error:e}}finally{try{b||n||!(i=d.return)||await i.call(d)}finally{if(r)throw r.error}}}))}catch(e){c.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.")}t.kernels={},t.embed_items_notebook=function(e,o){if(1!=(0,a.size)(e))throw new Error("embed_items_notebook expects exactly one document in docs_json");const t=i.Document.from_json((0,a.values)(e)[0]);for(const e of o){null!=e.notebook_comms_target&&m(e.notebook_comms_target,t);const o=(0,f._resolve_element)(e),n=(0,f._resolve_root_elements)(e);(0,g.add_document_standalone)(t,o,n);for(const e of n)e instanceof HTMLElement&&e.removeAttribute("id")}}},
function _(t,_,o,r,n){r();const a=t(1);a.__exportStar(t(62),o),a.__exportStar(t(63),o)},
function _(e,t,n,s,o){function l(){const e=document.getElementsByTagName("body")[0],t=document.getElementsByClassName("bokeh-test-div");1==t.length&&(e.removeChild(t[0]),delete t[0]);const n=document.createElement("div");n.classList.add("bokeh-test-div"),n.style.display="none",e.insertBefore(n,e.firstChild)}s(),n.results={},n.init=function(){l()},n.record0=function(e,t){n.results[e]=t},n.record=function(e,t){n.results[e]=t,l()},n.count=function(e){null==n.results[e]&&(n.results[e]=0),n.results[e]+=1,l()}},
function _(e,t,o,l,n){l(),o.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 o=document.createElement("span");o.style.backgroundColor="#a94442",o.style.borderRadius="0px 4px 0px 0px",o.style.color="white",o.style.cursor="pointer",o.style.cssFloat="right",o.style.fontSize="0.8em",o.style.margin="-6px -6px 0px 0px",o.style.padding="2px 5px 4px 5px",o.title="close",o.setAttribute("aria-label","close"),o.appendChild(document.createTextNode("x")),o.addEventListener("click",(()=>s.removeChild(t)));const l=document.createElement("h3");l.style.color="#a94442",l.style.margin="8px 0px 0px 0px",l.style.padding="0px",l.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(o),t.appendChild(l),t.appendChild(n);const s=document.getElementsByTagName("body")[0];s.insertBefore(t,s.firstChild)}(e instanceof Error&&null!=e.stack?e.stack:`${e}`),t)return;throw e}}},
function _(t,r,o,_,e){_();const s=t(1),i=t(7),m=s.__importStar(t(71));(0,i.register_models)(m);const n=s.__importStar(t(509));(0,i.register_models)(n)},
function _(t,_,r,o,a){o();const e=t(1);e.__exportStar(t(72),r),e.__exportStar(t(160),r),e.__exportStar(t(294),r),e.__exportStar(t(299),r),e.__exportStar(t(305),r),e.__exportStar(t(306),r),e.__exportStar(t(315),r),e.__exportStar(t(224),r),e.__exportStar(t(324),r),e.__exportStar(t(363),r),e.__exportStar(t(364),r),e.__exportStar(t(368),r),e.__exportStar(t(370),r),e.__exportStar(t(244),r),e.__exportStar(t(389),r),e.__exportStar(t(395),r),e.__exportStar(t(396),r),e.__exportStar(t(405),r),e.__exportStar(t(417),r),e.__exportStar(t(418),r),e.__exportStar(t(230),r),e.__exportStar(t(420),r),e.__exportStar(t(228),r),e.__exportStar(t(423),r),e.__exportStar(t(424),r),e.__exportStar(t(430),r),e.__exportStar(t(194),r),e.__exportStar(t(435),r),e.__exportStar(t(445),r),e.__exportStar(t(449),r),e.__exportStar(t(464),r)},
function _(e,o,a,n,r){n();const t=e(1);r("Annotation",e(73).Annotation),r("Arrow",e(99).Arrow),r("ArrowHead",e(141).ArrowHead),r("OpenHead",e(141).OpenHead),r("NormalHead",e(141).NormalHead),r("TeeHead",e(141).TeeHead),r("VeeHead",e(141).VeeHead),r("BaseColorBar",e(143).BaseColorBar),r("Band",e(235).Band),r("BoxAnnotation",e(237).BoxAnnotation),r("ColorBar",e(243).ColorBar),r("ContourColorBar",e(254).ContourColorBar),r("Label",e(255).Label),r("LabelSet",e(256).LabelSet),r("Legend",e(257).Legend),r("LegendItem",e(258).LegendItem),r("PolyAnnotation",e(259).PolyAnnotation),r("ScaleBar",e(260).ScaleBar),r("MetricLength",e(261).MetricLength),r("Slope",e(262).Slope),r("Span",e(263).Span),r("TextAnnotation",e(145).TextAnnotation),r("Title",e(144).Title),r("ToolbarPanel",e(264).ToolbarPanel),r("Whisker",e(288).Whisker),t.__exportStar(e(289),a)},
function _(t,e,i,n,s){var o;n();const l=t(74);class r extends l.RendererView{get_size(){if(this.displayed){const{width:t,height:e}=this._get_size();return{width:Math.round(t),height:Math.round(e)}}return{width:0,height:0}}_get_size(){throw new Error("not implemented")}connect_signals(){super.connect_signals();const t=this.model.properties;this.on_change(t.visible,(()=>{null!=this.layout&&(this.layout.visible=this.model.visible,this.plot_view.request_layout())}))}get needs_clip(){return null==this.layout}serializable_state(){var t,e,i;const n=super.serializable_state(),s=null!==(e=null===(t=this.bbox)||void 0===t?void 0:t.round())&&void 0!==e?e:null===(i=this.layout)||void 0===i?void 0:i.bbox;return null==s?n:Object.assign(Object.assign({},n),{bbox:s})}}i.AnnotationView=r,r.__name__="AnnotationView";class a extends l.Renderer{constructor(t){super(t)}}i.Annotation=a,o=a,a.__name__="Annotation",o.override({level:"annotation"})},
function _(e,t,r,n,i){var s,o;n();const a=e(1),l=e(54),_=a.__importStar(e(75)),c=e(20),u=e(8),h=e(50),d=e(12),p=e(84),g=e(57);class m extends h.Model{constructor(e){super(e)}}r.RendererGroup=m,s=m,m.__name__="RendererGroup",s.define((({Boolean:e})=>({visible:[e,!0]})));class f extends l.View{constructor(){super(...arguments),this._custom_coordinates=null}get coordinates(){const{_coordinates:e}=this;return null!=e?e:this._coordinates=this._initialize_coordinates()}set coordinates(e){this._custom_coordinates=e}initialize(){super.initialize(),this.visuals=new _.Visuals(this)}connect_signals(){super.connect_signals();const{group:e}=this.model;null!=e&&this.on_change(e.properties.visible,(()=>{this.model.visible=e.visible}));const{x_range_name:t,y_range_name:r}=this.model.properties;this.on_change([t,r],(()=>delete this._coordinates)),this.connect(this.plot_view.frame.change,(()=>delete this._coordinates))}_initialize_coordinates(){if(null!=this._custom_coordinates)return this._custom_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:r}=this.model,n=t.x_scales.get(e),i=t.y_scales.get(r);return(0,d.assert)(null!=n,`missing '${e}' range`),(0,d.assert)(null!=i,`missing '${r}' range`),new p.CoordinateTransform(n,i)}}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}get displayed(){return this.model.visible}render(){this.displayed&&this._render(),this._has_finished=!0}renderer_view(e){}update_geometry(){}compute_geometry(){}resolve_node(e){const t=(()=>{if(!(0,u.isString)(e.target)){if(e.target instanceof v){const t=this.plot_view.renderer_view(e.target);if(null!=t)return t}return null}switch(e.target){case"canvas":return this.plot_view.canvas;case"frame":return this.plot_view.frame;case"plot":return this.plot_view;case"parent":return this.parent}})();function r(t,r){const{offset:n}=e;return{x:t+n,y:r+n}}if(null==t)return r(NaN,NaN);if(!("bbox"in t&&t.bbox instanceof g.BBox))return r(NaN,NaN);const{bbox:n}=t;switch(e.symbol){case"top_left":return r(n.left,n.top);case"top_center":return r(n.hcenter,n.top);case"top_right":return r(n.right,n.top);case"center_left":return r(n.left,n.vcenter);case"center_center":case"center":return r(n.hcenter,n.vcenter);case"center_right":return r(n.right,n.vcenter);case"bottom_left":return r(n.left,n.bottom);case"bottom_center":return r(n.hcenter,n.bottom);case"bottom_right":return r(n.right,n.bottom);case"top":return r(NaN,n.top);case"left":return r(n.left,NaN);case"right":return r(n.right,NaN);case"bottom":return r(NaN,n.bottom);default:return r(NaN,NaN)}}}r.RendererView=f,f.__name__="RendererView";class v extends h.Model{constructor(e){super(e)}}r.Renderer=v,o=v,v.__name__="Renderer",o.define((({Boolean:e,String:t,Ref:r,Nullable:n})=>({group:[n(r(m)),null],level:[c.RenderLevel,"image"],visible:[e,!0],x_range_name:[t,"default"],y_range_name:[t,"default"],coordinates:[n(r(p.CoordinateMapping)),null],propagate_hover:[e,!1]})))},
function _(e,a,r,t,c){t();const n=e(1),l=e(76);c("Line",l.Line),c("LineScalar",l.LineScalar),c("LineVector",l.LineVector);const s=e(79);c("Fill",s.Fill),c("FillScalar",s.FillScalar),c("FillVector",s.FillVector);const i=e(80);c("Text",i.Text),c("TextScalar",i.TextScalar),c("TextVector",i.TextVector);const o=e(81);c("Hatch",o.Hatch),c("HatchScalar",o.HatchScalar),c("HatchVector",o.HatchVector);const u=e(83);c("Image",u.Image),c("ImageScalar",u.ImageScalar),c("ImageVector",u.ImageVector);const V=n.__importStar(e(78)),S=e(77);c("VisualProperties",S.VisualProperties),c("VisualUniforms",S.VisualUniforms);class m{*[Symbol.iterator](){yield*this._visuals}constructor(e){this._visuals=[];for(const[a,r]of e.model._mixins){const t=(()=>{switch(r){case V.Line:return new l.Line(e,a);case V.LineScalar:return new l.LineScalar(e,a);case V.LineVector:return new l.LineVector(e,a);case V.Fill:return new s.Fill(e,a);case V.FillScalar:return new s.FillScalar(e,a);case V.FillVector:return new s.FillVector(e,a);case V.Text:return new i.Text(e,a);case V.TextScalar:return new i.TextScalar(e,a);case V.TextVector:return new i.TextVector(e,a);case V.Hatch:return new o.Hatch(e,a);case V.HatchScalar:return new o.HatchScalar(e,a);case V.HatchVector:return new o.HatchVector(e,a);case V.Image:return new u.Image(e,a);case V.ImageScalar:return new u.ImageScalar(e,a);case V.ImageVector:return new u.ImageVector(e,a);default:throw new Error("unknown visual")}})();t instanceof S.VisualProperties&&t.update(),this._visuals.push(t),Object.defineProperty(this,a+t.type,{get:()=>t,configurable:!1,enumerable:!0})}}}r.Visuals=m,m.__name__="Visuals"},
function _(e,t,i,l,s){l();const a=e(1),n=e(77),h=a.__importStar(e(78)),o=e(22),_=e(8);function r(e){if((0,_.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(_.isInteger)}}i.resolve_line_dash=r;class u extends n.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,o.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.setLineDash(r(this.line_dash.get_value())),e.lineDashOffset=this.line_dash_offset.get_value()}}i.Line=u,u.__name__="Line";class c extends n.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,o.color2css)(t,i),e.lineWidth=this.line_width.value,e.lineJoin=this.line_join.value,e.lineCap=this.line_cap.value,e.setLineDash(r(this.line_dash.value)),e.lineDashOffset=this.line_dash_offset.value}}i.LineScalar=c,c.__name__="LineScalar";class d extends n.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}v_doit(e){return 0!=this.line_color.get(e)&&(0!=this.line_alpha.get(e)&&0!=this.line_width.get(e))}apply(e,t){const i=this.v_doit(t);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),l=this.line_alpha.get(t),s=this.line_width.get(t),a=this.line_join.get(t),n=this.line_cap.get(t),h=this.line_dash.get(t),_=this.line_dash_offset.get(t);e.strokeStyle=(0,o.color2css)(i,l),e.lineWidth=s,e.lineJoin=a,e.lineCap=n,e.setLineDash(r(h)),e.lineDashOffset=_}}i.LineVector=d,d.__name__="LineVector",u.prototype.type="line",u.prototype.attrs=Object.keys(h.Line),c.prototype.type="line",c.prototype.attrs=Object.keys(h.LineScalar),d.prototype.type="line",d.prototype.attrs=Object.keys(h.LineVector)},
function _(t,s,o,i,r){i();class e{*[Symbol.iterator](){yield*this._props}constructor(t,s=""){this.obj=t,this.prefix=s;const o=this;this._props=[];for(const i of this.attrs){const r=t.model.properties[s+i];r.change.connect((()=>this.update())),o[i]=r,this._props.push(r)}}update(){}}o.VisualProperties=e,e.__name__="VisualProperties";class p{*[Symbol.iterator](){for(const t of this.attrs)yield this.obj.model.properties[this.prefix+t]}constructor(t,s=""){this.obj=t,this.prefix=s;for(const o of this.attrs)Object.defineProperty(this,o,{get:()=>t[s+o]})}update(){}}o.VisualUniforms=p,p.__name__="VisualUniforms"},
function _(l,e,a,t,r){t();const c=l(1),o=c.__importStar(l(18)),n=l(20),_=c.__importStar(l(21)),i=l(9),h=l(8);a.Line={line_color:[_.Nullable(_.Color),"black"],line_alpha:[_.Alpha,1],line_width:[_.Number,1],line_join:[n.LineJoin,"bevel"],line_cap:[n.LineCap,"butt"],line_dash:[_.Or(n.LineDash,_.Array(_.Number)),[]],line_dash_offset:[_.Number,0]},a.Fill={fill_color:[_.Nullable(_.Color),"gray"],fill_alpha:[_.Alpha,1]},a.Image={global_alpha:[_.Alpha,1]},a.Hatch={hatch_color:[_.Nullable(_.Color),"black"],hatch_alpha:[_.Alpha,1],hatch_scale:[_.Number,12],hatch_pattern:[_.Nullable(_.Or(n.HatchPatternType,_.String)),null],hatch_weight:[_.Number,1],hatch_extra:[_.Dict(_.AnyRef()),{}]},a.Text={text_color:[_.Nullable(_.Color),"#444444"],text_outline_color:[_.Nullable(_.Color),null],text_alpha:[_.Alpha,1],text_font:[o.Font,"helvetica"],text_font_size:[_.FontSize,"16px"],text_font_style:[n.FontStyle,"normal"],text_align:[n.TextAlign,"left"],text_baseline:[n.TextBaseline,"bottom"],text_line_height:[_.Number,1.2]},a.LineScalar={line_color:[o.ColorScalar,"black"],line_alpha:[o.NumberScalar,1],line_width:[o.NumberScalar,1],line_join:[o.LineJoinScalar,"bevel"],line_cap:[o.LineCapScalar,"butt"],line_dash:[o.LineDashScalar,[]],line_dash_offset:[o.NumberScalar,0]},a.FillScalar={fill_color:[o.ColorScalar,"gray"],fill_alpha:[o.NumberScalar,1]},a.ImageScalar={global_alpha:[o.NumberScalar,1]},a.HatchScalar={hatch_color:[o.ColorScalar,"black"],hatch_alpha:[o.NumberScalar,1],hatch_scale:[o.NumberScalar,12],hatch_pattern:[o.NullStringScalar,null],hatch_weight:[o.NumberScalar,1],hatch_extra:[o.AnyScalar,{}]},a.TextScalar={text_color:[o.ColorScalar,"#444444"],text_outline_color:[o.ColorScalar,null],text_alpha:[o.NumberScalar,1],text_font:[o.FontScalar,"helvetica"],text_font_size:[o.FontSizeScalar,"16px"],text_font_style:[o.FontStyleScalar,"normal"],text_align:[o.TextAlignScalar,"left"],text_baseline:[o.TextBaselineScalar,"bottom"],text_line_height:[o.NumberScalar,1.2]},a.LineVector={line_color:[o.ColorSpec,"black"],line_alpha:[o.NumberSpec,1],line_width:[o.NumberSpec,1],line_join:[o.LineJoinSpec,"bevel"],line_cap:[o.LineCapSpec,"butt"],line_dash:[o.LineDashSpec,[]],line_dash_offset:[o.NumberSpec,0]},a.FillVector={fill_color:[o.ColorSpec,"gray"],fill_alpha:[o.NumberSpec,1]},a.ImageVector={global_alpha:[o.NumberSpec,1]},a.HatchVector={hatch_color:[o.ColorSpec,"black"],hatch_alpha:[o.NumberSpec,1],hatch_scale:[o.NumberSpec,12],hatch_pattern:[o.NullStringSpec,null],hatch_weight:[o.NumberSpec,1],hatch_extra:[o.AnyScalar,{}]},a.TextVector={text_color:[o.ColorSpec,"#444444"],text_outline_color:[o.ColorSpec,null],text_alpha:[o.NumberSpec,1],text_font:[o.FontSpec,"helvetica"],text_font_size:[o.FontSizeSpec,"16px"],text_font_style:[o.FontStyleSpec,"normal"],text_align:[o.TextAlignSpec,"left"],text_baseline:[o.TextBaselineSpec,"bottom"],text_line_height:[o.NumberSpec,1.2]},a.attrs_of=function(l,e,a,t=!1){const r={};for(const c of(0,i.keys)(a)){const a=`${e}${c}`,o=l[a];r[(0,h.isString)(t)?`${t}${c}`:t?a:c]=o}return r}},
function _(l,t,e,i,s){i();const a=l(1),o=l(77),r=a.__importStar(l(78)),_=l(22);class c extends o.VisualProperties{get doit(){const l=this.fill_color.get_value(),t=this.fill_alpha.get_value();return!(null==l||0==t)}apply(l,t){const{doit:e}=this;return e&&(this.set_value(l),l.fill(t)),e}values(){return{color:this.fill_color.get_value(),alpha:this.fill_alpha.get_value()}}set_value(l){const t=this.fill_color.get_value(),e=this.fill_alpha.get_value();l.fillStyle=(0,_.color2css)(t,e)}}e.Fill=c,c.__name__="Fill";class h extends o.VisualUniforms{get doit(){const l=this.fill_color.value,t=this.fill_alpha.value;return!(0==l||0==t)}apply(l,t){const{doit:e}=this;return e&&(this.set_value(l),l.fill(t)),e}values(){return{color:this.fill_color.value,alpha:this.fill_alpha.value}}set_value(l){const t=this.fill_color.value,e=this.fill_alpha.value;l.fillStyle=(0,_.color2css)(t,e)}}e.FillScalar=h,h.__name__="FillScalar";class u extends o.VisualUniforms{get doit(){const{fill_color:l}=this;if(l.is_Scalar()&&0==l.value)return!1;const{fill_alpha:t}=this;return!t.is_Scalar()||0!=t.value}v_doit(l){return 0!=this.fill_color.get(l)&&0!=this.fill_alpha.get(l)}apply(l,t,e){const i=this.v_doit(t);return i&&(this.set_vectorize(l,t),l.fill(e)),i}values(l){return{color:this.fill_color.get(l),alpha:this.fill_alpha.get(l)}}set_vectorize(l,t){const e=this.fill_color.get(t),i=this.fill_alpha.get(t);l.fillStyle=(0,_.color2css)(e,i)}}e.FillVector=u,u.__name__="FillVector",c.prototype.type="fill",c.prototype.attrs=Object.keys(r.Fill),h.prototype.type="fill",h.prototype.attrs=Object.keys(r.FillScalar),u.prototype.type="fill",u.prototype.attrs=Object.keys(r.FillVector)},
function _(t,e,l,s,o){s();const i=t(1),_=t(77),a=i.__importStar(t(78)),n=t(22),h=new Map;function r(t,e){const l=h.get(t);if(null==l){const l=new WeakSet([e]);h.set(t,l)}else{if(l.has(e))return;l.add(e)}const{fonts:s}=document;s.check(t)||s.load(t).then((()=>e.request_render()))}class u extends _.VisualProperties{get doit(){const t=this.text_color.get_value(),e=this.text_alpha.get_value();return!(null==t||0==e)}update(){if(!this.doit)return;r(this.font_value(),this.obj)}values(){return{color:this.text_color.get_value(),outline_color:this.text_outline_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(t){const e=this.text_color.get_value(),l=this.text_outline_color.get_value(),s=this.text_alpha.get_value();t.fillStyle=(0,n.color2css)(e,s),t.strokeStyle=(0,n.color2css)(l,s),t.font=this.font_value(),t.textAlign=this.text_align.get_value(),t.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()}`}}l.Text=u,u.__name__="Text";class x extends _.VisualUniforms{get doit(){const t=this.text_color.value,e=this.text_alpha.value;return!(0==t||0==e)}update(){if(!this.doit)return;r(this.font_value(),this.obj)}values(){return{color:this.text_color.value,outline_color:this.text_outline_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(t){const e=this.text_color.value,l=this.text_alpha.value,s=this.text_outline_color.value,o=this.font_value(),i=this.text_align.value,_=this.text_baseline.value;t.fillStyle=(0,n.color2css)(e,l),t.strokeStyle=(0,n.color2css)(s,l),t.font=o,t.textAlign=i,t.textBaseline=_}font_value(){return`${this.text_font_style.value} ${this.text_font_size.value} ${this.text_font.value}`}}l.TextScalar=x,x.__name__="TextScalar";class c extends _.VisualUniforms{_assert_font(t){r(this.font_value(t),this.obj)}values(t){return this._assert_font(t),{color:this.text_color.get(t),outline_color:this.text_outline_color.get(t),alpha:this.text_alpha.get(t),font:this.text_font.get(t),font_size:this.text_font_size.get(t),font_style:this.text_font_style.get(t),align:this.text_align.get(t),baseline:this.text_baseline.get(t),line_height:this.text_line_height.get(t)}}get doit(){const{text_color:t}=this;if(t.is_Scalar()&&0==t.value)return!1;const{text_alpha:e}=this;return!e.is_Scalar()||0!=e.value}v_doit(t){return 0!=this.text_color.get(t)&&0!=this.text_alpha.get(t)}apply(t,e){const l=this.v_doit(e);return l&&this.set_vectorize(t,e),l}set_vectorize(t,e){this._assert_font(e);const l=this.text_color.get(e),s=this.text_outline_color.get(e),o=this.text_alpha.get(e),i=this.font_value(e),_=this.text_align.get(e),a=this.text_baseline.get(e);t.fillStyle=(0,n.color2css)(l,o),t.strokeStyle=(0,n.color2css)(s,o),t.font=i,t.textAlign=_,t.textBaseline=a}font_value(t){return`${this.text_font_style.get(t)} ${this.text_font_size.get(t)} ${this.text_font.get(t)}`}}l.TextVector=c,c.__name__="TextVector",u.prototype.type="text",u.prototype.attrs=Object.keys(a.Text),x.prototype.type="text",x.prototype.attrs=Object.keys(a.TextScalar),c.prototype.type="text",c.prototype.attrs=Object.keys(a.TextVector)},
function _(t,e,a,r,i){r();const h=t(1),s=t(77),n=t(82),c=h.__importStar(t(18)),_=h.__importStar(t(78));class l extends s.VisualProperties{constructor(){super(...arguments),this._update_iteration=0}update(){if(this._update_iteration++,this._hatch_image=null,!this.doit)return;const t=this.hatch_color.get_value(),e=this.hatch_alpha.get_value(),a=this.hatch_scale.get_value(),r=this.hatch_pattern.get_value(),i=this.hatch_weight.get_value(),h=t=>{this._hatch_image=t},s=this.hatch_extra.get_value()[r];if(null!=s){const r=s.get_pattern(t,e,a,i);if(r instanceof Promise){const{_update_iteration:t}=this;r.then((e=>{this._update_iteration==t&&(h(e),this.obj.request_render())}))}else h(r)}else{const s=this.obj.canvas.create_layer(),c=(0,n.get_pattern)(s,r,t,e,a,i);h(c)}}get doit(){const t=this.hatch_color.get_value(),e=this.hatch_alpha.get_value(),a=this.hatch_pattern.get_value();return!(null==t||0==e||" "==a||"blank"==a||null==a)}apply(t,e){const{doit:a}=this;return a&&(this.set_value(t),t.layer.undo_transform((()=>t.fill(e)))),a}set_value(t){const e=this.pattern(t);t.fillStyle=null!=e?e:"transparent"}pattern(t){const e=this._hatch_image;return null==e?null:t.createPattern(e,this.repetition())}repetition(){const t=this.hatch_pattern.get_value(),e=this.hatch_extra.get_value()[t];if(null==e)return"repeat";switch(e.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}a.Hatch=l,l.__name__="Hatch";class o extends s.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const t=this.hatch_color.value,e=this.hatch_alpha.value,a=this.hatch_pattern.value;return!(0==t||0==e||" "==a||"blank"==a||null==a)}update(){this._update_iteration++;const t=this.hatch_color.length;if(this._hatch_image=new c.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const e=this.hatch_color.value,a=this.hatch_alpha.value,r=this.hatch_scale.value,i=this.hatch_pattern.value,h=this.hatch_weight.value,s=e=>{this._hatch_image=new c.UniformScalar(e,t)},_=this.hatch_extra.value[i];if(null!=_){const t=_.get_pattern(e,a,r,h);if(t instanceof Promise){const{_update_iteration:e}=this;t.then((t=>{this._update_iteration==e&&(s(t),this.obj.request_render())}))}else s(t)}else{const t=this.obj.canvas.create_layer(),c=(0,n.get_pattern)(t,i,e,a,r,h);s(c)}}get doit(){return this._static_doit}apply(t,e){const{doit:a}=this;return a&&(this.set_value(t),t.layer.undo_transform((()=>t.fill(e)))),a}set_value(t){var e;t.fillStyle=null!==(e=this.pattern(t))&&void 0!==e?e:"transparent"}pattern(t){const e=this._hatch_image.value;return null==e?null:t.createPattern(e,this.repetition())}repetition(){const t=this.hatch_pattern.value;if(null!=t){const e=this.hatch_extra.value[t];if(null!=e)switch(e.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}return"repeat"}}a.HatchScalar=o,o.__name__="HatchScalar";class u extends s.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const{hatch_color:t}=this;if(t.is_Scalar()&&0==t.value)return!1;const{hatch_alpha:e}=this;if(e.is_Scalar()&&0==e.value)return!1;const{hatch_pattern:a}=this;if(a.is_Scalar()){const t=a.value;if(" "==t||"blank"==t||null==t)return!1}return!0}update(){this._update_iteration++;const t=this.hatch_color.length;if(this._hatch_image=new c.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const e=(t,e,a,r,i,h)=>{const s=this.hatch_extra.value[t];if(null!=s){const t=s.get_pattern(e,a,r,i);if(t instanceof Promise){const{_update_iteration:e}=this;t.then((t=>{this._update_iteration==e&&(h(t),this.obj.request_render())}))}else h(t)}else{const s=this.obj.canvas.create_layer(),c=(0,n.get_pattern)(s,t,e,a,r,i);h(c)}};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 a=this.hatch_color.value,r=this.hatch_alpha.value,i=this.hatch_scale.value;e(this.hatch_pattern.value,a,r,i,this.hatch_weight.value,(e=>{this._hatch_image=new c.UniformScalar(e,t)}))}else{const a=new Array(t);a.fill(null),this._hatch_image=new c.UniformVector(a);for(let r=0;r<t;r++){const t=this.hatch_color.get(r),i=this.hatch_alpha.get(r),h=this.hatch_scale.get(r);e(this.hatch_pattern.get(r),t,i,h,this.hatch_weight.get(r),(t=>{a[r]=t}))}}}get doit(){return this._static_doit}v_doit(t){if(!this.doit)return!1;if(0==this.hatch_color.get(t))return!1;if(0==this.hatch_alpha.get(t))return!1;const e=this.hatch_pattern.get(t);return" "!=e&&"blank"!=e&&null!=e}apply(t,e,a){const r=this.v_doit(e);return r&&(this.set_vectorize(t,e),t.layer.undo_transform((()=>t.fill(a)))),r}set_vectorize(t,e){var a;t.fillStyle=null!==(a=this.pattern(t,e))&&void 0!==a?a:"transparent"}pattern(t,e){const a=this._hatch_image.get(e);return null==a?null:t.createPattern(a,this.repetition(e))}repetition(t){const e=this.hatch_pattern.get(t);if(null!=e){const t=this.hatch_extra.value[e];if(null!=t)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"}}return"repeat"}}a.HatchVector=u,u.__name__="HatchVector",l.prototype.type="hatch",l.prototype.attrs=Object.keys(_.Hatch),o.prototype.type="hatch",o.prototype.attrs=Object.keys(_.HatchScalar),u.prototype.type="hatch",u.prototype.attrs=Object.keys(_.HatchVector)},
function _(e,o,a,r,s){r();const i=e(19),n=e(22);function l(e,o,a){e.moveTo(0,a+.5),e.lineTo(o,a+.5),e.stroke()}function t(e,o,a){e.moveTo(a+.5,0),e.lineTo(a+.5,o),e.stroke()}function c(e,o){e.moveTo(0,o),e.lineTo(o,0),e.stroke(),e.moveTo(0,0),e.lineTo(o,o),e.stroke()}a.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"},a.get_pattern=function(e,o,r,s,k,_){return e.resize(k,k),e.prepare(),function(e,o,r,s,k,_){var T;const h=k,v=h/2,d=v/2,b=(0,n.color2css)(r,s);switch(e.strokeStyle=b,e.fillStyle=b,e.lineCap="square",e.lineWidth=_,null!==(T=a.hatch_aliases[o])&&void 0!==T?T:o){case"blank":break;case"dot":e.arc(v,v,v/2,0,2*Math.PI,!0),e.fill();break;case"ring":e.arc(v,v,v/2,0,2*Math.PI,!0),e.stroke();break;case"horizontal_line":l(e,h,v);break;case"vertical_line":t(e,h,v);break;case"cross":l(e,h,v),t(e,h,v);break;case"horizontal_dash":l(e,v,v);break;case"vertical_dash":t(e,v,v);break;case"spiral":{const o=h/30;e.moveTo(v,v);for(let a=0;a<360;a++){const r=.1*a,s=v+o*r*Math.cos(r),i=v+o*r*Math.sin(r);e.lineTo(s,i)}e.stroke();break}case"right_diagonal_line":e.moveTo(.5-d,h),e.lineTo(d+.5,0),e.stroke(),e.moveTo(d+.5,h),e.lineTo(3*d+.5,0),e.stroke(),e.moveTo(3*d+.5,h),e.lineTo(5*d+.5,0),e.stroke();break;case"left_diagonal_line":e.moveTo(d+.5,h),e.lineTo(.5-d,0),e.stroke(),e.moveTo(3*d+.5,h),e.lineTo(d+.5,0),e.stroke(),e.moveTo(5*d+.5,h),e.lineTo(3*d+.5,0),e.stroke();break;case"diagonal_cross":c(e,h);break;case"right_diagonal_dash":e.moveTo(d+.5,3*d+.5),e.lineTo(3*d+.5,d+.5),e.stroke();break;case"left_diagonal_dash":e.moveTo(d+.5,d+.5),e.lineTo(3*d+.5,3*d+.5),e.stroke();break;case"horizontal_wave":e.moveTo(0,d),e.lineTo(v,3*d),e.lineTo(h,d),e.stroke();break;case"vertical_wave":e.moveTo(d,0),e.lineTo(3*d,v),e.lineTo(d,h),e.stroke();break;case"criss_cross":c(e,h),l(e,h,v),t(e,h,v);break;default:i.logger.warn(`unknown hatch pattern: ${o}`)}}(e.ctx,o,r,s,k,_),e.canvas}},
function _(a,t,e,l,s){l();const o=a(1),r=a(77),p=o.__importStar(a(78));class _ extends r.VisualProperties{get doit(){return!(0==this.global_alpha.get_value())}apply(a){const{doit:t}=this;return t&&this.set_value(a),t}values(){return{global_alpha:this.global_alpha.get_value()}}set_value(a){const t=this.global_alpha.get_value();a.globalAlpha=t}}e.Image=_,_.__name__="Image";class i extends r.VisualUniforms{get doit(){return!(0==this.global_alpha.value)}apply(a){const{doit:t}=this;return t&&this.set_value(a),t}values(){return{global_alpha:this.global_alpha.value}}set_value(a){const t=this.global_alpha.value;a.globalAlpha=t}}e.ImageScalar=i,i.__name__="ImageScalar";class g extends r.VisualUniforms{get doit(){const{global_alpha:a}=this;return!a.is_Scalar()||0!=a.value}v_doit(a){return 0!=this.global_alpha.get(a)}apply(a,t){const e=this.v_doit(t);return e&&this.set_vectorize(a,t),e}values(a){return{alpha:this.global_alpha.get(a)}}set_vectorize(a,t){const e=this.global_alpha.get(t);a.globalAlpha=e}}e.ImageVector=g,g.__name__="ImageVector",_.prototype.type="image",_.prototype.attrs=Object.keys(p.Image),i.prototype.type="image",i.prototype.attrs=Object.keys(p.ImageScalar),g.prototype.type="image",g.prototype.attrs=Object.keys(p.ImageVector)},
function _(e,a,s,t,r){var c;t();const n=e(50),_=e(85),o=e(90),i=e(92),g=e(93),l=e(94),u=e(87),h=e(95),y=e(98);class x{constructor(e,a){this.x_scale=e,this.y_scale=a,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,a){return[this.x_scale.v_compute(e),this.y_scale.v_compute(a)]}map_from_screen(e,a){return[this.x_scale.v_invert(e),this.y_scale.v_invert(a)]}}s.CoordinateTransform=x,x.__name__="CoordinateTransform";class p extends n.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,a,s){if(e instanceof y.FactorRange!=a instanceof g.CategoricalScale)throw new Error(`Range ${e.type} is incompatible is Scale ${a.type}`);a instanceof i.LogScale&&e instanceof h.DataRange1d&&(e.scale_hint="log");const t=a.clone();return t.setv({source_range:e,target_range:s}),t}get_transform(e){const{x_source:a,x_scale:s,x_target:t}=this,r=this._get_scale(a,s,t),{y_source:c,y_scale:n,y_target:_}=this,o=this._get_scale(c,n,_),i=new l.CompositeScale({source_scale:r,source_range:r.source_range,target_scale:e.x_scale,target_range:e.x_target}),g=new l.CompositeScale({source_scale:o,source_range:o.source_range,target_scale:e.y_scale,target_range:e.y_target});return new x(i,g)}}s.CoordinateMapping=p,c=p,p.__name__="CoordinateMapping",c.define((({Ref:e})=>({x_source:[e(u.Range),()=>new h.DataRange1d],y_source:[e(u.Range),()=>new h.DataRange1d],x_scale:[e(_.Scale),()=>new o.LinearScale],y_scale:[e(_.Scale),()=>new o.LinearScale],x_target:[e(u.Range)],y_target:[e(u.Range)]})))},
function _(e,t,r,n,s){var _;n();const a=e(86),c=e(87),o=e(88),i=e(24);class u extends a.Transform{constructor(e){super(e)}compute(e){return this.s_compute(e)}v_compute(e){const t=new i.ScreenArray(e.length),{s_compute:r}=this;for(let n=0;n<e.length;n++)t[n]=r(e[n]);return t}invert(e){return this.s_invert(e)}v_invert(e){const t=new Float64Array(e.length),{s_invert:r}=this;for(let n=0;n<e.length;n++)t[n]=r(e[n]);return t}r_compute(e,t){const{s_compute:r}=this;return this.target_range.is_reversed?[r(t),r(e)]:[r(e),r(t)]}r_invert(e,t){const{s_invert:r}=this;return this.target_range.is_reversed?[r(t),r(e)]:[r(e),r(t)]}}r.Scale=u,_=u,u.__name__="Scale",_.internal((({Ref:e})=>({source_range:[e(c.Range)],target_range:[e(o.Range1d)]})))},
function _(n,s,o,r,c){r();const e=n(50);class t extends e.Model{constructor(n){super(n)}}o.Transform=t,t.__name__="Transform"},
function _(e,t,n,l,u){var s;l();const i=e(50),a=e(21),r=(0,a.Nullable)((0,a.Or)((0,a.Tuple)((0,a.Nullable)(a.Number),(0,a.Nullable)(a.Number)),a.Auto));class d extends i.Model{constructor(e){super(e),this.have_updated_interactively=!1,this.plots=new Set}get computed_bounds(){return this._computed_bounds}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)}}n.Range=d,s=d,d.__name__="Range",s.define((({Number:e,Nullable:t})=>({bounds:[r,null,{on_update(e,t){const[n,l]="auto"==e||null==e?[null,null]:e;t._computed_bounds=[null!=n?n:-1/0,null!=l?l:1/0]}}],min_interval:[t(e),null],max_interval:[t(e),null]})))},
function _(t,e,s,n,r){var a;n();const i=t(89);class _ extends i.NumericalRange{constructor(t){super(t)}_set_auto_bounds(){if("auto"==this.bounds){const t=Math.min(this._reset_start,this._reset_end),e=Math.max(this._reset_start,this._reset_end);this._computed_bounds=[t,e]}}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:t,_reset_end:e}=this;this.start!=t||this.end!=e?this.setv({start:t,end:e}):this.change.emit()}map(t){return new a({start:t(this.start),end:t(this.end)})}widen(t){let{start:e,end:s}=this;return this.is_reversed?(e+=t,s-=t):(e-=t,s+=t),new a({start:e,end:s})}}s.Range1d=_,a=_,_.__name__="Range1d",a.define((({Number:t,Nullable:e})=>({reset_start:[e(t),null,{on_update(t,e){e._reset_start=null!=t?t:e.start}}],reset_end:[e(t),null,{on_update(t,e){e._reset_end=null!=t?t:e.end}}]}))),a.override({start:0,end:1})},
function _(e,n,t,r,c){var u;r();const o=e(1),s=e(87),a=o.__importStar(e(18)),m=e(11);class _ extends s.Range{constructor(e){super(e)}}t.NumericalRange=_,u=_,_.__name__="NumericalRange",u.define((({Number:e})=>({start:[e,a.unset,{convert(e,n){const[t,r]=n.computed_bounds;return(0,m.clamp)(e,t,r)}}],end:[e,a.unset,{convert(e,n){const[t,r]=n.computed_bounds;return(0,m.clamp)(e,t,r)}}]})))},
function _(t,e,n,r,s){r();const a=t(91);class _ extends a.ContinuousScale{constructor(t){super(t)}get s_compute(){const[t,e]=this._linear_compute_state();return n=>t*n+e}get s_invert(){const[t,e]=this._linear_compute_state();return n=>(n-e)/t}_linear_compute_state(){const t=this.source_range.start,e=this.source_range.end,n=this.target_range.start,r=(this.target_range.end-n)/(e-t);return[r,-r*t+n]}}n.LinearScale=_,_.__name__="LinearScale"},
function _(n,c,o,s,e){s();const t=n(85);class u extends t.Scale{constructor(n){super(n)}}o.ContinuousScale=u,u.__name__="ContinuousScale"},
function _(t,e,s,a,r){a();const o=t(91);class n extends o.ContinuousScale{constructor(t){super(t)}get s_compute(){const[t,e,s,a]=this._compute_state();return r=>{if(0==s)return 0;{const o=(Math.log(r)-a)/s;return isFinite(o)?o*t+e:NaN}}}get s_invert(){const[t,e,s,a]=this._compute_state();return r=>{const o=(r-e)/t;return Math.exp(s*o+a)}}_get_safe_factor(t,e){let s=t<0?0:t,a=e<0?0:e;if(s==a)if(0==s)[s,a]=[1,10];else{const t=Math.log10(s);s=10**Math.floor(t),a=Math.ceil(t)!=Math.floor(t)?10**Math.ceil(t):10**(Math.ceil(t)+1)}return[s,a]}_compute_state(){const t=this.source_range.start,e=this.source_range.end,s=this.target_range.start,a=this.target_range.end-s,[r,o]=this._get_safe_factor(t,e);let n,c;0==r?(n=Math.log(o),c=0):(n=Math.log(o/r),c=Math.log(r));return[a,s,n,c]}}s.LogScale=n,n.__name__="LogScale"},
function _(t,e,c,a,s){a();const n=t(85),r=t(90),{_linear_compute_state:o}=r.LinearScale.prototype;class l extends n.Scale{constructor(t){super(t)}get s_compute(){const[t,e]=o.call(this),c=this.source_range;return a=>t*c.synthetic(a)+e}get s_invert(){const[t,e]=o.call(this);return c=>(c-e)/t}}c.CategoricalScale=l,l.__name__="CategoricalScale"},
function _(e,t,s,c,r){var n;c();const _=e(85),o=e(13);class a extends _.Scale{constructor(e){super(e)}get s_compute(){const e=this.source_scale.s_compute,t=this.target_scale.s_compute;return s=>t(e(s))}get s_invert(){const e=this.source_scale.s_invert,t=this.target_scale.s_invert;return s=>e(t(s))}compute(e){return this.s_compute(e)}v_compute(e){const{s_compute:t}=this;return(0,o.map)(e,t)}invert(e){return this.s_invert(e)}v_invert(e){const{s_invert:t}=this;return(0,o.map)(e,t)}}s.CompositeScale=a,n=a,a.__name__="CompositeScale",n.define((({Ref:e})=>({source_scale:[e(_.Scale)],target_scale:[e(_.Scale)]})))},
function _(t,i,n,e,a){var s;e();const l=t(1),_=t(96),o=t(20),r=t(34),d=t(19),h=l.__importStar(t(57)),u=t(97);n.auto_ranged=Symbol("auto_ranged"),n.is_auto_ranged=function(t){return n.auto_ranged in t};class g extends _.DataRange{constructor(t){super(t),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=isNaN(this.start)?null:this.start,this._initial_end=isNaN(this.end)?null: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:t}=this,i=(0,r.flat_map)(this.plots,(t=>t.auto_ranged_renderers.map((t=>t.model))));return(0,u.compute_renderers)(0==t.length?"auto":t,[...i])}_compute_plot_bounds(t,i){let n=h.empty();for(const e of t){const t=i.get(e);null==t||!e.visible&&this.only_visible||(n=h.union(n,t))}return n}adjust_bounds_for_aspect(t,i){const n=h.empty();let e=t.x1-t.x0;e<=0&&(e=1);let a=t.y1-t.y0;a<=0&&(a=1);const s=.5*(t.x1+t.x0),l=.5*(t.y1+t.y0);return e<i*a?e=i*a:a=e/i,n.x1=s+.5*e,n.x0=s-.5*e,n.y1=l+.5*a,n.y0=l-.5*a,n}_compute_min_max(t,i){let n,e,a=h.empty();for(const[i,n]of t)i.model.visible&&(a=h.union(a,n));return[n,e]=0==i?[a.x0,a.x1]:[a.y0,a.y1],[n,e]}_compute_range(t,i){const n=this.range_padding;let e,a;if(null!=this._initial_start&&(t=this._initial_start),null!=this._initial_end&&(i=this._initial_end),"log"==this.scale_hint){let s,l;if((isNaN(t)||!isFinite(t)||t<=0)&&(t=isNaN(i)||!isFinite(i)||i<=0?.1:i/100,d.logger.warn(`could not determine minimum data value for log axis, DataRange1d using value ${t}`)),(isNaN(i)||!isFinite(i)||i<=0)&&(i=isNaN(t)||!isFinite(t)||t<=0?10:100*t,d.logger.warn(`could not determine maximum data value for log axis, DataRange1d using value ${i}`)),i==t)l=this.default_span+.001,s=Math.log10(t);else{let e,a;"percent"==this.range_padding_units?(e=Math.log10(t),a=Math.log10(i),l=(a-e)*(1+n)):(e=Math.log10(t-n),a=Math.log10(i+n),l=a-e),s=(e+a)/2}e=10**(s-l/2),a=10**(s+l/2)}else{let s;s=i==t?this.default_span:"percent"==this.range_padding_units?(i-t)*(1+n):i-t+2*n;const l=(i+t)/2;e=l-s/2,a=l+s/2}let s=1;this.flipped&&([e,a]=[a,e],s=-1);const l=this.follow_interval;return null!=l&&Math.abs(e-a)>l&&("start"==this.follow?a=e+s*l:"end"==this.follow&&(e=a-s*l)),[e,a]}update(t,i,n,e){if(this.have_updated_interactively)return;const a=this.computed_renderers();let s=this._compute_plot_bounds(a,t);null!=e&&(s=this.adjust_bounds_for_aspect(s,e)),this._plot_bounds.set(n,s);const[l,_]=this._compute_min_max(this._plot_bounds.entries(),i);let[o,r]=this._compute_range(l,_);null!=this._initial_start&&("log"==this.scale_hint?this._initial_start>0&&(o=this._initial_start):o=this._initial_start),null!=this._initial_end&&("log"==this.scale_hint?this._initial_end>0&&(r=this._initial_end):r=this._initial_end);let d=!1;"auto"==this.bounds&&(this._computed_bounds=[o,r],d=!0);const[h,u]=[this.start,this.end];if(o!=h||r!=u){const t={};o!=h&&(t.start=o),r!=u&&(t.end=r),this.setv(t),d=!1}d&&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()}}n.DataRange1d=g,s=g,g.__name__="DataRange1d",s.define((({Boolean:t,Number:i,Nullable:n})=>({range_padding:[i,.1],range_padding_units:[o.PaddingUnits,"percent"],flipped:[t,!1],follow:[n(o.StartEnd),null],follow_interval:[n(i),null],default_span:[i,2],only_visible:[t,!1]}))),s.internal((({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]})))},
function _(e,a,r,n,t){var s;n();const c=e(89);class o extends c.NumericalRange{constructor(e){super(e)}}r.DataRange=o,s=o,o.__name__="DataRange",s.define((({Array:e,AnyRef:a,Or:r,Auto:n})=>({renderers:[r(e(a()),n),[]]}))),s.override({start:NaN,end:NaN})},
function _(n,u,e,r,t){r(),e.compute_renderers=function(n,u){return"auto"==n?u:null!=n?n:[]}},
function _(t,n,e,i,s){var r;i();const a=t(1),o=t(87),g=t(20),p=a.__importStar(t(18)),c=t(21),l=t(24),u=t(15),h=t(10),d=t(8),_=t(12);function f(t,n,e=0){const i=new Map;for(let s=0;s<t.length;s++){const r=t[s];if(i.has(r))throw new Error(`duplicate factor or subfactor: ${r}`);i.set(r,{value:.5+s*(1+n)+e})}return[i,(t.length-1)*n]}function m(t,n,e,i=0){var s;const r=new Map,a=new Map;for(const[n,e]of t){const t=null!==(s=a.get(n))&&void 0!==s?s:[];a.set(n,[...t,e])}let o=i,g=0;for(const[t,i]of a){const s=i.length,[a,p]=f(i,e,o);g+=p;const c=(0,h.sum)(i.map((t=>a.get(t).value)));r.set(t,{value:c/s,mapping:a}),o+=s+n+p}return[r,(a.size-1)*n+g]}function v(t,n,e,i,s=0){var r;const a=new Map,o=new Map;for(const[n,e,i]of t){const t=null!==(r=o.get(n))&&void 0!==r?r:[];o.set(n,[...t,[e,i]])}let g=s,p=0;for(const[t,s]of o){const r=s.length,[o,c]=m(s,e,i,g);p+=c;const l=(0,h.sum)(s.map((([t])=>o.get(t).value)));a.set(t,{value:l/r,mapping:o}),g+=r+n+c}return[a,(o.size-1)*n+p]}e.Factor=(0,c.Or)(c.String,(0,c.Tuple)(c.String,c.String),(0,c.Tuple)(c.String,c.String,c.String)),e.FactorSeq=(0,c.Or)((0,c.Array)(c.String),(0,c.Array)((0,c.Tuple)(c.String,c.String)),(0,c.Array)((0,c.Tuple)(c.String,c.String,c.String))),e.map_one_level=f,e.map_two_levels=m,e.map_three_levels=v;class S extends o.Range{constructor(t){super(t),this.invalidate_synthetic=new u.Signal0(this,"invalidate_synthetic")}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init()}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(),this.invalidate_synthetic.emit()}_lookup(t){switch(t.length){case 1:{const[n]=t,e=this._mapping.get(n);return null!=e?e.value:NaN}case 2:{const[n,e]=t,i=this._mapping.get(n);if(null!=i){const t=i.mapping.get(e);if(null!=t)return t.value}return NaN}case 3:{const[n,e,i]=t,s=this._mapping.get(n);if(null!=s){const t=s.mapping.get(e);if(null!=t){const n=t.mapping.get(i);if(null!=n)return n.value}}return NaN}}}synthetic(t){if((0,d.isNumber)(t))return t;if((0,d.isString)(t))return this._lookup([t]);let n=0;const e=t[t.length-1];return(0,d.isNumber)(e)&&(n=e,t=t.slice(0,-1)),this._lookup(t)+n}v_synthetic(t){const n=t.length,e=new l.ScreenArray(n);for(let i=0;i<n;i++)e[i]=this.synthetic(t[i]);return e}_init(){const{levels:t,mapping:n,tops:e,mids:i,inside_padding:s}=(()=>{if((0,h.every)(this.factors,d.isString)){const t=this.factors,[n,e]=f(t,this.factor_padding);return{levels:1,mapping:n,tops:null,mids:null,inside_padding:e}}if((0,h.every)(this.factors,(t=>(0,d.isArray)(t)&&2==t.length&&(0,d.isString)(t[0])&&(0,d.isString)(t[1])))){const t=this.factors,[n,e]=m(t,this.group_padding,this.factor_padding),i=[...n.keys()];return{levels:2,mapping:n,tops:i,mids:null,inside_padding:e}}if((0,h.every)(this.factors,(t=>(0,d.isArray)(t)&&3==t.length&&(0,d.isString)(t[0])&&(0,d.isString)(t[1])&&(0,d.isString)(t[2])))){const t=this.factors,[n,e]=v(t,this.group_padding,this.subgroup_padding,this.factor_padding),i=[...n.keys()],s=[];for(const[t,e]of n)for(const n of e.mapping.keys())s.push([t,n]);return{levels:3,mapping:n,tops:i,mids:s,inside_padding:e}}(0,_.unreachable)()})();this._mapping=n,this.tops=e,this.mids=i;let r=0,a=this.factors.length+s;if("percent"==this.range_padding_units){const t=(a-r)*this.range_padding/2;r-=t,a+=t}else r-=this.range_padding,a+=this.range_padding;this.setv({start:r,end:a,levels:t},{silent:!0}),"auto"==this.bounds&&(this._computed_bounds=[r,a])}}e.FactorRange=S,r=S,S.__name__="FactorRange",r.define((({Number:t})=>({factors:[e.FactorSeq,[]],factor_padding:[t,0],subgroup_padding:[t,.8],group_padding:[t,1.4],range_padding:[t,0],range_padding_units:[g.PaddingUnits,"percent"],start:[t,p.unset,{readonly:!0}],end:[t,p.unset,{readonly:!0}]}))),r.internal((({Number:t,String:n,Array:e,Tuple:i,Nullable:s})=>({levels:[t],mids:[s(e(i(n,n))),null],tops:[s(e(n)),null]})))},
function _(t,e,s,a,n){var r;a();const i=t(1),_=t(100),o=t(141),l=t(78),d=t(20),c=t(24),h=t(59),u=t(24),v=i.__importStar(t(18)),p=t(11);class y extends _.DataAnnotationView{*children(){yield*super.children();const{start:t,end:e}=this;null!=t&&(yield t),null!=e&&(yield e)}async lazy_initialize(){await super.lazy_initialize();const{start:t,end:e}=this.model;null!=t&&(this.start=await(0,h.build_view)(t,{parent:this})),null!=e&&(this.end=await(0,h.build_view)(e,{parent:this}))}set_data(t){var e,s;super.set_data(t);const a=u.Indices.all_set(this._x_start.length);null===(e=this.start)||void 0===e||e.set_data(t,a),null===(s=this.end)||void 0===s||s.set_data(t,a)}remove(){var t,e;null===(t=this.start)||void 0===t||t.remove(),null===(e=this.end)||void 0===e||e.remove(),super.remove()}map_data(){const{frame:t}=this.plot_view,[e,s]=(()=>{switch(this.model.start_units){case"canvas":return[new c.ScreenArray(this._x_start),new c.ScreenArray(this._y_start)];case"screen":return[t.bbox.xview.v_compute(this._x_start),t.bbox.yview.v_compute(this._y_start)];case"data":return[this.coordinates.x_scale.v_compute(this._x_start),this.coordinates.y_scale.v_compute(this._y_start)]}})(),[a,n]=(()=>{switch(this.model.end_units){case"canvas":return[new c.ScreenArray(this._x_end),new c.ScreenArray(this._y_end)];case"screen":return[t.bbox.xview.v_compute(this._x_end),t.bbox.yview.v_compute(this._y_end)];case"data":return[this.coordinates.x_scale.v_compute(this._x_end),this.coordinates.y_scale.v_compute(this._y_end)]}})();this._sx_start=e,this._sy_start=s,this._sx_end=a,this._sy_end=n;const r=e.length,i=this._angles=new c.ScreenArray(r);for(let t=0;t<r;t++)i[t]=Math.PI/2+(0,p.atan2)([e[t],s[t]],[a[t],n[t]])}paint(t){const{start:e,end:s}=this,{_sx_start:a,_sy_start:n,_sx_end:r,_sy_end:i,_angles:_}=this,{x:o,y:l,width:d,height:c}=this.plot_view.frame.bbox;for(let h=0,u=a.length;h<u;h++)null!=s&&(t.save(),t.translate(r[h],i[h]),t.rotate(_[h]),s.render(t,h),t.restore()),null!=e&&(t.save(),t.translate(a[h],n[h]),t.rotate(_[h]+Math.PI),e.render(t,h),t.restore()),this.visuals.line.doit&&(t.save(),null==e&&null==s||(t.beginPath(),t.rect(o,l,d,c),null!=s&&(t.save(),t.translate(r[h],i[h]),t.rotate(_[h]),s.clip(t,h),t.restore()),null!=e&&(t.save(),t.translate(a[h],n[h]),t.rotate(_[h]+Math.PI),e.clip(t,h),t.restore()),t.closePath(),t.clip()),t.beginPath(),t.moveTo(a[h],n[h]),t.lineTo(r[h],i[h]),this.visuals.line.apply(t,h),t.restore())}}s.ArrowView=y,y.__name__="ArrowView";class w extends _.DataAnnotation{constructor(t){super(t)}}s.Arrow=w,r=w,w.__name__="Arrow",r.prototype.default_view=y,r.mixins(l.LineVector),r.define((({Ref:t,Nullable:e})=>({x_start:[v.XCoordinateSpec,{field:"x_start"}],y_start:[v.YCoordinateSpec,{field:"y_start"}],start_units:[d.CoordinateUnits,"data"],start:[e(t(o.ArrowHead)),null],x_end:[v.XCoordinateSpec,{field:"x_end"}],y_end:[v.YCoordinateSpec,{field:"y_end"}],end_units:[d.CoordinateUnits,"data"],end:[e(t(o.ArrowHead)),()=>new o.OpenHead]})))},
function _(t,e,n,s,a){var o;s();const i=t(1),c=t(73),r=t(101),_=t(106),l=t(107),h=i.__importStar(t(18));class d extends c.AnnotationView{constructor(){super(...arguments),this._initial_set_data=!1}connect_signals(){super.connect_signals();const t=()=>{this.set_data(this.model.source),this._rerender()};this.connect(this.model.change,t),this.connect(this.model.source.streaming,t),this.connect(this.model.source.patching,t),this.connect(this.model.source.change,t)}_rerender(){this.request_render()}set_data(t){const e=this;for(const n of this.model)if(n instanceof h.VectorSpec||n instanceof h.ScalarSpec)if(n instanceof h.BaseCoordinateSpec){const s=n.array(t);e[`_${n.attr}`]=s}else{const s=n.uniform(t);e[`${n.attr}`]=s}this.plot_model.use_map&&(null!=e._x&&l.inplace.project_xy(e._x,e._y),null!=e._xs&&l.inplace.project_xsys(e._xs,e._ys));for(const t of this.visuals)t.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)}}n.DataAnnotationView=d,d.__name__="DataAnnotationView";class u extends c.Annotation{constructor(t){super(t)}}n.DataAnnotation=u,o=u,u.__name__="DataAnnotation",o.define((({Ref:t})=>({source:[t(r.ColumnarDataSource),()=>new _.ColumnDataSource]})))},
function _(t,e,n,a,s){var r;a();const i=t(19),l=t(102),o=t(15),c=t(10),u=t(30),h=t(9),g=t(8),d=t(104),_=t(103),f=t(105);class m extends f.DataSource{get_array(t){let e=this.data[t];return null==e?this.data[t]=e=[]:(0,g.isArray)(e)||(this.data[t]=e=Array.from(e)),e}constructor(t){super(t),this.selection_manager=new l.SelectionManager(this)}initialize(){super.initialize(),this._select=new o.Signal0(this,"select"),this.inspect=new o.Signal(this,"inspect")}get_column(t){return t in this.data?this.data[t]:null}columns(){return(0,h.keys)(this.data)}get_length(t=!0){const e=(0,c.uniq)((0,h.values)(this.data).map((t=>(0,u.is_NDArray)(t)?t.shape[0]:t.length)));switch(e.length){case 0:return null;case 1:return e[0];default:{const n="data source has columns of inconsistent lengths";if(t)return i.logger.warn(n),e.sort()[0];throw new Error(n)}}}get length(){var t;return null!==(t=this.get_length())&&void 0!==t?t:0}clear(){const t={};for(const e of this.columns())t[e]=new this.data[e].constructor(0);this.data=t}}n.ColumnarDataSource=m,r=m,m.__name__="ColumnarDataSource",r.define((({Ref:t})=>({selection_policy:[t(d.SelectionPolicy),()=>new d.UnionRenderers]}))),r.internal((({AnyRef:t})=>({inspected:[t(),()=>new _.Selection]})))},
function _(e,t,o,s,c){s();const n=e(103);function i(e){return"GlyphRenderer"==e.model.type}function l(e){return"GraphRenderer"==e.model.type}class r{constructor(e){this.inspectors=new Map,this.source=e}select(e,t,o,s="replace"){const c=[],n=[];for(const t of e)i(t)?c.push(t):l(t)&&n.push(t);let r=!1;for(const e of n){const c=e.model.selection_policy.hit_test(t,e);r=r||e.model.selection_policy.do_selection(c,e.model,o,s)}if(c.length>0){const e=this.source.selection_policy.hit_test(t,c);r=r||this.source.selection_policy.do_selection(e,this.source,o,s)}return r}inspect(e,t){let o=!1;if(i(e)){const s=e.hit_test(t);if(null!=s){o=!s.is_empty();const c=this.get_or_create_inspector(e.model);c.update(s,!0,"replace"),this.source.setv({inspected:c},{silent:!0}),this.source.inspect.emit([e.model,{geometry:t}])}}else if(l(e)){const s=e.model.inspection_policy.hit_test(t,e);o=e.model.inspection_policy.do_inspection(s,t,e,!1,"replace")}return o}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 n.Selection,this.inspectors.set(e,t)),t}}o.SelectionManager=r,r.__name__="SelectionManager"},
function _(i,e,s,t,n){var c;t();const l=i(50),d=i(10),h=i(9),_=i(21),u=i(13);s.OpaqueIndices=(0,_.Arrayable)(_.Int);class a extends l.Model{constructor(i){super(i)}get_view(){return this.view}get selected_glyph(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null}add_to_selected_glyphs(i){this.selected_glyphs.push(i)}update(i,e=!0,s="replace"){switch(s){case"replace":this.indices=i.indices,this.line_indices=i.line_indices,this.multiline_indices=i.multiline_indices,this.image_indices=i.image_indices,this.view=i.view,this.selected_glyphs=i.selected_glyphs;break;case"append":this.update_through_union(i);break;case"intersect":this.update_through_intersection(i);break;case"subtract":this.update_through_subtraction(i)}}clear(){this.indices=[],this.line_indices=[],this.multiline_indices={},this.image_indices=[],this.view=null,this.selected_glyphs=[]}map(i){return new c(Object.assign(Object.assign({},this.attributes),{indices:(0,u.map)(this.indices,i),multiline_indices:(0,h.to_object)((0,h.entries)(this.multiline_indices).map((([e,s])=>[i(Number(e)),s]))),image_indices:this.image_indices.map((e=>Object.assign(Object.assign({},e),{index:i(e.index)})))}))}is_empty(){return 0==this.indices.length&&0==this.line_indices.length&&0==this.image_indices.length}update_through_union(i){this.indices=(0,d.union)(this.indices,i.indices),this.selected_glyphs=(0,d.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,d.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,h.merge)(i.multiline_indices,this.multiline_indices)}update_through_intersection(i){this.indices=(0,d.intersection)(this.indices,i.indices),this.selected_glyphs=(0,d.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,d.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,h.merge)(i.multiline_indices,this.multiline_indices)}update_through_subtraction(i){this.indices=(0,d.difference)(this.indices,i.indices),this.selected_glyphs=(0,d.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,d.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,h.merge)(i.multiline_indices,this.multiline_indices)}}s.Selection=a,c=a,a.__name__="Selection",c.define((({Int:i,Array:e,Dict:t,Struct:n})=>({indices:[s.OpaqueIndices,[]],line_indices:[s.OpaqueIndices,[]],multiline_indices:[t(s.OpaqueIndices),{}],image_indices:[e(n({index:i,i,j:i,flat_index:i})),[]]}))),c.internal((({Array:i,AnyRef:e,Nullable:s})=>({selected_glyphs:[i(e()),[]],view:[s(e()),null]})))},
function _(e,t,n,s,o){s();const r=e(50);class c extends r.Model{do_selection(e,t,n,s){return null!=e&&(t.selected.update(e,n,s),t._select.emit(),!t.selected.is_empty())}}n.SelectionPolicy=c,c.__name__="SelectionPolicy";class l extends c{hit_test(e,t){const n=[];for(const s of t){const t=s.hit_test(e);null!=t&&n.push(t)}if(n.length>0){const e=n[0];for(const t of n)e.update_through_intersection(t);return e}return null}}n.IntersectRenderers=l,l.__name__="IntersectRenderers";class _ extends c{hit_test(e,t){const n=[];for(const s of t){const t=s.hit_test(e);null!=t&&n.push(t)}if(n.length>0){const e=n[0];for(const t of n)e.update_through_union(t);return e}return null}}n.UnionRenderers=_,_.__name__="UnionRenderers"},
function _(e,n,c,o,t){var a;o();const r=e(50),s=e(103);class l extends r.Model{constructor(e){super(e)}}c.DataSource=l,a=l,l.__name__="DataSource",a.define((({Ref:e})=>({selected:[e(s.Selection),()=>new s.Selection,{readonly:!0}]})))},
function _(t,a,s,e,r){var c;e();const n=t(101);class o extends n.ColumnarDataSource{constructor(t){super(t)}stream(t,a,{sync:s}={}){this.stream_to(this.properties.data,t,a,{sync:s})}patch(t,{sync:a}={}){this.patch_to(this.properties.data,t,{sync:a})}}s.ColumnDataSource=o,c=o,o.__name__="ColumnDataSource",c.define((({Any:t,Dict:a,Arrayable:s})=>({data:[a(s(t)),{}]})))},
function _(n,t,e,o,r){o();const c=n(1),l=c.__importDefault(n(108)),i=c.__importDefault(n(109)),u=n(24),a=new i.default("GOOGLE"),s=new i.default("WGS84"),f=(0,l.default)(s,a);e.wgs84_mercator={compute:(n,t)=>isFinite(n)&&isFinite(t)?f.forward([n,t]):[NaN,NaN],invert:(n,t)=>isFinite(n)&&isFinite(t)?f.inverse([n,t]):[NaN,NaN]};const _={lon:[-20026376.39,20026376.39],lat:[-20048966.1,20048966.1]},p={lon:[-180,180],lat:[-85.06,85.06]},{min:g,max:h}=Math;function m(n,t){const o=g(n.length,t.length),r=(0,u.infer_type)(n,t),c=new r(o),l=new r(o);return e.inplace.project_xy(n,t,c,l),[c,l]}e.clip_mercator=function(n,t,e){const[o,r]=_[e];return[h(n,o),g(t,r)]},e.in_bounds=function(n,t){const[e,o]=p[t];return e<n&&n<o},function(n){function t(n,t,o,r){const c=g(n.length,t.length);o=null!=o?o:n,r=null!=r?r:t;for(let l=0;l<c;l++){const c=n[l],i=t[l],[u,a]=e.wgs84_mercator.compute(c,i);o[l]=u,r[l]=a}}n.project_xy=t,n.project_xsys=function(n,e,o,r){const c=g(n.length,e.length);o=null!=o?o:n,r=null!=r?r:e;for(let l=0;l<c;l++)t(n[l],e[l],o[l],r[l])}}(e.inplace||(e.inplace={})),e.project_xy=m,e.project_xsys=function(n,t){const e=g(n.length,t.length),o=new Array(e),r=new Array(e);for(let c=0;c<e;c++){const[e,l]=m(n[c],t[c]);o[c]=e,r[c]=l}return[o,r]}},
function _(e,n,t,r,o){r();const a=e(1),i=a.__importDefault(e(109)),c=a.__importDefault(e(135));var u=(0,i.default)("WGS84");function f(e,n,t,r){var o,a,i;return Array.isArray(t)?(o=(0,c.default)(e,n,t,r)||{x:NaN,y:NaN},t.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==n.name&&"geocent"===n.name?"number"==typeof o.z?[o.x,o.y,o.z].concat(t.splice(3)):[o.x,o.y,t[2]].concat(t.splice(3)):[o.x,o.y].concat(t.splice(2)):[o.x,o.y]):(a=(0,c.default)(e,n,t,r),2===(i=Object.keys(t)).length||i.forEach((function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==n.name&&"geocent"===n.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;a[r]=t[r]})),a)}function l(e){return e instanceof i.default?e:e.oProj?e.oProj:(0,i.default)(e)}t.default=function(e,n,t){e=l(e);var r,o=!1;return void 0===n?(n=e,e=u,o=!0):(void 0!==n.x||Array.isArray(n))&&(t=n,n=e,e=u,o=!0),n=l(n),t?f(e,n,t):(r={forward:function(t,r){return f(e,n,t,r)},inverse:function(t,r){return f(n,e,t,r)}},o&&(r.oProj=n),r)}},
function _(t,e,a,s,i){s();const l=t(1),u=l.__importDefault(t(110)),r=l.__importDefault(t(121)),d=l.__importDefault(t(122)),o=t(130),f=l.__importDefault(t(132)),p=l.__importDefault(t(133)),m=l.__importDefault(t(117)),n=t(134);function h(t,e){if(!(this instanceof h))return new h(t);e=e||function(t){if(t)throw t};var a=(0,u.default)(t);if("object"==typeof a){var s=h.projections.get(a.projName);if(s){if(a.datumCode&&"none"!==a.datumCode){var i=(0,m.default)(f.default,a.datumCode);i&&(a.datum_params=a.datum_params||(i.towgs84?i.towgs84.split(","):null),a.ellps=i.ellipse,a.datumName=i.datumName?i.datumName:a.datumCode)}a.k0=a.k0||1,a.axis=a.axis||"enu",a.ellps=a.ellps||"wgs84",a.lat1=a.lat1||a.lat0;var l=(0,o.sphere)(a.a,a.b,a.rf,a.ellps,a.sphere),d=(0,o.eccentricity)(l.a,l.b,l.rf,a.R_A),_=(0,n.getNadgrids)(a.nadgrids),c=a.datum||(0,p.default)(a.datumCode,a.datum_params,l.a,l.b,d.es,d.ep2,_);(0,r.default)(this,a),(0,r.default)(this,s),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=c,this.init(),e(null,this)}else e(t)}else e(t)}h.projections=d.default,h.projections.start(),a.default=h},
function _(t,r,n,u,e){u();const f=t(1),i=f.__importDefault(t(111)),a=f.__importDefault(t(118)),o=f.__importDefault(t(113)),l=f.__importDefault(t(117));var C=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var d=["3857","900913","3785","102113"];n.default=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in i.default}(t))return i.default[t];if(function(t){return C.some((function(r){return t.indexOf(r)>-1}))}(t)){var r=(0,a.default)(t);if(function(t){var r=(0,l.default)(t,"authority");if(r){var n=(0,l.default)(r,"epsg");return n&&d.indexOf(n)>-1}}(r))return i.default["EPSG:3857"];var n=function(t){var r=(0,l.default)(t,"extension");if(r)return(0,l.default)(r,"proj4")}(r);return n?(0,o.default)(n):r}return function(t){return"+"===t[0]}(t)?(0,o.default)(t):void 0}},
function _(t,r,i,e,n){e();const f=t(1),a=f.__importDefault(t(112)),l=f.__importDefault(t(113)),u=f.__importDefault(t(118));function o(t){var r=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?o[t]=(0,l.default)(arguments[1]):o[t]=(0,u.default)(arguments[1]):o[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?o.apply(r,t):o(t)}));if("string"==typeof t){if(t in o)return o[t]}else"EPSG"in t?o["EPSG:"+t.EPSG]=t:"ESRI"in t?o["ESRI:"+t.ESRI]=t:"IAU2000"in t?o["IAU2000:"+t.IAU2000]=t:console.log(t);return}}(0,a.default)(o),i.default=o},
function _(t,l,G,S,e){S(),G.default=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},
function _(t,n,o,a,u){a();const e=t(1),r=t(114),i=e.__importDefault(t(115)),f=e.__importDefault(t(116)),l=e.__importDefault(t(117));o.default=function(t){var n,o,a,u={},e=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,n){var o=n.split("=");return o.push(!0),t[o[0].toLowerCase()]=o[1],t}),{}),c={proj:"projName",datum:"datumCode",rf:function(t){u.rf=parseFloat(t)},lat_0:function(t){u.lat0=t*r.D2R},lat_1:function(t){u.lat1=t*r.D2R},lat_2:function(t){u.lat2=t*r.D2R},lat_ts:function(t){u.lat_ts=t*r.D2R},lon_0:function(t){u.long0=t*r.D2R},lon_1:function(t){u.long1=t*r.D2R},lon_2:function(t){u.long2=t*r.D2R},alpha:function(t){u.alpha=parseFloat(t)*r.D2R},gamma:function(t){u.rectified_grid_angle=parseFloat(t)},lonc:function(t){u.longc=t*r.D2R},x_0:function(t){u.x0=parseFloat(t)},y_0:function(t){u.y0=parseFloat(t)},k_0:function(t){u.k0=parseFloat(t)},k:function(t){u.k0=parseFloat(t)},a:function(t){u.a=parseFloat(t)},b:function(t){u.b=parseFloat(t)},r_a:function(){u.R_A=!0},zone:function(t){u.zone=parseInt(t,10)},south:function(){u.utmSouth=!0},towgs84:function(t){u.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){u.to_meter=parseFloat(t)},units:function(t){u.units=t;var n=(0,l.default)(f.default,t);n&&(u.to_meter=n.to_meter)},from_greenwich:function(t){u.from_greenwich=t*r.D2R},pm:function(t){var n=(0,l.default)(i.default,t);u.from_greenwich=(n||parseFloat(t))*r.D2R},nadgrids:function(t){"@null"===t?u.datumCode="none":u.nadgrids=t},axis:function(t){var n="ewnsud";3===t.length&&-1!==n.indexOf(t.substr(0,1))&&-1!==n.indexOf(t.substr(1,1))&&-1!==n.indexOf(t.substr(2,1))&&(u.axis=t)},approx:function(){u.approx=!0}};for(n in e)o=e[n],n in c?"function"==typeof(a=c[n])?a(o):u[a]=o:u[n]=o;return"string"==typeof u.datumCode&&"WGS84"!==u.datumCode&&(u.datumCode=u.datumCode.toLowerCase()),u}},
function _(S,_,P,R,I){R(),P.PJD_3PARAM=1,P.PJD_7PARAM=2,P.PJD_GRIDSHIFT=3,P.PJD_WGS84=4,P.PJD_NODATUM=5,P.SRS_WGS84_SEMIMAJOR=6378137,P.SRS_WGS84_SEMIMINOR=6356752.314,P.SRS_WGS84_ESQUARED=.0066943799901413165,P.SEC_TO_RAD=484813681109536e-20,P.HALF_PI=Math.PI/2,P.SIXTH=.16666666666666666,P.RA4=.04722222222222222,P.RA6=.022156084656084655,P.EPSLN=1e-10,P.D2R=.017453292519943295,P.R2D=57.29577951308232,P.FORTPI=Math.PI/4,P.TWO_PI=2*Math.PI,P.SPI=3.14159265359},
function _(o,r,a,e,s){e();var n={};a.default=n,n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},
function _(t,e,f,o,u){o(),f.default={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},
function _(e,r,t,a,n){a();var o=/[\s_\-\/\(\)]/g;t.default=function(e,r){if(e[r])return e[r];for(var t,a=Object.keys(e),n=r.toLowerCase().replace(o,""),f=-1;++f<a.length;)if((t=a[f]).toLowerCase().replace(o,"")===n)return e[t]}},
function _(e,a,t,o,n){o();const r=e(1);var l=.017453292519943295;const d=r.__importDefault(e(119)),i=e(120);function _(e){return e*l}t.default=function(e){var a=(0,d.default)(e),t=a.shift(),o=a.shift();a.unshift(["name",o]),a.unshift(["type",t]);var n={};return(0,i.sExpr)(a,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 a="",t=0,o=e.AXIS.length;t<o;++t){var n=[e.AXIS[t][0].toLowerCase(),e.AXIS[t][1].toLowerCase()];-1!==n[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?a+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?a+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?a+="e":-1===n[0].indexOf("west")&&("x"!==n[0]&&"lon"!==n[0]||"west"!==n[1])||(a+="w")}2===a.length&&(a+="u"),3===a.length&&(e.axis=a)}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 r=e.GEOGCS;function l(a){return a*(e.to_meter||1)}"GEOGCS"===e.type&&(r=e),r&&(r.DATUM?e.datumCode=r.DATUM.name.toLowerCase():e.datumCode=r.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"),r.DATUM&&r.DATUM.SPHEROID&&(e.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=r.DATUM.SPHEROID.a,e.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(e.datum_params=r.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",_],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",_],["x0","false_easting",l],["y0","false_northing",l],["long0","central_meridian",_],["lat0","latitude_of_origin",_],["lat0","standard_parallel_1",_],["lat1","standard_parallel_1",_],["lat2","standard_parallel_2",_],["azimuth","Azimuth"],["alpha","azimuth",_],["srsCode","name"]].forEach((function(a){return t=e,n=(o=a)[0],r=o[1],void(!(n in t)&&r in t&&(t[n]=t[r],3===o.length&&(t[n]=o[2](t[n]))));var t,o,n,r})),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.lat_ts&&e.lat0&&"Polar_Stereographic"===e.projName&&(e.lat_ts=e.lat0,e.lat0=_(e.lat0>0?90:-90)):(e.lat0=_(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(n),n}},
function _(t,e,r,i,s){i(),r.default=function(t){return new c(t).output()};var h=1,o=/\s/,n=/[A-Za-z]/,a=/[A-Za-z84_]/,u=/[,\]]/,d=/[\d\.E\-\+]/;function c(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=h}c.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;o.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case h:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},c.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(u.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},c.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=h)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=h,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},c.prototype.number=function(t){if(!d.test(t)){if(u.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},c.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},c.prototype.keyword=function(t){if(a.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=h)}if(!u.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},c.prototype.neutral=function(t){if(n.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(d.test(t))return this.word=t,void(this.state=3);if(!u.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},c.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,a,r,s,c){function n(e,a,r){Array.isArray(a)&&(r.unshift(a),a=null);var s=a?{}:e,c=r.reduce((function(e,a){return E(a,e),e}),s);a&&(e[a]=c)}function E(e,a){if(Array.isArray(e)){var r=e.shift();if("PARAMETER"===r&&(r=e.shift()),1===e.length)return Array.isArray(e[0])?(a[r]={},void E(e[0],a[r])):void(a[r]=e[0]);if(e.length)if("TOWGS84"!==r){if("AXIS"===r)return r in a||(a[r]=[]),void a[r].push(e);var s;switch(Array.isArray(r)||(a[r]={}),r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return a[r]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&E(e[2],a[r]));case"SPHEROID":case"ELLIPSOID":return a[r]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&E(e[3],a[r]));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 n(a,r,e);default:for(s=-1;++s<e.length;)if(!Array.isArray(e[s]))return E(e,a[r]);return n(a,r,e)}}else a[r]=e;else a[r]=!0}else a[e]=!0}s(),r.sExpr=E},
function _(n,r,f,i,t){i(),f.default=function(n,r){var f,i;if(n=n||{},!r)return n;for(i in r)void 0!==(f=r[i])&&(n[i]=f);return n}},
function _(t,o,a,e,n){e();const r=t(1),f=r.__importDefault(t(123)),u=r.__importDefault(t(129));var i=[f.default,u.default],c={},d=[];function s(t,o){var a=d.length;return t.names?(d[a]=t,t.names.forEach((function(t){c[t.toLowerCase()]=a})),this):(console.log(o),!0)}function l(t){if(!t)return!1;var o=t.toLowerCase();return void 0!==c[o]&&d[c[o]]?d[c[o]]:void 0}function v(){i.forEach(s)}a.add=s,a.get=l,a.start=v,a.default={start:v,add:s,get:l}},
function _(t,i,s,h,a){h();const e=t(1),r=e.__importDefault(t(124)),n=e.__importDefault(t(125)),l=e.__importDefault(t(127)),u=e.__importDefault(t(128)),o=t(114);function f(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=(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 _(t){var i,s,h=t.x,a=t.y;if(a*o.R2D>90&&a*o.R2D<-90&&h*o.R2D>180&&h*o.R2D<-180)return null;if(Math.abs(Math.abs(a)-o.HALF_PI)<=o.EPSLN)return null;if(this.sphere)i=this.x0+this.a*this.k0*(0,n.default)(h-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(o.FORTPI+.5*a));else{var e=Math.sin(a),r=(0,l.default)(this.e,a,e);i=this.x0+this.a*this.k0*(0,n.default)(h-this.long0),s=this.y0-this.a*this.k0*Math.log(r)}return t.x=i,t.y=s,t}function M(t){var i,s,h=t.x-this.x0,a=t.y-this.y0;if(this.sphere)s=o.HALF_PI-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var e=Math.exp(-a/(this.a*this.k0));if(-9999===(s=(0,u.default)(this.e,e)))return null}return i=(0,n.default)(this.long0+h/(this.a*this.k0)),t.x=i,t.y=s,t}s.init=f,s.forward=_,s.inverse=M,s.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],s.default={init:f,forward:_,inverse:M,names:s.names}},
function _(t,n,r,u,a){u(),r.default=function(t,n,r){var u=t*n;return r/Math.sqrt(1-u*u)}},
function _(t,n,u,a,f){a();const e=t(1),o=t(114),_=e.__importDefault(t(126));u.default=function(t){return Math.abs(t)<=o.SPI?t:t-(0,_.default)(t)*o.TWO_PI}},
function _(n,t,u,f,c){f(),u.default=function(n){return n<0?-1:1}},
function _(t,n,a,o,u){o();const c=t(114);a.default=function(t,n,a){var o=t*a,u=.5*t;return o=Math.pow((1-o)/(1+o),u),Math.tan(.5*(c.HALF_PI-n))/o}},
function _(t,a,n,r,f){r();const h=t(114);n.default=function(t,a){for(var n,r,f=.5*t,o=h.HALF_PI-2*Math.atan(a),u=0;u<=15;u++)if(n=t*Math.sin(o),o+=r=h.HALF_PI-2*Math.atan(a*Math.pow((1-n)/(1+n),f))-o,Math.abs(r)<=1e-10)return o;return-9999}},
function _(n,i,e,t,r){function a(){}function f(n){return n}t(),e.init=a,e.forward=f,e.inverse=f,e.names=["longlat","identity"],e.default={init:a,forward:f,inverse:f,names:e.names}},
function _(t,r,e,a,n){a();const f=t(1),i=t(114),u=f.__importStar(t(131)),c=f.__importDefault(t(117));e.eccentricity=function(t,r,e,a){var n=t*t,f=r*r,u=(n-f)/n,c=0;return a?(n=(t*=1-u*(i.SIXTH+u*(i.RA4+u*i.RA6)))*t,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(n-f)/f}},e.sphere=function(t,r,e,a,n){if(!t){var f=(0,c.default)(u.default,a);f||(f=u.WGS84),t=f.a,r=f.b,e=f.rf}return e&&!r&&(r=(1-1/e)*t),(0===e||Math.abs(t-r)<i.EPSLN)&&(n=!0,r=t),{a:t,b:r,rf:e,sphere:n}}},
function _(e,a,l,s,r){s();var i={};l.default=i,i.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},i.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},i.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},i.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},i.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},i.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},i.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},i.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},i.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},i.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},i.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},i.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},i.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},i.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},i.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},i.clrk80ign={a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},i.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},i.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},i.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},i.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},i.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},i.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},i.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},i.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},i.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},i.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},i.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},i.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},i.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},i.hough={a:6378270,rf:297,ellipseName:"Hough"},i.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},i.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},i.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},i.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},i.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},i.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},i.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},i.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},i.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},i.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},i.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},i.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},l.WGS84=i.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},i.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},
function _(e,a,s,t,l){t();var m={};s.default=m,m.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},m.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},m.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},m.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},m.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},m.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},m.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},m.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},m.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},m.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},m.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},m.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},m.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},m.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},m.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},m.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},m.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},
function _(a,m,_,t,u){t();const d=a(114);_.default=function(a,m,_,t,u,p,r){var s={};return s.datum_type=void 0===a||"none"===a?d.PJD_NODATUM:d.PJD_WGS84,m&&(s.datum_params=m.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=d.PJD_3PARAM),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=d.PJD_7PARAM,s.datum_params[3]*=d.SEC_TO_RAD,s.datum_params[4]*=d.SEC_TO_RAD,s.datum_params[5]*=d.SEC_TO_RAD,s.datum_params[6]=s.datum_params[6]/1e6+1))),r&&(s.datum_type=d.PJD_GRIDSHIFT,s.grids=r),s.a=_,s.b=t,s.es=u,s.ep2=p,s}},
function _(t,e,n,r,i){r();var u={};function l(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:u[t]||null,isNull:!1}}function o(t){return t/3600*Math.PI/180}function a(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function d(t){return t.map((function(t){return[o(t.longitudeShift),o(t.latitudeShift)]}))}function g(t,e,n){return{name:a(t,e+8,e+16).trim(),parent:a(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function s(t,e,n,r){for(var i=e+176,u=[],l=0;l<n.gridNodeCount;l++){var o={latitudeShift:t.getFloat32(i+16*l,r),longitudeShift:t.getFloat32(i+16*l+4,r),latitudeAccuracy:t.getFloat32(i+16*l+8,r),longitudeAccuracy:t.getFloat32(i+16*l+12,r)};u.push(o)}return u}n.default=function(t,e){var n=new DataView(e),r=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0),11!==e&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(n),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:a(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(n,r);i.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var l=function(t,e,n){for(var r=176,i=[],u=0;u<e.nSubgrids;u++){var l=g(t,r,n),a=s(t,r,l,n),f=Math.round(1+(l.upperLongitude-l.lowerLongitude)/l.longitudeInterval),c=Math.round(1+(l.upperLatitude-l.lowerLatitude)/l.latitudeInterval);i.push({ll:[o(l.lowerLongitude),o(l.lowerLatitude)],del:[o(l.longitudeInterval),o(l.latitudeInterval)],lim:[f,c],count:l.gridNodeCount,cvs:d(a)})}return i}(n,i,r),f={header:i,subgrids:l};return u[t]=f,f},n.getNadgrids=function(t){return void 0===t?null:t.split(",").map(l)}},
function _(t,e,a,u,m){u();const r=t(1),_=t(114),d=r.__importDefault(t(136)),o=r.__importDefault(t(138)),f=r.__importDefault(t(109)),i=r.__importDefault(t(139)),n=r.__importDefault(t(140));a.default=function t(e,a,u,m){var r,y=void 0!==(u=Array.isArray(u)?(0,i.default)(u):{x:u.x,y:u.y,z:u.z,m:u.m}).z;if((0,n.default)(u),e.datum&&a.datum&&function(t,e){return(t.datum.datum_type===_.PJD_3PARAM||t.datum.datum_type===_.PJD_7PARAM||t.datum.datum_type===_.PJD_GRIDSHIFT)&&"WGS84"!==e.datumCode||(e.datum.datum_type===_.PJD_3PARAM||e.datum.datum_type===_.PJD_7PARAM||e.datum.datum_type===_.PJD_GRIDSHIFT)&&"WGS84"!==t.datumCode}(e,a)&&(u=t(e,r=new f.default("WGS84"),u,m),e=r),m&&"enu"!==e.axis&&(u=(0,o.default)(e,!1,u)),"longlat"===e.projName)u={x:u.x*_.D2R,y:u.y*_.D2R,z:u.z||0};else if(e.to_meter&&(u={x:u.x*e.to_meter,y:u.y*e.to_meter,z:u.z||0}),!(u=e.inverse(u)))return;if(e.from_greenwich&&(u.x+=e.from_greenwich),u=(0,d.default)(e.datum,a.datum,u))return a.from_greenwich&&(u={x:u.x-a.from_greenwich,y:u.y,z:u.z||0}),"longlat"===a.projName?u={x:u.x*_.R2D,y:u.y*_.R2D,z:u.z||0}:(u=a.forward(u),a.to_meter&&(u={x:u.x/a.to_meter,y:u.y/a.to_meter,z:u.z||0})),m&&"enu"!==a.axis?(0,o.default)(a,!0,u):(y||delete u.z,u)}},
function _(r,e,t,a,i){a();const l=r(1),n=r(114),o=r(137),u=l.__importDefault(r(125));function d(r){return r===n.PJD_3PARAM||r===n.PJD_7PARAM}function s(r,e,t){if(null===r.grids||0===r.grids.length)return console.log("Grid shift grids not found"),-1;for(var a={x:-t.x,y:t.y},i={x:Number.NaN,y:Number.NaN},l=[],o=0;o<r.grids.length;o++){var u=r.grids[o];if(l.push(u.name),u.isNull){i=a;break}if(u.mandatory,null!==u.grid){var d=u.grid.subgrids[0],s=(Math.abs(d.del[1])+Math.abs(d.del[0]))/1e4,f=d.ll[0]-s,x=d.ll[1]-s,m=d.ll[0]+(d.lim[0]-1)*d.del[0]+s,N=d.ll[1]+(d.lim[1]-1)*d.del[1]+s;if(!(x>a.y||f>a.x||N<a.y||m<a.x||(i=y(a,e,d),isNaN(i.x))))break}else if(u.mandatory)return console.log("Unable to find mandatory grid '"+u.name+"'"),-1}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*n.R2D+" "+a.y*n.R2D+" tried: '"+l+"'"),-1):(t.x=-i.x,t.y=i.y,0)}function y(r,e,t){var a={x:Number.NaN,y:Number.NaN};if(isNaN(r.x))return a;var i={x:r.x,y:r.y};i.x-=t.ll[0],i.y-=t.ll[1],i.x=(0,u.default)(i.x-Math.PI)+Math.PI;var l=f(i,t);if(e){if(isNaN(l.x))return a;l.x=i.x-l.x,l.y=i.y-l.y;var n,o,d=9;do{if(o=f(l,t),isNaN(o.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}n={x:i.x-(o.x+l.x),y:i.y-(o.y+l.y)},l.x+=n.x,l.y+=n.y}while(d--&&Math.abs(n.x)>1e-12&&Math.abs(n.y)>1e-12);if(d<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=(0,u.default)(l.x+t.ll[0]),a.y=l.y+t.ll[1]}else isNaN(l.x)||(a.x=r.x+l.x,a.y=r.y+l.y);return a}function f(r,e){var t,a={x:r.x/e.del[0],y:r.y/e.del[1]},i=Math.floor(a.x),l=Math.floor(a.y),n=a.x-1*i,o=a.y-1*l,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(l<0||l>=e.lim[1])return u;t=l*e.lim[0]+i;var d=e.cvs[t][0],s=e.cvs[t][1];t++;var y=e.cvs[t][0],f=e.cvs[t][1];t+=e.lim[0];var x=e.cvs[t][0],m=e.cvs[t][1];t--;var N=e.cvs[t][0],c=e.cvs[t][1],_=n*o,g=n*(1-o),v=(1-n)*(1-o),S=(1-n)*o;return u.x=v*d+g*y+S*N+_*x,u.y=v*s+g*f+S*c+_*m,u}t.default=function(r,e,t){if((0,o.compareDatums)(r,e))return t;if(r.datum_type===n.PJD_NODATUM||e.datum_type===n.PJD_NODATUM)return t;var a=r.a,i=r.es;if(r.datum_type===n.PJD_GRIDSHIFT){if(0!==s(r,!1,t))return;a=n.SRS_WGS84_SEMIMAJOR,i=n.SRS_WGS84_ESQUARED}var l=e.a,u=e.b,y=e.es;if(e.datum_type===n.PJD_GRIDSHIFT&&(l=n.SRS_WGS84_SEMIMAJOR,u=n.SRS_WGS84_SEMIMINOR,y=n.SRS_WGS84_ESQUARED),i===y&&a===l&&!d(r.datum_type)&&!d(e.datum_type))return t;if(t=(0,o.geodeticToGeocentric)(t,i,a),d(r.datum_type)&&(t=(0,o.geocentricToWgs84)(t,r.datum_type,r.datum_params)),d(e.datum_type)&&(t=(0,o.geocentricFromWgs84)(t,e.datum_type,e.datum_params)),t=(0,o.geocentricToGeodetic)(t,y,l,u),e.datum_type===n.PJD_GRIDSHIFT&&0!==s(e,!0,t))return;return t},t.applyGridShift=s},
function _(a,t,r,m,s){m();const u=a(114);r.compareDatums=function(a,t){return a.datum_type===t.datum_type&&(!(a.a!==t.a||Math.abs(a.es-t.es)>5e-11)&&(a.datum_type===u.PJD_3PARAM?a.datum_params[0]===t.datum_params[0]&&a.datum_params[1]===t.datum_params[1]&&a.datum_params[2]===t.datum_params[2]:a.datum_type!==u.PJD_7PARAM||a.datum_params[0]===t.datum_params[0]&&a.datum_params[1]===t.datum_params[1]&&a.datum_params[2]===t.datum_params[2]&&a.datum_params[3]===t.datum_params[3]&&a.datum_params[4]===t.datum_params[4]&&a.datum_params[5]===t.datum_params[5]&&a.datum_params[6]===t.datum_params[6]))},r.geodeticToGeocentric=function(a,t,r){var m,s,_,e,n=a.x,d=a.y,i=a.z?a.z:0;if(d<-u.HALF_PI&&d>-1.001*u.HALF_PI)d=-u.HALF_PI;else if(d>u.HALF_PI&&d<1.001*u.HALF_PI)d=u.HALF_PI;else{if(d<-u.HALF_PI)return{x:-1/0,y:-1/0,z:a.z};if(d>u.HALF_PI)return{x:1/0,y:1/0,z:a.z}}return n>Math.PI&&(n-=2*Math.PI),s=Math.sin(d),e=Math.cos(d),_=s*s,{x:((m=r/Math.sqrt(1-t*_))+i)*e*Math.cos(n),y:(m+i)*e*Math.sin(n),z:(m*(1-t)+i)*s}},r.geocentricToGeodetic=function(a,t,r,m){var s,_,e,n,d,i,p,P,y,z,M,o,A,c,x,h=1e-12,f=a.x,I=a.y,F=a.z?a.z:0;if(s=Math.sqrt(f*f+I*I),_=Math.sqrt(f*f+I*I+F*F),s/r<h){if(c=0,_/r<h)return u.HALF_PI,x=-m,{x:a.x,y:a.y,z:a.z}}else c=Math.atan2(I,f);e=F/_,P=(n=s/_)*(1-t)*(d=1/Math.sqrt(1-t*(2-t)*n*n)),y=e*d,A=0;do{A++,i=t*(p=r/Math.sqrt(1-t*y*y))/(p+(x=s*P+F*y-p*(1-t*y*y))),o=(M=e*(d=1/Math.sqrt(1-i*(2-i)*n*n)))*P-(z=n*(1-i)*d)*y,P=z,y=M}while(o*o>1e-24&&A<30);return{x:c,y:Math.atan(M/Math.abs(z)),z:x}},r.geocentricToWgs84=function(a,t,r){if(t===u.PJD_3PARAM)return{x:a.x+r[0],y:a.y+r[1],z:a.z+r[2]};if(t===u.PJD_7PARAM){var m=r[0],s=r[1],_=r[2],e=r[3],n=r[4],d=r[5],i=r[6];return{x:i*(a.x-d*a.y+n*a.z)+m,y:i*(d*a.x+a.y-e*a.z)+s,z:i*(-n*a.x+e*a.y+a.z)+_}}},r.geocentricFromWgs84=function(a,t,r){if(t===u.PJD_3PARAM)return{x:a.x-r[0],y:a.y-r[1],z:a.z-r[2]};if(t===u.PJD_7PARAM){var m=r[0],s=r[1],_=r[2],e=r[3],n=r[4],d=r[5],i=r[6],p=(a.x-m)/i,P=(a.y-s)/i,y=(a.z-_)/i;return{x:p+d*P-n*y,y:-d*p+P+e*y,z:n*p-e*P+y}}}},
function _(e,a,i,s,n){s(),i.default=function(e,a,i){var s,n,r,c=i.x,d=i.y,f=i.z||0,u={};for(r=0;r<3;r++)if(!a||2!==r||void 0!==i.z)switch(0===r?(s=c,n=-1!=="ew".indexOf(e.axis[r])?"x":"y"):1===r?(s=d,n=-1!=="ns".indexOf(e.axis[r])?"y":"x"):(s=f,n="z"),e.axis[r]){case"e":case"n":u[n]=s;break;case"w":case"s":u[n]=-s;break;case"u":void 0!==i[n]&&(u.z=s);break;case"d":void 0!==i[n]&&(u.z=-s);break;default:return null}return u}},
function _(n,t,e,u,f){u(),e.default=function(n){var t={x:n[0],y:n[1]};return n.length>2&&(t.z=n[2]),n.length>3&&(t.m=n[3]),t}},
function _(e,i,n,t,r){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")}t(),n.default=function(e){o(e.x),o(e.y)}},
function _(e,i,s,o,n){var l,t,a,r,_;o();const c=e(1),d=e(142),p=e(78),T=c.__importStar(e(18));class m extends d.MarkingView{}s.ArrowHeadView=m,m.__name__="ArrowHeadView";class v extends d.Marking{constructor(e){super(e)}}s.ArrowHead=v,l=v,v.__name__="ArrowHead",l.define((()=>({size:[T.NumberSpec,25]})));class u extends m{clip(e,i){this.visuals.line.set_vectorize(e,i);const s=this.size.get(i);e.moveTo(.5*s,s),e.lineTo(.5*s,-2),e.lineTo(-.5*s,-2),e.lineTo(-.5*s,s),e.lineTo(0,0),e.lineTo(.5*s,s)}render(e,i){const s=this.size.get(i);e.beginPath(),e.moveTo(.5*s,s),e.lineTo(0,0),e.lineTo(-.5*s,s),this.visuals.line.apply(e,i)}}s.OpenHeadView=u,u.__name__="OpenHeadView";class h extends v{constructor(e){super(e)}}s.OpenHead=h,t=h,h.__name__="OpenHead",t.prototype.default_view=u,t.mixins(p.LineVector);class V extends m{clip(e,i){this.visuals.line.set_vectorize(e,i);const s=this.size.get(i);e.moveTo(.5*s,s),e.lineTo(.5*s,-2),e.lineTo(-.5*s,-2),e.lineTo(-.5*s,s),e.lineTo(.5*s,s)}render(e,i){const s=this.size.get(i);e.beginPath(),e.moveTo(.5*s,s),e.lineTo(0,0),e.lineTo(-.5*s,s),e.closePath(),this.visuals.fill.apply(e,i),this.visuals.line.apply(e,i)}}s.NormalHeadView=V,V.__name__="NormalHeadView";class H extends v{constructor(e){super(e)}}s.NormalHead=H,a=H,H.__name__="NormalHead",a.prototype.default_view=V,a.mixins([p.LineVector,p.FillVector]),a.override({fill_color:"black"});class w extends m{clip(e,i){this.visuals.line.set_vectorize(e,i);const s=this.size.get(i);e.moveTo(.5*s,s),e.lineTo(.5*s,-2),e.lineTo(-.5*s,-2),e.lineTo(-.5*s,s),e.lineTo(0,.5*s),e.lineTo(.5*s,s)}render(e,i){const s=this.size.get(i);e.beginPath(),e.moveTo(.5*s,s),e.lineTo(0,0),e.lineTo(-.5*s,s),e.lineTo(0,.5*s),e.closePath(),this.visuals.fill.apply(e,i),this.visuals.line.apply(e,i)}}s.VeeHeadView=w,w.__name__="VeeHeadView";class x extends v{constructor(e){super(e)}}s.VeeHead=x,r=x,x.__name__="VeeHead",r.prototype.default_view=w,r.mixins([p.LineVector,p.FillVector]),r.override({fill_color:"black"});class g extends m{render(e,i){const s=this.size.get(i);e.beginPath(),e.moveTo(.5*s,0),e.lineTo(-.5*s,0),this.visuals.line.apply(e,i)}clip(e,i){}}s.TeeHeadView=g,g.__name__="TeeHeadView";class z extends v{constructor(e){super(e)}}s.TeeHead=z,_=z,z.__name__="TeeHead",_.prototype.default_view=g,_.mixins(p.LineVector)},
function _(e,t,n,i,s){var a;i();const r=e(1),c=e(50),o=e(54),_=r.__importStar(e(75)),u=r.__importStar(e(18));class l extends o.View{initialize(){super.initialize(),this.visuals=new _.Visuals(this)}request_render(){this.parent.request_render()}get canvas(){return this.parent.canvas}set_data(e,t){const n=this;for(const i of this.model){if(!(i instanceof u.VectorSpec||i instanceof u.ScalarSpec))continue;const s=i.uniform(e).select(t);n[`${i.attr}`]=s}}}n.MarkingView=l,l.__name__="MarkingView";class d extends c.Model{constructor(e){super(e)}}n.Marking=d,a=d,d.__name__="Marking",a.define((({})=>({})))},
function _(t,e,i,a,r){var o;a();const n=t(1),s=t(73),_=t(144),l=t(159),h=t(160),c=t(163),u=t(194),d=t(164),p=t(224),m=t(165),f=t(228),g=t(230),w=t(149),b=t(20),y=n.__importStar(t(78)),x=t(231),v=t(232),j=t(234),k=t(146),z=t(59),B=t(57),T=t(8),L=t(9);class S extends s.AnnotationView{get orientation(){return this._orientation}*children(){yield*super.children(),yield this._axis_view,yield this._title_view}initialize(){super.initialize();const{ticker:t,formatter:e}=this.model;this._ticker="auto"!=t?t:this._create_ticker(),this._formatter="auto"!=e?e:this._create_formatter(),this._major_range=this._create_major_range(),this._major_scale=this._create_major_scale(),this._minor_range=new g.Range1d({start:0,end:1}),this._minor_scale=new f.LinearScale,this._frame=new l.CartesianFrame(this._major_scale,this._minor_scale,this._major_range,this._minor_range),this._axis=this._create_axis(),this._apply_axis_properties(),this._title=new _.Title,this._apply_title_properties()}async lazy_initialize(){await super.lazy_initialize();const t=this,e={get parent(){return t.parent},get root(){return t.root},get frame(){return t._frame},get canvas_view(){return t.parent.canvas_view},request_layout(){t.layout.dirty=!0,t.parent.request_layout()},request_paint(){t.parent.request_paint(t)},request_render(){t.request_paint()},notify_finished_after_paint(){t.parent.notify_finished_after_paint()}};this._axis_view=await(0,z.build_view)(this._axis,{parent:e}),this._title_view=await(0,z.build_view)(this._title,{parent:e})}remove(){this._title_view.remove(),this._axis_view.remove(),super.remove()}_apply_axis_properties(){const t=Object.assign(Object.assign(Object.assign({ticker:this._ticker,formatter:this._formatter,major_label_standoff:this.model.label_standoff,axis_line_color:null,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_overrides:this.model.major_label_overrides,major_label_policy:this.model.major_label_policy},y.attrs_of(this.model,"major_label_",y.Text,!0)),y.attrs_of(this.model,"major_tick_",y.Line,!0)),y.attrs_of(this.model,"minor_tick_",y.Line,!0));this._axis.setv(t)}_apply_title_properties(){var t;const e=Object.assign({text:null!==(t=this.model.title)&&void 0!==t?t:"",standoff:this.model.title_standoff},y.attrs_of(this.model,"title_",y.Text,!1));this._title.setv(e)}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>{this._apply_title_properties(),this._apply_axis_properties()})),this.connect(this._ticker.change,(()=>this.request_render())),this.connect(this._formatter.change,(()=>this.request_render()))}_update_frame(){const[t,e,i,a]=(()=>"horizontal"==this.orientation?[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.in_x_scale=t,this._frame.in_y_scale=e,this._frame.x_range=i,this._frame.y_range=a,this._frame.configure_scales()}update_layout(){const{location:t,width:e,height:i,padding:a,margin:r}=this.model,[o,n]=(()=>{if(!(0,T.isString)(t))return["end","start"];switch(t){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"]}})(),s=this._orientation=(()=>{const{orientation:t}=this.model;return"auto"==t?null!=this.panel?this.panel.is_horizontal?"horizontal":"vertical":"start"==n||"end"==n||"center"==o?"vertical":"horizontal":t})();this._update_frame();const _=new v.NodeLayout,l=new v.VStack,h=new v.VStack,c=new v.HStack,u=new v.HStack;_.absolute=!0,l.absolute=!0,h.absolute=!0,c.absolute=!0,u.absolute=!0,_.on_resize((t=>this._frame.set_geometry(t)));const d=new j.BorderLayout;this._inner_layout=d,d.absolute=!0,d.center_panel=_,d.top_panel=l,d.bottom_panel=h,d.left_panel=c,d.right_panel=u;const p={left:a,right:a,top:a,bottom:a},m=(()=>{if(null==this.panel){if((0,T.isString)(t))return{left:r,right:r,top:r,bottom:r};{const[e,i]=t;return{left:e,right:r,top:r,bottom:i}}}if(!(0,T.isString)(t)){const[e,i]=t;return d.fixup_geometry=(t,a)=>{const r=t,o=this.layout.bbox,{width:n,height:s}=t;if(t=new B.BBox({left:o.left+e,bottom:o.bottom-i,width:n,height:s}),null!=a){const e=t.left-r.left,i=t.top-r.top,{left:o,top:n,width:s,height:_}=a;a=new B.BBox({left:o+e,top:n+i,width:s,height:_})}return[t,a]},{left:e,right:0,top:0,bottom:i}}d.fixup_geometry=(t,e)=>{const i=t;if("horizontal"==s){const{top:e,width:i,height:a}=t;if("end"==n){const{right:r}=this.layout.bbox;t=new B.BBox({right:r,top:e,width:i,height:a})}else if("center"==n){const{hcenter:r}=this.layout.bbox;t=new B.BBox({hcenter:Math.round(r),top:e,width:i,height:a})}}else{const{left:e,width:i,height:a}=t;if("end"==o){const{bottom:r}=this.layout.bbox;t=new B.BBox({left:e,bottom:r,width:i,height:a})}else if("center"==o){const{vcenter:r}=this.layout.bbox;t=new B.BBox({left:e,vcenter:Math.round(r),width:i,height:a})}}if(null!=e){const a=t.left-i.left,r=t.top-i.top,{left:o,top:n,width:s,height:_}=e;e=new B.BBox({left:o+a,top:n+r,width:s,height:_})}return[t,e]}})();let f,g,w,b;if(d.padding=p,null!=this.panel)f="max",g=void 0,w=void 0,b=void 0;else if("auto"==("horizontal"==s?e:i)){f="fixed";const t=this._get_major_size_factor();null!=t&&(g=25*t),w={percent:.3},b={percent:.8}}else f="fit",g=void 0;if("horizontal"==s){const t="auto"==e?void 0:e,a="auto"==i?25:i;d.set_sizing({width_policy:f,height_policy:"min",width:g,min_width:w,max_width:b,halign:n,valign:o,margin:m}),d.center_panel.set_sizing({width_policy:"auto"==e?"fit":"fixed",height_policy:"fixed",width:t,height:a})}else{const t="auto"==e?25:e,a="auto"==i?void 0:i;d.set_sizing({width_policy:"min",height_policy:f,height:g,min_height:w,max_height:b,halign:n,valign:o,margin:m}),d.center_panel.set_sizing({width_policy:"fixed",height_policy:"auto"==i?"fit":"fixed",width:t,height:a})}l.set_sizing({width_policy:"fit",height_policy:"min"}),h.set_sizing({width_policy:"fit",height_policy:"min"}),c.set_sizing({width_policy:"min",height_policy:"fit"}),u.set_sizing({width_policy:"min",height_policy:"fit"});const{_title_view:y}=this;"horizontal"==s?(y.panel=new k.Panel("above"),y.update_layout(),l.children.push(y.layout)):(y.panel=new k.Panel("left"),y.update_layout(),c.children.push(y.layout));const{panel:z}=this,L=null!=z&&s==z.orientation?z.side:"horizontal"==s?"below":"right",S=(()=>{switch(L){case"above":return l;case"below":return h;case"left":return c;case"right":return u}})(),{_axis_view:O}=this;if(O.panel=new k.Panel(L),O.update_layout(),null!=O.layout&&S.children.push(O.layout),null!=this.panel){const t=new x.Grid([{layout:d,row:0,col:0}]);t.absolute=!0,"horizontal"==s?t.set_sizing({width_policy:"max",height_policy:"min"}):t.set_sizing({width_policy:"min",height_policy:"max"}),this.layout=t}else this.layout=this._inner_layout;const{visible:q}=this.model;this.layout.sizing.visible=q}_create_axis(){return new h.LinearAxis}_create_formatter(){return new p.BasicTickFormatter}_create_major_range(){return new g.Range1d({start:0,end:1})}_create_major_scale(){return new f.LinearScale}_create_ticker(){return new u.BasicTicker}_get_major_size_factor(){return null}_render(){const{ctx:t}=this.layer;t.save(),this._paint_bbox(t,this._inner_layout.bbox),this._paint_colors(t,this._inner_layout.center_panel.bbox),this._title_view.render(),this._axis_view.render(),t.restore()}_paint_bbox(t,e){const{x:i,y:a}=e;let{width:r,height:o}=e;i+r>=this.parent.canvas_view.bbox.width&&(r-=1),a+o>=this.parent.canvas_view.bbox.height&&(o-=1),t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(i,a,r,o)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(i,a,r,o)),t.restore()}serializable_state(){const t=super.serializable_state(),{children:e=[]}=t,i=n.__rest(t,["children"]);return e.push(this._title_view.serializable_state()),e.push(this._axis_view.serializable_state()),Object.assign(Object.assign({},i),{children:e})}}i.BaseColorBarView=S,S.__name__="BaseColorBarView";class O extends s.Annotation{constructor(t){super(t)}}i.BaseColorBar=O,o=O,O.__name__="BaseColorBar",o.mixins([["major_label_",y.Text],["title_",y.Text],["major_tick_",y.Line],["minor_tick_",y.Line],["border_",y.Line],["bar_",y.Line],["background_",y.Fill]]),o.define((({Alpha:t,Number:e,String:i,Tuple:a,Map:r,Or:o,Ref:n,Auto:s,Nullable:_})=>({location:[o(b.Anchor,a(e,e)),"top_right"],orientation:[o(b.Orientation,s),"auto"],title:[_(o(i,n(w.BaseText))),null],title_standoff:[e,2],width:[o(e,s),"auto"],height:[o(e,s),"auto"],scale_alpha:[t,1],ticker:[o(n(c.Ticker),s),"auto"],formatter:[o(n(d.TickFormatter),s),"auto"],major_label_overrides:[r(o(i,e),o(i,n(w.BaseText))),new globalThis.Map,{convert:t=>(0,T.isPlainObject)(t)?new L.Dict(t):t}],major_label_policy:[n(m.LabelingPolicy),()=>new m.NoOverlap],label_standoff:[e,5],margin:[e,30],padding:[e,10],major_tick_in:[e,5],major_tick_out:[e,0],minor_tick_in:[e,0],minor_tick_out:[e,0]}))),o.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,a){var c;s();const o=e(145),r=e(20);class n extends o.TextAnnotationView{_get_position(){const e=this.model.offset,t=this.model.standoff/2,{align:i,vertical_align:s}=this.model;let a,c;const{bbox:o}=this.layout;switch(this.panel.side){case"above":case"below":switch(s){case"top":c=o.top+t;break;case"middle":c=o.vcenter;break;case"bottom":c=o.bottom-t}switch(i){case"left":a=o.left+e;break;case"center":a=o.hcenter;break;case"right":a=o.right-e}break;case"left":switch(s){case"top":a=o.left+t;break;case"middle":a=o.hcenter;break;case"bottom":a=o.right-t}switch(i){case"left":c=o.bottom-e;break;case"center":c=o.vcenter;break;case"right":c=o.top+e}break;case"right":switch(s){case"top":a=o.right-t;break;case"middle":a=o.hcenter;break;case"bottom":a=o.left+t}switch(i){case"left":c=o.top+e;break;case"center":c=o.vcenter;break;case"right":c=o.bottom-e}}return{sx:a,sy:c,x_anchor:i,y_anchor:"middle"==s?"center":s}}_render(){const e=this._get_position(),t=this.panel.get_label_angle_heuristic("parallel");this._paint(this.layer.ctx,e,t)}_get_size(){if(!this.displayed)return{width:0,height:0};const e=this._text_view.graphics();e.visuals=this.visuals.text.values();const{width:t,height:i}=e._size();return{width:t,height:0==i?0:2+i+this.model.standoff}}}i.TitleView=n,n.__name__="TitleView";class l extends o.TextAnnotation{constructor(e){super(e)}}i.Title=l,c=l,l.__name__="Title",c.prototype.default_view=n,c.define((({Number:e})=>({vertical_align:[r.VerticalAlign,"bottom"],align:[r.TextAlign,"left"],offset:[e,0],standoff:[e,10]}))),c.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1})},
function _(t,i,e,n,s){var a;n();const o=t(1),l=t(73),_=t(146),r=t(149),d=t(59),h=t(8),c=t(150),u=o.__importStar(t(78));class x extends l.AnnotationView{*children(){yield*super.children(),yield this._text_view}async lazy_initialize(){await super.lazy_initialize(),await this._init_text()}async _init_text(){const{text:t}=this.model,i=(0,h.isString)(t)?(0,c.parse_delimited_string)(t):t;this._text_view=await(0,d.build_view)(i,{parent:this})}update_layout(){const{panel:t}=this;this.layout=null!=t?new _.SideLayout(t,(()=>this.get_size()),!0):void 0}connect_signals(){super.connect_signals();const{text:t}=this.model.properties;this.on_change(t,(async()=>{this._text_view.remove(),await this._init_text()})),this.connect(this.model.change,(()=>this.request_render()))}remove(){this._text_view.remove(),super.remove()}has_finished(){return!!super.has_finished()&&!!this._text_view.has_finished()}get displayed(){return super.displayed&&""!=this._text_view.model.text&&this.visuals.text.doit}_paint(t,i,e){const n=this._text_view.graphics();n.angle=e,n.position=i,n.align="auto",n.visuals=this.visuals.text.values();const{background_fill:s,border_line:a}=this.visuals;if(s.doit||a.doit){const{p0:i,p1:e,p2:s,p3:a}=n.rect();t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(e.x,e.y),t.lineTo(s.x,s.y),t.lineTo(a.x,a.y),t.closePath(),this.visuals.background_fill.apply(t),this.visuals.border_line.apply(t)}this.visuals.text.doit&&n.paint(t)}}e.TextAnnotationView=x,x.__name__="TextAnnotationView";class p extends l.Annotation{constructor(t){super(t)}}e.TextAnnotation=p,a=p,p.__name__="TextAnnotation",a.mixins([u.Text,["border_",u.Line],["background_",u.Fill]]),a.define((({String:t,Or:i,Ref:e})=>({text:[i(t,e(r.BaseText)),""]}))),a.override({background_fill_color:null,border_line_color:null})},
function _(t,e,i,l,a){l();const r=t(147),o=t(148),n=t(8),s=Math.PI/2,h={above:{parallel:0,normal:-s,horizontal:0,vertical:-s},below:{parallel:0,normal:s,horizontal:0,vertical:s},left:{parallel:-s,normal:0,horizontal:0,vertical:-s},right:{parallel:s,normal:0,horizontal:0,vertical:s}},c={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"}},g={above:"right",below:"left",left:"right",right:"left"},b={above:"left",below:"right",left:"right",right:"left"};class f{constructor(t,e){this.side=t,this.face=(()=>{if(null!=e&&"auto"!=e)return e;switch(this.side){case"left":case"above":return"front";case"right":case"below":return"back"}})(),this.dimension="above"==this.side||"below"==this.side?0:1,this.orientation=0==this.dimension?"horizontal":"vertical",this.is_horizontal=0==this.dimension,this.is_vertical=1==this.dimension,this.normals=(()=>{const t="front"==this.face?-1:1;switch(this.side){case"left":case"right":return[t,0];case"above":case"below":return[0,t]}})()}get face_adjusted_side(){const{side:t,face:e}=this;switch(t){case"left":case"right":return"front"==e?"left":"right";case"above":case"below":return"front"==e?"above":"below"}}get_label_text_heuristics(t){const e=this.face_adjusted_side;return(0,n.isString)(t)?{vertical_align:c[e][t],align:_[e][t]}:{vertical_align:"center",align:(t<0?g:b)[e]}}get_label_angle_heuristic(t){if((0,n.isString)(t)){const e=this.face_adjusted_side;return h[e][t]}return-t}}i.Panel=f,f.__name__="Panel";class d extends o.ContentLayoutable{constructor(t,e,i=!1){super(),this.panel=t,this.get_size=e,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:t,height:e}=this.get_size();return!this.rotate||this.panel.is_horizontal?new r.Sizeable({width:t,height:e}):new r.Sizeable({width:e,height:t})}has_size_changed(){const{width:t,height:e}=this._content_size();return this.panel.is_horizontal?this.bbox.height!=e:this.bbox.width!=t}}i.SideLayout=d,d.__name__="SideLayout"},
function _(h,t,i,e,w){e();const n=h(21),{min:d,max:s}=Math;class g{constructor(h={}){this.width=null!=h.width?h.width:0,this.height=null!=h.height?h.height:0}bounded_to({width:h,height:t}){return new g({width:this.width==1/0&&null!=h?h:this.width,height:this.height==1/0&&null!=t?t:this.height})}expanded_to({width:h,height:t}){return new g({width:h!=1/0?s(this.width,h):this.width,height:t!=1/0?s(this.height,t):this.height})}expand_to({width:h,height:t}){this.width=s(this.width,h),this.height=s(this.height,t)}narrowed_to({width:h,height:t}){return new g({width:d(this.width,h),height:d(this.height,t)})}narrow_to({width:h,height:t}){this.width=d(this.width,h),this.height=d(this.height,t)}grow_by({left:h,right:t,top:i,bottom:e}){const w=this.width+h+t,n=this.height+i+e;return new g({width:w,height:n})}shrink_by({left:h,right:t,top:i,bottom:e}){const w=s(this.width-h-t,0),n=s(this.height-i-e,0);return new g({width:w,height:n})}map(h,t){return new g({width:h(this.width),height:(null!=t?t:h)(this.height)})}}i.Sizeable=g,g.__name__="Sizeable",i.SizingPolicy=(0,n.Enum)("fixed","fit","min","max")},
function _(i,t,e,h,s){h();const n=i(147),r=i(57),g=i(8),_=i(12),{abs:o,min:l,max:d,round:a}=Math;class u{constructor(){this.absolute=!1,this.position={left:0,top:0},this._bbox=new r.BBox,this._inner_bbox=new r.BBox,this._sizing=null,this._dirty=!1,this._handlers=[]}*[Symbol.iterator](){}get bbox(){return this._bbox}get inner_bbox(){return this._inner_bbox}get sizing(){return(0,_.assert)(null!=this._sizing),this._sizing}set dirty(i){this._dirty=i}get dirty(){return this._dirty}get visible(){return this.sizing.visible}set visible(i){this.sizing.visible!=i&&(this.sizing.visible=i,this._dirty=!0)}set_sizing(i={}){var t,e,h,s,n,r;const g=null!==(t=i.width_policy)&&void 0!==t?t:"fit",_=i.width,o=i.min_width,l=i.max_width,d=null!==(e=i.height_policy)&&void 0!==e?e:"fit",a=i.height,u=i.min_height,c=i.max_height,w=i.aspect,x=null!==(h=i.margin)&&void 0!==h?h:{top:0,right:0,bottom:0,left:0},b=null===(s=i.visible)||void 0===s||s,z=null!==(n=i.halign)&&void 0!==n?n:"start",m=null!==(r=i.valign)&&void 0!==r?r:"start";this._sizing={width_policy:g,min_width:o,width:_,max_width:l,height_policy:d,min_height:u,height:a,max_height:c,aspect:w,margin:x,visible:b,halign:z,valign:m,size:{width:_,height:a}},this._init()}_init(){}_set_geometry(i,t){this._bbox=i,this._inner_bbox=t}set_geometry(i,t){const{fixup_geometry:e}=this;null!=e&&([i,t]=e(i,t)),this._set_geometry(i,null!=t?t:i);for(const i of this._handlers)i(this._bbox,this._inner_bbox)}on_resize(i){this._handlers.push(i)}is_width_expanding(){return"max"==this.sizing.width_policy}is_height_expanding(){return"max"==this.sizing.height_policy}apply_aspect(i,{width:t,height:e}){const{aspect:h}=this.sizing;if(null!=h){const{width_policy:s,height_policy:n}=this.sizing,r=(i,t)=>{const e={max:4,fit:3,min:2,fixed:1};return e[i]>e[t]};if("fixed"!=s&&"fixed"!=n)if(s==n){const s=t,n=a(t/h),r=a(e*h),g=e;o(i.width-s)+o(i.height-n)<=o(i.width-r)+o(i.height-g)?(t=s,e=n):(t=r,e=g)}else r(s,n)?e=a(t/h):t=a(e*h);else"fixed"==s?e=a(t/h):"fixed"==n&&(t=a(e*h))}return{width:t,height:e}}measure(i){if(null==this._sizing&&this.set_sizing(),!this.sizing.visible)return{width:0,height:0};const t=i=>"fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:i,e=i=>"fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:i,h=new n.Sizeable(i).shrink_by(this.sizing.margin).map(t,e),s=this._measure(h),r=this.clip_size(s,h),g=t(r.width),_=e(r.height),o=this.apply_aspect(h,{width:g,height:_});return Object.assign(Object.assign({},s),o)}compute(i={}){const t=this.measure({width:null!=i.width&&this.is_width_expanding()?i.width:1/0,height:null!=i.height&&this.is_height_expanding()?i.height:1/0}),{width:e,height:h}=t,{left:s,top:n}=this.position,g=new r.BBox({left:s,top:n,width:e,height:h});let _;if(null!=t.inner){const{left:i,top:s,right:n,bottom:g}=t.inner;_=new r.BBox({left:i,top:s,right:e-n,bottom:h-g})}this.set_geometry(g,_)}get xview(){return this.bbox.xview}get yview(){return this.bbox.yview}clip_size(i,t){function e(i,t,e,h){return null==e?e=0:(0,g.isNumber)(e)||(e=a(e.percent*t)),null==h?h=1/0:(0,g.isNumber)(h)||(h=a(h.percent*t)),d(e,l(i,h))}return{width:e(i.width,t.width,this.sizing.min_width,this.sizing.max_width),height:e(i.height,t.height,this.sizing.min_height,this.sizing.max_height)}}has_size_changed(){const{_dirty:i}=this;return this._dirty=!1,i}}e.Layoutable=u,u.__name__="Layoutable";class c extends u{_measure(i){const t=this._content_size(),e=i.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 e.width;case"max":return d(t.width,e.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 e.height;case"max":return d(t.height,e.height)}})()}}}e.ContentLayoutable=c,c.__name__="ContentLayoutable";class w extends c{constructor(i){super(),this.text=i}_content_size(){return new n.Sizeable(this.text.size())}}e.TextLayout=w,w.__name__="TextLayout";class x extends c{constructor(i={}){super(),this.size=i}_content_size(){return new n.Sizeable(this.size)}}e.FixedLayout=x,x.__name__="FixedLayout"},
function _(e,s,t,n,a){var _;n();const x=e(50),c=e(54);class i extends c.View{}t.BaseTextView=i,i.__name__="BaseTextView";class o extends x.Model{constructor(e){super(e)}}t.BaseText=o,_=o,o.__name__="BaseText",_.define((({String:e})=>({text:[e]})))},
function _(n,e,t,i,o){i();const r=n(151),l=n(158),s=n(10),c=[{start:"$$",end:"$$",inline:!1},{start:"\\[",end:"\\]",inline:!1},{start:"\\(",end:"\\)",inline:!0}];function d(n){return n.split("").map((n=>`\\${n}`)).join("")}t.parse_delimited_string=function(n){const e=[];for(const t of c){const i=d(t.start),o=d(t.end),r=new RegExp(`${i}([^]*?)${o}`,"gm");for(const i of n.matchAll(r)){const{index:n}=i;if(null!=n){const[o,r]=i;e.push({index:n,outer:o,inner:r,delim:t})}}}if(e.length>0){if(1==e.length){const[t]=e,i=t.index,o=t.outer.length;if(0==i&&o==n.length){const n=t.inner;return new r.TeX({text:n,inline:t.delim.inline})}}let t="",i=0;for(const o of(0,s.sort_by)(e,(n=>n.index))){const e=o.index;i<=e&&(t+=0!=e?`\\text{${n.slice(i,e)}}${o.inner}`:`${o.inner}`,i=e+o.outer.length)}return t+=i<n.length?`\\text{${n.slice(i)}}`:"",new r.TeX({text:t,inline:!1})}return new l.PlainText({text:n})}},
function _(t,e,i,s,n){var h,o,r;s();const a=t(8),l=t(152),_=t(22),c=t(153),d=t(154),u=t(40),g=t(155),x=t(57),p=t(149),f=t(156);class m extends p.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(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}_rect(){const{width:t,height:e}=this._size(),{x:i,y:s}=this._computed_position();return new x.BBox({x:i,y:s,width:t,height:e}).rect}set position(t){this._position=t}get position(){return this._position}get text(){return this.model.text}get provider(){return f.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(t){const e=t.color,i=t.alpha,s=t.font_style;let n=t.font_size;const h=t.font,{font_size_scale:o,_base_font_size:r}=this,a=(0,d.parse_css_font_size)(n);if(null!=a){let{value:t,unit:e}=a;t*=o,"em"==e&&0!=r&&(t*=r,e="px"),n=`${t}${e}`}const l=`${s} ${n} ${h}`;this.font=l,this.color=(0,_.color2css)(e,i);const c=t.align;this._x_anchor=c;const u=t.baseline;this._y_anchor=(()=>{switch(u){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}_computed_position(){const{width:t,height:e}=this._size(),{sx:i,sy:s,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position,o=(0,d.font_metrics)(this.font);return{x:i-(()=>{if((0,a.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:s-(()=>{if((0,a.isNumber)(h))return h*e;switch(h){case"top":return o.height>e?e-(-this.valign-o.descent)-o.height:0;case"center":case"baseline":return.5*e;case"bottom":return o.height>e?e+o.descent+this.valign:e}})()}}size(){const{width:t,height:e}=this._size(),{angle:i}=this;if(null==i||0==i)return{width:t,height:e};{const s=Math.cos(Math.abs(i)),n=Math.sin(Math.abs(i));return{width:Math.abs(t*s+e*n),height:Math.abs(t*n+e*s)}}}get_image_dimensions(){var t;const e=(0,d.font_metrics)(this.font),i=null===(t=this.svg_element.getAttribute("style"))||void 0===t?void 0:t.split(";");if(null!=i){const t=new Map;i.forEach((e=>{const[i,s]=e.split(":");""!=i.trim()&&t.set(i.trim(),s.trim())}));const s=(0,d.parse_css_length)(t.get("vertical-align"));"ex"==(null==s?void 0:s.unit)?this.valign=s.value*e.x_height:"px"==(null==s?void 0:s.unit)&&(this.valign=s.value)}const s=(()=>{const t=this.svg_element.getAttribute("width"),e=this.svg_element.getAttribute("height");return{width:null!=t&&t.endsWith("ex")?parseFloat(t):1,height:null!=e&&e.endsWith("ex")?parseFloat(e):1}})();return{width:e.x_height*s.width,height:e.x_height*s.height}}get truncated_text(){return this.model.text.length>6?`${this.model.text.substring(0,6)}...`:this.model.text}_size(){var t,e;if(null==this.svg_image)return"failed"==this.provider.status||"not_started"==this.provider.status?{width:(0,c.text_width)(this.truncated_text,this.font),height:(0,d.font_metrics)(this.font).height}:{width:this._base_font_size,height:this._base_font_size};const i=(0,d.font_metrics)(this.font);let{width:s,height:n}=this.get_image_dimensions();n=Math.max(n,i.height);return{width:s*("%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1),height:n*("%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1)}}bbox(){const{p0:t,p1:e,p2:i,p3:s}=this.rect(),n=Math.min(t.x,e.x,i.x,s.x),h=Math.min(t.y,e.y,i.y,s.y),o=Math.max(t.x,e.x,i.x,s.x),r=Math.max(t.y,e.y,i.y,s.y);return new x.BBox({left:n,right:o,top:h,bottom:r})}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:i,sy:s}=this.position,n=new g.AffineTransform;return n.translate(i,s),n.rotate(e),n.translate(-i,-s),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:i,p2:s,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:i,width:s,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(i)),t.lineTo(h(e),h(i+n)),t.lineTo(h(e+s),h(i+n)),t.lineTo(h(e+s),h(i)),t.closePath(),t.stroke(),t.restore()}async load_image(){if(null==this.provider.MathJax)return null;const t=this._process_text();if(null==t)return this._has_finished=!0,null;const e=t.children[0];this.svg_element=e,e.setAttribute("font",this.font),e.setAttribute("stroke",this.color);const i=e.outerHTML,s=`data:image/svg+xml;utf-8,${encodeURIComponent(i)}`;return this.svg_image=await(0,l.load_image)(s),this.parent.request_layout(),this.svg_image}paint(t){null==this.svg_image&&("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&this.load_image()),t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();if(null!=this.svg_image){const{width:e,height:i}=this.get_image_dimensions();t.drawImage(this.svg_image,n,h,e,i)}else"failed"!=this.provider.status&&"not_started"!=this.provider.status||(t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.truncated_text,n,h+(0,d.font_metrics)(this.font).ascent));t.restore(),this._has_finished||"failed"!=this.provider.status&&null==this.svg_image||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}i.MathTextView=m,m.__name__="MathTextView";class v extends p.BaseText{constructor(t){super(t)}}i.MathText=v,v.__name__="MathText";class y extends m{get styled_text(){return this.text}_process_text(){}_size(){return{width:(0,c.text_width)(this.text,this.font),height:(0,d.font_metrics)(this.font).height}}paint(t){t.save();const{sx:e,sy:i}=this.position,{angle:s}=this;null!=s&&0!=s&&(t.translate(e,i),t.rotate(s),t.translate(-e,-i));const{x:n,y:h}=this._computed_position();t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.text,n,h+(0,d.font_metrics)(this.font).ascent),t.restore(),this._has_finished=!0,this.parent.notify_finished_after_paint()}}i.AsciiView=y,y.__name__="AsciiView";class b extends v{constructor(t){super(t)}}i.Ascii=b,h=b,b.__name__="Ascii",h.prototype.default_view=y;class w extends m{get styled_text(){let t=this.text.trim(),e=t.match(/<math(.*?[^?])?>/s);return null==e?this.text.trim():(t=(0,u.insert_text_on_position)(t,t.indexOf(e[0])+e[0].length,`<mstyle displaystyle="true" mathcolor="${(0,_.color2hexrgb)(this.color)}" ${this.font.includes("bold")?'mathvariant="bold"':""}>`),e=t.match(/<\/[^>]*?math.*?>/s),null==e?this.text.trim():(0,u.insert_text_on_position)(t,t.indexOf(e[0]),"</mstyle>"))}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.mathml2svg(this.styled_text,{em:this.base_font_size,ex:e.x_height})}}i.MathMLView=w,w.__name__="MathMLView";class M extends v{constructor(t){super(t)}}i.MathML=M,o=M,M.__name__="MathML",o.prototype.default_view=w;class z extends m{get styled_text(){const[t,e,i]=(0,_.color2rgba)(this.color);return`\\color[RGB]{${t}, ${e}, ${i}} ${this.font.includes("bold")?`\\pmb{${this.text}}`:this.text}`}_process_text(){var t;const e=(0,d.font_metrics)(this.font);return null===(t=this.provider.MathJax)||void 0===t?void 0:t.tex2svg(this.styled_text,{display:!this.model.inline,em:this.base_font_size,ex:e.x_height},this.model.macros)}}i.TeXView=z,z.__name__="TeXView";class T extends v{constructor(t){super(t)}}i.TeX=T,r=T,T.__name__="TeX",r.prototype.default_view=z,r.define((({Boolean:t,Number:e,String:i,Dict:s,Tuple:n,Or:h})=>({macros:[s(h(i,n(i,e))),{}],inline:[t,!1]})))},
function _(i,e,t,s,n){s();const a=i(19);t.load_image=async function(i,e){return new o(i,e).promise};class o{constructor(i,e={}){this.image=new Image,this._finished=!1;const{attempts:t=1,timeout:s=1}=e,n=(()=>{if(i instanceof ArrayBuffer){const e=new Blob([i],{type:"image/png"});return URL.createObjectURL(e)}return i})();this.promise=new Promise(((i,o)=>{this.image.crossOrigin="anonymous";let r=0;this.image.onerror=()=>{if(++r==t){const i=`unable to load ${n} image after ${t} attempts`;if(a.logger.warn(i),null==this.image.crossOrigin)return void(null!=e.failed&&e.failed());a.logger.warn(`attempting to load ${n} without a cross origin policy`),this.image.crossOrigin=null,r=0}setTimeout((()=>this.image.src=n),s)},this.image.onload=()=>{this._finished=!0,null!=e.loaded&&e.loaded(this.image),i(this.image)},this.image.src=n}))}get finished(){return this._finished}}t.ImageLoader=o,o.__name__="ImageLoader"},
function _(t,e,s,i,n){i();const h=t(57),o=t(154),a=t(10),r=t(8),c=t(155),_=t(22);s.text_width=(()=>{const t=document.createElement("canvas").getContext("2d");let e="";return(s,i)=>(i!=e&&(e=i,t.font=i),t.measureText(s).width)})();class l{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(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}set position(t){this._position=t}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:t,p1:e,p2:s,p3:i}=this.rect(),n=Math.min(t.x,e.x,s.x,i.x),o=Math.min(t.y,e.y,s.y,i.y),a=Math.max(t.x,e.x,s.x,i.x),r=Math.max(t.y,e.y,s.y,i.y);return new h.BBox({left:n,right:a,top:o,bottom:r})}size(){const{width:t,height:e}=this._size(),{angle:s}=this;if(null==s||0==s)return{width:t,height:e};{const i=Math.cos(Math.abs(s)),n=Math.sin(Math.abs(s));return{width:Math.abs(t*i+e*n),height:Math.abs(t*n+e*i)}}}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:s,sy:i}=this.position,n=new c.AffineTransform;return n.translate(s,i),n.rotate(e),n.translate(-s,-i),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:s,p2:i,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:s,width:i,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(s)),t.lineTo(h(e),h(s+n)),t.lineTo(h(e+i),h(s+n)),t.lineTo(h(e+i),h(s)),t.closePath(),t.stroke(),t.restore()}}s.GraphicsBox=l,l.__name__="GraphicsBox";class u extends l{set visuals(t){const e=t.color,s=t.alpha,i=t.outline_color,n=t.font_style;let h=t.font_size;const a=t.font,{font_size_scale:r,base_font_size:c}=this,l=(0,o.parse_css_font_size)(h);if(null!=l){let{value:t,unit:e}=l;t*=r,"em"==e&&0!=c&&(t*=c,e="px"),h=`${t}${e}`}const u=`${n} ${h} ${a}`;this.font=u,this.color=(0,_.color2css)(e,s),this.outline_color=(0,_.color2css)(i,s),this.line_height=t.line_height;const x=t.align;this._visual_align=x,this._x_anchor=x;const p=t.baseline;this._y_anchor=(()=>{switch(p){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}constructor({text:t}){super(),this._visual_align="left",this.text=t}infer_text_height(){if(this.text.includes("\n"))return"ascent_descent";{function t(t){for(const e of new Set(t))if(!("0"<=e&&e<="9"))switch(e){case",":case".":case"+":case"-":case"\u2212":case"e":continue;default:return!1}return!0}return t(this.text)?"cap":"ascent_descent"}}_text_line(t){var e;const s=null!==(e=this.text_height_metric)&&void 0!==e?e:this.infer_text_height(),i=(()=>{switch(s){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}})(),n=(()=>{switch(s){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return t.descent}})();return{height:i+n,ascent:i,descent:n}}get nlines(){return this.text.split("\n").length}_size(){var t,e;const{font:i}=this,n=(0,o.font_metrics)(i),h=(this.line_height-1)*n.height,r=""==this.text,c=this.text.split("\n"),_=c.length,l=c.map((t=>(0,s.text_width)(t,i))),u=this._text_line(n).height*_,x="%"==(null===(t=this.width)||void 0===t?void 0:t.unit)?this.width.value:1,p="%"==(null===(e=this.height)||void 0===e?void 0:e.unit)?this.height.value:1;return{width:(0,a.max)(l)*x,height:r?0:(u+h*(_-1))*p,metrics:n}}_computed_position(t,e,s){const{width:i,height:n}=t,{sx:h,sy:o,x_anchor:a=this._x_anchor,y_anchor:c=this._y_anchor}=this.position;return{x:h-(()=>{if((0,r.isNumber)(a))return a*i;switch(a){case"left":return 0;case"center":return.5*i;case"right":return i}})(),y:o-(()=>{var t;if((0,r.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":return.5*n;case"bottom":return n;case"baseline":if(1!=s)return.5*n;switch(null!==(t=this.text_height_metric)&&void 0!==t?t:this.infer_text_height()){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}}})()}}_rect(){const{width:t,height:e,metrics:s}=this._size(),i=this.text.split("\n").length,{x:n,y:o}=this._computed_position({width:t,height:e},s,i);return new h.BBox({x:n,y:o,width:t,height:e}).rect}paint(t){var e,i;const{font:n}=this,h=(0,o.font_metrics)(n),r=(this.line_height-1)*h.height,c=this.text.split("\n"),_=c.length,l=c.map((t=>(0,s.text_width)(t,n))),u=this._text_line(h),x=u.height*_,p="%"==(null===(e=this.width)||void 0===e?void 0:e.unit)?this.width.value:1,f="%"==(null===(i=this.height)||void 0===i?void 0:i.unit)?this.height.value:1,g=(0,a.max)(l)*p,d=(x+r*(_-1))*f;t.save(),t.fillStyle=this.color,t.strokeStyle=this.outline_color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic";const{sx:b,sy:m}=this.position,{align:y}=this,{angle:w}=this;null!=w&&0!=w&&(t.translate(b,m),t.rotate(w),t.translate(-b,-m));let{x:v,y:z}=this._computed_position({width:g,height:d},h,_);if("justify"==y)for(let e=0;e<_;e++){let i=v;const h=c[e].split(" "),o=h.length,_=h.map((t=>(0,s.text_width)(t,n))),l=(g-(0,a.sum)(_))/(o-1);for(let e=0;e<o;e++)t.fillText(h[e],i,z),t.strokeText(h[e],i,z),i+=_[e]+l;z+=u.height+r}else for(let e=0;e<_;e++){const s=v+(()=>{switch("auto"==y?this._visual_align:y){case"left":return 0;case"center":return.5*(g-l[e]);case"right":return g-l[e]}})(),i=c[e],n=z+u.ascent;t.fillText(i,s,n),t.strokeText(i,s,n),z+=u.height+r}t.restore()}}s.TextBox=u,u.__name__="TextBox";class x extends l{constructor(t,e){super(),this.base=t,this.expo=e}get children(){return[this.base,this.expo]}set base_font_size(t){super.base_font_size=t,this.base.base_font_size=t,this.expo.base_font_size=t}set position(t){this._position=t;const e=this.base.size(),s=this.expo.size(),i=this._shift_scale()*e.height,n=Math.max(e.height,i+s.height);this.base.position={sx:0,x_anchor:"left",sy:n,y_anchor:"bottom"},this.expo.position={sx:e.width,x_anchor:"left",sy:i,y_anchor:"bottom"}}get position(){return this._position}set visuals(t){this.expo.font_size_scale=.7,this.base.visuals=t,this.expo.visuals=t}_shift_scale(){if(this.base instanceof u&&1==this.base.nlines){const{x_height:t,cap_height:e}=(0,o.font_metrics)(this.base.font);return t/e}return 2/3}infer_text_height(){return this.base.infer_text_height()}_rect(){const t=this.base.bbox(),e=this.expo.bbox(),s=t.union(e),{x:i,y:n}=this._computed_position();return s.translate(i,n).rect}_size(){const t=this.base.size(),e=this.expo.size();return{width:t.width+e.width,height:Math.max(t.height,this._shift_scale()*t.height+e.height)}}paint(t){t.save();const{angle:e}=this;if(null!=e&&0!=e){const{sx:s,sy:i}=this.position;t.translate(s,i),t.rotate(e),t.translate(-s,-i)}const{x:s,y:i}=this._computed_position();t.translate(s,i),this.base.paint(t),this.expo.paint(t),t.restore()}paint_bbox(t){super.paint_bbox(t);const{x:e,y:s}=this._computed_position();t.save(),t.translate(e,s);for(const e of this.children)e.paint_bbox(t);t.restore()}_computed_position(){const{width:t,height:e}=this._size(),{sx:s,sy:i,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position;return{x:s-(()=>{if((0,r.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:i-(()=>{if((0,r.isNumber)(h))return h*e;switch(h){case"top":return 0;case"center":case"baseline":return.5*e;case"bottom":return e}})()}}}s.BaseExpo=x,x.__name__="BaseExpo";class p{constructor(t){this.items=t}set base_font_size(t){for(const e of this.items)e.base_font_size=t}get length(){return this.items.length}set visuals(t){for(const e of this.items)e.visuals=t;const e={x:0,cap:1,ascent:2,x_descent:3,cap_descent:4,ascent_descent:5},s=(0,a.max_by)(this.items.map((t=>t.infer_text_height())),(t=>e[t]));for(const t of this.items)t.text_height_metric=s}set angle(t){for(const e of this.items)e.angle=t}max_size(){let t=0,e=0;for(const s of this.items){const i=s.size();t=Math.max(t,i.width),e=Math.max(e,i.height)}return{width:t,height:e}}}s.GraphicsBoxes=p,p.__name__="GraphicsBoxes"},
function _(t,e,n,c,s){c();const a=t(12),o=t(8),r=(()=>{try{return"undefined"!=typeof OffscreenCanvas&&null!=new OffscreenCanvas(0,0).getContext("2d")}catch(t){return!1}})()?(t,e)=>new OffscreenCanvas(t,e):(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},i=(()=>{const t=r(0,0).getContext("2d");return(0,a.assert)(null!=t,"can't obtain 2d context"),e=>{t.font=e;const n=t.measureText("M"),c=t.measureText("x"),s=t.measureText("\xc5\u015ag|"),r=s.fontBoundingBoxAscent,i=s.fontBoundingBoxDescent;if((0,o.is_defined)(r)&&(0,o.is_defined)(i))return{height:r+i,ascent:r,descent:i,cap_height:n.actualBoundingBoxAscent,x_height:c.actualBoundingBoxAscent};const u=s.actualBoundingBoxAscent,l=s.actualBoundingBoxDescent;if((0,o.is_defined)(u)&&(0,o.is_defined)(l))return{height:u+l,ascent:u,descent:l,cap_height:n.actualBoundingBoxAscent,x_height:c.actualBoundingBoxAscent};(0,a.unreachable)()}})(),u=(()=>{const t=document.createElement("canvas"),e=t.getContext("2d");let n=-1,c=-1;return(s,a=1)=>{e.font=s;const{width:o}=e.measureText("M"),r=o*a,i=Math.ceil(r),u=Math.ceil(2*r),l=Math.ceil(1.5*r);n<i&&(n=i,t.width=i),c<u&&(c=u,t.height=u),e.save(),e.scale(a,a),e.fillStyle="#f00",e.fillRect(0,0,i,u);const f=t=>{let e=0;for(let n=0;n<=l;n++)for(let c=0;c<i;c++,e+=4)if(255!=t[e])return l-n;return 0};e.font=s,e.fillStyle="#000";for(const t of"xa")e.fillText(t,0,l/a);const{data:d}=e.getImageData(0,0,i,u),h=f(d)/a;for(const t of"ASQ")e.fillText(t,0,l/a);const{data:g}=e.getImageData(0,0,i,u),x=f(g)/a;for(const t of"\xc5\u015agy")e.fillText(t,0,l/a);const{data:m}=e.getImageData(0,0,i,u),_=f(m)/a,B=(t=>{let e=t.length-4;for(let n=u;n>=l;n--)for(let c=0;c<i;c++,e-=4)if(255!=t[e])return n-l;return 0})(m)/a;return e.restore(),{height:_+B,ascent:_,cap_height:x,x_height:h,descent:B}}})(),l=(()=>{try{return i("normal 10px sans-serif"),i}catch(t){return u}})(),f=new Map;n.font_metrics=function(t){let e=f.get(t);if(null==e){const n=document.fonts.check(t);e={font:l(t)},n&&f.set(t,e)}return e.font},n.parse_css_font_size=function(t){const e=t.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=e){const[,t,,n]=e,c=Number(t);if(isFinite(c))return{value:c,unit:n}}return null},n.parse_css_length=function(t){const e=t.match(/^\s*(-?\d+(\.\d+)?)(\w+)\s*$/);if(null!=e){const[,t,,n]=e,c=Number(t);if(isFinite(c))return{value:c,unit:n}}return null}},
function _(t,s,r,e,i){e();const n=t(26),{sin:a,cos:h}=Math;class o{constructor(t=1,s=0,r=0,e=1,i=0,n=0){this.a=t,this.b=s,this.c=r,this.d=e,this.e=i,this.f=n}toString(){const{a:t,b:s,c:r,d:e,e:i,f:n}=this;return`matrix(${t}, ${s}, ${r}, ${e}, ${i}, ${n})`}static from_DOMMatrix(t){const{a:s,b:r,c:e,d:i,e:n,f:a}=t;return new o(s,r,e,i,n,a)}to_DOMMatrix(){const{a:t,b:s,c:r,d:e,e:i,f:n}=this;return new DOMMatrix([t,s,r,e,i,n])}clone(){const{a:t,b:s,c:r,d:e,e:i,f:n}=this;return new o(t,s,r,e,i,n)}[n.equals](t,s){return s.eq(this.a,t.a)&&s.eq(this.b,t.b)&&s.eq(this.c,t.c)&&s.eq(this.d,t.d)&&s.eq(this.e,t.e)&&s.eq(this.f,t.f)}reset(){this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0}get is_identity(){const{a:t,b:s,c:r,d:e,e:i,f:n}=this;return 1==t&&0==s&&0==r&&1==e&&0==i&&0==n}apply_point(t){const[s,r]=this.apply(t.x,t.y);return{x:s,y:r}}apply_rect(t){return{p0:this.apply_point(t.p0),p1:this.apply_point(t.p1),p2:this.apply_point(t.p2),p3:this.apply_point(t.p3)}}apply(t,s){const{a:r,b:e,c:i,d:n,e:a,f:h}=this;return[r*t+i*s+a,e*t+n*s+h]}iv_apply(t,s){const{a:r,b:e,c:i,d:n,e:a,f:h}=this,o=t.length;for(let c=0;c<o;c++){const o=t[c],p=s[c];t[c]=r*o+i*p+a,s[c]=e*o+n*p+h}}transform(t,s,r,e,i,n){const{a,b:h,c:o,d:c,e:p,f}=this;return this.a=a*t+o*s,this.c=a*r+o*e,this.e=a*i+o*n+p,this.b=h*t+c*s,this.d=h*r+c*e,this.f=h*i+c*n+f,this}translate(t,s){return this.transform(1,0,0,1,t,s)}scale(t,s){return this.transform(t,0,0,s,0,0)}skew(t,s){return this.transform(1,s,t,1,0,0)}rotate(t){if(0==t)return this;const s=a(t),r=h(t);return this.transform(r,s,-s,r,0,0)}rotate_ccw(t){return this.rotate(-t)}rotate_around(t,s,r){return this.translate(t,s),this.rotate(r),this.translate(-t,-s),this}translate_x(t){return this.translate(t,0)}translate_y(t){return this.translate(0,t)}flip(){return this.scale(-1,-1)}flip_x(){return this.scale(1,-1)}flip_y(){return this.scale(-1,1)}}r.AffineTransform=o,o.__name__="AffineTransform",r.rotate_around=function(t,s,r){if(0==r)return t;{const e=new o;e.rotate_around(s.x,s.y,r);const[i,n]=e.apply(t.x,t.y);return{x:i,y:n}}}},
function _(t,e,a,r,s){var n=this&&this.__createBinding||(Object.create?function(t,e,a,r){void 0===r&&(r=a);var s=Object.getOwnPropertyDescriptor(e,a);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,s)}:function(t,e,a,r){void 0===r&&(r=a),t[r]=e[a]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)"default"!==a&&Object.prototype.hasOwnProperty.call(t,a)&&n(e,t,a);return i(e,t),e};r();const d=t(15),u=t(157);class c{constructor(){this.ready=new d.Signal0(this,"ready"),this.status="not_started"}}a.MathJaxProvider=c,c.__name__="MathJaxProvider";class l extends c{get MathJax(){return null}async fetch(){this.status="failed"}}a.NoProvider=l,l.__name__="NoProvider";class h extends c{get MathJax(){return"undefined"!=typeof MathJax?MathJax:null}async fetch(){const t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js",t.onload=()=>{this.status="loaded",this.ready.emit()},t.onerror=()=>{this.status="failed"},this.status="loading",document.head.appendChild(t)}}a.CDNProvider=h,h.__name__="CDNProvider";class _ extends c{get MathJax(){return this._mathjax}async fetch(){this.status="loading";try{const e=await(0,u.load_module)(Promise.resolve().then((()=>o(t(677)))));this._mathjax=e,this.status="loaded",this.ready.emit()}catch(t){this.status="failed"}}}a.BundleProvider=_,_.__name__="BundleProvider",a.default_provider=new _},
function _(n,r,o,t,c){t(),o.load_module=async function(n){try{return await n}catch(n){if((r=n)instanceof Error&&"code"in r&&"MODULE_NOT_FOUND"===n.code)return null;throw n}var r}},
function _(e,t,i,n,s){var a;n();const x=e(149),_=e(153);class l extends x.BaseTextView{initialize(){super.initialize(),this._has_finished=!0}graphics(){return new _.TextBox({text:this.model.text})}}i.PlainTextView=l,l.__name__="PlainTextView";class r extends x.BaseText{constructor(e){super(e)}}i.PlainText=r,a=r,r.__name__="PlainText",a.prototype.default_view=l},
function _(e,s,t,a,_){a();const r=e(93),n=e(92),i=e(88),g=e(95),c=e(98),h=e(57),l=e(9),o=e(12),u=e(15);class x{get bbox(){return this._bbox}constructor(e,s,t,a,_={},r={},n={},i={}){this._bbox=new h.BBox,this.change=new u.Signal0(this,"change"),this.in_x_scale=e,this.in_y_scale=s,this.x_range=t,this.y_range=a,this.extra_x_ranges=_,this.extra_y_ranges=r,this.extra_x_scales=n,this.extra_y_scales=i,(0,o.assert)(e.properties.source_range.is_unset&&e.properties.target_range.is_unset),(0,o.assert)(s.properties.source_range.is_unset&&s.properties.target_range.is_unset),this._configure_scales()}_get_ranges(e,s){return new Map((0,l.entries)(Object.assign(Object.assign({},s),{default:e})))}_get_scales(e,s,t,a){var _;const i=new Map((0,l.entries)(Object.assign(Object.assign({},s),{default:e}))),h=new Map;for(const[s,l]of t){if(l instanceof c.FactorRange!=e instanceof r.CategoricalScale)throw new Error(`Range ${l.type} is incompatible is Scale ${e.type}`);e instanceof n.LogScale&&l instanceof g.DataRange1d&&(l.scale_hint="log");const t=(null!==(_=i.get(s))&&void 0!==_?_:e).clone();t.setv({source_range:l,target_range:a}),h.set(s,t)}return h}_configure_frame_ranges(){const{bbox:e}=this;this._x_target=new i.Range1d({start:e.left,end:e.right}),this._y_target=new i.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)}configure_scales(){this._configure_scales(),this.change.emit()}_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 ranges(){return new Set([...this.x_ranges.values(),...this.y_ranges.values()])}get x_scales(){return this._x_scales}get y_scales(){return this._y_scales}get scales(){return new Set([...this.x_scales.values(),...this.y_scales.values()])}get x_scale(){return this._x_scales.get("default")}get y_scale(){return this._y_scales.get("default")}}t.CartesianFrame=x,x.__name__="CartesianFrame"},
function _(i,s,x,A,o){A(),o("Axis",i(161).Axis),o("CategoricalAxis",i(166).CategoricalAxis),o("ContinuousAxis",i(169).ContinuousAxis),o("DatetimeAxis",i(170).DatetimeAxis),o("LinearAxis",i(186).LinearAxis),o("LogAxis",i(188).LogAxis),o("MercatorAxis",i(191).MercatorAxis)},
function _(t,e,i,s,a){var n;s();const o=t(1),l=t(162),r=t(163),_=t(164),h=t(165),c=o.__importStar(t(78)),d=t(20),u=t(24),b=t(146),m=t(10),f=t(9),g=t(8),x=t(153),p=t(98),v=t(149),w=t(59),j=t(12),k=t(8),y=t(57),z=t(150),{abs:M}=Math;class O extends l.GuideRendererView{constructor(){super(...arguments),this._axis_label_view=null,this._major_label_views=new Map}get panel(){return this._panel}set panel(t){this._panel=new b.Panel(t.side,this.model.face)}get bbox(){if(null!=this.layout&&null==this.model.fixed_location)return this.layout.bbox;if(this.is_renderable){const{extents:t}=this,e=Math.round(t.tick+t.tick_label+t.axis_label);let{sx0:i,sy0:s,sx1:a,sy1:n}=this.rule_scoords;const{dimension:o,face:l}=this;return 0==o?"front"==l?s-=e:n+=e:"front"==l?i-=e:a+=e,y.BBox.from_lrtb({left:i,top:s,right:a,bottom:n})}return new y.BBox}*children(){yield*super.children(),null!=this._axis_label_view&&(yield this._axis_label_view),yield*this._major_label_views.values()}async lazy_initialize(){await super.lazy_initialize(),await this._init_axis_label(),await this._init_major_labels()}async _init_axis_label(){const{axis_label:t}=this.model;if(null!=t){const e=(0,k.isString)(t)?(0,z.parse_delimited_string)(t):t;this._axis_label_view=await(0,w.build_view)(e,{parent:this})}else this._axis_label_view=null}async _init_major_labels(){for(const[t,e]of this.model.major_label_overrides){const i=(0,k.isString)(e)?(0,z.parse_delimited_string)(e):e;this._major_label_views.set(t,await(0,w.build_view)(i,{parent:this}))}}update_layout(){this.layout=new b.SideLayout(this.panel,(()=>this.get_size()),!0),this.layout.on_resize((()=>this._coordinates=void 0))}get_size(){const{visible:t,fixed_location:e}=this.model;if(t&&null==e&&this.is_renderable){const{extents:t}=this;return{width:0,height:Math.round(t.tick+t.tick_label+t.axis_label)}}return{width:0,height:0}}get is_renderable(){const[t,e]=this.ranges;return t.is_valid&&e.is_valid&&t.span>0&&e.span>0}_render(){var t;if(!this.is_renderable)return;const{tick_coords:e,extents:i}=this,s=this.layer.ctx;s.save(),this._draw_background(s,i),this._draw_rule(s,i),this._draw_major_ticks(s,i,e),this._draw_minor_ticks(s,i,e),this._draw_major_labels(s,i,e),this._draw_axis_label(s,i,e),null===(t=this._paint)||void 0===t||t.call(this,s,i,e),s.restore()}connect_signals(){super.connect_signals();const{axis_label:t,major_label_overrides:e}=this.model.properties;this.on_change(t,(async()=>{var t;null===(t=this._axis_label_view)||void 0===t||t.remove(),await this._init_axis_label()})),this.on_change(e,(async()=>{for(const t of this._major_label_views.values())t.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_background(t,e){if(!this.visuals.background_fill.doit)return;t.beginPath();const{x:i,y:s,width:a,height:n}=this.bbox;t.rect(i,s,a,n),this.visuals.background_fill.apply(t)}_draw_rule(t,e){if(!this.visuals.axis_line.doit)return;const{sx0:i,sy0:s,sx1:a,sy1:n}=this.rule_scoords;t.beginPath(),t.moveTo(i,s),t.lineTo(a,n),this.visuals.axis_line.apply(t)}_draw_major_ticks(t,e,i){const s=this.model.major_tick_in,a=this.model.major_tick_out,n=this.visuals.major_tick_line;this._draw_ticks(t,i.major,s,a,n)}_draw_minor_ticks(t,e,i){const s=this.model.minor_tick_in,a=this.model.minor_tick_out,n=this.visuals.minor_tick_line;this._draw_ticks(t,i.minor,s,a,n)}_draw_major_labels(t,e,i){const s=i.major,a=this.compute_labels(s[this.dimension]),n=this.model.major_label_orientation,o=e.tick+this.model.major_label_standoff,l=this.visuals.major_label_text;this._draw_oriented_labels(t,a,s,n,o,l)}_axis_label_extent(){if(null==this._axis_label_view)return 0;const t=this._axis_label_view.graphics(),e=this.model.axis_label_orientation;t.visuals=this.visuals.axis_label_text.values(),t.angle=this.panel.get_label_angle_heuristic(e),t.base_font_size=this.plot_view.base_font_size;const i=t.size(),s=0==this.dimension?i.height:i.width,a=this.model.axis_label_standoff;return s>0?a+s+3:0}_draw_axis_label(t,e,i){if(null==this._axis_label_view)return;const[s,a]=(()=>{const{bbox:t}=this,{side:e,face:i}=this.panel,[s]=this.ranges,{axis_label_align:a}=this.model;switch(e){case"above":case"below":{const[e,n]=(()=>{switch(a){case"start":return s.is_reversed?[t.right,"right"]:[t.left,"left"];case"center":return[t.hcenter,"center"];case"end":return s.is_reversed?[t.left,"left"]:[t.right,"right"]}})(),[o,l]="front"==i?[t.bottom,"bottom"]:[t.top,"top"];return[e,o,n,l]}case"left":case"right":{const[e,n]=(()=>{switch(a){case"start":return s.is_reversed?[t.top,"top"]:[t.bottom,"bottom"];case"center":return[t.vcenter,"center"];case"end":return s.is_reversed?[t.bottom,"bottom"]:[t.top,"top"]}})(),[o,l]="front"==i?[t.right,"right"]:[t.left,"left"];return[o,e,l,n]}}})(),[n,o]=this.normals,l=this.model.axis_label_orientation,r=e.tick+e.tick_label+this.model.axis_label_standoff,{vertical_align:_,align:h}=this.panel.get_label_text_heuristics(l),c={sx:s+n*r,sy:a+o*r,x_anchor:h,y_anchor:_},d=this._axis_label_view.graphics();d.visuals=this.visuals.axis_label_text.values(),d.angle=this.panel.get_label_angle_heuristic(l),d.base_font_size=this.plot_view.base_font_size,d.position=c,d.align=h,d.paint(t)}_draw_ticks(t,e,i,s,a){if(!a.doit)return;const[n,o]=this.scoords(e),[l,r]=this.normals,[_,h]=this.offsets,[c,d]=[l*(_-i),r*(h-i)],[u,b]=[l*(_+s),r*(h+s)];a.set_value(t),t.beginPath();for(let e=0;e<n.length;e++){const i=Math.round(n[e]+u),s=Math.round(o[e]+b),a=Math.round(n[e]+c),l=Math.round(o[e]+d);t.moveTo(i,s),t.lineTo(a,l)}t.stroke()}_draw_oriented_labels(t,e,i,s,a,n){if(!n.doit||0==e.length)return;const[o,l]=this.scoords(i),[r,_]=this.offsets,[h,c]=this.normals,d=h*(r+a),b=c*(_+a),{vertical_align:m,align:f}=this.panel.get_label_text_heuristics(s),g=this.panel.get_label_angle_heuristic(s);e.visuals=n.values(),e.angle=g,e.base_font_size=this.plot_view.base_font_size;for(let t=0;t<e.length;t++){const i=e.items[t];i.position={sx:o[t]+d,sy:l[t]+b,x_anchor:f,y_anchor:m},i instanceof x.TextBox&&(i.align=f)}const p=e.length,v=u.Indices.all_set(p),{items:w}=e,j=w.map((t=>t.bbox())),k=(()=>{const[t]=this.ranges;return t.is_reversed?0==this.dimension?(t,e)=>j[t].left-j[e].right:(t,e)=>j[e].top-j[t].bottom:0==this.dimension?(t,e)=>j[e].left-j[t].right:(t,e)=>j[t].top-j[e].bottom})(),{major_label_policy:y}=this.model,z=y.filter(v,j,k),M=[...z.ones()];if(0!=M.length){const t=this.canvas.bbox,e=e=>{const i=j[e];if(i.left<0){const t=-i.left,{position:s}=w[e];w[e].position=Object.assign(Object.assign({},s),{sx:s.sx+t})}else if(i.right>t.width){const s=i.right-t.width,{position:a}=w[e];w[e].position=Object.assign(Object.assign({},a),{sx:a.sx-s})}},i=e=>{const i=j[e];if(i.top<0){const t=-i.top,{position:s}=w[e];w[e].position=Object.assign(Object.assign({},s),{sy:s.sy+t})}else if(i.bottom>t.height){const s=i.bottom-t.height,{position:a}=w[e];w[e].position=Object.assign(Object.assign({},a),{sy:a.sy-s})}},s=M[0],a=M[M.length-1];0==this.dimension?(e(s),e(a)):(i(s),i(a))}for(const e of z){w[e].paint(t)}}_tick_extent(){const{major:t,minor:e}=this.tick_coords,i=this.dimension;return Math.max(0==t[i].length?0:this.model.major_tick_out,0==e[i].length?0:this.model.minor_tick_out)}_tick_label_extents(){const t=this.tick_coords.major,e=this.compute_labels(t[this.dimension]),i=this.model.major_label_orientation,s=this.model.major_label_standoff,a=this.visuals.major_label_text;return[this._oriented_labels_extent(e,i,s,a)]}get extents(){const t=this._tick_label_extents();return{tick:this._tick_extent(),tick_labels:t,tick_label:(0,m.sum)(t),axis_label:this._axis_label_extent()}}_oriented_labels_extent(t,e,i,s){if(0==t.length||!s.doit)return 0;const a=this.panel.get_label_angle_heuristic(e);t.visuals=s.values(),t.angle=a,t.base_font_size=this.plot_view.base_font_size;const n=t.max_size(),o=0==this.dimension?n.height:n.width;return o>0?i+o+3:0}get normals(){return this.panel.normals}get dimension(){return this.panel.dimension}compute_labels(t){const e=this.model.formatter.format_graphics(t,this),{_major_label_views:i}=this,s=new Set;for(let a=0;a<t.length;a++){const n=i.get(t[a]);null!=n&&(s.add(n),e[a]=n.graphics())}for(const t of this._major_label_views.values())s.has(t)||(t._has_finished=!0);return new x.GraphicsBoxes(e)}scoords(t){const[e,i]=t,[s,a]=this.coordinates.map_to_screen(e,i);if(null!=this.model.fixed_location)return[[...s],[...a]];{const{bbox:t}=this,{face:e}=this.panel;if(this.panel.is_vertical){const i="front"==e?t.right:t.left;return[(0,m.repeat)(i,s.length),[...a]]}{const i="front"==e?t.bottom:t.top;return[[...s],(0,m.repeat)(i,a.length)]}}}get offsets(){return[0,0]}get ranges(){const t=this.dimension,e=1-t,{ranges:i}=this.coordinates;return[i[t],i[e]]}get computed_bounds(){const[t]=this.ranges,e=this.model.bounds,i=[t.min,t.max];if("auto"==e)return[t.min,t.max];{let t,s;const[a,n]=e,[o,l]=i,{min:r,max:_}=Math;return M(a-n)>M(o-l)?(t=_(r(a,n),o),s=r(_(a,n),l)):(t=r(a,n),s=_(a,n)),[t,s]}}get rule_coords(){const t=this.dimension,e=1-t,[i]=this.ranges,[s,a]=this.computed_bounds,n=[new Array(2),new Array(2)];return n[t][0]=Math.max(s,i.min),n[t][1]=Math.min(a,i.max),n[t][0]>n[t][1]&&(n[t][0]=n[t][1]=NaN),n[e][0]=this.loc,n[e][1]=this.loc,n}get rule_scoords(){const[[t,e],[i,s]]=this.scoords(this.rule_coords);return{sx0:Math.round(t),sy0:Math.round(i),sx1:Math.round(e),sy1:Math.round(s)}}get tick_coords(){const t=this.dimension,e=1-t,[i]=this.ranges,[s,a]=this.computed_bounds,n=this.model.ticker.get_ticks(s,a,i,this.loc),o=n.major,l=n.minor,r=[[],[]],_=[[],[]],[h,c]=[i.min,i.max];for(let i=0;i<o.length;i++)o[i]<h||o[i]>c||(r[t].push(o[i]),r[e].push(this.loc));for(let i=0;i<l.length;i++)l[i]<h||l[i]>c||(_[t].push(l[i]),_[e].push(this.loc));return{major:r,minor:_}}get loc(){const{fixed_location:t}=this.model;if(null!=t){if((0,g.isNumber)(t))return t;const[,e]=this.ranges;if(e instanceof p.FactorRange)return e.synthetic(t);(0,j.unreachable)()}const[,e]=this.ranges;switch(this.panel.side){case"left":case"below":return e.start;case"right":case"above":return e.end}}get face(){return this.panel.face}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.bbox})}remove(){var t;null===(t=this._axis_label_view)||void 0===t||t.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 t of this._major_label_views.values())if(!t.has_finished())return!1;return!0}}i.AxisView=O,O.__name__="AxisView";class T extends l.GuideRenderer{constructor(t){super(t)}}i.Axis=T,n=T,T.__name__="Axis",n.prototype.default_view=O,n.mixins([["axis_",c.Line],["major_tick_",c.Line],["minor_tick_",c.Line],["major_label_",c.Text],["axis_label_",c.Text],["background_",c.Fill]]),n.define((({Any:t,Int:e,Number:i,String:s,Ref:a,Map:n,Tuple:o,Or:l,Nullable:c,Auto:u,Enum:b})=>({dimension:[l(b(0,1),u),"auto"],face:[l(d.Face,u),"auto"],bounds:[l(o(i,i),u),"auto"],ticker:[a(r.Ticker)],formatter:[a(_.TickFormatter)],axis_label:[c(l(s,a(v.BaseText))),null],axis_label_standoff:[e,5],axis_label_orientation:[l(d.LabelOrientation,i),"parallel"],axis_label_align:[d.Align,"center"],major_label_standoff:[e,5],major_label_orientation:[l(d.LabelOrientation,i),"horizontal"],major_label_overrides:[n(l(s,i),l(s,a(v.BaseText))),new globalThis.Map,{convert:t=>(0,g.isPlainObject)(t)?new f.Dict(t):t}],major_label_policy:[a(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:[c(l(i,t)),null]}))),n.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",background_fill_color:null})},
function _(e,r,d,n,i){var s;n();const _=e(74);class u extends _.RendererView{}d.GuideRendererView=u,u.__name__="GuideRendererView";class c extends _.Renderer{constructor(e){super(e)}}d.GuideRenderer=c,s=c,c.__name__="GuideRenderer",s.override({level:"guide"})},
function _(c,e,n,s,o){s();const r=c(50);class t extends r.Model{constructor(c){super(c)}}n.Ticker=t,t.__name__="Ticker"},
function _(t,o,r,e,c){e();const n=t(50),a=t(153);class m extends n.Model{constructor(t){super(t)}format_graphics(t,o){return this.doFormat(t,o).map((t=>new a.TextBox({text:t})))}compute(t,o){return this.doFormat([t],null!=o?o:{loc:0})[0]}v_compute(t,o){return this.doFormat(t,null!=o?o:{loc:0})}}r.TickFormatter=m,m.__name__="TickFormatter"},
function _(e,n,s,t,i){var l,r;t();const c=e(50),o=e(9),a=e(40),u=e(8),d=e(24);class _ extends c.Model{constructor(e){super(e)}}s.LabelingPolicy=_,_.__name__="LabelingPolicy";class f extends _{constructor(e){super(e)}filter(e,n,s){return e}}s.AllLabels=f,f.__name__="AllLabels";class v extends _{constructor(e){super(e)}filter(e,n,s){const{min_distance:t}=this;let i=null;for(const n of e)null!=i&&s(i,n)<t?e.unset(n):i=n;return e}}s.NoOverlap=v,l=v,v.__name__="NoOverlap",l.define((({Number:e})=>({min_distance:[e,5]})));class m extends _{constructor(e){super(e)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}get func(){const e=(0,a.use_strict)(this.code);return new d.GeneratorFunction("indices","bboxes","distance",...this.names,e)}filter(e,n,s){var t,i;const l=Object.create(null),r=this.func.call(l,e,n,s,...this.values);let c=r.next();if(null!==(t=c.done)&&void 0!==t&&t&&void 0!==c.value){const{value:n}=c;return n instanceof d.Indices?n:void 0===n?e:(0,u.isIterable)(n)?d.Indices.from_indices(e.size,n):d.Indices.all_unset(e.size)}{const n=[];do{n.push(c.value),c=r.next()}while(null===(i=c.done)||void 0===i||!i);return d.Indices.from_indices(e.size,n)}}}s.CustomLabelingPolicy=m,r=m,m.__name__="CustomLabelingPolicy",r.define((({Unknown:e,String:n,Dict:s})=>({args:[s(e),{}],code:[n,""]})))},
function _(t,s,o,e,i){var r;e();const a=t(1),l=t(161),_=t(167),n=t(168),p=a.__importStar(t(78)),c=t(20),h=t(153),m=t(8);class u extends l.AxisView{_paint(t,s,o){this._draw_group_separators(t,s,o)}_draw_group_separators(t,s,o){const[e]=this.ranges,[i,r]=this.computed_bounds;if(null==e.tops||e.tops.length<2||!this.visuals.separator_line.doit)return;const a=this.dimension,l=1-a,_=[[],[]];let n=0;for(let t=0;t<e.tops.length-1;t++){let s,o;for(let i=n;i<e.factors.length;i++)if(e.factors[i][0]==e.tops[t+1]){[s,o]=[e.factors[i-1],e.factors[i]],n=i;break}const p=(e.synthetic(s)+e.synthetic(o))/2;p>i&&p<r&&(_[a].push(p),_[l].push(this.loc))}const p=this.extents.tick_label;this._draw_ticks(t,_,-3,p-6,this.visuals.separator_line)}_draw_major_labels(t,s,o){const e=this._get_factor_info();let i=s.tick+this.model.major_label_standoff;for(let o=0;o<e.length;o++){const[r,a,l,_]=e[o];this._draw_oriented_labels(t,r,a,l,i,_),i+=s.tick_labels[o]}}_tick_label_extents(){const t=this._get_factor_info(),s=[];for(const[o,,e,i]of t){const t=this._oriented_labels_extent(o,e,this.model.major_label_standoff,i);s.push(t)}return s}_get_factor_info(){const[t]=this.ranges,[s,o]=this.computed_bounds,e=this.loc,i=this.model.ticker.get_ticks(s,o,t,e),r=this.tick_coords,a=[],l=t=>new h.GraphicsBoxes(t.map((t=>(0,m.isString)(t)?new h.TextBox({text:t}):t))),_=t=>l(this.model.formatter.doFormat(t,this));if(1==t.levels){const t=_(i.major);a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text])}else if(2==t.levels){const t=_(i.major.map((t=>t[1])));a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([l(i.tops),r.tops,this.model.group_label_orientation,this.visuals.group_text])}else if(3==t.levels){const t=_(i.major.map((t=>t[2]))),s=i.mids.map((t=>t[1]));a.push([t,r.major,this.model.major_label_orientation,this.visuals.major_label_text]),a.push([l(s),r.mids,this.model.subgroup_label_orientation,this.visuals.subgroup_text]),a.push([l(i.tops),r.tops,this.model.group_label_orientation,this.visuals.group_text])}return a}get tick_coords(){const t=this.dimension,s=1-t,[o]=this.ranges,[e,i]=this.computed_bounds,r=this.model.ticker.get_ticks(e,i,o,this.loc),a={major:[[],[]],mids:[[],[]],tops:[[],[]],minor:[[],[]]};return a.major[t]=r.major,a.major[s]=r.major.map((()=>this.loc)),3==o.levels&&(a.mids[t]=r.mids,a.mids[s]=r.mids.map((()=>this.loc))),o.levels>1&&(a.tops[t]=r.tops,a.tops[s]=r.tops.map((()=>this.loc))),a}}o.CategoricalAxisView=u,u.__name__="CategoricalAxisView";class d extends l.Axis{constructor(t){super(t)}}o.CategoricalAxis=d,r=d,d.__name__="CategoricalAxis",r.prototype.default_view=u,r.mixins([["separator_",p.Line],["group_",p.Text],["subgroup_",p.Text]]),r.define((({Number:t,Or:s})=>({group_label_orientation:[s(c.LabelOrientation,t),"parallel"],subgroup_label_orientation:[s(c.LabelOrientation,t),"parallel"]}))),r.override({ticker:()=>new _.CategoricalTicker,formatter:()=>new n.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 _(t,c,o,s,e){s();const r=t(163);class i extends r.Ticker{constructor(t){super(t)}get_ticks(t,c,o,s){var e,r;return{major:this._collect(o.factors,o,t,c),minor:[],tops:this._collect(null!==(e=o.tops)&&void 0!==e?e:[],o,t,c),mids:this._collect(null!==(r=o.mids)&&void 0!==r?r:[],o,t,c)}}_collect(t,c,o,s){const e=[];for(const r of t){const t=c.synthetic(r);t>o&&t<s&&e.push(r)}return e}}o.CategoricalTicker=i,i.__name__="CategoricalTicker"},
function _(t,r,o,c,a){c();const e=t(164),n=t(10);class i extends e.TickFormatter{constructor(t){super(t)}doFormat(t,r){return(0,n.copy)(t)}}o.CategoricalTickFormatter=i,i.__name__="CategoricalTickFormatter"},
function _(s,n,i,o,u){o();const e=s(161);class t extends e.AxisView{}i.ContinuousAxisView=t,t.__name__="ContinuousAxisView";class _ extends e.Axis{constructor(s){super(s)}}i.ContinuousAxis=_,_.__name__="ContinuousAxis"},
function _(e,t,i,s,a){var n;s();const o=e(169),r=e(171),m=e(177);class _ extends o.ContinuousAxisView{}i.DatetimeAxisView=_,_.__name__="DatetimeAxisView";class c extends o.ContinuousAxis{constructor(e){super(e)}}i.DatetimeAxis=c,n=c,c.__name__="DatetimeAxis",n.prototype.default_view=_,n.override({ticker:()=>new m.DatetimeTicker,formatter:()=>new r.DatetimeTickFormatter})},
function _(t,e,o,n,r){var s;n();const i=t(1),c=t(20),_=t(34),u=t(172),l=t(8),m=t(164),a=t(176),d=i.__importDefault(t(175));o.resolution_order=["microseconds","milliseconds","seconds","minsec","minutes","hourmin","hours","days","months","years"],o.tm_index_for_resolution=new Map;for(const t of o.resolution_order)o.tm_index_for_resolution.set(t,0);function h(t,e){const o=1.1*t*1e3,n=1e3*e;return o<a.ONE_MILLI?"microseconds":o<a.ONE_SECOND?"milliseconds":o<a.ONE_MINUTE?n>=a.ONE_MINUTE?"minsec":"seconds":o<a.ONE_HOUR?n>=a.ONE_HOUR?"hourmin":"minutes":o<a.ONE_DAY?"hours":o<a.ONE_MONTH?"days":o<a.ONE_YEAR?"months":"years"}function f(t){return(0,d.default)(t,"%Y %m %d %H %M %S").split(/\s+/).map((t=>parseInt(t,10)))}function x(t,e){const o=(0,u.sprintf)("$1%06d",N(t));return-1==(e=e.replace(/((^|[^%])(%%)*)%f/,o)).indexOf("%")?e:(0,d.default)(t,e)}function N(t){return Math.round(t/1e3%1*1e6)}o.tm_index_for_resolution.set("seconds",5),o.tm_index_for_resolution.set("minsec",4),o.tm_index_for_resolution.set("minutes",4),o.tm_index_for_resolution.set("hourmin",3),o.tm_index_for_resolution.set("hours",3),o._get_resolution=h,o._mktime=f,o._strftime=x,o._us=N;class O extends m.TickFormatter{constructor(t){super(t)}doFormat(t,e,o){if(0==t.length)return[];const n=Math.abs(t[t.length-1]-t[0])/1e3,r=n/(t.length-1),s=(0,l.is_undefined)(o)?h(r,n):o,i=[];for(const[e,o]of(0,_.enumerate)(t)){const n=this._compute_label(e,s),r=this._add_context(e,n,o,t.length,s);i.push(r)}return i}_compute_label(t,e){const n=x(t,this[e]),r=f(t),s=o.resolution_order.indexOf(e);let i,c=n,_=!1,u=s;for(;0==r[o.tm_index_for_resolution.get(o.resolution_order[u])]&&(u+=1,u!=o.resolution_order.length);){if(("minsec"==e||"hourmin"==e)&&!_){if("minsec"==e&&0==r[4]&&0!=r[5]||"hourmin"==e&&0==r[3]&&0!=r[4]){i=o.resolution_order[s-1],c=x(t,this[i]);break}_=!0}i=o.resolution_order[u],c=x(t,this[i])}if(this.strip_leading_zeros){const t=c.replace(/^0+/g,"");return t!=c&&isNaN(parseInt(t))?`0${t}`:t}return c}_add_context(t,e,o,n,r){const s=this.context_location,i=this.context_which;if(null==this.context)return e;if("start"==i&&0==o||"end"==i&&o==n-1||"center"==i&&o==Math.floor(n/2)||"all"==i){const o=(0,l.isString)(this.context)?x(t,this.context):this.context.doFormat([t],{loc:0},r)[0];if(""==o)return e;switch(s){case"above":return`${o}\n${e}`;case"below":return`${e}\n${o}`;case"left":return`${o} ${e}`;case"right":return`${e} ${o}`}}return e}}o.DatetimeTickFormatter=O,s=O,O.__name__="DatetimeTickFormatter",s.define((({Boolean:t,Nullable:e,Or:o,Ref:n,String:r})=>({microseconds:[r,"%fus"],milliseconds:[r,"%3Nms"],seconds:[r,"%Ss"],minsec:[r,":%M:%S"],minutes:[r,":%M"],hourmin:[r,"%H:%M"],hours:[r,"%Hh"],days:[r,"%m/%d"],months:[r,"%m/%Y"],years:[r,"%Y"],strip_leading_zeros:[t,!0],context:[e(o(r,n(s))),null],context_which:[c.ContextWhich,"start"],context_location:[c.Location,"below"]})))},
function _(r,n,t,e,i){e();const u=r(1),l=u.__importStar(r(173)),a=r(174),f=u.__importDefault(r(175)),o=r(21),s=r(30),c=r(8);function m(r,...n){return(0,a.sprintf)(r,...n)}function p(r,n,t){if((0,c.isNumber)(r)){return m((()=>{switch(!1){case Math.floor(r)!=r:return"%d";case!(Math.abs(r)>.1&&Math.abs(r)<1e3):return"%0.3f";default:return"%0.3e"}})(),r)}return`${r}`}function _(r,n,e){if(null==n)return p;if(null!=e&&r in e){const n=e[r];if((0,c.isString)(n)){if(n in t.DEFAULT_FORMATTERS)return t.DEFAULT_FORMATTERS[n];throw new Error(`Unknown tooltip field formatter type '${n}'`)}return function(r,t,e){return n.format(r,t,e)}}return t.DEFAULT_FORMATTERS.numeral}function d(r,n,t){const e=n.get_column(r);if(null==e)return null;if(null==t)return null;if((0,c.isNumber)(t))return e[t];const i=e[t.index];if((0,c.isTypedArray)(i)||(0,c.isArray)(i)){if((0,c.isArray)(i[0])){return i[t.j][t.i]}return(0,s.is_NDArray)(i)&&3==i.dimension?i.slice(t.flat_index*i.shape[2],(t.flat_index+1)*i.shape[2]):i[t.flat_index]}return i}function g(r,n,t,e){if("$"==r[0]){return function(r,n){if(r in n)return n[r];throw new Error(`Unknown special variable '$${r}'`)}(r.substring(1),e)}return d(r.substring(1).replace(/[{}]/g,""),n,t)}t.FormatterType=(0,o.Enum)("numeral","printf","datetime"),t.DEFAULT_FORMATTERS={numeral:(r,n,t)=>l.format(r,n),datetime:(r,n,t)=>(0,f.default)(r,n),printf:(r,n,t)=>m(n,r)},t.sprintf=m,t.basic_formatter=p,t.get_formatter=_,t._get_column_value=d,t.get_value=g,t.replace_placeholders=function(r,n,t,e,i={},u){let l,a;if((0,c.isString)(r)?(l=r,a=!1):(l=r.html,a=!0),l=l.replace(/@\$name/g,(r=>`@{${i.name}}`)),l=l.replace(/((?:\$\w+)|(?:@\w+)|(?:@{(?:[^{}]+)}))(?:{([^{}]+)})?/g,((r,l,f)=>{const o=g(l,n,t,i);if(null==o)return null!=u?u("???"):"???";if("safe"==f)return a=!0,`${o}`;const s=`${_(l,f,e)(o,f,i)}`;return null!=u?u(s):s})),a){return[...(new DOMParser).parseFromString(l,"text/html").body.childNodes]}return l},t.process_placeholders=function(r,n){return r.replace(/((?:\$\w+)|(?:@\w+)|(?:@{(?:[^{}]+)}))(?:{([^{}]+)})?/g,((r,t,e)=>{const i=t[0],u=t.substring(1).replace(/[{}]/g,"").trim();return n(i,u,e)}))}},
function _(e,n,t,r,i){
/*!
* numbro.js
* version : 1.6.2
* author : Företagsplatsen AB
* license : MIT
* http://www.foretagsplatsen.se
*/
var a,o={},l=o,u="en-US",c=null,s="0,0";void 0!==n&&n.exports;function f(e){this._value=e}function d(e){var n,t="";for(n=0;n<e;n++)t+="0";return t}function h(e,n,t,r){var i,a,o=Math.pow(10,n);return a=e.toFixed(0).search("e")>-1?function(e,n){var t,r,i,a;return t=(a=e.toString()).split("e")[0],i=a.split("e")[1],a=t.split(".")[0]+(r=t.split(".")[1]||"")+d(i-r.length),n>0&&(a+="."+d(n)),a}(e,n):(t(e*o)/o).toFixed(n),r&&(i=new RegExp("0{1,"+r+"}$"),a=a.replace(i,"")),a}function p(e,n,t){var r;return r=n.indexOf("$")>-1?function(e,n,t){var r,i,a=n,l=a.indexOf("$"),c=a.indexOf("("),s=a.indexOf("+"),f=a.indexOf("-"),d="",h="";-1===a.indexOf("$")?"infix"===o[u].currency.position?(h=o[u].currency.symbol,o[u].currency.spaceSeparated&&(h=" "+h+" ")):o[u].currency.spaceSeparated&&(d=" "):a.indexOf(" $")>-1?(d=" ",a=a.replace(" $","")):a.indexOf("$ ")>-1?(d=" ",a=a.replace("$ ","")):a=a.replace("$","");if(i=m(e,a,t,h),-1===n.indexOf("$"))switch(o[u].currency.position){case"postfix":i.indexOf(")")>-1?((i=i.split("")).splice(-1,0,d+o[u].currency.symbol),i=i.join("")):i=i+d+o[u].currency.symbol;break;case"infix":break;case"prefix":i.indexOf("(")>-1||i.indexOf("-")>-1?(i=i.split(""),r=Math.max(c,f)+1,i.splice(r,0,o[u].currency.symbol+d),i=i.join("")):i=o[u].currency.symbol+d+i;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else l<=1?i.indexOf("(")>-1||i.indexOf("+")>-1||i.indexOf("-")>-1?(r=1,(l<c||l<s||l<f)&&(r=0),(i=i.split("")).splice(r,0,o[u].currency.symbol+d),i=i.join("")):i=o[u].currency.symbol+d+i:i.indexOf(")")>-1?((i=i.split("")).splice(-1,0,d+o[u].currency.symbol),i=i.join("")):i=i+d+o[u].currency.symbol;return i}(e,n,t):n.indexOf("%")>-1?function(e,n,t){var r,i="";e*=100,n.indexOf(" %")>-1?(i=" ",n=n.replace(" %","")):n=n.replace("%","");r=m(e,n,t),r.indexOf(")")>-1?((r=r.split("")).splice(-1,0,i+"%"),r=r.join("")):r=r+i+"%";return r}(e,n,t):n.indexOf(":")>-1?function(e){var n=Math.floor(e/60/60),t=Math.floor((e-60*n*60)/60),r=Math.round(e-60*n*60-60*t);return n+":"+(t<10?"0"+t:t)+":"+(r<10?"0"+r:r)}(e):m(e,n,t),r}function m(e,n,t,r){var i,a,l,s,f,d,p,m,x,g,O,b,w,y,M,v,$,B=!1,E=!1,F=!1,k="",U=!1,N=!1,S=!1,j=!1,D=!1,C="",L="",T=Math.abs(e),K=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],G=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],I="",P=!1,R=!1;if(0===e&&null!==c)return c;if(!isFinite(e))return""+e;if(0===n.indexOf("{")){var W=n.indexOf("}");if(-1===W)throw Error('Format should also contain a "}"');b=n.slice(1,W),n=n.slice(W+1)}else b="";if(n.indexOf("}")===n.length-1){var Y=n.indexOf("{");if(-1===Y)throw Error('Format should also contain a "{"');w=n.slice(Y+1,-1),n=n.slice(0,Y+1)}else w="";if(v=null===($=-1===n.indexOf(".")?n.match(/([0-9]+).*/):n.match(/([0-9]+)\..*/))?-1:$[1].length,-1!==n.indexOf("-")&&(P=!0),n.indexOf("(")>-1?(B=!0,n=n.slice(1,-1)):n.indexOf("+")>-1&&(E=!0,n=n.replace(/\+/g,"")),n.indexOf("a")>-1){if(g=n.split(".")[0].match(/[0-9]+/g)||["0"],g=parseInt(g[0],10),U=n.indexOf("aK")>=0,N=n.indexOf("aM")>=0,S=n.indexOf("aB")>=0,j=n.indexOf("aT")>=0,D=U||N||S||j,n.indexOf(" a")>-1?(k=" ",n=n.replace(" a","")):n=n.replace("a",""),p=0===(p=(f=Math.floor(Math.log(T)/Math.LN10)+1)%3)?3:p,g&&0!==T&&(d=Math.floor(Math.log(T)/Math.LN10)+1-g,m=3*~~((Math.min(g,f)-p)/3),T/=Math.pow(10,m),-1===n.indexOf(".")&&g>3))for(n+="[.]",M=(M=0===d?0:3*~~(d/3)-d)<0?M+3:M,i=0;i<M;i++)n+="0";Math.floor(Math.log(Math.abs(e))/Math.LN10)+1!==g&&(T>=Math.pow(10,12)&&!D||j?(k+=o[u].abbreviations.trillion,e/=Math.pow(10,12)):T<Math.pow(10,12)&&T>=Math.pow(10,9)&&!D||S?(k+=o[u].abbreviations.billion,e/=Math.pow(10,9)):T<Math.pow(10,9)&&T>=Math.pow(10,6)&&!D||N?(k+=o[u].abbreviations.million,e/=Math.pow(10,6)):(T<Math.pow(10,6)&&T>=Math.pow(10,3)&&!D||U)&&(k+=o[u].abbreviations.thousand,e/=Math.pow(10,3)))}if(n.indexOf("b")>-1)for(n.indexOf(" b")>-1?(C=" ",n=n.replace(" b","")):n=n.replace("b",""),s=0;s<=K.length;s++)if(a=Math.pow(1024,s),l=Math.pow(1024,s+1),e>=a&&e<l){C+=K[s],a>0&&(e/=a);break}if(n.indexOf("d")>-1)for(n.indexOf(" d")>-1?(C=" ",n=n.replace(" d","")):n=n.replace("d",""),s=0;s<=G.length;s++)if(a=Math.pow(1e3,s),l=Math.pow(1e3,s+1),e>=a&&e<l){C+=G[s],a>0&&(e/=a);break}if(n.indexOf("o")>-1&&(n.indexOf(" o")>-1?(L=" ",n=n.replace(" o","")):n=n.replace("o",""),o[u].ordinal&&(L+=o[u].ordinal(e))),n.indexOf("[.]")>-1&&(F=!0,n=n.replace("[.]",".")),x=e.toString().split(".")[0],O=n.split(".")[1],y=n.indexOf(","),O){if(x=(I=-1!==O.indexOf("*")?h(e,e.toString().split(".")[1].length,t):O.indexOf("[")>-1?h(e,(O=(O=O.replace("]","")).split("["))[0].length+O[1].length,t,O[1].length):h(e,O.length,t)).split(".")[0],I.split(".")[1].length)I=(r?k+r:o[u].delimiters.decimal)+I.split(".")[1];else I="";F&&0===Number(I.slice(1))&&(I="")}else x=h(e,null,t);return x.indexOf("-")>-1&&(x=x.slice(1),R=!0),x.length<v&&(x=new Array(v-x.length+1).join("0")+x),y>-1&&(x=x.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+o[u].delimiters.thousands)),0===n.indexOf(".")&&(x=""),b+(n.indexOf("(")<n.indexOf("-")?(B&&R?"(":"")+(P&&R||!B&&R?"-":""):(P&&R||!B&&R?"-":"")+(B&&R?"(":""))+(!R&&E&&0!==e?"+":"")+x+I+(L||"")+(k&&!r?k:"")+(C||"")+(B&&R?")":"")+w}function x(e,n){o[e]=n}function g(e){u=e;var n=o[e].defaults;n&&n.format&&a.defaultFormat(n.format),n&&n.currencyFormat&&a.defaultCurrencyFormat(n.currencyFormat)}(a=function(e){return a.isNumbro(e)?e=e.value():0===e||void 0===e?e=0:Number(e)||(e=a.fn.unformat(e)),new f(Number(e))}).version="1.6.2",a.isNumbro=function(e){return e instanceof f},a.setLanguage=function(e,n){console.warn("`setLanguage` is deprecated since version 1.6.0. Use `setCulture` instead");var t=e,r=e.split("-")[0],i=null;l[t]||(Object.keys(l).forEach((function(e){i||e.split("-")[0]!==r||(i=e)})),t=i||n||"en-US"),g(t)},a.setCulture=function(e,n){var t=e,r=e.split("-")[1],i=null;o[t]||(r&&Object.keys(o).forEach((function(e){i||e.split("-")[1]!==r||(i=e)})),t=i||n||"en-US"),g(t)},a.language=function(e,n){if(console.warn("`language` is deprecated since version 1.6.0. Use `culture` instead"),!e)return u;if(e&&!n){if(!l[e])throw new Error("Unknown language : "+e);g(e)}return!n&&l[e]||x(e,n),a},a.culture=function(e,n){if(!e)return u;if(e&&!n){if(!o[e])throw new Error("Unknown culture : "+e);g(e)}return!n&&o[e]||x(e,n),a},a.languageData=function(e){if(console.warn("`languageData` is deprecated since version 1.6.0. Use `cultureData` instead"),!e)return l[u];if(!l[e])throw new Error("Unknown language : "+e);return l[e]},a.cultureData=function(e){if(!e)return o[u];if(!o[e])throw new Error("Unknown culture : "+e);return o[e]},a.culture("en-US",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var n=e%10;return 1==~~(e%100/10)?"th":1===n?"st":2===n?"nd":3===n?"rd":"th"},currency:{symbol:"$",position:"prefix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:"$ ,0.00",fullWithTwoDecimalsNoCurrency:",0.00"}}),a.languages=function(){return console.warn("`languages` is deprecated since version 1.6.0. Use `cultures` instead"),l},a.cultures=function(){return o},a.zeroFormat=function(e){c="string"==typeof e?e:null},a.defaultFormat=function(e){s="string"==typeof e?e:"0.0"},a.defaultCurrencyFormat=function(e){"string"==typeof e?e:"0$"},a.validate=function(e,n){var t,r,i,o,l,u,c,s;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=a.cultureData(n)}catch(e){c=a.cultureData(a.culture())}return i=c.currency.symbol,l=c.abbreviations,t=c.delimiters.decimal,r="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(s=e.match(/^[^\d]+/))||(e=e.substr(1),s[0]===i))&&((null===(s=e.match(/[^\d]+$/))||(e=e.slice(0,-1),s[0]===l.thousand||s[0]===l.million||s[0]===l.billion||s[0]===l.trillion))&&(u=new RegExp(r+"{2}"),!e.match(/[^\d.,]/g)&&(!((o=e.split(t)).length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(u)&&!!o[1].match(/^\d+$/)))))},n.exports={format:function(e,n,t,r){return null!=t&&t!==a.culture()&&a.setCulture(t),p(Number(e),null!=n?n:s,null==r?Math.round:r)}}},
function _(e,n,t,r,i){!function(){"use strict";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 n(t){return function(t,r){var i,s,a,o,p,c,l,u,f,d=1,g=t.length,y="";for(s=0;s<g;s++)if("string"==typeof t[s])y+=t[s];else if("object"==typeof t[s]){if((o=t[s]).keys)for(i=r[d],a=0;a<o.keys.length;a++){if(null==i)throw new Error(n('[sprintf] Cannot access property "%s" of undefined value "%s"',o.keys[a],o.keys[a-1]));i=i[o.keys[a]]}else i=o.param_no?r[o.param_no]:r[d++];if(e.not_type.test(o.type)&&e.not_primitive.test(o.type)&&i instanceof Function&&(i=i()),e.numeric_arg.test(o.type)&&"number"!=typeof i&&isNaN(i))throw new TypeError(n("[sprintf] expecting number but found %T",i));switch(e.number.test(o.type)&&(u=i>=0),o.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,o.width?parseInt(o.width):0);break;case"e":i=o.precision?parseFloat(i).toExponential(o.precision):parseFloat(i).toExponential();break;case"f":i=o.precision?parseFloat(i).toFixed(o.precision):parseFloat(i);break;case"g":i=o.precision?String(Number(i.toPrecision(o.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=o.precision?i.substring(0,o.precision):i;break;case"t":i=String(!!i),i=o.precision?i.substring(0,o.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=o.precision?i.substring(0,o.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=o.precision?i.substring(0,o.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}e.json.test(o.type)?y+=i:(!e.number.test(o.type)||u&&!o.sign?f="":(f=u?"+":"-",i=i.toString().replace(e.sign,"")),c=o.pad_char?"0"===o.pad_char?"0":o.pad_char.charAt(1):" ",l=o.width-(f+i).length,p=o.width&&l>0?c.repeat(l):"",y+=o.align?f+i+p:"0"===c?f+p+i:p+f+i)}return y}(function(n){if(i[n])return i[n];var t,r=n,s=[],a=0;for(;r;){if(null!==(t=e.text.exec(r)))s.push(t[0]);else if(null!==(t=e.modulo.exec(r)))s.push("%");else{if(null===(t=e.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],p=t[2],c=[];if(null===(c=e.key.exec(p)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(p=p.substring(c[0].length));)if(null!==(c=e.key_access.exec(p)))o.push(c[1]);else{if(null===(c=e.index_access.exec(p)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");s.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return i[n]=s}(t),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}var i=Object.create(null);void 0!==t&&(t.sprintf=n,t.vsprintf=r),"undefined"!=typeof window&&(window.sprintf=n,window.vsprintf=r,"function"==typeof define&&define.amd&&define((function(){return{sprintf:n,vsprintf:r}})))}()},
function _(e,t,n,r,o){!function(e){"object"==typeof t&&t.exports?t.exports=e():"function"==typeof define?define(e):this.tz=e()}((function(){function e(e,t,n){var r,o=t.day[1];do{r=new Date(Date.UTC(n,t.month,Math.abs(o++)))}while(t.day[0]<7&&r.getUTCDay()!=t.day[0]);return(r={clock:t.clock,sort:r.getTime(),rule:t,save:6e4*t.save,offset:e.offset})[r.clock]=r.sort+6e4*t.time,r.posix?r.wallclock=r[r.clock]+(e.offset+t.saved):r.posix=r[r.clock]-(e.offset+t.saved),r}function t(t,n,r){var o,a,u,i,l,s,c,f=t[t.zone],h=[],T=new Date(r).getUTCFullYear(),g=1;for(o=1,a=f.length;o<a&&!(f[o][n]<=r);o++);if((u=f[o]).rules){for(s=t[u.rules],c=T+1;c>=T-g;--c)for(o=0,a=s.length;o<a;o++)s[o].from<=c&&c<=s[o].to?h.push(e(u,s[o],c)):s[o].to<c&&1==g&&(g=c-s[o].to);for(h.sort((function(e,t){return e.sort-t.sort})),o=0,a=h.length;o<a;o++)r>=h[o][n]&&h[o][h[o].clock]>u[h[o].clock]&&(i=h[o])}return i&&((l=/^(.*)\/(.*)$/.exec(u.format))?i.abbrev=l[i.save?2:1]:i.abbrev=u.format.replace(/%s/,i.rule.letter)),i||u}function n(e,n){return"UTC"==e.zone?n:(e.entry=t(e,"posix",n),n+e.entry.offset+e.entry.save)}function r(e,n){return"UTC"==e.zone?n:(e.entry=r=t(e,"wallclock",n),0<(o=n-r.wallclock)&&o<r.save?null:n-r.offset-r.save);var r,o}function o(e,t,o){var a,i=+(o[1]+1),s=o[2]*i,c=u.indexOf(o[3].toLowerCase());if(c>9)t+=s*l[c-10];else{if(a=new Date(n(e,t)),c<7)for(;s;)a.setUTCDate(a.getUTCDate()+i),a.getUTCDay()==c&&(s-=i);else 7==c?a.setUTCFullYear(a.getUTCFullYear()+s):8==c?a.setUTCMonth(a.getUTCMonth()+s):a.setUTCDate(a.getUTCDate()+s);null==(t=r(e,a.getTime()))&&(t=r(e,a.getTime()+864e5*i)-864e5*i)}return t}var a={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(e,t,n,r){var o,a,u=this.entry.offset+this.entry.save,i=Math.abs(u/1e3),l=[],s=3600;for(o=0;o<3;o++)l.push(("0"+Math.floor(i/s)).slice(-2)),i%=s,s/=60;return"^"!=n||u?("^"==n&&(r=3),3==r?(a=(a=l.join(":")).replace(/:00$/,""),"^"!=n&&(a=a.replace(/:00$/,""))):r?(a=l.slice(0,r+1).join(":"),"^"==n&&(a=a.replace(/:00$/,""))):a=l.slice(0,2).join(""),a=(a=(u<0?"-":"+")+a).replace(/([-+])(0)/,{_:" $1","-":"$1"}[n]||"$1$2")):"Z"},"%":function(e){return"%"},n:function(e){return"\n"},t:function(e){return"\t"},U:function(e){return s(e,0)},W:function(e){return s(e,1)},V:function(e){return c(e)[0]},G:function(e){return c(e)[1]},g:function(e){return c(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,a,u,l,s,c=Object.create(this),f=[];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)):s=l;else if(isNaN(l)){if("string"==(u=typeof l))~l.indexOf("%")?c.format=l:t||"*"!=l?!t&&(u=/^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|(([+-])(\d{2}(:\d{2}){0,2})))?)?$/.exec(l))?((s=[]).push.apply(s,u.slice(1,8)),u[9]?(s.push(u[10]+1),s.push.apply(s,u[11].split(/:/))):u[8]&&s.push(1)):/^\w{2,3}_\w{2}$/.test(l)?c.locale=l:(u=i.exec(l))?f.push(u):c.zone=l:s=l;else if("function"==u){if(u=l.call(c))return u}else if(/^\w{2,3}_\w{2}$/.test(l.name))c[l.name]=l;else if(l.zones){for(u in l.zones)c[u]=l.zones[u];for(u in l.rules)c[u]=l.rules[u]}}else t||(s=l);if(c[c.locale]||delete c.locale,c[c.zone]||delete c.zone,null!=s){if("*"==s)s=c.clock();else if(Array.isArray(s)){for(u=[],a=!s[7],t=0;t<11;t++)u[t]=+(s[t]||0);--u[1],s=Date.UTC.apply(Date.UTC,u)+-u[7]*(36e5*u[8]+6e4*u[9]+1e3*u[10])}else s=Math.floor(s);if(!isNaN(s)){if(a&&(s=r(c,s)),null==s)return s;for(t=0,a=f.length;t<a;t++)s=o(c,s,f[t]);return c.format?(u=new Date(n(c,s)),c.format.replace(/%([-0_^]?)(:{0,3})(\d*)(.)/g,(function(e,t,n,r,o){var a,i,l="0";if(a=c[o]){for(e=String(a.call(c,u,s,t,n.length)),"_"==(t||a.style)&&(l=" "),i="-"==t?0:a.pad||0;e.length<i;)e=l+e;for(i="-"==t?0:r||a.pad;e.length<i;)e=l+e;"N"==o&&i<e.length&&(e=e.slice(0,i)),"^"==t&&(e=e.toUpperCase())}return e}))):s}}return function(){return c.convert(arguments)}},locale:"en_US",en_US:{date:"%m/%d/%Y",time24:"%I:%M:%S %p",time12:"%I:%M:%S %p",dateTime:"%a %d %b %Y %I:%M:%S %p %Z",meridiem:["AM","PM"],month:{abbrev:"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|"),full:"January|February|March|April|May|June|July|August|September|October|November|December".split("|")},day:{abbrev:"Sun|Mon|Tue|Wed|Thu|Fri|Sat".split("|"),full:"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|")}}},u="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",i=new RegExp("^\\s*([+-])(\\d+)\\s+("+u+")s?\\s*$","i"),l=[36e5,6e4,1e3,1];function s(e,t){var n,r,o;return r=new Date(Date.UTC(e.getUTCFullYear(),0)),n=Math.floor((e.getTime()-r.getTime())/864e5),r.getUTCDay()==t?o=0:8==(o=7-r.getUTCDay()+t)&&(o=1),n>=o?Math.floor((n-o)/7)+1:0}function c(e){var t,n,r;return n=e.getUTCFullYear(),t=new Date(Date.UTC(n,0)).getUTCDay(),(r=s(e,1)+(t>1&&t<=4?1:0))?53!=r||4==t||3==t&&29==new Date(n,1,29).getDate()?[r,e.getUTCFullYear()]:[1,e.getUTCFullYear()+1]:(n=e.getUTCFullYear()-1,[r=4==(t=new Date(Date.UTC(n,0)).getUTCDay())||3==t&&29==new Date(n,1,29).getDate()?53:52,e.getUTCFullYear()-1])}return u=u.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,(function(e){a[e].pad=2})),a.N.pad=9,a.j.pad=3,a.k.style="_",a.l.style="_",a.e.style="_",function(){return a.convert(arguments)}}))},
function _(t,n,e,_,E){function N(t){return new Date(t.getTime())}function O(t){const n=N(t);return n.setUTCDate(1),n.setUTCHours(0),n.setUTCMinutes(0),n.setUTCSeconds(0),n.setUTCMilliseconds(0),n}_(),e.ONE_MILLI=1,e.ONE_SECOND=1e3,e.ONE_MINUTE=60*e.ONE_SECOND,e.ONE_HOUR=60*e.ONE_MINUTE,e.ONE_DAY=24*e.ONE_HOUR,e.ONE_MONTH=30*e.ONE_DAY,e.ONE_YEAR=365*e.ONE_DAY,e.copy_date=N,e.last_month_no_later_than=O,e.last_year_no_later_than=function(t){const n=O(t);return n.setUTCMonth(0),n}},
function _(e,n,i,a,s){var r;a();const t=e(10),c=e(178),m=e(180),_=e(181),k=e(183),o=e(184),T=e(176);class w extends m.CompositeTicker{constructor(e){super(e)}}i.DatetimeTicker=w,r=w,w.__name__="DatetimeTicker",r.override({num_minor_ticks:0,tickers:()=>[new c.AdaptiveTicker({mantissas:[1,2,5],base:10,min_interval:0,max_interval:500*T.ONE_MILLI,num_minor_ticks:0}),new c.AdaptiveTicker({mantissas:[1,2,5,10,15,20,30],base:60,min_interval:T.ONE_SECOND,max_interval:30*T.ONE_MINUTE,num_minor_ticks:0}),new c.AdaptiveTicker({mantissas:[1,2,4,6,8,12],base:24,min_interval:T.ONE_HOUR,max_interval:12*T.ONE_HOUR,num_minor_ticks:0}),new _.DaysTicker({days:(0,t.range)(1,32)}),new _.DaysTicker({days:(0,t.range)(1,31,3)}),new _.DaysTicker({days:[1,8,15,22]}),new _.DaysTicker({days:[1,15]}),new k.MonthsTicker({months:(0,t.range)(0,12,1)}),new k.MonthsTicker({months:(0,t.range)(0,12,2)}),new k.MonthsTicker({months:(0,t.range)(0,12,4)}),new k.MonthsTicker({months:(0,t.range)(0,12,6)}),new o.YearsTicker({})]})},
function _(t,e,a,s,i){var n;s();const r=t(179),_=t(10),l=t(11);class h extends r.ContinuousTicker{constructor(t){super(t)}get_min_interval(){return this.min_interval}get_max_interval(){var t;return null!==(t=this.max_interval)&&void 0!==t?t:1/0}get extended_mantissas(){const t=(0,_.nth)(this.mantissas,-1)/this.base,e=(0,_.nth)(this.mantissas,0)*this.base;return[t,...this.mantissas,e]}get base_factor(){return 0==this.get_min_interval()?1:this.get_min_interval()}get_interval(t,e,a){const s=e-t,i=this.get_ideal_interval(t,e,a),n=Math.floor((0,l.log)(i/this.base_factor,this.base)),r=this.base**n*this.base_factor,h=this.extended_mantissas,m=h.map((t=>Math.abs(a-s/(t*r)))),v=h[(0,_.argmin)(m)]*r;return(0,l.clamp)(v,this.get_min_interval(),this.get_max_interval())}}a.AdaptiveTicker=h,n=h,h.__name__="AdaptiveTicker",n.define((({Number:t,Array:e,Nullable:a})=>({base:[t,10],mantissas:[e(t),[1,2,5]],min_interval:[t,0],max_interval:[a(t),null]})))},
function _(t,n,i,s,e){var o;s();const r=t(163),c=t(10);class _ extends r.Ticker{constructor(t){super(t)}get_ticks(t,n,i,s){return this.get_ticks_no_defaults(t,n,s,this.desired_num_ticks)}get_ticks_no_defaults(t,n,i,s){const e=this.get_interval(t,n,s),o=Math.floor(t/e),r=Math.ceil(n/e);let _;_=isFinite(o)&&isFinite(r)?(0,c.range)(o,r+1):[];const u=_.map((t=>t*e)).filter((i=>t<=i&&i<=n)),a=this.num_minor_ticks,f=[];if(a>0&&u.length>0){const i=e/a,s=(0,c.range)(0,a).map((t=>t*i));for(const i of s.slice(1)){const s=u[0]-i;t<=s&&s<=n&&f.push(s)}for(const i of u)for(const e of s){const s=i+e;t<=s&&s<=n&&f.push(s)}}return{major:u,minor:f}}get_ideal_interval(t,n,i){return(n-t)/i}}i.ContinuousTicker=_,o=_,_.__name__="ContinuousTicker",o.define((({Int:t})=>({num_minor_ticks:[t,5],desired_num_ticks:[t,6]})))},
function _(t,e,i,r,s){var n;r();const _=t(179),a=t(10);class l extends _.ContinuousTicker{constructor(t){super(t)}get min_intervals(){return this.tickers.map((t=>t.get_min_interval()))}get max_intervals(){return this.tickers.map((t=>t.get_max_interval()))}get_min_interval(){return this.min_intervals[0]}get_max_interval(){return this.max_intervals[0]}get_best_ticker(t,e,i){const r=e-t,s=this.get_ideal_interval(t,e,i),n=[(0,a.sorted_index)(this.min_intervals,s)-1,(0,a.sorted_index)(this.max_intervals,s)],_=[this.min_intervals[n[0]],this.max_intervals[n[1]]].map((t=>Math.abs(i-r/t)));let l;if((0,a.is_empty)(_.filter((t=>!isNaN(t)))))l=this.tickers[0];else{const t=n[(0,a.argmin)(_)];l=this.tickers[t]}return l}get_interval(t,e,i){return this.get_best_ticker(t,e,i).get_interval(t,e,i)}get_ticks_no_defaults(t,e,i,r){return this.get_best_ticker(t,e,r).get_ticks_no_defaults(t,e,i,r)}}i.CompositeTicker=l,n=l,l.__name__="CompositeTicker",n.define((({Array:t,Ref:e})=>({tickers:[t(e(_.ContinuousTicker)),[]]})))},
function _(t,e,n,s,a){var o;s();const i=t(182),r=t(176),c=t(10);class _ extends i.BaseSingleIntervalTicker{constructor(t){super(t)}initialize(){super.initialize();const t=this.days;t.length>1?this.interval=(t[1]-t[0])*r.ONE_DAY:this.interval=31*r.ONE_DAY}get_ticks_no_defaults(t,e,n,s){const a=function(t,e){const n=(0,r.last_month_no_later_than)(new Date(t)),s=(0,r.last_month_no_later_than)(new Date(e));s.setUTCMonth(s.getUTCMonth()+1);const a=[],o=n;for(;a.push((0,r.copy_date)(o)),o.setUTCMonth(o.getUTCMonth()+1),!(o>s););return a}(t,e),o=this.days;return{major:(0,c.concat)(a.map((t=>((t,e)=>{const n=t.getUTCMonth(),s=[];for(const a of o){const o=(0,r.copy_date)(t);o.setUTCDate(a),new Date(o.getTime()+e/2).getUTCMonth()==n&&s.push(o)}return s})(t,this.interval)))).map((t=>t.getTime())).filter((n=>t<=n&&n<=e)),minor:[]}}}n.DaysTicker=_,o=_,_.__name__="DaysTicker",o.define((({Int:t,Array:e})=>({days:[e(t),[]]}))),o.override({num_minor_ticks:0})},
function _(e,n,r,t,i){var a;t();const l=e(179);class s extends l.ContinuousTicker{constructor(e){super(e)}get_interval(e,n,r){return this.interval}get_min_interval(){return this.interval}get_max_interval(){return this.interval}}r.BaseSingleIntervalTicker=s,s.__name__="BaseSingleIntervalTicker";class _ extends s{constructor(e){super(e)}}r.SingleIntervalTicker=_,a=_,_.__name__="SingleIntervalTicker",a.define((({Number:e})=>({interval:[e]})))},
function _(t,e,n,a,r){var s;a();const i=t(182),o=t(176),l=t(10);class _ extends i.BaseSingleIntervalTicker{constructor(t){super(t)}initialize(){super.initialize();const t=this.months;t.length>1?this.interval=(t[1]-t[0])*o.ONE_MONTH:this.interval=12*o.ONE_MONTH}get_ticks_no_defaults(t,e,n,a){const r=function(t,e){const n=(0,o.last_year_no_later_than)(new Date(t)),a=(0,o.last_year_no_later_than)(new Date(e));a.setUTCFullYear(a.getUTCFullYear()+1);const r=[],s=n;for(;r.push((0,o.copy_date)(s)),s.setUTCFullYear(s.getUTCFullYear()+1),!(s>a););return r}(t,e),s=this.months;return{major:(0,l.concat)(r.map((t=>s.map((e=>{const n=(0,o.copy_date)(t);return n.setUTCMonth(e),n}))))).map((t=>t.getTime())).filter((n=>t<=n&&n<=e)),minor:[]}}}n.MonthsTicker=_,s=_,_.__name__="MonthsTicker",s.define((({Int:t,Array:e})=>({months:[e(t),[]]})))},
function _(e,t,a,r,_){r();const n=e(185),s=e(182),i=e(176);class c extends s.BaseSingleIntervalTicker{constructor(e){super(e),this.interval=i.ONE_YEAR,this.basic_ticker=new n.BasicTicker({num_minor_ticks:0})}get_ticks_no_defaults(e,t,a,r){const _=(0,i.last_year_no_later_than)(new Date(e)).getUTCFullYear(),n=(0,i.last_year_no_later_than)(new Date(t)).getUTCFullYear();return{major:this.basic_ticker.get_ticks_no_defaults(_,n,a,r).major.map((e=>Date.UTC(e,0,1))).filter((a=>e<=a&&a<=t)),minor:[]}}}a.YearsTicker=c,c.__name__="YearsTicker"},
function _(c,e,s,i,n){i();const r=c(178);class t extends r.AdaptiveTicker{constructor(c){super(c)}}s.BasicTicker=t,t.__name__="BasicTicker"},
function _(e,i,s,n,r){var t;n();const a=e(169),o=e(187),c=e(185);class _ extends a.ContinuousAxisView{}s.LinearAxisView=_,_.__name__="LinearAxisView";class u extends a.ContinuousAxis{constructor(e){super(e)}}s.LinearAxis=u,t=u,u.__name__="LinearAxis",t.prototype.default_view=_,t.override({ticker:()=>new c.BasicTicker,formatter:()=>new o.BasicTickFormatter})},
function _(i,t,e,n,o){var r;n();const s=i(164),c=i(40);function _(i){let t="";for(const e of i)t+="-"==e?"\u2212":e;return t}e.unicode_replace=_;class a extends s.TickFormatter{constructor(i){super(i),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(i){if(!this.use_scientific)return!1;const{scientific_limit_high:t}=this,{scientific_limit_low:e}=this,n=i.length<2?0:Math.abs(i[1]-i[0])/1e4;for(const o of i){const i=Math.abs(o);if(!(i<=n)&&(i>=t||i<=e))return!0}return!1}_format_with_precision(i,t,e){return t?i.map((i=>_(i.toExponential(e)))):i.map((i=>_((0,c.to_fixed)(i,e))))}_auto_precision(i,t){const e=new Array(i.length),n=this.last_precision<=15;i:for(let o=this.last_precision;n?o<=15:o>=1;n?o++:o--){if(t){e[0]=i[0].toExponential(o);for(let t=1;t<i.length;t++)if(e[t]==e[t-1])continue i;this.last_precision=o;break}e[0]=(0,c.to_fixed)(i[0],o);for(let t=1;t<i.length;t++)if(e[t]=(0,c.to_fixed)(i[t],o),e[t]==e[t-1])continue i;this.last_precision=o;break}return this.last_precision}doFormat(i,t){if(0==i.length)return[];const e=this._need_sci(i),n="auto"==this.precision?this._auto_precision(i,e):this.precision;return this._format_with_precision(i,e,n)}}e.BasicTickFormatter=a,r=a,a.__name__="BasicTickFormatter",r.define((({Boolean:i,Int:t,Auto:e,Or:n})=>({precision:[n(t,e),"auto"],use_scientific:[i,!0],power_limit_high:[t,5],power_limit_low:[t,-3]})))},
function _(e,o,i,s,t){var n;s();const r=e(169),_=e(189),c=e(190);class a extends r.ContinuousAxisView{}i.LogAxisView=a,a.__name__="LogAxisView";class u extends r.ContinuousAxis{constructor(e){super(e)}}i.LogAxis=u,n=u,u.__name__="LogAxis",n.prototype.default_view=a,n.override({ticker:()=>new c.LogTicker,formatter:()=>new _.LogTickFormatter})},
function _(e,t,n,o,r){var i;o();const a=e(164),s=e(187),c=e(190),l=e(153),{abs:u,log:x,round:_}=Math;class p extends a.TickFormatter{constructor(e){super(e)}initialize(){super.initialize(),this.basic_formatter=new s.BasicTickFormatter}format_graphics(e,t){var n,o;if(0==e.length)return[];const r=null!==(o=null===(n=this.ticker)||void 0===n?void 0:n.base)&&void 0!==o?o:10,i=this._exponents(e,r);return null==i?this.basic_formatter.format_graphics(e,t):i.map((e=>{if(u(e)<this.min_exponent){const t=new l.TextBox({text:(0,s.unicode_replace)(`${r**e}`)}),n=new l.TextBox({text:""});return new l.BaseExpo(t,n)}{const t=new l.TextBox({text:(0,s.unicode_replace)(`${r}`)}),n=new l.TextBox({text:(0,s.unicode_replace)(`${e}`)});return new l.BaseExpo(t,n)}}))}_exponents(e,t){let n=null;const o=[];for(const r of e){const e=_(x(r)/x(t));if(n==e)return null;n=e,o.push(e)}return o}doFormat(e,t){var n,o;if(0==e.length)return[];const r=null!==(o=null===(n=this.ticker)||void 0===n?void 0:n.base)&&void 0!==o?o:10,i=this._exponents(e,r);return null==i?this.basic_formatter.doFormat(e,t):i.map((e=>u(e)<this.min_exponent?(0,s.unicode_replace)(`${r**e}`):(0,s.unicode_replace)(`${r}^${e}`)))}}n.LogTickFormatter=p,i=p,p.__name__="LogTickFormatter",i.define((({Int:e,Ref:t,Nullable:n})=>({ticker:[n(t(c.LogTicker)),null],min_exponent:[e,0]})))},
function _(t,o,e,s,n){var r;s();const i=t(178),a=t(10);class c extends i.AdaptiveTicker{constructor(t){super(t)}get_ticks_no_defaults(t,o,e,s){const n=this.num_minor_ticks,r=[],i=this.base,c=Math.log(t)/Math.log(i),f=Math.log(o)/Math.log(i),l=f-c;let h;if(isFinite(l)&&0!=l)if(l<2){const e=this.get_interval(t,o,s),i=Math.floor(t/e),c=Math.ceil(o/e);if(h=(0,a.range)(i,c+1).filter((t=>0!=t)).map((t=>t*e)).filter((e=>t<=e&&e<=o)),n>0&&h.length>0){const t=e/n,o=(0,a.range)(0,n).map((o=>o*t));for(const t of o.slice(1))r.push(h[0]-t);for(const t of h)for(const e of o)r.push(t+e)}}else{const t=Math.ceil(.999999*c),o=Math.floor(1.000001*f),e=Math.ceil((o-t)/9);if(h=(0,a.range)(t-1,o+1,e).map((t=>i**t)),n>0&&h.length>0){const t=i**e/n,o=(0,a.range)(1,n+1).map((o=>o*t));for(const t of o)r.push(h[0]/t);r.push(h[0]);for(const t of h)for(const e of o)r.push(t*e)}}else h=[];return{major:h.filter((e=>t<=e&&e<=o)),minor:r.filter((e=>t<=e&&e<=o))}}}e.LogTicker=c,r=c,c.__name__="LogTicker",r.override({mantissas:[1,5]})},
function _(e,r,t,i,a){var o;i();const s=e(161),c=e(186),n=e(192),_=e(193);class x extends s.AxisView{}t.MercatorAxisView=x,x.__name__="MercatorAxisView";class d extends c.LinearAxis{constructor(e){super(e)}}t.MercatorAxis=d,o=d,d.__name__="MercatorAxis",o.prototype.default_view=x,o.override({ticker:()=>new _.MercatorTicker({dimension:"lat"}),formatter:()=>new n.MercatorTickFormatter({dimension:"lat"})})},
function _(r,t,e,o,n){var i;o();const c=r(187),s=r(20),a=r(107);class l extends c.BasicTickFormatter{constructor(r){super(r)}doFormat(r,t){if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0==r.length)return[];const e=r.length,o=new Array(e);if("lon"==this.dimension)for(let n=0;n<e;n++){const[e]=a.wgs84_mercator.invert(r[n],t.loc);o[n]=e}else for(let n=0;n<e;n++){const[,e]=a.wgs84_mercator.invert(t.loc,r[n]);o[n]=e}return super.doFormat(o,t)}}e.MercatorTickFormatter=l,i=l,l.__name__="MercatorTickFormatter",i.define((({Nullable:r})=>({dimension:[r(s.LatLon),null]})))},
function _(t,o,n,s,r){var e;s();const i=t(185),c=t(20),_=t(107);class a extends i.BasicTicker{constructor(t){super(t)}get_ticks_no_defaults(t,o,n,s){if(null==this.dimension)throw new Error(`${this}.dimension wasn't configured`);return[t,o]=(0,_.clip_mercator)(t,o,this.dimension),"lon"==this.dimension?this._get_ticks_lon(t,o,n,s):this._get_ticks_lat(t,o,n,s)}_get_ticks_lon(t,o,n,s){const[r]=_.wgs84_mercator.invert(t,n),[e,i]=_.wgs84_mercator.invert(o,n),c=super.get_ticks_no_defaults(r,e,n,s),a=[];for(const t of c.major)if((0,_.in_bounds)(t,"lon")){const[o]=_.wgs84_mercator.compute(t,i);a.push(o)}const m=[];for(const t of c.minor)if((0,_.in_bounds)(t,"lon")){const[o]=_.wgs84_mercator.compute(t,i);m.push(o)}return{major:a,minor:m}}_get_ticks_lat(t,o,n,s){const[,r]=_.wgs84_mercator.invert(n,t),[e,i]=_.wgs84_mercator.invert(n,o),c=super.get_ticks_no_defaults(r,i,n,s),a=[];for(const t of c.major)if((0,_.in_bounds)(t,"lat")){const[,o]=_.wgs84_mercator.compute(e,t);a.push(o)}const m=[];for(const t of c.minor)if((0,_.in_bounds)(t,"lat")){const[,o]=_.wgs84_mercator.compute(e,t);m.push(o)}return{major:a,minor:m}}}n.MercatorTicker=a,e=a,a.__name__="MercatorTicker",e.define((({Nullable:t})=>({dimension:[t(c.LatLon),null]})))},
function _(e,i,r,c,k){c(),k("AdaptiveTicker",e(178).AdaptiveTicker),k("BasicTicker",e(185).BasicTicker),k("CategoricalTicker",e(167).CategoricalTicker),k("CompositeTicker",e(180).CompositeTicker),k("ContinuousTicker",e(179).ContinuousTicker),k("DatetimeTicker",e(177).DatetimeTicker),k("DaysTicker",e(181).DaysTicker),k("FixedTicker",e(195).FixedTicker),k("LogTicker",e(190).LogTicker),k("MercatorTicker",e(193).MercatorTicker),k("MonthsTicker",e(183).MonthsTicker),k("SingleIntervalTicker",e(182).SingleIntervalTicker),k("Ticker",e(163).Ticker),k("YearsTicker",e(184).YearsTicker),k("BinnedTicker",e(196).BinnedTicker)},
function _(e,r,t,i,n){var s;i();const _=e(179);class c extends _.ContinuousTicker{constructor(e){super(e)}get_ticks_no_defaults(e,r,t,i){return{major:[...this.ticks],minor:[...this.minor_ticks]}}get_interval(e,r,t){return 0}get_min_interval(){return 0}get_max_interval(){return 0}}t.FixedTicker=c,s=c,c.__name__="FixedTicker",s.define((({Number:e,Arrayable:r})=>({ticks:[r(e),[]],minor_ticks:[r(e),[]]})))},
function _(e,n,t,r,i){var o;r();const a=e(163),s=e(197),c=e(13);class m extends a.Ticker{constructor(e){super(e)}get_ticks(e,n,t,r){const{binning:i}=this.mapper.metrics,o=Math.max(0,(0,c.left_edge_index)(e,i)),a=Math.min((0,c.left_edge_index)(n,i)+1,i.length-1),s=[];for(let e=o;e<=a;e++)s.push(i[e]);const{num_major_ticks:m}=this,_=[],h="auto"==m?s.length:m,l=Math.max(1,Math.floor(s.length/h));for(let e=0;e<s.length;e+=l)_.push(s[e]);return{major:_,minor:[]}}}t.BinnedTicker=m,o=m,m.__name__="BinnedTicker",o.define((({Number:e,Ref:n,Or:t,Auto:r})=>({mapper:[n(s.ScanningColorMapper)],num_major_ticks:[t(e,r),8]})))},
function _(n,i,e,t,a){t();const o=n(198),_=n(13);class r extends o.ContinuousColorMapper{constructor(n){super(n)}index_to_value(n){return this._scan_data.binning[n]}value_to_index(n,i){const e=this._scan_data;return n<e.binning[0]?-1:n>e.binning[e.binning.length-1]?i:(0,_.left_edge_index)(n,e.binning)}}e.ScanningColorMapper=r,r.__name__="ScanningColorMapper"},
function _(t,e,o,n,s){var l;n();const i=t(199),c=t(201),a=t(10),h=t(8);class r extends i.ColorMapper{constructor(t){super(t),this._scan_data=null}connect_signals(){super.connect_signals();const t=()=>{for(const[t]of this.domain)this.connect(t.view.change,(()=>this.update_data())),this.connect(t.data_source.selected.change,(()=>this.update_data()))},{high:e,low:o,high_color:n,low_color:s,palette:l,nan_color:i}=this.properties;this.on_change([e,o,n,s,l,i],(()=>this.update_data())),this.connect(this.properties.domain.change,(()=>t())),t()}update_data(){const{domain:t,palette:e}=this,o=[...this._collect(t)];this._scan_data=this.scan(o,e.length),this.metrics_change.emit(),this.change.emit()}get metrics(){return null==this._scan_data&&this.update_data(),this._scan_data}*_collect(t){for(const[e,o]of t)for(const t of(0,h.isArray)(o)?o:[o]){if(e.view.properties.indices.is_unset)continue;const o=e.data_source.get_column(t);if(null==o)continue;let n=e.view.indices.select(o);const s=e.view.masked,l=e.data_source.selected.indices;let i;if(null!=s&&l.length>0?i=(0,a.intersection)([...s],l):null!=s?i=[...s]:l.length>0&&(i=l),null!=i&&(n=(0,a.map)(i,(t=>n[t]))),n.length>0&&!(0,h.isNumber)(n[0]))for(const t of n)yield*t;else yield*n}}_v_compute(t,e,o,n){const{nan_color:s}=n;let{low_color:l,high_color:i}=n;null==l&&(l=o[0]),null==i&&(i=o[o.length-1]);const{domain:c}=this,h=(0,a.is_empty)(c)?t:[...this._collect(c)];this._scan_data=this.scan(h,o.length),this.metrics_change.emit();for(let n=0,c=t.length;n<c;n++){const c=t[n];isNaN(c)?e[n]=s:e[n]=this.cmap(c,o,l,i)}}_colors(t){return Object.assign(Object.assign({},super._colors(t)),{low_color:null!=this.low_color?t(this.low_color):void 0,high_color:null!=this.high_color?t(this.high_color):void 0})}cmap(t,e,o,n){const s=this.value_to_index(t,e.length);return s<0?o:s>=e.length?n:e[s]}}o.ContinuousColorMapper=r,l=r,r.__name__="ContinuousColorMapper",l.define((({Number:t,String:e,Ref:o,Color:n,Or:s,Tuple:l,Array:i,Nullable:a})=>({high:[a(t),null],low:[a(t),null],high_color:[a(n),null],low_color:[a(n),null],domain:[i(l(o(c.GlyphRenderer),s(e,i(e)))),[]]})))},
function _(t,e,r,n,o){var i;n();const _=t(200),a=t(15),c=t(24),s=t(22),l=t(27),p=t(30);function u(t){return(0,s.encode_rgba)((0,s.color2rgba)(t))}function h(t){const e=new Uint32Array(t.length);for(let r=0,n=t.length;r<n;r++)e[r]=u(t[r]);return e}r._convert_color=u,r._convert_palette=h;class g extends _.Mapper{constructor(t){super(t)}initialize(){super.initialize(),this.metrics_change=new a.Signal0(this,"metrics_change")}v_compute(t){const e=new Array(t.length);return this._v_compute(t,e,this.palette,this._colors((t=>t))),e}get rgba_mapper(){const t=this,e=h(this.palette),r=this._colors(u);return{v_compute(n){const o=(0,p.is_NDArray)(n)&&3==n.dimension?n.shape[2]:1,i=new c.ColorArray(n.length/o);return t._v_compute_uint32(n,i,e,r),new Uint8ClampedArray((0,l.to_big_endian)(i).buffer)}}}_colors(t){return{nan_color:t(this.nan_color)}}_v_compute_uint32(t,e,r,n){this._v_compute(t,e,r,n)}}r.ColorMapper=g,i=g,g.__name__="ColorMapper",i.define((({Color:t,Array:e})=>({palette:[e(t)],nan_color:[t,"gray"]})))},
function _(r,e,n,s,o){s();const p=r(86);class t extends p.Transform{constructor(r){super(r)}compute(r){throw new Error("mapping single values is not supported")}}n.Mapper=t,t.__name__="Mapper"},
function _(e,t,i,s,l){var h;s();const n=e(202),o=e(203),a=e(213),c=e(214),d=e(217),_=e(218),r=e(219),p=e(205),g=e(101),y=e(220),u=e(24),m=e(13),v=e(9),f=e(59),w=e(26),b=e(98),V=e(210),G={fill:{},line:{}},x={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},R={fill:{fill_alpha:.2},line:{}},k={fill:{fill_alpha:.2},line:{}};class S extends n.DataRendererView{get glyph_view(){return this.glyph}*children(){yield*super.children(),yield this.cds_view,yield this.glyph,yield this.selection_glyph,yield this.nonselection_glyph,null!=this.hover_glyph&&(yield this.hover_glyph),yield this.muted_glyph,yield this.decimated_glyph}get data_source(){return this.model.properties.data_source}async lazy_initialize(){var e;await super.lazy_initialize(),this.cds_view=await(0,f.build_view)(this.model.view,{parent:this});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,l=Object.assign({},t.attributes);function h(e){const h=(0,v.clone)(l);return i&&(0,v.extend)(h,e.fill),s&&(0,v.extend)(h,e.line),new t.constructor(h)}function n(e,t){return t instanceof p.Glyph?t:h("auto"==t?e:{fill:{},line:{}})}delete l.id;let{selection_glyph:o,nonselection_glyph:a,hover_glyph:c,muted_glyph:d}=this.model;o=n(G,o),this.selection_glyph=await this.build_glyph_view(o),a=n(R,a),this.nonselection_glyph=await this.build_glyph_view(a),null!=c&&(this.hover_glyph=await this.build_glyph_view(c)),d=n(k,d),this.muted_glyph=await this.build_glyph_view(d);const _=n(x,"auto");this.decimated_glyph=await this.build_glyph_view(_),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.cds_view.remove(),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,(()=>{const{inspected:t}=this.model.data_source,i={indices:t.indices,line_indices:t.line_indices,multiline_indices:t.multiline_indices,image_indices:t.image_indices,selected_glyphs:t.selected_glyphs};(0,w.is_equal)(this._previous_inspected,i)||(this._previous_inspected=i,e())})),this.connect(this.model.properties.view.change,(async()=>{this.cds_view.remove(),this.cds_view=await(0,f.build_view)(this.model.view,{parent:this}),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[,e]of i)e instanceof b.FactorRange&&this.connect(e.invalidate_synthetic,t);for(const[,e]of s)e instanceof b.FactorRange&&this.connect(e.invalidate_synthetic,t);const{transformchange:l,exprchange:h}=this.model.glyph;this.connect(l,t),this.connect(h,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,l=this.all_indices.count;this.decimated=new u.Indices(l);for(let e=0;e<l;e+=s)this.decimated.set(e);this.plot_view.invalidate_dataranges=!0}set_visuals(){var e,t;const i=this.model.data_source,{all_indices:s}=this;this.glyph.set_visuals(i,s),this.glyph.after_visuals(),this.decimated_glyph.set_visuals(i,s),this.decimated_glyph.after_visuals(),this.selection_glyph.set_visuals(i,s),this.selection_glyph.after_visuals(),this.nonselection_glyph.set_visuals(i,s),this.nonselection_glyph.after_visuals(),null===(e=this.hover_glyph)||void 0===e||e.set_visuals(i,s),null===(t=this.hover_glyph)||void 0===t||t.after_visuals(),this.muted_glyph.set_visuals(i,s),this.muted_glyph.after_visuals()}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:l}=this.model.data_source,h=(()=>l.is_empty()?[]:this.glyph instanceof o.LineView&&l.selected_glyph===this.glyph.model?this.model.view.convert_indices_from_subset(i):l.indices)(),{inspected:n}=this.model.data_source;this._previous_inspected={indices:n.indices,line_indices:n.line_indices,multiline_indices:n.multiline_indices,image_indices:n.image_indices,selected_glyphs:n.selected_glyphs};const p=new Set((()=>n.is_empty()?[]:null!=n.selected_glyph?this.model.view.convert_indices_from_subset(i):n.indices.length>0?n.indices:Object.keys(n.multiline_indices).map((e=>parseInt(e))))()),g=(0,m.filter)(i,(e=>p.has(t[e]))),{lod_threshold:y}=this.plot_model;let u,v,f;if(null!=this.model.document&&this.model.document.interactive_duration()>0&&!e&&null!=y&&t.length>y?(i=[...this.decimated],u=this.decimated_glyph,v=this.decimated_glyph,f=this.selection_glyph):(u=this.model.muted?this.muted_glyph:this.glyph,v=this.nonselection_glyph,f=this.selection_glyph),null!=this.hover_glyph&&0!=g.length){const e=new Set(i);for(const t of g)e.delete(t);i=[...e]}if(0==h.length)if(this.glyph instanceof o.LineView)null!=this.hover_glyph&&0!=g.length?this.hover_glyph.render(s,this.model.view.convert_indices_from_subset(g)):u.render(s,t);else if(this.glyph instanceof a.PatchView||this.glyph instanceof d.HAreaView||this.glyph instanceof r.VAreaView||this.glyph instanceof _.VAreaStepView||this.glyph instanceof c.HAreaStepView)if(0==n.selected_glyphs.length||null==this.hover_glyph)u.render(s,t);else for(const e of n.selected_glyphs)e==this.glyph.model&&this.hover_glyph.render(s,t);else u.render(s,i),null!=this.hover_glyph&&0!=g.length&&this.hover_glyph.render(s,g);else{const e=new Set(h),l=new Array,n=new Array;if(this.glyph instanceof o.LineView)for(const i of t)e.has(i)?l.push(i):n.push(i);else for(const s of i)e.has(t[s])?l.push(s):n.push(s);v.render(s,n),f.render(s,l),null!=this.hover_glyph&&(this.glyph instanceof o.LineView?this.hover_glyph.render(s,this.model.view.convert_indices_from_subset(g)):this.hover_glyph.render(s,g))}s.restore()}get_reference_point(e,t){if(null!=e){const i=this.model.data_source.get_column(e);if(null!=i)for(const[e,s]of(0,v.entries)(this.model.view.indices_map))if(i[parseInt(e)]==t)return s}return 0}draw_legend(e,t,i,s,l,h,n,o){if(0==this.glyph.data_size)return;const a=(()=>{if(null==o)return this.get_reference_point(h,n);{const{indices_map:e}=this.model.view;return o in e?e[o]:null}})();null!=a&&this.glyph.draw_legend_for_index(e,{x0:t,x1:i,y0:s,y1:l},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=S,S.__name__="GlyphRendererView";class A extends n.DataRenderer{constructor(e){super(e)}get_selection_manager(){return this.data_source.selection_manager}add_decoration(e,t){const i=new V.Decoration({marking:e,node:t}),s=[this.glyph,this.selection_glyph,this.nonselection_glyph,this.hover_glyph,this.muted_glyph];for(const e of s)e instanceof p.Glyph&&(e.decorations=[...e.decorations,i]);return i}}i.GlyphRenderer=A,h=A,A.__name__="GlyphRenderer",h.prototype.default_view=S,h.define((({Boolean:e,Auto:t,Or:i,Ref:s,Null:l,Nullable:h})=>({data_source:[s(g.ColumnarDataSource)],view:[s(y.CDSView),()=>new y.CDSView],glyph:[s(p.Glyph)],hover_glyph:[h(s(p.Glyph)),null],nonselection_glyph:[i(s(p.Glyph),t,l),"auto"],selection_glyph:[i(s(p.Glyph),t,l),"auto"],muted_glyph:[i(s(p.Glyph),t,l),"auto"],muted:[e,!1]})))},
function _(e,r,t,n,s){var a,o;n();const _=e(74),i=e(95);class c extends _.RendererView{constructor(){super(...arguments),this[a]=!0}get xscale(){return this.coordinates.x_scale}get yscale(){return this.coordinates.y_scale}bounds(){return this.glyph_view.bounds()}log_bounds(){return this.glyph_view.log_bounds()}}t.DataRendererView=c,a=i.auto_ranged,c.__name__="DataRendererView";class d extends _.Renderer{constructor(e){super(e)}get selection_manager(){return this.get_selection_manager()}}t.DataRenderer=d,o=d,d.__name__="DataRenderer",o.override({level:"glyph"})},
function _(e,t,i,n,s){var l;n();const o=e(1),_=e(204),r=e(211),h=o.__importStar(e(78)),c=o.__importStar(e(212)),a=e(103);class d extends _.XYGlyphView{async load_glglyph(){const{LineGL:t}=await Promise.resolve().then((()=>o.__importStar(e(542))));return t}_render(e,t,i){const{sx:n,sy:s}=null!=i?i:this,l=this.parent.nonselection_glyph==this;let o=null;const _=e=>null!=o&&e-o!=1;let r=!0;e.beginPath();for(const i of t){const t=n[i],h=s[i];l&&!r&&null!=o&&i-o>1&&isFinite(n[o+1]+s[o+1])&&e.lineTo(n[o+1],s[o+1]),isFinite(t+h)?(r||_(i)?(l&&i>0&&isFinite(n[i-1]+s[i-1])?(e.moveTo(n[i-1],s[i-1]),e.lineTo(t,h)):e.moveTo(t,h),r=!1):e.lineTo(t,h),o=i):r=!0}if(l&&!r&&null!=o){const t=n.length;o<t-1&&isFinite(n[o+1]+s[o+1])&&e.lineTo(n[o+1],s[o+1])}this.visuals.line.set_value(e),e.stroke()}_hit_point(e){const t=new a.Selection,i={x:e.sx,y:e.sy};let n=9999;const s=Math.max(2,this.line_width.value/2);for(let e=0,l=this.sx.length-1;e<l;e++){const l={x:this.sx[e],y:this.sy[e]},o={x:this.sx[e+1],y:this.sy[e+1]},_=c.dist_to_segment(i,l,o);_<s&&_<n&&(n=_,t.add_to_selected_glyphs(this.model),t.view=this,t.line_indices=[e])}return t}_hit_span(e){const{sx:t,sy:i}=e;let n,s;"v"==e.direction?(n=this.renderer.yscale.invert(i),s=this._y):(n=this.renderer.xscale.invert(t),s=this._x);const l=[];for(let e=0,t=s.length-1;e<t;e++){const t=s[e],i=s[e+1];(t<=n&&n<=i||i<=n&&n<=t)&&l.push(e)}const o=new a.Selection;return 0!=l.length&&(o.add_to_selected_glyphs(this.model),o.view=this,o.line_indices=l),o}get_interpolation_hit(e,t){const[i,n,s,l]=[this._x[e],this._y[e],this._x[e+1],this._y[e+1]];return(0,r.line_interpolation)(this.renderer,t,i,n,s,l)}draw_legend_for_index(e,t,i){(0,r.generic_line_scalar_legend)(this.visuals,e,t)}}i.LineView=d,d.__name__="LineView";class y extends _.XYGlyph{constructor(e){super(e)}}i.Line=y,l=y,y.__name__="Line",l.prototype.default_view=d,l.mixins(h.LineScalar)},
function _(e,t,_,s,i){var n;s();const a=e(1),o=e(107),c=a.__importStar(e(18)),p=e(205);class r extends p.GlyphView{_project_data(){o.inplace.project_xy(this._x,this._y)}_index_data(e){const{_x:t,_y:_,data_size:s}=this;for(let i=0;i<s;i++){const s=t[i],n=_[i];e.add_point(s,n)}}scenterxy(e){return[this.sx[e],this.sy[e]]}}_.XYGlyphView=r,r.__name__="XYGlyphView";class d extends p.Glyph{constructor(e){super(e)}}_.XYGlyph=d,n=d,d.__name__="XYGlyph",n.define((({})=>({x:[c.XCoordinateSpec,{field:"x"}],y:[c.YCoordinateSpec,{field:"y"}]})))},
function _(e,t,s,i,n){var a;i();const r=e(1),o=r.__importStar(e(18)),l=r.__importStar(e(57)),_=r.__importStar(e(75)),c=e(29),h=e(54),d=e(50),u=e(59),f=e(19),p=e(24),g=e(8),y=e(206),v=e(13),w=e(26),x=e(207),m=e(98),b=e(103),S=e(210),{abs:z,ceil:$}=Math;class k extends h.View{constructor(){super(...arguments),this._index=null,this._data_size=null,this._nohit_warned=new Set,this.decorations=new Map}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{base:e}=this;if(null!=e)return e.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 _.Visuals(this)}*children(){yield*super.children(),yield*this.decorations.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,u.build_views)(this.decorations,this.model.decorations,{parent:this.parent});const{webgl:e}=this.canvas;if(null!=e&&null!=this.load_glglyph){const t=await this.load_glglyph();this.glglyph=new t(e.regl_wrapper,this)}}request_render(){this.parent.request_render()}get canvas(){return this.renderer.parent.canvas_view}render(e,t,s){var i;if(null!=this.glglyph)this.glglyph.render(e,t,null!==(i=this.base)&&void 0!==i?i:this);else{if(null!=this.canvas.webgl&&c.settings.force_webgl)throw new Error(`${this} doesn't support webgl rendering`);this._render(e,t,null!=s?s: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(l.positive_x()),{y0:s,y1:i}=this.index.bounds(l.positive_y());return this._bounds({x0:e,y0:s,x1:t,y1:i})}get_anchor_point(e,t,[s,i]){switch(e){case"center":case"center_center":{const[e,n]=this.scenterxy(t,s,i);return{x:e,y:n}}default:return null}}sdist(e,t,s,i="edge",n=!1){const a=t.length,r=new p.ScreenArray(a),o=e.s_compute;if("center"==i)for(let e=0;e<a;e++){const i=t[e],n=s.get(e)/2,a=o(i-n),l=o(i+n);r[e]=z(l-a)}else for(let e=0;e<a;e++){const i=t[e],n=o(i),a=o(i+s.get(e));r[e]=z(a-n)}return n&&(0,v.inplace_map)(r,(e=>$(e))),r}draw_legend_for_index(e,t,s){}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)||(f.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:s,sy0:i,sy1:n}=e,[a,r]=this.renderer.coordinates.x_scale.r_invert(t,s),[o,l]=this.renderer.coordinates.y_scale.r_invert(i,n),_=[...this.index.indices({x0:a,x1:r,y0:o,y1:l})];return new b.Selection({indices:_})}_project_data(){}*_iter_visuals(){for(const e of this.visuals)for(const t of e)(t instanceof o.VectorSpec||t instanceof o.ScalarSpec)&&(yield t)}set_base(e){e!=this&&e instanceof this.constructor&&(this.base=e)}_configure(e,t){Object.defineProperty(this,(0,g.isString)(e)?e:e.attr,Object.assign({configurable:!0,enumerable:!0},t))}set_visuals(e,t){var s;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,w.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 e of this.visuals)e.update();null===(s=this.glglyph)||void 0===s||s.set_visuals_changed()}set_data(e,t,s){var i;const{x_source:n,y_source:a}=this.renderer.coordinates,r=new Set(this._iter_visuals());this._data_size=t.count;for(const s of this.model)if((s instanceof o.VectorSpec||s instanceof o.ScalarSpec)&&!r.has(s))if(s instanceof o.BaseCoordinateSpec){const i=s.array(e);let r=t.select(i);const l="x"==s.dimension?n:a;if(l instanceof m.FactorRange)if(s instanceof o.CoordinateSpec)r=l.v_synthetic(r);else if(s instanceof o.CoordinateSeqSpec)for(let e=0;e<r.length;e++)r[e]=l.v_synthetic(r[e]);let _;_=s instanceof o.CoordinateSeqSpec?y.RaggedArray.from(r,Float64Array):r,this._configure(`_${s.attr}`,{value:_})}else{const i=s.uniform(e).select(t);if(this._configure(s,{value:i}),s instanceof o.DistanceSpec){const e=i.is_Scalar()?i.value:(0,v.max)(i.array);this._configure(`max_${s.attr}`,{value:e})}}this.renderer.plot_view.model.use_map&&this._project_data(),this._set_data(null!=s?s:null);for(const s of this.decorations.values())s.marking.set_data(e,t);null===(i=this.glglyph)||void 0===i||i.set_data_changed(),this.index_data()}_set_data(e){}after_visuals(){}get _index_size(){return this.data_size}index_data(){const e=new x.SpatialIndex(this._index_size);this._index_data(e),e.finish(),this._index=e}mask_data(){return null==this._mask_data?p.Indices.all_set(this.data_size):this._mask_data()}map_data(){var e;const t=this,{x_scale:s,y_scale:i}=this.renderer.coordinates;for(const e of this.model)if(e instanceof o.BaseCoordinateSpec){const n="x"==e.dimension?s:i;let a=t[`_${e.attr}`];if(a instanceof y.RaggedArray){const e=n.v_compute(a.array);a=new y.RaggedArray(a.offsets,e)}else a=n.v_compute(a);this[`s${e.attr}`]=a}this._map_data(),null===(e=this.glglyph)||void 0===e||e.set_data_mapped()}_map_data(){}}s.GlyphView=k,k.__name__="GlyphView";class A extends d.Model{constructor(e){super(e)}}s.Glyph=A,a=A,A.__name__="Glyph",a.define((({Array:e,Ref:t})=>({decorations:[e(t(S.Decoration)),[]]})))},
function _(t,s,r,e,a){var n;e();const o=t(26),h=t(12);class i{constructor(t,s){this.offsets=t,this.array=s}[(n=Symbol.toStringTag,o.equals)](t,s){return s.arrays(this.offsets,t.offsets)&&s.arrays(this.array,t.array)}get length(){return this.offsets.length}clone(){return new i(this.offsets.slice(),this.array.slice())}static from(t,s){const r=t.length;let e=0;const a=(()=>{const s=new Uint32Array(r);for(let a=0;a<r;a++){const r=t[a].length;s[a]=e,e+=r}return e<256?new Uint8Array(s):e<65536?new Uint16Array(s):s})(),n=new s(e);for(let s=0;s<r;s++)n.set(t[s],a[s]);return new i(a,n)}*[Symbol.iterator](){const{offsets:t,length:s}=this;for(let r=0;r<s;r++)yield this.array.subarray(t[r],t[r+1])}_check_bounds(t){(0,h.assert)(0<=t&&t<this.length,`Out of bounds: 0 <= ${t} < ${this.length}`)}get(t){this._check_bounds(t);const{offsets:s}=this;return this.array.subarray(s[t],s[t+1])}set(t,s){this._check_bounds(t),this.array.set(s,this.offsets[t])}}r.RaggedArray=i,i.__name__="RaggedArray",i[n]="RaggedArray"},
function _(i,t,n,e,s){e();const d=i(1).__importDefault(i(208)),o=i(24),x=i(57);function h(i,t){let n=0,e=t.length-1;for(;n<e;){const s=n+e>>1;t[s]>i?e=s:n=s+1}return t[n]}class r extends d.default{get boxes(){return this._boxes}search_indices(i,t,n,e){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let s=this._boxes.length-4;const d=[],x=new o.Indices(this.numItems);for(;void 0!==s;){const o=Math.min(s+4*this.nodeSize,h(s,this._levelBounds));for(let h=s;h<o;h+=4){const o=0|this._indices[h>>2],r=this._boxes[h+0],l=this._boxes[h+1],a=this._boxes[h+2],_=this._boxes[h+3];n<r||(e<l||i>a||t>_||(s<4*this.numItems?x.set(o):d.push(o)))}s=d.pop()}return x}}r.__name__="_FlatBush";class l{constructor(i){this.index=null,i>0&&(this.index=new r(i))}add_rect(i,t,n,e){var s;isFinite(i+t+n+e)?null===(s=this.index)||void 0===s||s.add(i,t,n,e):this.add_empty()}add_point(i,t){var n;isFinite(i+t)?null===(n=this.index)||void 0===n||n.add(i,t,i,t):this.add_empty()}add_empty(){var i;null===(i=this.index)||void 0===i||i.add(1/0,1/0,-1/0,-1/0)}finish(){var i;null===(i=this.index)||void 0===i||i.finish()}_normalize(i){let{x0:t,y0:n,x1:e,y1:s}=i;return t>e&&([t,e]=[e,t]),n>s&&([n,s]=[s,n]),{x0:t,y0:n,x1:e,y1:s}}get bbox(){if(null==this.index)return(0,x.empty)();{const{minX:i,minY:t,maxX:n,maxY:e}=this.index;return{x0:i,y0:t,x1:n,y1:e}}}indices(i){if(null==this.index)return new o.Indices(0);{const{x0:t,y0:n,x1:e,y1:s}=this._normalize(i);return this.index.search_indices(t,n,e,s)}}bounds(i){const t=(0,x.empty)();if(null==this.index)return t;const{boxes:n}=this.index;for(const e of this.indices(i)){const s=n[4*e+0],d=n[4*e+1],o=n[4*e+2],x=n[4*e+3];s>=i.x0&&s<t.x0&&(t.x0=s),o<=i.x1&&o>t.x1&&(t.x1=o),d>=i.y0&&d<t.y0&&(t.y0=d),x<=i.y1&&x>t.y1&&(t.y1=x)}return t}}n.SpatialIndex=l,l.__name__="SpatialIndex"},
function _(t,i,s,e,n){e();const h=t(1).__importDefault(t(209)),o=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class r{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[i,s]=new Uint8Array(t,0,2);if(251!==i)throw new Error("Data does not appear to be in a Flatbush format.");const e=s>>4;if(3!==e)throw new Error(`Got v${e} data when expected v3.`);const n=o[15&s];if(!n)throw new Error("Unrecognized array type.");const[h]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new r(a,h,n,void 0,t)}constructor(t,i=16,s=Float64Array,e=ArrayBuffer,n){if(void 0===t)throw new Error("Missing required argument: numItems.");if(isNaN(t)||t<=0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+i,2),65535);let r=t,a=r;this._levelBounds=[4*r];do{r=Math.ceil(r/this.nodeSize),a+=r,this._levelBounds.push(4*a)}while(1!==r);this.ArrayType=s,this.IndexArrayType=a<16384?Uint16Array:Uint32Array;const d=o.indexOf(this.ArrayType),_=4*a*this.ArrayType.BYTES_PER_ELEMENT;if(d<0)throw new Error(`Unexpected typed array class: ${s}.`);n&&void 0!==n.byteLength&&!n.buffer?(this.data=n,this._boxes=new this.ArrayType(this.data,8,4*a),this._indices=new this.IndexArrayType(this.data,8+_,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 e(8+_+a*this.IndexArrayType.BYTES_PER_ELEMENT),this._boxes=new this.ArrayType(this.data,8,4*a),this._indices=new this.IndexArrayType(this.data,8+_,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+d]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=t),this._queue=new h.default}add(t,i,s,e){const n=this._pos>>2,h=this._boxes;return this._indices[n]=n,h[this._pos++]=t,h[this._pos++]=i,h[this._pos++]=s,h[this._pos++]=e,t<this.minX&&(this.minX=t),i<this.minY&&(this.minY=i),s>this.maxX&&(this.maxX=s),e>this.maxY&&(this.maxY=e),n}finish(){if(this._pos>>2!==this.numItems)throw new Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);const t=this._boxes;if(this.numItems<=this.nodeSize)return t[this._pos++]=this.minX,t[this._pos++]=this.minY,t[this._pos++]=this.maxX,void(t[this._pos++]=this.maxY);const i=this.maxX-this.minX||1,s=this.maxY-this.minY||1,e=new Uint32Array(this.numItems);for(let n=0,h=0;n<this.numItems;n++){const o=t[h++],r=t[h++],a=t[h++],d=t[h++],_=Math.floor(65535*((o+a)/2-this.minX)/i),m=Math.floor(65535*((r+d)/2-this.minY)/s);e[n]=u(_,m)}_(e,t,this._indices,0,this.numItems-1,this.nodeSize);for(let i=0,s=0;i<this._levelBounds.length-1;i++){const e=this._levelBounds[i];for(;s<e;){const i=s;let n=t[s++],h=t[s++],o=t[s++],r=t[s++];for(let i=1;i<this.nodeSize&&s<e;i++)n=Math.min(n,t[s++]),h=Math.min(h,t[s++]),o=Math.max(o,t[s++]),r=Math.max(r,t[s++]);this._indices[this._pos>>2]=i,t[this._pos++]=n,t[this._pos++]=h,t[this._pos++]=o,t[this._pos++]=r}}}search(t,i,s,e,n){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let h=this._boxes.length-4;const o=[],r=[];for(;void 0!==h;){const a=Math.min(h+4*this.nodeSize,d(h,this._levelBounds));for(let d=h;d<a;d+=4){if(s<this._boxes[d])continue;if(e<this._boxes[d+1])continue;if(t>this._boxes[d+2])continue;if(i>this._boxes[d+3])continue;const a=0|this._indices[d>>2];h>=4*this.numItems?o.push(a):(void 0===n||n(a))&&r.push(a)}h=o.pop()}return r}neighbors(t,i,s=1/0,e=1/0,n){if(this._pos!==this._boxes.length)throw new Error("Data not yet indexed - call index.finish().");let h=this._boxes.length-4;const o=this._queue,r=[],_=e*e;t:for(;void 0!==h;){const e=Math.min(h+4*this.nodeSize,d(h,this._levelBounds));for(let s=h;s<e;s+=4){const e=0|this._indices[s>>2],r=a(t,this._boxes[s],this._boxes[s+2]),d=a(i,this._boxes[s+1],this._boxes[s+3]),m=r*r+d*d;m>_||(h>=4*this.numItems?o.push(e<<1,m):(void 0===n||n(e))&&o.push(1+(e<<1),m))}for(;o.length&&1&o.peek();){if(o.peekValue()>_)break t;if(r.push(o.pop()>>1),r.length===s)break t}h=o.length?o.pop()>>1:void 0}return o.clear(),r}}function a(t,i,s){return t<i?i-t:t<=s?0:t-s}function d(t,i){let s=0,e=i.length-1;for(;s<e;){const n=s+e>>1;i[n]>t?e=n:s=n+1}return i[s]}function _(t,i,s,e,n,h){if(Math.floor(e/h)>=Math.floor(n/h))return;const o=t[e+n>>1];let r=e-1,a=n+1;for(;;){do{r++}while(t[r]<o);do{a--}while(t[a]>o);if(r>=a)break;m(t,i,s,r,a)}_(t,i,s,e,a,h),_(t,i,s,a+1,n,h)}function m(t,i,s,e,n){const h=t[e];t[e]=t[n],t[n]=h;const o=4*e,r=4*n,a=i[o],d=i[o+1],_=i[o+2],m=i[o+3];i[o]=i[r],i[o+1]=i[r+1],i[o+2]=i[r+2],i[o+3]=i[r+3],i[r]=a,i[r+1]=d,i[r+2]=_,i[r+3]=m;const u=s[e];s[e]=s[n],s[n]=u}function u(t,i){let s=t^i,e=65535^s,n=65535^(t|i),h=t&(65535^i),o=s|e>>1,r=s>>1^s,a=n>>1^e&h>>1^n,d=s&n>>1^h>>1^h;s=o,e=r,n=a,h=d,o=s&s>>2^e&e>>2,r=s&e>>2^e&(s^e)>>2,a^=s&n>>2^e&h>>2,d^=e&n>>2^(s^e)&h>>2,s=o,e=r,n=a,h=d,o=s&s>>4^e&e>>4,r=s&e>>4^e&(s^e)>>4,a^=s&n>>4^e&h>>4,d^=e&n>>4^(s^e)&h>>4,s=o,e=r,n=a,h=d,a^=s&n>>8^e&h>>8,d^=e&n>>8^(s^e)&h>>8,s=a^a>>1,e=d^d>>1;let _=t^i,m=e|65535^(_|s);return _=16711935&(_|_<<8),_=252645135&(_|_<<4),_=858993459&(_|_<<2),_=1431655765&(_|_<<1),m=16711935&(m|m<<8),m=252645135&(m|m<<4),m=858993459&(m|m<<2),m=1431655765&(m|m<<1),(m<<1|_)>>>0}s.default=r},
function _(s,t,i,h,e){h();i.default=class{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(s,t){let i=this.length++;for(;i>0;){const s=i-1>>1,h=this.values[s];if(t>=h)break;this.ids[i]=this.ids[s],this.values[i]=h,i=s}this.ids[i]=s,this.values[i]=t}pop(){if(0===this.length)return;const s=this.ids[0];if(this.length--,this.length>0){const s=this.ids[0]=this.ids[this.length],t=this.values[0]=this.values[this.length],i=this.length>>1;let h=0;for(;h<i;){let s=1+(h<<1);const i=s+1;let e=this.ids[s],l=this.values[s];const n=this.values[i];if(i<this.length&&n<l&&(s=i,e=this.ids[i],l=n),l>=t)break;this.ids[h]=e,this.values[h]=l,h=s}this.ids[h]=s,this.values[h]=t}return s}peek(){if(0!==this.length)return this.ids[0]}peekValue(){if(0!==this.length)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}},
function _(e,i,n,a,t){var r;a();const o=e(142),s=e(50),d=e(54),l=e(59);class c extends d.View{*children(){yield*super.children(),yield this.marking}async lazy_initialize(){await super.lazy_initialize(),this.marking=await(0,l.build_view)(this.model.marking,{parent:this.parent})}}n.DecorationView=c,c.__name__="DecorationView";class _ extends s.Model{constructor(e){super(e)}}n.Decoration=_,r=_,_.__name__="Decoration",r.prototype.default_view=c,r.define((({Enum:e,Ref:i})=>({marking:[i(o.Marking)],node:[e("start","middle","end")]})))},
function _(e,n,a,t,i){t();const l=e(1).__importStar(e(212));function r(e,n,{x0:a,x1:t,y0:i,y1:l},r){n.save(),n.beginPath(),n.moveTo(a,(i+l)/2),n.lineTo(t,(i+l)/2),e.line.apply(n,r),n.restore()}function c(e,n,{x0:a,x1:t,y0:i,y1:l},r){var c,o;const _=.1*Math.abs(t-a),s=.1*Math.abs(l-i),y=a+_,p=t-_,g=i+s,h=l-s;n.beginPath(),n.rect(y,g,p-y,h-g),e.fill.apply(n,r),null===(c=e.hatch)||void 0===c||c.apply(n,r),null===(o=e.line)||void 0===o||o.apply(n,r)}a.generic_line_scalar_legend=function(e,n,{x0:a,x1:t,y0:i,y1:l}){n.save(),n.beginPath(),n.moveTo(a,(i+l)/2),n.lineTo(t,(i+l)/2),e.line.apply(n),n.restore()},a.generic_line_vector_legend=r,a.generic_line_legend=r,a.generic_area_scalar_legend=function(e,n,{x0:a,x1:t,y0:i,y1:l}){var r,c;const o=.1*Math.abs(t-a),_=.1*Math.abs(l-i),s=a+o,y=t-o,p=i+_,g=l-_;n.beginPath(),n.rect(s,p,y-s,g-p),e.fill.apply(n),null===(r=e.hatch)||void 0===r||r.apply(n),null===(c=e.line)||void 0===c||c.apply(n)},a.generic_area_vector_legend=c,a.generic_area_legend=c,a.line_interpolation=function(e,n,a,t,i,r){const{sx:c,sy:o}=n;let _,s,y,p;"point"==n.type?([y,p]=e.yscale.r_invert(o-1,o+1),[_,s]=e.xscale.r_invert(c-1,c+1)):"v"==n.direction?([y,p]=e.yscale.r_invert(o,o),[_,s]=[Math.min(a-1,i-1),Math.max(a+1,i+1)]):([_,s]=e.xscale.r_invert(c,c),[y,p]=[Math.min(t-1,r-1),Math.max(t+1,r+1)]);const{x:g,y:h}=l.check_2_segments_intersect(_,y,s,p,a,t,i,r);return[g,h]}},
function _(t,n,e,i,r){function s(t,n){return(t.x-n.x)**2+(t.y-n.y)**2}function o(t,n,e){const i=s(n,e);if(0==i)return s(t,n);const r=((t.x-n.x)*(e.x-n.x)+(t.y-n.y)*(e.y-n.y))/i;if(r<0)return s(t,n);if(r>1)return s(t,e);return s(t,{x:n.x+r*(e.x-n.x),y:n.y+r*(e.y-n.y)})}i(),e.point_in_poly=function(t,n,e,i){let r=!1,s=e[e.length-1],o=i[i.length-1];for(let u=0;u<e.length;u++){const c=e[u],_=i[u];o<n!=_<n&&s+(n-o)/(_-o)*(c-s)<t&&(r=!r),s=c,o=_}return r},e.point_in_ellipse=function(t,n,e,i,r,s,o){return((Math.cos(e)/r)**2+(Math.sin(e)/i)**2)*(t-s)**2+2*Math.cos(e)*Math.sin(e)*((1/r)**2-(1/i)**2)*(t-s)*(n-o)+((Math.cos(e)/i)**2+(Math.sin(e)/r)**2)*(n-o)**2<=1},e.dist_2_pts=s,e.dist_to_segment_squared=o,e.dist_to_segment=function(t,n,e){return Math.sqrt(o(t,n,e))},e.check_2_segments_intersect=function(t,n,e,i,r,s,o,u){const c=(u-s)*(e-t)-(o-r)*(i-n);if(0==c)return{hit:!1,x:null,y:null};{let _=n-s,h=t-r;const l=(e-t)*_-(i-n)*h;_=((o-r)*_-(u-s)*h)/c,h=l/c;return{hit:_>0&&_<1&&h>0&&h<1,x:t+_*(e-t),y:n+_*(i-n)}}}},
function _(t,s,e,i,a){var l;i();const n=t(1),_=t(204),o=t(211),c=n.__importStar(t(212)),h=n.__importStar(t(78)),r=t(103);class p extends _.XYGlyphView{_render(t,s,e){const{sx:i,sy:a}=null!=e?e:this;let l=!0;t.beginPath();for(const e of s){const s=i[e],n=a[e];isFinite(s+n)?l?(t.moveTo(s,n),l=!1):t.lineTo(s,n):(t.closePath(),l=!0)}t.closePath(),this.visuals.fill.apply(t),this.visuals.hatch.apply(t),this.visuals.line.apply(t)}draw_legend_for_index(t,s,e){(0,o.generic_area_scalar_legend)(this.visuals,t,s)}_hit_point(t){const s=new r.Selection;return c.point_in_poly(t.sx,t.sy,this.sx,this.sy)&&(s.add_to_selected_glyphs(this.model),s.view=this),s}}e.PatchView=p,p.__name__="PatchView";class d extends _.XYGlyph{constructor(t){super(t)}}e.Patch=d,l=d,d.__name__="Patch",l.prototype.default_view=p,l.mixins([h.LineScalar,h.FillScalar,h.HatchScalar])},
function _(e,t,s,i,a){var o;i();const r=e(1),n=e(215),_=r.__importStar(e(212)),l=r.__importStar(e(18)),h=e(20),c=e(216),p=e(103);class d extends n.AreaView{_index_data(e){const{min:t,max:s}=Math;for(let i=0;i<this.data_size;i++){const a=this._x1[i],o=this._x2[i],r=this._y[i];e.add_rect(t(a,o),r,s(a,o),r)}}_step_path(e,t,s,i,a,o){let r=s[a],n=i[a];const _=a<o?1:-1;for(let l=a+_;l!=o;l+=_){switch(t){case"before":e.lineTo(s[l],n),e.lineTo(s[l],i[l]);break;case"after":e.lineTo(r,i[l]),e.lineTo(s[l],i[l]);break;case"center":{const t=(n+i[l])/2;e.lineTo(r,t),e.lineTo(s[l],t),e.lineTo(s[l],i[l]);break}}r=s[l],n=i[l]}}_render(e,t,s){const{sx1:i,sx2:a,sy:o}=null!=s?s:this,r=this.model.step_mode,n=(0,c.flip_step_mode)(this.model.step_mode);e.beginPath(),e.moveTo(i[0],o[0]),this._step_path(e,r,i,o,0,o.length),this._step_path(e,n,a,o,o.length,-1),e.closePath(),this.visuals.fill.apply(e),this.visuals.hatch.apply(e)}scenterxy(e){return[(this.sx1[e]+this.sx2[e])/2,this.sy[e]]}_hit_point(e){const{sx1:t,sx2:s,sy:i}=this;for(let a=0;a<this.data_size-1;a++){let o,r;switch(this.model.step_mode){case"before":o=[i[a],i[a+1],i[a+1],i[a]],r=[t[a+1],t[a+1],s[a+1],s[a+1]];break;case"after":o=[i[a],i[a+1],i[a+1],i[a]],r=[t[a],t[a],s[a],s[a]];break;case"center":{const e=(i[a]+i[a+1])/2;o=[i[a],e,e,i[a+1],i[a+1],e,e,i[a]],r=[t[a],t[a],t[a+1],t[a+1],s[a+1],s[a+1],s[a],s[a]];break}}if(_.point_in_poly(e.sx,e.sy,o,r)){const e=new p.Selection;return e.add_to_selected_glyphs(this.model),e.view=this,e.line_indices=[a],e}}return new p.Selection}_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)}}s.HAreaStepView=d,d.__name__="HAreaStepView";class x extends n.Area{constructor(e){super(e)}}s.HAreaStep=x,o=x,x.__name__="HAreaStep",o.prototype.default_view=d,o.define((({})=>({x1:[l.XCoordinateSpec,{field:"x1"}],x2:[l.YCoordinateSpec,{field:"x2"}],y:[l.YCoordinateSpec,{field:"y"}],step_mode:[h.StepMode,"before"]})))},
function _(e,a,r,_,s){var n;_();const i=e(1),l=e(205),c=e(211),t=i.__importStar(e(78));class d extends l.GlyphView{draw_legend_for_index(e,a,r){(0,c.generic_area_scalar_legend)(this.visuals,e,a)}}r.AreaView=d,d.__name__="AreaView";class o extends l.Glyph{constructor(e){super(e)}}r.Area=o,n=o,o.__name__="Area",n.mixins([t.FillScalar,t.HatchScalar])},
function _(e,r,t,n,c){n(),t.flip_step_mode=function(e){switch(e){case"before":return"after";case"after":return"before";case"center":return"center"}}},
function _(t,s,e,i,h){var n;i();const r=t(1),a=t(215),_=r.__importStar(t(212)),o=r.__importStar(t(18)),l=t(103);class c extends a.AreaView{_index_data(t){const{min:s,max:e}=Math,{data_size:i}=this;for(let h=0;h<i;h++){const i=this._x1[h],n=this._x2[h],r=this._y[h];t.add_rect(s(i,n),r,e(i,n),r)}}_render(t,s,e){const{sx1:i,sx2:h,sy:n}=null!=e?e:this;t.beginPath();for(let s=0,e=i.length;s<e;s++)t.lineTo(i[s],n[s]);for(let s=h.length-1;s>=0;s--)t.lineTo(h[s],n[s]);t.closePath(),this.visuals.fill.apply(t),this.visuals.hatch.apply(t)}_hit_point(t){const s=this.sy.length,e=new l.Selection;for(let i=0,h=s-1;i<h;i++){const s=[this.sx1[i],this.sx1[i+1],this.sx2[i+1],this.sx2[i]],h=[this.sy[i],this.sy[i+1],this.sy[i+1],this.sy[i]];if(_.point_in_poly(t.sx,t.sy,s,h)){e.add_to_selected_glyphs(this.model),e.view=this,e.line_indices=[i];break}}return e}scenterxy(t){return[(this.sx1[t]+this.sx2[t])/2,this.sy[t]]}_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)}}e.HAreaView=c,c.__name__="HAreaView";class x extends a.Area{constructor(t){super(t)}}e.HArea=x,n=x,x.__name__="HArea",n.prototype.default_view=c,n.define((({})=>({x1:[o.XCoordinateSpec,{field:"x1"}],x2:[o.XCoordinateSpec,{field:"x2"}],y:[o.YCoordinateSpec,{field:"y"}]})))},
function _(e,t,s,i,a){var o;i();const r=e(1),n=e(215),_=r.__importStar(e(212)),l=r.__importStar(e(18)),h=e(20),c=e(216),p=e(103);class d extends n.AreaView{_index_data(e){const{min:t,max:s}=Math;for(let i=0;i<this.data_size;i++){const a=this._x[i],o=this._y1[i],r=this._y2[i];e.add_rect(a,t(o,r),a,s(o,r))}}_step_path(e,t,s,i,a,o){let r=s[a],n=i[a];const _=a<o?1:-1;for(let l=a+_;l!=o;l+=_){switch(t){case"before":e.lineTo(r,i[l]),e.lineTo(s[l],i[l]);break;case"after":e.lineTo(s[l],n),e.lineTo(s[l],i[l]);break;case"center":{const t=(r+s[l])/2;e.lineTo(t,n),e.lineTo(t,i[l]),e.lineTo(s[l],i[l]);break}}r=s[l],n=i[l]}}_render(e,t,s){const{sx:i,sy1:a,sy2:o}=null!=s?s:this,r=this.model.step_mode,n=(0,c.flip_step_mode)(this.model.step_mode);e.beginPath(),e.moveTo(i[0],a[0]),this._step_path(e,r,i,a,0,i.length),this._step_path(e,n,i,o,i.length,-1),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{sx:t,sy1:s,sy2:i}=this;for(let a=0;a<this.data_size-1;a++){let o,r;switch(this.model.step_mode){case"before":o=[t[a],t[a+1],t[a+1],t[a]],r=[s[a+1],s[a+1],i[a+1],i[a+1]];break;case"after":o=[t[a],t[a+1],t[a+1],t[a]],r=[s[a],s[a],i[a],i[a]];break;case"center":{const e=(t[a]+t[a+1])/2;o=[t[a],e,e,t[a+1],t[a+1],e,e,t[a]],r=[s[a],s[a],s[a+1],s[a+1],i[a+1],i[a+1],i[a],i[a]];break}}if(_.point_in_poly(e.sx,e.sy,o,r)){const e=new p.Selection;return e.add_to_selected_glyphs(this.model),e.view=this,e.line_indices=[a],e}}return new p.Selection}_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)}}s.VAreaStepView=d,d.__name__="VAreaStepView";class y extends n.Area{constructor(e){super(e)}}s.VAreaStep=y,o=y,y.__name__="VAreaStep",o.prototype.default_view=d,o.define((({})=>({x:[l.XCoordinateSpec,{field:"x"}],y1:[l.YCoordinateSpec,{field:"y1"}],y2:[l.YCoordinateSpec,{field:"y2"}],step_mode:[h.StepMode,"before"]})))},
function _(t,s,e,i,h){var n;i();const r=t(1),a=t(215),_=r.__importStar(t(212)),o=r.__importStar(t(18)),l=t(103);class c extends a.AreaView{_index_data(t){const{min:s,max:e}=Math,{data_size:i}=this;for(let h=0;h<i;h++){const i=this._x[h],n=this._y1[h],r=this._y2[h];t.add_rect(i,s(n,r),i,e(n,r))}}_render(t,s,e){const{sx:i,sy1:h,sy2:n}=null!=e?e:this;t.beginPath();for(let s=0,e=h.length;s<e;s++)t.lineTo(i[s],h[s]);for(let s=n.length-1;s>=0;s--)t.lineTo(i[s],n[s]);t.closePath(),this.visuals.fill.apply(t),this.visuals.hatch.apply(t)}scenterxy(t){return[this.sx[t],(this.sy1[t]+this.sy2[t])/2]}_hit_point(t){const s=this.sx.length,e=new l.Selection;for(let i=0,h=s-1;i<h;i++){const s=[this.sx[i],this.sx[i+1],this.sx[i+1],this.sx[i]],h=[this.sy1[i],this.sy1[i+1],this.sy2[i+1],this.sy2[i]];if(_.point_in_poly(t.sx,t.sy,s,h)){e.add_to_selected_glyphs(this.model),e.view=this,e.line_indices=[i];break}}return e}_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)}}e.VAreaView=c,c.__name__="VAreaView";class y extends a.Area{constructor(t){super(t)}}e.VArea=y,n=y,y.__name__="VArea",n.prototype.default_view=c,n.define((({})=>({x:[o.XCoordinateSpec,{field:"x"}],y1:[o.YCoordinateSpec,{field:"y1"}],y2:[o.YCoordinateSpec,{field:"y2"}]})))},
function _(e,i,t,s,n){var c;s();const o=e(50),_=e(54),r=e(24),l=e(221),a=e(222),d=e(223);class h extends _.View{initialize(){super.initialize(),this.compute_indices()}connect_signals(){super.connect_signals();const{filter:e}=this.model.properties;this.on_change(e,(()=>this.compute_indices()));const i=()=>{const e=()=>this.compute_indices(),i=this.parent.data_source.get_value();this.connect(i.change,e),this.connect(i.streaming,e),this.connect(i.patching,e),this.connect(i.properties.data.change,e)};i();const{data_source:t}=this.parent;this.on_change(t,(()=>{i()}))}compute_indices(){var e;const i=this.parent.data_source.get_value(),t=null!==(e=i.get_length())&&void 0!==e?e:1,s=r.Indices.all_set(t),n=this.model.filter.compute_indices(i);s.intersect(n),this.model.indices=s,this.model._indices_map_to_subset()}}t.CDSViewView=h,h.__name__="CDSViewView";class p extends o.Model{constructor(e){super(e)}_indices_map_to_subset(){this._indices=[...this.indices],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]))}get filters(){const{filter:e}=this;return e instanceof d.IntersectionFilter?e.operands:e instanceof a.AllIndices?[]:[e]}set filters(e){0==e.length?this.filter=new a.AllIndices:1==e.length?this.filter=e[0]:this.filter=new d.IntersectionFilter({operands:e})}}t.CDSView=p,c=p,p.__name__="CDSView",c.prototype.default_view=h,c.define((({Ref:e})=>({filter:[e(l.Filter),()=>new a.AllIndices]}))),c.internal((({Int:e,Dict:i,Ref:t,Nullable:s})=>({indices:[t(r.Indices)],indices_map:[i(e),{}],masked:[s(t(r.Indices)),null]})))},
function _(e,t,n,s,c){s();const o=e(50);class r extends o.Model{constructor(e){super(e)}}n.Filter=r,r.__name__="Filter"},
function _(e,n,s,t,c){t();const l=e(221),i=e(24);class _ extends l.Filter{constructor(e){super(e)}compute_indices(e){var n;const s=null!==(n=e.get_length())&&void 0!==n?n:1;return i.Indices.all_set(s)}}s.AllIndices=_,_.__name__="AllIndices"},
function _(e,t,n,r,s){var c;r();const i=e(221),o=e(24);class l extends i.Filter{constructor(e){super(e)}compute_indices(e){var t;const{operands:n}=this;if(0==n.length){const n=null!==(t=e.get_length())&&void 0!==t?t:1;return o.Indices.all_set(n)}{const[t,...r]=n.map((t=>t.compute_indices(e)));for(const e of r)t.intersect(e);return t}}}n.IntersectionFilter=l,c=l,l.__name__="IntersectionFilter",c.define((({Array:e,Ref:t})=>({operands:[e(t(i.Filter))]})))},
function _(t,r,a,e,i){e(),i("BasicTickFormatter",t(187).BasicTickFormatter),i("CategoricalTickFormatter",t(168).CategoricalTickFormatter),i("DatetimeTickFormatter",t(171).DatetimeTickFormatter),i("CustomJSTickFormatter",t(225).CustomJSTickFormatter),i("LogTickFormatter",t(189).LogTickFormatter),i("MercatorTickFormatter",t(192).MercatorTickFormatter),i("NumeralTickFormatter",t(226).NumeralTickFormatter),i("PrintfTickFormatter",t(227).PrintfTickFormatter),i("TickFormatter",t(164).TickFormatter)},
function _(t,e,s,n,r){var c;n();const i=t(164),a=t(9),o=t(40);class u extends i.TickFormatter{constructor(t){super(t)}get names(){return(0,a.keys)(this.args)}get values(){return(0,a.values)(this.args)}_make_func(){const t=(0,o.use_strict)(this.code);return new Function("tick","index","ticks",...this.names,t)}doFormat(t,e){const s=this._make_func().bind({});return t.map(((t,e,n)=>`${s(t,e,n,...this.values)}`))}}s.CustomJSTickFormatter=u,c=u,u.__name__="CustomJSTickFormatter",c.define((({Unknown:t,String:e,Dict:s})=>({args:[s(t),{}],code:[e,""]})))},
function _(r,n,t,o,e){var a;o();const u=r(1).__importStar(r(173)),c=r(164),i=r(20);class s extends c.TickFormatter{constructor(r){super(r)}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(r,n){const{format:t,language:o,_rounding_fn:e}=this;return r.map((r=>u.format(r,t,o,e)))}}t.NumeralTickFormatter=s,a=s,s.__name__="NumeralTickFormatter",a.define((({String:r})=>({format:[r,"0,0"],language:[r,"en"],rounding:[i.RoundingFunction,"round"]})))},
function _(t,r,n,o,a){var e;o();const i=t(164),s=t(172);class c extends i.TickFormatter{constructor(t){super(t)}doFormat(t,r){return t.map((t=>(0,s.sprintf)(this.format,t)))}}n.PrintfTickFormatter=c,e=c,c.__name__="PrintfTickFormatter",e.define((({String:t})=>({format:[t,"%s"]})))},
function _(a,e,l,c,o){c(),o("CategoricalScale",a(93).CategoricalScale),o("CompositeScale",a(94).CompositeScale),o("ContinuousScale",a(91).ContinuousScale),o("LinearInterpolationScale",a(229).LinearInterpolationScale),o("LinearScale",a(90).LinearScale),o("LogScale",a(92).LogScale),o("Scale",a(85).Scale)},
function _(e,r,n,t,a){var i;t();const s=e(85),o=e(90),c=e(13);class _ extends s.Scale{constructor(e){super(e)}initialize(){super.initialize();const{source_range:e,target_range:r}=this.properties;e.is_unset||r.is_unset||(this.linear_scale=new o.LinearScale({source_range:e.get_value(),target_range:r.get_value()}))}connect_signals(){super.connect_signals();const{source_range:e,target_range:r}=this.properties;this.on_change([e,r],(()=>{this.linear_scale=new o.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:r}=this,{start:n,end:t}=this.source_range,a=n,i=t,s=r.length,o=(t-n)/(s-1),_=new Float64Array(s);for(let e=0;e<s;e++)_[e]=n+e*o;const l=(0,c.map)(e,(e=>{if(e<a)return a;if(e>i)return i;const n=(0,c.left_edge_index)(e,r);if(-1==n)return a;if(n>=s-1)return i;const t=r[n],o=(e-t)/(r[n+1]-t),l=_[n];return l+o*(_[n+1]-l)}));return this.linear_scale.v_compute(l)}invert(e){return e}v_invert(e){return new Float64Array(e)}}n.LinearInterpolationScale=_,i=_,_.__name__="LinearInterpolationScale",i.internal((({Number:e,Arrayable:r,Ref:n})=>({binning:[r(e)],linear_scale:[n(o.LinearScale)]})))},
function _(a,n,e,g,R){g(),R("DataRange",a(96).DataRange),R("DataRange1d",a(95).DataRange1d),R("FactorRange",a(98).FactorRange),R("Range",a(87).Range),R("Range1d",a(88).Range1d)},
function _(a,t,o,e,i){e();var u=a(147);i("Sizeable",u.Sizeable),i("SizingPolicy",u.SizingPolicy);var l=a(148);i("Layoutable",l.Layoutable),i("ContentLayoutable",l.ContentLayoutable),i("TextLayout",l.TextLayout),i("FixedLayout",l.FixedLayout);var n=a(232);i("HStack",n.HStack),i("VStack",n.VStack);var y=a(233);i("Grid",y.Grid),i("Row",y.Row),i("Column",y.Column)},
function _(t,e,h,i,r){i();const n=t(148),s=t(57),{max:o,round:c}=Math;class l extends n.Layoutable{constructor(){super(...arguments),this.children=[]}*[Symbol.iterator](){yield*this.children}}h.Stack=l,l.__name__="Stack";class a extends l{_measure(t){let e=0,h=0;for(const t of this.children){const i=t.measure({width:0,height:0});e+=i.width,h=o(h,i.height)}return{width:e,height:h}}_set_geometry(t,e){if(super._set_geometry(t,e),t.is_empty)for(const t of this.children)t.set_geometry(new s.BBox);else{const e=this.absolute?t.top:0;let h=this.absolute?t.left:0;const{height:i}=t;for(const t of this.children){const{width:r}=t.measure({width:0,height:0});t.set_geometry(new s.BBox({left:h,width:r,top:e,height:i})),h+=r}}}}h.HStack=a,a.__name__="HStack";class d extends l{_measure(t){let e=0,h=0;for(const t of this.children){const i=t.measure({width:0,height:0});e=o(e,i.width),h+=i.height}return{width:e,height:h}}_set_geometry(t,e){if(super._set_geometry(t,e),t.is_empty)for(const t of this.children)t.set_geometry(new s.BBox);else{const e=this.absolute?t.left:0;let h=this.absolute?t.top:0;const{width:i}=t;for(const t of this.children){const{height:r}=t.measure({width:0,height:0});t.set_geometry(new s.BBox({top:h,height:r,left:e,width:i})),h+=r}}}}h.VStack=d,d.__name__="VStack";class g extends n.Layoutable{constructor(){super(...arguments),this.children=[]}*[Symbol.iterator](){yield*this.children}_measure(t){const{width_policy:e,height_policy:h}=this.sizing,{min:i,max:r}=Math;let n=0,s=0;for(const e of this.children){const{width:h,height:i}=e.measure(t);n=r(n,h),s=r(s,i)}return{width:(()=>{const{width:h}=this.sizing;if(t.width==1/0)return"fixed"==e&&null!=h?h:n;switch(e){case"fixed":return null!=h?h:n;case"min":return n;case"fit":return null!=h?i(t.width,h):t.width;case"max":return null!=h?r(t.width,h):t.width}})(),height:(()=>{const{height:e}=this.sizing;if(t.height==1/0)return"fixed"==h&&null!=e?e:s;switch(h){case"fixed":return null!=e?e:s;case"min":return s;case"fit":return null!=e?i(t.height,e):t.height;case"max":return null!=e?r(t.height,e):t.height}})()}}_set_geometry(t,e){if(super._set_geometry(t,e),t.is_empty)for(const t of this.children)t.set_geometry(new s.BBox);else{const e=this.absolute?t:t.relative(),{left:h,right:i,top:r,bottom:n}=e,o=c(e.vcenter),l=c(e.hcenter);for(const e of this.children){const{margin:c,halign:a="start",valign:d="start"}=e.sizing,{width:g,height:u,inner:_}=e.measure(t),w=(()=>{switch(`${d}_${a}`){case"start_start":return new s.BBox({left:h+c.left,top:r+c.top,width:g,height:u});case"start_center":return new s.BBox({hcenter:l,top:r+c.top,width:g,height:u});case"start_end":return new s.BBox({right:i-c.right,top:r+c.top,width:g,height:u});case"center_start":return new s.BBox({left:h+c.left,vcenter:o,width:g,height:u});case"center_center":return new s.BBox({hcenter:l,vcenter:o,width:g,height:u});case"center_end":return new s.BBox({right:i-c.right,vcenter:o,width:g,height:u});case"end_start":return new s.BBox({left:h+c.left,bottom:n-c.bottom,width:g,height:u});case"end_center":return new s.BBox({hcenter:l,bottom:n-c.bottom,width:g,height:u});case"end_end":return new s.BBox({right:i-c.right,bottom:n-c.bottom,width:g,height:u})}})(),m=null==_?w:new s.BBox({left:w.left+_.left,top:w.top+_.top,right:w.right-_.right,bottom:w.bottom-_.bottom});e.set_geometry(w,m)}}}}h.NodeLayout=g,g.__name__="NodeLayout"},
function _(t,i,s,e,o){e();const n=t(147),r=t(148),l=t(8),h=t(57),c=t(10),{max:a,round:g}=Math;class p{constructor(t){this._map=new Map,this.def=t}get(t){let i=this._map.get(t);return void 0===i&&(i=this.def(),this._map.set(t,i)),i}apply(t,i){const s=this.get(t);this._map.set(t,i(s))}}s.DefaultMap=p,p.__name__="DefaultMap";class _{constructor(){this._items=[],this._nrows=0,this._ncols=0}get size(){return this._items.length}get nrows(){return this._nrows}get ncols(){return this._ncols}add(t,i){const{r1:s,c1:e}=t;this._nrows=a(this._nrows,s+1),this._ncols=a(this._ncols,e+1),this._items.push({span:t,data:i})}at(t,i){return this._items.filter((({span:s})=>s.r0<=t&&t<=s.r1&&s.c0<=i&&i<=s.c1)).map((({data:t})=>t))}row(t){return this._items.filter((({span:i})=>i.r0<=t&&t<=i.r1)).map((({data:t})=>t))}col(t){return this._items.filter((({span:i})=>i.c0<=t&&t<=i.c1)).map((({data:t})=>t))}*[Symbol.iterator](){yield*this._items}foreach(t){for(const{span:i,data:s}of this._items)t(i,s)}map(t){const i=new _;for(const{span:s,data:e}of this._items)i.add(s,t(s,e));return i}}s.Container=_,_.__name__="Container";class f extends r.Layoutable{*[Symbol.iterator](){for(const{layout:t}of this.items)yield t}constructor(t=[]){super(),this.rows="auto",this.cols="auto",this.spacing=0,this.items=t}is_width_expanding(){if(super.is_width_expanding())return!0;if("fixed"==this.sizing.width_policy)return!1;const{cols:t}=this._state;return(0,c.some)(t,(t=>"max"==t.policy))}is_height_expanding(){if(super.is_height_expanding())return!0;if("fixed"==this.sizing.height_policy)return!1;const{rows:t}=this._state;return(0,c.some)(t,(t=>"max"==t.policy))}_init(){var t,i,s,e;super._init();const o=new _;for(const{layout:t,row:i,col:s,row_span:e=1,col_span:n=1}of this.items)if(t.sizing.visible){const r=i,l=s,h=i+e-1,c=s+n-1;o.add({r0:r,c0:l,r1:h,c1:c},t)}const{nrows:n,ncols:r}=o,h=new Array(n);for(let s=0;s<n;s++){const e=(()=>{var t;const i=(0,l.isPlainObject)(this.rows)?null!==(t=this.rows[s])&&void 0!==t?t:this.rows["*"]:this.rows;return null==i?{policy:"auto"}:(0,l.isNumber)(i)?{policy:"fixed",height:i}:(0,l.isString)(i)?{policy:i}:i})(),n=null!==(t=e.align)&&void 0!==t?t:"auto";"fixed"==e.policy?h[s]={policy:"fixed",height:e.height,align:n}:"min"==e.policy?h[s]={policy:"min",align:n}:"fit"==e.policy||"max"==e.policy?h[s]={policy:e.policy,flex:null!==(i=e.flex)&&void 0!==i?i:1,align:n}:(0,c.some)(o.row(s),(t=>t.is_height_expanding()))?h[s]={policy:"max",flex:1,align:n}:h[s]={policy:"min",align:n}}const a=new Array(r);for(let t=0;t<r;t++){const i=(()=>{var i;const s=(0,l.isPlainObject)(this.cols)?null!==(i=this.cols[t])&&void 0!==i?i:this.cols["*"]:this.cols;return null==s?{policy:"auto"}:(0,l.isNumber)(s)?{policy:"fixed",width:s}:(0,l.isString)(s)?{policy:s}:s})(),n=null!==(s=i.align)&&void 0!==s?s:"auto";"fixed"==i.policy?a[t]={policy:"fixed",width:i.width,align:n}:"min"==i.policy?a[t]={policy:"min",align:n}:"fit"==i.policy||"max"==i.policy?a[t]={policy:i.policy,flex:null!==(e=i.flex)&&void 0!==e?e:1,align:n}:(0,c.some)(o.col(t),(t=>t.is_width_expanding()))?a[t]={policy:"max",flex:1,align:n}:a[t]={policy:"min",align:n}}const[g,p]=(0,l.isNumber)(this.spacing)?[this.spacing,this.spacing]:this.spacing;this._state={items:o,nrows:n,ncols:r,rows:h,cols:a,rspacing:g,cspacing:p}}_measure_totals(t,i){const{nrows:s,ncols:e,rspacing:o,cspacing:n}=this._state;return{height:(0,c.sum)(t)+(s-1)*o,width:(0,c.sum)(i)+(e-1)*n}}_measure_cells(t){const{items:i,nrows:s,ncols:e,rows:o,cols:r,rspacing:l,cspacing:h}=this._state,c=new Array(s);for(let t=0;t<s;t++){const i=o[t];c[t]="fixed"==i.policy?i.height:0}const p=new Array(e);for(let t=0;t<e;t++){const i=r[t];p[t]="fixed"==i.policy?i.width:0}const f=new _;i.foreach(((i,s)=>{const{r0:e,c0:_,r1:d,c1:u}=i,w=(d-e)*l,m=(u-_)*h;let y=0;for(let i=e;i<=d;i++)y+=t(i,_).height;y+=w;let x=0;for(let i=_;i<=u;i++)x+=t(e,i).width;x+=m;const b=s.measure({width:x,height:y});f.add(i,{layout:s,size_hint:b});const z=new n.Sizeable(b).grow_by(s.sizing.margin);z.height-=w,z.width-=m;const v=[];for(let t=e;t<=d;t++){const i=o[t];"fixed"==i.policy?z.height-=i.height:v.push(t)}if(z.height>0){const t=g(z.height/v.length);for(const i of v)c[i]=a(c[i],t)}const j=[];for(let t=_;t<=u;t++){const i=r[t];"fixed"==i.policy?z.width-=i.width:j.push(t)}if(z.width>0){const t=g(z.width/j.length);for(const i of j)p[i]=a(p[i],t)}}));return{size:this._measure_totals(c,p),row_heights:c,col_widths:p,size_hints:f}}_measure_grid(t){const{nrows:i,ncols:s,rows:e,cols:o,rspacing:n,cspacing:r}=this._state,l=this._measure_cells(((t,i)=>{const s=e[t],n=o[i];return{width:"fixed"==n.policy?n.width:1/0,height:"fixed"==s.policy?s.height:1/0}}));let h;h="fixed"==this.sizing.height_policy&&null!=this.sizing.height?this.sizing.height:t.height!=1/0&&this.is_height_expanding()?t.height:l.size.height;let c,p=0;for(let t=0;t<i;t++){const i=e[t];"fit"==i.policy||"max"==i.policy?p+=i.flex:h-=l.row_heights[t]}if(h-=(i-1)*n,0!=p&&h>0)for(let t=0;t<i;t++){const i=e[t];if("fit"==i.policy||"max"==i.policy){const s=g(h*(i.flex/p));h-=s,l.row_heights[t]=s,p-=i.flex}}else if(h<0){let t=0;for(let s=0;s<i;s++){"fixed"!=e[s].policy&&t++}let s=-h;for(let o=0;o<i;o++){if("fixed"!=e[o].policy){const i=l.row_heights[o],e=g(s/t);l.row_heights[o]=a(i-e,0),s-=e>i?i:e,t--}}}c="fixed"==this.sizing.width_policy&&null!=this.sizing.width?this.sizing.width:t.width!=1/0&&this.is_width_expanding()?t.width:l.size.width;let _=0;for(let t=0;t<s;t++){const i=o[t];"fit"==i.policy||"max"==i.policy?_+=i.flex:c-=l.col_widths[t]}if(c-=(s-1)*r,0!=_&&c>0)for(let t=0;t<s;t++){const i=o[t];if("fit"==i.policy||"max"==i.policy){const s=g(c*(i.flex/_));c-=s,l.col_widths[t]=s,_-=i.flex}}else if(c<0){let t=0;for(let i=0;i<s;i++){"fixed"!=o[i].policy&&t++}let i=-c;for(let e=0;e<s;e++){if("fixed"!=o[e].policy){const s=l.col_widths[e],o=g(i/t);l.col_widths[e]=a(s-o,0),i-=o>s?s:o,t--}}}const{row_heights:f,col_widths:d,size_hints:u}=this._measure_cells(((t,i)=>({width:l.col_widths[i],height:l.row_heights[t]})));return{size:this._measure_totals(f,d),row_heights:f,col_widths:d,size_hints:u}}_measure(t){const{size:i}=this._measure_grid(t);return i}_set_geometry(t,i){super._set_geometry(t,i);const{nrows:s,ncols:e,rspacing:o,cspacing:n}=this._state,{row_heights:r,col_widths:l,size_hints:c}=this._measure_grid(t),_=this._state.rows.map(((t,i)=>Object.assign(Object.assign({},t),{top:0,height:r[i],get bottom(){return this.top+this.height}}))),f=this._state.cols.map(((t,i)=>Object.assign(Object.assign({},t),{left:0,width:l[i],get right(){return this.left+this.width}}))),d=c.map(((t,i)=>Object.assign(Object.assign({},i),{outer:new h.BBox,inner:new h.BBox})));for(let i=0,e=this.absolute?t.top:this.position.top;i<s;i++){const t=_[i];t.top=e,e+=t.height+o}for(let i=0,s=this.absolute?t.left:this.position.left;i<e;i++){const t=f[i];t.left=s,s+=t.width+n}d.foreach((({r0:t,c0:i,r1:s,c1:e},r)=>{const{layout:l,size_hint:c}=r,{sizing:a}=l,{width:p,height:d}=c,u=function(t,i){let s=(i-t)*n;for(let e=t;e<=i;e++)s+=f[e].width;return s}(i,e),w=function(t,i){let s=(i-t)*o;for(let e=t;e<=i;e++)s+=_[e].height;return s}(t,s),m=i==e&&"auto"!=f[i].align?f[i].align:a.halign,y=t==s&&"auto"!=_[t].align?_[t].align:a.valign;let x=f[i].left;"start"==m?x+=a.margin.left:"center"==m?x+=g((u-p)/2):"end"==m&&(x+=u-a.margin.right-p);let b=_[t].top;"start"==y?b+=a.margin.top:"center"==y?b+=g((w-d)/2):"end"==y&&(b+=w-a.margin.bottom-d),r.outer=new h.BBox({left:x,top:b,width:p,height:d})}));const u=_.map((()=>({start:new p((()=>0)),end:new p((()=>0))}))),w=f.map((()=>({start:new p((()=>0)),end:new p((()=>0))})));d.foreach((({r0:t,c0:i,r1:s,c1:e},{size_hint:o,outer:n})=>{const{inner:r}=o;null!=r&&(u[t].start.apply(n.top,(t=>a(t,r.top))),u[s].end.apply(_[s].bottom-n.bottom,(t=>a(t,r.bottom))),w[i].start.apply(n.left,(t=>a(t,r.left))),w[e].end.apply(f[e].right-n.right,(t=>a(t,r.right))))})),d.foreach((({r0:t,c0:i,r1:s,c1:e},o)=>{const{size_hint:n,outer:r}=o,l=t=>{const i=this.absolute?r:r.relative(),s=i.left+t.left,e=i.top+t.top,o=i.right-t.right,n=i.bottom-t.bottom;return new h.BBox({left:s,top:e,right:o,bottom:n})};if(null!=n.inner){let h=l(n.inner);const c=u[t].start.get(r.top),a=u[s].end.get(_[s].bottom-r.bottom),g=w[i].start.get(r.left),p=w[e].end.get(f[e].right-r.right);try{h=l({top:c,bottom:a,left:g,right:p})}catch(t){}o.inner=h}else o.inner=r})),d.foreach(((t,{layout:i,outer:s,inner:e})=>{i.set_geometry(s,e)}))}}s.Grid=f,f.__name__="Grid";class d extends f{constructor(t){super(),this.items=t.map(((t,i)=>({layout:t,row:0,col:i}))),this.rows="fit"}}s.Row=d,d.__name__="Row";class u extends f{constructor(t){super(),this.items=t.map(((t,i)=>({layout:t,row:i,col:0}))),this.cols="fit"}}s.Column=u,u.__name__="Column"},
function _(t,e,i,h,o){h();const n=t(147),s=t(148),r=t(57);class l extends s.Layoutable{constructor(){super(...arguments),this.aligns={left:!0,right:!0,top:!0,bottom:!0},this.min_border={left:0,top:0,right:0,bottom:0},this.padding={left:0,top:0,right:0,bottom:0},this.center_border_width=0}*[Symbol.iterator](){yield this.top_panel,yield this.bottom_panel,yield this.left_panel,yield this.right_panel,yield this.center_panel}_measure(t){t=new n.Sizeable({width:"fixed"==this.sizing.width_policy||t.width==1/0?this.sizing.width:t.width,height:"fixed"==this.sizing.height_policy||t.height==1/0?this.sizing.height:t.height});const e=this.left_panel.measure({width:0,height:t.height}),i=Math.max(e.width,this.min_border.left)+this.padding.left,h=this.right_panel.measure({width:0,height:t.height}),o=Math.max(h.width,this.min_border.right)+this.padding.right,s=this.top_panel.measure({width:t.width,height:0}),r=Math.max(s.height,this.min_border.top)+this.padding.top,l=this.bottom_panel.measure({width:t.width,height:0}),_=Math.max(l.height,this.min_border.bottom)+this.padding.bottom,g=new n.Sizeable(t).shrink_by({left:i,right:o,top:r,bottom:_}),a=this.center_panel.measure(g);return{width:i+a.width+o,height:r+a.height+_,inner:{left:i,right:o,top:r,bottom:_},align:(()=>{const{width_policy:t,height_policy:e}=this.center_panel.sizing;return Object.assign(Object.assign({},this.aligns),{fixed_width:"fixed"==t,fixed_height:"fixed"==e})})()}}_set_geometry(t,e){var i,h,o,n;if(super._set_geometry(t,e),this.sizing.visible){this.center_panel.set_geometry(e);const i=this.left_panel.measure({width:0,height:t.height}),h=this.right_panel.measure({width:0,height:t.height}),o=this.top_panel.measure({width:t.width,height:0}),n=this.bottom_panel.measure({width:t.width,height:0}),{left:s,top:l,right:_,bottom:g}=e;this.top_panel.set_geometry(new r.BBox({left:s,right:_,bottom:l,height:o.height})),this.bottom_panel.set_geometry(new r.BBox({left:s,right:_,top:g,height:n.height})),this.left_panel.set_geometry(new r.BBox({top:l,bottom:g,right:s,width:i.width})),this.right_panel.set_geometry(new r.BBox({top:l,bottom:g,left:_,width:h.width}));const a=e.shrink_by(this.center_border_width);if(null!=this.inner_top_panel){const{left:t,right:e,top:i,width:h}=a,o=this.inner_top_panel.measure({width:h,height:0});this.inner_top_panel.set_geometry(new r.BBox({left:t,right:e,top:i,height:o.height}))}if(null!=this.inner_bottom_panel){const{left:t,right:e,bottom:i,width:h}=a,o=this.inner_bottom_panel.measure({width:h,height:0});this.inner_bottom_panel.set_geometry(new r.BBox({left:t,right:e,bottom:i,height:o.height}))}if(null!=this.inner_left_panel){const{top:t,bottom:e,left:i,height:h}=a,o=this.inner_left_panel.measure({width:0,height:h});this.inner_left_panel.set_geometry(new r.BBox({top:t,bottom:e,left:i,width:o.width}))}if(null!=this.inner_right_panel){const{top:t,bottom:e,right:i,height:h}=a,o=this.inner_right_panel.measure({width:0,height:h});this.inner_right_panel.set_geometry(new r.BBox({top:t,bottom:e,right:i,width:o.width}))}}else this.center_panel.set_geometry(new r.BBox),this.top_panel.set_geometry(new r.BBox),this.bottom_panel.set_geometry(new r.BBox),this.left_panel.set_geometry(new r.BBox),this.right_panel.set_geometry(new r.BBox),null===(i=this.inner_top_panel)||void 0===i||i.set_geometry(new r.BBox),null===(h=this.inner_bottom_panel)||void 0===h||h.set_geometry(new r.BBox),null===(o=this.inner_left_panel)||void 0===o||o.set_geometry(new r.BBox),null===(n=this.inner_right_panel)||void 0===n||n.set_geometry(new r.BBox)}}i.BorderLayout=l,l.__name__="BorderLayout"},
function _(e,s,_,i,l){var t;i();const o=e(1),r=e(236),p=o.__importStar(e(78));class h extends r.UpperLowerView{paint(e){e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let s=0,_=this._lower_sx.length;s<_;s++)e.lineTo(this._lower_sx[s],this._lower_sy[s]);for(let s=this._upper_sx.length-1;s>=0;s--)e.lineTo(this._upper_sx[s],this._upper_sy[s]);e.closePath(),this.visuals.fill.apply(e),e.beginPath(),e.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let s=0,_=this._lower_sx.length;s<_;s++)e.lineTo(this._lower_sx[s],this._lower_sy[s]);this.visuals.line.apply(e),e.beginPath(),e.moveTo(this._upper_sx[0],this._upper_sy[0]);for(let s=0,_=this._upper_sx.length;s<_;s++)e.lineTo(this._upper_sx[s],this._upper_sy[s]);this.visuals.line.apply(e)}}_.BandView=h,h.__name__="BandView";class n extends r.UpperLower{constructor(e){super(e)}}_.Band=n,t=n,n.__name__="Band",t.prototype.default_view=h,t.mixins([p.Line,p.Fill]),t.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},
function _(e,t,s,r,i){var n;r();const a=e(1),o=e(100),_=e(24),c=e(20),p=a.__importStar(e(18));class u extends o.DataAnnotationView{map_data(){const{frame:e}=this.plot_view,t=this.model.dimension,s=this.coordinates.x_scale,r=this.coordinates.y_scale,i="height"==t?r:s,n="height"==t?s:r,a="height"==t?e.bbox.yview:e.bbox.xview,o="height"==t?e.bbox.xview:e.bbox.yview,c=(()=>{switch(this.model.properties.lower.units){case"canvas":return new _.ScreenArray(this._lower);case"screen":return a.v_compute(this._lower);case"data":return i.v_compute(this._lower)}})(),p=(()=>{switch(this.model.properties.upper.units){case"canvas":return new _.ScreenArray(this._upper);case"screen":return a.v_compute(this._upper);case"data":return i.v_compute(this._upper)}})(),u=(()=>{switch(this.model.properties.base.units){case"canvas":return new _.ScreenArray(this._base);case"screen":return o.v_compute(this._base);case"data":return n.v_compute(this._base)}})(),[h,d]="height"==t?[1,0]:[0,1],w=[c,u],l=[p,u];this._lower_sx=w[h],this._lower_sy=w[d],this._upper_sx=l[h],this._upper_sy=l[d]}}s.UpperLowerView=u,u.__name__="UpperLowerView";class h extends p.CoordinateSpec{constructor(){super(...arguments),this._value=p.unset}get dimension(){return"width"==this.obj.dimension?"x":"y"}get units(){var e;return this._value===p.unset?"data":null!==(e=this._value.units)&&void 0!==e?e:"data"}}s.XOrYCoordinateSpec=h,h.__name__="XOrYCoordinateSpec";class d extends o.DataAnnotation{constructor(e){super(e)}}s.UpperLower=d,n=d,d.__name__="UpperLower",n.define((()=>({dimension:[c.Dimension,"height"],lower:[h,{field:"lower"}],upper:[h,{field:"upper"}],base:[h,{field:"base"}]})))},
function _(t,e,o,i,s){var r,n;i();const a=t(1),l=t(73),h=t(95),_=a.__importStar(t(78)),c=t(20),m=t(10),b=t(57),u=t(15),d=t(12),p=t(21),f=t(238),g=t(239),v=a.__importStar(t(240)),x=t(241);o.EDGE_TOLERANCE=2.5;const{abs:N}=Math,w=(0,p.Enum)("none","left","right","top","bottom","x","y","all"),y=(0,p.Enum)("none","x","y","both"),B=(0,p.Nullable)((0,p.Or)(p.Number,(0,p.Ref)(x.Node)));class z extends l.AnnotationView{constructor(){super(...arguments),this.bbox=new b.BBox,this[r]=!0,this._pan_state=null,this._pinch_state=null,this._is_hovered=!1}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.bbox.round()})}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}bounds(){const{left:t,left_units:e,right:o,right_units:i,top:s,top_units:r,bottom:n,bottom_units:a}=this.model,l="data"==e&&!(t instanceof x.Node),h="data"==i&&!(o instanceof x.Node),_="data"==r&&!(s instanceof x.Node),c="data"==a&&!(n instanceof x.Node),[m,b]=l&&h?t<=o?[t,o]:[o,t]:l?[t,t]:h?[o,o]:[NaN,NaN],[u,d]=_&&c?s<=n?[s,n]:[n,s]:_?[s,s]:c?[n,n]:[NaN,NaN];return{x0:m,x1:b,y0:u,y1:d}}log_bounds(){return(0,b.empty)()}get mappers(){function t(t,e,o,i){switch(t){case"canvas":return i;case"screen":return o;case"data":return e}}const e=this.model,{x_scale:o,y_scale:i}=this.coordinates,{x_view:s,y_view:r}=this.plot_view.frame.bbox,{x_screen:n,y_screen:a}=this.plot_view.canvas.bbox;return{left:t(e.left_units,o,s,n),right:t(e.right_units,o,s,n),top:t(e.top_units,i,r,a),bottom:t(e.bottom_units,i,r,a)}}_render(){const t=(t,e,o)=>e instanceof x.Node?this.resolve_node(e)[t]:o.compute(e),{left:e,right:o,top:i,bottom:s}=this.model,{mappers:r}=this;this.bbox=b.BBox.from_lrtb({left:t("x",e,r.left),right:t("x",o,r.right),top:t("y",i,r.top),bottom:t("y",s,r.bottom)}),this.bbox.is_valid&&this._paint_box()}get border_radius(){return v.border_radius(this.model.border_radius)}_paint_box(){const{ctx:t}=this.layer;t.save(),t.beginPath(),(0,g.round_rect)(t,this.bbox,this.border_radius);const{_is_hovered:e,visuals:o}=this,i=e&&o.hover_fill.doit?o.hover_fill:o.fill,s=e&&o.hover_hatch.doit?o.hover_hatch:o.hatch,r=e&&o.hover_line.doit?o.hover_line:o.line;i.apply(t),s.apply(t),r.apply(t),t.restore()}interactive_bbox(){const t=this.model.line_width+o.EDGE_TOLERANCE;return this.bbox.grow_by(t)}interactive_hit(t,e){if(!this.model.visible||!this.model.editable)return!1;return this.interactive_bbox().contains(t,e)}_hit_test(t,e){const{left:i,right:s,bottom:r,top:n}=this.bbox,a=Math.max(o.EDGE_TOLERANCE,this.model.line_width/2),l=N(i-t),h=N(s-t),_=N(n-e),c=N(r-e),m=l<a&&l<h,b=h<a&&h<l,u=_<a&&_<c,d=c<a&&c<_;return u&&m?"top_left":u&&b?"top_right":d&&m?"bottom_left":d&&b?"bottom_right":m?"left":b?"right":u?"top":d?"bottom":this.bbox.contains(t,e)?"area":null}get resizable(){const{resizable:t}=this.model;return{left:"left"==t||"x"==t||"all"==t,right:"right"==t||"x"==t||"all"==t,top:"top"==t||"y"==t||"all"==t,bottom:"bottom"==t||"y"==t||"all"==t}}_can_hit(t){const{left:e,right:o,top:i,bottom:s}=this.resizable;switch(t){case"top_left":return i&&e;case"top_right":return i&&o;case"bottom_left":return s&&e;case"bottom_right":return s&&o;case"left":return e;case"right":return o;case"top":return i;case"bottom":return s;case"area":return"none"!=this.model.movable}}_pan_start(t){if(this.model.visible&&this.model.editable){const{sx:e,sy:o}=t,i=this._hit_test(e,o);if(null!=i&&this._can_hit(i))return this._pan_state={bbox:this.bbox.clone(),target:i},this.model.pan.emit(["pan:start",t.modifiers]),!0}return!1}_pan(t){(0,d.assert)(null!=this._pan_state);const{mappers:e}=this,o=(t,e,o)=>e instanceof x.Node?this.resolve_node(e)[t]:null==e?NaN:o.compute(e),i=b.BBox.from_lrtb({left:o("x",this.model.left_limit,e.left),right:o("x",this.model.right_limit,e.right),top:o("y",this.model.top_limit,e.top),bottom:o("y",this.model.bottom_limit,e.bottom)}),[s,r,n,a]=(()=>{const{dx:e,dy:o}=t,{target:i}=this._pan_state,{symmetric:s}=this.model,[r,n]=s?[-e,-o]:[0,0];switch(i){case"top_left":return[e,r,o,n];case"top_right":return[r,e,o,n];case"bottom_left":return[e,r,n,o];case"bottom_right":return[r,e,n,o];case"left":return[e,r,0,0];case"right":return[r,e,0,0];case"top":return[0,0,o,n];case"bottom":return[0,0,n,o];case"area":switch(this.model.movable){case"both":return[e,e,o,o];case"x":return[e,e,0,0];case"y":return[0,0,o,o];case"none":return[0,0,0,0]}}})(),l=(()=>{const t=(t,e)=>(0,m.min)([t,e]),e=t=>t<0?-1:t>0?1:0,{bbox:o}=this._pan_state;let{left:l,right:h,left_sign:_,right_sign:c}=(()=>{const t=o.left+s,i=o.right+r,n=e(s),a=e(r);return t<=i?{left:t,right:i,left_sign:n,right_sign:a}:{left:i,right:t,left_sign:a,right_sign:n}})(),{top:u,bottom:d,top_sign:p,bottom_sign:f}=(()=>{const t=o.top+n,i=o.bottom+a,s=e(n),r=e(a);return t<=i?{top:t,bottom:i,top_sign:s,bottom_sign:r}:{top:i,bottom:t,top_sign:r,bottom_sign:s}})();const g=l-i.left,v=i.right-h,x=t(g<0?g:NaN,v<0?v:NaN);isFinite(x)&&x<0&&(l+=-_*-x,h+=-c*-x);const N=u-i.top,w=i.bottom-d,y=t(N<0?N:NaN,w<0?w:NaN);return isFinite(y)&&y<0&&(u+=-p*-y,d+=-f*-y),b.BBox.from_lrtb({left:l,right:h,top:u,bottom:d})})(),h=(()=>{const{left:t,right:o,top:i,bottom:s}=this.model;return{left:t instanceof x.Node?t:e.left.invert(l.left),right:o instanceof x.Node?o:e.right.invert(l.right),top:i instanceof x.Node?i:e.top.invert(l.top),bottom:s instanceof x.Node?s:e.bottom.invert(l.bottom)}})();this.model.update(h),this.model.pan.emit(["pan",t.modifiers])}_pan_end(t){this._pan_state=null,this.model.pan.emit(["pan:end",t.modifiers])}_pinch_start(t){if(this.model.visible&&this.model.editable&&"none"!=this.model.resizable){const{sx:e,sy:o}=t;if(this.bbox.contains(e,o))return this._pinch_state={bbox:this.bbox.clone()},this.model.pan.emit(["pan:start",t.modifiers]),!0}return!1}_pinch(t){(0,d.assert)(null!=this._pinch_state);const e=(()=>{const{scale:e}=t,{bbox:o}=this._pinch_state,{left:i,top:s,right:r,bottom:n,width:a,height:l}=o,h=a*(e-1),_=l*(e-1),{resizable:c}=this,m=c.left?-h/2:0,u=c.right?h/2:0,d=c.top?-_/2:0,p=c.bottom?_/2:0;return b.BBox.from_lrtb({left:i+m,right:r+u,top:s+d,bottom:n+p})})(),o=(()=>{const{left:t,right:o,top:i,bottom:s}=this.model,{mappers:r}=this;return{left:t instanceof x.Node?t:r.left.invert(e.left),right:o instanceof x.Node?o:r.right.invert(e.right),top:i instanceof x.Node?i:r.top.invert(e.top),bottom:s instanceof x.Node?s:r.bottom.invert(e.bottom)}})();this.model.update(o),this.model.pan.emit(["pan",t.modifiers])}_pinch_end(t){this._pinch_state=null,this.model.pan.emit(["pan:end",t.modifiers])}get _has_hover(){const{hover_line:t,hover_fill:e,hover_hatch:o}=this.visuals;return t.doit||e.doit||o.doit}_move_start(t){const{_has_hover:e}=this;return e&&(this._is_hovered=!0,this.request_paint()),e}_move(t){}_move_end(t){this._has_hover&&(this._is_hovered=!1,this.request_paint())}cursor(t,e){var o,i;const s=null!==(i=null===(o=this._pan_state)||void 0===o?void 0:o.target)&&void 0!==i?i:this._hit_test(t,e);if(null==s||!this._can_hit(s))return null;switch(s){case"top_left":return this.model.tl_cursor;case"top_right":return this.model.tr_cursor;case"bottom_left":return this.model.bl_cursor;case"bottom_right":return this.model.br_cursor;case"left":case"right":return this.model.ew_cursor;case"top":case"bottom":return this.model.ns_cursor;case"area":switch(this.model.movable){case"both":return this.model.in_cursor;case"x":return this.model.ew_cursor;case"y":return this.model.ns_cursor;case"none":return null}}}}o.BoxAnnotationView=z,r=h.auto_ranged,z.__name__="BoxAnnotationView";class E extends l.Annotation{constructor(t){super(t),this.pan=new u.Signal(this,"pan")}update({left:t,right:e,top:o,bottom:i}){this.setv({left:t,right:e,top:o,bottom:i,visible:!0})}clear(){this.visible=!1}}o.BoxAnnotation=E,n=E,E.__name__="BoxAnnotation",n.prototype.default_view=z,n.mixins([_.Line,_.Fill,_.Hatch,["hover_",_.Line],["hover_",_.Fill],["hover_",_.Hatch]]),n.define((({Boolean:t,Number:e,Ref:o,Or:i})=>({top:[i(e,o(x.Node)),NaN],bottom:[i(e,o(x.Node)),NaN],left:[i(e,o(x.Node)),NaN],right:[i(e,o(x.Node)),NaN],top_units:[c.CoordinateUnits,"data"],bottom_units:[c.CoordinateUnits,"data"],left_units:[c.CoordinateUnits,"data"],right_units:[c.CoordinateUnits,"data"],top_limit:[B,null],bottom_limit:[B,null],left_limit:[B,null],right_limit:[B,null],border_radius:[f.BorderRadius,0],editable:[t,!1],resizable:[w,"all"],movable:[y,"both"],symmetric:[t,!1]}))),n.internal((({String:t})=>({tl_cursor:[t,"nwse-resize"],tr_cursor:[t,"nesw-resize"],bl_cursor:[t,"nesw-resize"],br_cursor:[t,"nwse-resize"],ew_cursor:[t,"ew-resize"],ns_cursor:[t,"ns-resize"],in_cursor:[t,"move"]}))),n.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3,hover_fill_color:null,hover_fill_alpha:.4,hover_line_color:null,hover_line_alpha:.3})},
function _(t,n,e,r,i){r();const g=t(1),a=t(21),h=g.__importStar(t(20));e.Length=(0,a.NonNegative)(a.Int);var c;e.Anchor=(0,a.Or)(h.Anchor,(0,a.Tuple)((0,a.Or)(h.Align,h.HAlign,a.Percent),(0,a.Or)(h.Align,h.VAlign,a.Percent))),e.TextAnchor=(0,a.Or)(e.Anchor,a.Auto),e.Padding=(0,a.Or)(e.Length,(0,a.Tuple)(e.Length,e.Length),(c=e.Length,(0,a.PartialStruct)({x:c,y:c})),(0,a.Tuple)(e.Length,e.Length,e.Length,e.Length),(t=>(0,a.PartialStruct)({left:t,right:t,top:t,bottom:t}))(e.Length)),e.BorderRadius=(0,a.Or)(e.Length,(0,a.Tuple)(e.Length,e.Length,e.Length,e.Length),(0,a.PartialStruct)({top_left:e.Length,top_right:e.Length,bottom_right:e.Length,bottom_left:e.Length})),e.Index=(0,a.NonNegative)(a.Int),e.Span=(0,a.NonNegative)(a.Int);e.GridChild=t=>(0,a.Tuple)((0,a.Ref)(t),e.Index,e.Index,(0,a.Opt)(e.Span),(0,a.Opt)(e.Span)),e.GridSpacing=(0,a.Or)(e.Length,(0,a.Tuple)(e.Length,e.Length)),e.TrackAlign=(0,a.Enum)("start","center","end","auto"),e.TrackSize=a.String,e.TrackSizing=(0,a.PartialStruct)({size:e.TrackSize,align:e.TrackAlign}),e.TrackSizingLike=(0,a.Or)(e.TrackSize,e.TrackSizing),e.TracksSizing=(0,a.Or)(e.TrackSizingLike,(0,a.Array)(e.TrackSizingLike),(0,a.Map)(a.Int,e.TrackSizingLike))},
function _(t,o,e,i,n){i(),e.round_rect=function(t,o,e){let{top_left:i,top_right:n,bottom_right:c,bottom_left:h}=e;if(0!=i||0!=n||0!=c||0!=h){const{left:e,right:l,top:r,bottom:T,width:f,height:a}=o,_=Math.min(f/(i+n),a/(n+c),f/(c+h),a/(i+h));_<1&&(i*=_,n*=_,c*=_,h*=_),t.moveTo(e+i,r),t.lineTo(l-n,r),t.arcTo(l,r,l,r+n,n),t.lineTo(l,T-c),t.arcTo(l,T,l-c,T,c),t.lineTo(e+h,T),t.arcTo(e,T,e,T-h,h),t.lineTo(e,r+i),t.arcTo(e,r,e+i,r,i),t.closePath()}else{const{left:e,top:i,width:n,height:c}=o;t.rect(e,i,n,c)}}},
function _(t,e,r,n,o){n();const c=t(8),i=t(12);function s(t){if(!(0,c.isString)(t)){return{x:(()=>{const[e]=t;switch(e){case"start":case"left":return 0;case"center":return.5;case"end":case"right":return 1;default:return e}})(),y:(()=>{const[,e]=t;switch(e){case"start":case"top":return 0;case"center":return.5;case"end":case"bottom":return 1;default:return e}})()}}switch(t){case"top_left":return{x:0,y:0};case"top":case"top_center":return{x:.5,y:0};case"top_right":return{x:1,y:0};case"right":case"center_right":return{x:1,y:.5};case"bottom_right":return{x:1,y:1};case"bottom":case"bottom_center":return{x:.5,y:1};case"bottom_left":return{x:0,y:1};case"left":case"center_left":return{x:0,y:.5};case"center":case"center_center":return{x:.5,y:.5}}}r.anchor=s,r.text_anchor=function(t,e,r){return s("auto"!=t?t:[(()=>{switch(e){case"left":return"start";case"center":return"center";case"right":return"end"}})(),(()=>{switch(r){case"alphabetic":case"ideographic":case"hanging":case"middle":return"center";case"top":return"start";case"bottom":return"end"}})()])},r.padding=function(t){if((0,c.isNumber)(t))return{left:t,right:t,top:t,bottom:t};if(!(0,c.isPlainObject)(t)){if(2==t.length){const[e=0,r=0]=t;return{left:e,right:e,top:r,bottom:r}}{const[e=0,r=0,n=0,o=0]=t;return{left:e,right:r,top:n,bottom:o}}}if("x"in t||"y"in t){const{x:e=0,y:r=0}=t;return{left:e,right:e,top:r,bottom:r}}if("left"in t||"right"in t||"top"in t||"bottom"in t){const{left:e=0,right:r=0,top:n=0,bottom:o=0}=t;return{left:e,right:r,top:n,bottom:o}}(0,i.unreachable)()},r.border_radius=function(t){var e,r,n,o;if((0,c.isNumber)(t))return{top_left:t,top_right:t,bottom_right:t,bottom_left:t};if((0,c.isPlainObject)(t))return{top_left:null!==(e=t.top_left)&&void 0!==e?e:0,top_right:null!==(r=t.top_right)&&void 0!==r?r:0,bottom_right:null!==(n=t.bottom_right)&&void 0!==n?n:0,bottom_left:null!==(o=t.bottom_left)&&void 0!==o?o:0};{const[e=0,r=0,n=0,o=0]=t;return{top_left:e,top_right:r,bottom_right:n,bottom_left:o}}}},
function _(e,t,r,a,o){var m;a();const n=e(242),f=e(50),s=e(21);r.ImplicitTarget=(0,s.Enum)("canvas","plot","frame","parent"),r.NodeTarget=(0,s.Or)((0,s.Ref)(f.Model),r.ImplicitTarget);class g extends n.Coordinate{constructor(e){super(e)}}r.Node=g,m=g,g.__name__="Node",m.define((({String:e,Int:t})=>({target:[r.NodeTarget],symbol:[e],offset:[t,0]}))),r.frame_left=new g({target:"frame",symbol:"left"}),r.frame_right=new g({target:"frame",symbol:"right"}),r.frame_top=new g({target:"frame",symbol:"top"}),r.frame_bottom=new g({target:"frame",symbol:"bottom"})},
function _(o,n,e,t,s){t();const c=o(50);class r extends c.Model{constructor(o){super(o)}}e.Coordinate=r,r.__name__="Coordinate"},
function _(e,i,n,t,a){var o;t();const l=e(143),r=e(160),s=e(224),_=e(199),c=e(244),h=e(230),p=e(228),g=e(194),m=e(10),u=e(12);class d extends l.BaseColorBarView{connect_signals(){super.connect_signals(),this.connect(this.model.properties.color_mapper.change,(async()=>{this._title_view.remove(),this._axis_view.remove(),this.initialize(),await this.lazy_initialize(),this.plot_view.invalidate_layout()})),this.connect(this.model.color_mapper.metrics_change,(()=>this._metrics_changed())),this.connect(this.model.properties.display_low.change,(()=>this._metrics_changed())),this.connect(this.model.properties.display_high.change,(()=>this._metrics_changed()))}get color_mapper(){let e=this.model.color_mapper;return e instanceof c.WeightedStackColorMapper&&(e=e.alpha_mapper),e}update_layout(){super.update_layout(),this._set_canvas_image()}_create_axis(){const{color_mapper:e}=this;return e instanceof c.CategoricalColorMapper?new r.CategoricalAxis:e instanceof c.LogColorMapper?new r.LogAxis:new r.LinearAxis}_create_formatter(){const{color_mapper:e}=this;return this._ticker instanceof g.LogTicker?new s.LogTickFormatter:e instanceof c.CategoricalColorMapper?new s.CategoricalTickFormatter:new s.BasicTickFormatter}_create_major_range(){const{color_mapper:e}=this;if(e instanceof c.CategoricalColorMapper)return new h.FactorRange({factors:e.factors});if(e instanceof c.ContinuousColorMapper){const{min:i,max:n}=this._continuous_metrics(e);return new h.Range1d({start:i,end:n})}(0,u.unreachable)()}_create_major_scale(){const{color_mapper:e}=this;return e instanceof c.LinearColorMapper?new p.LinearScale:e instanceof c.LogColorMapper?new p.LogScale:e instanceof c.ScanningColorMapper?new p.LinearInterpolationScale({binning:this._scanning_binning(e)}):e instanceof c.CategoricalColorMapper?new p.CategoricalScale:void(0,u.unreachable)()}_create_ticker(){const{color_mapper:e}=this;return e instanceof c.LogColorMapper?new g.LogTicker:e instanceof c.ScanningColorMapper?new g.BinnedTicker({mapper:e}):e instanceof c.CategoricalColorMapper?new g.CategoricalTicker:new g.BasicTicker}_continuous_metrics(e){const{display_low:i,display_high:n}=this.model;let{min:t,max:a}=e.metrics;if(null!=n&&null!=i&&n<i)return this._index_low=0,this._index_high=-1,{min:NaN,max:NaN};if(this._index_high=null,null!=n){const i=e.palette.length,t=e.value_to_index(n,i);t<i-1&&(this._index_high=t,a=e.index_to_value(t+1))}if(this._index_low=null,null!=i){const n=e.value_to_index(i,e.palette.length);n>0&&(this._index_low=n,t=e.index_to_value(n))}return{min:t,max:a}}_get_major_size_factor(){return this.color_mapper.palette.length}_metrics_changed(){const e=this._major_range,i=this._major_scale,{color_mapper:n}=this;if(n instanceof c.ScanningColorMapper&&i instanceof p.LinearInterpolationScale){const e=this._scanning_binning(n);i.binning=e;const t="vertical"==this.orientation,a=t?this._frame.y_scale:this._frame.x_scale;if(a instanceof p.LinearInterpolationScale){a.binning=e;const i=t?this._frame.y_range:this._frame.x_range;i instanceof h.Range1d&&(i.start=e[0],i.end=e[e.length-1])}}else if(n instanceof c.ContinuousColorMapper&&e instanceof h.Range1d){const{min:i,max:t}=this._continuous_metrics(n);e.setv({start:i,end:t})}this._set_canvas_image(),this.plot_view.request_layout()}_paint_colors(e,i){const{x:n,y:t,width:a,height:o}=i;e.save(),e.globalAlpha=this.model.scale_alpha,null!=this._image&&(e.imageSmoothingEnabled=!1,e.drawImage(this._image,n,t,a,o)),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(e),e.strokeRect(n,t,a,o)),e.restore()}_scanning_binning(e){let{binning:i,force_low_cutoff:n}=e.metrics;const{display_high:t}=this.model;let{display_low:a}=this.model;if(n&&(null==a||e.metrics.min>a)&&(a=e.metrics.min),null!=t&&null!=a&&t<a)return this._index_low=0,this._index_high=-1,[NaN];if(this._index_high=null,null!=t){const n=e.value_to_index(t,i.length);n<i.length-1&&(this._index_high=n)}if(this._index_low=null,null!=a){const n=e.value_to_index(a,i.length);n>0&&(this._index_low=n)}if(null!=this._index_low||null!=this._index_high){const e=null!=this._index_low?this._index_low:0,n=(null!=this._index_high?this._index_high+1:i.length-1)-e+1;if(n>0){const t=new Array(n);for(let a=0;a<n;a++)t[a]=i[a+e];i=t}else i=[NaN]}return i}_set_canvas_image(){const{orientation:e}=this;let{palette:i}=this.color_mapper;if(null==this._index_high&&null==this._index_low||(i=i.slice(null!=this._index_low?this._index_low:0,null!=this._index_high?this._index_high+1:i.length)),i.length<1)return void(this._image=null);"vertical"==e&&(i=(0,m.reversed)(i));const[n,t]="vertical"==e?[1,i.length]:[i.length,1],a=this._image=document.createElement("canvas");a.width=n,a.height=t;const o=a.getContext("2d"),l=o.getImageData(0,0,n,t),r=new c.LinearColorMapper({palette:i}).rgba_mapper.v_compute((0,m.range)(0,i.length));l.data.set(r),o.putImageData(l,0,0)}}n.ColorBarView=d,d.__name__="ColorBarView";class f extends l.BaseColorBar{constructor(e){super(e)}}n.ColorBar=f,o=f,f.__name__="ColorBar",o.prototype.default_view=d,o.define((({Nullable:e,Number:i,Ref:n})=>({color_mapper:[n(_.ColorMapper)],display_low:[e(i),null],display_high:[e(i),null]})))},
function _(r,o,a,p,e){p(),e("CategoricalColorMapper",r(245).CategoricalColorMapper),e("CategoricalMarkerMapper",r(247).CategoricalMarkerMapper),e("CategoricalPatternMapper",r(248).CategoricalPatternMapper),e("ContinuousColorMapper",r(198).ContinuousColorMapper),e("ColorMapper",r(199).ColorMapper),e("LinearColorMapper",r(249).LinearColorMapper),e("LogColorMapper",r(250).LogColorMapper),e("ScanningColorMapper",r(197).ScanningColorMapper),e("EqHistColorMapper",r(251).EqHistColorMapper),e("StackColorMapper",r(252).StackColorMapper),e("WeightedStackColorMapper",r(253).WeightedStackColorMapper)},
function _(t,o,r,a,e){var c;a();const s=t(246),l=t(199),n=t(98);class _ extends l.ColorMapper{constructor(t){super(t)}_v_compute(t,o,r,{nan_color:a}){(0,s.cat_v_compute)(t,this.factors,r,o,this.start,this.end,a)}}r.CategoricalColorMapper=_,c=_,_.__name__="CategoricalColorMapper",c.define((({Number:t,Nullable:o})=>({factors:[n.FactorSeq],start:[t,0],end:[o(t),null]})))},
function _(n,t,e,i,l){i();const o=n(13),f=n(8);function c(n,t){if(n.length!=t.length)return!1;for(let e=0,i=n.length;e<i;e++)if(n[e]!==t[e])return!1;return!0}e._cat_equals=c,e.cat_v_compute=function(n,t,e,i,l,r,u){const _=n.length;for(let g=0;g<_;g++){let _,h,d=n[g];(0,f.isString)(d)?_=(0,o.index_of)(t,d):(d=d.slice(l,null!=r?r:void 0),_=1==d.length?(0,o.index_of)(t,d[0]):(0,o.find_index)(t,(n=>c(n,d)))),h=_<0||_>=e.length?u:e[_],i[g]=h}}},
function _(e,r,a,t,s){var c;t();const l=e(246),n=e(98),u=e(200),o=e(20);class p extends u.Mapper{constructor(e){super(e)}v_compute(e){const r=new Array(e.length);return(0,l.cat_v_compute)(e,this.factors,this.markers,r,this.start,this.end,this.default_value),r}}a.CategoricalMarkerMapper=p,c=p,p.__name__="CategoricalMarkerMapper",c.define((({Number:e,Array:r,Nullable:a})=>({factors:[n.FactorSeq],markers:[r(o.MarkerType)],start:[e,0],end:[a(e),null],default_value:[o.MarkerType,"circle"]})))},
function _(t,e,a,r,n){var s;r();const c=t(246),l=t(98),p=t(200),u=t(20);class o extends p.Mapper{constructor(t){super(t)}v_compute(t){const e=new Array(t.length);return(0,c.cat_v_compute)(t,this.factors,this.patterns,e,this.start,this.end,this.default_value),e}}a.CategoricalPatternMapper=o,s=o,o.__name__="CategoricalPatternMapper",s.define((({Number:t,Array:e,Nullable:a})=>({factors:[l.FactorSeq],patterns:[e(u.HatchPatternType)],start:[t,0],end:[a(t),null],default_value:[u.HatchPatternType," "]})))},
function _(n,r,o,t,a){t();const e=n(198),i=n(13),s=n(11);class _ extends e.ContinuousColorMapper{constructor(n){super(n)}scan(n,r){const o=null!=this.low?this.low:(0,i.min)(n),t=null!=this.high?this.high:(0,i.max)(n);return{max:t,min:o,norm_factor:1/(t-o),normed_interval:1/r}}index_to_value(n){const r=this._scan_data;return r.min+r.normed_interval*n/r.norm_factor}value_to_index(n,r){const o=this._scan_data;if(n==o.max)return r-1;const t=(n-o.min)*o.norm_factor,a=Math.floor(t/o.normed_interval);return(0,s.clamp)(a,-1,r)}}o.LinearColorMapper=_,_.__name__="LinearColorMapper"},
function _(n,t,a,o,s){o();const r=n(198),e=n(13),i=n(11);class l extends r.ContinuousColorMapper{constructor(n){super(n)}scan(n,t){const a=null!=this.low?this.low:(0,e.min)(n),o=null!=this.high?this.high:(0,e.max)(n);return{max:o,min:a,scale:t/Math.log(o/a)}}index_to_value(n){const t=this._scan_data;return t.min*Math.exp(n/t.scale)}value_to_index(n,t){const a=this._scan_data;if(n==a.max)return t-1;if(n>a.max)return t;if(n<a.min)return-1;const o=Math.log(n/a.min),s=Math.floor(o*a.scale);return(0,i.clamp)(s,-1,t)}}a.LogColorMapper=l,l.__name__="LogColorMapper"},
function _(e,n,s,t,l){var o;t();const i=e(197),r=e(13),c=e(10);class a extends i.ScanningColorMapper{constructor(e){super(e)}scan(e,n){const s=null!=this.low?this.low:(0,r.min)(e),t=null!=this.high?this.high:(0,r.max)(e),l=this.bins,o=(0,c.linspace)(s,t,l+1),i=(0,r.bin_counts)(e,o);let a=0;for(let e=0;e<l;e++)0!=i[e]&&a++;const _=new Array(a+1),h=new Array(a+1);for(let e=0,n=1;e<l;e++)0!=i[e]&&(_[n]=i[e],h[n]=(o[e]+o[e+1])/2,n++);_[0]=0,h[0]=2*h[1]-h[a];const f=(0,c.cumsum)(_),p=f[1],u=f[a]-p;for(let e=1;e<=a;e++)f[e]=(f[e]-p)/u;f[0]=-1;let{rescale_discrete_levels:m}=this,d=0;if(m){const e=-.5/98,n=e*a+(1.5-2*e);n>1?d=1-n:m=!1}const g=(0,c.linspace)(d,1,n+1),w=(0,r.interpolate)(g,f,h);let b=!1;if(m){const e=(0,r.sorted_index)(w,s);s<w[e]&&e>0&&(w[e-1]=s),b=!0}else w[0]=s;return w[w.length-1]=t,{min:s,max:t,binning:w,force_low_cutoff:b}}}s.EqHistColorMapper=a,o=a,a.__name__="EqHistColorMapper",o.define((({Boolean:e,Int:n})=>({bins:[n,65536],rescale_discrete_levels:[e,!1]})))},
function _(o,r,a,c,e){c();const p=o(199);class t extends p.ColorMapper{constructor(o){super(o)}}a.StackColorMapper=t,t.__name__="StackColorMapper"},
function _(e,t,o,r,n){var l;r();const a=e(199),s=e(198),c=e(252),i=e(24),_=e(13),p=e(12),u=e(22);class h extends c.StackColorMapper{constructor(e){super(e)}_mix_colors(e,t,o,r){if(isNaN(r))return t;let n=0,l=0,a=0,s=0;const c=o.length;if(0!=r)for(let t=0;t<c;t++){if(isNaN(o[t]))continue;const c=o[t]/r;n+=e[4*t]*c,l+=e[4*t+1]*c,a+=e[4*t+2]*c,s+=e[4*t+3]*c}else{let t=0;for(let r=0;r<c;r++)0==o[r]&&(n+=e[4*r],l+=e[4*r+1],a+=e[4*r+2],s+=e[4*r+3],t++);n/=t,l/=t,a/=t,s/=t}return(0,u.encode_rgba)([(0,u.byte)(n),(0,u.byte)(l),(0,u.byte)(a),(0,u.byte)(s)])}_v_compute(e,t,o,r){(0,p.unreachable)()}_v_compute_uint32(e,t,o,r){const n=t.length,l=o.length,s=e.length/n;(0,p.assert)(s==l,`Expected ${s} not ${l} colors in palette`);const c=new i.RGBAArray(4*l);for(let e=0;e<l;e++){const[t,r,n,l]=(0,u.decode_rgba)(o[e]);c[4*e]=t,c[4*e+1]=r,c[4*e+2]=n,c[4*e+3]=l}const h=this.color_baseline,f=null==h?(0,_.min)(e):h;if(0!=f)for(let t=0,o=e.length;t<o;t++)e[t]=Math.max(e[t]-f,0);const{nan_color:b}=r,m=new Array(n),N=new Array(l);for(let o=0;o<n;o++){let r=NaN;for(let t=0;t<l;t++){const n=e[o*l+t];N[t]=n,isNaN(n)||(isNaN(r)?r=n:r+=n)}t[o]=this._mix_colors(c,b,N,r),m[o]=r}const g=(0,a._convert_palette)(this.alpha_mapper.palette),y=new Uint32Array(n);this.alpha_mapper._v_compute(m,y,g,r);for(let e=0;e<n;e++){const o=(0,u.byte)((255&t[e])*(255&y[e])/255);t[e]=4294967040&t[e]|o}}}o.WeightedStackColorMapper=h,l=h,h.__name__="WeightedStackColorMapper",l.define((({Array:e,Nullable:t,Number:o,Ref:r,String:n})=>({alpha_mapper:[r(s.ContinuousColorMapper)],color_baseline:[t(o),null],stack_labels:[t(e(n)),null]})))},
function _(e,t,r,i,l){var n;i();const o=e(143),s=e(230),a=e(201),_=e(59),h=e(12);class d extends o.BaseColorBarView{*children(){yield*super.children(),yield this._fill_view,yield this._line_view}async lazy_initialize(){await super.lazy_initialize();const{fill_renderer:e,line_renderer:t}=this.model;this._fill_view=await(0,_.build_view)(e,{parent:this.parent}),this._line_view=await(0,_.build_view)(t,{parent:this.parent})}remove(){this._fill_view.remove(),this._line_view.remove(),super.remove()}_create_major_range(){const e=this.model.levels;return e.length>0?new s.Range1d({start:e[0],end:e[e.length-1]}):new s.Range1d({start:0,end:1})}_paint_colors(e,t){const r="vertical"==this.orientation,i=this.model.levels,l=this._major_scale;l.source_range=this._major_range,l.target_range=r?new s.Range1d({start:t.bottom,end:t.top}):new s.Range1d({start:t.left,end:t.right});const n=l.v_compute(i),o=this._fill_view.glyph,a=o.data_size;if(a>0){(0,h.assert)(i.length==a+1,"Inconsistent number of filled contour levels"),e.save();for(let i=0;i<a;i++)e.beginPath(),r?e.rect(t.left,n[i],t.width,n[i+1]-n[i]):e.rect(n[i],t.top,n[i+1]-n[i],t.height),o.visuals.fill.apply(e,i),o.visuals.hatch.apply(e,i);e.restore()}const _=this._line_view.glyph,d=_.data_size;if(d>0){(0,h.assert)(i.length==d,"Inconsistent number of line contour levels"),e.save();for(let i=0;i<d;i++)e.beginPath(),r?(e.moveTo(t.left,n[i]),e.lineTo(t.right,n[i])):(e.moveTo(n[i],t.bottom),e.lineTo(n[i],t.top)),_.visuals.line.set_vectorize(e,i),e.stroke();e.restore()}}}r.ContourColorBarView=d,d.__name__="ContourColorBarView";class v extends o.BaseColorBar{constructor(e){super(e)}}r.ContourColorBar=v,n=v,v.__name__="ContourColorBar",n.prototype.default_view=d,n.define((({Array:e,Number:t,Ref:r})=>({fill_renderer:[r(a.GlyphRenderer)],line_renderer:[r(a.GlyphRenderer)],levels:[e(t),[]]})))},
function _(e,t,s,i,n){var a;i();const o=e(145),l=e(11),h=e(20),u=e(146);class c extends o.TextAnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new u.SideLayout(e,(()=>this.get_size()),!1):void 0}_get_size(){if(!this.displayed)return{width:0,height:0};const e=this._text_view.graphics(),{angle:t,angle_units:s}=this.model;e.angle=(0,l.compute_angle)(t,s),e.visuals=this.visuals.text.values();const{width:i,height:n}=e.size();return{width:i,height:n}}_render(){const{angle:e,angle_units:t}=this.model,s=(0,l.compute_angle)(e,t),i=null!=this.layout?this.layout:this.plot_view.frame,n=this.coordinates.x_scale,a=this.coordinates.y_scale;let o=(()=>{switch(this.model.x_units){case"canvas":return this.model.x;case"screen":return i.bbox.xview.compute(this.model.x);case"data":return n.compute(this.model.x)}})(),h=(()=>{switch(this.model.y_units){case"canvas":return this.model.y;case"screen":return i.bbox.yview.compute(this.model.y);case"data":return a.compute(this.model.y)}})();o+=this.model.x_offset,h-=this.model.y_offset,this._paint(this.layer.ctx,{sx:o,sy:h},s)}}s.LabelView=c,c.__name__="LabelView";class d extends o.TextAnnotation{constructor(e){super(e)}}s.Label=d,a=d,d.__name__="Label",a.prototype.default_view=c,a.define((({Number:e,Angle:t})=>({x:[e],x_units:[h.CoordinateUnits,"data"],y:[e],y_units:[h.CoordinateUnits,"data"],angle:[t,0],angle_units:[h.AngleUnits,"rad"],x_offset:[e,0],y_offset:[e,0]})))},
function _(t,e,i,s,a){var n;s();const o=t(1),l=t(100),r=o.__importStar(t(78)),c=t(20),_=t(153),u=o.__importStar(t(18)),x=t(24);class h extends l.DataAnnotationView{map_data(){const{x_scale:t,y_scale:e}=this.coordinates,i=null!=this.layout?this.layout:this.plot_view.frame;this.sx=(()=>{switch(this.model.x_units){case"canvas":return new x.ScreenArray(this._x);case"screen":return i.bbox.xview.v_compute(this._x);case"data":return t.v_compute(this._x)}})(),this.sy=(()=>{switch(this.model.y_units){case"canvas":return new x.ScreenArray(this._y);case"screen":return i.bbox.yview.v_compute(this._y);case"data":return e.v_compute(this._y)}})()}paint(){const{ctx:t}=this.layer;for(let e=0,i=this.text.length;e<i;e++){const i=this.x_offset.get(e),s=this.y_offset.get(e),a=this.sx[e]+i,n=this.sy[e]-s,o=this.angle.get(e),l=this.text.get(e);isFinite(a+n+o)&&null!=l&&this._paint(t,e,`${l}`,a,n,o)}}_paint(t,e,i,s,a,n){const o=new _.TextBox({text:i});o.angle=n,o.position={sx:s,sy:a},o.visuals=this.visuals.text.values(e);const{background_fill:l,border_line:r}=this.visuals;if(l.doit||r.doit){const{p0:i,p1:s,p2:a,p3:n}=o.rect();t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(s.x,s.y),t.lineTo(a.x,a.y),t.lineTo(n.x,n.y),t.closePath(),this.visuals.background_fill.apply(t,e),this.visuals.border_line.apply(t,e)}this.visuals.text.doit&&o.paint(t)}}i.LabelSetView=h,h.__name__="LabelSetView";class d extends l.DataAnnotation{constructor(t){super(t)}}i.LabelSet=d,n=d,d.__name__="LabelSet",n.prototype.default_view=h,n.mixins([r.TextVector,["border_",r.LineVector],["background_",r.FillVector]]),n.define((()=>({x:[u.XCoordinateSpec,{field:"x"}],y:[u.YCoordinateSpec,{field:"y"}],x_units:[c.CoordinateUnits,"data"],y_units:[c.CoordinateUnits,"data"],text:[u.NullStringSpec,{field:"text"}],angle:[u.AngleSpec,0],x_offset:[u.NumberSpec,{value:0}],y_offset:[u.NumberSpec,{value:0}]}))),n.override({background_fill_color:null,border_line_color:null})},
function _(t,e,i,n,s){var o;n();const l=t(1),r=t(73),a=t(258),c=t(20),h=l.__importStar(t(78)),_=t(15),d=t(146),b=t(57),u=t(10),g=t(34),p=t(8),m=t(153),f=t(231),{max:x,ceil:w}=Math;class y extends f.ContentLayoutable{constructor(t,e,i,n){super(),this.item=t,this.label=e,this.text=i,this.settings=n}get field(){return this.item.get_field_from_label_prop()}_content_size(){const t=this.text.size(),{glyph_width:e,glyph_height:i,label_standoff:n,label_width:s,label_height:o}=this.settings,l=e+n+x(t.width,s),r=x(i,t.height,o);return new f.Sizeable({width:l,height:r})}}y.__name__="LegendEntry";class v extends r.AnnotationView{constructor(){super(...arguments),this.bbox=new b.BBox}_get_size(){const{width:t,height:e}=this.bbox,{margin:i}=this.model;return{width:t+2*i,height:e+2*i}}update_layout(){this.update_geometry();const{panel:t}=this;this.layout=null!=t?new d.SideLayout(t,(()=>this.get_size())):void 0}connect_signals(){super.connect_signals();const t=()=>this.request_render();this.connect(this.model.change,t),this.connect(this.model.item_change,t)}get padding(){return null!=this.model.border_line_color?this.model.padding:0}update_geometry(){super.update_geometry();const{spacing:t,orientation:e}=this.model,i="vertical"==e,{padding:n}=this,s=n,o=n,{title:l}=this.model,r=new m.TextBox({text:null!=l?l:""});r.position={sx:0,sy:0,x_anchor:"left",y_anchor:"top"},r.visuals=this.visuals.title_text.values();const a=new d.Panel(this.model.title_location);r.angle=a.get_label_angle_heuristic("parallel");const c=[];for(const t of this.model.items){t.legend=this.model;const e=t.get_labels_list_from_label_prop();for(const i of e){const e=new m.TextBox({text:`${i}`});e.position={sx:0,sy:0,x_anchor:"left",y_anchor:"center"},e.visuals=this.visuals.label_text.values();const n=new y(t,i,e,this.model);n.set_sizing({visible:t.visible}),c.push({layout:n,row:0,col:0})}}const{ncols:h,nrows:_}=(()=>{let{ncols:t,nrows:e}=this.model;const n=c.length;return i?("auto"!=e||(e="auto"!=t?w(n/t):1/0),t=1/0):("auto"!=t||(t="auto"!=e?w(n/e):1/0),e=1/0),{ncols:t,nrows:e}})();let u=0,g=0;for(const t of c)t.row=u,t.col=g,i?(u+=1,u>=_&&(u=0,g+=1)):(g+=1,g>=h&&(g=0,u+=1));const p=new f.Grid(c);this.grid=p,p.spacing=t,p.set_sizing();const x=new f.TextLayout(r);this.title_panel=x;const v=""!=r.text&&this.visuals.title_text.doit;x.set_sizing({visible:v});const k=(()=>{if(!v)return new f.Column([p]);switch(this.model.title_location){case"above":return new f.Column([x,p]);case"below":return new f.Column([p,x]);case"left":return new f.Row([x,p]);case"right":return new f.Row([p,x])}})();this.border_box=k,k.position={left:s,top:o},k.spacing=this.model.title_standoff,k.set_sizing(),k.compute();const L=n+k.bbox.width+n,z=n+k.bbox.height+n;this.bbox=new b.BBox({left:0,top:0,width:L,height:z})}compute_geometry(){super.compute_geometry();const{margin:t,location:e}=this.model,{width:i,height:n}=this.bbox,s=null!=this.layout?this.layout:this.plot_view.frame,[o,l]=s.bbox.ranges;let r,a;if((0,p.isString)(e))switch(e){case"top_left":r=o.start+t,a=l.start+t;break;case"top":case"top_center":r=(o.end+o.start)/2-i/2,a=l.start+t;break;case"top_right":r=o.end-t-i,a=l.start+t;break;case"bottom_right":r=o.end-t-i,a=l.end-t-n;break;case"bottom":case"bottom_center":r=(o.end+o.start)/2-i/2,a=l.end-t-n;break;case"bottom_left":r=o.start+t,a=l.end-t-n;break;case"left":case"center_left":r=o.start+t,a=(l.end+l.start)/2-n/2;break;case"center":case"center_center":r=(o.end+o.start)/2-i/2,a=(l.end+l.start)/2-n/2;break;case"right":case"center_right":r=o.end-t-i,a=(l.end+l.start)/2-n/2}else{const[t,i]=e;r=s.bbox.xview.compute(t),a=s.bbox.yview.compute(i)-n}this.bbox=new b.BBox({left:r,top:a,width:i,height:n})}interactive_hit(t,e){return this.bbox.contains(t,e)}_hit_test(t,e){const{left:i,top:n}=this.bbox;t-=i+this.grid.bbox.left,e-=n+this.grid.bbox.top;for(const i of this.grid)if(i.bbox.contains(t,e))return{type:"entry",entry:i};return null}cursor(t,e){return"none"==this.model.click_policy?null:null!=this._hit_test(t,e)?"pointer":null}on_hit(t,e){const i=(()=>{switch(this.model.click_policy){case"hide":return t=>t.visible=!t.visible;case"mute":return t=>t.muted=!t.muted;case"none":return t=>{}}})(),n=this._hit_test(t,e);if(null!=n){const{renderers:t}=n.entry.item;for(const e of t)i(e);return!0}return!1}_render(){if(this.update_geometry(),this.compute_geometry(),0==this.model.items.length)return;if(!(0,u.some)(this.model.items,(t=>t.visible)))return;const{ctx:t}=this.layer;t.save(),this._draw_legend_box(t),this._draw_legend_items(t),this._draw_title(t),t.restore()}_draw_legend_box(t){const{x:e,y:i,width:n,height:s}=this.bbox;t.beginPath(),t.rect(e,i,n,s),this.visuals.background_fill.apply(t),this.visuals.border_line.apply(t)}_draw_title(t){const{title:e}=this.model;if(null==e||0==e.length||!this.visuals.title_text.doit)return;const{left:i,top:n}=this.bbox;switch(t.save(),t.translate(i,n),t.translate(this.title_panel.bbox.left,this.title_panel.bbox.top),this.model.title_location){case"left":t.translate(0,this.title_panel.bbox.height);break;case"right":t.translate(this.title_panel.bbox.width,0)}this.title_panel.text.paint(t),t.restore()}_draw_legend_items(t){const e=(()=>{switch(this.model.click_policy){case"none":return t=>!0;case"hide":return t=>(0,u.every)(t.renderers,(t=>t.visible));case"mute":return t=>(0,u.every)(t.renderers,(t=>!t.muted))}})(),i=(t,e,i)=>{if(!this.visuals.item_background_fill.doit)return!1;switch(this.model.item_background_policy){case"every":return!0;case"even":return e%2==0==(i%2==0);case"odd":return e%2==0!=(i%2==0);case"none":return!1}},{left:n,top:s}=this.bbox;t.translate(n,s),t.translate(this.grid.bbox.left,this.grid.bbox.top);for(const[{layout:n,row:s,col:o},l]of(0,g.enumerate)(this.grid.items)){const{bbox:l,text:r,item:a,label:c,field:h,settings:_}=n,{glyph_width:d,glyph_height:b,label_standoff:u}=_,{left:g,top:p,width:m,height:f}=l;t.translate(g,p),i(0,s,o)&&(t.beginPath(),t.rect(0,0,m,f),this.visuals.item_background_fill.apply(t));const x=f/2,w=0,y=x-b/2,v=w+d,k=y+b;for(const e of a.renderers){const i=this.plot_view.renderer_view(e);null==i||i.draw_legend(t,w,v,y,k,h,c,a.index)}t.translate(v+u,x),r.paint(t),t.translate(-v-u,-x),e(a)||(t.beginPath(),t.rect(0,0,m,f),this.visuals.inactive_fill.set_value(t),t.fill()),t.translate(-g,-p)}t.translate(-this.grid.bbox.left,-this.grid.bbox.top),t.translate(-n,-s)}}i.LegendView=v,v.__name__="LegendView";class k extends r.Annotation{constructor(t){super(t)}initialize(){super.initialize(),this.item_change=new _.Signal0(this,"item_change")}}i.Legend=k,o=k,k.__name__="Legend",o.prototype.default_view=v,o.mixins([["label_",h.Text],["title_",h.Text],["inactive_",h.Fill],["border_",h.Line],["background_",h.Fill],["item_background_",h.Fill]]),o.define((({Number:t,Int:e,String:i,Array:n,Tuple:s,Or:o,Ref:l,Nullable:r,Positive:h,Auto:_})=>({orientation:[c.Orientation,"vertical"],ncols:[o(h(e),_),"auto"],nrows:[o(h(e),_),"auto"],location:[o(c.LegendLocation,s(t,t)),"top_right"],title:[r(i),null],title_location:[c.Location,"above"],title_standoff:[t,5],label_standoff:[t,5],glyph_height:[t,20],glyph_width:[t,20],label_height:[t,20],label_width:[t,20],margin:[t,10],padding:[t,10],spacing:[t,3],items:[n(l(a.LegendItem)),[]],click_policy:[c.LegendClickPolicy,"none"],item_background_policy:[c.AlternationPolicy,"none"]}))),o.override({border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,item_background_fill_color:"#f1f1f1",item_background_fill_alpha:.8,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,r,n,l,t){var i;l();const s=e(1),o=e(50),_=e(201),a=e(101),u=e(28),d=s.__importStar(e(18)),c=e(19),h=e(10);class f extends o.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;for(const r of this.renderers)if(r.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 r=this.renderers[0].data_source;if(!(0,h.includes)(r.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()||c.logger.error("Non matching data sources on legend item renderers");this._check_field_label_on_data_source()||c.logger.error(`Bad column name on label: ${this.label}`)}get_field_from_label_prop(){const{label:e}=this;return(0,u.isField)(e)?e.field:null}get_labels_list_from_label_prop(){if(!this.visible)return[];const{index:e}=this;if(null!=e&&this.renderers.every((r=>!(e in r.view.indices_map))))return[];if((0,u.isValue)(this.label)){const{value:e}=this.label;return null!=e?[e]:[]}const r=this.get_field_from_label_prop();if(null!=r){let e;if(0==this.renderers.length)return["No source found"];if(e=this.renderers[0].data_source,e instanceof a.ColumnarDataSource){const n=e.get_column(r);return null!=n?(0,h.uniq)(Array.from(n)):["Invalid field"]}}return[]}}n.LegendItem=f,i=f,f.__name__="LegendItem",i.define((({Boolean:e,Int:r,Array:n,Ref:l,Nullable:t})=>({label:[d.NullStringSpec,null],renderers:[n(l(_.GlyphRenderer)),[]],index:[t(r),null],visible:[e,!0]})))},
function _(t,e,s,n,i){var o,a;n();const r=t(1),l=t(73),h=t(95),_=r.__importStar(t(78)),c=t(20),d=t(212),u=t(15),y=t(57),p=t(13),v=t(12);class x{constructor(t=[],e=[]){this.xs=t,this.ys=e,(0,v.assert)(t.length==e.length)}clone(){return new x(this.xs.slice(),this.ys.slice())}[Symbol.iterator](){return this.nodes()}*nodes(){const{xs:t,ys:e,n:s}=this;for(let n=0;n<s;n++)yield[t[n],e[n],n]}*edges(){const{xs:t,ys:e,n:s}=this;for(let n=1;n<s;n++){const s={x:t[n-1],y:e[n-1]},i={x:t[n],y:e[n]};yield[s,i,n-1]}if(s>=3){const n={x:t[s-1],y:e[s-1]},i={x:t[0],y:e[0]};yield[n,i,s-1]}}contains(t,e){return(0,d.point_in_poly)(t,e,this.xs,this.ys)}get bbox(){const[t,e,s,n]=(0,p.minmax2)(this.xs,this.ys);return new y.BBox({x0:t,x1:e,y0:s,y1:n})}get n(){return this.xs.length}translate(t,e,...s){const n=this.clone(),{xs:i,ys:o,n:a}=n;if(0!=s.length)for(const n of s){const s=n%a;i[s]+=t,o[s]+=e}else for(let s=0;s<a;s++)i[s]+=t,o[s]+=e;return n}}x.__name__="Polygon";class m extends l.AnnotationView{constructor(){super(...arguments),this.poly=new x,this[o]=!0,this._pan_state=null,this._is_hovered=!1}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.poly.bbox.round()})}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}bounds(){const{xs_units:t,ys_units:e}=this.model;if("data"==t&&"data"==e){const{xs:t,ys:e}=this.model,[s,n,i,o]=(0,p.minmax2)(t,e);return{x0:s,x1:n,y0:i,y1:o}}return(0,y.empty)()}log_bounds(){return(0,y.empty)()}_mappers(){const t=(t,e,s,n)=>{switch(t){case"canvas":return n;case"screen":return s;case"data":return e}},e=this.model,{frame:s,canvas:n}=this.plot_view,{x_scale:i,y_scale:o}=s,{x_view:a,y_view:r}=s.bbox,{x_screen:l,y_screen:h}=n.bbox;return{x:t(e.xs_units,i,a,l),y:t(e.ys_units,o,r,h)}}_render(){const{xs:t,ys:e}=this.model;(0,v.assert)(t.length==e.length),this.poly=(()=>{const{x:s,y:n}=this._mappers();return new x(s.v_compute(t),n.v_compute(e))})();const{ctx:s}=this.layer;s.beginPath();for(const[t,e]of this.poly)s.lineTo(t,e);const{_is_hovered:n,visuals:i}=this,o=n&&i.hover_fill.doit?i.hover_fill:i.fill,a=n&&i.hover_hatch.doit?i.hover_hatch:i.hatch,r=n&&i.hover_line.doit?i.hover_line:i.line;this.poly.n>=3&&(s.closePath(),o.apply(s),a.apply(s)),r.apply(s)}interactive_hit(t,e){return!(!this.model.visible||!this.model.editable)&&this.poly.contains(t,e)}_hit_test(t,e){const{abs:s}=Math,n=Math.max(2.5,this.model.line_width/2);for(const[i,o,a]of this.poly)if(s(i-t)<n&&s(o-e)<n)return{type:"node",i:a};const i={x:t,y:e};let o=null,a=1/0;for(const[t,e,s]of this.poly.edges()){const r=(0,d.dist_to_segment)(i,t,e);r<n&&r<a&&(a=r,o=s)}return null!=o?{type:"edge",i:o}:this.poly.contains(t,e)?{type:"area"}:null}_can_hit(t){return!0}_pan_start(t){if(this.model.visible&&this.model.editable){const{sx:e,sy:s}=t,n=this._hit_test(e,s);if(null!=n&&this._can_hit(n))return this._pan_state={poly:this.poly.clone(),target:n},this.model.pan.emit(["pan:start",t.modifiers]),!0}return!1}_pan(t){(0,v.assert)(null!=this._pan_state);const e=(()=>{const{poly:e,target:s}=this._pan_state,{dx:n,dy:i}=t;switch(s.type){case"node":{const{i:t}=s;return e.translate(n,i,t)}case"edge":{const{i:t}=s;return e.translate(n,i,t,t+1)}case"area":return e.translate(n,i)}})(),{x:s,y:n}=this._mappers(),i=s.v_invert(e.xs),o=n.v_invert(e.ys);this.model.update({xs:i,ys:o}),this.model.pan.emit(["pan",t.modifiers])}_pan_end(t){this._pan_state=null,this.model.pan.emit(["pan:end",t.modifiers])}get _has_hover(){const{hover_line:t,hover_fill:e,hover_hatch:s}=this.visuals;return t.doit||e.doit||s.doit}_move_start(t){const{_has_hover:e}=this;return e&&(this._is_hovered=!0,this.request_paint()),e}_move(t){}_move_end(t){this._has_hover&&(this._is_hovered=!1,this.request_paint())}cursor(t,e){var s,n;const i=null!==(n=null===(s=this._pan_state)||void 0===s?void 0:s.target)&&void 0!==n?n:this._hit_test(t,e);if(null==i||!this._can_hit(i))return null;switch(i.type){case"node":case"edge":case"area":return"move"}}}s.PolyAnnotationView=m,o=h.auto_ranged,m.__name__="PolyAnnotationView";class f extends l.Annotation{constructor(t){super(t),this.pan=new u.Signal(this,"pan")}update({xs:t,ys:e}){this.setv({xs:t.slice(),ys:e.slice(),visible:!0})}clear(){this.setv({xs:[],ys:[],visible:!1})}}s.PolyAnnotation=f,a=f,f.__name__="PolyAnnotation",a.prototype.default_view=m,a.mixins([_.Line,_.Fill,_.Hatch,["hover_",_.Line],["hover_",_.Fill],["hover_",_.Hatch]]),a.define((({Boolean:t,Number:e,Arrayable:s})=>({xs:[s(e),[]],ys:[s(e),[]],xs_units:[c.CoordinateUnits,"data"],ys_units:[c.CoordinateUnits,"data"],editable:[t,!1]}))),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3,hover_fill_color:null,hover_fill_alpha:.4,hover_line_color:null,hover_line_alpha:.3})},
function _(t,e,i,a,s){var o;a();const n=t(1),l=t(73),r=t(261),h=t(87),_=t(88),c=t(20),u=n.__importStar(t(78)),d=t(153),g=t(146),b=t(57),x=t(231),w=t(233),p=t(186),m=t(163),y=t(195),f=t(90),v=t(84),z=t(59),k=t(11),L=t(12),B=t(34),S=t(172),T=t(21),{round:A}=Math,R=(0,T.Enum)("adaptive","exact");class F extends l.AnnotationView{constructor(){super(...arguments),this.bbox=new b.BBox}_get_size(){const{width:t,height:e}=this.bbox,{margin:i}=this.model;return{width:t+2*i,height:e+2*i}}initialize(){super.initialize();const{ticker:t}=this.model;this.axis=new p.LinearAxis(Object.assign({ticker:t},u.attrs_of(this.model,"bar_",u.Line,"axis_"))),this.range=(()=>{const{range:t,orientation:e}=this.model;if("auto"!=t)return t;{const{frame:t}=this.parent;switch(e){case"horizontal":return t.x_range;case"vertical":return t.y_range}}})()}async lazy_initialize(){await super.lazy_initialize();const t=(()=>{const t=new _.Range1d,e=new _.Range1d,i=new _.Range1d,a=new _.Range1d;return this.axis_scale=new f.LinearScale({source_range:t,target_range:e}),this.cross_scale=new f.LinearScale({source_range:i,target_range:a}),"horizontal"==this.model.orientation?new v.CoordinateTransform(this.axis_scale,this.cross_scale):new v.CoordinateTransform(this.cross_scale,this.axis_scale)})();this.axis_view=await(0,z.build_view)(this.axis,{parent:this.plot_view}),this.axis_view.coordinates=t,this.axis_view.panel=new g.Panel("horizontal"==this.model.orientation?"below":"right"),this.axis_view.update_layout()}remove(){this.axis_view.remove(),super.remove()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>{this.request_render()})),this.connect(this.range.change,(()=>{this.request_render()}))}update_layout(){this.update_geometry();const{panel:t}=this;this.layout=null!=t?new g.SideLayout(t,(()=>this.get_size())):void 0}update_geometry(){super.update_geometry()}get horizontal(){return"horizontal"==this.model.orientation}text_layout(t){const{text:e,location:i,align:a,visuals:s}=t,{orientation:o}=this.model,n=new d.TextBox({text:e}),l=new g.Panel(i);n.visuals=s.values();const r=(()=>{switch(i){case"above":case"below":return"horizontal";default:return o}})();n.angle=l.get_label_angle_heuristic(r),n.base_font_size=this.plot_view.base_font_size,n.position={sx:0,sy:0,x_anchor:"left",y_anchor:"top"},n.align="auto";const h=new x.TextLayout(n);h.absolute=!0;const _="horizontal"==o,c=_?a:void 0,u=_?void 0:a;return h.set_sizing({width_policy:"min",height_policy:"min",visible:""!=e&&s.doit,halign:c,valign:u}),h}compute_geometry(){super.compute_geometry();const{orientation:t,bar_length:e,length_sizing:i,padding:a,margin:s,location:o}=this.model,{border_line:n,bar_line:l}=this.visuals,r=l.line_width.get_value(),h=n.line_width.get_value(),{frame:_}=this.parent,c="horizontal"==t?_.bbox.width:_.bbox.height,u=0<=e&&e<=1?e:(0,k.clamp)(e/c,0,1),{new_value:d,new_unit:g,new_long_unit:p,scale_factor:m,exact:y}=(()=>{const{unit:t,dimensional:e}=this.model,a=this.range.span*u;return e.compute(a,t,"exact"==i)})(),f=A(c*u*m),v=(()=>{const{label:t}=this.model;return(0,S.process_placeholders)(t,((t,e,i)=>{switch(e){case"value":return y?null!=i?(0,S.sprintf)(i,d):d.toFixed(2):`${d}`;case"unit":switch(null!=i?i:"short"){case"short":return g;case"long":return p}default:return"???"}}))})();this.label_layout=this.text_layout({text:v,location:this.model.label_location,align:this.model.label_align,visuals:this.visuals.label_text}),this.title_layout=this.text_layout({text:this.model.title,location:this.model.title_location,align:this.model.title_align,visuals:this.visuals.title_text});const z="horizontal"==t?{width:f,height:r}:{width:r,height:f},T=this.axis_view.layout;(0,L.assert)(null!=T),this.axis_layout=T,T.absolute=!0,"horizontal"==t?T.set_sizing({width_policy:"fixed",width:z.width,height_policy:"min",valign:"center"}):T.set_sizing({width_policy:"min",height_policy:"fixed",height:z.height,halign:"center"}),this.box_layout=(()=>{const t={above:[],below:[],left:[],right:[]};function e(e,i,a){e.visible&&t[i].push(function(t,e){const i=new x.FixedLayout;return i.absolute=!0,i.set_sizing("left"==t||"right"==t?{width_policy:"fixed",width:e}:{height_policy:"fixed",height:e}),i}(i,a),e)}e(this.label_layout,this.model.label_location,this.model.label_standoff),e(this.title_layout,this.model.title_location,this.model.title_standoff);const i=t.above.length,a=t.left.length,s=[{layout:T,row:i,col:a}];for(const[e,o]of(0,B.enumerate)(t.above))s.push({layout:e,row:i-o-1,col:a});for(const[e,o]of(0,B.enumerate)(t.below))s.push({layout:e,row:i+o+1,col:a});for(const[e,o]of(0,B.enumerate)(t.left))s.push({layout:e,row:i,col:a-o-1});for(const[e,o]of(0,B.enumerate)(t.right))s.push({layout:e,row:i,col:a+o+1});return new w.Grid(s)})();const{box_layout:R}=this;R.absolute=!0,R.position={left:a,top:a},R.set_sizing(),R.compute();const[F,N]=(()=>{const{x_range:e,y_range:i}=this.axis_view.bbox;return"horizontal"==t?[e,i]:[i,e]})();this.axis_scale.source_range.end=d,this.axis_scale.target_range.setv(F),this.cross_scale.source_range.end=1,this.cross_scale.target_range.setv(N);const O=h+a+R.bbox.width+a+h,P=h+a+R.bbox.height+a+h,V=null!=this.layout?this.layout:this.plot_view.frame,[q,C]=V.bbox.ranges,{sx:M,sy:j}=(()=>{switch(o){case"top_left":return{sx:q.start+s,sy:C.start+s};case"top":case"top_center":return{sx:(q.end+q.start)/2-O/2,sy:C.start+s};case"top_right":return{sx:q.end-s-O,sy:C.start+s};case"bottom_right":return{sx:q.end-s-O,sy:C.end-s-P};case"bottom":case"bottom_center":return{sx:(q.end+q.start)/2-O/2,sy:C.end-s-P};case"bottom_left":return{sx:q.start+s,sy:C.end-s-P};case"left":case"center_left":return{sx:q.start+s,sy:(C.end+C.start)/2-P/2};case"center":case"center_center":return{sx:(q.end+q.start)/2-O/2,sy:(C.end+C.start)/2-P/2};case"right":case"center_right":return{sx:q.end-s-O,sy:(C.end+C.start)/2-P/2}}})();this.bbox=new b.BBox({left:M,top:j,width:O,height:P})}_draw_box(t){const{width:e,height:i}=this.bbox;t.beginPath(),t.rect(0,0,e,i),this.visuals.background_fill.apply(t),this.visuals.background_hatch.apply(t),this.visuals.border_line.apply(t)}_draw_axis(t){this.axis_view.render()}_draw_text(t,e,i){const{bbox:a}=e,[s,o]=(()=>{const{orientation:t}=this.model,e="horizontal"==t;switch(i){case"left":return e?[0,0]:[0,a.height];case"right":return e?[0,0]:[a.width,0];case"above":case"below":return[0,0]}})(),{left:n,top:l}=a.translate(s,o);t.translate(n,l),e.text.paint(t),t.translate(-n,-l)}_draw_label(t){this._draw_text(t,this.label_layout,this.model.label_location)}_draw_title(t){this._draw_text(t,this.title_layout,this.model.title_location)}_render(){this.update_geometry(),this.compute_geometry();const{ctx:t}=this.layer,{left:e,top:i}=this.bbox;t.translate(e,i),this.box_layout.visible&&this._draw_box(t),this.axis_layout.visible&&this._draw_axis(t),this.label_layout.visible&&this._draw_label(t),this.title_layout.visible&&this._draw_title(t),t.translate(-e,-i)}}i.ScaleBarView=F,F.__name__="ScaleBarView";class N extends l.Annotation{constructor(t){super(t)}}i.ScaleBar=N,o=N,N.__name__="ScaleBar",o.prototype.default_view=F,o.mixins([["bar_",u.Line],["label_",u.Text],["title_",u.Text],["border_",u.Line],["background_",u.Fill],["background_",u.Hatch]]),o.define((({NonNegative:t,Number:e,String:i,Ref:a,Or:s,Auto:o})=>({range:[s(a(h.Range),o),"auto"],unit:[i,"m"],dimensional:[a(r.Dimensional),()=>new r.MetricLength],orientation:[c.Orientation,"horizontal"],bar_length:[t(e),.2],length_sizing:[R,"adaptive"],location:[c.Anchor,"top_right"],label:[i,"@{value} @{unit}"],label_align:[c.Align,"center"],label_location:[c.Location,"below"],label_standoff:[e,5],title:[i,""],title_align:[c.Align,"center"],title_location:[c.Location,"above"],title_standoff:[e,5],margin:[e,10],padding:[e,10],ticker:[a(m.Ticker),()=>new y.FixedTicker({ticks:[]})]}))),o.override({bar_line_width:2,border_line_color:"#e5e5e5",border_line_alpha:.5,border_line_width:1,background_fill_color:"#ffffff",background_fill_alpha:.95,label_text_font_size:"13px",label_text_baseline:"middle",title_text_font_size:"13px",title_text_font_style:"italic"})},
function _(e,n,t,l,s){var r,i,u;l();const a=e(50),o=e(12),c=e(13),{min:_}=Math;class m extends a.Model{constructor(e){super(e)}compute(e,n,t){const{ticks:l,basis:s}=this,r=s.find((({short_name:e})=>e==n));(0,o.assert)(null!=r);const i=e*r.factor,[u,a,m]=(()=>{const e=(0,c.bisect_right_by)(s,i,(({factor:e})=>e));if(e>0){const{short_name:n,long_name:t,factor:l}=s[e-1];return[n,t,i/l]}return[n,r.long_name,i]})();t=null!=t?t:0==l.length;const h=(()=>{if(t)return m;{const e=(0,c.bisect_right)(l,m);return l[_(e,l.length-1)]}})();return{new_value:h,new_unit:u,new_long_unit:a,scale_factor:h*(i/m)/e/r.factor,exact:t}}}t.Dimensional=m,r=m,m.__name__="Dimensional",r.define((({Nullable:e,Array:n,String:t,Number:l})=>({ticks:[n(l)],include:[e(n(t)),null],exclude:[n(t),[]]})));class h extends m{constructor(e){super(e),this._basis=null,this._basis_template=[["Q",1e30,"quetta",null],["R",1e27,"ronna",null],["Y",1e24,"yotta",null],["Z",1e21,"zetta",null],["E",1e18,"exa",null],["P",1e15,"peta",null],["T",1e12,"tera",null],["G",1e9,"giga",null],["M",1e6,"mega",null],["k",1e3,"kilo",null],["h",100,"hecto",null],["",1,"",null],["d",.1,"deci",null],["c",.01,"centi",null],["m",.001,"milli",null],["\xb5",1e-6,"micro","\\mathrm{\\mu}"],["n",1e-9,"nano",null],["p",1e-12,"pico",null],["f",1e-15,"femto",null],["a",1e-18,"atto",null],["z",1e-21,"zepto",null],["y",1e-24,"yocto",null],["r",1e-27,"ronto",null],["q",1e-30,"quecto",null]]}build_basis(){const{_basis_template:e,_short_name:n,_long_name:t,_tex_repr:l}=this,{include:s,exclude:r}=this,i=e.map((([e,s,r,i])=>({short_name:`${e}${n}`,factor:s,long_name:`${r}${t}`,tex_repr:`${null!=i?i:e}${l}`}))).filter((({short_name:e})=>(null==s||s.includes(e))&&!r.includes(e)));return(0,c.sort_by)(i,(({factor:e})=>e))}get basis(){return null==this._basis&&(this._basis=this.build_basis()),this._basis}}t.Metric=h,i=h,h.__name__="Metric",i.override({ticks:[1,2,5,10,15,20,25,50,75,100,125,150,200,250,500,750]});class d extends h{constructor(e){super(e),this._short_name="m",this._long_name="meter",this._tex_repr="m"}}t.MetricLength=d,u=d,d.__name__="MetricLength",u.override({exclude:["dm","hm"]})},
function _(e,l,o,i,t){var n;i();const s=e(1),a=e(73),_=s.__importStar(e(78));class c extends a.AnnotationView{connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_render(){const{gradient:e,y_intercept:l}=this.model;if(null==e||null==l)return;const{frame:o}=this.plot_view,i=this.coordinates.x_scale,t=this.coordinates.y_scale,[n,s,a,_]=(()=>{if(0==e){const e=t.compute(l),i=e;return[o.bbox.left,o.bbox.right,e,i]}{const n=o.bbox.top,s=o.bbox.bottom,a=t.invert(n),_=t.invert(s),c=(a-l)/e,r=(_-l)/e,h=i.compute(c),b=i.compute(r);return h<=b?[h,b,n,s]:[b,h,s,n]}})(),{ctx:c}=this.layer;if(c.save(),this.visuals.above_fill.doit||this.visuals.above_hatch.doit){const{left:e,right:l,top:i,bottom:t}=o.bbox;c.beginPath(),c.moveTo(n,a),c.lineTo(n,a),c.lineTo(s,_),c.lineTo(s,_),a<=_?(s<l&&c.lineTo(l,t),c.lineTo(l,i),c.lineTo(e,i)):(c.lineTo(l,i),c.lineTo(e,i),n>e&&c.lineTo(e,t)),c.closePath(),this.visuals.above_fill.apply(c),this.visuals.above_hatch.apply(c)}if(this.visuals.below_fill.doit||this.visuals.below_hatch.doit){const{left:e,right:l,top:i,bottom:t}=o.bbox;c.beginPath(),c.moveTo(n,a),c.lineTo(n,a),c.lineTo(s,_),a<=_?(c.lineTo(l,t),c.lineTo(e,t),n>e&&c.lineTo(e,i)):(s<l&&c.lineTo(l,i),c.lineTo(l,t),c.lineTo(e,t)),c.closePath(),this.visuals.below_fill.apply(c),this.visuals.below_hatch.apply(c)}c.beginPath(),c.moveTo(n,a),c.lineTo(s,_),this.visuals.line.apply(c),c.restore()}}o.SlopeView=c,c.__name__="SlopeView";class r extends a.Annotation{constructor(e){super(e)}}o.Slope=r,n=r,r.__name__="Slope",n.prototype.default_view=c,n.mixins([_.Line,["above_",_.Fill],["above_",_.Hatch],["below_",_.Fill],["below_",_.Hatch]]),n.define((({Number:e,Nullable:l})=>({gradient:[l(e),null],y_intercept:[l(e),null]}))),n.override({line_color:"black",above_fill_color:null,above_fill_alpha:.4,below_fill_color:null,below_fill_alpha:.4})},
function _(t,e,i,n,s){var o;n();const a=t(1),r=t(73),l=a.__importStar(t(78)),h=t(20),_=t(212),c=t(15),d=t(12);class u{constructor(t,e){this.p0=t,this.p1=e}clone(){return new u(Object.assign({},this.p0),Object.assign({},this.p1))}hit_test(t,e=2.5){return(0,_.dist_to_segment)(t,this.p0,this.p1)<e}translate(t,e){const{p0:i,p1:n}=this,s={x:i.x+t,y:i.y+e},o={x:n.x+t,y:n.y+e};return new u(s,o)}}u.__name__="Line";class p extends r.AnnotationView{constructor(){super(...arguments),this._pan_state=null,this._is_hovered=!1}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.plot_view.request_paint(this)))}_render(){const{location:t,location_units:e}=this.model;if(null==t)return;function i(t,e,i,n,s){switch(e){case"canvas":return s.compute(t);case"screen":return n.compute(t);case"data":return i.compute(t)}}const{frame:n,canvas:s}=this.plot_view,{x_scale:o,y_scale:a}=this.coordinates;let r,l,h,_;"width"==this.model.dimension?(h=i(t,e,a,n.bbox.yview,s.bbox.y_screen),l=n.bbox.left,_=n.bbox.width,r=this.model.line_width):(h=n.bbox.top,l=i(t,e,o,n.bbox.xview,s.bbox.y_screen),_=this.model.line_width,r=n.bbox.height);const c={x:l,y:h},d={x:l+_,y:h+r};this.line=new u(c,d);const{_is_hovered:p,visuals:m}=this,v=p&&m.hover_line.doit?m.hover_line:m.line,{ctx:b}=this.layer;b.save(),b.beginPath(),this.visuals.line.set_value(b),b.moveTo(l,h),"width"==this.model.dimension?b.lineTo(l+_,h):b.lineTo(l,h+r),v.apply(b),b.restore()}interactive_hit(t,e){return!(!this.model.visible||!this.model.editable)&&null!=this._hit_test(t,e)}_hit_test(t,e){const i=Math.max(2.5,this.model.line_width/2);return this.line.hit_test({x:t,y:e},i)?"edge":null}_can_hit(t){return!0}_pan_start(t){if(this.model.visible&&this.model.editable){const{sx:e,sy:i}=t,n=this._hit_test(e,i);if(null!=n&&this._can_hit(n))return this._pan_state={line:this.line.clone(),target:n},this.model.pan.emit(["pan:start",t.modifiers]),!0}return!1}_pan(t){function e(t,e,i,n,s){switch(e){case"canvas":return s.invert(t);case"screen":return n.invert(t);case"data":return i.invert(t)}}(0,d.assert)(null!=this._pan_state);const i=(()=>{const{dx:e,dy:i}=t,{line:n}=this._pan_state;return"width"==this.model.dimension?n.translate(0,i).p0.y:n.translate(e,0).p0.x})(),n=(()=>{const{location_units:t}=this.model,{frame:n,canvas:s}=this.plot_view,{x_scale:o,y_scale:a}=this.coordinates;return"width"==this.model.dimension?e(i,t,a,n.bbox.yview,s.bbox.y_screen):e(i,t,o,n.bbox.xview,s.bbox.y_screen)})();this.model.location=n,this.model.pan.emit(["pan",t.modifiers])}_pan_end(t){this._pan_state=null,this.model.pan.emit(["pan:end",t.modifiers])}get _has_hover(){const{hover_line:t}=this.visuals;return t.doit}_move_start(t){const{_has_hover:e}=this;return e&&(this._is_hovered=!0,this.request_paint()),e}_move(t){}_move_end(t){this._has_hover&&(this._is_hovered=!1,this.request_paint())}cursor(t,e){var i,n;const s=null!==(n=null===(i=this._pan_state)||void 0===i?void 0:i.target)&&void 0!==n?n:this._hit_test(t,e);return null!=s&&this._can_hit(s)?"width"==this.model.dimension?"ns-resize":"ew-resize":null}}i.SpanView=p,p.__name__="SpanView";class m extends r.Annotation{constructor(t){super(t),this.pan=new c.Signal(this,"pan")}}i.Span=m,o=m,m.__name__="Span",o.prototype.default_view=p,o.mixins([l.Line,["hover_",l.Line]]),o.define((({Boolean:t,Number:e,Nullable:i})=>({location:[i(e),null],location_units:[h.CoordinateUnits,"data"],dimension:[h.Dimension,"width"],editable:[t,!1]}))),o.override({line_color:"black",hover_line_color:null,hover_line_alpha:.3})},
function _(e,i,t,o,s){var l;o();const a=e(73),n=e(265),r=e(59),h=e(56),_=e(146),v=e(57);class b extends a.AnnotationView{constructor(){super(...arguments),this.el=(0,h.div)(),this._previous_bbox=new v.BBox}update_layout(){this.layout=new _.SideLayout(this.panel,(()=>this.get_size()),!0)}has_finished(){return super.has_finished()&&this.toolbar_view.has_finished()}*children(){yield*super.children(),yield this.toolbar_view}async lazy_initialize(){await super.lazy_initialize(),this.toolbar_view=await(0,r.build_view)(this.model.toolbar,{parent:this.canvas})}connect_signals(){super.connect_signals(),this.plot_view.mouseenter.connect((()=>{this.toolbar_view.set_visibility(!0)})),this.plot_view.mouseleave.connect((()=>{this.toolbar_view.set_visibility(!1)}))}remove(){this.toolbar_view.remove(),(0,h.remove)(this.el),super.remove()}_render(){(0,h.display)(this.el);const{bbox:e}=this.layout;if(!this._previous_bbox.equals(e)){(0,h.position)(this.el,e),this._previous_bbox=e,(0,h.empty)(this.el),this.el.style.position="absolute";const{style:i}=this.toolbar_view.el;this.toolbar_view.model.horizontal?(i.width="100%",i.height="unset"):(i.width="unset",i.height="100%"),this.toolbar_view.render(),this.plot_view.canvas_view.add_event(this.el),this.el.appendChild(this.toolbar_view.el),this.toolbar_view.after_render()}this.model.visible||(0,h.undisplay)(this.el)}_get_size(){const{tools:e,logo:i}=this.model.toolbar;return{width:30*e.length+(null!=i?25:0)+15,height:30}}}t.ToolbarPanelView=b,b.__name__="ToolbarPanelView";class d extends a.Annotation{constructor(e){super(e)}}t.ToolbarPanel=d,l=d,d.__name__="ToolbarPanel",l.prototype.default_view=b,l.define((({Ref:e})=>({toolbar:[e(n.Toolbar)]})))},
function _(t,e,o,s,i){var l;s();const n=t(1),a=t(19),r=t(56),c=t(59),h=t(266),_=t(20),u=t(10),v=t(34),p=t(9),d=t(8),f=t(273),g=t(274),m=t(275),b=t(280),w=t(282),y=t(283),T=t(285),z=t(276),x=n.__importStar(t(286)),C=x,I=n.__importStar(t(287)),A=I,L=n.__importDefault(t(278));class P extends h.UIElementView{constructor(){super(...arguments),this._tool_button_views=new Map,this._items=[],this._visible=null}get tool_buttons(){return this._tool_buttons.flat()}get overflow_el(){return this._overflow_el}get visible(){var t;return!!this.model.visible&&(!this.model.autohide||null!==(t=this._visible)&&void 0!==t&&t)}*children(){yield*super.children(),yield*this._tool_button_views.values()}has_finished(){if(!super.has_finished())return!1;for(const t of this._tool_button_views.values())if(!t.has_finished())return!1;return!0}initialize(){super.initialize();const{location:t}=this.model,e="left"==t||"above"==t,o=this.model.horizontal?"vertical":"horizontal";this._overflow_menu=new z.ContextMenu([],{target:this.root.el,orientation:o,reversed:e,prevent_hide:t=>t.composedPath().includes(this._overflow_el)})}async lazy_initialize(){await super.lazy_initialize(),await this._build_tool_button_views()}connect_signals(){super.connect_signals();const{buttons:t,tools:e}=this.model.properties;this.on_change([t,e],(async()=>{await this._build_tool_button_views(),this.render()})),this.connect(this.model.properties.autohide.change,(()=>{this._on_visible_change()}))}stylesheets(){return[...super.stylesheets(),x.default,I.default,L.default]}remove(){(0,c.remove_views)(this._tool_button_views),super.remove()}async _build_tool_button_views(){this._tool_buttons=(()=>{const{buttons:t}=this.model;if("auto"==t){return[...(0,p.values)(this.model.gestures).map((t=>t.tools)),this.model.actions,this.model.inspectors.filter((t=>t.toggleable)),this.model.auxiliaries].map((t=>t.map((t=>t.tool_button()))))}return(0,u.split)(t,null)})(),await(0,c.build_views)(this._tool_button_views,this._tool_buttons.flat(),{parent:this})}set_visibility(t){t!=this._visible&&(this._visible=t,this._on_visible_change())}_on_visible_change(){this.el.classList.toggle(C.hidden,!this.visible)}_after_resize(){super._after_resize(),this._after_render()}render(){super.render(),this.el.classList.add(C[this.model.location]),this.el.classList.toggle(C.inner,this.model.inner),this._on_visible_change();const{horizontal:t}=this.model;this._overflow_el=(0,r.div)({class:C.tool_overflow,tabIndex:0},t?"\u22ee":"\u22ef");const e=()=>{const t=(()=>{switch(this.model.location){case"right":return{left_of:this._overflow_el};case"left":return{right_of:this._overflow_el};case"above":return{below:this._overflow_el};case"below":return{above:this._overflow_el}}})();this._overflow_menu.toggle(t)};if(this._overflow_el.addEventListener("click",(()=>{e()})),this._overflow_el.addEventListener("keydown",(t=>{"Enter"==t.key&&e()})),this._items=[],null!=this.model.logo){const t="grey"===this.model.logo?A.grey:null,e=(0,r.a)({href:"https://bokeh.org/",target:"_blank",class:[A.logo,A.logo_small,t]});this._items.push(e),this.shadow_el.appendChild(e)}for(const[,t]of this._tool_button_views)t.render(),t.after_render();const o=this._tool_buttons.map((t=>t.map((t=>this._tool_button_views.get(t).el)))).filter((t=>0!=t.length)),s=()=>(0,r.div)({class:C.divider});for(const t of(0,v.join)(o,s))this._items.push(t),this.shadow_el.appendChild(t)}_after_render(){super._after_render(),(0,u.clear)(this._overflow_menu.items),this.shadow_el.contains(this._overflow_el)&&this.shadow_el.removeChild(this._overflow_el);for(const t of this._items)this.shadow_el.contains(t)||this.shadow_el.append(t);const{horizontal:t}=this.model,{bbox:e}=this,o=t?C.right:C.above;let s=0,i=!1;for(const l of this._items)if(i)this.shadow_el.removeChild(l),this._overflow_menu.items.push({custom:l,class:o});else{const{width:n,height:a}=l.getBoundingClientRect();s+=t?n:a,i=t?s>e.width-15:s>e.height-15,i&&(this.shadow_el.removeChild(l),this.shadow_el.appendChild(this._overflow_el),this._overflow_menu.items.push({custom:l,class:o}))}}}function k(){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}}}o.ToolbarView=P,P.__name__="ToolbarView",o.Drag=f.Tool,o.Inspection=f.Tool,o.Scroll=f.Tool,o.Tap=f.Tool;class S extends h.UIElement{constructor(t){super(t)}get horizontal(){return"above"==this.location||"below"==this.location}get vertical(){return"left"==this.location||"right"==this.location}connect_signals(){super.connect_signals();const{tools:t,active_drag:e,active_inspect:o,active_scroll:s,active_tap:i,active_multi:l}=this.properties;this.on_change([t,e,o,s,i,l],(()=>{this._init_tools(),this._activate_tools()}))}initialize(){super.initialize(),this._init_tools(),this._activate_tools()}_init_tools(){const t=new Set;function e(e,o){const s=(e instanceof g.ToolProxy?e.underlying:e)instanceof o;return s&&t.add(e),s}const o=this.tools.filter((t=>e(t,w.InspectTool)));this.inspectors=o;const s=this.tools.filter((t=>e(t,T.HelpTool)));this.help=s;const i=this.tools.filter((t=>e(t,y.ActionTool)));this.actions=i;const l={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 t of this.tools)e(t,b.GestureTool)&&l[t.event_role].tools.push(t);for(const t of(0,p.typed_keys)(l)){const e=this.gestures[t];e.tools=(0,u.sort_by)(l[t].tools,(t=>t.default_order)),null!=e.active&&(0,u.every)(e.tools,(t=>{var o;return t.id!=(null===(o=e.active)||void 0===o?void 0:o.id)}))&&(e.active=null)}const n=this.tools.filter((e=>!t.has(e)));this.auxiliaries=n}_activate_tools(){if("auto"==this.active_inspect);else if(null==this.active_inspect)for(const t of this.inspectors)t.active=!1;else if((0,d.isArray)(this.active_inspect)){const t=(0,u.intersection)(this.active_inspect,this.inspectors);t.length!=this.active_inspect.length&&(this.active_inspect=t);for(const t of this.inspectors)(0,u.includes)(this.active_inspect,t)||(t.active=!1)}else{let t=!1;for(const e of this.inspectors)e!=this.active_inspect?e.active=!1:t=!0;t||(this.active_inspect=null)}const t=t=>{t.active?this._active_change(t):t.active=!0};for(const t of(0,p.values)(this.gestures))for(const e of t.tools)this.connect(e.properties.active.change,(()=>this._active_change(e)));function e(t){switch(t){case"tap":return"active_tap";case"pan":return"active_drag";case"pinch":case"scroll":return"active_scroll";case"multi":return"active_multi";default:return null}}function o(t){return"tap"==t||"pan"==t}for(const[s,i]of(0,p.entries)(this.gestures)){const l=s,n=e(l);if(null!=n){const e=this[n];if("auto"==e)0!=i.tools.length&&o(l)&&t(i.tools[0]);else if(null!=e)(0,u.includes)(this.tools,e)?t(e):this[n]=null;else{this.gestures[l].active=null;for(const t of this.gestures[l].tools)t.active=!1}}}}_active_change(t){const{event_types:e}=t;for(const o of e)if(t.active){const e=this.gestures[o].active;null!=e&&t!=e&&(a.logger.debug(`Toolbar: deactivating tool: ${e} for event type '${o}'`),e.active=!1),this.gestures[o].active=t,a.logger.debug(`Toolbar: activating tool: ${t} for event type '${o}'`)}else this.gestures[o].active=null}}o.Toolbar=S,l=S,S.__name__="Toolbar",l.prototype.default_view=P,l.define((({Boolean:t,Array:e,Or:s,Ref:i,Nullable:l,Auto:n})=>({tools:[e(s(i(f.Tool),i(g.ToolProxy))),[]],logo:[l(_.Logo),"normal"],autohide:[t,!1],active_drag:[l(s(i(o.Drag),n)),"auto"],active_inspect:[l(s(i(o.Inspection),e(i(o.Inspection)),n)),"auto"],active_scroll:[l(s(i(o.Scroll),n)),"auto"],active_tap:[l(s(i(o.Tap),n)),"auto"],active_multi:[l(s(i(b.GestureTool),n)),"auto"]}))),l.internal((({Array:t,Boolean:e,Ref:o,Or:s,Struct:i,Nullable:l,Null:n,Auto:a})=>{const r=i({tools:t(o(b.GestureTool)),active:l(o(b.GestureTool))}),c=i({pan:r,scroll:r,pinch:r,tap:r,doubletap:r,press:r,pressup:r,rotate:r,move:r,multi:r});return{buttons:[s(t(s(o(m.ToolButton),n)),a),"auto"],location:[_.Location,"right"],inner:[e,!1],gestures:[c,k],actions:[t(s(o(y.ActionTool),o(g.ToolProxy))),[]],inspectors:[t(s(o(w.InspectTool),o(g.ToolProxy))),[]],auxiliaries:[t(s(o(f.Tool),o(g.ToolProxy))),[]],help:[t(s(o(T.HelpTool),o(g.ToolProxy))),[]]}}))},
function _(e,t,s,i,l){var n;i();const r=e(1),o=e(50),_=e(267),h=e(268),a=e(19),p=e(55),d=e(56),y=e(269),c=e(9),u=e(57),b=e(8),f=r.__importDefault(e(272)),{round:g,floor:x}=Math;function*S(e){if(e instanceof _.Styles){const t=new Set((0,c.keys)(o.Model.prototype._props));for(const s of e)t.has(s.attr)||(yield[s.attr,s.get_value()])}else yield*(0,c.entries)(e)}class m extends p.DOMComponentView{constructor(){super(...arguments),this._display=new d.InlineStyleSheet,this.style=new d.InlineStyleSheet,this._bbox=new u.BBox,this._is_displayed=!1}*_css_classes(){yield*super._css_classes(),yield*this.model.css_classes}*_stylesheets(){yield*super._stylesheets(),yield this.style,yield this._display,yield*this._computed_stylesheets()}*_computed_stylesheets(){for(const e of this.model.stylesheets)if((0,b.isString)(e))yield new d.InlineStyleSheet(e);else if(e instanceof h.StyleSheet)yield e.underlying();else{const t=[];for(const[s,i]of(0,c.entries)(e)){t.push(`${s} {`);for(const[e,s]of S(i)){const i=e.replace(/_/g,"-");(0,b.isString)(s)&&0!=s.length&&t.push(` ${i}: ${s};`)}t.push("}")}const s=t.join("\n");yield new d.InlineStyleSheet(s)}}stylesheets(){return[...super.stylesheets(),f.default]}update_style(){this.style.clear()}box_sizing(){return{width_policy:"auto",height_policy:"auto",width:null,height:null,aspect_ratio:null}}get bbox(){return this._bbox}update_bbox(){return this._update_bbox()}_update_bbox(){const e=(()=>{if(this.el.isConnected){if(null!=this.el.offsetParent)return!0;{const{position:e,display:t}=getComputedStyle(this.el);return"fixed"==e&&"none"!=t}}return!1})(),t=e?(()=>{const e=this.el.getBoundingClientRect(),{left:t,top:s}=(()=>{if(null!=this.parent){const t=this.parent.el.getBoundingClientRect();return{left:e.left-t.left,top:e.top-t.top}}return{left:0,top:0}})();return new u.BBox({left:g(t),top:g(s),width:x(e.width),height:x(e.height)})})():new u.BBox,s=!this._bbox.equals(t);return this._bbox=t,this._is_displayed=e,s}initialize(){super.initialize(),this._resize_observer=new ResizeObserver((e=>this.after_resize())),this._resize_observer.observe(this.el,{box:"border-box"})}connect_signals(){super.connect_signals();const{visible:e,styles:t,css_classes:s,stylesheets:i}=this.model.properties;this.on_change(e,(()=>this._update_visible())),this.on_change(t,(()=>this._update_styles())),this.on_change(s,(()=>this._update_css_classes())),this.on_change(i,(()=>this._update_stylesheets()))}remove(){this._resize_observer.disconnect(),super.remove()}_after_resize(){}after_resize(){this.update_bbox()&&this._after_resize(),this.finish()}render_to(e){super.render_to(e),this.after_render()}render(){super.render(),this._apply_styles(),this._apply_visible()}_after_render(){}after_render(){this.update_style(),this.update_bbox(),this._after_render(),this.is_displayed||this.finish()}get is_displayed(){return this._is_displayed}_apply_visible(){this.model.visible?this._display.clear():this._display.replace(":host { display: none !important; }")}_apply_styles(){const{styles:e}=this.model,t=(e,t)=>{const s=e in this.el.style;return s&&(0,b.isString)(t)&&(this.el.style[e]=t),s};for(const[s,i]of S(e)){const e=s.replace(/_/g,"-");t(e,i)||t(`-webkit-${e}`,i)||t(`-moz-${e}`,i)||a.logger.trace(`unknown CSS property '${e}'`)}}_update_visible(){this._apply_visible()}_update_styles(){this.el.removeAttribute("style"),this._apply_styles()}export(e="auto",t=!0){const s="auto"==e||"png"==e?"canvas":"svg",i=new y.CanvasLayer(s,t),{width:l,height:n}=this.bbox;return i.resize(l,n),i}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{bbox:this.bbox})}}s.UIElementView=m,m.__name__="UIElementView";class v extends o.Model{constructor(e){super(e)}}s.UIElement=v,n=v,v.__name__="UIElement",n.define((({Boolean:e,Array:t,Dict:s,String:i,Ref:l,Or:n,Nullable:r})=>{const o=n(s(r(i)),l(_.Styles));return{visible:[e,!0],css_classes:[t(i),[]],styles:[o,{}],stylesheets:[t(n(l(h.StyleSheet),i,s(o))),[]]}}))},
function _(l,n,u,_,e){var t;_();const o=l(50);class r extends o.Model{constructor(l){super(l)}}u.Styles=r,t=r,r.__name__="Styles",t.define((({String:l,Nullable:n})=>({align_content:[n(l),null],align_items:[n(l),null],align_self:[n(l),null],alignment_baseline:[n(l),null],all:[n(l),null],animation:[n(l),null],animation_delay:[n(l),null],animation_direction:[n(l),null],animation_duration:[n(l),null],animation_fill_mode:[n(l),null],animation_iteration_count:[n(l),null],animation_name:[n(l),null],animation_play_state:[n(l),null],animation_timing_function:[n(l),null],aspect_ratio:[n(l),null],backface_visibility:[n(l),null],background:[n(l),null],background_attachment:[n(l),null],background_clip:[n(l),null],background_color:[n(l),null],background_image:[n(l),null],background_origin:[n(l),null],background_position:[n(l),null],background_position_x:[n(l),null],background_position_y:[n(l),null],background_repeat:[n(l),null],background_size:[n(l),null],baseline_shift:[n(l),null],block_size:[n(l),null],border:[n(l),null],border_block_end:[n(l),null],border_block_end_color:[n(l),null],border_block_end_style:[n(l),null],border_block_end_width:[n(l),null],border_block_start:[n(l),null],border_block_start_color:[n(l),null],border_block_start_style:[n(l),null],border_block_start_width:[n(l),null],border_bottom:[n(l),null],border_bottom_color:[n(l),null],border_bottom_left_radius:[n(l),null],border_bottom_right_radius:[n(l),null],border_bottom_style:[n(l),null],border_bottom_width:[n(l),null],border_collapse:[n(l),null],border_color:[n(l),null],border_image:[n(l),null],border_image_outset:[n(l),null],border_image_repeat:[n(l),null],border_image_slice:[n(l),null],border_image_source:[n(l),null],border_image_width:[n(l),null],border_inline_end:[n(l),null],border_inline_end_color:[n(l),null],border_inline_end_style:[n(l),null],border_inline_end_width:[n(l),null],border_inline_start:[n(l),null],border_inline_start_color:[n(l),null],border_inline_start_style:[n(l),null],border_inline_start_width:[n(l),null],border_left:[n(l),null],border_left_color:[n(l),null],border_left_style:[n(l),null],border_left_width:[n(l),null],border_radius:[n(l),null],border_right:[n(l),null],border_right_color:[n(l),null],border_right_style:[n(l),null],border_right_width:[n(l),null],border_spacing:[n(l),null],border_style:[n(l),null],border_top:[n(l),null],border_top_color:[n(l),null],border_top_left_radius:[n(l),null],border_top_right_radius:[n(l),null],border_top_style:[n(l),null],border_top_width:[n(l),null],border_width:[n(l),null],bottom:[n(l),null],box_shadow:[n(l),null],box_sizing:[n(l),null],break_after:[n(l),null],break_before:[n(l),null],break_inside:[n(l),null],caption_side:[n(l),null],caret_color:[n(l),null],clear:[n(l),null],clip:[n(l),null],clip_path:[n(l),null],clip_rule:[n(l),null],color:[n(l),null],color_interpolation:[n(l),null],color_interpolation_filters:[n(l),null],column_count:[n(l),null],column_fill:[n(l),null],column_gap:[n(l),null],column_rule:[n(l),null],column_rule_color:[n(l),null],column_rule_style:[n(l),null],column_rule_width:[n(l),null],column_span:[n(l),null],column_width:[n(l),null],columns:[n(l),null],content:[n(l),null],counter_increment:[n(l),null],counter_reset:[n(l),null],cursor:[n(l),null],direction:[n(l),null],display:[n(l),null],dominant_baseline:[n(l),null],empty_cells:[n(l),null],fill:[n(l),null],fill_opacity:[n(l),null],fill_rule:[n(l),null],filter:[n(l),null],flex:[n(l),null],flex_basis:[n(l),null],flex_direction:[n(l),null],flex_flow:[n(l),null],flex_grow:[n(l),null],flex_shrink:[n(l),null],flex_wrap:[n(l),null],float:[n(l),null],flood_color:[n(l),null],flood_opacity:[n(l),null],font:[n(l),null],font_family:[n(l),null],font_feature_settings:[n(l),null],font_kerning:[n(l),null],font_size:[n(l),null],font_size_adjust:[n(l),null],font_stretch:[n(l),null],font_style:[n(l),null],font_synthesis:[n(l),null],font_variant:[n(l),null],font_variant_caps:[n(l),null],font_variant_east_asian:[n(l),null],font_variant_ligatures:[n(l),null],font_variant_numeric:[n(l),null],font_variant_position:[n(l),null],font_weight:[n(l),null],gap:[n(l),null],glyph_orientation_vertical:[n(l),null],grid:[n(l),null],grid_area:[n(l),null],grid_auto_columns:[n(l),null],grid_auto_flow:[n(l),null],grid_auto_rows:[n(l),null],grid_column:[n(l),null],grid_column_end:[n(l),null],grid_column_gap:[n(l),null],grid_column_start:[n(l),null],grid_gap:[n(l),null],grid_row:[n(l),null],grid_row_end:[n(l),null],grid_row_gap:[n(l),null],grid_row_start:[n(l),null],grid_template:[n(l),null],grid_template_areas:[n(l),null],grid_template_columns:[n(l),null],grid_template_rows:[n(l),null],height:[n(l),null],hyphens:[n(l),null],image_orientation:[n(l),null],image_rendering:[n(l),null],inline_size:[n(l),null],justify_content:[n(l),null],justify_items:[n(l),null],justify_self:[n(l),null],left:[n(l),null],letter_spacing:[n(l),null],lighting_color:[n(l),null],line_break:[n(l),null],line_height:[n(l),null],list_style:[n(l),null],list_style_image:[n(l),null],list_style_position:[n(l),null],list_style_type:[n(l),null],margin:[n(l),null],margin_block_end:[n(l),null],margin_block_start:[n(l),null],margin_bottom:[n(l),null],margin_inline_end:[n(l),null],margin_inline_start:[n(l),null],margin_left:[n(l),null],margin_right:[n(l),null],margin_top:[n(l),null],marker:[n(l),null],marker_end:[n(l),null],marker_mid:[n(l),null],marker_start:[n(l),null],mask:[n(l),null],mask_composite:[n(l),null],mask_image:[n(l),null],mask_position:[n(l),null],mask_repeat:[n(l),null],mask_size:[n(l),null],mask_type:[n(l),null],max_block_size:[n(l),null],max_height:[n(l),null],max_inline_size:[n(l),null],max_width:[n(l),null],min_block_size:[n(l),null],min_height:[n(l),null],min_inline_size:[n(l),null],min_width:[n(l),null],object_fit:[n(l),null],object_position:[n(l),null],opacity:[n(l),null],order:[n(l),null],orphans:[n(l),null],outline:[n(l),null],outline_color:[n(l),null],outline_offset:[n(l),null],outline_style:[n(l),null],outline_width:[n(l),null],overflow:[n(l),null],overflow_anchor:[n(l),null],overflow_wrap:[n(l),null],overflow_x:[n(l),null],overflow_y:[n(l),null],overscroll_behavior:[n(l),null],overscroll_behavior_block:[n(l),null],overscroll_behavior_inline:[n(l),null],overscroll_behavior_x:[n(l),null],overscroll_behavior_y:[n(l),null],padding:[n(l),null],padding_block_end:[n(l),null],padding_block_start:[n(l),null],padding_bottom:[n(l),null],padding_inline_end:[n(l),null],padding_inline_start:[n(l),null],padding_left:[n(l),null],padding_right:[n(l),null],padding_top:[n(l),null],page_break_after:[n(l),null],page_break_before:[n(l),null],page_break_inside:[n(l),null],paint_order:[n(l),null],perspective:[n(l),null],perspective_origin:[n(l),null],place_content:[n(l),null],place_items:[n(l),null],place_self:[n(l),null],pointer_events:[n(l),null],position:[n(l),null],quotes:[n(l),null],resize:[n(l),null],right:[n(l),null],rotate:[n(l),null],row_gap:[n(l),null],ruby_align:[n(l),null],ruby_position:[n(l),null],scale:[n(l),null],scroll_behavior:[n(l),null],shape_rendering:[n(l),null],stop_color:[n(l),null],stop_opacity:[n(l),null],stroke:[n(l),null],stroke_dasharray:[n(l),null],stroke_dashoffset:[n(l),null],stroke_linecap:[n(l),null],stroke_linejoin:[n(l),null],stroke_miterlimit:[n(l),null],stroke_opacity:[n(l),null],stroke_width:[n(l),null],tab_size:[n(l),null],table_layout:[n(l),null],text_align:[n(l),null],text_align_last:[n(l),null],text_anchor:[n(l),null],text_combine_upright:[n(l),null],text_decoration:[n(l),null],text_decoration_color:[n(l),null],text_decoration_line:[n(l),null],text_decoration_style:[n(l),null],text_emphasis:[n(l),null],text_emphasis_color:[n(l),null],text_emphasis_position:[n(l),null],text_emphasis_style:[n(l),null],text_indent:[n(l),null],text_justify:[n(l),null],text_orientation:[n(l),null],text_overflow:[n(l),null],text_rendering:[n(l),null],text_shadow:[n(l),null],text_transform:[n(l),null],text_underline_position:[n(l),null],top:[n(l),null],touch_action:[n(l),null],transform:[n(l),null],transform_box:[n(l),null],transform_origin:[n(l),null],transform_style:[n(l),null],transition:[n(l),null],transition_delay:[n(l),null],transition_duration:[n(l),null],transition_property:[n(l),null],transition_timing_function:[n(l),null],translate:[n(l),null],unicode_bidi:[n(l),null],user_select:[n(l),null],vertical_align:[n(l),null],visibility:[n(l),null],white_space:[n(l),null],widows:[n(l),null],width:[n(l),null],will_change:[n(l),null],word_break:[n(l),null],word_spacing:[n(l),null],word_wrap:[n(l),null],writing_mode:[n(l),null],z_index:[n(l),null]})))},
function _(e,n,t,l,r){var s,i;l();const u=e(1),S=e(50),_=u.__importStar(e(56));class h extends S.Model{constructor(e){super(e)}}t.StyleSheet=h,h.__name__="StyleSheet";class y extends h{constructor(e){super(e)}underlying(){return new _.InlineStyleSheet(this.css)}}t.InlineStyleSheet=y,s=y,y.__name__="InlineStyleSheet",s.define((({String:e})=>({css:[e]})));class d extends h{constructor(e){super(e)}underlying(){return new _.ImportedStyleSheet(this.url)}}t.ImportedStyleSheet=d,i=d,d.__name__="ImportedStyleSheet",i.define((({String:e})=>({url:[e]})));class o extends y{constructor(e){super(e),this._underlying=null}underlying(){return null==this._underlying&&(this._underlying=new _.GlobalInlineStyleSheet(this.css)),this._underlying}}t.GlobalInlineStyleSheet=o,o.__name__="GlobalInlineStyleSheet";class c extends d{constructor(e){super(e),this._underlying=null}underlying(){return null==this._underlying&&(this._underlying=new _.GlobalInlineStyleSheet(this.url)),this._underlying}}t.GlobalImportedStyleSheet=c,c.__name__="GlobalImportedStyleSheet"},
function _(t,e,s,i,a){i();const n=t(270),r=t(57),h=t(56);class o{get canvas(){return this._canvas}get ctx(){return this._ctx}get el(){return this._el}constructor(t,e){switch(this.pixel_ratio=1,this.bbox=new r.BBox,this.backend=t,this.hidpi=e,t){case"webgl":case"canvas":{this._el=this._canvas=(0,h.canvas)({class:"bk-layer"});const t=this.canvas.getContext("2d");if(null==t)throw new Error("unable to obtain 2D rendering context");this._ctx=t,e&&(this.pixel_ratio=devicePixelRatio);break}case"svg":{const t=new n.SVGRenderingContext2D;this._ctx=t,this._canvas=t.get_svg(),this._el=(0,h.div)({class:"bk-layer"});this._el.attachShadow({mode:"open"}).appendChild(this._canvas);break}}this._ctx.layer=this}resize(t,e){if(this.bbox.width==t&&this.bbox.height==e)return;this.bbox=new r.BBox({left:0,top:0,width:t,height:e});const{target:s}=this;s.width=t*this.pixel_ratio,s.height=e*this.pixel_ratio}get target(){return this._ctx instanceof n.SVGRenderingContext2D?this._ctx:this.canvas}undo_transform(t){const{ctx:e}=this,s=e.getTransform();e.resetTransform();try{t(e)}finally{e.setTransform(s)}}prepare(){const{ctx:t,hidpi:e,pixel_ratio:s}=this;t.save(),e&&(t.scale(s,s),t.translate(.5,.5)),this.clear()}clear(){const{x:t,y:e,width:s,height:i}=this.bbox;this.ctx.clearRect(t,e,s,i)}finish(){this.ctx.restore()}to_blob(){const{_canvas:t}=this;if(t instanceof HTMLCanvasElement)return new Promise(((e,s)=>{t.toBlob((t=>null!=t?e(t):s()),"image/png")}));{const t=this._ctx.get_serialized_svg(!0),e=new Blob([t],{type:"image/svg+xml"});return Promise.resolve(e)}}}s.CanvasLayer=o,o.__name__="CanvasLayer"},
function _(t,e,i,s,n){s();const r=t(155),a=t(8),o=t(271),l=t(11),h=t(56);function _(t){const e={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t in e?e[t]:e.start}function c(t){const e={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t in e?e[t]:e.alphabetic}const p=function(t,e){const i=new Map,s=t.split(",");e=null!=e?e:10;for(let t=0;t<s.length;t+=2){const n=`&${s[t+1]};`,r=parseInt(s[t],e);i.set(n,`&#${r};`)}return i.set("\\xa0"," "),i}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),u={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},fontKerning:{canvas:"auto"},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"}};function d(t){if(function(t){return"undefined"!=typeof VideoFrame&&t instanceof VideoFrame}(t))return[t.codedWidth,t.codedHeight];{function e(t){return(0,a.isNumber)(t)?t:t.baseVal.value}const{width:i,height:s}=t;return[e(i),e(s)]}}class m{constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){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",`${t}`),-1!==e.indexOf("rgba")){const t=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e),[,s,n,r,a]=t;i.setAttribute("stop-color",`rgb(${s},${n},${r})`),i.setAttribute("stop-opacity",a)}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}m.__name__="CanvasGradient";class f{constructor(t,e){this.__root=t,this.__ctx=e}setTransform(t){throw new Error("not implemented")}}f.__name__="CanvasPattern";class g{get canvas(){return this}get width(){return this._width}set width(t){this._width=t,this.__root.setAttribute("width",`${t}`)}get height(){return this._height}set height(t){this._height=t,this.__root.setAttribute("height",`${t}`)}constructor(t){var e,i,s;this.__currentDefaultPath="",this.__currentPosition=null,this.globalAlpha=1,this._transform=new r.AffineTransform,this._clip_path=null,this.__document=null!==(e=null==t?void 0:t.document)&&void 0!==e?e:document,null!=(null==t?void 0:t.ctx)?this.__ctx=t.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.reset(),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.__currentElement=this.__root,this.width=null!==(i=null==t?void 0:t.width)&&void 0!==i?i:500,this.height=null!==(s=null==t?void 0:t.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)}_random_string(){let t;do{t=g.__random.choices(12,"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz").join("")}while(this.__ids.has(t));return t}__createElement(t,e={},i=!1){const s=this.__document.createElementNS("http://www.w3.org/2000/svg",t);i&&(s.setAttribute("fill","none"),s.setAttribute("stroke","none"));const n=Object.keys(e);for(const t of n)s.setAttribute(t,`${e[t]}`);return s}__setDefaultStyles(){const t=Object.keys(u),e=this;for(let i=0;i<t.length;i++){const s=t[i];e[s]=u[s].canvas}}__applyStyleState(t){const e=Object.keys(t),i=this;for(let s=0;s<e.length;s++){const n=e[s];i[n]=t[n]}}__getStyleState(){const t=Object.keys(u),e={};for(let i=0;i<t.length;i++){const s=t[i];e[s]=this[s]}return e}__applyStyleToCurrentElement(t){const e=this.__currentElement,i=Object.keys(u);for(let s=0;s<i.length;s++){const n=u[i[s]],r=this[i[s]];if(null!=n.apply&&n.apply.includes(t))if(r instanceof f){for(const t of[...r.__ctx.__defs.childNodes])if(t instanceof Element){const e=t.getAttribute("id");this.__ids.add(e),this.__defs.appendChild(t)}const t=r.__root.getAttribute("id");e.setAttribute(n.apply,`url(#${t})`)}else if(r instanceof m){const t=r.__root.getAttribute("id");e.setAttribute(n.apply,`url(#${t})`)}else if(n.svg!==r)if("stroke"!==n.svgAttr&&"fill"!==n.svgAttr||!(0,a.isString)(r)||-1===r.indexOf("rgba")){let a=n.svgAttr;if("globalAlpha"===i[s]&&(a=`${t}-${n.svgAttr}`,null!=e.getAttribute(a)))continue;e.setAttribute(a,`${r}`)}else{const t=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(r),[,i,s,a,o]=t;e.setAttribute(n.svgAttr,`rgb(${i},${s},${a})`);const l=parseFloat(o)*this.globalAlpha;e.setAttribute(`${n.svgAttr}-opacity`,`${l}`)}}}get_serialized_svg(t=!1){let e=(new XMLSerializer).serializeToString(this.__root);if(t)for(const[t,i]of p){const s=new RegExp(t,"gi");s.test(e)&&(e=e.replace(s,i))}return e}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:t,clip_path:e,attributes:i}=this.__stack.pop();this._transform=t,this._clip_path=e,this.__applyStyleState(i)}reset(){this.__setDefaultStyles(),this.__stack=[]}_apply_transform(t,e=this._transform){e.is_identity||t.setAttribute("transform",e.toString())}scale(t,e){isFinite(t)&&(null==e||isFinite(e))&&this._transform.scale(t,null!=e?e:t)}rotate(t){isFinite(t)&&this._transform.rotate(t)}translate(t,e){isFinite(t+e)&&this._transform.translate(t,e)}transform(t,e,i,s,n,r){isFinite(t+e+i+s+n+r)&&this._transform.transform(t,e,i,s,n,r)}beginPath(){this.__currentDefaultPath="",this.__currentPosition=null,this.__init_element()}__init_element(){const t=this.__createElement("path",{},!0);this.__root.appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;"path"===t.nodeName?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t,e,i){const s=""==this.__currentDefaultPath?"":" ";this.__currentDefaultPath+=s+i,this.__currentPosition={x:t,y:e}}get _hasCurrentDefaultPath(){return""!=this.__currentDefaultPath}moveTo(t,e){if(!isFinite(t+e))return;"path"!==this.__currentElement.nodeName&&this.beginPath();const[i,s]=this._transform.apply(t,e);this.__addPathCommand(i,s,`M ${i} ${s}`)}closePath(){this._hasCurrentDefaultPath&&this.__addPathCommand(NaN,NaN,"Z")}lineTo(t,e){if(isFinite(t+e))if(this._hasCurrentDefaultPath){const[i,s]=this._transform.apply(t,e);this.__addPathCommand(i,s,`L ${i} ${s}`)}else this.moveTo(t,e)}bezierCurveTo(t,e,i,s,n,r){if(!isFinite(t+e+i+s+n+r))return;const[a,o]=this._transform.apply(n,r),[l,h]=this._transform.apply(t,e),[_,c]=this._transform.apply(i,s);this.__addPathCommand(a,o,`C ${l} ${h} ${_} ${c} ${a} ${o}`)}quadraticCurveTo(t,e,i,s){if(!isFinite(t+e+i+s))return;const[n,r]=this._transform.apply(i,s),[a,o]=this._transform.apply(t,e);this.__addPathCommand(n,r,`Q ${a} ${o} ${n} ${r}`)}arcTo(t,e,i,s,n){if(!isFinite(t+e+i+s+n))return;if(null==this.__currentPosition)return;const r=this.__currentPosition.x,a=this.__currentPosition.y;if(n<0)throw new Error(`IndexSizeError: The radius provided (${n}) is negative.`);if(r===t&&a===e||t===i&&e===s||0===n)return void this.lineTo(t,e);function o([t,e]){const i=Math.sqrt(t**2+e**2);return[t/i,e/i]}const l=o([r-t,a-e]),h=o([i-t,s-e]);if(l[0]*h[1]==l[1]*h[0])return void this.lineTo(t,e);const _=l[0]*h[0]+l[1]*h[1],c=Math.acos(Math.abs(_)),p=o([l[0]+h[0],l[1]+h[1]]),u=n/Math.sin(c/2),d=t+u*p[0],m=e+u*p[1],f=[-l[1],l[0]],g=[h[1],-h[0]];function b(t){const e=t[0];return t[1]>=0?Math.acos(e):-Math.acos(e)}const v=b(f),A=b(g);this.lineTo(d+f[0]*n,m+f[1]*n),this.arc(d,m,n,v,A)}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(t,e){let i=null;if(t instanceof Path2D)i=t;else{if(null!=e)throw new Error("invalid arguments");e=t}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!=e&&this.__currentElement.setAttribute("fill-rule",e),null!=this._clip_path&&this.__currentElement.setAttribute("clip-path",this._clip_path)}rect(t,e,i,s){isFinite(t+e+i+s)&&(this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.lineTo(t,e),this.closePath())}fillRect(t,e,i,s){isFinite(t+e+i+s)&&(this.beginPath(),this.rect(t,e,i,s),this.fill())}strokeRect(t,e,i,s){isFinite(t+e+i+s)&&(this.beginPath(),this.rect(t,e,i,s),this.stroke())}__clearCanvas(){(0,h.empty)(this.__defs),(0,h.empty)(this.__root),this.__root.appendChild(this.__defs),this.__currentElement=this.__root}clearRect(t,e,i,s){if(!isFinite(t+e+i+s))return;if(0===t&&0===e&&i===this.width&&s===this.height)return void this.__clearCanvas();const n=this.__createElement("rect",{x:t,y:e,width:i,height:s,fill:"#FFFFFF"},!0);this._apply_transform(n),this.__root.appendChild(n)}roundRect(t,e,i,s,n){throw new Error("not implemented")}createLinearGradient(t,e,i,s){if(!isFinite(t+e+i+s))throw new Error("The provided double value is non-finite");const[n,r]=this._transform.apply(t,e),[a,o]=this._transform.apply(i,s),l=this.__createElement("linearGradient",{id:this._random_string(),x1:`${n}px`,x2:`${a}px`,y1:`${r}px`,y2:`${o}px`,gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(l),new m(l,this)}createRadialGradient(t,e,i,s,n,r){if(!isFinite(t+e+i+s+n+r))throw new Error("The provided double value is non-finite");const[a,o]=this._transform.apply(t,e),[l,h]=this._transform.apply(s,n),_=this.__createElement("radialGradient",{id:this._random_string(),cx:`${l}px`,cy:`${h}px`,r:`${r}px`,r0:`${i}px`,fx:`${a}px`,fy:`${o}px`,gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(_),new m(_,this)}createConicGradient(t,e,i){throw Error("not implemented")}__parseFont(){const[,t,e,i,s,,n]=/^\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!=t?t:"normal",size:null!=s?s:"10px",family:null!=n?n:"sans-serif",weight:null!=i?i:"normal",decoration:null!=e?e:"normal"}}__applyText(t,e,i,s){const n=this.__parseFont(),r=this.__createElement("text",{"font-family":n.family,"font-size":n.size,"font-style":n.style,"font-weight":n.weight,"text-decoration":n.decoration,x:e,y:i,"text-anchor":_(this.textAlign),"dominant-baseline":c(this.textBaseline)},!0);r.appendChild(this.__document.createTextNode(t)),this._apply_transform(r),this.__currentElement=r,this.__applyStyleToCurrentElement(s);const a=(()=>{if(null!=this._clip_path){const t=this.__createElement("g");return t.setAttribute("clip-path",this._clip_path),t.appendChild(r),t}return r})();this.__root.appendChild(a)}fillText(t,e,i){isFinite(e+i)&&this.__applyText(t,e,i,"fill")}strokeText(t,e,i){isFinite(e+i)&&this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,s,n,r=!1){this.ellipse(t,e,i,i,0,s,n,r)}ellipse(t,e,i,s,n,a,o,h=!1){if(!isFinite(t+e+i+s+n+a+o))return;if(i<0||s<0)throw new DOMException("IndexSizeError, radius can't be negative");const _=h?o-a:a-o;a%=2*Math.PI,o%=2*Math.PI;const c=(new r.AffineTransform).translate(t,e).rotate(n),p=i*Math.cos(a),u=s*Math.sin(a),[d,m]=c.apply(p,u);this.lineTo(d,m);const f=180*n/Math.PI,g=h?0:1;if(Math.abs(a-o)<2*l.float32_epsilon&&!(Math.abs(_)<2*l.float32_epsilon&&_<0)){const[t,e]=this._transform.apply(d,m),n=i*Math.cos(a+Math.PI),r=s*Math.sin(a+Math.PI),[o,l]=c.apply(n,r),[h,_]=this._transform.apply(o,l);this.__addPathCommand(t,e,`A ${i} ${s} ${f} 0 ${g} ${h} ${_} A ${i} ${s} ${f} 0 ${g} ${t} ${e}`)}else{const t=i*Math.cos(o),e=s*Math.sin(o),[n,r]=c.apply(t,e);let l=o-a;l<0&&(l+=2*Math.PI);const _=h!==l>Math.PI?1:0,[p,u]=this._transform.apply(n,r);this.__addPathCommand(p,u,`A ${i} ${s} ${f} ${_} ${g} ${p} ${u}`)}}clip(){const t=this.__createElement("clipPath"),e=this._random_string();this.__applyCurrentDefaultPath(),t.setAttribute("id",e),t.appendChild(this.__currentElement),this.__defs.appendChild(t),this._clip_path=`url(#${e})`}drawImage(t,...e){let i,s,n,r,a,o,l,h;if(2==e.length){if([i,s]=e,!isFinite(i+s))return;a=0,o=0;const[_,c]=d(t);n=l=_,r=h=c}else if(4==e.length){if([i,s,n,r]=e,!isFinite(i+s+n+r))return;a=0,o=0;const[_,c]=d(t);l=_,h=c}else{if(8!==e.length)throw new Error(`Inavlid number of arguments passed to drawImage: ${arguments.length}`);if([a,o,l,h,i,s,n,r]=e,!isFinite(a+o+l+h+i+s+n+r))return}const _=this.__root,c=this._transform.clone().translate(i,s);if(t instanceof g||t instanceof SVGSVGElement){const e=(t instanceof SVGSVGElement?t:t.get_svg()).cloneNode(!0);let i;c.is_identity&&1==this.globalAlpha&&null==this._clip_path?i=_:(i=this.__createElement("g"),c.is_identity||this._apply_transform(i,c),1!=this.globalAlpha&&i.setAttribute("opacity",`${this.globalAlpha}`),null!=this._clip_path&&i.setAttribute("clip-path",this._clip_path),_.appendChild(i));for(const t of[...e.childNodes])if(t instanceof SVGDefsElement){for(const e of[...t.childNodes])if(e instanceof Element){const t=e.getAttribute("id");this.__ids.add(t),this.__defs.appendChild(e.cloneNode(!0))}}else i.appendChild(t.cloneNode(!0))}else if(t instanceof HTMLImageElement||t instanceof SVGImageElement){const e=this.__createElement("image");if(e.setAttribute("width",`${n}`),e.setAttribute("height",`${r}`),e.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&e.setAttribute("opacity",`${this.globalAlpha}`),0!=a||0!=o||l!==t.width||h!==t.height){const e=this.__document.createElement("canvas");e.width=n,e.height=r;e.getContext("2d").drawImage(t,a,o,l,h,0,0,n,r),t=e}this._apply_transform(e,c);const i=t instanceof HTMLCanvasElement?t.toDataURL():t.getAttribute("src");if(e.setAttribute("href",i),null!=this._clip_path){const t=this.__createElement("g");t.setAttribute("clip-path",this._clip_path),t.appendChild(e),_.appendChild(t)}else _.appendChild(e)}else if(t instanceof HTMLCanvasElement){const e=this.__createElement("image");e.setAttribute("width",`${n}`),e.setAttribute("height",`${r}`),e.setAttribute("preserveAspectRatio","none"),1!=this.globalAlpha&&e.setAttribute("opacity",`${this.globalAlpha}`);const i=this.__document.createElement("canvas");i.width=n,i.height=r;const s=i.getContext("2d");if(s.imageSmoothingEnabled=!1,s.drawImage(t,a,o,l,h,0,0,n,r),t=i,this._apply_transform(e,c),e.setAttribute("href",t.toDataURL()),null!=this._clip_path){const t=this.__createElement("g");t.setAttribute("clip-path",this._clip_path),t.appendChild(e),_.appendChild(t)}else _.appendChild(e)}}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),s=this._random_string(),[n,r]=d(t);if(i.setAttribute("id",s),i.setAttribute("width",`${n}`),i.setAttribute("height",`${r}`),i.setAttribute("patternUnits","userSpaceOnUse"),t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof SVGImageElement){const e=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s=t instanceof HTMLCanvasElement?t.toDataURL():t.getAttribute("src");e.setAttribute("href",s),i.appendChild(e),this.__defs.appendChild(i)}else if(t instanceof g){for(const e of[...t.__root.childNodes])e instanceof SVGDefsElement||i.appendChild(e.cloneNode(!0));this.__defs.appendChild(i)}else{if(!(t instanceof SVGSVGElement))throw new Error("unsupported");for(const e of[...t.childNodes])e instanceof SVGDefsElement||i.appendChild(e.cloneNode(!0));this.__defs.appendChild(i)}return new f(i,this)}getLineDash(){const{lineDash:t}=this;return(0,a.isString)(t)?t.split(",").map((t=>parseInt(t))):null==t?[]:t}setLineDash(t){t.length>0?this.lineDash=t.join(","):this.lineDash=null}getTransform(){return this._transform.to_DOMMatrix()}setTransform(...t){let e;e=(0,a.isNumber)(t[0])?new DOMMatrix(t):t[0]instanceof DOMMatrix?t[0]:new DOMMatrix(Object.values(null==t[0])),this._transform=r.AffineTransform.from_DOMMatrix(e)}resetTransform(){this._transform=new r.AffineTransform}isPointInPath(...t){throw new Error("not implemented")}isPointInStroke(...t){throw new Error("not implemented")}createImageData(...t){throw new Error("not implemented")}getImageData(t,e,i,s){throw new Error("not implemented")}putImageData(...t){throw new Error("not implemented")}drawFocusIfNeeded(...t){throw new Error("not implemented")}scrollPathIntoView(...t){throw new Error("not implemented")}}i.SVGRenderingContext2D=g,g.__name__="SVGRenderingContext2D",g.__random=o.random},
function _(t,e,n,s,r){s();const{PI:o,log:a,sin:_,cos:i,sqrt:m,floor:l}=Math;n.MAX_INT32=2147483647;class d{float(){return(this.integer()-1)/(n.MAX_INT32-1)}floats(t,e=0,n=1){const s=new Array(t);for(let r=0;r<t;r++)s[r]=e+this.float()*(n-e);return s}choices(t,e){const n=e.length,s=new Array(t);for(let r=0;r<t;r++)s[r]=e[this.integer()%n];return s}uniform(t,e){return t+(this.float()-.5)*e}uniforms(t,e,n){return Float64Array.from({length:n},(()=>this.uniform(t,e)))}normal(t,e){return this.normals(t,e,1)[0]}normals(t,e,n){const[s,r]=[t,e],l=new Float64Array(n);for(let t=0;t<n;t+=2){const e=this.float(),d=this.float(),h=m(-2*a(e));l[t]=s+r*(h*i(2*o*d)),t+1<n&&(l[t+1]=s+r*(h*_(2*o*d)))}return l}}n.AbstractRandom=d,d.__name__="AbstractRandom";class h extends d{integer(){return l(Math.random()*n.MAX_INT32)}}n.SystemRandom=h,h.__name__="SystemRandom";class c extends d{constructor(t){super(),this._seed=t%n.MAX_INT32,this._seed<=0&&(this._seed+=n.MAX_INT32-1)}integer(){return this._seed=48271*this._seed%n.MAX_INT32,this._seed}}n.LCGRandom=c,c.__name__="LCGRandom";class f extends c{}n.Random=f,f.__name__="Random",n.random=new f(Date.now())},
function _(t,i,o,e,n){e(),o.default=":host{position:relative;}"},
function _(t,e,n,o,i){var s;o();const a=t(54),r=t(20),l=t(10),c=t(8),_=t(50);class u extends a.View{connect_signals(){super.connect_signals(),this.connect(this.model.properties.active.change,(()=>{this.model.active?this.activate():this.deactivate()}))}get overlays(){return[]}activate(){}deactivate(){}}n.ToolView=u,u.__name__="ToolView";class d extends _.Model{constructor(t){super(t)}get event_role(){const{event_type:t}=this;return(0,c.isString)(t)?t:"multi"}get event_types(){const{event_type:t}=this;return null==t?[]:(0,c.isString)(t)?[t]:t}get tooltip(){var t;return null!==(t=this.description)&&void 0!==t?t:this.tool_name}get computed_icon(){const{icon:t,tool_icon:e}=this;return null!=t?t:null!=e?`.${e}`:void 0}get menu(){return null}_get_dim_limits([t,e],[n,o],i,s){const a=i.bbox.h_range;let r;"width"==s||"both"==s?(r=[(0,l.min)([t,n]),(0,l.max)([t,n])],r=[(0,l.max)([r[0],a.start]),(0,l.min)([r[1],a.end])]):r=[a.start,a.end];const c=i.bbox.v_range;let _;return"height"==s||"both"==s?(_=[(0,l.min)([e,o]),(0,l.max)([e,o])],_=[(0,l.max)([_[0],c.start]),(0,l.min)([_[1],c.end])]):_=[c.start,c.end],[r,_]}_get_dim_tooltip(t){const{description:e,tool_name:n}=this;return null!=e?e:"both"==t?n:"auto"==t?`${n} (either x, y or both dimensions)`:`${n} (${"width"==t?"x":"y"}-axis)`}static register_alias(t,e){this.prototype._known_aliases.set(t,e)}static from_string(t){const e=this.prototype._known_aliases.get(t);if(null!=e)return e();{const e=[...this.prototype._known_aliases.keys()];throw new Error(`unexpected tool name '${t}', possible tools are ${e.join(", ")}`)}}}n.Tool=d,s=d,d.__name__="Tool",s.prototype._known_aliases=new Map,s.define((({String:t,Regex:e,Nullable:n,Or:o})=>({icon:[n(o(r.ToolIcon,e(/^--/),e(/^\./),e(/^data:image/))),null],description:[n(t),null]}))),s.internal((({Boolean:t})=>({active:[t,!1],disabled:[t,!1]})))},
function _(t,o,e,s,n){var i;s();const l=t(15),r=t(50),c=t(273),a=t(34);class u extends r.Model{constructor(t){super(t)}get underlying(){return this.tools[0]}tool_button(){const t=this.tools[0].tool_button();return t.tool=this,t}get event_type(){return this.tools[0].event_type}get event_role(){return this.tools[0].event_role}get event_types(){return this.tools[0].event_types}get default_order(){return this.tools[0].default_order}get tooltip(){return this.tools[0].tooltip}get tool_name(){return this.tools[0].tool_name}get computed_icon(){return this.tools[0].computed_icon}get toggleable(){const t=this.tools[0];return"toggleable"in t&&t.toggleable}initialize(){super.initialize(),this.do=new l.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 t of this.tools)this.connect(t.properties.active.change,(()=>{this.active=t.active}))}doit(){for(const t of this.tools)t.do.emit()}set_active(){for(const t of this.tools)t.active=this.active}get menu(){const{menu:t}=this.tools[0];if(null==t)return null;const o=[];for(const[e,s]of(0,a.enumerate)(t))if(null==e)o.push(null);else{const t=()=>{var t,o,e;for(const n of this.tools)null===(e=null===(o=null===(t=n.menu)||void 0===t?void 0:t[s])||void 0===o?void 0:o.handler)||void 0===e||e.call(o)};o.push(Object.assign(Object.assign({},e),{handler:t}))}return o}}e.ToolProxy=u,i=u,u.__name__="ToolProxy",i.define((({Boolean:t,Array:o,Ref:e})=>({tools:[o(e(c.Tool)),[]],active:[t,t=>(0,a.some)(t.tools,(t=>t.active))],disabled:[t,!1]})))},
function _(e,t,s,o,l){var i;o();const n=e(1),a=e(266),r=e(273),d=e(274),c=e(56),h=e(20),u=e(276),m=e(10),_=n.__importStar(e(279)),p=_,v=n.__importDefault(e(278));class f extends a.UIElementView{initialize(){var e;super.initialize();const{location:t}=this.parent.model,s="left"==t||"above"==t,o=this.parent.model.horizontal?"vertical":"horizontal",l=null!==(e=this.model.tool.menu)&&void 0!==e?e:[];this._menu=new u.ContextMenu(s?(0,m.reversed)(l):l,{target:this.root.el,orientation:o,prevent_hide:e=>e.composedPath().includes(this.el)});let i=null,n=null;this.el.addEventListener("pointerdown",(e=>{e.buttons==c.MouseButton.Left&&(i=e.timeStamp,n=setTimeout((()=>{i=null,n=null,this._pressed()}),250))})),this.el.addEventListener("pointerup",(e=>{if(null!=n&&(clearTimeout(n),n=null),null!=i){if(e.timeStamp-i>=250)this._pressed();else{if(this._menu.is_open)return void this._menu.hide();e.composedPath().includes(this.el)&&this._clicked()}i=null}})),this.el.addEventListener("keydown",(e=>{switch(e.key){case"Enter":this._clicked();break;case" ":this._pressed()}}))}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.render())),this.connect(this.model.tool.change,(()=>this.render()))}remove(){this._menu.remove(),super.remove()}stylesheets(){return[...super.stylesheets(),_.default,v.default]}render(){var e,t;super.render(),this.class_list.add(p[this.parent.model.location]),this.model.tool.disabled&&this.class_list.add(p.disabled);const s=(0,c.div)({class:p.tool_icon});this.shadow_el.appendChild(s);const o=null!==(e=this.model.icon)&&void 0!==e?e:this.model.tool.computed_icon;if(null!=o)if(o.startsWith("data:image")){const e=`url("${encodeURI(o)}")`;s.style.backgroundImage=e}else if(o.startsWith("--"))s.style.backgroundImage=`var(${o})`;else if(o.startsWith(".")){const e=o.substring(1);s.classList.add(e)}else if(h.ToolIcon.valid(o)){const e=`bk-tool-icon-${o.replace(/_/g,"-")}`;s.classList.add(e)}if(null!=this.model.tool.menu){const e=(0,c.div)({class:p.tool_chevron});this.shadow_el.appendChild(e)}const l=null!==(t=this.model.tooltip)&&void 0!==t?t:this.model.tool.tooltip;this.el.title=l,this.el.tabIndex=0}_pressed(){const e=(()=>{switch(this.parent.model.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}}})();this._menu.toggle(e)}}s.ToolButtonView=f,f.__name__="ToolButtonView";class g extends a.UIElement{constructor(e){super(e)}}s.ToolButton=g,i=g,g.__name__="ToolButton",i.define((({String:e,Regex:t,Ref:s,Nullable:o,Or:l})=>({tool:[l(s(r.Tool),s(d.ToolProxy))],icon:[o(l(h.ToolIcon,t(/^--/),t(/^\./),t(/^data:image/))),null],tooltip:[o(e),null]})))},
function _(t,e,i,n,o){n();const s=t(1),l=t(56),h=t(10),r=t(8),d=t(34),a=s.__importStar(t(277)),u=a,_=s.__importDefault(t(278)),c=s.__importDefault(t(58));class m{get is_open(){return this._open}get can_open(){return 0!=this.items.length}constructor(t,e){var i,n,o;this.el=(0,l.div)(),this._open=!1,this._item_click=(t,e)=>{var i,n;null===(i=this.entry_handler)||void 0===i||i.call(this,t,e),null===(n=t.handler)||void 0===n||n.call(t),this.hide()},this._on_mousedown=t=>{var e,i;t.composedPath().includes(this.el)||null!==(i=null===(e=this.prevent_hide)||void 0===e?void 0:e.call(this,t))&&void 0!==i&&i||this.hide()},this._on_keydown=t=>{"Escape"==t.key&&this.hide()},this._on_blur=()=>{this.hide()},this.items=t,this.target=e.target,this.orientation=null!==(i=e.orientation)&&void 0!==i?i:"vertical",this.reversed=null!==(n=e.reversed)&&void 0!==n&&n,this.prevent_hide=e.prevent_hide,this.extra_styles=null!==(o=e.extra_styles)&&void 0!==o?o:[],this.entry_handler=e.entry_handler,this.shadow_el=this.el.attachShadow({mode:"open"}),this.class_list=new l.ClassList(this.el.classList)}remove(){this._unlisten(),(0,l.remove)(this.el)}_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(t){var e;const i=(()=>{if("left_of"in t){const{left:e,top:i}=t.left_of.getBoundingClientRect();return{right:e,top:i}}if("right_of"in t){const{top:e,right:i}=t.right_of.getBoundingClientRect();return{left:i,top:e}}if("below"in t){const{left:e,bottom:i}=t.below.getBoundingClientRect();return{left:e,top:i}}if("above"in t){const{left:e,top:i}=t.above.getBoundingClientRect();return{left:e,bottom:i}}return t})(),n=null!==(e=this.el.offsetParent)&&void 0!==e?e:document.body,o=(()=>{const t=n.getBoundingClientRect(),e=getComputedStyle(n);return{left:t.left-parseFloat(e.marginLeft),right:t.right+parseFloat(e.marginRight),top:t.top-parseFloat(e.marginTop),bottom:t.bottom+parseFloat(e.marginBottom)}})(),{style:s}=this.el;s.left=null!=i.left?i.left-o.left+"px":"auto",s.top=null!=i.top?i.top-o.top+"px":"auto",s.right=null!=i.right?o.right-i.right+"px":"auto",s.bottom=null!=i.bottom?o.bottom-i.bottom+"px":"auto"}stylesheets(){return[c.default,a.default,_.default,...this.extra_styles]}empty(){(0,l.empty)(this.shadow_el),this.class_list.clear()}render(){var t,e;this.empty();for(const t of this.stylesheets()){((0,r.isString)(t)?new l.InlineStyleSheet(t):t).install(this.shadow_el)}this.class_list.add(u[this.orientation]);const i=this.reversed?(0,h.reversed)(this.items):this.items;for(const[n,o]of(0,d.enumerate)(i)){let i;if(null==n)i=(0,l.div)({class:u.divider});else{if(null!=n.if&&!n.if())continue;if(null!=n.custom)i=n.custom;else{const s=null!=n.icon?(0,l.div)({class:[u.menu_icon,n.icon]}):null,h=[null!==(e=null===(t=n.active)||void 0===t?void 0:t.call(n))&&void 0!==e&&e?u.active:null,n.class];i=(0,l.div)({class:h,title:n.tooltip,tabIndex:0},s,n.label,n.content),i.addEventListener("click",(()=>{this._item_click(n,o)})),i.addEventListener("keydown",(t=>{"Enter"==t.key&&this._item_click(n,o)}))}}this.shadow_el.appendChild(i)}}show(t){var e;if(0!=this.items.length&&!this._open){if(this.render(),0==this.shadow_el.children.length)return;(null!==(e=this.target.shadowRoot)&&void 0!==e?e:this.target).appendChild(this.el),this._position(null!=t?t:{left:0,top:0}),this._listen(),this._open=!0}}hide(){this._open&&(this._open=!1,this._unlisten(),(0,l.remove)(this.el))}toggle(t){this._open?this.hide():this.show(t)}}i.ContextMenu=m,m.__name__="ContextMenu"},
function _(r,o,i,e,t){e(),i.menu_icon="bk-menu-icon",i.horizontal="bk-horizontal",i.vertical="bk-vertical",i.divider="bk-divider",i.active="bk-active",i.default=".bk-menu-icon{width:28px;height:28px;mask-size:60% 60%;mask-position:center center;mask-repeat:no-repeat;-webkit-mask-size:60% 60%;-webkit-mask-position:center center;-webkit-mask-repeat:no-repeat;background-size:60%;background-color:transparent;background-repeat:no-repeat;background-position:center center;}:host{position:absolute;display:inline-flex;flex-wrap:nowrap;user-select:none;-webkit-user-select:none;width:auto;height:auto;z-index:100;cursor:pointer;font-size:var(--font-size);background-color:#fff;border:1px solid #ccc;border-radius:var(--border-radius);box-shadow:2px 4px 8px rgba(0, 0, 0, 0.175);}:host(.bk-horizontal){flex-direction:row;}:host(.bk-vertical){flex-direction:column;}.bk-divider{cursor:default;overflow:hidden;background-color:#e5e5e5;}:host(.bk-horizontal) > .bk-divider{width:1px;margin:5px 0;}:host(.bk-vertical) > .bk-divider{height:1px;margin:0 5px;}:host > :not(.bk-divider){border:1px solid transparent;--active-tool-highlight:#26aae1;}:host > :not(.bk-divider).bk-active{border-color:var(--active-tool-highlight);}:host > :not(.bk-divider):hover{background-color:#f9f9f9;}:host > :not(.bk-divider):focus,:host > :not(.bk-divider):focus-visible{outline:1px dotted var(--active-tool-highlight);outline-offset:-1px;}:host > :not(.bk-divider)::-moz-focus-inner{border:0;}:host(.bk-horizontal) > :not(.bk-divider):first-child{border-top-left-radius:var(--border-radius);border-bottom-left-radius:var(--border-radius);}:host(.bk-horizontal) > :not(.bk-divider):last-child{border-top-right-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);}:host(.bk-vertical) > :not(.bk-divider):first-child{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);}:host(.bk-vertical) > :not(.bk-divider):last-child{border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);}"},
function _(o,A,e,t,n){t(),e.tool_icon_copy="bk-tool-icon-copy",e.tool_icon_replace_mode="bk-tool-icon-replace-mode",e.tool_icon_append_mode="bk-tool-icon-append-mode",e.tool_icon_intersect_mode="bk-tool-icon-intersect-mode",e.tool_icon_subtract_mode="bk-tool-icon-subtract-mode",e.tool_icon_clear_selection="bk-tool-icon-clear-selection",e.tool_icon_box_select="bk-tool-icon-box-select",e.tool_icon_x_box_select="bk-tool-icon-x-box-select",e.tool_icon_y_box_select="bk-tool-icon-y-box-select",e.tool_icon_box_zoom="bk-tool-icon-box-zoom",e.tool_icon_x_box_zoom="bk-tool-icon-x-box-zoom",e.tool_icon_y_box_zoom="bk-tool-icon-y-box-zoom",e.tool_icon_auto_box_zoom="bk-tool-icon-auto-box-zoom",e.tool_icon_zoom_in="bk-tool-icon-zoom-in",e.tool_icon_zoom_out="bk-tool-icon-zoom-out",e.tool_icon_help="bk-tool-icon-help",e.tool_icon_hover="bk-tool-icon-hover",e.tool_icon_crosshair="bk-tool-icon-crosshair",e.tool_icon_lasso_select="bk-tool-icon-lasso-select",e.tool_icon_pan="bk-tool-icon-pan",e.tool_icon_x_pan="bk-tool-icon-x-pan",e.tool_icon_y_pan="bk-tool-icon-y-pan",e.tool_icon_range="bk-tool-icon-range",e.tool_icon_polygon_select="bk-tool-icon-polygon-select",e.tool_icon_redo="bk-tool-icon-redo",e.tool_icon_reset="bk-tool-icon-reset",e.tool_icon_save="bk-tool-icon-save",e.tool_icon_tap_select="bk-tool-icon-tap-select",e.tool_icon_undo="bk-tool-icon-undo",e.tool_icon_wheel_pan="bk-tool-icon-wheel-pan",e.tool_icon_wheel_zoom="bk-tool-icon-wheel-zoom",e.tool_icon_box_edit="bk-tool-icon-box-edit",e.tool_icon_freehand_draw="bk-tool-icon-freehand-draw",e.tool_icon_poly_draw="bk-tool-icon-poly-draw",e.tool_icon_point_draw="bk-tool-icon-point-draw",e.tool_icon_poly_edit="bk-tool-icon-poly-edit",e.tool_icon_line_edit="bk-tool-icon-line-edit",e.tool_icon_settings="bk-tool-icon-settings",e.tool_icon_unknown="bk-tool-icon-unknown",e.tool_icon_fullscreen="bk-tool-icon-fullscreen",e.tool_icon_chevron_up="bk-tool-icon-chevron-up",e.tool_icon_chevron_down="bk-tool-icon-chevron-down",e.tool_icon_chevron_left="bk-tool-icon-chevron-left",e.tool_icon_chevron_right="bk-tool-icon-chevron-right",e.tool_icon_caret_up="bk-tool-icon-caret-up",e.tool_icon_caret_down="bk-tool-icon-caret-down",e.tool_icon_caret_left="bk-tool-icon-caret-left",e.tool_icon_caret_right="bk-tool-icon-caret-right",e.tool_icon_see_on="bk-tool-icon-see-on",e.tool_icon_see_off="bk-tool-icon-see-off",e.default=':host{--bokeh-icon-color:#a1a6a9;--bokeh-icon-color-disabled:#d4d9db;}.bk-tool-icon-copy{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-copy);-webkit-mask-image:var(--bokeh-icon-copy);}.bk-tool-icon-replace-mode{background-image:var(--bokeh-icon-replace-mode, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxokK3gniQAAAHpJREFUWMNjXLhsJcNAAiaGAQajDhhwB7DgEP+PxmeksvjgDwFcLmYkUh2hkBj8IcBIZXsYh1w2/I8v3sgAOM0bLYhGc8GgrwuICgldfQO88pcvXvg/aOuCUQeM5oLRuoCFCJcTbOMh5XOiW0JDNhdQS3y0IBp1ABwAAF8KGrhC1Eg6AAAAAElFTkSuQmCC"));}.bk-tool-icon-append-mode{background-image:var(--bokeh-icon-append-mode, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkZWD04WwAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAoUlEQVRYw+1WQQ6AIAwrhO8Y/bIXEz9jIMSDr8ETCUEPQzA4pMeFLKNbu4l5WR0CDOMEALBGIzMuQIBEZQjPgP9JLjwTfBjY9sO9lZsFA9IafZng3BlIyVefgd8XQFZBAWe8jfNxwsDhir6rzoCiPiy1K+J8/FRQemv2XfAdFcQ9znU4Viqg9ta1qYJ+D1BnAIBrkgGVOrXNqUA9rbyZm/AEzFh4jEeY/soAAAAASUVORK5CYII="));}.bk-tool-icon-intersect-mode{background-image:var(--bokeh-icon-intersect-mode, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxkrkOpp2wAAAPhJREFUWMPtV1EKwjAMTUavI3oawR/vtn5srJdREfzwMvHHQlcT2mpdMzFfWxiP5r2+JMN+mAiCOB72CABgR1cln4oOGocJnuMTSxWk8jMm7OggYkYXA9gPE3uyd8NXHONJ+eYMdE/NqCJmEZ5ZqlJJ4sUksKN7cYSaPoCZFWR1QI+Xm1fBACU63Cw22x0AAJxudwrffVwvZ+JmQdAHZkw0d4EpAMCw8k87pMdbnwtizQumJYv3nwV6XOA1qbUT/oQLUJgFRbsiNwFVucBIlyR3p0tdMp+XmFjfLKi1LatyAXtCRjPWBdL3Ke3VuACJKFfDr/xFN2fgAR/Go0qaLlmEAAAAAElFTkSuQmCC"));}.bk-tool-icon-subtract-mode{background-image:var(--bokeh-icon-subtract-mode, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AUFFxgsF5XNOQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABFUlEQVRYw9VWUQqDMAxNpWfxQxD1MoP97G7zQ5mH2RTZYLtM9lWoMbXtxLXNX4OG9r28l4hrd0PQoqxqAACYpxH25C/nkwCHyCBwSPoS09k1T5Fo+4EiExcC4v584xGFmyIXHBLRISAVZyZufUPVa4rcrwmPDgr93ylo+2GliLRUYHK6th/o/6r7nfLpqaCsagEA8Hh9FmcNKeRmgeYDC+SCq0B6FFi8/BcV6BdR9cL3gCv3ijPKOacsn3rBEcjmaVxpfGcg4wHxzgJJnc6241Hn23DERFRAu1bNcWa3Q0uXi62XR6sCaWoSejbtdLYmU3kTEunNgj0bUbQqYG/IcMaqwPS9jftoVCAQ0ZVDJwf0zQdH4AsyW6fpQu4YegAAAABJRU5ErkJggg=="));}.bk-tool-icon-clear-selection{background-image:var(--bokeh-icon-clear-selection, 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-tool-icon-box-select{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-box-select);-webkit-mask-image:var(--bokeh-icon-box-select);}.bk-tool-icon-x-box-select{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-x-box-select);-webkit-mask-image:var(--bokeh-icon-x-box-select);}.bk-tool-icon-y-box-select{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-y-box-select);-webkit-mask-image:var(--bokeh-icon-y-box-select);}.bk-tool-icon-box-zoom{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-box-zoom);-webkit-mask-image:var(--bokeh-icon-box-zoom);}.bk-tool-icon-x-box-zoom{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-x-box-zoom);-webkit-mask-image:var(--bokeh-icon-x-box-zoom);}.bk-tool-icon-y-box-zoom{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-y-box-zoom);-webkit-mask-image:var(--bokeh-icon-y-box-zoom);}.bk-tool-icon-auto-box-zoom{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-auto-box-zoom);-webkit-mask-image:var(--bokeh-icon-auto-box-zoom);}.bk-tool-icon-zoom-in{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-zoom-in);-webkit-mask-image:var(--bokeh-icon-zoom-in);}.bk-tool-icon-zoom-out{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-zoom-out);-webkit-mask-image:var(--bokeh-icon-zoom-out);}.bk-tool-icon-help{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-help);-webkit-mask-image:var(--bokeh-icon-help);}.bk-tool-icon-hover{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-hover);-webkit-mask-image:var(--bokeh-icon-hover);}.bk-tool-icon-crosshair{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-crosshair);-webkit-mask-image:var(--bokeh-icon-crosshair);}.bk-tool-icon-lasso-select{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-lasso-select);-webkit-mask-image:var(--bokeh-icon-lasso-select);}.bk-tool-icon-pan{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-pan);-webkit-mask-image:var(--bokeh-icon-pan);}.bk-tool-icon-x-pan{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-x-pan);-webkit-mask-image:var(--bokeh-icon-x-pan);}.bk-tool-icon-y-pan{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-y-pan);-webkit-mask-image:var(--bokeh-icon-y-pan);}.bk-tool-icon-range{background-image:var(--bokeh-icon-range, 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-tool-icon-polygon-select{background-image:var(--bokeh-icon-polygon-select, 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-tool-icon-redo{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-redo);-webkit-mask-image:var(--bokeh-icon-redo);}.bk-tool-icon-reset{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-reset);-webkit-mask-image:var(--bokeh-icon-reset);}.bk-tool-icon-save{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-save);-webkit-mask-image:var(--bokeh-icon-save);}.bk-tool-icon-tap-select{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-tap-select);-webkit-mask-image:var(--bokeh-icon-tap-select);}.bk-tool-icon-undo{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-undo);-webkit-mask-image:var(--bokeh-icon-undo);}.bk-tool-icon-wheel-pan{background-image:var(--bokeh-icon-wheel-pan, 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-tool-icon-wheel-zoom{background-image:var(--bokeh-icon-wheel-zoom, 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-tool-icon-box-edit{background-image:var(--bokeh-icon-box-edit, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gEMEg4QfHjM1QAAAGRJREFUWMNjXLhsJcNAAiaGAQYsDAwM/+lsJ+OgCwGsLqMB+D8o08CoA0YdMOqAUQewDFQdMBoFIyoN/B/U7YFRB7DQIc7xyo9GwbBMA4xDqhxgISH1klXbDYk0QOseEeOgDgEAIS0JQleje6IAAAAASUVORK5CYII="));}.bk-tool-icon-freehand-draw{background-image:var(--bokeh-icon-freehand-draw, 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-tool-icon-poly-draw{background-image:var(--bokeh-icon-poly-draw, 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-tool-icon-point-draw{background-image:var(--bokeh-icon-point-draw, 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-tool-icon-poly-edit{background-image:var(--bokeh-icon-poly-edit, 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-tool-icon-line-edit{background-image:var(--bokeh-icon-line-edit, 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=="));}.bk-tool-icon-settings{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-settings);-webkit-mask-image:var(--bokeh-icon-settings);}.bk-tool-icon-unknown{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-unknown);-webkit-mask-image:var(--bokeh-icon-unknown);}.bk-tool-icon-fullscreen{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-fullscreen);-webkit-mask-image:var(--bokeh-icon-fullscreen);}.bk-tool-icon-chevron-up{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-up);-webkit-mask-image:var(--bokeh-icon-chevron-up);}.bk-tool-icon-chevron-down{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-down);-webkit-mask-image:var(--bokeh-icon-chevron-down);}.bk-tool-icon-chevron-left{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-left);-webkit-mask-image:var(--bokeh-icon-chevron-left);}.bk-tool-icon-chevron-right{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-right);-webkit-mask-image:var(--bokeh-icon-chevron-right);}.bk-tool-icon-caret-up{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-caret-up);-webkit-mask-image:var(--bokeh-icon-caret-up);}.bk-tool-icon-caret-down{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-caret-down);-webkit-mask-image:var(--bokeh-icon-caret-down);}.bk-tool-icon-caret-left{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-caret-left);-webkit-mask-image:var(--bokeh-icon-caret-left);}.bk-tool-icon-caret-right{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-caret-right);-webkit-mask-image:var(--bokeh-icon-caret-right);}.bk-tool-icon-see-on{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-see-on);-webkit-mask-image:var(--bokeh-icon-see-on);}.bk-tool-icon-see-off{background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-see-off);-webkit-mask-image:var(--bokeh-icon-see-off);}:host{--bokeh-icon-question-mark:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M8%208a3.5%203%200%200%201%203.5%20-3h1a3.5%203%200%200%201%203.5%203a3%203%200%200%201%20-2%203a3%204%200%200%200%20-2%204%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2212%22%20y1%3D%2219%22%20x2%3D%2212%22%20y2%3D%2219.01%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-help:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2212%22%20y1%3D%2217%22%20x2%3D%2212%22%20y2%3D%2217.01%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2013.5a1.5%201.5%200%200%201%201%20-1.5a2.6%202.6%200%201%200%20-3%20-4%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-x:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%206l-12%2012%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%206l12%2012%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-settings:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M10.325%204.317c.426%20-1.756%202.924%20-1.756%203.35%200a1.724%201.724%200%200%200%202.573%201.066c1.543%20-.94%203.31%20.826%202.37%202.37a1.724%201.724%200%200%200%201.065%202.572c1.756%20.426%201.756%202.924%200%203.35a1.724%201.724%200%200%200%20-1.066%202.573c.94%201.543%20-.826%203.31%20-2.37%202.37a1.724%201.724%200%200%200%20-2.572%201.065c-.426%201.756%20-2.924%201.756%20-3.35%200a1.724%201.724%200%200%200%20-2.573%20-1.066c-1.543%20.94%20-3.31%20-.826%20-2.37%20-2.37a1.724%201.724%200%200%200%20-1.065%20-2.572c-1.756%20-.426%20-1.756%20-2.924%200%20-3.35a1.724%201.724%200%200%200%201.066%20-2.573c-.94%20-1.543%20.826%20-3.31%202.37%20-2.37c1%20.608%202.296%20.07%202.572%20-1.065z%22%3E%3C%2Fpath%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%3E%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-unknown:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M14%203v4a1%201%200%200%200%201%201h4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M17%2021h-10a2%202%200%200%201%20-2%20-2v-14a2%202%200%200%201%202%20-2h7l5%205v11a2%202%200%200%201%20-2%202z%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2017v.01%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2014a1.5%201.5%200%201%200%20-1.14%20-2.474%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-fullscreen:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Crect%20x%3D%223%22%20y%3D%2216%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M4%2012v-6a2%202%200%200%201%202%20-2h12a2%202%200%200%201%202%202v12a2%202%200%200%201%20-2%202h-6%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%208h4v4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M16%208l-5%205%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-save:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M4%2017v2a2%202%200%200%200%202%202h12a2%202%200%200%200%202%20-2v-2%22%20%2F%3E%0A%20%20%3Cpolyline%20points%3D%227%2011%2012%2016%2017%2011%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2212%22%20y1%3D%224%22%20x2%3D%2212%22%20y2%3D%2216%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-copy:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Crect%20x%3D%228%22%20y%3D%228%22%20width%3D%2212%22%20height%3D%2212%22%20rx%3D%222%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M16%208v-2a2%202%200%200%200%20-2%20-2h-8a2%202%200%200%200%20-2%202v8a2%202%200%200%200%202%202h2%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-tap-select:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cline%20x1%3D%223%22%20y1%3D%2212%22%20x2%3D%226%22%20y2%3D%2212%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2212%22%20y1%3D%223%22%20x2%3D%2212%22%20y2%3D%226%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%227.8%22%20y1%3D%227.8%22%20x2%3D%225.6%22%20y2%3D%225.6%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2216.2%22%20y1%3D%227.8%22%20x2%3D%2218.4%22%20y2%3D%225.6%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%227.8%22%20y1%3D%2216.2%22%20x2%3D%225.6%22%20y2%3D%2218.4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2012l9%203l-4%202l-2%204l-3%20-9%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-lasso-select:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M4.028%2013.252c-.657%20-.972%20-1.028%20-2.078%20-1.028%20-3.252c0%20-3.866%204.03%20-7%209%20-7s9%203.134%209%207s-4.03%207%20-9%207c-1.913%200%20-3.686%20-.464%20-5.144%20-1.255%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%225%22%20cy%3D%2215%22%20r%3D%222%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M5%2017c0%201.42%20.316%202.805%201%204%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-pan:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%209l3%203l-3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%209l-3%203l3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M9%2018l3%203l3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%206l-3%20-3l-3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2012h9%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2012h9%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2012v9%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%203v9%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-x-pan:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%209l3%203l-3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%209l-3%203l3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2012h9%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2012h9%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-y-pan:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M9%2018l3%203l3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%206l-3%20-3l-3%203%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2012v9%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%203v9%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-box-select:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M4%206v-1a1%201%200%200%201%201%20-1h1m5%200h2m5%200h1a1%201%200%200%201%201%201v1m0%205v2m0%205v1a1%201%200%200%201%20-1%201h-1m-5%200h-2m-5%200h-1a1%201%200%200%201%20-1%20-1v-1m0%20-5v-2%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-x-box-select:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M17%2013l-4%204%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M13%2013l4%204%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M4%206v-1a1%201%200%200%201%201%20-1h1m5%200h2m5%200h1a1%201%200%200%201%201%201v1m0%205v2m0%205v1a1%201%200%200%201%20-1%201h-1m-5%200h-2m-5%200h-1a1%201%200%200%201%20-1%20-1v-1m0%20-5v-2%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-y-box-select:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M13%2013l2%202l2%20-2%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%2015v2.5%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M4%206v-1a1%201%200%200%201%201%20-1h1m5%200h2m5%200h1a1%201%200%200%201%201%201v1m0%205v2m0%205v1a1%201%200%200%201%20-1%201h-1m-5%200h-2m-5%200h-1a1%201%200%200%201%20-1%20-1v-1m0%20-5v-2%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-box-zoom:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2215%22%20cy%3D%2215%22%20r%3D%225%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M22%2022l-3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%2018h-1a2%202%200%200%201%20-2%20-2v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2011v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%206v-1a2%202%200%200%201%202%20-2h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M10%203h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%203h1a2%202%200%200%201%202%202v1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-x-box-zoom:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M17%2013l-4%204%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M13%2013l4%204%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2215%22%20cy%3D%2215%22%20r%3D%225%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M22%2022l-3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%2018h-1a2%202%200%200%201%20-2%20-2v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2011v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%206v-1a2%202%200%200%201%202%20-2h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M10%203h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%203h1a2%202%200%200%201%202%202v1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-y-box-zoom:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M13%2013l2%202l2%20-2%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%2015v2.5%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2215%22%20cy%3D%2215%22%20r%3D%225%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M22%2022l-3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%2018h-1a2%202%200%200%201%20-2%20-2v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2011v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%206v-1a2%202%200%200%201%202%20-2h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M10%203h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%203h1a2%202%200%200%201%202%202v1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-auto-box-zoom:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2215%22%20cy%3D%2215%22%20r%3D%225%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M22%2022l-3%20-3%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M6%2018h-1a2%202%200%200%201%20-2%20-2v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%2011v-1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M3%206v-1a2%202%200%200%201%202%20-2h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M10%203h1%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M15%203h1a2%202%200%200%201%202%202v1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-zoom-in:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%227%22%20y1%3D%2210%22%20x2%3D%2213%22%20y2%3D%2210%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2210%22%20y1%3D%227%22%20x2%3D%2210%22%20y2%3D%2213%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2221%22%20y1%3D%2221%22%20x2%3D%2215%22%20y2%3D%2215%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-zoom-out:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%227%22%20y1%3D%2210%22%20x2%3D%2213%22%20y2%3D%2210%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2221%22%20y1%3D%2221%22%20x2%3D%2215%22%20y2%3D%2215%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-undo:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M9%2013l-4%20-4l4%20-4m-4%204h11a4%204%200%200%201%200%208h-1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-redo:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M15%2013l4%20-4l-4%20-4m4%204h-11a4%204%200%200%200%200%208h1%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-reset:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M20%2011a8.1%208.1%200%200%200%20-15.5%20-2m-.5%20-4v4h4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M4%2013a8.1%208.1%200%200%200%2015.5%202m.5%204v-4h-4%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-hover:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M12%2020l-3%20-3h-2a3%203%200%200%201%20-3%20-3v-6a3%203%200%200%201%203%20-3h10a3%203%200%200%201%203%203v6a3%203%200%200%201%20-3%203h-2l-3%203%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%228%22%20y1%3D%229%22%20x2%3D%2216%22%20y2%3D%229%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%228%22%20y1%3D%2213%22%20x2%3D%2214%22%20y2%3D%2213%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-crosshair:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M20%2012h-4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M4%2012h4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%2020v-4%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M12%204v4%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-chevron-up:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpolyline%20points%3D%226%2015%2012%209%2018%2015%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-chevron-down:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-chevron-left:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpolyline%20points%3D%2215%206%209%2012%2015%2018%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-chevron-right:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpolyline%20points%3D%229%206%2015%2012%209%2018%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-caret-up:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%2015l-6%20-6l-6%206h12%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-caret-down:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%2015l-6%20-6l-6%206h12%22%20transform%3D%22rotate(180%2012%2012)%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-caret-left:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%2015l-6%20-6l-6%206h12%22%20transform%3D%22rotate(270%2012%2012)%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-caret-right:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22currentColor%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cpath%20d%3D%22M18%2015l-6%20-6l-6%206h12%22%20transform%3D%22rotate(90%2012%2012)%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-see-on:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%222%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M22%2012c-2.667%204.667%20-6%207%20-10%207s-7.333%20-2.333%20-10%20-7c2.667%20-4.667%206%20-7%2010%20-7s7.333%202.333%2010%207%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");--bokeh-icon-see-off:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%222%22%20stroke%3D%22currentColor%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%0A%20%20%3Cline%20x1%3D%223%22%20y1%3D%223%22%20x2%3D%2221%22%20y2%3D%2221%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M10.584%2010.587a2%202%200%200%200%202.828%202.83%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22M9.363%205.365a9.466%209.466%200%200%201%202.637%20-.365c4%200%207.333%202.333%2010%207c-.778%201.361%20-1.612%202.524%20-2.503%203.488m-2.14%201.861c-1.631%201.1%20-3.415%201.651%20-5.357%201.651c-4%200%20-7.333%20-2.333%20-10%20-7c1.369%20-2.395%202.913%20-4.175%204.632%20-5.341%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");}'},
function _(o,t,e,r,i){r(),e.tool_icon="bk-tool-icon",e.disabled="bk-disabled",e.tool_chevron="bk-tool-chevron",e.above="bk-above",e.below="bk-below",e.left="bk-left",e.right="bk-right",e.active="bk-active",e.default=":host{--button-width:30px;--button-height:30px;--button-color:lightgray;--button-border:2px;--active-tool-highlight:#26aae1;--active-tool-border:var(--button-border) solid transparent;}:host{position:relative;width:var(--button-width);height:var(--button-height);cursor:pointer;user-select:none;-webkit-user-select:none;}.bk-tool-icon{position:relative;top:calc(var(--button-border)/2);width:calc(var(--button-width) - var(--button-border));height:calc(var(--button-height) - var(--button-border));mask-size:60% 60%;mask-position:center center;mask-repeat:no-repeat;-webkit-mask-size:60% 60%;-webkit-mask-position:center center;-webkit-mask-repeat:no-repeat;background-size:60% 60%;background-origin:border-box;background-position:center center;background-repeat:no-repeat;}:host(.bk-disabled) .bk-tool-icon{background-color:var(--bokeh-icon-color-disabled);cursor:not-allowed;}.bk-tool-chevron{position:absolute;visibility:hidden;width:8px;height:8px;mask-size:100% 100%;mask-position:center center;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;-webkit-mask-position:center center;-webkit-mask-repeat:no-repeat;}:host(:hover) .bk-tool-chevron{visibility:visible;}:host(.bk-above) .bk-tool-chevron{right:0;bottom:0;background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-down);-webkit-mask-image:var(--bokeh-icon-chevron-down);}:host(.bk-below) .bk-tool-chevron{right:0;top:0;background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-up);-webkit-mask-image:var(--bokeh-icon-chevron-up);}:host(.bk-left) .bk-tool-chevron{right:0;bottom:0;background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-right);-webkit-mask-image:var(--bokeh-icon-chevron-right);}:host(.bk-right) .bk-tool-chevron{left:0;bottom:0;background-color:var(--bokeh-icon-color);mask-image:var(--bokeh-icon-chevron-left);-webkit-mask-image:var(--bokeh-icon-chevron-left);}:host(:hover){background-color:rgba(192, 192, 192, 0.15);}:host(:focus),:host(:focus-visible){outline:1px dotted var(--active-tool-highlight);outline-offset:-1px;}:host::-moz-focus-inner{border:0;}:host(.bk-above){border-bottom:var(--active-tool-border);}:host(.bk-above.bk-active){border-bottom-color:var(--active-tool-highlight);}:host(.bk-below){border-top:var(--active-tool-border);}:host(.bk-below.bk-active){border-top-color:var(--active-tool-highlight);}:host(.bk-right){border-left:var(--active-tool-border);}:host(.bk-right.bk-active){border-left-color:var(--active-tool-highlight);}:host(.bk-left){border-right:var(--active-tool-border);}:host(.bk-left.bk-active){border-right-color:var(--active-tool-highlight);}"},
function _(e,o,t,n,s){n();const r=e(273),l=e(281);class u extends r.ToolView{get plot_view(){return this.parent}}t.GestureToolView=u,u.__name__="GestureToolView";class _ extends r.Tool{constructor(e){super(e)}tool_button(){return new l.OnOffButton({tool:this})}}t.GestureTool=_,_.__name__="GestureTool"},
function _(t,e,o,n,s){var i;n();const c=t(1),_=t(275),l=c.__importStar(t(279));class a extends _.ToolButtonView{_toggle_active(){this.class_list.toggle(l.active,this.model.tool.active)}connect_signals(){super.connect_signals();const{active:t}=this.model.tool.properties;this.on_change(t,(()=>{this._toggle_active()}))}render(){super.render(),this._toggle_active()}_clicked(){const{active:t}=this.model.tool;this.model.tool.active=!t}}o.OnOffButtonView=a,a.__name__="OnOffButtonView";class r extends _.ToolButton{constructor(t){super(t)}}o.OnOffButton=r,i=r,r.__name__="OnOffButton",i.prototype.default_view=a},
function _(e,o,t,n,s){var l;n();const _=e(273),c=e(281);class i extends _.ToolView{get plot_view(){return this.parent}}t.InspectToolView=i,i.__name__="InspectToolView";class r extends _.Tool{constructor(e){super(e),this.event_type="move"}tool_button(){return new c.OnOffButton({tool:this})}}t.InspectTool=r,l=r,r.__name__="InspectTool",l.define((({Boolean:e})=>({toggleable:[e,!0]}))),l.override({active:!0})},
function _(o,t,n,s,i){s();const e=o(273),c=o(284),l=o(15);class _ extends e.ToolView{connect_signals(){super.connect_signals(),this.connect(this.model.do,(o=>this.doit(o)))}}n.ActionToolView=_,_.__name__="ActionToolView";class a extends e.Tool{constructor(o){super(o),this.do=new l.Signal(this,"do")}tool_button(){return new c.ClickButton({tool:this})}}n.ActionTool=a,a.__name__="ActionTool"},
function _(t,o,e,n,i){var c;n();const l=t(275);class _ extends l.ToolButtonView{_clicked(){this.model.tool.do.emit(void 0)}}e.ClickButtonView=_,_.__name__="ClickButtonView";class s extends l.ToolButton{constructor(t){super(t)}}e.ClickButton=s,c=s,s.__name__="ClickButton",c.prototype.default_view=_},
function _(o,e,t,i,l){var n;i();const s=o(283),r=o(278);class c extends s.ActionToolView{doit(){window.open(this.model.redirect)}}t.HelpToolView=c,c.__name__="HelpToolView";class _ extends s.ActionTool{constructor(o){super(o),this.tool_name="Help",this.tool_icon=r.tool_icon_help}}t.HelpTool=_,n=_,_.__name__="HelpTool",n.prototype.default_view=c,n.define((({String:o})=>({redirect:[o,"https://docs.bokeh.org/en/latest/docs/user_guide/interaction/tools.html"]}))),n.override({description:"Click the question mark to learn more about Bokeh plot tools."}),n.register_alias("help",(()=>new n))},
function _(o,t,e,i,l){i(),e.inner="bk-inner",e.hidden="bk-hidden",e.logo="bk-logo",e.above="bk-above",e.below="bk-below",e.left="bk-left",e.right="bk-right",e.divider="bk-divider",e.tool_overflow="bk-tool-overflow",e.horizontal="bk-horizontal",e.vertical="bk-vertical",e.default=':host{--button-width:30px;--button-height:30px;--button-color:lightgray;}:host{display:flex;flex-wrap:nowrap;align-items:center;user-select:none;-webkit-user-select:none;}:host(.bk-inner){background-color:white;opacity:0.8;}:host(.bk-hidden){visibility:hidden;opacity:0;transition:visibility 0.3s linear, opacity 0.3s linear;}.bk-logo{flex-shrink:0;}:host(.bk-above),:host(.bk-below){flex-direction:row;justify-content:flex-end;}:host(.bk-above) .bk-logo,:host(.bk-below) .bk-logo{order:1;margin-left:5px;margin-right:0px;}:host(.bk-left),:host(.bk-right){flex-direction:column;justify-content:flex-start;}:host(.bk-left) .bk-logo,:host(.bk-right) .bk-logo{order:0;margin-bottom:5px;margin-top:0px;}.bk-divider{content:" ";display:inline-block;background-color:var(--button-color);}:host(.bk-above) .bk-divider,:host(.bk-below) .bk-divider{height:10px;width:1px;}:host(.bk-left) .bk-divider,:host(.bk-right) .bk-divider{height:1px;width:10px;}.bk-tool-overflow{color:gray;display:flex;align-items:center;}.bk-tool-overflow:hover{background-color:rgba(192, 192, 192, 0.15);}.bk-tool-overflow:focus,.bk-tool-overflow:focus-visible{outline:1px dotted var(--active-tool-highlight);outline-offset:-1px;}.bk-tool-overflow::-moz-focus-inner{border:0;}:host(.bk-above) .bk-tool-overflow,:host(.bk-below) .bk-tool-overflow,:host(.bk-horizontal) .bk-tool-overflow{width:calc(var(--button-width)/2);height:var(--button-height);flex-direction:row;}:host(.bk-left) .bk-tool-overflow,:host(.bk-right) .bk-tool-overflow,:host(.bk-vertical) .bk-tool-overflow{width:var(--button-width);height:calc(var(--button-height)/2);flex-direction:column;}'},
function _(A,l,g,o,d){o(),g.logo="bk-logo",g.grey="bk-grey",g.logo_small="bk-logo-small",g.default=".bk-logo{margin:5px;position:relative;display:block;background-repeat:no-repeat;}.bk-logo.bk-grey{filter:grayscale(100%);}.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==);}"},
function _(e,i,t,s,r){var l;s();const a=e(236),h=e(141),_=e(24),n=e(59),o=e(78);class d extends a.UpperLowerView{*children(){yield*super.children();const{lower_head:e,upper_head:i}=this;null!=e&&(yield e),null!=i&&(yield i)}async lazy_initialize(){await super.lazy_initialize();const{lower_head:e,upper_head:i}=this.model;null!=e&&(this.lower_head=await(0,n.build_view)(e,{parent:this})),null!=i&&(this.upper_head=await(0,n.build_view)(i,{parent:this}))}set_data(e){var i,t;super.set_data(e);const s=_.Indices.all_set(this._lower.length);null===(i=this.lower_head)||void 0===i||i.set_data(e,s),null===(t=this.upper_head)||void 0===t||t.set_data(e,s)}paint(e){if(this.visuals.line.doit)for(let i=0,t=this._lower_sx.length;i<t;i++)e.beginPath(),e.moveTo(this._lower_sx[i],this._lower_sy[i]),e.lineTo(this._upper_sx[i],this._upper_sy[i]),this.visuals.line.apply(e,i);const i="height"==this.model.dimension?0:Math.PI/2;if(null!=this.lower_head)for(let t=0,s=this._lower_sx.length;t<s;t++)e.save(),e.translate(this._lower_sx[t],this._lower_sy[t]),e.rotate(i+Math.PI),this.lower_head.render(e,t),e.restore();if(null!=this.upper_head)for(let t=0,s=this._upper_sx.length;t<s;t++)e.save(),e.translate(this._upper_sx[t],this._upper_sy[t]),e.rotate(i),this.upper_head.render(e,t),e.restore()}}t.WhiskerView=d,d.__name__="WhiskerView";class p extends a.UpperLower{constructor(e){super(e)}}t.Whisker=p,l=p,p.__name__="Whisker",l.prototype.default_view=d,l.mixins(o.LineVector),l.define((({Ref:e,Nullable:i})=>({lower_head:[i(e(h.ArrowHead)),()=>new h.TeeHead({size:10})],upper_head:[i(e(h.ArrowHead)),()=>new h.TeeHead({size:10})]}))),l.override({level:"underlay"})},
function _(L,e,T,l,H){l(),H("HTMLLabel",L(290).HTMLLabel),H("HTMLLabelSet",L(292).HTMLLabelSet),H("HTMLTitle",L(293).HTMLTitle)},
function _(e,t,s,i,n){var o;i();const a=e(1),l=e(291),r=e(11),u=e(20),_=e(153),d=e(146),c=a.__importStar(e(78));class h extends l.TextAnnotationView{update_layout(){const{panel:e}=this;this.layout=null!=e?new d.SideLayout(e,(()=>this.get_size()),!1):void 0}_get_size(){const{text:e}=this.model,t=new _.TextBox({text:e}),{angle:s,angle_units:i}=this.model;t.angle=(0,r.compute_angle)(s,i),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,s=(0,r.compute_angle)(e,t),i=null!=this.layout?this.layout:this.plot_view.frame,n=this.coordinates.x_scale,o=this.coordinates.y_scale;let a=(()=>{switch(this.model.x_units){case"canvas":return this.model.x;case"screen":return i.bbox.xview.compute(this.model.x);case"data":return n.compute(this.model.x)}})(),l=(()=>{switch(this.model.y_units){case"canvas":return this.model.y;case"screen":return i.bbox.yview.compute(this.model.y);case"data":return o.compute(this.model.y)}})();a+=this.model.x_offset,l-=this.model.y_offset,this._paint(this.layer.ctx,this.model.text,a,l,s)}}s.HTMLLabelView=h,h.__name__="HTMLLabelView";class m extends l.TextAnnotation{constructor(e){super(e)}}s.HTMLLabel=m,o=m,m.__name__="HTMLLabel",o.prototype.default_view=h,o.mixins([c.Text,["border_",c.Line],["background_",c.Fill]]),o.define((({Number:e,String:t,Angle:s})=>({x:[e],x_units:[u.CoordinateUnits,"data"],y:[e],y_units:[u.CoordinateUnits,"data"],text:[t,""],angle:[s,0],angle_units:[u.AngleUnits,"rad"],x_offset:[e,0],y_offset:[e,0]}))),o.override({background_fill_color:null,border_line_color:null})},
function _(t,e,s,i,l){i();const n=t(73),o=t(56),a=t(146);class r extends n.AnnotationView{update_layout(){const{panel:t}=this;this.layout=null!=t?new a.SideLayout(t,(()=>this.get_size()),!0):void 0}initialize(){super.initialize(),this.el=(0,o.div)(),this.plot_view.canvas_view.add_overlay(this.el)}remove(){(0,o.remove)(this.el),super.remove()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.render()))}render(){this.model.visible||(0,o.undisplay)(this.el),super.render()}_paint(t,e,s,i,l){const{el:n}=this;(0,o.undisplay)(n),n.textContent=e,this.visuals.text.set_value(t),n.style.position="absolute",n.style.left=`${s}px`,n.style.top=`${i}px`,n.style.color=t.fillStyle,n.style.webkitTextStroke=`1px ${t.strokeStyle}`,n.style.font=t.font,n.style.lineHeight="normal",n.style.whiteSpace="pre";const[a,r]=(()=>{switch(this.visuals.text.text_align.get_value()){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[u,d]=(()=>{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 c=`translate(${r}, ${d})`;0!=l&&(c+=`rotate(${l}rad)`),n.style.transformOrigin=`${a} ${u}`,n.style.transform=c,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),n.style.backgroundColor=t.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),n.style.borderStyle=t.getLineDash().length<2?"solid":"dashed",n.style.borderWidth=`${t.lineWidth}px`,n.style.borderColor=t.strokeStyle),(0,o.display)(n)}}s.TextAnnotationView=r,r.__name__="TextAnnotationView";class u extends n.Annotation{constructor(t){super(t)}}s.TextAnnotation=u,u.__name__="TextAnnotation"},
function _(t,e,s,i,r){var o;i();const l=t(1),a=t(100),n=l.__importStar(t(78)),c=t(20),h=t(56),_=l.__importStar(t(18)),u=t(24),d=t(12);class y extends a.DataAnnotationView{constructor(){super(...arguments),this.els=[]}set_data(t){super.set_data(t),this.els.forEach((t=>(0,h.remove)(t))),this.els=[];for(const t of this.text){const t=(0,h.div)({style:{display:"none"}});this.plot_view.canvas_view.add_overlay(t),this.els.push(t)}}remove(){this.els.forEach((t=>(0,h.remove)(t))),this.els=[],super.remove()}_rerender(){this.render()}map_data(){const{x_scale:t,y_scale:e}=this.coordinates,s=null!=this.layout?this.layout:this.plot_view.frame;this.sx=(()=>{switch(this.model.x_units){case"canvas":return new u.ScreenArray(this._x);case"screen":return s.bbox.xview.v_compute(this._x);case"data":return t.v_compute(this._x)}})(),this.sy=(()=>{switch(this.model.y_units){case"canvas":return new u.ScreenArray(this._y);case"screen":return s.bbox.yview.v_compute(this._y);case"data":return e.v_compute(this._y)}})()}paint(){const{ctx:t}=this.layer;for(let e=0,s=this.text.length;e<s;e++){const s=this.x_offset.get(e),i=this.y_offset.get(e),r=this.sx[e]+s,o=this.sy[e]-i,l=this.angle.get(e),a=this.text.get(e);isFinite(r+o+l)&&null!=a&&this._paint(t,e,a,r,o,l)}}_paint(t,e,s,i,r,o){(0,d.assert)(e in this.els);const l=this.els[e];l.textContent=s,this.visuals.text.set_vectorize(t,e),l.style.position="absolute",l.style.left=`${i}px`,l.style.top=`${r}px`,l.style.color=t.fillStyle,l.style.webkitTextStroke=`1px ${t.strokeStyle}`,l.style.font=t.font,l.style.lineHeight="normal",l.style.whiteSpace="pre";const[a,n]=(()=>{switch(this.visuals.text.text_align.get(e)){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[c,_]=(()=>{switch(this.visuals.text.text_baseline.get(e)){case"top":return["top","0%"];case"middle":default:return["center","-50%"];case"bottom":return["bottom","-100%"]}})();let u=`translate(${n}, ${_})`;0!=o&&(u+=`rotate(${o}rad)`),l.style.transformOrigin=`${a} ${c}`,l.style.transform=u,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),l.style.backgroundColor=t.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),l.style.borderStyle=t.getLineDash().length<2?"solid":"dashed",l.style.borderWidth=`${t.lineWidth}px`,l.style.borderColor=t.strokeStyle),(0,h.display)(l)}}s.HTMLLabelSetView=y,y.__name__="HTMLLabelSetView";class p extends a.DataAnnotation{constructor(t){super(t)}}s.HTMLLabelSet=p,o=p,p.__name__="HTMLLabelSet",o.prototype.default_view=y,o.mixins([n.TextVector,["border_",n.LineVector],["background_",n.FillVector]]),o.define((()=>({x:[_.XCoordinateSpec,{field:"x"}],y:[_.YCoordinateSpec,{field:"y"}],x_units:[c.CoordinateUnits,"data"],y_units:[c.CoordinateUnits,"data"],text:[_.NullStringSpec,{field:"text"}],angle:[_.AngleSpec,0],x_offset:[_.NumberSpec,{value:0}],y_offset:[_.NumberSpec,{value:0}]}))),o.override({background_fill_color:null,border_line_color:null})},
function _(e,t,i,l,s){var o;l();const a=e(1),n=e(291),r=e(20),c=e(153),h=a.__importStar(e(78));class _ extends n.TextAnnotationView{_get_location(){const e=this.model.offset,t=this.model.standoff/2;let i,l;const{bbox:s}=this.layout;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":l=s.top+t;break;case"middle":l=s.vcenter;break;case"bottom":l=s.bottom-t}switch(this.model.align){case"left":i=s.left+e;break;case"center":i=s.hcenter;break;case"right":i=s.right-e}break;case"left":switch(this.model.vertical_align){case"top":i=s.left+t;break;case"middle":i=s.hcenter;break;case"bottom":i=s.right-t}switch(this.model.align){case"left":l=s.bottom-e;break;case"center":l=s.vcenter;break;case"right":l=s.top+e}break;case"right":switch(this.model.vertical_align){case"top":i=s.right-t;break;case"middle":i=s.hcenter;break;case"bottom":i=s.left+t}switch(this.model.align){case"left":l=s.top+e;break;case"center":l=s.vcenter;break;case"right":l=s.bottom-e}}return[i,l]}_render(){const{text:e}=this.model;if(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(),l=this.panel.get_label_angle_heuristic("parallel");this._paint(this.layer.ctx,e,t,i,l)}_get_size(){const{text:e}=this.model,t=new c.TextBox({text:e});t.visuals=this.visuals.text.values();const{width:i,height:l}=t.size();return{width:i,height:0==l?0:2+l+this.model.standoff}}}i.HTMLTitleView=_,_.__name__="HTMLTitleView";class d extends n.TextAnnotation{constructor(e){super(e)}}i.HTMLTitle=d,o=d,d.__name__="HTMLTitle",o.prototype.default_view=_,o.mixins([h.Text,["border_",h.Line],["background_",h.Fill]]),o.define((({Number:e,String:t})=>({text:[t,""],vertical_align:[r.VerticalAlign,"bottom"],align:[r.TextAlign,"left"],offset:[e,0],standoff:[e,10]}))),o.prototype._props.text_align.options.internal=!0,o.prototype._props.text_baseline.options.internal=!0,o.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})},
function _(e,t,u,n,S){n(),S("CustomJS",e(295).CustomJS),S("OpenURL",e(297).OpenURL),S("SetValue",e(298).SetValue)},
function _(require,module,exports,__esModule,__esExport){var _a;__esModule();const callback_1=require(296),object_1=require(9),array_1=require(10),string_1=require(40),logging_1=require(19),types_1=require(8),standalone_1=require(53);class CustomJS extends callback_1.Callback{constructor(t){super(t),this._state=null}connect_signals(){super.connect_signals();const{args:t,code:e,module:s}=this.properties;this.on_change([t,e,s],(()=>this._state=null))}async _compile_module(){const url=URL.createObjectURL(new Blob([this.code],{type:"text/javascript"}));try{const module=await eval(`import("${url}")`);return(0,types_1.isFunction)(module.default)?module.default:(logging_1.logger.warn("custom ES module didn't export a default function"),()=>{})}finally{URL.revokeObjectURL(url)}}async _compile_function(){const[t=[],e=[]]=(0,array_1.unzip)((0,object_1.entries)(this.args)),s=(0,string_1.use_strict)(this.code),o=new Function(...t,"cb_obj","cb_data","cb_context",s);return function(...t){return o.call(this,...e,...t)}}_is_es_module(t){return t.split("\n").some((t=>t.trimStart().startsWith("export default")))}async _compile(){const t=(()=>"auto"==this.module?this._is_es_module(this.code):this.module)();return t?{func:await this._compile_module(),module:t}:{func:await this._compile_function(),module:t}}async state(){return null==this._state&&(this._state=await this._compile()),this._state}async execute(t,e={}){const{func:s,module:o}=await this.state(),n={index:standalone_1.index};return o?s(this.args,t,e,n):s.call(t,t,e,n)}}exports.CustomJS=CustomJS,_a=CustomJS,CustomJS.__name__="CustomJS",_a.define((({Unknown:t,String:e,Dict:s,Auto:o,Or:n,Boolean:i})=>({args:[s(t),{}],code:[e],module:[n(o,i),"auto"]})))},
function _(c,a,l,n,s){n();const e=c(50);class o extends e.Model{constructor(c){super(c)}}l.Callback=o,o.__name__="Callback"},
function _(e,t,n,o,i){var s;o();const c=e(296),r=e(172),a=e(8);class d extends c.Callback{constructor(e){super(e)}navigate(e){this.same_tab?window.location.href=e:window.open(e)}execute(e,{source:t}){const n=e=>{const n=(0,r.replace_placeholders)(this.url,t,e,void 0,void 0,encodeURI);if(!(0,a.isString)(n))throw new Error("HTML output is not supported in this context");this.navigate(n)},{selected:o}=t;for(const e of o.indices)n(e);for(const e of o.line_indices)n(e)}}n.OpenURL=d,s=d,d.__name__="OpenURL",s.define((({Boolean:e,String:t})=>({url:[t,"http://"],same_tab:[e,!1]})))},
function _(e,t,r,n,o){var a;n();const s=e(296),c=e(14),l=e(19);class u extends s.Callback{constructor(e){super(e)}execute(){const{obj:e,attr:t,value:r}=this;t in e.properties?e.setv({[t]:r}):l.logger.error(`${e.type}.${t} is not a property`)}}r.SetValue=u,a=u,u.__name__="SetValue",a.define((({String:e,Unknown:t,Ref:r})=>({obj:[r(c.HasProps)],attr:[e],value:[t]})))},
function _(a,n,e,r,s){r(),s("Canvas",a(300).Canvas),s("CartesianFrame",a(159).CartesianFrame)},
function _(e,t,s,i,a){var r;i();const l=e(1),n=e(29),h=e(19),o=e(56),_=e(20),p=e(301),c=e(157),u=e(269),d=e(266),b=e(56),v=l.__importDefault(e(304));const w=(()=>{let t;return async()=>void 0!==t?t:t=await async function(){const t=document.createElement("canvas"),s=t.getContext("webgl",{alpha:!0,antialias:!1,depth:!1,premultipliedAlpha:!0});if(null!=s){const i=await(0,c.load_module)(Promise.resolve().then((()=>l.__importStar(e(517)))));if(null!=i){const e=i.get_regl(s);if(e.has_webgl)return{canvas:t,regl_wrapper:e};h.logger.trace("WebGL is supported, but not the required extensions")}else h.logger.trace("WebGL is supported, but bokehjs(.min).js bundle is not available")}else h.logger.trace("WebGL is not supported");return null}()})();class g extends d.UIElementView{constructor(){super(...arguments),this.webgl=null,this._size=new b.InlineStyleSheet,this.plot_views=[]}initialize(){super.initialize(),this.underlays_el=(0,o.div)({class:"bk-layer"}),this.primary=this.create_layer(),this.overlays=this.create_layer(),this.overlays_el=(0,o.div)({class:"bk-layer"}),this.events_el=(0,o.div)({class:["bk-layer","bk-events"]}),this.ui_event_bus=new p.UIEventBus(this)}get layers(){return[this.underlays_el,this.primary,this.overlays,this.overlays_el,this.events_el]}async lazy_initialize(){if(await super.lazy_initialize(),"webgl"==this.model.output_backend&&(this.webgl=await w(),n.settings.force_webgl&&null==this.webgl))throw new Error("webgl is not available")}remove(){this.ui_event_bus.destroy(),super.remove()}stylesheets(){return[...super.stylesheets(),v.default,this._size]}render(){super.render();const e=[this.underlays_el,this.primary.el,this.overlays.el,this.overlays_el,this.events_el];(0,o.append)(this.shadow_el,...e)}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}_update_bbox(){const e=super._update_bbox();if(e){const{width:e,height:t}=this.bbox;this._size.replace(`\n .bk-layer {\n width: ${e}px;\n height: ${t}px;\n }\n `),this.primary.resize(e,t),this.overlays.resize(e,t)}return e}after_resize(){0==this.plot_views.length&&super.after_resize()}_after_resize(){super._after_resize();const{width:e,height:t}=this.bbox;this.primary.resize(e,t),this.overlays.resize(e,t)}resize(){this._update_bbox(),this._after_resize()}prepare_webgl(e){const{webgl:t}=this;if(null!=t){const{width:s,height:i}=this.bbox;t.canvas.width=this.pixel_ratio*s,t.canvas.height=this.pixel_ratio*i;const[a,r,l,n]=e,{xview:h,yview:o}=this.bbox,_=h.compute(a),p=o.compute(r+n),c=this.pixel_ratio;t.regl_wrapper.set_scissor(c*_,c*p,c*l,c*n),this._clear_webgl()}}blit_webgl(e){const{webgl:t}=this;if(null!=t&&t.canvas.width*t.canvas.height>0){if(h.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:s}=e;t.clear(s.width,s.height)}}compose(){const e=this.create_layer(),{width:t,height:s}=this.bbox;return e.resize(t,s),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 u.CanvasLayer(e,t)}to_blob(){return this.compose().to_blob()}}s.CanvasView=g,g.__name__="CanvasView";class y extends d.UIElement{constructor(e){super(e)}}s.Canvas=y,r=y,y.__name__="Canvas",r.prototype.default_view=g,r.define((({Boolean:e})=>({hidpi:[e,!0],output_backend:[_.OutputBackend,"canvas"]})))},
function _(t,e,n,i,s){i();const r=t(1),_=r.__importDefault(t(302)),a=t(15),o=t(19),h=t(56),l=r.__importStar(t(52)),c=t(303),u=t(10),p=t(8),v=t(27),d=t(274);function m(t){return(0,p.isObject)(t)&&"_move_start"in t&&"_move"in t&&"_move_end"in t}function g(t){return(0,p.isObject)(t)&&"_pan_start"in t&&"_pan"in t&&"_pan_end"in t}function y(t){return(0,p.isObject)(t)&&"_pinch_start"in t&&"_pinch"in t&&"_pinch_end"in t}function w(t){return(0,p.isObject)(t)&&"_rotate_start"in t&&"_rotate"in t&&"_rotate_end"in t}n.is_Moveable=m,n.is_Pannable=g,n.is_Pinchable=y,n.is_Rotatable=w,n.is_Scrollable=function(t){return(0,p.isObject)(t)&&"_scroll"in t},n.is_Keyable=function(t){return(0,p.isObject)(t)&&"_keydown"in t&&"_keyup"in t},n.is_Tapable=function(t){return(0,p.isObject)(t)&&"_tap"in t};class f{get hit_area(){return this.canvas_view.events_el}constructor(t){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._prev_move=null,this._curr_pan=null,this._curr_pinch=null,this._curr_rotate=null,this._current_pan_view=null,this._current_pinch_view=null,this._current_rotate_view=null,this._current_move_view=null,this.canvas_view=t,this.hammer=new _.default(this.hit_area,{cssProps:{},touchAction:"auto",inputClass:v.is_mobile?_.default.TouchMouseInput:_.default.PointerEventInput}),this._configure_hammerjs(),this.hit_area.addEventListener("mousemove",(t=>this._mouse_move(t))),this.hit_area.addEventListener("mouseenter",(t=>this._mouse_enter(t))),this.hit_area.addEventListener("mouseleave",(t=>this._mouse_exit(t))),this.hit_area.addEventListener("contextmenu",(t=>this._context_menu(t))),this.hit_area.addEventListener("wheel",(t=>this._mouse_wheel(t))),document.addEventListener("keydown",this),document.addEventListener("keyup",this)}destroy(){this.hammer.destroy(),document.removeEventListener("keydown",this),document.removeEventListener("keyup",this)}handleEvent(t){"keydown"==t.type?this._key_down(t):"keyup"==t.type&&this._key_up(t)}_configure_hammerjs(){this.hammer.get("doubletap").recognizeWith("tap"),this.hammer.get("tap").requireFailure("doubletap"),this.hammer.get("doubletap").dropRequireFailure("tap"),this.hammer.on("doubletap",(t=>this._doubletap(t))),this.hammer.on("tap",(t=>this._tap(t))),this.hammer.on("press",(t=>this._press(t))),this.hammer.on("pressup",(t=>this._pressup(t))),this.hammer.get("pan").set({direction:_.default.DIRECTION_ALL}),this.hammer.on("panstart",(t=>this._pan_start(t))),this.hammer.on("pan",(t=>this._pan(t))),this.hammer.on("panend",(t=>this._pan_end(t))),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("pinchstart",(t=>this._pinch_start(t))),this.hammer.on("pinch",(t=>this._pinch(t))),this.hammer.on("pinchend",(t=>this._pinch_end(t))),this.hammer.get("rotate").set({enable:!0}),this.hammer.on("rotatestart",(t=>this._rotate_start(t))),this.hammer.on("rotate",(t=>this._rotate(t))),this.hammer.on("rotateend",(t=>this._rotate_end(t)))}register_tool(t){let e=!0;for(const n of t.model.event_types)this._register_tool(t,n,e),e=!1}_register_tool(t,e,n=!0){const i=t,{id:s}=i.model,r=t=>e=>{e.id==s&&t(e.e)},_=t=>e=>{t(e.e)};switch(e){case"pan":null!=i._pan_start&&i.connect(this.pan_start,r(i._pan_start.bind(i))),null!=i._pan&&i.connect(this.pan,r(i._pan.bind(i))),null!=i._pan_end&&i.connect(this.pan_end,r(i._pan_end.bind(i)));break;case"pinch":null!=i._pinch_start&&i.connect(this.pinch_start,r(i._pinch_start.bind(i))),null!=i._pinch&&i.connect(this.pinch,r(i._pinch.bind(i))),null!=i._pinch_end&&i.connect(this.pinch_end,r(i._pinch_end.bind(i)));break;case"rotate":null!=i._rotate_start&&i.connect(this.rotate_start,r(i._rotate_start.bind(i))),null!=i._rotate&&i.connect(this.rotate,r(i._rotate.bind(i))),null!=i._rotate_end&&i.connect(this.rotate_end,r(i._rotate_end.bind(i)));break;case"move":null!=i._move_enter&&i.connect(this.move_enter,r(i._move_enter.bind(i))),null!=i._move&&i.connect(this.move,r(i._move.bind(i))),null!=i._move_exit&&i.connect(this.move_exit,r(i._move_exit.bind(i)));break;case"tap":null!=i._tap&&i.connect(this.tap,r(i._tap.bind(i)));case"doubletap":null!=i._doubletap&&i.connect(this.doubletap,r(i._doubletap.bind(i)));break;case"press":null!=i._press&&i.connect(this.press,r(i._press.bind(i)));break;case"pressup":null!=i._pressup&&i.connect(this.pressup,r(i._pressup.bind(i)));break;case"scroll":null!=i._scroll&&i.connect(this.scroll,r(i._scroll.bind(i)))}n&&(null!=i._keydown&&i.connect(this.keydown,_(i._keydown.bind(i))),null!=i._keyup&&i.connect(this.keyup,_(i._keyup.bind(i))),v.is_mobile&&null!=i._scroll&&"pinch"==e&&(o.logger.debug("Registering scroll on touch screen"),i.connect(this.scroll,r(i._scroll.bind(i)))))}hit_test_renderers(t,e,n){var i,s;const r=t.get_renderer_views();for(const t of(0,u.reversed)(r))if(null!==(s=null===(i=t.interactive_hit)||void 0===i?void 0:i.call(t,e,n))&&void 0!==s&&s)return t;return null}set_cursor(t){this.hit_area.style.cursor=null!=t?t:"default"}hit_test_frame(t,e,n){return t.frame.bbox.contains(e,n)}hit_test_plot(t,e){for(const n of this.canvas_view.plot_views)if(n.bbox.relative().contains(t,e))return n;return null}_trigger(t,e,n){var i;if(!this.hit_area.isConnected)return;const{sx:s,sy:r}=e,_=this.hit_test_plot(s,r),a=t=>{const[n,i]=[s,r];return Object.assign(Object.assign({},e),{sx:n,sy:i})};if("panstart"==e.type||"pan"==e.type||"panend"==e.type){let i;if("panstart"==e.type&&null!=_?(this._curr_pan={plot_view:_},i=_):"pan"==e.type&&null!=this._curr_pan?i=this._curr_pan.plot_view:"panend"==e.type&&null!=this._curr_pan?(i=this._curr_pan.plot_view,this._curr_pan=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("pinchstart"==e.type||"pinch"==e.type||"pinchend"==e.type){let i;if("pinchstart"==e.type&&null!=_?(this._curr_pinch={plot_view:_},i=_):"pinch"==e.type&&null!=this._curr_pinch?i=this._curr_pinch.plot_view:"pinchend"==e.type&&null!=this._curr_pinch?(i=this._curr_pinch.plot_view,this._curr_pinch=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("rotatestart"==e.type||"rotate"==e.type||"rotateend"==e.type){let i;if("rotatestart"==e.type&&null!=_?(this._curr_rotate={plot_view:_},i=_):"rotate"==e.type&&null!=this._curr_rotate?i=this._curr_rotate.plot_view:"rotateend"==e.type&&null!=this._curr_rotate?(i=this._curr_rotate.plot_view,this._curr_rotate=null):i=null,null!=i){const e=a();this.__trigger(i,t,e,n)}}else if("mouseenter"==e.type||"mousemove"==e.type||"mouseleave"==e.type){const o=null===(i=this._prev_move)||void 0===i?void 0:i.plot_view;if(null!=o&&("mouseleave"==e.type||o!=_)){const{sx:t,sy:e}=a();this.__trigger(o,this.move_exit,{type:"mouseleave",sx:t,sy:e,modifiers:{shift:!1,ctrl:!1,alt:!1}},n)}if(null!=_&&("mouseenter"==e.type||o!=_)){const{sx:t,sy:e}=a();this.__trigger(_,this.move_enter,{type:"mouseenter",sx:t,sy:e,modifiers:{shift:!1,ctrl:!1,alt:!1}},n)}if(null!=_&&"mousemove"==e.type){const e=a();this.__trigger(_,t,e,n)}this._prev_move={sx:s,sy:r,plot_view:_}}else if(null!=_){const e=a();this.__trigger(_,t,e,n)}}__trigger(t,e,n,i){var s,r,_,a,o;const h=t.model.toolbar.gestures,l=e.name,c=l.split(":")[0],p=this.hit_test_renderers(t,n.sx,n.sy);if("pan"==c){if(null!=this._current_pan_view)return"pan"==l?this._current_pan_view._pan(n):"pan:end"==l&&(this._current_pan_view._pan_end(n),this._current_pan_view=null),void i.preventDefault();if(null!=p&&"pan:start"==l&&g(p)&&p._pan_start(n))return this._current_pan_view=p,void i.preventDefault()}else if("pinch"==c){if(null!=this._current_pinch_view)return"pinch"==l?this._current_pinch_view._pinch(n):"pinch:end"==l&&(this._current_pinch_view._pinch_end(n),this._current_pinch_view=null),void i.preventDefault();if(null!=p&&"pinch:start"==l&&y(p)&&p._pinch_start(n))return this._current_pinch_view=p,void i.preventDefault()}else if("rotate"==c){if(null!=this._current_rotate_view)return"rotate"==l?this._current_rotate_view._rotate(n):"rotate:end"==l&&(this._current_rotate_view._rotate_end(n),this._current_rotate_view=null),void i.preventDefault();if(null!=p&&"rotate:start"==l&&w(p)&&p._rotate_start(n))return this._current_rotate_view=p,void i.preventDefault()}else"move"==c&&(this._current_move_view==p?null===(s=this._current_move_view)||void 0===s||s._move(n):(null===(r=this._current_move_view)||void 0===r||r._move_end(n),this._current_move_view=null,null!=p&&m(p)&&p._move_start(n)&&(this._current_move_view=p)));switch(c){case"move":{const i=h.move.active;null!=i&&this.trigger(e,n,i.id);const s=t.model.toolbar.inspectors.filter((t=>t.active)),r=(()=>{var e,r,_,a,o;const h=null!==(o=null!==(a=null!==(_=null!==(r=null!==(e=this._current_pan_view)&&void 0!==e?e:this._current_pinch_view)&&void 0!==r?r:this._current_rotate_view)&&void 0!==_?_:this._current_move_view)&&void 0!==a?a:p)&&void 0!==o?o:function(e){var n;if(null!=e){const i=e instanceof d.ToolProxy?e.tools[0]:e;return null!==(n=t.tool_views.get(i))&&void 0!==n?n:null}return null}(i);if(null!=h){const t=h.cursor(n.sx,n.sy);if(null!=t)return t}return this.hit_test_frame(t,n.sx,n.sy)&&!(0,u.is_empty)(s)?"crosshair":null})();this.set_cursor(r),null==p||p.model.propagate_hover||(0,u.is_empty)(s)||(e=this.move_exit),s.map((t=>this.trigger(e,n,t.id)));break}case"tap":{const s=null!==(_=i.path)&&void 0!==_?_:i.composedPath();if(0!=s.length&&s[0]!=this.hit_area)return;if(null===(a=null==p?void 0:p.on_hit)||void 0===a||a.call(p,n.sx,n.sy),this.hit_test_frame(t,n.sx,n.sy)){const t=h.tap.active;null!=t&&this.trigger(e,n,t.id)}break}case"doubletap":if(this.hit_test_frame(t,n.sx,n.sy)){const t=null!==(o=h.doubletap.active)&&void 0!==o?o:h.tap.active;null!=t&&this.trigger(e,n,t.id)}break;case"scroll":{const t=h[v.is_mobile?"pinch":"scroll"].active;null!=t&&(i.preventDefault(),i.stopPropagation(),this.trigger(e,n,t.id));break}case"pan":{const t=h.pan.active;null!=t&&(i.preventDefault(),this.trigger(e,n,t.id));break}default:{const t=h[c].active;null!=t&&this.trigger(e,n,t.id)}}this._trigger_bokeh_event(t,n)}trigger(t,e,n=null){t.emit({id:n,e})}_trigger_bokeh_event(t,e){const n=(()=>{const{sx:n,sy:i,modifiers:s}=e,r=t.frame.x_scale.invert(n),_=t.frame.y_scale.invert(i);switch(e.type){case"wheel":return new l.MouseWheel(n,i,r,_,e.delta,s);case"mousemove":return new l.MouseMove(n,i,r,_,s);case"mouseenter":return new l.MouseEnter(n,i,r,_,s);case"mouseleave":return new l.MouseLeave(n,i,r,_,s);case"tap":return new l.Tap(n,i,r,_,s);case"doubletap":return new l.DoubleTap(n,i,r,_,s);case"press":return new l.Press(n,i,r,_,s);case"pressup":return new l.PressUp(n,i,r,_,s);case"pan":return new l.Pan(n,i,r,_,e.dx,e.dy,s);case"panstart":return new l.PanStart(n,i,r,_,s);case"panend":return new l.PanEnd(n,i,r,_,s);case"pinch":return new l.Pinch(n,i,r,_,e.scale,s);case"pinchstart":return new l.PinchStart(n,i,r,_,s);case"pinchend":return new l.PinchEnd(n,i,r,_,s);case"rotate":return new l.Rotate(n,i,r,_,e.rotation,s);case"rotatestart":return new l.RotateStart(n,i,r,_,s);case"rotateend":return new l.RotateEnd(n,i,r,_,s);default:return}})();null!=n&&t.model.trigger_event(n)}_get_sxy(t){const{pageX:e,pageY:n}=function(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}(t)?(0!=t.touches.length?t.touches:t.changedTouches)[0]:t,{left:i,top:s}=(0,h.offset_bbox)(this.hit_area);return{sx:e-i,sy:n-s}}_get_modifiers(t){return{shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey}}_pan_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{dx:t.deltaX,dy:t.deltaY,modifiers:this._get_modifiers(t.srcEvent)})}_pinch_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{scale:t.scale,modifiers:this._get_modifiers(t.srcEvent)})}_rotate_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{rotation:t.rotation,modifiers:this._get_modifiers(t.srcEvent)})}_tap_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t.srcEvent)),{modifiers:this._get_modifiers(t.srcEvent)})}_move_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t)),{modifiers:this._get_modifiers(t)})}_scroll_event(t){return Object.assign(Object.assign({type:t.type},this._get_sxy(t)),{delta:(0,c.getDeltaY)(t),modifiers:this._get_modifiers(t)})}_key_event(t){return{type:t.type,key:t.key,modifiers:this._get_modifiers(t)}}_pan_start(t){const e=this._pan_event(t);e.sx-=t.deltaX,e.sy-=t.deltaY,this._trigger(this.pan_start,e,t.srcEvent)}_pan(t){this._trigger(this.pan,this._pan_event(t),t.srcEvent)}_pan_end(t){this._trigger(this.pan_end,this._pan_event(t),t.srcEvent)}_pinch_start(t){this._trigger(this.pinch_start,this._pinch_event(t),t.srcEvent)}_pinch(t){this._trigger(this.pinch,this._pinch_event(t),t.srcEvent)}_pinch_end(t){this._trigger(this.pinch_end,this._pinch_event(t),t.srcEvent)}_rotate_start(t){this._trigger(this.rotate_start,this._rotate_event(t),t.srcEvent)}_rotate(t){this._trigger(this.rotate,this._rotate_event(t),t.srcEvent)}_rotate_end(t){this._trigger(this.rotate_end,this._rotate_event(t),t.srcEvent)}_tap(t){this._trigger(this.tap,this._tap_event(t),t.srcEvent)}_doubletap(t){this._trigger(this.doubletap,this._tap_event(t),t.srcEvent)}_press(t){this._trigger(this.press,this._tap_event(t),t.srcEvent)}_pressup(t){this._trigger(this.pressup,this._tap_event(t),t.srcEvent)}_mouse_enter(t){this._trigger(this.move_enter,this._move_event(t),t)}_mouse_move(t){this._trigger(this.move,this._move_event(t),t)}_mouse_exit(t){this._trigger(this.move_exit,this._move_event(t),t)}_mouse_wheel(t){this._trigger(this.scroll,this._scroll_event(t),t)}_context_menu(t){}_key_down(t){this.trigger(this.keydown,this._key_event(t))}_key_up(t){this.trigger(this.keyup,this._key_event(t))}}n.UIEventBus=f,f.__name__="UIEventBus"},
function _(t,e,i,n,r){
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
!function(t,i,n,r){"use strict";var s,o=["","webkit","Moz","MS","ms","o"],a=i.createElement("div"),h="function",u=Math.round,c=Math.abs,l=Date.now;function p(t,e,i){return setTimeout(y(t,i),e)}function f(t,e,i){return!!Array.isArray(t)&&(v(t,i[e],i),!0)}function v(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==r)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function d(e,i,n){var r="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=new Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=t.console&&(t.console.warn||t.console.log);return s&&s.call(t.console,r,n),e.apply(this,arguments)}}s="function"!=typeof Object.assign?function(t){if(t===r||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==r&&null!==n)for(var s in n)n.hasOwnProperty(s)&&(e[s]=n[s])}return e}:Object.assign;var m=d((function(t,e,i){for(var n=Object.keys(e),s=0;s<n.length;)(!i||i&&t[n[s]]===r)&&(t[n[s]]=e[n[s]]),s++;return t}),"extend","Use `assign`."),g=d((function(t,e){return m(t,e,!0)}),"merge","Use `assign`.");function T(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&s(n,i)}function y(t,e){return function(){return t.apply(e,arguments)}}function E(t,e){return typeof t==h?t.apply(e&&e[0]||r,e):t}function I(t,e){return t===r?e:t}function A(t,e,i){v(b(e),(function(e){t.addEventListener(e,i,!1)}))}function _(t,e,i){v(b(e),(function(e){t.removeEventListener(e,i,!1)}))}function C(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function S(t,e){return t.indexOf(e)>-1}function b(t){return t.trim().split(/\s+/g)}function P(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function D(t){return Array.prototype.slice.call(t,0)}function x(t,e,i){for(var n=[],r=[],s=0;s<t.length;){var o=e?t[s][e]:t[s];P(r,o)<0&&n.push(t[s]),r[s]=o,s++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function w(t,e){for(var i,n,s=e[0].toUpperCase()+e.slice(1),a=0;a<o.length;){if((n=(i=o[a])?i+s:e)in t)return n;a++}return r}var O=1;function R(e){var i=e.ownerDocument||e;return i.defaultView||i.parentWindow||t}var M="ontouchstart"in t,z=w(t,"PointerEvent")!==r,N=M&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),X="touch",Y="mouse",F=25,W=1,q=4,k=8,H=1,L=2,U=4,V=8,j=16,G=L|U,Z=V|j,B=G|Z,$=["x","y"],J=["clientX","clientY"];function K(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){E(t.options.enable,[t])&&i.handler(e)},this.init()}function Q(t,e,i){var n=i.pointers.length,s=i.changedPointers.length,o=e&W&&n-s==0,a=e&(q|k)&&n-s==0;i.isFirst=!!o,i.isFinal=!!a,o&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,s=n.length;i.firstInput||(i.firstInput=tt(e));s>1&&!i.firstMultiple?i.firstMultiple=tt(e):1===s&&(i.firstMultiple=!1);var o=i.firstInput,a=i.firstMultiple,h=a?a.center:o.center,u=e.center=et(n);e.timeStamp=l(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=st(h,u),e.distance=rt(h,u),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},s=t.prevInput||{};e.eventType!==W&&s.eventType!==q||(r=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=nt(e.deltaX,e.deltaY);var p=it(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=p.x,e.overallVelocityY=p.y,e.overallVelocity=c(p.x)>c(p.y)?p.x:p.y,e.scale=a?(f=a.pointers,v=n,rt(v[0],v[1],J)/rt(f[0],f[1],J)):1,e.rotation=a?function(t,e){return st(e[1],e[0],J)+st(t[1],t[0],J)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,s,o,a=t.lastInterval||e,h=e.timeStamp-a.timeStamp;if(e.eventType!=k&&(h>F||a.velocity===r)){var u=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,p=it(h,u,l);n=p.x,s=p.y,i=c(p.x)>c(p.y)?p.x:p.y,o=nt(u,l),t.lastInterval=e}else i=a.velocity,n=a.velocityX,s=a.velocityY,o=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=s,e.direction=o}(i,e);var f,v;var d=t.element;C(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function tt(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:u(t.pointers[i].clientX),clientY:u(t.pointers[i].clientY)},i++;return{timeStamp:l(),pointers:e,center:et(e),deltaX:t.deltaX,deltaY:t.deltaY}}function et(t){var e=t.length;if(1===e)return{x:u(t[0].clientX),y:u(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:u(i/e),y:u(n/e)}}function it(t,e,i){return{x:e/t||0,y:i/t||0}}function nt(t,e){return t===e?H:c(t)>=c(e)?t<0?L:U:e<0?V:j}function rt(t,e,i){i||(i=$);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function st(t,e,i){i||(i=$);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}K.prototype={handler:function(){},init:function(){this.evEl&&A(this.element,this.evEl,this.domHandler),this.evTarget&&A(this.target,this.evTarget,this.domHandler),this.evWin&&A(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(R(this.element),this.evWin,this.domHandler)}};var ot={mousedown:W,mousemove:2,mouseup:q},at="mousedown",ht="mousemove mouseup";function ut(){this.evEl=at,this.evWin=ht,this.pressed=!1,K.apply(this,arguments)}T(ut,K,{handler:function(t){var e=ot[t.type];e&W&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=q),this.pressed&&(e&q&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Y,srcEvent:t}))}});var ct={pointerdown:W,pointermove:2,pointerup:q,pointercancel:k,pointerout:k},lt={2:X,3:"pen",4:Y,5:"kinect"},pt="pointerdown",ft="pointermove pointerup pointercancel";function vt(){this.evEl=pt,this.evWin=ft,K.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(pt="MSPointerDown",ft="MSPointerMove MSPointerUp MSPointerCancel"),T(vt,K,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=ct[n],s=lt[t.pointerType]||t.pointerType,o=s==X,a=P(e,t.pointerId,"pointerId");r&W&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):r&(q|k)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))}});var dt={touchstart:W,touchmove:2,touchend:q,touchcancel:k};function mt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,K.apply(this,arguments)}function gt(t,e){var i=D(t.touches),n=D(t.changedTouches);return e&(q|k)&&(i=x(i.concat(n),"identifier",!0)),[i,n]}T(mt,K,{handler:function(t){var e=dt[t.type];if(e===W&&(this.started=!0),this.started){var i=gt.call(this,t,e);e&(q|k)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:X,srcEvent:t})}}});var Tt={touchstart:W,touchmove:2,touchend:q,touchcancel:k},yt="touchstart touchmove touchend touchcancel";function Et(){this.evTarget=yt,this.targetIds={},K.apply(this,arguments)}function It(t,e){var i=D(t.touches),n=this.targetIds;if(e&(2|W)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,o=D(t.changedTouches),a=[],h=this.target;if(s=i.filter((function(t){return C(t.target,h)})),e===W)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<o.length;)n[o[r].identifier]&&a.push(o[r]),e&(q|k)&&delete n[o[r].identifier],r++;return a.length?[x(s.concat(a),"identifier",!0),a]:void 0}T(Et,K,{handler:function(t){var e=Tt[t.type],i=It.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:X,srcEvent:t})}});var At=2500;function _t(){K.apply(this,arguments);var t=y(this.handler,this);this.touch=new Et(this.manager,t),this.mouse=new ut(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Ct(t,e){t&W?(this.primaryTouch=e.changedPointers[0].identifier,St.call(this,e)):t&(q|k)&&St.call(this,e)}function St(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),At)}}function bt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],s=Math.abs(e-r.x),o=Math.abs(i-r.y);if(s<=25&&o<=25)return!0}return!1}T(_t,K,{handler:function(t,e,i){var n=i.pointerType==X,r=i.pointerType==Y;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)Ct.call(this,e,i);else if(r&&bt.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Pt=w(a.style,"touchAction"),Dt=Pt!==r,xt="compute",wt="auto",Ot="manipulation",Rt="none",Mt="pan-x",zt="pan-y",Nt=function(){if(!Dt)return!1;var e={},i=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){e[n]=!i||t.CSS.supports("touch-action",n)})),e}();function Xt(t,e){this.manager=t,this.set(e)}Xt.prototype={set:function(t){t==xt&&(t=this.compute()),Dt&&this.manager.element.style&&Nt[t]&&(this.manager.element.style[Pt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return v(this.manager.recognizers,(function(e){E(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(S(t,Rt))return Rt;var e=S(t,Mt),i=S(t,zt);if(e&&i)return Rt;if(e||i)return e?Mt:zt;if(S(t,Ot))return Ot;return wt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=S(n,Rt)&&!Nt[Rt],s=S(n,zt)&&!Nt[zt],o=S(n,Mt)&&!Nt[Mt];if(r){var a=1===t.pointers.length,h=t.distance<2,u=t.deltaTime<250;if(a&&h&&u)return}if(!o||!s)return r||s&&i&G||o&&i&Z?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Yt=1,Ft=32;function Wt(t){this.options=s({},this.defaults,t||{}),this.id=O++,this.manager=null,this.options.enable=I(this.options.enable,!0),this.state=Yt,this.simultaneous={},this.requireFail=[]}function qt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function kt(t){return t==j?"down":t==V?"up":t==L?"left":t==U?"right":""}function Ht(t,e){var i=e.manager;return i?i.get(t):t}function Lt(){Wt.apply(this,arguments)}function Ut(){Lt.apply(this,arguments),this.pX=null,this.pY=null}function Vt(){Lt.apply(this,arguments)}function jt(){Wt.apply(this,arguments),this._timer=null,this._input=null}function Gt(){Lt.apply(this,arguments)}function Zt(){Lt.apply(this,arguments)}function Bt(){Wt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function $t(t,e){return(e=e||{}).recognizers=I(e.recognizers,$t.defaults.preset),new Jt(t,e)}Wt.prototype={defaults:{},set:function(t){return s(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(f(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Ht(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return f(t,"dropRecognizeWith",this)||(t=Ht(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(f(t,"requireFailure",this))return this;var e=this.requireFail;return-1===P(e,t=Ht(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(f(t,"dropRequireFailure",this))return this;t=Ht(t,this);var e=P(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+qt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+qt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Ft},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Ft|Yt)))return!1;t++}return!0},recognize:function(t){var e=s({},t);if(!E(this.options.enable,[this,e]))return this.reset(),void(this.state=Ft);56&this.state&&(this.state=Yt),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},T(Lt,Wt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,r=this.attrTest(t);return n&&(i&k||!r)?16|e:n||r?i&q?8|e:2&e?4|e:2:Ft}}),T(Ut,Lt,{defaults:{event:"pan",threshold:10,pointers:1,direction:B},getTouchAction:function(){var t=this.options.direction,e=[];return t&G&&e.push(zt),t&Z&&e.push(Mt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(e.direction&G?(r=0===s?H:s<0?L:U,i=s!=this.pX,n=Math.abs(t.deltaX)):(r=0===o?H:o<0?V:j,i=o!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return Lt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=kt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),T(Vt,Lt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Rt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),T(jt,Wt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[wt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(q|k)&&!r)this.reset();else if(t.eventType&W)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&q)return 8;return Ft},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&q?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}}),T(Gt,Lt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Rt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),T(Zt,Lt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|Z,pointers:1},getTouchAction:function(){return Ut.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(G|Z)?e=t.overallVelocity:i&G?e=t.overallVelocityX:i&Z&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&c(e)>this.options.velocity&&t.eventType&q},emit:function(t){var e=kt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),T(Bt,Wt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ot]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&W&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=q)return this.failTimeout();var s=!this.pTime||t.timeStamp-this.pTime<e.interval,o=!this.pCenter||rt(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,o&&s?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=p((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Ft},failTimeout:function(){return this._timer=p((function(){this.state=Ft}),this.options.interval,this),Ft},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),$t.VERSION="2.0.7",$t.defaults={domEvents:!1,touchAction:xt,enable:!0,inputTarget:null,inputClass:null,preset:[[Gt,{enable:!1}],[Vt,{enable:!1},["rotate"]],[Zt,{direction:G}],[Ut,{direction:G},["swipe"]],[Bt],[Bt,{event:"doubletap",taps:2},["tap"]],[jt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Jt(t,e){var i;this.options=s({},$t.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(z?vt:N?Et:M?_t:ut))(i,Q),this.touchAction=new Xt(this,this.options.touchAction),Kt(this,!0),v(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Kt(t,e){var i,n=t.element;n.style&&(v(t.options.cssProps,(function(r,s){i=w(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}Jt.prototype={set:function(t){return s(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),s++}},get:function(t){if(t instanceof Wt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(f(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(f(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=P(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==r&&e!==r){var i=this.handlers;return v(b(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==r){var i=this.handlers;return v(b(t),(function(t){e?i[t]&&i[t].splice(P(i[t],e),1):delete i[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&Kt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},s($t,{INPUT_START:W,INPUT_MOVE:2,INPUT_END:q,INPUT_CANCEL:k,STATE_POSSIBLE:Yt,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ft,DIRECTION_NONE:H,DIRECTION_LEFT:L,DIRECTION_RIGHT:U,DIRECTION_UP:V,DIRECTION_DOWN:j,DIRECTION_HORIZONTAL:G,DIRECTION_VERTICAL:Z,DIRECTION_ALL:B,Manager:Jt,Input:K,TouchAction:Xt,TouchInput:Et,MouseInput:ut,PointerEventInput:vt,TouchMouseInput:_t,SingleTouchInput:mt,Recognizer:Wt,AttrRecognizer:Lt,Tap:Bt,Pan:Ut,Swipe:Zt,Pinch:Vt,Rotate:Gt,Press:jt,on:A,off:_,each:v,merge:g,extend:m,assign:s,inherit:T,bindFn:y,prefixed:w}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=$t,"function"==typeof define&&define.amd?define((function(){return $t})):void 0!==e&&e.exports?e.exports=$t:t.Hammer=$t}(window,document)},
function _(t,e,n,l,o){
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
function a(t){const e=getComputedStyle(t).fontSize,n=parseInt(e,10);return isNaN(n)?null:n}l(),n.getDeltaY=function(t){let e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=(n=t.target,null!==(i=null!==(o=a(null!==(l=n.offsetParent)&&void 0!==l?l:document.body))&&void 0!==o?o:a(n))&&void 0!==i?i:16);break;case t.DOM_DELTA_PAGE:e*=function(t){return t.clientHeight}(t.target)}var n,l,o,i;return e}},
function _(e,t,n,o,a){o(),n.layer="bk-layer",n.events="bk-events",n.default=".bk-layer{position:absolute;top:0;left:0;width:100%;height:100%;}.bk-layer.bk-events{user-select:none;-webkit-user-select:none;touch-action:auto;-webkit-user-drag:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}"},
function _(o,n,i,a,d){a(),d("CoordinateMapping",o(84).CoordinateMapping),d("Node",o(241).Node)},
function _(m,o,n,r,a){r(),a("Expression",m(307).Expression),a("CustomJSExpr",m(308).CustomJSExpr),a("Stack",m(309).Stack),a("CumSum",m(310).CumSum),a("ScalarExpression",m(307).ScalarExpression),a("Minimum",m(311).Minimum),a("Maximum",m(312).Maximum);var s=m(313);a("XComponent",s.XComponent),a("YComponent",s.YComponent),a("PolarTransform",m(314).PolarTransform)},
function _(e,t,s,i,r){i();const n=e(50);class _ extends n.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}}s.Expression=_,_.__name__="Expression";class o extends n.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}}s.ScalarExpression=o,o.__name__="ScalarExpression"},
function _(e,s,n,t,r){var o;t();const a=e(14),c=e(307),i=e(24),u=e(10),l=e(9),h=e(40),g=e(8);class v extends c.Expression{constructor(e){super(e)}connect_signals(){super.connect_signals();for(const e of(0,l.values)(this.args))e instanceof a.HasProps&&e.change.connect((()=>{this._result.clear(),this.change.emit()}))}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 i.GeneratorFunction(...this.names,e)}_v_compute(e){var s,n;const t=this.func.apply(e,this.values);let r=t.next();if(null!==(s=r.done)&&void 0!==s&&s&&void 0!==r.value){const{value:s}=r;return(0,g.isArray)(s)||(0,g.isTypedArray)(s)?s:(0,g.isIterable)(s)?[...s]:(0,u.repeat)(s,e.length)}{const e=[];do{e.push(r.value),r=t.next()}while(null===(n=r.done)||void 0===n||!n);return e}}}n.CustomJSExpr=v,o=v,v.__name__="CustomJSExpr",o.define((({Unknown:e,String:s,Dict:n})=>({args:[n(e),{}],code:[s,""]})))},
function _(t,n,e,o,r){var s;o();const c=t(307),a=t(9);class i extends c.Expression{constructor(t){super(t)}_v_compute(t){var n;const e=null!==(n=t.get_length())&&void 0!==n?n:0,o=new Float64Array(e);for(const n of this.fields){const r=(0,a.dict)(t.data).get(n);if(null!=r){const t=Math.min(e,r.length);for(let n=0;n<t;n++)o[n]+=r[n]}}return o}}e.Stack=i,s=i,i.__name__="Stack",s.define((({String:t,Array:n})=>({fields:[n(t),[]]})))},
function _(e,n,t,o,r){var i;o();const l=e(307);class u extends l.Expression{constructor(e){super(e)}_v_compute(e){var n;const t=new Float64Array(null!==(n=e.get_length())&&void 0!==n?n:0),o=e.data[this.field],r=this.include_zero?1:0;t[0]=this.include_zero?0:o[0];for(let e=1;e<t.length;e++)t[e]=t[e-1]+o[e-r];return t}}t.CumSum=u,i=u,u.__name__="CumSum",i.define((({Boolean:e,String:n})=>({field:[n],include_zero:[e,!1]})))},
function _(i,n,t,e,a){var r;e();const s=i(307),c=i(9),m=i(10);class u extends s.ScalarExpression{constructor(i){super(i)}_compute(i){var n;const t=null!==(n=(0,c.dict)(i.data).get(this.field))&&void 0!==n?n:[];return Math.min(this.initial,(0,m.min)(t))}}t.Minimum=u,r=u,u.__name__="Minimum",r.define((({Number:i,String:n})=>({field:[n],initial:[i,1/0]})))},
function _(i,t,a,n,e){var r;n();const s=i(307),c=i(9),m=i(10);class u extends s.ScalarExpression{constructor(i){super(i)}_compute(i){var t;const a=null!==(t=(0,c.dict)(i.data).get(this.field))&&void 0!==t?t:[];return Math.max(this.initial,(0,m.max)(a))}}a.Maximum=u,r=u,u.__name__="Maximum",r.define((({Number:i,String:t})=>({field:[t],initial:[i,-1/0]})))},
function _(n,e,t,o,r){var s;o();const _=n(307);class m extends _.Expression{constructor(n){super(n)}get x(){return new c({transform:this})}get y(){return new u({transform:this})}}t.CoordinateTransform=m,m.__name__="CoordinateTransform";class a extends _.Expression{constructor(n){super(n)}}t.XYComponent=a,s=a,a.__name__="XYComponent",s.define((({Ref:n})=>({transform:[n(m)]})));class c extends a{constructor(n){super(n)}_v_compute(n){return this.transform.v_compute(n).x}}t.XComponent=c,c.__name__="XComponent";class u extends a{constructor(n){super(n)}_v_compute(n){return this.transform.v_compute(n).y}}t.YComponent=u,u.__name__="YComponent"},
function _(r,t,e,n,o){var i;n();const a=r(1),s=r(313),c=r(20),l=a.__importStar(r(18));class d extends s.CoordinateTransform{constructor(r){super(r)}_v_compute(r){const t=this.properties.radius.uniform(r),e=this.properties.angle.uniform(r),n="anticlock"==this.direction?-1:1,o=Math.min(t.length,e.length),i=new Float64Array(o),a=new Float64Array(o);for(let r=0;r<o;r++){const o=t.get(r),s=e.get(r)*n;i[r]=o*Math.cos(s),a[r]=o*Math.sin(s)}return{x:i,y:a}}}e.PolarTransform=d,i=d,d.__name__="PolarTransform",i.define((({})=>({radius:[l.DistanceSpec,{field:"radius"}],angle:[l.AngleSpec,{field:"angle"}],direction:[c.Direction,"anticlock"]})))},
function _(e,i,r,t,l){t(),l("BooleanFilter",e(316).BooleanFilter),l("CustomJSFilter",e(317).CustomJSFilter),l("Filter",e(221).Filter),l("GroupFilter",e(318).GroupFilter),l("IndexFilter",e(319).IndexFilter),l("AllIndices",e(222).AllIndices),l("InversionFilter",e(320).InversionFilter),l("IntersectionFilter",e(223).IntersectionFilter),l("UnionFilter",e(321).UnionFilter),l("DifferenceFilter",e(322).DifferenceFilter),l("SymmetricDifferenceFilter",e(323).SymmetricDifferenceFilter)},
function _(e,l,n,o,s){var t;o();const a=e(221),r=e(24);class i extends a.Filter{constructor(e){super(e)}compute_indices(e){var l;const n=null!==(l=e.get_length())&&void 0!==l?l:1,{booleans:o}=this;return null==o?r.Indices.all_set(n):r.Indices.from_booleans(n,o)}}n.BooleanFilter=i,t=i,i.__name__="BooleanFilter",t.define((({Boolean:e,Array:l,Nullable:n})=>({booleans:[n(l(e)),null]})))},
function _(e,n,r,s,t){var i;s();const o=e(221),u=e(24),c=e(9),a=e(8),l=e(40);class f extends o.Filter{constructor(e){super(e)}get names(){return(0,c.keys)(this.args)}get values(){return(0,c.values)(this.args)}get func(){const e=(0,l.use_strict)(this.code);return new Function(...this.names,"source",e)}compute_indices(e){var n;const r=null!==(n=e.get_length())&&void 0!==n?n:1,s=this.func(...this.values,e);if(null==s)return u.Indices.all_set(r);if((0,a.isArrayOf)(s,a.isInteger))return u.Indices.from_indices(r,s);if((0,a.isArrayOf)(s,a.isBoolean))return u.Indices.from_booleans(r,s);throw new Error(`expect an array of integers or booleans, or null, got ${s}`)}}r.CustomJSFilter=f,i=f,f.__name__="CustomJSFilter",i.define((({Unknown:e,String:n,Dict:r})=>({args:[r(e),{}],code:[n,""]})))},
function _(n,e,t,o,r){var u;o();const s=n(221),i=n(24),l=n(19);class c extends s.Filter{constructor(n){super(n)}compute_indices(n){var e;const t=n.get_column(this.column_name),o=null!==(e=n.get_length())&&void 0!==e?e:1;if(null==t)return l.logger.warn(`${this}: groupby column '${this.column_name}' not found in the data source`),i.Indices.all_set(o);{const n=new i.Indices(o,0);for(let e=0;e<n.size;e++)t[e]===this.group&&n.set(e);return n}}}t.GroupFilter=c,u=c,c.__name__="GroupFilter",u.define((({String:n})=>({column_name:[n],group:[n]})))},
function _(e,n,i,l,t){var s;l();const c=e(221),r=e(24);class d extends c.Filter{constructor(e){super(e)}compute_indices(e){var n;const i=null!==(n=e.get_length())&&void 0!==n?n:1,{indices:l}=this;return null==l?r.Indices.all_set(i):r.Indices.from_indices(i,l)}}i.IndexFilter=d,s=d,d.__name__="IndexFilter",s.define((({Int:e,Arrayable:n,Nullable:i})=>({indices:[i(n(e)),null]})))},
function _(e,n,r,t,i){var s;t();const o=e(221);class c extends o.Filter{constructor(e){super(e)}compute_indices(e){const n=this.operand.compute_indices(e);return n.invert(),n}}r.InversionFilter=c,s=c,c.__name__="InversionFilter",s.define((({Ref:e})=>({operand:[e(o.Filter)]})))},
function _(n,e,t,r,o){var s;r();const i=n(221),c=n(24);class l extends i.Filter{constructor(n){super(n)}compute_indices(n){var e;const{operands:t}=this;if(0==t.length){const t=null!==(e=n.get_length())&&void 0!==e?e:1;return c.Indices.all_set(t)}{const[e,...r]=t.map((e=>e.compute_indices(n)));for(const n of r)e.add(n);return e}}}t.UnionFilter=l,s=l,l.__name__="UnionFilter",s.define((({Array:n,Ref:e})=>({operands:[n(e(i.Filter))]})))},
function _(e,t,n,r,s){var c;r();const i=e(221),o=e(24);class l extends i.Filter{constructor(e){super(e)}compute_indices(e){var t;const{operands:n}=this;if(0==n.length){const n=null!==(t=e.get_length())&&void 0!==t?t:1;return o.Indices.all_set(n)}{const[t,...r]=n.map((t=>t.compute_indices(e)));for(const e of r)t.subtract(e);return t}}}n.DifferenceFilter=l,c=l,l.__name__="DifferenceFilter",c.define((({Array:e,Ref:t})=>({operands:[e(t(i.Filter))]})))},
function _(e,t,r,n,c){var i;n();const s=e(221),o=e(24);class l extends s.Filter{constructor(e){super(e)}compute_indices(e){var t;const{operands:r}=this;if(0==r.length){const r=null!==(t=e.get_length())&&void 0!==t?t:1;return o.Indices.all_set(r)}{const[t,...n]=r.map((t=>t.compute_indices(e)));for(const e of n)t.symmetric_subtract(e);return t}}}r.SymmetricDifferenceFilter=l,i=l,l.__name__="SymmetricDifferenceFilter",i.define((({Array:e,Ref:t})=>({operands:[e(t(s.Filter))]})))},
function _(e,a,t,r,i){r(),i("AnnularWedge",e(325).AnnularWedge),i("Annulus",e(326).Annulus),i("Arc",e(327).Arc),i("Bezier",e(328).Bezier),i("Block",e(330).Block),i("Circle",e(332).Circle),i("Ellipse",e(333).Ellipse),i("Glyph",e(205).Glyph),i("HArea",e(217).HArea),i("HAreaStep",e(214).HAreaStep),i("HBar",e(335).HBar),i("HSpan",e(336).HSpan),i("HStrip",e(337).HStrip),i("HexTile",e(338).HexTile),i("Image",e(339).Image),i("ImageRGBA",e(341).ImageRGBA),i("ImageStack",e(342).ImageStack),i("ImageURL",e(343).ImageURL),i("Line",e(203).Line),i("MultiLine",e(344).MultiLine),i("MultiPolygons",e(345).MultiPolygons),i("Patch",e(213).Patch),i("Patches",e(346).Patches),i("Quad",e(347).Quad),i("Quadratic",e(348).Quadratic),i("Ray",e(349).Ray),i("Rect",e(350).Rect),i("Scatter",e(351).Scatter),i("Segment",e(354).Segment),i("Spline",e(355).Spline),i("Step",e(357).Step),i("Text",e(358).Text),i("VArea",e(219).VArea),i("VAreaStep",e(218).VAreaStep),i("VBar",e(359).VBar),i("VSpan",e(360).VSpan),i("VStrip",e(361).VStrip),i("Wedge",e(362).Wedge)},
function _(e,t,s,i,r){var n;i();const a=e(1),_=e(204),o=e(211),d=e(78),h=e(24),l=e(20),u=a.__importStar(e(18)),c=e(11),g=e(103),p=e(13);class x extends _.XYGlyphView{async load_glglyph(){const{AnnularWedgeGL:t}=await Promise.resolve().then((()=>a.__importStar(e(530))));return t}_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,p.max)(this.souter_radius)}_render(e,t,s){const{sx:i,sy:r,start_angle:n,end_angle:a,sinner_radius:_,souter_radius:o}=null!=s?s:this,d="anticlock"==this.model.direction;for(const s of t){const t=i[s],h=r[s],l=_[s],u=o[s],c=n.get(s),g=a.get(s);if(!isFinite(t+h+l+u+c+g))continue;const p=g-c;e.translate(t,h),e.rotate(c),e.beginPath(),e.moveTo(u,0),e.arc(0,0,u,0,p,d),e.rotate(p),e.lineTo(l,0),e.arc(0,0,l,0,-p,!d),e.closePath(),e.rotate(-p-c),e.translate(-t,-h),this.visuals.fill.apply(e,s),this.visuals.hatch.apply(e,s),this.visuals.line.apply(e,s)}}_hit_point(e){const{sx:t,sy:s}=e,i=this.renderer.xscale.invert(t),r=this.renderer.yscale.invert(s),n=t-this.max_souter_radius,a=t+this.max_souter_radius,[_,o]=this.renderer.xscale.r_invert(n,a),d=s-this.max_souter_radius,h=s+this.max_souter_radius,[l,u]=this.renderer.yscale.r_invert(d,h),p=[];for(const e of this.index.indices({x0:_,x1:o,y0:l,y1:u})){const t=this.souter_radius[e]**2,s=this.sinner_radius[e]**2,[n,a]=this.renderer.xscale.r_compute(i,this._x[e]),[_,o]=this.renderer.yscale.r_compute(r,this._y[e]),d=(n-a)**2+(_-o)**2;d<=t&&d>=s&&p.push(e)}const x="anticlock"==this.model.direction,m=[];for(const e of p){const i=Math.atan2(s-this.sy[e],t-this.sx[e]);(Math.abs(this.start_angle.get(e)-this.end_angle.get(e))>=2*Math.PI||(0,c.angle_between)(-i,-this.start_angle.get(e),-this.end_angle.get(e),x))&&m.push(e)}return new g.Selection({indices:m})}draw_legend_for_index(e,t,s){(0,o.generic_area_vector_legend)(this.visuals,e,t,s)}scenterxy(e){const t=(this.sinner_radius[e]+this.souter_radius[e])/2,s=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+t*Math.cos(s),this.sy[e]+t*Math.sin(s)]}}s.AnnularWedgeView=x,x.__name__="AnnularWedgeView";class m extends _.XYGlyph{constructor(e){super(e)}}s.AnnularWedge=m,n=m,m.__name__="AnnularWedge",n.prototype.default_view=x,n.mixins([d.LineVector,d.FillVector,d.HatchVector]),n.define((({})=>({direction:[l.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 _(s,e,r,i,t){var n;i();const a=s(1),u=s(204),_=s(24),o=s(78),d=a.__importStar(s(18)),h=s(103);class c extends u.XYGlyphView{async load_glglyph(){const{AnnulusGL:e}=await Promise.resolve().then((()=>a.__importStar(s(537))));return e}_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,_.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,_.to_screen)(this.outer_radius)}_render(s,e,r){const{sx:i,sy:t,sinner_radius:n,souter_radius:a}=null!=r?r:this;for(const r of e){const e=i[r],u=t[r],_=n[r],o=a[r];isFinite(e+u+_+o)&&(s.beginPath(),s.arc(e,u,_,0,2*Math.PI,!0),s.moveTo(e+o,u),s.arc(e,u,o,2*Math.PI,0,!1),this.visuals.fill.apply(s,r),this.visuals.hatch.apply(s,r),this.visuals.line.apply(s,r))}}_hit_point(s){const{sx:e,sy:r}=s,i=this.renderer.xscale.invert(e),t=this.renderer.yscale.invert(r);let n,a,u,_;if("data"==this.model.properties.outer_radius.units)n=i-this.max_outer_radius,u=i+this.max_outer_radius,a=t-this.max_outer_radius,_=t+this.max_outer_radius;else{const s=e-this.max_outer_radius,i=e+this.max_outer_radius;[n,u]=this.renderer.xscale.r_invert(s,i);const t=r-this.max_outer_radius,o=r+this.max_outer_radius;[a,_]=this.renderer.yscale.r_invert(t,o)}const o=[];for(const s of this.index.indices({x0:n,x1:u,y0:a,y1:_})){const e=this.souter_radius[s]**2,r=this.sinner_radius[s]**2,[n,a]=this.renderer.xscale.r_compute(i,this._x[s]),[u,_]=this.renderer.yscale.r_compute(t,this._y[s]),d=(n-a)**2+(u-_)**2;d<=e&&d>=r&&o.push(s)}return new h.Selection({indices:o})}draw_legend_for_index(s,{x0:e,y0:r,x1:i,y1:t},n){const a=n+1,u=new Array(a);u[n]=(e+i)/2;const _=new Array(a);_[n]=(r+t)/2;const o=.5*Math.min(Math.abs(i-e),Math.abs(t-r)),d=new Array(a);d[n]=.4*o;const h=new Array(a);h[n]=.8*o,this._render(s,[n],{sx:u,sy:_,sinner_radius:d,souter_radius:h})}}r.AnnulusView=c,c.__name__="AnnulusView";class l extends u.XYGlyph{constructor(s){super(s)}}r.Annulus=l,n=l,l.__name__="Annulus",n.prototype.default_view=c,n.mixins([o.LineVector,o.FillVector,o.HatchVector]),n.define((({})=>({inner_radius:[d.DistanceSpec,{field:"inner_radius"}],outer_radius:[d.DistanceSpec,{field:"outer_radius"}]})))},
function _(e,s,t,i,n){var r;i();const a=e(1),o=e(204),d=e(211),c=e(78),l=e(24),_=e(20),h=a.__importStar(e(18));class u extends o.XYGlyphView{_map_data(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,l.to_screen)(this.radius)}_render(e,s,t){if(!this.visuals.line.doit)return;const{sx:i,sy:n,sradius:r,start_angle:a,end_angle:o}=null!=t?t:this,d="anticlock"==this.model.direction;for(const t of s){const s=i[t],c=n[t],l=r[t],_=a.get(t),h=o.get(t);isFinite(s+c+l+_+h)&&(this._render_decorations(e,t,s,c,l,_,h,d),e.beginPath(),e.arc(s,c,l,_,h,d),this.visuals.line.apply(e,t))}}_render_decorations(e,s,t,i,n,r,a,o){const{sin:d,cos:c,PI:l}=Math;for(const o of this.decorations.values()){if(e.save(),"start"==o.model.node){const s=n*c(r)+t,a=n*d(r)+i;e.translate(s,a),e.rotate(r+l)}else if("end"==o.model.node){const s=n*Math.cos(a)+t,r=n*Math.sin(a)+i;e.translate(s,r),e.rotate(a)}o.marking.render(e,s),e.restore()}}draw_legend_for_index(e,s,t){(0,d.generic_line_vector_legend)(this.visuals,e,s,t)}}t.ArcView=u,u.__name__="ArcView";class g extends o.XYGlyph{constructor(e){super(e)}}t.Arc=g,r=g,g.__name__="Arc",r.prototype.default_view=u,r.mixins(c.LineVector),r.define((({})=>({direction:[_.Direction,"anticlock"],radius:[h.DistanceSpec,{field:"radius"}],start_angle:[h.AngleSpec,{field:"start_angle"}],end_angle:[h.AngleSpec,{field:"end_angle"}]})))},
function _(e,i,t,c,s){var n;c();const o=e(1),r=e(78),_=e(205),d=e(211),a=e(107),l=e(329),x=o.__importStar(e(18));class y extends _.GlyphView{_project_data(){a.inplace.project_xy(this._x0,this._y0),a.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{data_size:i,_x0:t,_y0:c,_x1:s,_y1:n,_cx0:o,_cy0:r,_cx1:_,_cy1:d}=this;for(let a=0;a<i;a++){const i=t[a],x=c[a],y=s[a],p=n[a],f=o[a],h=r[a],u=_[a],C=d[a];if(isFinite(i+y+x+p+f+h+u+C)){const{x0:t,y0:c,x1:s,y1:n}=(0,l.cbb)(i,x,f,h,u,C,y,p);e.add_rect(t,c,s,n)}else e.add_empty()}}_render(e,i,t){if(!this.visuals.line.doit)return;const{sx0:c,sy0:s,sx1:n,sy1:o,scx0:r,scy0:_,scx1:d,scy1:a}=null!=t?t:this;for(const t of i){const i=c[t],l=s[t],x=n[t],y=o[t],p=r[t],f=_[t],h=d[t],u=a[t];isFinite(i+l+x+y+p+f+h+u)&&(e.beginPath(),e.moveTo(i,l),e.bezierCurveTo(p,f,h,u,x,y),this.visuals.line.apply(e,t))}}draw_legend_for_index(e,i,t){(0,d.generic_line_vector_legend)(this.visuals,e,i,t)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}t.BezierView=y,y.__name__="BezierView";class p extends _.Glyph{constructor(e){super(e)}}t.Bezier=p,n=p,p.__name__="Bezier",n.prototype.default_view=y,n.define((({})=>({x0:[x.XCoordinateSpec,{field:"x0"}],y0:[x.YCoordinateSpec,{field:"y0"}],x1:[x.XCoordinateSpec,{field:"x1"}],y1:[x.YCoordinateSpec,{field:"y1"}],cx0:[x.XCoordinateSpec,{field:"cx0"}],cy0:[x.YCoordinateSpec,{field:"cy0"}],cx1:[x.XCoordinateSpec,{field:"cx1"}],cy1:[x.YCoordinateSpec,{field:"cy1"}]}))),n.mixins(r.LineVector)},
function _(n,t,o,c,s){c();const r=n(13),{abs:u,sqrt:e,min:i,max:f}=Math;o.qbb=function(n,t,o,c,s,r){function u(n,t,o){if(t==(n+o)/2)return[n,o];{const c=(n-t)/(n-2*t+o),s=n*(1-c)**2+2*t*(1-c)*c+o*c**2;return[i(n,o,s),f(n,o,s)]}}const[e,a]=u(n,o,s),[x,y]=u(t,c,r);return{x0:e,x1:a,y0:x,y1:y}},o.cbb=function(n,t,o,c,s,i,f,a){const x=f,y=a;f=o,a=c;const b=s,h=i,l=[];for(let o=0;o<=2;o++){let c,s,r;if(0==o?(s=6*n-12*f+6*b,c=-3*n+9*f-9*b+3*x,r=3*f-3*n):(s=6*t-12*a+6*h,c=-3*t+9*a-9*h+3*y,r=3*a-3*t),u(c)<1e-12){if(u(s)<1e-12)continue;const n=-r/s;0<n&&n<1&&l.push(n);continue}const i=s**2-4*r*c,m=e(i);if(i<0)continue;const p=(-s+m)/(2*c);0<p&&p<1&&l.push(p);const q=(-s-m)/(2*c);0<q&&q<1&&l.push(q)}const m=l.length;let p=m;const q=Array(m+2),A=Array(m+2);for(;p-- >0;){const o=l[p],c=1-o,s=c**3*n+3*c**2*o*f+3*c*o**2*b+o**3*x,r=c**3*t+3*c**2*o*a+3*c*o**2*h+o**3*y;q[p]=s,A[p]=r}q[m]=n,A[m]=t,q[m+1]=x,A[m+1]=y;const[g,M,_,d]=(0,r.minmax2)(q,A);return{x0:g,x1:M,y0:_,y1:d}}},
function _(t,e,s,i,h){var r;i();const n=t(1),o=t(331),a=t(24),c=n.__importStar(t(18));class _ extends o.LRTBView{scenterxy(t){return[this.sleft[t]/2+this.sright[t]/2,this.stop[t]/2+this.sbottom[t]/2]}_lrtb(t){const e=this._x[t],s=this._y[t],i=this.width.get(t),h=this.height.get(t);return[Math.min(e,e+i),Math.max(e,e+i),Math.max(s,s+h),Math.min(s,s+h)]}_map_data(){const t=this.renderer.xscale.v_compute(this._x),e=this.renderer.yscale.v_compute(this._y),s=this.sdist(this.renderer.xscale,this._x,this.width,"edge"),i=this.sdist(this.renderer.yscale,this._y,this.height,"edge"),h=t.length;this.stop=new a.ScreenArray(h),this.sbottom=new a.ScreenArray(h),this.sleft=new a.ScreenArray(h),this.sright=new a.ScreenArray(h);for(let r=0;r<h;r++)this.stop[r]=e[r]-i[r],this.sbottom[r]=e[r],this.sleft[r]=t[r],this.sright[r]=t[r]+s[r];this._clamp_viewport()}}s.BlockView=_,_.__name__="BlockView";class l extends o.LRTB{constructor(t){super(t)}}s.Block=l,r=l,l.__name__="Block",r.prototype.default_view=_,r.define((({})=>({x:[c.XCoordinateSpec,{field:"x"}],y:[c.YCoordinateSpec,{field:"y"}],width:[c.NumberSpec,{value:1}],height:[c.NumberSpec,{value:1}]})))},
function _(t,e,r,s,i){var n;s();const a=t(1),o=t(78),h=t(205),c=t(211),_=t(103),l=t(57),d=t(238),x=a.__importStar(t(240)),m=t(239);class p extends h.GlyphView{async load_glglyph(){const{LRTBGL:e}=await Promise.resolve().then((()=>a.__importStar(t(544))));return e}get_anchor_point(t,e,r){const s=Math.min(this.sleft[e],this.sright[e]),i=Math.max(this.sright[e],this.sleft[e]),n=Math.min(this.stop[e],this.sbottom[e]),a=Math.max(this.sbottom[e],this.stop[e]);switch(t){case"top_left":return{x:s,y:n};case"top":case"top_center":return{x:(s+i)/2,y:n};case"top_right":return{x:i,y:n};case"bottom_left":return{x:s,y:a};case"bottom":case"bottom_center":return{x:(s+i)/2,y:a};case"bottom_right":return{x:i,y:a};case"left":case"center_left":return{x:s,y:(n+a)/2};case"center":case"center_center":return{x:(s+i)/2,y:(n+a)/2};case"right":case"center_right":return{x:i,y:(n+a)/2}}}_set_data(t){super._set_data(t),this.border_radius=x.border_radius(this.model.border_radius)}_index_data(t){const{min:e,max:r}=Math,{data_size:s}=this;for(let i=0;i<s;i++){const[s,n,a,o]=this._lrtb(i);t.add_rect(e(s,n),e(a,o),r(n,s),r(a,o))}}_render(t,e,r){const{sleft:s,sright:i,stop:n,sbottom:a,border_radius:o}=null!=r?r:this;for(const r of e){const e=s[r],h=n[r],c=i[r],_=a[r];if(!isFinite(e+h+c+_))continue;t.beginPath();const d=l.BBox.from_lrtb({left:e,right:c,top:h,bottom:_});(0,m.round_rect)(t,d,o),this.visuals.fill.apply(t,r),this.visuals.hatch.apply(t,r),this.visuals.line.apply(t,r)}}_clamp_viewport(){const t=this.renderer.plot_view.frame.bbox.h_range,e=this.renderer.plot_view.frame.bbox.v_range,r=this.stop.length;for(let s=0;s<r;s++)this.stop[s]=Math.max(this.stop[s],e.start),this.sbottom[s]=Math.min(this.sbottom[s],e.end),this.sleft[s]=Math.max(this.sleft[s],t.start),this.sright[s]=Math.min(this.sright[s],t.end)}_hit_rect(t){return this._hit_rect_against_index(t)}_hit_point(t){const{sx:e,sy:r}=t,s=this.renderer.xscale.invert(e),i=this.renderer.yscale.invert(r),n=[...this.index.indices({x0:s,y0:i,x1:s,y1:i})];return new _.Selection({indices:n})}_hit_span(t){const{sx:e,sy:r}=t;let s;if("v"==t.direction){const t=this.renderer.yscale.invert(r),e=this.renderer.plot_view.frame.bbox.h_range,[i,n]=this.renderer.xscale.r_invert(e.start,e.end);s=[...this.index.indices({x0:i,y0:t,x1:n,y1:t})]}else{const t=this.renderer.xscale.invert(e),r=this.renderer.plot_view.frame.bbox.v_range,[i,n]=this.renderer.yscale.r_invert(r.start,r.end);s=[...this.index.indices({x0:t,y0:i,x1:t,y1:n})]}return new _.Selection({indices:s})}draw_legend_for_index(t,e,r){(0,c.generic_area_vector_legend)(this.visuals,t,e,r)}}r.LRTBView=p,p.__name__="LRTBView";class u extends h.Glyph{constructor(t){super(t)}}r.LRTB=u,n=u,u.__name__="LRTB",n.mixins([o.LineVector,o.FillVector,o.HatchVector]),n.define((()=>({border_radius:[d.BorderRadius,0]})))},
function _(s,i,e,t,r){var a;t();const n=s(1),d=s(204),h=s(78),c=s(24),_=s(20),o=n.__importStar(s(212)),u=n.__importStar(s(18)),l=n.__importStar(s(39)),x=s(13),y=s(103);class p extends d.XYGlyphView{async load_glglyph(){const{CircleGL:i}=await Promise.resolve().then((()=>n.__importStar(s(539))));return i}get use_radius(){return!(this.radius.is_Scalar()&&isNaN(this.radius.value))}_set_data(s){super._set_data(s);const i=this.use_radius?2*this.max_radius:l.max(this.size);this._configure("max_size",{value:i})}_index_data(s){if(this.use_radius){const{_x:i,_y:e,radius:t,data_size:r}=this;for(let a=0;a<r;a++){const r=i[a],n=e[a],d=t.get(a);s.add_rect(r-d,n-d,r+d,n+d)}}else super._index_data(s)}_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 s=this.sdist(this.renderer.xscale,this._x,this.radius),i=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,x.map)(s,((s,e)=>Math.max(s,i[e])));break}case"min":{const s=this.sdist(this.renderer.xscale,this._x,this.radius),i=this.sdist(this.renderer.yscale,this._y,this.radius);this.sradius=(0,x.map)(s,((s,e)=>Math.min(s,i[e])));break}}else this.sradius=(0,c.to_screen)(this.radius);else{const s=c.ScreenArray.from(this.size);this.sradius=(0,x.map)(s,(s=>s/2))}}_mask_data(){const{frame:s}=this.renderer.plot_view,i=s.x_target,e=s.y_target;let t,r;return this.use_radius&&"data"==this.model.properties.radius.units?(t=i.map((s=>this.renderer.xscale.invert(s))).widen(this.max_radius),r=e.map((s=>this.renderer.yscale.invert(s))).widen(this.max_radius)):(t=i.widen(this.max_size).map((s=>this.renderer.xscale.invert(s))),r=e.widen(this.max_size).map((s=>this.renderer.yscale.invert(s)))),this.index.indices({x0:t.start,x1:t.end,y0:r.start,y1:r.end})}_render(s,i,e){const{sx:t,sy:r,sradius:a}=null!=e?e:this;for(const e of i){const i=t[e],n=r[e],d=a[e];isFinite(i+n+d)&&(s.beginPath(),s.arc(i,n,d,0,2*Math.PI,!1),this.visuals.fill.apply(s,e),this.visuals.hatch.apply(s,e),this.visuals.line.apply(s,e))}}_hit_point(s){const{sx:i,sy:e}=s,t=this.renderer.xscale.invert(i),r=this.renderer.yscale.invert(e),{hit_dilation:a}=this.model,[n,d,h,c]=(()=>{if(this.use_radius&&"data"==this.model.properties.radius.units){const s=this.max_radius*a;return[t-s,t+s,r-s,r+s]}{const s=this.max_size*a,t=i-s,r=i+s,n=e-s,d=e+s,[h,c]=this.renderer.xscale.r_invert(t,r),[_,o]=this.renderer.yscale.r_invert(n,d);return[h,c,_,o]}})(),_=this.index.indices({x0:n,x1:d,y0:h,y1:c}),o=[];if(this.use_radius&&"data"==this.model.properties.radius.units)for(const s of _){const i=(this.sradius[s]*a)**2,[e,n]=this.renderer.xscale.r_compute(t,this._x[s]),[d,h]=this.renderer.yscale.r_compute(r,this._y[s]);(e-n)**2+(d-h)**2<=i&&o.push(s)}else for(const s of _){const t=(this.sradius[s]*a)**2;(this.sx[s]-i)**2+(this.sy[s]-e)**2<=t&&o.push(s)}return new y.Selection({indices:o})}_hit_span(s){const{sx:i,sy:e}=s,t=this.bounds(),[r,a,n,d]=(()=>{const r=this.use_radius&&"data"==this.model.properties.radius.units?this.max_radius:this.max_size/2;if("h"==s.direction){const s=i-r,e=i+r,[a,n]=this.renderer.xscale.r_invert(s,e),{y0:d,y1:h}=t;return[a,n,d,h]}{const s=e-r,i=e+r,{x0:a,x1:n}=t,[d,h]=this.renderer.yscale.r_invert(s,i);return[a,n,d,h]}})(),h=[...this.index.indices({x0:r,x1:a,y0:n,y1:d})];return new y.Selection({indices:h})}_hit_rect(s){const{sx0:i,sx1:e,sy0:t,sy1:r}=s,[a,n]=this.renderer.xscale.r_invert(i,e),[d,h]=this.renderer.yscale.r_invert(t,r),c=this.index.indices({x0:a,x1:n,y0:d,y1:h}),_=[];for(const s of c){const a=this.sx[s],n=this.sy[s];i<=a&&a<=e&&t<=n&&n<=r&&_.push(s)}return new y.Selection({indices:_})}_hit_poly(s){const{sx:i,sy:e}=s,t=(()=>{const[s,t,r,a]=(0,x.minmax2)(i,e),[n,d]=this.renderer.xscale.r_invert(s,t),[h,c]=this.renderer.yscale.r_invert(r,a);return this.index.indices({x0:n,x1:d,y0:h,y1:c})})(),r=[];for(const s of t)o.point_in_poly(this.sx[s],this.sy[s],i,e)&&r.push(s);return new y.Selection({indices:r})}draw_legend_for_index(s,{x0:i,y0:e,x1:t,y1:r},a){const n=a+1,d=new Array(n);d[a]=(i+t)/2;const h=new Array(n);h[a]=(e+r)/2;const c=new Array(n);c[a]=.2*Math.min(Math.abs(t-i),Math.abs(r-e)),this._render(s,[a],{sx:d,sy:h,sradius:c})}}e.CircleView=p,p.__name__="CircleView";class m extends d.XYGlyph{constructor(s){super(s)}}e.Circle=m,a=m,m.__name__="Circle",a.prototype.default_view=p,a.mixins([h.LineVector,h.FillVector,h.HatchVector]),a.define((({Number:s})=>({angle:[u.AngleSpec,0],size:[u.ScreenSizeSpec,{value:4}],radius:[u.NullDistanceSpec,null],radius_dimension:[_.RadiusDimension,"x"],hit_dilation:[s,1]})))},
function _(t,s,e,i,h){var r;i();const n=t(1),a=t(334),l=n.__importStar(t(212)),o=t(24),_=t(103),d=n.__importStar(t(18));class c extends a.CenterRotatableView{_map_data(){"data"==this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this.width,"center"):this.sw=(0,o.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,o.to_screen)(this.height)}_render(t,s,e){const{sx:i,sy:h,sw:r,sh:n,angle:a}=null!=e?e:this;for(const e of s){const s=i[e],l=h[e],o=r[e],_=n[e],d=a.get(e);isFinite(s+l+o+_+d)&&(t.beginPath(),t.ellipse(s,l,o/2,_/2,d,0,2*Math.PI),this.visuals.fill.apply(t,e),this.visuals.hatch.apply(t,e),this.visuals.line.apply(t,e))}}_hit_point(t){let s,e,i,h,r,n,a,o,d;const{sx:c,sy:p}=t,w=this.renderer.xscale.invert(c),x=this.renderer.yscale.invert(p);"data"==this.model.properties.width.units?(s=w-this.max_width,e=w+this.max_width):(n=c-this.max_width,a=c+this.max_width,[s,e]=this.renderer.xscale.r_invert(n,a)),"data"==this.model.properties.height.units?(i=x-this.max_height,h=x+this.max_height):(o=p-this.max_height,d=p+this.max_height,[i,h]=this.renderer.yscale.r_invert(o,d));const y=this.index.indices({x0:s,x1:e,y0:i,y1:h}),m=[];for(const t of y)r=l.point_in_ellipse(c,p,this.angle.get(t),this.sh[t]/2,this.sw[t]/2,this.sx[t],this.sy[t]),r&&m.push(t);return new _.Selection({indices:m})}draw_legend_for_index(t,{x0:s,y0:e,x1:i,y1:h},r){const n=r+1,a=new Array(n);a[r]=(s+i)/2;const l=new Array(n);l[r]=(e+h)/2;const o=this.sw[r]/this.sh[r],_=.8*Math.min(Math.abs(i-s),Math.abs(h-e)),c=new Array(n),p=new Array(n);o>1?(c[r]=_,p[r]=_/o):(c[r]=_*o,p[r]=_);const w=new d.UniformScalar(0,n);this._render(t,[r],{sx:a,sy:l,sw:c,sh:p,angle:w})}}e.EllipseView=c,c.__name__="EllipseView";class p extends a.CenterRotatable{constructor(t){super(t)}}e.Ellipse=p,r=p,p.__name__="Ellipse",r.prototype.default_view=c},
function _(e,t,i,a,n){var r;a();const s=e(1),h=e(204),o=e(78),_=s.__importStar(e(18));class c extends h.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:a}){const{max_w2:n,max_h2:r}=this;return{x0:e-n,x1:t+n,y0:i-r,y1:a+r}}}i.CenterRotatableView=c,c.__name__="CenterRotatableView";class l extends h.XYGlyph{constructor(e){super(e)}}i.CenterRotatable=l,r=l,l.__name__="CenterRotatable",r.mixins([o.LineVector,o.FillVector,o.HatchVector]),r.define((({})=>({angle:[_.AngleSpec,0],width:[_.DistanceSpec,{field:"width"}],height:[_.DistanceSpec,{field:"height"}]})))},
function _(t,e,s,i,h){var r;i();const a=t(1),n=t(331),_=t(24),o=a.__importStar(t(18));class c extends n.LRTBView{scenterxy(t){return[(this.sleft[t]+this.sright[t])/2,this.sy[t]]}_lrtb(t){const e=this._left[t],s=this._right[t],i=this._y[t],h=this.height.get(t)/2;return[Math.min(e,s),Math.max(e,s),i+h,i-h]}_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 t=this.sy.length;this.stop=new _.ScreenArray(t),this.sbottom=new _.ScreenArray(t);for(let e=0;e<t;e++)this.stop[e]=this.sy[e]-this.sh[e]/2,this.sbottom[e]=this.sy[e]+this.sh[e]/2;this._clamp_viewport()}}s.HBarView=c,c.__name__="HBarView";class l extends n.LRTB{constructor(t){super(t)}}s.HBar=l,r=l,l.__name__="HBar",r.prototype.default_view=c,r.define((({})=>({left:[o.XCoordinateSpec,{value:0}],y:[o.YCoordinateSpec,{field:"y"}],height:[o.NumberSpec,{value:1}],right:[o.XCoordinateSpec,{field:"right"}]})))},
function _(t,e,n,i,s){var r;i();const _=t(1),a=t(205),o=t(211),d=t(103),c=t(78),h=_.__importStar(t(39)),l=t(13),p=t(10),u=_.__importStar(t(18)),{abs:y,max:f}=Math;class x extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._y)t.add_point(0,e)}_bounds(t){const{y0:e,y1:n}=t;return{x0:NaN,x1:NaN,y0:e,y1:n}}_map_data(){super._map_data();const{round:t}=Math;this.sy=(0,l.map)(this.sy,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,this.sy[t]]}_render(t,e,n){const{sy:i}=null!=n?n:this,{left:s,right:r}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=i[n];isFinite(e)&&(t.beginPath(),t.moveTo(s,e),t.lineTo(r,e),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[i,s]=this.renderer.yscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:0,x1:0,y0:i,y1:s})}_find_spans(t,e){const{sy:n,line_width:i}=this,s=[];for(const r of t){e(n[r],i.get(r))&&s.push(r)}return s}_hit_point(t){const{sy:e}=t,n=this._get_candidates(e),i=this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)));return new d.Selection({indices:i})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,p.range)(0,this.data_size);{const{sy:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>y(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:n}=t,i=this._get_candidates(e,n);return this._find_spans(i,((t,i)=>e-i/2<=t&&t<=n+i/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.HSpanView=x,x.__name__="HSpanView";class m extends a.Glyph{constructor(t){super(t)}}n.HSpan=m,r=m,m.__name__="HSpan",r.prototype.default_view=x,r.mixins([c.LineVector]),r.define((()=>({y:[u.YCoordinateSpec,{field:"y"}]})))},
function _(t,e,i,s,r){var n;s();const a=t(1),_=t(205),o=t(211),h=t(103),c=t(78),l=t(24),d=t(13),p=a.__importStar(t(34)),y=t(10),u=a.__importStar(t(18));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(544))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){const{left:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new l.ScreenArray(e);return i.fill(t),i}get sright(){const{right:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new l.ScreenArray(e);return i.fill(t),i}get stop(){return this.sy0}get sbottom(){return this.sy1}_set_data(t){super._set_data(t);const{abs:e}=Math,{max:i,map:s,zip:r}=p,{_y0:n,_y1:a}=this;this.max_height=i(s(r(n,a),(([t,i])=>e(t-i))))}_index_data(t){const{_y0:e,_y1:i,data_size:s}=this;for(let r=0;r<s;r++){const s=e[r],n=i[r];t.add_rect(0,s,0,n)}}_bounds(t){const{y0:e,y1:i}=t;return{x0:NaN,x1:NaN,y0:e,y1:i}}_map_data(){super._map_data();const{round:t}=Math;this.sy0=(0,d.map)(this.sy0,(e=>t(e))),this.sy1=(0,d.map)(this.sy1,(e=>t(e)))}scenterxy(t){const{hcenter:e}=this.renderer.plot_view.frame.bbox;return[e,(this.sy0[t]+this.sy1[t])/2]}_render(t,e,i){const{sy0:s,sy1:r}=null!=i?i:this,{left:n,right:a,width:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(n,e,_,o-e),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(n,e),t.lineTo(a,e),t.moveTo(n,o),t.lineTo(a,o),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_height:i}=this,[s,r]=this.renderer.yscale.r_invert(t,null!=e?e:t),n=s-i,a=r+i;return this.index.indices({x0:0,x1:0,y0:n,y1:a})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sy0:s,sy1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sy:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new h.Selection({indices:s})}_hit_span(t){const e=(()=>{if("v"==t.direction)return(0,y.range)(0,this.data_size);{const{sy:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new h.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sy0:e,sy1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new h.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.HStripView=f,f.__name__="HStripView";class g extends _.Glyph{constructor(t){super(t)}}i.HStrip=g,n=g,g.__name__="HStrip",n.prototype.default_view=f,n.mixins([c.LineVector,c.FillVector,c.HatchVector]),n.define((()=>({y0:[u.YCoordinateSpec,{field:"y0"}],y1:[u.YCoordinateSpec,{field:"y1"}]})))},
function _(e,t,s,i,r){var n;i();const a=e(1),o=e(205),c=a.__importStar(e(212)),l=a.__importStar(e(18)),h=e(78),_=e(20),d=e(107),p=e(211),x=e(103);class y extends o.GlyphView{async load_glglyph(){const{HexTileGL:t}=await Promise.resolve().then((()=>a.__importStar(e(540))));return t}scenterxy(e){return[this.sx[e],this.sy[e]]}_set_data(){const{orientation:e,size:t,aspect_scale:s}=this.model,{q:i,r}=this,n=this.q.length;this._x=new Float64Array(n),this._y=new Float64Array(n);const{_x:a,_y:o}=this,c=Math.sqrt(3);if("pointytop"==e)for(let e=0;e<n;e++){const n=i.get(e),l=r.get(e)/2;a[e]=t*c*(n+l)/s,o[e]=-3*t*l}else for(let e=0;e<n;e++){const n=i.get(e)/2,l=r.get(e);a[e]=3*t*n,o[e]=-t*c*(l+n)*s}}_project_data(){d.inplace.project_xy(this._x,this._y)}_index_data(e){let t=this.model.size,s=Math.sqrt(3)*t/2;"flattop"==this.model.orientation?([s,t]=[t,s],t*=this.model.aspect_scale):s/=this.model.aspect_scale;const{data_size:i}=this;for(let r=0;r<i;r++){const i=this._x[r],n=this._y[r];e.add_rect(i-s,n-t,i+s,n+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_mapped()}_get_unscaled_vertices(){const e=this.model.size,t=this.model.aspect_scale;if("pointytop"==this.model.orientation){const s=this.renderer.yscale,i=this.renderer.xscale,r=Math.abs(s.compute(0)-s.compute(e)),n=Math.sqrt(3)/2*Math.abs(i.compute(0)-i.compute(e))/t,a=r/2;return[[0,-n,-n,0,n,n],[r,a,-a,-r,-a,a]]}{const s=this.renderer.xscale,i=this.renderer.yscale,r=Math.abs(s.compute(0)-s.compute(e)),n=Math.sqrt(3)/2*Math.abs(i.compute(0)-i.compute(e))*t,a=r/2;return[[r,a,-a,-r,-a,a],[0,-n,-n,0,n,n]]}}_render(e,t,s){const{sx:i,sy:r,svx:n,svy:a,scale:o}=null!=s?s:this;for(const s of t){const t=i[s],c=r[s],l=o.get(s);if(isFinite(t+c+l)){e.translate(t,c),e.beginPath();for(let t=0;t<6;t++)e.lineTo(n[t]*l,a[t]*l);e.closePath(),e.translate(-t,-c),this.visuals.fill.apply(e,s),this.visuals.hatch.apply(e,s),this.visuals.line.apply(e,s)}}}_hit_point(e){const{sx:t,sy:s}=e,i=this.renderer.xscale.invert(t),r=this.renderer.yscale.invert(s),n=this.index.indices({x0:i,y0:r,x1:i,y1:r}),a=[];for(const e of n)c.point_in_poly(t-this.sx[e],s-this.sy[e],this.svx,this.svy)&&a.push(e);return new x.Selection({indices:a})}_hit_span(e){const{sx:t,sy:s}=e;let i;if("v"==e.direction){const e=this.renderer.yscale.invert(s),t=this.renderer.plot_view.frame.bbox.h_range,[r,n]=this.renderer.xscale.r_invert(t.start,t.end);i=[...this.index.indices({x0:r,y0:e,x1:n,y1:e})]}else{const e=this.renderer.xscale.invert(t),s=this.renderer.plot_view.frame.bbox.v_range,[r,n]=this.renderer.yscale.r_invert(s.start,s.end);i=[...this.index.indices({x0:e,y0:r,x1:e,y1:n})]}return new x.Selection({indices:i})}_hit_rect(e){const{sx0:t,sx1:s,sy0:i,sy1:r}=e,[n,a]=this.renderer.xscale.r_invert(t,s),[o,c]=this.renderer.yscale.r_invert(i,r),l=[...this.index.indices({x0:n,x1:a,y0:o,y1:c})];return new x.Selection({indices:l})}draw_legend_for_index(e,t,s){(0,p.generic_area_vector_legend)(this.visuals,e,t,s)}}s.HexTileView=y,y.__name__="HexTileView";class u extends o.Glyph{constructor(e){super(e)}}s.HexTile=u,n=u,u.__name__="HexTile",n.prototype.default_view=y,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((({Number:e})=>({r:[l.NumberSpec,{field:"r"}],q:[l.NumberSpec,{field:"q"}],scale:[l.NumberSpec,1],size:[e,1],aspect_scale:[e,1],orientation:[_.HexTileOrientation,"pointytop"]}))),n.override({line_color:null})},
function _(e,t,a,r,n){var i,o=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&o(t,e,a);return l(t,e),t};r();const _=e(340),c=e(199),u=e(249);class d extends _.ImageBaseView{async load_glglyph(){const{ImageGL:t}=await Promise.resolve().then((()=>s(e(541))));return t}connect_signals(){super.connect_signals(),this.connect(this.model.color_mapper.change,(()=>this._update_image()))}_update_image(){null!=this.glglyph&&this.glglyph.set_image_changed(),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)}}a.ImageView=d,d.__name__="ImageView";class f extends _.ImageBase{constructor(e){super(e)}}a.Image=f,i=f,f.__name__="Image",i.prototype.default_view=d,i.define((({Ref:e})=>({color_mapper:[e(c.ColorMapper),()=>new u.LinearColorMapper({palette:["#000000","#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0","#ffffff"]})]})))},
function _(e,t,s,i,a){var r;i();const n=e(1),h=e(204),_=e(24),o=e(20),d=n.__importStar(e(18)),c=n.__importStar(e(78)),l=e(103),g=e(12),m=e(238),u=e(240);class x extends h.XYGlyphView{constructor(){super(...arguments),this._image_data=null}get image_data(){return(0,g.assert)(null!=this._image_data,"data not set"),this._image_data}connect_signals(){super.connect_signals(),this.connect(this.model.properties.global_alpha.change,(()=>this.renderer.request_render()))}get image_dimension(){return 2}get xy_scale(){switch(this.model.origin){case"bottom_left":return{x:1,y:-1};case"top_left":return{x:1,y:1};case"bottom_right":return{x:-1,y:-1};case"top_right":return{x:-1,y:1}}}get xy_offset(){switch(this.model.origin){case"bottom_left":return{x:0,y:1};case"top_left":return{x:0,y:0};case"bottom_right":return{x:1,y:1};case"top_right":return{x:1,y:0}}}get xy_anchor(){return(0,u.anchor)(this.model.anchor)}get xy_sign(){const e=this.renderer.xscale.source_range,t=this.renderer.yscale.source_range;return{x:e.is_reversed?-1:1,y:t.is_reversed?-1:1}}_render(e,t,s){const{image_data:i,sx:a,sy:r,sw:n,sh:h}=null!=s?s:this,{xy_sign:_,xy_scale:o,xy_offset:d,xy_anchor:c}=this;if(e.save(),e.imageSmoothingEnabled=!1,this.visuals.image.doit)for(const s of t){const t=i[s],l=a[s],g=r[s],m=n[s],u=h[s];if(null==t||!isFinite(l+g+m+u))continue;const x=_.x*c.x*m,y=_.y*c.y*u;e.save(),e.translate(l-x,g-y),e.scale(_.x*o.x,_.y*o.y),this.visuals.image.set_vectorize(e,s),e.drawImage(t,-d.x*m,-d.y*u,m,u),e.restore()}e.restore()}_set_data(e){const t=this.data_size;null!=this._image_data&&this._image_data.length==t||(this._image_data=new Array(t).fill(null),this._width=new Uint32Array(t),this._height=new Uint32Array(t));const{image_dimension:s}=this;for(let i=0;i<t;i++){if(null!=e&&!e.includes(i))continue;const t=this.image.get(i);(0,g.assert)(t.dimension==s,`expected a ${s}D array, not ${t.dimension}D`);const[a,r]=t.shape;this._height[i]=a,this._width[i]=r;const n=this._flat_img_to_buf8(t);this._set_image_data_from_buffer(i,n)}}_index_data(e){const{data_size:t}=this;for(let s=0;s<t;s++){const[t,i,a,r]=this._lrtb(s);e.add_rect(t,r,i,a)}}_lrtb(e){const t=this.dw.get(e),s=this.dh.get(e),i=this._x[e],a=this._y[e],{xy_anchor:r}=this,[n,h]=[i-r.x*t,i+(1-r.x)*t],[_,o]=[a+r.y*s,a-(1-r.y)*s],[d,c]=n<=h?[n,h]:[h,n],[l,g]=_<=o?[_,o]:[o,_];return[d,c,g,l]}_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 s=this._get_or_create_canvas(e),i=s.getContext("2d"),a=i.getImageData(0,0,this._width[e],this._height[e]);a.data.set(t),i.putImageData(a,0,0),this.image_data[e]=s}_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,_.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,_.to_screen)(this.dh)}_image_index(e,t,s){const[i,a,r,n]=this._lrtb(e),h=this._width[e],_=this._height[e],o=(a-i)/h,d=(r-n)/_;let c=Math.floor((t-i)/o),l=Math.floor((s-n)/d);return this.renderer.xscale.source_range.is_reversed&&(c=h-c-1),this.renderer.yscale.source_range.is_reversed&&(l=_-l-1),{index:e,i:c,j:l,flat_index:l*h+c}}_hit_point(e){const{sx:t,sy:s}=e,i=this.renderer.xscale.invert(t),a=this.renderer.yscale.invert(s),r=this.index.indices({x0:i,x1:i,y0:a,y1:a}),n=new l.Selection,h=[];for(const e of r)t!=1/0&&s!=1/0&&(h.push(e),n.image_indices.push(this._image_index(e,i,a)));return n.indices=h,n}}s.ImageBaseView=x,x.__name__="ImageBaseView";class y extends h.XYGlyph{constructor(e){super(e)}}s.ImageBase=y,r=y,y.__name__="ImageBase",r.mixins(c.ImageVector),r.define((({Boolean:e})=>({image:[d.NDArraySpec,{field:"image"}],dw:[d.DistanceSpec,{field:"dw"}],dh:[d.DistanceSpec,{field:"dh"}],dilate:[e,!1],origin:[o.ImageOrigin,"bottom_left"],anchor:[m.Anchor,"bottom_left"]})))},
function _(e,t,r,n,a){var i,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return u(t,e),t};n();const c=e(340),l=e(8);class _ extends c.ImageBaseView{async load_glglyph(){const{ImageGL:t}=await Promise.resolve().then((()=>s(e(541))));return t}_flat_img_to_buf8(e){const t=(0,l.isTypedArray)(e)?e:new Uint32Array(e);return new Uint8ClampedArray(t.buffer)}}r.ImageRGBAView=_,_.__name__="ImageRGBAView";class f extends c.ImageBase{constructor(e){super(e)}}r.ImageRGBA=f,i=f,f.__name__="ImageRGBA",i.prototype.default_view=_},
function _(e,t,a,r,n){var i,o=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(t,a);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,r,n)}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&o(t,e,a);return s(t,e),t};r();const c=e(340),l=e(252);class u extends c.ImageBaseView{async load_glglyph(){const{ImageGL:t}=await Promise.resolve().then((()=>_(e(541))));return t}connect_signals(){super.connect_signals(),this.connect(this.model.color_mapper.change,(()=>this._update_image()))}get image_dimension(){return 3}_update_image(){null!=this.glglyph&&this.glglyph.set_image_changed(),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)}}a.ImageStackView=u,u.__name__="ImageStackView";class g extends c.ImageBase{constructor(e){super(e)}}a.ImageStack=g,i=g,g.__name__="ImageStack",i.prototype.default_view=u,i.define((({Ref:e})=>({color_mapper:[e(l.StackColorMapper)]})))},
function _(e,t,s,i,r){var a;i();const n=e(1),h=e(204),o=e(24),d=e(20),_=n.__importStar(e(18)),l=e(13),c=e(152),g=n.__importStar(e(240));class m extends h.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 s=0;s<t;s++)e.add_empty()}_set_data(){this._set_data_iteration++;const e=this.url.length;this.image=new Array(e),this.rendered=new o.Indices(e);const{retry_attempts:t,retry_timeout:s}=this.model,{_set_data_iteration:i}=this;for(let r=0;r<e;r++){const e=this.url.get(r);if(""==e)continue;const a=new c.ImageLoader(e,{loaded:()=>{this._set_data_iteration!=i||this.rendered.get(r)||this.renderer.request_render()},failed:()=>{this._set_data_iteration==i&&(this.image[r]=void 0)},attempts:t+1,timeout:s});this.image[r]=a.image}const r="data"==this.model.properties.w.units,a="data"==this.model.properties.h.units,n=this.data_size,h=new o.ScreenArray(r?2*n:n),d=new o.ScreenArray(a?2*n:n);this.anchor=g.anchor(this.model.anchor);const{x:_,y:m}=this.anchor;function u(e,t){const s=e-_*t;return[s,s+t]}function p(e,t){const s=e+m*t;return[s,s-t]}if(r)for(let e=0;e<n;e++)[h[e],h[n+e]]=u(this._x[e],this.w.get(e));else h.set(this._x,0);if(a)for(let e=0;e<n;e++)[d[e],d[n+e]]=p(this._y[e],this.h.get(e));else d.set(this._y,0);const[f,w,y,x]=(0,l.minmax2)(h,d);this._bounds_rect={x0:f,x1:w,y0:y,y1:x}}has_finished(){return super.has_finished()&&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,o.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,o.to_screen)(this.h)}_render(e,t,s){const{image:i,sx:r,sy:a,sw:n,sh:h,angle:o,global_alpha:d}=null!=s?s:this,{frame:_}=this.renderer.plot_view,{left:l,top:c,width:g,height:m}=_.bbox;e.beginPath(),e.rect(l+1,c+1,g-2,m-2),e.clip();let u=!0;for(const s of t){const t=i[s];isFinite(r[s]+a[s]+o.get(s)+d.get(s))&&null!=t&&(t.complete?0==t.naturalWidth&&0==t.naturalHeight||this._render_image(e,s,t,r,a,n,h,o,d):u=!1)}u&&!this._images_rendered&&(this._images_rendered=!0,this.notify_finished())}_render_image(e,t,s,i,r,a,n,h,o){isFinite(a[t])||(a[t]=s.width),isFinite(n[t])||(n[t]=s.height);const d=a[t],_=n[t],{anchor:l}=this,c=l.x*d,g=l.y*_,m=i[t]-c,u=r[t]-g,p=h.get(t),f=o.get(t);e.save(),e.globalAlpha=f;const w=d/2,y=_/2;0!=p?(e.translate(m,u),e.translate(w,y),e.rotate(p),e.translate(-w,-y),e.drawImage(s,0,0,d,_),e.translate(w,y),e.rotate(-p),e.translate(-w,-y),e.translate(-m,-u)):e.drawImage(s,m,u,d,_),e.restore(),this.rendered.set(t)}bounds(){return this._bounds_rect}}s.ImageURLView=m,m.__name__="ImageURLView";class u extends h.XYGlyph{constructor(e){super(e)}}s.ImageURL=u,a=u,u.__name__="ImageURL",a.prototype.default_view=m,a.define((({Boolean:e,Int:t})=>({url:[_.StringSpec,{field:"url"}],anchor:[d.Anchor,"top_left"],global_alpha:[_.NumberSpec,{value:1}],angle:[_.AngleSpec,0],w:[_.NullDistanceSpec,null],h:[_.NullDistanceSpec,null],dilate:[e,!1],retry_attempts:[t,0],retry_timeout:[t,0]})))},
function _(e,t,s,i,n){var r;i();const o=e(1),l=e(107),_=e(78),c=o.__importStar(e(212)),a=o.__importStar(e(18)),h=e(13),d=e(9),y=e(205),g=e(211),x=e(103);class p extends y.GlyphView{async load_glglyph(){const{MultiLineGL:t}=await Promise.resolve().then((()=>o.__importStar(e(545))));return t}_project_data(){l.inplace.project_xy(this._xs.array,this._ys.array)}_index_data(e){const{data_size:t}=this;for(let s=0;s<t;s++){const t=this._xs.get(s),i=this._ys.get(s),[n,r,o,l]=(0,h.minmax2)(t,i);e.add_rect(n,o,r,l)}}_render(e,t,s){const{sxs:i,sys:n}=null!=s?s:this;for(const s of t){const t=i.get(s),r=n.get(s),o=Math.min(t.length,r.length);let l=!0;e.beginPath();for(let s=0;s<o;s++){const i=t[s],n=r[s];isFinite(i+n)?l?(e.moveTo(i,n),l=!1):e.lineTo(i,n):l=!0}this.visuals.line.set_vectorize(e,s),e.stroke()}}_hit_point(e){const t={x:e.sx,y:e.sy};let s=9999;const i=new Map;for(let e=0,n=this.sxs.length;e<n;e++){const n=Math.max(2,this.line_width.get(e)/2),r=this.sxs.get(e),o=this.sys.get(e);let l=null;for(let e=0,i=r.length-1;e<i;e++){const i={x:r[e],y:o[e]},_={x:r[e+1],y:o[e+1]},a=c.dist_to_segment(t,i,_);a<n&&a<s&&(s=a,l=[e])}null!=l&&i.set(e,l)}return new x.Selection({indices:[...i.keys()],multiline_indices:(0,d.to_object)(i)})}_hit_span(e){const{sx:t,sy:s}=e;let i,n;"v"==e.direction?(i=this.renderer.yscale.invert(s),n=this._ys):(i=this.renderer.xscale.invert(t),n=this._xs);const r=new Map;for(let e=0,t=n.length;e<t;e++){const t=n.get(e),s=[];for(let e=0,n=t.length-1;e<n;e++)t[e]<=i&&i<=t[e+1]&&s.push(e);s.length>0&&r.set(e,s)}return new x.Selection({indices:[...r.keys()],multiline_indices:(0,d.to_object)(r)})}get_interpolation_hit(e,t,s){const i=this._xs.get(e),n=this._ys.get(e),r=i[t],o=n[t],l=i[t+1],_=n[t+1];return(0,g.line_interpolation)(this.renderer,s,r,o,l,_)}draw_legend_for_index(e,t,s){(0,g.generic_line_vector_legend)(this.visuals,e,t,s)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}s.MultiLineView=p,p.__name__="MultiLineView";class u extends y.Glyph{constructor(e){super(e)}}s.MultiLine=u,r=u,u.__name__="MultiLine",r.prototype.default_view=p,r.define((({})=>({xs:[a.XCoordinateSeqSpec,{field:"xs"}],ys:[a.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins(_.LineVector)},
function _(t,e,s,n,i){var o;n();const r=t(1),l=t(207),h=t(205),_=t(211),a=t(13),c=t(13),d=t(78),y=r.__importStar(t(212)),x=r.__importStar(t(18)),f=t(103),g=t(12);class p extends h.GlyphView{_project_data(){}_index_data(t){const{min:e,max:s}=Math,{data_size:n}=this;for(let i=0;i<n;i++){const n=this._xs[i],o=this._ys[i];if(0==n.length||0==o.length){t.add_empty();continue}let r=1/0,l=-1/0,h=1/0,_=-1/0;for(let t=0,i=n.length;t<i;t++){const i=n[t][0],c=o[t][0];if(0!=i.length&&0!=c.length){const[t,n,o,d]=(0,a.minmax2)(i,c);r=e(r,t),l=s(l,n),h=e(h,o),_=s(_,d)}}t.add_rect(r,h,l,_)}this._hole_index=this._index_hole_data()}_index_hole_data(){const{min:t,max:e}=Math,{data_size:s}=this,n=new l.SpatialIndex(s);for(let i=0;i<s;i++){const s=this._xs[i],o=this._ys[i];if(0==s.length||0==o.length){n.add_empty();continue}let r=1/0,l=-1/0,h=1/0,_=-1/0;for(let n=0,i=s.length;n<i;n++){const i=s[n],c=o[n];if(i.length>1&&c.length>1)for(let s=1,n=i.length;s<n;s++){const[n,o,d,y]=(0,a.minmax2)(i[s],c[s]);r=t(r,n),l=e(l,o),h=t(h,d),_=e(_,y)}}n.add_rect(r,h,l,_)}return n.finish(),n}_mask_data(){const{x_range:t,y_range:e}=this.renderer.plot_view.frame;return this.index.indices({x0:t.min,x1:t.max,y0:e.min,y1:e.max})}_render(t,e,s){if(!this.visuals.fill.doit&&!this.visuals.line.doit)return;const{sxs:n,sys:i}=null!=s?s:this;for(const s of e){t.beginPath();const e=n[s],o=i[s],r=Math.min(e.length,o.length);for(let s=0;s<r;s++){const n=e[s],i=o[s],r=Math.min(n.length,i.length);for(let e=0;e<r;e++){const s=n[e],o=i[e],r=Math.min(s.length,o.length);for(let e=0;e<r;e++){const n=s[e],i=o[e];0==e?t.moveTo(n,i):t.lineTo(n,i)}t.closePath()}}this.visuals.fill.apply(t,s,"evenodd"),this.visuals.hatch.apply(t,s,"evenodd"),this.visuals.line.apply(t,s)}}_hit_poly(t){const{sx:e,sy:s,greedy:n=!1}=t,i=(()=>{const t=this.renderer.xscale.v_invert(e),n=this.renderer.yscale.v_invert(s),[i,o,r,l]=(0,a.minmax2)(t,n);return this.index.indices({x0:i,x1:o,y0:r,y1:l})})(),o=[];for(const t of i){const i=this.sxs[t],r=this.sys[t];let l=!n;const h=i.length;for(let t=0;t<h;t++){const o=i[t][0],h=r[t][0],_=o.length;for(let t=0;t<_;t++){const i=o[t],r=h[t];if(y.point_in_poly(i,r,e,s)){if(n){l=!0;break}}else if(!n){l=!1;break}}if(n){if(l)break}else if(!l)break}l&&o.push(t)}return new f.Selection({indices:o})}_hit_rect(t){const{sx0:e,sx1:s,sy0:n,sy1:i,greedy:o}=t,r=[e,s,s,e],l=[n,n,i,i];return this._hit_poly({type:"poly",sx:r,sy:l,greedy:o})}_hit_point(t){const{sx:e,sy:s}=t,n=this.renderer.xscale.invert(e),i=this.renderer.yscale.invert(s),o=this.index.indices({x0:n,y0:i,x1:n,y1:i}),r=this._hole_index.indices({x0:n,y0:i,x1:n,y1:i}),l=[];for(const t of o){const n=this.sxs[t],i=this.sys[t];for(let o=0,h=n.length;o<h;o++){const h=n[o].length;if(y.point_in_poly(e,s,n[o][0],i[o][0]))if(1==h)l.push(t);else if(r.get(t)){if(h>1){let r=!1;for(let t=1;t<h;t++){const l=n[o][t],h=i[o][t];if(y.point_in_poly(e,s,l,h)){r=!0;break}}r||l.push(t)}}else l.push(t)}}return new f.Selection({indices:l})}_get_snap_coord(t){return(0,c.sum)(t)/t.length}scenterxy(t,e,s){if(1==this.sxs[t].length){return[this._get_snap_coord(this.sxs[t][0][0]),this._get_snap_coord(this.sys[t][0][0])]}{const n=this.sxs[t],i=this.sys[t];for(let t=0,o=n.length;t<o;t++)if(y.point_in_poly(e,s,n[t][0],i[t][0])){return[this._get_snap_coord(n[t][0]),this._get_snap_coord(i[t][0])]}}(0,g.unreachable)()}map_data(){const t=this._xs.length;this.sxs=new Array(t),this.sys=new Array(t);for(let e=0;e<t;e++){const t=this._xs[e].length;this.sxs[e]=new Array(t),this.sys[e]=new Array(t);for(let s=0;s<t;s++){const t=this._xs[e][s].length;this.sxs[e][s]=new Array(t),this.sys[e][s]=new Array(t);for(let n=0;n<t;n++){const[t,i]=this.renderer.coordinates.map_to_screen(this._xs[e][s][n],this._ys[e][s][n]);this.sxs[e][s][n]=t,this.sys[e][s][n]=i}}}}draw_legend_for_index(t,e,s){(0,_.generic_area_vector_legend)(this.visuals,t,e,s)}}s.MultiPolygonsView=p,p.__name__="MultiPolygonsView";class u extends h.Glyph{constructor(t){super(t)}}s.MultiPolygons=u,o=u,u.__name__="MultiPolygons",o.prototype.default_view=p,o.define((({})=>({xs:[x.XCoordinateSeqSeqSeqSpec,{field:"xs"}],ys:[x.YCoordinateSeqSeqSeqSpec,{field:"ys"}]}))),o.mixins([d.LineVector,d.FillVector,d.HatchVector])},
function _(e,t,s,i,n){var r;i();const o=e(1),a=e(205),_=e(211),c=e(13),l=e(78),h=o.__importStar(e(212)),y=o.__importStar(e(18)),d=e(103),p=e(12),x=e(107);class f extends a.GlyphView{_project_data(){x.inplace.project_xy(this._xs.array,this._ys.array)}_index_data(e){const{data_size:t}=this;for(let s=0;s<t;s++){const t=this._xs.get(s),i=this._ys.get(s),[n,r,o,a]=(0,c.minmax2)(t,i);e.add_rect(n,o,r,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,s){const{sxs:i,sys:n}=null!=s?s:this;for(const s of t){const t=i.get(s),r=n.get(s);let o=!0;e.beginPath();const a=Math.min(t.length,r.length);for(let s=0;s<a;s++){const i=t[s],n=r[s];isFinite(i+n)?o?(e.moveTo(i,n),o=!1):e.lineTo(i,n):(e.closePath(),o=!0)}e.closePath(),this.visuals.fill.apply(e,s),this.visuals.hatch.apply(e,s),this.visuals.line.apply(e,s)}}_hit_poly(e){const{sx:t,sy:s,greedy:i=!1}=e,n=(()=>{const e=this.renderer.xscale.v_invert(t),i=this.renderer.yscale.v_invert(s),[n,r,o,a]=(0,c.minmax2)(e,i);return this.index.indices({x0:n,x1:r,y0:o,y1:a})})(),r=[];for(const e of n){const n=this.sxs.get(e),o=this.sys.get(e),a=n.length;if(0==a)continue;let _=!i;for(let e=0;e<a;e++){const r=n[e],a=o[e];if(h.point_in_poly(r,a,t,s)){if(i){_=!0;break}}else if(!i){_=!1;break}}_&&r.push(e)}return new d.Selection({indices:r})}_hit_rect(e){const{sx0:t,sx1:s,sy0:i,sy1:n,greedy:r}=e,o=[t,s,s,t],a=[i,i,n,n];return this._hit_poly({type:"poly",sx:o,sy:a,greedy:r})}_hit_point(e){const{sx:t,sy:s}=e,i=this.renderer.xscale.invert(t),n=this.renderer.yscale.invert(s),r=this.index.indices({x0:i,y0:n,x1:i,y1:n}),o=[];for(const e of r){const i=this.sxs.get(e),n=this.sys.get(e),r=i.length;for(let a=0,_=0;;_++){if(isNaN(i[_])||_==r){const r=i.subarray(a,_),c=n.subarray(a,_);if(h.point_in_poly(t,s,r,c)){o.push(e);break}a=_+1}if(_==r)break}}return new d.Selection({indices:o})}_get_snap_coord(e){return(0,c.sum)(e)/e.length}scenterxy(e,t,s){const i=this.sxs.get(e),n=this.sys.get(e),r=i.length;let o=!1;for(let e=0,a=0;;a++){const _=isNaN(i[a]);if(o=o||_,a==r&&!o){return[this._get_snap_coord(i),this._get_snap_coord(n)]}if(_||a==r){const r=i.subarray(e,a),o=n.subarray(e,a);if(h.point_in_poly(t,s,r,o)){return[this._get_snap_coord(r),this._get_snap_coord(o)]}e=a+1}if(a==r)break}(0,p.unreachable)()}draw_legend_for_index(e,t,s){(0,_.generic_area_vector_legend)(this.visuals,e,t,s)}}s.PatchesView=f,f.__name__="PatchesView";class g extends a.Glyph{constructor(e){super(e)}}s.Patches=g,r=g,g.__name__="Patches",r.prototype.default_view=f,r.define((({})=>({xs:[y.XCoordinateSeqSpec,{field:"xs"}],ys:[y.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins([l.LineVector,l.FillVector,l.HatchVector])},
function _(t,e,i,o,s){var r;o();const _=t(1),d=t(331),n=_.__importStar(t(18));class a extends d.LRTBView{scenterxy(t){return[this.sleft[t]/2+this.sright[t]/2,this.stop[t]/2+this.sbottom[t]/2]}_lrtb(t){return[this._left[t],this._right[t],this._top[t],this._bottom[t]]}}i.QuadView=a,a.__name__="QuadView";class h extends d.LRTB{constructor(t){super(t)}}i.Quad=h,r=h,h.__name__="Quad",r.prototype.default_view=a,r.define((({})=>({right:[n.XCoordinateSpec,{field:"right"}],bottom:[n.YCoordinateSpec,{field:"bottom"}],left:[n.XCoordinateSpec,{field:"left"}],top:[n.YCoordinateSpec,{field:"top"}]})))},
function _(e,i,t,s,n){var c;s();const o=e(1),r=e(78),a=e(107),_=e(205),d=e(211),l=e(329),x=o.__importStar(e(18));class y extends _.GlyphView{_project_data(){a.inplace.project_xy(this._x0,this._y0),a.inplace.project_xy(this._x1,this._y1)}_index_data(e){const{_x0:i,_x1:t,_y0:s,_y1:n,_cx:c,_cy:o,data_size:r}=this;for(let a=0;a<r;a++){const r=i[a],_=t[a],d=s[a],x=n[a],y=c[a],p=o[a];if(isFinite(r+_+d+x+y+p)){const{x0:i,y0:t,x1:s,y1:n}=(0,l.qbb)(r,d,y,p,_,x);e.add_rect(i,t,s,n)}else e.add_empty()}}_render(e,i,t){if(!this.visuals.line.doit)return;const{sx0:s,sy0:n,sx1:c,sy1:o,scx:r,scy:a}=null!=t?t:this;for(const t of i){const i=s[t],_=n[t],d=c[t],l=o[t],x=r[t],y=a[t];isFinite(i+_+d+l+x+y)&&(e.beginPath(),e.moveTo(i,_),e.quadraticCurveTo(x,y,d,l),this.visuals.line.apply(e,t))}}draw_legend_for_index(e,i,t){(0,d.generic_line_vector_legend)(this.visuals,e,i,t)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}t.QuadraticView=y,y.__name__="QuadraticView";class p extends _.Glyph{constructor(e){super(e)}}t.Quadratic=p,c=p,p.__name__="Quadratic",c.prototype.default_view=y,c.define((({})=>({x0:[x.XCoordinateSpec,{field:"x0"}],y0:[x.YCoordinateSpec,{field:"y0"}],x1:[x.XCoordinateSpec,{field:"x1"}],y1:[x.YCoordinateSpec,{field:"y1"}],cx:[x.XCoordinateSpec,{field:"cx"}],cy:[x.YCoordinateSpec,{field:"cy"}]}))),c.mixins(r.LineVector)},
function _(e,t,s,n,i){var l;n();const a=e(1),r=e(204),h=e(211),o=e(78),_=e(24),c=a.__importStar(e(18));class g extends r.XYGlyphView{_map_data(){"data"==this.model.properties.length.units?this.slength=this.sdist(this.renderer.xscale,this._x,this.length):this.slength=(0,_.to_screen)(this.length);const{width:e,height:t}=this.renderer.plot_view.frame.bbox,s=2*(e+t),{slength:n}=this;for(let e=0,t=n.length;e<t;e++)0==n[e]&&(n[e]=s)}_render(e,t,s){if(!this.visuals.line.doit)return;const{sx:n,sy:i,slength:l,angle:a}=null!=s?s:this;for(const s of t){const t=n[s],r=i[s],h=a.get(s),o=l[s];isFinite(t+r+h+o)&&(e.translate(t,r),e.rotate(h),e.beginPath(),e.moveTo(0,0),e.lineTo(o,0),this.visuals.line.apply(e,s),e.rotate(-h),e.translate(-t,-r))}}draw_legend_for_index(e,t,s){(0,h.generic_line_vector_legend)(this.visuals,e,t,s)}}s.RayView=g,g.__name__="RayView";class d extends r.XYGlyph{constructor(e){super(e)}}s.Ray=d,l=d,d.__name__="Ray",l.prototype.default_view=g,l.mixins(o.LineVector),l.define((({})=>({length:[c.DistanceSpec,0],angle:[c.AngleSpec,0]})))},
function _(t,s,e,i,r){var a;i();const n=t(1),h=t(334),_=t(211),d=t(24),o=t(13),l=t(103),c=t(57),x=t(155),y=t(238),w=n.__importStar(t(240)),u=t(239),{abs:g,sqrt:m}=Math;class f extends h.CenterRotatableView{async load_glglyph(){const{RectGL:s}=await Promise.resolve().then((()=>n.__importStar(t(547))));return s}_set_data(t){super._set_data(t),this.border_radius=w.border_radius(this.model.border_radius)}_map_data(){const t=this.data_size;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,d.to_screen)(this.width),this.sx0=new d.ScreenArray(t);for(let s=0;s<t;s++)this.sx0[s]=this.sx[s]-this.sw[s]/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,d.to_screen)(this.height),this.sy1=new d.ScreenArray(t);for(let s=0;s<t;s++)this.sy1[s]=this.sy[s]-this.sh[s]/2}const{sw:s,sh:e}=this;this.ssemi_diag=new d.ScreenArray(t);for(let i=0;i<t;i++){const t=s[i],r=e[i];this.ssemi_diag[i]=m(t**2+r**2)/2}const i=new d.ScreenArray(t),r=new d.ScreenArray(t);for(let s=0;s<t;s++)i[s]=this.sx0[s]+this.sw[s]/2,r[s]=this.sy1[s]+this.sh[s]/2;this.max_x2_ddist=(0,o.max)(this._ddist(0,i,this.ssemi_diag)),this.max_y2_ddist=(0,o.max)(this._ddist(1,r,this.ssemi_diag))}_render(t,s,e){const{sx:i,sy:r,sx0:a,sy1:n,sw:h,sh:_,angle:d,border_radius:o}=null!=e?e:this;for(const e of s){const s=i[e],l=r[e],x=a[e],y=n[e],w=h[e],g=_[e],m=d.get(e);if(isFinite(s+l+x+y+w+g+m)&&(0!=w&&0!=g)){if(t.beginPath(),0!=m){t.translate(s,l),t.rotate(m);const e=new c.BBox({x:-w/2,y:-g/2,width:w,height:g});(0,u.round_rect)(t,e,o),t.rotate(-m),t.translate(-s,-l)}else{const s=new c.BBox({x,y,width:w,height:g});(0,u.round_rect)(t,s,o)}this.visuals.fill.apply(t,e),this.visuals.hatch.apply(t,e),this.visuals.line.apply(t,e)}}}_hit_rect(t){return this._hit_rect_against_index(t)}_hit_point(t){const s={x:t.sx,y:t.sy},e=this.renderer.xscale.invert(s.x),i=this.renderer.yscale.invert(s.y),r=this.index.indices({x0:e-this.max_x2_ddist,x1:e+this.max_x2_ddist,y0:i-this.max_y2_ddist,y1:i+this.max_y2_ddist}),{sx:a,sy:n,sx0:h,sy1:_,sw:d,sh:o,angle:c}=this,y=[];for(const t of r){const e=a[t],i=n[t],r=h[t],l=_[t],w=d[t],u=o[t],g=c.get(t),m=(0,x.rotate_around)(s,{x:e,y:i},-g),f=m.x-r,p=m.y-l;0<=f&&f<=w&&0<=p&&p<=u&&y.push(t)}return new l.Selection({indices:y})}_map_dist_corner_for_data_side_length(t,s,e){const i=t.length,r=new Float64Array(i),a=new Float64Array(i);for(let e=0;e<i;e++){const i=t[e],n=s.get(e)/2;r[e]=i-n,a[e]=i+n}const n=e.v_compute(r),h=e.v_compute(a),_=this.sdist(e,r,s,"edge",this.model.dilate);let d=n;for(let t=0;t<i;t++){const s=n[t],e=h[t];if(!isNaN(s+e)&&s!=e){d=s<e?n:h;break}}return[_,d]}_ddist(t,s,e){const i=(0,d.infer_type)(s,e),r=0==t?this.renderer.xscale:this.renderer.yscale,a=s,n=a.length,h=new i(n);for(let t=0;t<n;t++)h[t]=a[t]+e[t];const _=r.v_invert(a),o=r.v_invert(h),l=_.length,c=new i(l);for(let t=0;t<l;t++)c[t]=g(o[t]-_[t]);return c}draw_legend_for_index(t,s,e){(0,_.generic_area_vector_legend)(this.visuals,t,s,e)}}e.RectView=f,f.__name__="RectView";class p extends h.CenterRotatable{constructor(t){super(t)}}e.Rect=p,a=p,p.__name__="Rect",a.prototype.default_view=f,a.define((({Boolean:t})=>({border_radius:[y.BorderRadius,0],dilate:[t,!1]})))},
function _(e,t,r,a,n){var s;a();const i=e(1),c=e(352),o=e(353),_=i.__importStar(e(18));class l extends c.MarkerView{async load_glglyph(){const{MultiMarkerGL:t}=await Promise.resolve().then((()=>i.__importStar(e(546))));return t}_render(e,t,r){const{sx:a,sy:n,size:s,angle:i,marker:c}=null!=r?r:this;for(const r of t){const t=a[r],_=n[r],l=s.get(r),g=i.get(r),u=c.get(r);if(!isFinite(t+_+l+g)||null==u)continue;const d=l/2;e.beginPath(),e.translate(t,_),0!=g&&e.rotate(g),o.marker_funcs[u](e,r,d,this.visuals),0!=g&&e.rotate(-g),e.translate(-t,-_)}}draw_legend_for_index(e,{x0:t,x1:r,y0:a,y1:n},s){const i=s+1,c=this.marker.get(s),o=Object.assign(Object.assign({},this._get_legend_args({x0:t,x1:r,y0:a,y1:n},s)),{marker:new _.UniformScalar(c,i)});this._render(e,[s],o)}}r.ScatterView=l,l.__name__="ScatterView";class g extends c.Marker{constructor(e){super(e)}}r.Scatter=g,s=g,g.__name__="Scatter",s.prototype.default_view=l,s.define((()=>({marker:[_.MarkerSpec,{value:"circle"}]})))},
function _(e,t,s,i,r){var n;i();const a=e(1),_=e(204),c=e(78),o=a.__importStar(e(212)),h=a.__importStar(e(18)),x=a.__importStar(e(39)),d=e(13),l=e(103);class y extends _.XYGlyphView{_render(e,t,s){const{sx:i,sy:r,size:n,angle:a}=null!=s?s:this;for(const s of t){const t=i[s],_=r[s],c=n.get(s),o=a.get(s);if(!isFinite(t+_+c+o))continue;const h=c/2;e.beginPath(),e.translate(t,_),0!=o&&e.rotate(o),this._render_one(e,s,h,this.visuals),0!=o&&e.rotate(-o),e.translate(-t,-_)}}_mask_data(){const{x_target:e,y_target:t}=this.renderer.plot_view.frame,s=e.widen(this.max_size).map((e=>this.renderer.xscale.invert(e))),i=t.widen(this.max_size).map((e=>this.renderer.yscale.invert(e)));return this.index.indices({x0:s.start,x1:s.end,y0:i.start,y1:i.end})}_hit_point(e){const{sx:t,sy:s}=e,{max_size:i}=this,{hit_dilation:r}=this.model,n=t-i*r,a=t+i*r,[_,c]=this.renderer.xscale.r_invert(n,a),o=s-i*r,h=s+i*r,[x,d]=this.renderer.yscale.r_invert(o,h),y=this.index.indices({x0:_,x1:c,y0:x,y1:d}),m=[];for(const e of y){const i=this.size.get(e)/2*r;Math.abs(this.sx[e]-t)<=i&&Math.abs(this.sy[e]-s)<=i&&m.push(e)}return new l.Selection({indices:m})}_hit_span(e){const{sx:t,sy:s}=e,i=this.bounds(),r=this.max_size/2,[n,a,_,c]=(()=>{if("h"==e.direction){const{y0:e,y1:s}=i,n=t-r,a=t+r,[_,c]=this.renderer.xscale.r_invert(n,a);return[_,c,e,s]}{const{x0:e,x1:t}=i,n=s-r,a=s+r,[_,c]=this.renderer.yscale.r_invert(n,a);return[e,t,_,c]}})(),o=[...this.index.indices({x0:n,x1:a,y0:_,y1:c})];return new l.Selection({indices:o})}_hit_rect(e){const{sx0:t,sx1:s,sy0:i,sy1:r}=e,[n,a]=this.renderer.xscale.r_invert(t,s),[_,c]=this.renderer.yscale.r_invert(i,r),o=[...this.index.indices({x0:n,x1:a,y0:_,y1:c})];return new l.Selection({indices:o})}_hit_poly(e){const{sx:t,sy:s}=e,i=(()=>{const e=this.renderer.xscale.v_invert(t),i=this.renderer.yscale.v_invert(s),[r,n,a,_]=(0,d.minmax2)(e,i);return this.index.indices({x0:r,x1:n,y0:a,y1:_})})(),r=[];for(const e of i)o.point_in_poly(this.sx[e],this.sy[e],t,s)&&r.push(e);return new l.Selection({indices:r})}_set_data(e){super._set_data(e);const t=x.max(this.size);this._configure("max_size",{value:t})}_get_legend_args({x0:e,x1:t,y0:s,y1:i},r){const n=r+1,a=new Array(n),_=new Array(n);a[r]=(e+t)/2,_[r]=(s+i)/2;const c=.4*Math.min(Math.abs(t-e),Math.abs(i-s));return{sx:a,sy:_,size:new h.UniformScalar(c,n),angle:new h.UniformScalar(0,n)}}draw_legend_for_index(e,{x0:t,x1:s,y0:i,y1:r},n){const a=this._get_legend_args({x0:t,x1:s,y0:i,y1:r},n);this._render(e,[n],a)}}s.MarkerView=y,y.__name__="MarkerView";class m extends _.XYGlyph{constructor(e){super(e)}}s.Marker=m,n=m,m.__name__="Marker",n.mixins([c.LineVector,c.FillVector,c.HatchVector]),n.define((({Number:e})=>({size:[h.ScreenSizeSpec,{value:4}],angle:[h.AngleSpec,0],hit_dilation:[e,1]})))},
function _(l,n,o,i,a){i();const t=Math.sqrt(3),e=Math.sqrt(5),p=(e+1)/4,c=Math.sqrt((5-e)/8),h=(e-1)/4,u=Math.sqrt((5+e)/8);function f(l,n){l.rotate(Math.PI/4),y(l,n),l.rotate(-Math.PI/4)}function r(l,n){const o=n*t,i=o/3;l.moveTo(-o/2,-i),l.lineTo(0,0),l.lineTo(o/2,-i),l.lineTo(0,0),l.lineTo(0,n)}function y(l,n){l.moveTo(0,n),l.lineTo(0,-n),l.moveTo(-n,0),l.lineTo(n,0)}function T(l,n){l.moveTo(0,n),l.lineTo(n/1.5,0),l.lineTo(0,-n),l.lineTo(-n/1.5,0),l.closePath()}function s(l,n){const o=n*t,i=o/3;l.moveTo(-n,i),l.lineTo(n,i),l.lineTo(0,i-o),l.closePath()}function v(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function d(l,n,o,i){T(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function P(l,n,o,i){!function(l,n){l.beginPath(),l.arc(0,0,n/4,0,2*Math.PI,!1),l.closePath()}(l,o),i.line.set_vectorize(l,n),l.fillStyle=l.strokeStyle,l.fill()}function m(l,n,o,i){!function(l,n){const o=n/2,i=t*o;l.moveTo(n,0),l.lineTo(o,-i),l.lineTo(-o,-i),l.lineTo(-n,0),l.lineTo(-o,i),l.lineTo(o,i),l.closePath()}(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function _(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function q(l,n,o,i){!function(l,n){const o=Math.sqrt(5-2*e)*n;l.moveTo(0,-n),l.lineTo(o*h,o*u-n),l.lineTo(o*(1+h),o*u-n),l.lineTo(o*(1+h-p),o*(u+c)-n),l.lineTo(o*(1+2*h-p),o*(2*u+c)-n),l.lineTo(0,2*o*u-n),l.lineTo(-o*(1+2*h-p),o*(2*u+c)-n),l.lineTo(-o*(1+h-p),o*(u+c)-n),l.lineTo(-o*(1+h),o*u-n),l.lineTo(-o*h,o*u-n),l.closePath()}(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}function M(l,n,o,i){s(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)}o.marker_funcs={asterisk:function(l,n,o,i){y(l,o),f(l,o),i.line.apply(l,n)},circle:v,circle_cross:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),y(l,o),i.line.apply(l,n)},circle_dot:function(l,n,o,i){v(l,n,o,i),P(l,n,o,i)},circle_y:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),r(l,o),i.line.apply(l,n)},circle_x:function(l,n,o,i){l.arc(0,0,o,0,2*Math.PI,!1),i.fill.apply(l,n),i.hatch.apply(l,n),f(l,o),i.line.apply(l,n)},cross:function(l,n,o,i){y(l,o),i.line.apply(l,n)},diamond:d,diamond_dot:function(l,n,o,i){d(l,n,o,i),P(l,n,o,i)},diamond_cross:function(l,n,o,i){T(l,o),i.fill.apply(l,n),i.hatch.apply(l,n),l.moveTo(0,o),l.lineTo(0,-o),l.moveTo(-o/1.5,0),l.lineTo(o/1.5,0),i.line.apply(l,n)},dot:P,hex:m,hex_dot:function(l,n,o,i){m(l,n,o,i),P(l,n,o,i)},inverted_triangle:function(l,n,o,i){l.rotate(Math.PI),s(l,o),l.rotate(-Math.PI),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},plus:function(l,n,o,i){const a=3*o/8,t=[a,a,o,o,a,a,-a,-a,-o,-o,-a,-a],e=[o,a,a,-a,-a,-o,-o,-a,-a,a,a,o];l.beginPath();for(let n=0;n<12;n++)l.lineTo(t[n],e[n]);l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},square:_,square_cross:function(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),y(l,o),i.line.apply(l,n)},square_dot:function(l,n,o,i){_(l,n,o,i),P(l,n,o,i)},square_pin:function(l,n,o,i){const a=3*o/8;l.moveTo(-o,-o),l.quadraticCurveTo(0,-a,o,-o),l.quadraticCurveTo(a,0,o,o),l.quadraticCurveTo(0,a,-o,o),l.quadraticCurveTo(-a,0,-o,-o),l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},square_x:function(l,n,o,i){const a=2*o;l.rect(-o,-o,a,a),i.fill.apply(l,n),i.hatch.apply(l,n),l.moveTo(-o,o),l.lineTo(o,-o),l.moveTo(-o,-o),l.lineTo(o,o),i.line.apply(l,n)},star:q,star_dot:function(l,n,o,i){q(l,n,o,i),P(l,n,o,i)},triangle:M,triangle_dot:function(l,n,o,i){M(l,n,o,i),P(l,n,o,i)},triangle_pin:function(l,n,o,i){const a=o*t,e=a/3,p=3*e/8;l.moveTo(-o,e),l.quadraticCurveTo(0,p,o,e),l.quadraticCurveTo(t*p/2,p/2,0,e-a),l.quadraticCurveTo(-t*p/2,p/2,-o,e),l.closePath(),i.fill.apply(l,n),i.hatch.apply(l,n),i.line.apply(l,n)},dash:function(l,n,o,i){!function(l,n){l.moveTo(-n,0),l.lineTo(n,0)}(l,o),i.line.apply(l,n)},x:function(l,n,o,i){f(l,o),i.line.apply(l,n)},y:function(l,n,o,i){r(l,o),i.line.apply(l,n)}}},
function _(e,t,s,i,n){var r;i();const o=e(1),a=o.__importStar(e(212)),_=o.__importStar(e(18)),d=e(78),h=e(107),c=e(11),x=e(205),l=e(211),y=e(103);class p extends x.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:s}=Math,{_x0:i,_x1:n,_y0:r,_y1:o,data_size:a}=this;for(let _=0;_<a;_++){const a=i[_],d=n[_],h=r[_],c=o[_];e.add_rect(t(a,d),t(h,c),s(a,d),s(h,c))}}_render(e,t,s){if(!this.visuals.line.doit)return;const{sx0:i,sy0:n,sx1:r,sy1:o}=null!=s?s:this;for(const s of t){const t=i[s],a=n[s],_=r[s],d=o[s];isFinite(t+a+_+d)&&(this._render_decorations(e,s,t,a,_,d),e.beginPath(),e.moveTo(t,a),e.lineTo(_,d),this.visuals.line.apply(e,s))}}_render_decorations(e,t,s,i,n,r){const{PI:o}=Math,a=(0,c.atan2)([s,i],[n,r])+o/2;for(const _ of this.decorations.values())e.save(),"start"==_.model.node?(e.translate(s,i),e.rotate(a+o)):"end"==_.model.node&&(e.translate(n,r),e.rotate(a)),_.marking.render(e,t),e.restore()}_hit_point(e){const{sx:t,sy:s}=e,i={x:t,y:s},[n,r]=this.renderer.xscale.r_invert(t-2,t+2),[o,_]=this.renderer.yscale.r_invert(s-2,s+2),d=this.index.indices({x0:n,y0:o,x1:r,y1:_}),h=[];for(const e of d){const t=Math.max(2,this.line_width.get(e)/2)**2,s={x:this.sx0[e],y:this.sy0[e]},n={x:this.sx1[e],y:this.sy1[e]};a.dist_to_segment_squared(i,s,n)<t&&h.push(e)}return new y.Selection({indices:h})}_hit_span(e){const[t,s]=this.renderer.plot_view.frame.bbox.ranges,{sx:i,sy:n}=e;let r,o,a;"v"==e.direction?(a=this.renderer.yscale.invert(n),[r,o]=[this._y0,this._y1]):(a=this.renderer.xscale.invert(i),[r,o]=[this._x0,this._x1]);const _=[],[d,h]=this.renderer.xscale.r_invert(t.start,t.end),[c,x]=this.renderer.yscale.r_invert(s.start,s.end),l=this.index.indices({x0:d,y0:c,x1:h,y1:x});for(const t of l){(r[t]<=a&&a<=o[t]||o[t]<=a&&a<=r[t])&&_.push(t);const s=1.5+this.line_width.get(t)/2;r[t]==o[t]&&("h"==e.direction?Math.abs(this.sx0[t]-i)<=s&&_.push(t):Math.abs(this.sy0[t]-n)<=s&&_.push(t))}return new y.Selection({indices:_})}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,s){(0,l.generic_line_vector_legend)(this.visuals,e,t,s)}}s.SegmentView=p,p.__name__="SegmentView";class f extends x.Glyph{constructor(e){super(e)}}s.Segment=f,r=f,f.__name__="Segment",r.prototype.default_view=p,r.define((({})=>({x0:[_.XCoordinateSpec,{field:"x0"}],y0:[_.YCoordinateSpec,{field:"y0"}],x1:[_.XCoordinateSpec,{field:"x1"}],y1:[_.YCoordinateSpec,{field:"y1"}]}))),r.mixins(d.LineVector)},
function _(t,e,s,i,n){var o;i();const _=t(1),l=t(204),a=_.__importStar(t(78)),c=t(356);class r extends l.XYGlyphView{_set_data(){const{tension:t,closed:e}=this.model;[this._xt,this._yt]=(0,c.catmullrom_spline)(this._x,this._y,20,t,e)}_map_data(){const{x_scale:t,y_scale:e}=this.renderer.coordinates;this.sxt=t.v_compute(this._xt),this.syt=e.v_compute(this._yt)}_render(t,e,s){const{sxt:i,syt:n}=null!=s?s:this;let o=!0;t.beginPath();const _=i.length;for(let e=0;e<_;e++){const s=i[e],_=n[e];isFinite(s+_)?o?(t.moveTo(s,_),o=!1):t.lineTo(s,_):o=!0}this.visuals.line.set_value(t),t.stroke()}}s.SplineView=r,r.__name__="SplineView";class h extends l.XYGlyph{constructor(t){super(t)}}s.Spline=h,o=h,h.__name__="Spline",o.prototype.default_view=r,o.mixins(a.LineScalar),o.define((({Boolean:t,Number:e})=>({tension:[e,.5],closed:[t,!1]})))},
function _(n,t,e,o,s){o();const c=n(24),l=n(12);e.catmullrom_spline=function(n,t,e=10,o=.5,s=!1){(0,l.assert)(n.length==t.length);const r=n.length,f=s?r+1:r,w=(0,c.infer_type)(n,t),i=new w(f+2),u=new w(f+2);i.set(n,1),u.set(t,1),s?(i[0]=n[r-1],u[0]=t[r-1],i[f]=n[0],u[f]=t[0],i[f+1]=n[1],u[f+1]=t[1]):(i[0]=n[0],u[0]=t[0],i[f+1]=n[r-1],u[f+1]=t[r-1]);const g=new w(4*(e+1));for(let n=0,t=0;n<=e;n++){const o=n/e,s=o**2,c=o*s;g[t++]=2*c-3*s+1,g[t++]=-2*c+3*s,g[t++]=c-2*s+o,g[t++]=c-s}const h=new w((f-1)*(e+1)),_=new w((f-1)*(e+1));for(let n=1,t=0;n<f;n++){const s=(i[n+1]-i[n-1])*o,c=(u[n+1]-u[n-1])*o,l=(i[n+2]-i[n])*o,r=(u[n+2]-u[n])*o;for(let o=0;o<=4*e;t++){const e=g[o++],f=g[o++],w=g[o++],a=g[o++];h[t]=e*i[n]+f*i[n+1]+w*s+a*l,_[t]=e*u[n]+f*u[n+1]+w*c+a*r}}return[h,_]}},
function _(e,t,r,n,s){var i;n();const _=e(1),a=e(204),o=e(211),l=_.__importStar(e(78)),d=e(20),c=e(12);class h extends a.XYGlyphView{async load_glglyph(){const{StepGL:t}=await Promise.resolve().then((()=>_.__importStar(e(548))));return t}_render(e,t,r){const n=t.length;if(n<2)return;const{sx:s,sy:i}=null!=r?r:this,_=this.model.mode;this.visuals.line.set_value(e);let a=!1,o=!1;const l=t[0];let d=isFinite(s[l]+i[l]);"center"==_&&(a=this._render_xy(e,a,d?s[l]:NaN,i[l]));for(const r of t){const t=isFinite(s[r+1]+i[r+1]);switch(_){case"before":a=this._render_xy(e,a,d?s[r]:NaN,i[r]),r<s.length-1&&(a=this._render_xy(e,a,d&&t?s[r]:NaN,i[r+1]));break;case"after":a=this._render_xy(e,a,d?s[r]:NaN,i[r]),r<s.length-1&&(a=this._render_xy(e,a,d&&t?s[r+1]:NaN,i[r]));break;case"center":if(d&&t){const t=(s[r]+s[r+1])/2;a=this._render_xy(e,a,t,i[r]),a=this._render_xy(e,a,t,i[r+1])}else o&&(a=this._render_xy(e,a,d?s[r]:NaN,i[r])),a=this._render_xy(e,a,t?s[r+1]:NaN,i[r+1]);break;default:(0,c.unreachable)()}o=d,d=t}if(a){const r=t[n-1];this._render_xy(e,a,d?s[r]:NaN,i[r])&&e.stroke()}}_render_xy(e,t,r,n){return isFinite(r+n)?t?e.lineTo(r,n):(e.beginPath(),e.moveTo(r,n),t=!0):t&&(e.stroke(),t=!1),t}draw_legend_for_index(e,t,r){(0,o.generic_line_scalar_legend)(this.visuals,e,t)}}r.StepView=h,h.__name__="StepView";class y extends a.XYGlyph{constructor(e){super(e)}}r.Step=y,i=y,y.__name__="Step",i.prototype.default_view=h,i.mixins(l.LineScalar),i.define((()=>({mode:[d.StepMode,"before"]})))},
function _(t,e,s,i,a){var n;i();const r=t(1),o=t(204),l=r.__importStar(t(78)),c=r.__importStar(t(18)),h=t(39),_=t(103),d=t(57),u=t(34),x=t(155),f=t(153),g=t(238),p=r.__importStar(t(240)),y=t(239);class b extends c.DataSpec{}b.__name__="TextAnchorSpec";class v extends o.XYGlyphView{after_visuals(){var t,e;super.after_visuals();const{text:s}=null!==(t=this.base)&&void 0!==t?t:this;this.labels=Array.from(s,(t=>{if(null==t)return null;{const e=`${t}`;return new f.TextBox({text:e})}}));const i=this.data_size,{anchor:a}=null!==(e=this.base)&&void 0!==e?e:this,{padding:n,border_radius:r}=this.model,{text_align:o,text_baseline:l}=this.visuals.text;if(a.is_Scalar()&&"auto"!=a.value)this.anchor_=new h.UniformScalar(p.anchor(a.value),i);else if(a.is_Scalar()&&o.is_Scalar()&&l.is_Scalar())this.anchor_=new h.UniformScalar(p.text_anchor(a.value,o.value,l.value),i);else{const t=new Array(i);for(let e=0;e<i;e++){const s=a.get(e),i=o.get(e),n=l.get(e);t[e]=p.text_anchor(s,i,n)}this.anchor_=new h.UniformVector(t)}this.padding=p.padding(n),this.border_radius=p.border_radius(r),this.swidth=new Float32Array(i),this.sheight=new Float32Array(i);const{left:c,right:_,top:d,bottom:x}=this.padding;for(const[t,e]of(0,u.enumerate)(this.labels)){if(null==t)continue;t.visuals=this.visuals.text.values(e),t.position={sx:0,sy:0,x_anchor:"left",y_anchor:"top"},t.align="auto";const s=t.size(),i=c+s.width+_,a=d+s.height+x;this.swidth[e]=i,this.sheight[e]=a}}_render(t,e,s){const{sx:i,sy:a,x_offset:n,y_offset:r,angle:o}=null!=s?s:this,{text:l,background_fill:c,background_hatch:h,border_line:_}=this.visuals,{anchor_:u,border_radius:x,padding:f}=this,{labels:g,swidth:p,sheight:b}=this;for(const s of e){const e=i[s]+n.get(s),v=a[s]+r.get(s),w=o.get(s),N=g[s];if(!isFinite(e+v+w)||null==N)continue;const m=p[s],S=b[s],T=u.get(s),V=T.x*m,A=T.y*S;if(t.translate(e,v),t.rotate(w),t.translate(-V,-A),c.v_doit(s)||h.v_doit(s)||_.v_doit(s)){t.beginPath();const e=new d.BBox({x:0,y:0,width:m,height:S});(0,y.round_rect)(t,e,x),c.apply(t,s),h.apply(t,s),_.apply(t,s)}if(l.v_doit(s)){const{left:e,top:s}=f;t.translate(e,s),N.paint(t),t.translate(-e,-s)}t.translate(V,A),t.rotate(-w),t.translate(-e,-v)}}_hit_point(t){const e={x:t.sx,y:t.sy},{sx:s,sy:i,x_offset:a,y_offset:n,angle:r,labels:o}=this,{anchor_:l}=this,{swidth:c,sheight:h}=this,d=this.data_size,u=[];for(let t=0;t<d;t++){const _=s[t]+a.get(t),d=i[t]+n.get(t),f=r.get(t),g=o[t];if(!isFinite(_+d+f)||null==g)continue;const p=c[t],y=h[t],b=l.get(t),v=b.x*p,w=b.y*y,{x:N,y:m}=(0,x.rotate_around)(e,{x:_,y:d},-f),S=_-v,T=d-w;S<=N&&N<=S+p&&T<=m&&m<=T+y&&u.push(t)}return new _.Selection({indices:u})}rect_i(t){const{sx:e,sy:s,x_offset:i,y_offset:a,angle:n,labels:r}=this,{anchor_:o}=this,{swidth:l,sheight:c}=this,h=e[t]+i.get(t),_=s[t]+a.get(t),u=n.get(t),f=r[t];if(!isFinite(h+_+u)||null==f)return{p0:{x:NaN,y:NaN},p1:{x:NaN,y:NaN},p2:{x:NaN,y:NaN},p3:{x:NaN,y:NaN}};const g=l[t],p=c[t],y=o.get(t),b=y.x*g,v=y.y*p,w=new d.BBox({x:h-b,y:_-v,width:g,height:p}),{rect:N}=w;if(0==u)return N;{const t=new x.AffineTransform;return t.rotate_around(h,_,u),t.apply_rect(N)}}scenterxy(t){const{p0:e,p1:s,p2:i,p3:a}=this.rect_i(t);return[(e.x+s.x+i.x+a.x)/4,(e.y+s.y+i.y+a.y)/4]}}s.TextView=v,v.__name__="TextView";class w extends o.XYGlyph{constructor(t){super(t)}}s.Text=w,n=w,w.__name__="Text",n.prototype.default_view=v,n.mixins([l.TextVector,["border_",l.LineVector],["background_",l.FillVector],["background_",l.HatchVector]]),n.define((()=>({text:[c.NullStringSpec,{field:"text"}],angle:[c.AngleSpec,0],x_offset:[c.NumberSpec,0],y_offset:[c.NumberSpec,0],anchor:[b,{value:"auto"}],padding:[g.Padding,0],border_radius:[g.BorderRadius,0]}))),n.override({border_line_color:null,background_fill_color:null,background_hatch_color:null})},
function _(t,s,e,i,r){var h;i();const o=t(1),a=t(331),n=t(24),_=o.__importStar(t(18));class c extends a.LRTBView{scenterxy(t){return[this.sx[t],(this.stop[t]+this.sbottom[t])/2]}_lrtb(t){const s=this.width.get(t)/2,e=this._x[t],i=this._top[t],r=this._bottom[t];return[e-s,e+s,Math.max(i,r),Math.min(i,r)]}_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 t=this.sx.length;this.sleft=new n.ScreenArray(t),this.sright=new n.ScreenArray(t);for(let s=0;s<t;s++)this.sleft[s]=this.sx[s]-this.sw[s]/2,this.sright[s]=this.sx[s]+this.sw[s]/2;this._clamp_viewport()}}e.VBarView=c,c.__name__="VBarView";class p extends a.LRTB{constructor(t){super(t)}}e.VBar=p,h=p,p.__name__="VBar",h.prototype.default_view=c,h.define((({})=>({x:[_.XCoordinateSpec,{field:"x"}],bottom:[_.YCoordinateSpec,{value:0}],width:[_.NumberSpec,{value:1}],top:[_.YCoordinateSpec,{field:"top"}]})))},
function _(t,e,n,s,i){var _;s();const r=t(1),a=t(205),o=t(211),d=t(103),c=t(78),h=r.__importStar(t(39)),x=t(13),l=t(10),p=r.__importStar(t(18)),{abs:u,max:f}=Math;class m extends a.GlyphView{after_visuals(){super.after_visuals(),this.max_line_width=h.max(this.line_width)}_index_data(t){for(const e of this._x)t.add_point(e,0)}_bounds(t){const{x0:e,x1:n}=t;return{x0:e,x1:n,y0:NaN,y1:NaN}}_map_data(){super._map_data();const{round:t}=Math;this.sx=(0,x.map)(this.sx,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[this.sx[t],e]}_render(t,e,n){const{sx:s}=null!=n?n:this,{top:i,bottom:_}=this.renderer.plot_view.frame.bbox;for(const n of e){const e=s[n];isFinite(e)&&(t.beginPath(),t.moveTo(e,i),t.lineTo(e,_),this.visuals.line.apply(t,n))}}_get_candidates(t,e){const{max_line_width:n}=this,[s,i]=this.renderer.xscale.r_invert(t-n,(null!=e?e:t)+n);return this.index.indices({x0:s,x1:i,y0:0,y1:0})}_find_spans(t,e){const{sx:n,line_width:s}=this,i=[];for(const _ of t){e(n[_],s.get(_))&&i.push(_)}return i}_hit_point(t){const{sx:e}=t,n=this._get_candidates(e),s=this._find_spans(n,((t,n)=>u(t-e)<=f(n,2)));return new d.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,l.range)(0,this.data_size);{const{sx:e}=t,n=this._get_candidates(e);return this._find_spans(n,((t,n)=>u(t-e)<=f(n/2,2)))}})();return new d.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:n}=t,s=this._get_candidates(e,n);return this._find_spans(s,((t,s)=>e-s/2<=t&&t<=n+s/2))})();return new d.Selection({indices:e})}draw_legend_for_index(t,e,n){(0,o.generic_line_vector_legend)(this.visuals,t,e,n)}}n.VSpanView=m,m.__name__="VSpanView";class w extends a.Glyph{constructor(t){super(t)}}n.VSpan=w,_=w,w.__name__="VSpan",_.prototype.default_view=m,_.mixins([c.LineVector]),_.define((()=>({x:[p.XCoordinateSpec,{field:"x"}]})))},
function _(t,e,i,s,r){var n;s();const a=t(1),_=t(205),o=t(211),c=t(103),h=t(78),l=t(24),d=t(13),p=a.__importStar(t(34)),x=t(10),u=a.__importStar(t(18));class f extends _.GlyphView{async lazy_initialize(){await super.lazy_initialize();const{webgl:e}=this.renderer.plot_view.canvas_view;if(null!=e&&e.regl_wrapper.has_webgl){const{LRTBGL:i}=await Promise.resolve().then((()=>a.__importStar(t(544))));this.glglyph=new i(e.regl_wrapper,this)}}get sleft(){return this.sx0}get sright(){return this.sx1}get stop(){const{top:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new l.ScreenArray(e);return i.fill(t),i}get sbottom(){const{bottom:t}=this.renderer.plot_view.frame.bbox,e=this.data_size,i=new l.ScreenArray(e);return i.fill(t),i}_set_data(t){super._set_data(t);const{abs:e}=Math,{max:i,map:s,zip:r}=p,{_x0:n,_x1:a}=this;this.max_width=i(s(r(n,a),(([t,i])=>e(t-i))))}_index_data(t){const{_x0:e,_x1:i,data_size:s}=this;for(let r=0;r<s;r++){const s=e[r],n=i[r];t.add_rect(s,0,n,0)}}_bounds(t){const{x0:e,x1:i}=t;return{x0:e,x1:i,y0:NaN,y1:NaN}}_map_data(){super._map_data();const{round:t}=Math;this.sx0=(0,d.map)(this.sx0,(e=>t(e))),this.sx1=(0,d.map)(this.sx1,(e=>t(e)))}scenterxy(t){const{vcenter:e}=this.renderer.plot_view.frame.bbox;return[(this.sx0[t]+this.sx1[t])/2,e]}_render(t,e,i){const{sx0:s,sx1:r}=null!=i?i:this,{top:n,bottom:a,height:_}=this.renderer.plot_view.frame.bbox;for(const i of e){const e=s[i],o=r[i];isFinite(e+o)&&(t.beginPath(),t.rect(e,n,o-e,_),this.visuals.fill.apply(t,i),this.visuals.hatch.apply(t,i),t.beginPath(),t.moveTo(e,n),t.lineTo(e,a),t.moveTo(o,n),t.lineTo(o,a),this.visuals.line.apply(t,i))}}_get_candidates(t,e){const{max_width:i}=this,[s,r]=this.renderer.xscale.r_invert(t,null!=e?e:t),n=s-i,a=r+i;return this.index.indices({x0:n,x1:a,y0:0,y1:0})}_find_strips(t,e){function i(t,i){return t<=i?e(t,i):e(i,t)}const{sx0:s,sx1:r}=this,n=[];for(const e of t){i(s[e],r[e])&&n.push(e)}return n}_hit_point(t){const{sx:e}=t,i=this._get_candidates(e),s=this._find_strips(i,((t,i)=>t<=e&&e<=i));return new c.Selection({indices:s})}_hit_span(t){const e=(()=>{if("h"==t.direction)return(0,x.range)(0,this.data_size);{const{sx:e}=t,i=this._get_candidates(e);return this._find_strips(i,((t,i)=>t<=e&&e<=i))}})();return new c.Selection({indices:e})}_hit_rect(t){const e=(()=>{const{sx0:e,sx1:i}=t,s=this._get_candidates(e,i);return this._find_strips(s,((t,s)=>e<=t&&t<=i&&e<=s&&s<=i))})();return new c.Selection({indices:e})}draw_legend_for_index(t,e,i){(0,o.generic_area_vector_legend)(this.visuals,t,e,i)}}i.VStripView=f,f.__name__="VStripView";class w extends _.Glyph{constructor(t){super(t)}}i.VStrip=w,n=w,w.__name__="VStrip",n.prototype.default_view=f,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((()=>({x0:[u.XCoordinateSpec,{field:"x0"}],x1:[u.XCoordinateSpec,{field:"x1"}]})))},
function _(e,s,t,i,a){var n;i();const r=e(1),l=e(204),d=e(211),h=e(78),c=e(24),o=e(20),_=r.__importStar(e(18)),g=e(11),u=e(103),p=e(13);class x extends l.XYGlyphView{async load_glglyph(){const{WedgeGL:s}=await Promise.resolve().then((()=>r.__importStar(e(549))));return s}_map_data(){"data"==this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this.radius):this.sradius=(0,c.to_screen)(this.radius),this.max_sradius=(0,p.max)(this.sradius)}_render(e,s,t){const{sx:i,sy:a,sradius:n,start_angle:r,end_angle:l}=null!=t?t:this,d="anticlock"==this.model.direction;for(const t of s){const s=i[t],h=a[t],c=n[t],o=r.get(t),_=l.get(t);isFinite(s+h+c+o+_)&&(e.beginPath(),e.arc(s,h,c,o,_,d),e.lineTo(s,h),e.closePath(),this.visuals.fill.apply(e,t),this.visuals.hatch.apply(e,t),this.visuals.line.apply(e,t))}}_hit_point(e){let s,t,i,a,n;const{sx:r,sy:l}=e,d=this.renderer.xscale.invert(r),h=this.renderer.yscale.invert(l);t=r-this.max_sradius,i=r+this.max_sradius;const[c,o]=this.renderer.xscale.r_invert(t,i);a=l-this.max_sradius,n=l+this.max_sradius;const[_,p]=this.renderer.yscale.r_invert(a,n),x=[];for(const e of this.index.indices({x0:c,x1:o,y0:_,y1:p})){const r=this.sradius[e]**2;[t,i]=this.renderer.xscale.r_compute(d,this._x[e]),[a,n]=this.renderer.yscale.r_compute(h,this._y[e]),s=(t-i)**2+(a-n)**2,s<=r&&x.push(e)}const y="anticlock"==this.model.direction,m=[];for(const e of x){const s=Math.atan2(l-this.sy[e],r-this.sx[e]);(Math.abs(this.start_angle.get(e)-this.end_angle.get(e))>=2*Math.PI||(0,g.angle_between)(-s,-this.start_angle.get(e),-this.end_angle.get(e),y))&&m.push(e)}return new u.Selection({indices:m})}draw_legend_for_index(e,s,t){(0,d.generic_area_vector_legend)(this.visuals,e,s,t)}scenterxy(e){const s=this.sradius[e]/2,t=(this.start_angle.get(e)+this.end_angle.get(e))/2;return[this.sx[e]+s*Math.cos(t),this.sy[e]+s*Math.sin(t)]}}t.WedgeView=x,x.__name__="WedgeView";class y extends l.XYGlyph{constructor(e){super(e)}}t.Wedge=y,n=y,y.__name__="Wedge",n.prototype.default_view=x,n.mixins([h.LineVector,h.FillVector,h.HatchVector]),n.define((({})=>({direction:[o.Direction,"anticlock"],radius:[_.DistanceSpec,{field:"radius"}],start_angle:[_.AngleSpec,{field:"start_angle"}],end_angle:[_.AngleSpec,{field:"end_angle"}]})))},
function _(n,i,o,a,r){a(),r("Decoration",n(210).Decoration),r("Marking",n(142).Marking)},
function _(t,_,r,o,a){o();const e=t(1);e.__exportStar(t(365),r),e.__exportStar(t(366),r),e.__exportStar(t(367),r)},
function _(e,t,d,n,s){n();const o=e(50),r=e(13),i=e(10),_=e(103);class a extends o.Model{constructor(e){super(e)}_hit_test(e,t,d){if(!t.model.visible)return null;const n=d.glyph.hit_test(e);return null==n?null:d.model.view.convert_selection_from_subset(n)}}d.GraphHitTestPolicy=a,a.__name__="GraphHitTestPolicy";class c extends a{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.edge_view)}do_selection(e,t,d,n){if(null==e)return!1;const s=t.edge_renderer.data_source.selected;return s.update(e,d,n),t.edge_renderer.data_source._select.emit(),!s.is_empty()}do_inspection(e,t,d,n,s){if(null==e)return!1;const{edge_renderer:o}=d.model,r=o.get_selection_manager().get_or_create_inspector(d.edge_view.model);return r.update(e,n,s),d.edge_view.model.data_source.setv({inspected:r},{silent:!0}),d.edge_view.model.data_source.inspect.emit([d.edge_view.model,{geometry:t}]),!r.is_empty()}}d.EdgesOnly=c,c.__name__="EdgesOnly";class l extends a{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.node_view)}do_selection(e,t,d,n){if(null==e)return!1;const s=t.node_renderer.data_source.selected;return s.update(e,d,n),t.node_renderer.data_source._select.emit(),!s.is_empty()}do_inspection(e,t,d,n,s){if(null==e)return!1;const{node_renderer:o}=d.model,r=o.get_selection_manager().get_or_create_inspector(d.node_view.model);return r.update(e,n,s),d.node_view.model.data_source.setv({inspected:r},{silent:!0}),d.node_view.model.data_source.inspect.emit([d.node_view.model,{geometry:t}]),!r.is_empty()}}d.NodesOnly=l,l.__name__="NodesOnly";class u extends a{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.node_view)}get_linked_edges(e,t,d){const n=(()=>{switch(d){case"selection":return(0,r.map)(e.selected.indices,(t=>e.data.index[t]));case"inspection":return(0,r.map)(e.inspected.indices,(t=>e.data.index[t]))}})(),s=[];for(let e=0;e<t.data.start.length;e++)((0,i.contains)(n,t.data.start[e])||(0,i.contains)(n,t.data.end[e]))&&s.push(e);const o=new _.Selection;for(const e of s)o.multiline_indices[e]=[0];return o.indices=s,o}do_selection(e,t,d,n){if(null==e)return!1;const s=t.node_renderer.data_source.selected;s.update(e,d,n);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,d,n),t.node_renderer.data_source._select.emit(),!s.is_empty()}do_inspection(e,t,d,n,s){if(null==e)return!1;const o=d.node_view.model.data_source.selection_manager.get_or_create_inspector(d.node_view.model);o.update(e,n,s),d.node_view.model.data_source.setv({inspected:o},{silent:!0});const r=d.edge_view.model.data_source.selection_manager.get_or_create_inspector(d.edge_view.model),i=this.get_linked_edges(d.node_view.model.data_source,d.edge_view.model.data_source,"inspection");return r.update(i,n,s),d.edge_view.model.data_source.setv({inspected:r},{silent:!0}),d.node_view.model.data_source.inspect.emit([d.node_view.model,{geometry:t}]),!o.is_empty()}}d.NodesAndLinkedEdges=u,u.__name__="NodesAndLinkedEdges";class m extends a{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.edge_view)}get_linked_nodes(e,t,d){const n=(()=>{switch(d){case"selection":return t.selected.indices;case"inspection":return t.inspected.indices}})(),s=[];for(const e of n)s.push(t.data.start[e]),s.push(t.data.end[e]);const o=(0,i.uniq)(s).map((t=>(0,r.index_of)(e.data.index,t)));return new _.Selection({indices:o})}do_selection(e,t,d,n){if(null==e)return!1;const s=t.edge_renderer.data_source.selected;s.update(e,d,n);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,d,n),t.edge_renderer.data_source._select.emit(),!s.is_empty()}do_inspection(e,t,d,n,s){if(null==e)return!1;const o=d.edge_view.model.data_source.selection_manager.get_or_create_inspector(d.edge_view.model);o.update(e,n,s),d.edge_view.model.data_source.setv({inspected:o},{silent:!0});const r=d.node_view.model.data_source.selection_manager.get_or_create_inspector(d.node_view.model),i=this.get_linked_nodes(d.node_view.model.data_source,d.edge_view.model.data_source,"inspection");return r.update(i,n,s),d.node_view.model.data_source.setv({inspected:r},{silent:!0}),d.edge_view.model.data_source.inspect.emit([d.edge_view.model,{geometry:t}]),!o.is_empty()}}d.EdgesAndLinkedNodes=m,m.__name__="EdgesAndLinkedNodes";class p extends a{constructor(e){super(e)}hit_test(e,t){return this._hit_test(e,t,t.node_view)}get_adjacent_nodes(e,t,d){const n=(()=>{switch(d){case"selection":return(0,r.map)(e.selected.indices,(t=>e.data.index[t]));case"inspection":return(0,r.map)(e.inspected.indices,(t=>e.data.index[t]))}})(),s=[],o=[];for(let e=0;e<t.data.start.length;e++)(0,i.contains)(n,t.data.start[e])&&(s.push(t.data.end[e]),o.push(t.data.start[e])),(0,i.contains)(n,t.data.end[e])&&(s.push(t.data.start[e]),o.push(t.data.end[e]));for(let e=0;e<o.length;e++)s.push(o[e]);const a=(0,i.uniq)(s).map((t=>(0,r.index_of)(e.data.index,t)));return new _.Selection({indices:a})}do_selection(e,t,d,n){if(null==e)return!1;const s=t.node_renderer.data_source.selected;s.update(e,d,n);const o=this.get_adjacent_nodes(t.node_renderer.data_source,t.edge_renderer.data_source,"selection");return o.is_empty()||s.update(o,d,n),t.node_renderer.data_source._select.emit(),!s.is_empty()}do_inspection(e,t,d,n,s){if(null==e)return!1;const o=d.node_view.model.data_source.selection_manager.get_or_create_inspector(d.node_view.model);o.update(e,n,s),d.node_view.model.data_source.setv({inspected:o},{silent:!0});const r=this.get_adjacent_nodes(d.node_view.model.data_source,d.edge_view.model.data_source,"inspection");return r.is_empty()||(o.update(r,n,s),d.node_view.model.data_source.setv({inspected:o},{silent:!0})),d.node_view.model.data_source.inspect.emit([d.node_view.model,{geometry:t}]),!o.is_empty()}}d.NodesAndAdjacentNodes=p,p.__name__="NodesAndAdjacentNodes"},
function _(e,o,t,r,n){var s;r();const a=e(50),d=e(313);class _ extends a.Model{constructor(e){super(e)}get node_coordinates(){return new u({layout:this})}get edge_coordinates(){return new i({layout:this})}}t.LayoutProvider=_,_.__name__="LayoutProvider";class c extends d.CoordinateTransform{constructor(e){super(e)}}t.GraphCoordinates=c,s=c,c.__name__="GraphCoordinates",s.define((({Ref:e})=>({layout:[e(_)]})));class u extends c{constructor(e){super(e)}_v_compute(e){const[o,t]=this.layout.get_node_coordinates(e);return{x:o,y:t}}}t.NodeCoordinates=u,u.__name__="NodeCoordinates";class i extends c{constructor(e){super(e)}_v_compute(e){const[o,t]=this.layout.get_edge_coordinates(e);return{x:o,y:t}}}t.EdgeCoordinates=i,i.__name__="EdgeCoordinates"},
function _(t,e,a,n,o){var l;n();const r=t(366),s=t(9);class u extends r.LayoutProvider{constructor(t){super(t)}get_node_coordinates(t){var e,a;const n=null!==(e=new s.Dict(t.data).get("index"))&&void 0!==e?e:[],o=n.length,l=new Float64Array(o),r=new Float64Array(o),{graph_layout:u}=this;for(let t=0;t<o;t++){const e=n[t],[o,s]=null!==(a=u.get(e))&&void 0!==a?a:[NaN,NaN];l[t]=o,r[t]=s}return[l,r]}get_edge_coordinates(t){var e,a,n,o;const l=new s.Dict(t.data),r=null!==(e=l.get("start"))&&void 0!==e?e:[],u=null!==(a=l.get("end"))&&void 0!==a?a:[],i=Math.min(r.length,u.length),d=[],g=[],c=l.get("xs"),h=l.get("ys"),N=null!=c&&null!=h,{graph_layout:v}=this;for(let t=0;t<i;t++){const e=v.has(r[t])&&v.has(u[t]);if(N&&e)d.push(c[t]),g.push(h[t]);else{const e=null!==(n=v.get(r[t]))&&void 0!==n?n:[NaN,NaN],a=null!==(o=v.get(u[t]))&&void 0!==o?o:[NaN,NaN];d.push([e[0],a[0]]),g.push([e[1],a[1]])}}return[d,g]}}a.StaticLayoutProvider=u,l=u,u.__name__="StaticLayoutProvider",l.define((({Number:t,Int:e,Arrayable:a,Map:n})=>({graph_layout:[n(e,a(t)),new globalThis.Map]})))},
function _(i,d,n,r,G){r(),G("Grid",i(369).Grid)},
function _(i,e,s,n,t){var r;n();const o=i(1),d=i(160),_=i(162),a=i(163),l=o.__importStar(i(78)),h=i(8);class u extends _.GuideRendererView{_render(){const i=this.layer.ctx;i.save(),this._draw_regions(i),this._draw_minor_grids(i),this._draw_grids(i),i.restore()}connect_signals(){super.connect_signals(),this.connect(this.model.change,(()=>this.request_render()))}_draw_regions(i){if(!this.visuals.band_fill.doit&&!this.visuals.band_hatch.doit)return;const[e,s]=this.grid_coords("major",!1);for(let n=0;n<e.length-1;n++){if(n%2!=1)continue;const[t,r]=this.coordinates.map_to_screen(e[n],s[n]),[o,d]=this.coordinates.map_to_screen(e[n+1],s[n+1]);i.beginPath(),i.rect(t[0],r[0],o[1]-t[0],d[1]-r[0]),this.visuals.band_fill.apply(i),this.visuals.band_hatch.apply(i)}}_draw_grids(i){if(!this.visuals.grid_line.doit)return;const[e,s]=this.grid_coords("major");this._draw_grid_helper(i,this.visuals.grid_line,e,s)}_draw_minor_grids(i){if(!this.visuals.minor_grid_line.doit)return;const[e,s]=this.grid_coords("minor");this._draw_grid_helper(i,this.visuals.minor_grid_line,e,s)}_draw_grid_helper(i,e,s,n){e.set_value(i),i.beginPath();for(let e=0;e<s.length;e++){const[t,r]=this.coordinates.map_to_screen(s[e],n[e]);i.moveTo(Math.round(t[0]),Math.round(r[0]));for(let e=1;e<t.length;e++)i.lineTo(Math.round(t[e]),Math.round(r[e]))}i.stroke()}ranges(){const i=this.model.dimension,e=1-i,{ranges:s}=this.coordinates;return[s[i],s[e]]}computed_bounds(){const[i]=this.ranges(),e=this.model.bounds,s=[i.min,i.max];let n,t;if((0,h.isArray)(e))n=Math.min(e[0],e[1]),t=Math.max(e[0],e[1]),n<s[0]&&(n=s[0]),t>s[1]&&(t=s[1]);else{[n,t]=s;for(const i of this.plot_view.axis_views)i.dimension==this.model.dimension&&i.model.x_range_name==this.model.x_range_name&&i.model.y_range_name==this.model.y_range_name&&([n,t]=i.computed_bounds)}return[n,t]}grid_coords(i,e=!0){const s=this.model.dimension,n=1-s,[t,r]=this.ranges(),[o,d]=(()=>{const[i,e]=this.computed_bounds();return[Math.min(i,e),Math.max(i,e)]})(),_=[[],[]],a=this.model.get_ticker();if(null==a)return _;const l=a.get_ticks(o,d,t,r.min)[i],h=t.min,u=t.max,[c,m]=(()=>{const{cross_bounds:i}=this.model;return"auto"==i?[r.min,r.max]:i})();e||(l[0]!=h&&l.splice(0,0,h),l[l.length-1]!=u&&l.push(u));for(let i=0;i<l.length;i++){if((l[i]==h||l[i]==u)&&e)continue;const t=[],r=[],o=2;for(let e=0;e<o;e++){const s=c+(m-c)/(o-1)*e;t.push(l[i]),r.push(s)}_[s].push(t),_[n].push(r)}return _}}s.GridView=u,u.__name__="GridView";class c extends _.GuideRenderer{constructor(i){super(i)}get_ticker(){return null!=this.ticker?this.ticker:null!=this.axis?this.axis.ticker:null}}s.Grid=c,r=c,c.__name__="Grid",r.prototype.default_view=u,r.mixins([["grid_",l.Line],["minor_grid_",l.Line],["band_",l.Fill],["band_",l.Hatch]]),r.define((({Number:i,Auto:e,Enum:s,Ref:n,Tuple:t,Or:r,Nullable:o})=>({bounds:[r(t(i,i),e),"auto"],cross_bounds:[r(t(i,i),e),"auto"],dimension:[s(0,1),0],axis:[o(n(d.Axis)),null],ticker:[o(n(a.Ticker)),null]}))),r.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},
function _(o,x,B,a,l){a(),l("Column",o(371).Column),l("FlexBox",o(372).FlexBox),l("GridBox",o(377).GridBox),l("GroupBox",o(379).GroupBox),l("HBox",o(381).HBox),l("LayoutDOM",o(373).LayoutDOM),l("Row",o(382).Row),l("ScrollBox",o(383).ScrollBox),l("Spacer",o(384).Spacer),l("TabPanel",o(385).TabPanel),l("Tabs",o(386).Tabs),l("VBox",o(388).VBox)},
function _(e,o,n,t,s){var u;t();const _=e(372);class c extends _.FlexBoxView{constructor(){super(...arguments),this._direction="column"}}n.ColumnView=c,c.__name__="ColumnView";class l extends _.FlexBox{constructor(e){super(e)}}n.Column=l,u=l,l.__name__="Column",u.prototype.default_view=c},
function _(e,t,i,n,o){var s;n();const a=e(373),c=e(376),r=e(233),l=e(266),h=e(56);class d extends a.LayoutDOMView{connect_signals(){super.connect_signals();const{children:e}=this.model.properties;this.on_change(e,(()=>this.update_children()))}get child_models(){return this.model.children}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flex"}}_update_layout(){super._update_layout(),this.style.append(":host",{flex_direction:this._direction,gap:(0,h.px)(this.model.spacing)});const e=new r.Container;let t=0,i=0;for(const n of this.child_views){if(!(n instanceof a.LayoutDOMView))continue;const o=n.box_sizing(),s=(()=>{const e="row"==this._direction?o.width_policy:o.height_policy,t="row"==this._direction?o.width:o.height,i=null!=t?(0,h.px)(t):"auto";switch(e){case"auto":case"fixed":return`0 0 ${i}`;case"fit":return"1 1 auto";case"min":return"0 1 auto";case"max":return"1 0 0px"}})(),c=(()=>{switch("row"==this._direction?o.height_policy:o.width_policy){case"auto":case"fixed":case"fit":case"min":return"row"==this._direction?o.valign:o.halign;case"max":return"stretch"}})();n.style.append(":host",{flex:s,align_self:c}),"row"==this._direction?"max"==o.height_policy&&n.style.append(":host",{height:"auto"}):"max"==o.width_policy&&n.style.append(":host",{width:"auto"}),null!=n.layout&&(e.add({r0:t,c0:i,r1:t+1,c1:i+1},n),"row"==this._direction?i+=1:t+=1)}0!=e.size?(this.layout=new c.GridAlignmentLayout(e),this.layout.set_sizing()):delete this.layout}}i.FlexBoxView=d,d.__name__="FlexBoxView";class _ extends a.LayoutDOM{constructor(e){super(e)}}i.FlexBox=_,s=_,_.__name__="FlexBox",s.define((({Number:e,Array:t,Ref:i})=>({children:[t(i(l.UIElement)),[]],spacing:[e,0]})))},
function _(t,e,i,s,l){var n;s();const a=t(266),o=t(374),r=t(19),h=t(15),u=t(20),_=t(56),d=t(8),c=t(59),f=t(231),m=t(16),p=t(269),w=t(12);class y extends a.UIElementView{constructor(){super(...arguments),this._child_views=new Map,this.mouseenter=new h.Signal(this,"mouseenter"),this.mouseleave=new h.Signal(this,"mouseleave"),this.disabled=new h.Signal(this,"disabled"),this._resized=!1,this._auto_width="fit-content",this._auto_height="fit-content",this._layout_computed=!1,this._was_built=!1}get is_layout_root(){return this.is_root||!(this.parent instanceof y)}_after_resize(){this._resized=!0,super._after_resize(),this.is_layout_root&&!this._was_built?(r.logger.warn(`${this} wasn't built properly`),this.render_to(null)):this.compute_layout()}async lazy_initialize(){await super.lazy_initialize(),await this.build_child_views()}remove(){for(const t of this.child_views)t.remove();this._child_views.clear(),super.remove()}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(t=>{this.mouseenter.emit(t)})),this.el.addEventListener("mouseleave",(t=>{this.mouseleave.emit(t)})),this.el.addEventListener("contextmenu",(t=>{null!=this.model.context_menu&&(console.log("context menu"),t.preventDefault())})),this.parent instanceof y&&this.connect(this.parent.disabled,(t=>{this.disabled.emit(t||this.model.disabled)}));const t=this.model.properties;this.on_change(t.disabled,(()=>{this.disabled.emit(this.model.disabled)})),this.on_change([t.css_classes,t.stylesheets,t.width,t.height,t.min_width,t.min_height,t.max_width,t.max_height,t.margin,t.width_policy,t.height_policy,t.flow_mode,t.sizing_mode,t.aspect_ratio,t.visible],(()=>this.invalidate_layout()))}*children(){yield*super.children(),yield*this.child_views}get child_views(){return this.child_models.map((t=>this._child_views.get(t))).filter(d.isNotNull)}get layoutable_views(){return this.child_views.filter((t=>t instanceof y))}async build_child_views(){const{created:t,removed:e}=await(0,c.build_views)(this._child_views,this.child_models,{parent:this});for(const t of e)this._resize_observer.unobserve(t.el);for(const e of t)this._resize_observer.observe(e.el,{box:"border-box"});return t}render(){super.render();for(const t of this.child_views)t.render(),this.shadow_el.appendChild(t.el)}_update_children(){}async update_children(){const t=new Set(await this.build_child_views());if(0!=t.size){for(const t of this.child_views)(0,_.remove)(t.el);for(const e of this.child_views)this.shadow_el.append(e.el),t.has(e)&&(e.render(),e.after_render())}this._update_children(),this.invalidate_layout()}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flow"}}_update_layout(){function t(t,e,i,s){switch(t){case"auto":return null!=e?(0,_.px)(e):i;case"fixed":return null!=e?(0,_.px)(e):"fit-content";case"fit":return"fit-content";case"min":return"min-content";case"max":return null==s?"100%":`calc(100% - ${s})`}}function e(t){return(0,d.isNumber)(t)?(0,_.px)(t):`${t.percent}%`}const i={},s=this._intrinsic_display();i.display=function(t){const{inner:e,outer:i}=t;switch(`${e} ${i}`){case"block flow":return"block";case"inline flow":return"inline";case"block flow-root":return"flow-root";case"inline flow-root":return"inline-block";case"block flex":return"flex";case"inline flex":return"inline-flex";case"block grid":return"grid";case"inline grid":return"inline-grid";case"block table":return"table";case"inline table":return"inline-table";default:(0,w.unreachable)()}}(s);const l=this.box_sizing(),{width_policy:n,height_policy:a,width:o,height:r,aspect_ratio:h}=l,u=(()=>{if("auto"==h){if(null!=o&&null!=r)return o/r}else if((0,d.isNumber)(h))return h;return null})();"auto"==h?i.aspect_ratio=null!=o&&null!=r?`${o} / ${r}`:"auto":(0,d.isNumber)(h)&&(i.aspect_ratio=`${h}`);const{margin:c}=this.model,f=(()=>{if(null!=c){if((0,d.isNumber)(c))return i.margin=(0,_.px)(c),{width:(0,_.px)(2*c),height:(0,_.px)(2*c)};if(2==c.length){const[t,e]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)}`,{width:(0,_.px)(2*e),height:(0,_.px)(2*t)}}{const[t,e,s,l]=c;return i.margin=`${(0,_.px)(t)} ${(0,_.px)(e)} ${(0,_.px)(s)} ${(0,_.px)(l)}`,{width:(0,_.px)(l+e),height:(0,_.px)(t+s)}}}return{width:null,height:null}})(),[m,p]=(()=>{const e=t(n,o,this._auto_width,f.width),i=t(a,r,this._auto_height,f.height);if(null!=h){if(n!=a)return"fixed"==n?[e,"auto"]:"fixed"==a?["auto",i]:"max"==n?[e,"auto"]:"max"==a?["auto",i]:["auto","auto"];if("fixed"!=n&&"fixed"!=a&&null!=u)return u>=1?[e,"auto"]:["auto",i]}return[e,i]})();i.width=m,i.height=p;const{min_width:y,max_width:g}=this.model,{min_height:b,max_height:x}=this.model;i.min_width=null==y?"0px":e(y),i.min_height=null==b?"0px":e(b),this.is_layout_root?(null!=g&&(i.max_width=e(g)),null!=x&&(i.max_height=e(x))):(null!=g?i.max_width=`min(${e(g)}, 100%)`:"fixed"!=n&&(i.max_width="100%"),null!=x?i.max_height=`min(${e(x)}, 100%)`:"fixed"!=a&&(i.max_height="100%"));const{resizable:v}=this.model;if(!1!==v){const t=(()=>{switch(v){case"width":return"horizontal";case"height":return"vertical";case!0:case"both":return"both"}})();i.resize=t,i.overflow="auto"}this.style.append(":host",i)}update_layout(){this.update_style();for(const t of this.layoutable_views)t.update_layout();this._update_layout()}get is_managed(){return this.parent instanceof y}_measure_layout(){}measure_layout(){for(const t of this.layoutable_views)t.measure_layout();this._measure_layout()}compute_layout(){this.parent instanceof y?this.parent.compute_layout():(this.measure_layout(),this.update_bbox(),this._compute_layout(),this.after_layout()),this._layout_computed=!0}_compute_layout(){if(null!=this.layout){this.layout.compute(this.bbox.size);for(const t of this.layoutable_views)null==t.layout?t._compute_layout():t._propagate_layout()}else for(const t of this.layoutable_views)t._compute_layout()}_propagate_layout(){for(const t of this.layoutable_views)null==t.layout&&t._compute_layout()}update_bbox(){for(const t of this.layoutable_views)t.update_bbox();const t=super.update_bbox();return null!=this.layout&&(this.layout.visible=this.is_displayed),t}_after_layout(){}after_layout(){for(const t of this.layoutable_views)t.after_layout();this._after_layout()}render_to(t){if(!this.is_layout_root)throw new Error(`${this.toString()} is not a root layout`);this.render(),null!=t&&t.appendChild(this.el),this.r_after_render(),this._was_built=!0,this.notify_finished()}r_after_render(){for(const t of this.child_views)t instanceof y?t.r_after_render():t.after_render();this.after_render()}after_render(){this._after_render(),this.is_managed||this.invalidate_layout(),this._has_finished||(this.is_displayed?(0,m.defer)().then((()=>{this._resized||this.finish()})):this.finish())}async rebuild(){await this.build_child_views(),this.invalidate_render()}invalidate_layout(){this.parent instanceof y?this.parent.invalidate_layout():(this.update_layout(),this.compute_layout())}invalidate_render(){this.render(),this.invalidate_layout()}has_finished(){if(!super.has_finished())return!1;if(this.is_layout_root&&!this._layout_computed)return!1;for(const t of this.child_views)if(!t.has_finished())return!1;return!0}box_sizing(){let{width_policy:t,height_policy:e,aspect_ratio:i}=this.model;const{sizing_mode:s}=this.model;if(null!=s)if("inherit"==s){if(this.parent instanceof y){const s=this.parent.box_sizing();t=s.width_policy,e=s.height_policy,null==i&&(i=s.aspect_ratio)}}else if("fixed"==s)t=e="fixed";else if("stretch_both"==s)t=e="max";else if("stretch_width"==s)t="max";else if("stretch_height"==s)e="max";else switch(null==i&&(i="auto"),s){case"scale_width":t="max",e="min";break;case"scale_height":t="min",e="max";break;case"scale_both":t="max",e="max"}const[l,n]=(()=>{const{align:t}=this.model;return"auto"==t?[void 0,void 0]:(0,d.isArray)(t)?t:[t,t]})(),{width:a,height:o}=this.model;return{width_policy:t,height_policy:e,width:a,height:o,aspect_ratio:i,halign:l,valign:n}}export(t="auto",e=!0){const i=(()=>{switch(t){case"auto":case"png":return"canvas";case"svg":return"svg"}})(),s=new p.CanvasLayer(i,e),{x:l,y:n,width:a,height:o}=this.bbox;s.resize(a,o);const r=getComputedStyle(this.el).backgroundColor;s.ctx.fillStyle=r,s.ctx.fillRect(l,n,a,o);for(const i of this.child_views){const l=i.export(t,e),{x:n,y:a}=i.bbox.scale(s.pixel_ratio);s.ctx.drawImage(l.canvas,n,a)}return s}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{children:this.child_views.map((t=>t.serializable_state()))})}}i.LayoutDOMView=y,y.__name__="LayoutDOMView";class g extends a.UIElement{constructor(t){super(t)}}i.LayoutDOM=g,n=g,g.__name__="LayoutDOM",n.define((t=>{const{Boolean:e,Number:i,Auto:s,Tuple:l,Or:n,Null:a,Nullable:r,Ref:h}=t,_=l(i,i),d=l(i,i,i,i);return{width:[r(i),null],height:[r(i),null],min_width:[r(i),null],min_height:[r(i),null],max_width:[r(i),null],max_height:[r(i),null],margin:[r(n(i,_,d)),null],width_policy:[n(f.SizingPolicy,s),"auto"],height_policy:[n(f.SizingPolicy,s),"auto"],aspect_ratio:[n(i,s,a),null],flow_mode:[u.FlowMode,"block"],sizing_mode:[r(u.SizingMode),null],disabled:[e,!1],align:[n(u.Align,l(u.Align,u.Align),s),"auto"],context_menu:[r(h(o.Menu)),null],resizable:[n(e,u.Dimensions),!1]}}))},
function _(e,s,t,i,r){var n;i();const a=e(1),l=e(266),o=e(375),d=e(20),m=e(59),u=e(34),c=a.__importStar(e(277)),h=c;class _ extends l.UIElementView{constructor(){super(...arguments),this.items=new Map}stylesheets(){return[...super.stylesheets(),c.default]}*children(){yield*super.children(),yield*this.items.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,m.build_views)(this.items,this.model.items)}remove(){(0,m.remove_views)(this.items),super.remove()}render(){super.render(),this.el.classList.add(h[this.model.orientation]);const e=(()=>{const{items:e,reversed:s}=this.model,t=s?(0,u.reverse)(e):e;return(0,u.map)(t,(e=>this.items.get(e)))})();for(const s of e)s.render(),this.shadow_el.appendChild(s.el)}}t.MenuView=_,_.__name__="MenuView";class p extends l.UIElement{constructor(e){super(e)}}t.Menu=p,n=p,p.__name__="Menu",n.define((({Boolean:e,Array:s,Ref:t})=>({items:[s(t(o.MenuItem)),[]],reversed:[e,!1],orientation:[d.Orientation,"vertical"]})))},
function _(e,t,s,n,u){n();const _=e(1),l=e(266),m=_.__importDefault(e(277)),a=_.__importDefault(e(278));class r extends l.UIElementView{stylesheets(){return[...super.stylesheets(),m.default,a.default]}}s.MenuItemView=r,r.__name__="MenuItemView";class c extends l.UIElement{constructor(e){super(e)}}s.MenuItem=c,c.__name__="MenuItem"},
function _(t,o,e,i,l){i();const n=t(148),r=t(57),h=t(12),{max:u}=Math;class s extends n.Layoutable{constructor(t){super(),this.children=t}_measure(t){return{width:0,height:0}}compute(t={}){const{width:o,height:e}=t;(0,h.assert)(null!=o&&null!=e);const i={width:o,height:e},l=new r.BBox({left:0,top:0,width:o,height:e});let n;if(null!=i.inner){const{left:t,top:l,right:h,bottom:u}=i.inner;n=new r.BBox({left:t,top:l,right:o-h,bottom:e-u})}this.set_geometry(l,n)}_set_geometry(t,o){super._set_geometry(t,o);const e=this.children.map(((t,o)=>{const{layout:e,bbox:i}=o;(0,h.assert)(null!=e);const l=e.measure(i);return{child:o,layout:e,bbox:i,size_hint:l}})),i=Array(e.nrows).fill(null).map((()=>({top:0,bottom:0}))),l=Array(e.ncols).fill(null).map((()=>({left:0,right:0})));e.foreach((({r0:t,c0:o,r1:e,c1:n},{size_hint:r})=>{const{inner:h}=r;null!=h&&(l[o].left=u(l[o].left,h.left),l[n].right=u(l[n].right,h.right),i[t].top=u(i[t].top,h.top),i[e].bottom=u(i[e].bottom,h.bottom))})),e.foreach((({r0:t,c0:o,r1:e,c1:n},{layout:h,size_hint:u,bbox:s})=>{const f=s,g=null==u.inner?void 0:(()=>{var h,s,g,m,c,d;const{inner:b,align:p}=u,a=null===(h=null==p?void 0:p.left)||void 0===h||h,_=null===(s=null==p?void 0:p.right)||void 0===s||s,v=null===(g=null==p?void 0:p.top)||void 0===g||g,w=null===(m=null==p?void 0:p.bottom)||void 0===m||m,y=null!==(c=null==p?void 0:p.fixed_width)&&void 0!==c&&c,x=null!==(d=null==p?void 0:p.fixed_height)&&void 0!==d&&d,{left:B,right:A}=(()=>{if(y){const t=f.width-b.right-b.left;if(a){const e=l[o].left;return{left:e,right:f.width-(e+t)}}if(_){const o=l[n].right;return{left:f.width-(o+t),right:o}}return{left:b.left,right:b.right}}return{left:a?l[o].left:b.left,right:_?l[n].right:b.right}})(),{top:z,bottom:L}=(()=>{if(x){const o=f.height-b.bottom-b.top;if(v){const e=i[t].top;return{top:e,bottom:f.height-(e+o)}}if(w){const t=i[e].bottom;return{top:f.height-(t+o),bottom:t}}return{top:b.top,bottom:b.bottom}}return{top:v?i[t].top:b.top,bottom:w?i[e].bottom:b.bottom}})(),{width:G,height:M}=f;return r.BBox.from_lrtb({left:B,top:z,right:G-A,bottom:M-L})})();h.set_geometry(f,g)}))}}e.GridAlignmentLayout=s,s.__name__="GridAlignmentLayout"},
function _(e,i,n,r,s){var o;r();const t=e(378),l=e(238),c=e(266);class d extends t.CSSGridBoxView{connect_signals(){super.connect_signals();const{children:e,rows:i,cols:n}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change([i,n],(()=>this.invalidate_layout()))}get _children(){return this.model.children}get _rows(){return this.model.rows}get _cols(){return this.model.cols}}n.GridBoxView=d,d.__name__="GridBoxView";class _ extends t.CSSGridBox{constructor(e){super(e)}}n.GridBox=_,o=_,_.__name__="GridBox",o.prototype.default_view=d,o.define((({Array:e,Nullable:i})=>({children:[e((0,l.GridChild)(c.UIElement)),[]],rows:[i(l.TracksSizing),null],cols:[i(l.TracksSizing),null]})))},
function _(n,i,s,t,e){var o;t();const a=n(373),l=n(376),r=n(238),c=n(56),_=n(233),u=n(34),d=n(8),{max:p}=Math;class g extends a.LayoutDOMView{connect_signals(){super.connect_signals();const{spacing:n}=this.model.properties;this.on_change(n,(()=>this.invalidate_layout()))}get child_models(){return this._children.map((([n])=>n))}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){super._update_layout();const n={},[i,s]=(()=>{const{spacing:n}=this.model;return(0,d.isNumber)(n)?[n,n]:n})();n.row_gap=(0,c.px)(i),n.column_gap=(0,c.px)(s);let t=0,e=0;const o=new _.Container;for(const[[,n,i,s=1,l=1],r]of(0,u.enumerate)(this._children)){const c=this.child_views[r];t=p(t,n+s),e=p(e,i+l);const _={};if(_.grid_row_start=`${n+1}`,_.grid_row_end=`span ${s}`,_.grid_column_start=`${i+1}`,_.grid_column_end=`span ${l}`,c.style.append(":host",_),c instanceof a.LayoutDOMView&&null!=c.layout){const t=n,e=i,a=n+s-1,r=i+l-1;o.add({r0:t,c0:e,r1:a,c1:r},c)}}const{_rows:r,_cols:g}=this;function h(n,i){if(n instanceof Map)for(const[s,t]of n.entries())(0,d.isString)(t)?i[s].size=t:i[s]=t;else if((0,d.isArray)(n))for(const[s,t]of(0,u.enumerate)(n))(0,d.isString)(s)?i[t].size=s:i[t]=s;else if(null!=n)for(const s of i)(0,d.isString)(n)?s.size=n:(s.size=n.size,s.align=n.align)}r instanceof Map?t=p(t,...r.keys()):(0,d.isArray)(r)&&(t=p(t,r.length)),g instanceof Map?e=p(e,...g.keys()):(0,d.isArray)(g)&&(e=p(e,g.length));const f=Array(t).fill(null).map((()=>({}))),m=Array(e).fill(null).map((()=>({})));h(r,f),h(g,m);for(const[[,n,i],s]of(0,u.enumerate)(this._children)){const t=this.child_views[s],{halign:e,valign:o}=t.box_sizing();t.style.append(":host",{justify_self:null!=e?e:m[i].align,align_self:null!=o?o:f[n].align})}const y="auto";n.grid_template_rows=f.map((({size:n})=>null!=n?n:y)).join(" "),n.grid_template_columns=m.map((({size:n})=>null!=n?n:y)).join(" "),this.style.append(":host",n),0!=o.size?(this.layout=new l.GridAlignmentLayout(o),this.layout.set_sizing()):delete this.layout}}s.CSSGridBoxView=g,g.__name__="CSSGridBoxView";class h extends a.LayoutDOM{constructor(n){super(n)}}s.CSSGridBox=h,o=h,h.__name__="CSSGridBox",o.define((()=>({spacing:[r.GridSpacing,0]})))},
function _(e,t,s,l,i){var c;l();const h=e(1),d=e(373),o=e(266),n=e(56),a=h.__importDefault(e(380));class _ extends d.LayoutDOMView{stylesheets(){return[...super.stylesheets(),a.default]}connect_signals(){super.connect_signals();const{child:e}=this.model.properties;this.on_change(e,(()=>this.update_children()));const{checkable:t,disabled:s}=this.model.properties;this.on_change(t,(()=>{(0,n.display)(this.checkbox_el,this.model.checkable)})),this.on_change(s,(()=>{this.checkbox_el.checked=!this.model.disabled}))}get child_models(){return[this.model.child]}render(){super.render();const{checkable:e,disabled:t,title:s}=this.model;this.checkbox_el=(0,n.input)({type:"checkbox",checked:!t}),this.checkbox_el.addEventListener("change",(()=>{this.model.disabled=!this.checkbox_el.checked})),(0,n.display)(this.checkbox_el,e);const l=(0,n.legend)({},this.checkbox_el,s),i=this.child_views.map((e=>e.el));this.fieldset_el=(0,n.fieldset)({},l,...i),this.shadow_el.appendChild(this.fieldset_el)}_update_children(){const e=this.child_views.map((e=>e.el));this.fieldset_el.append(...e)}}s.GroupBoxView=_,_.__name__="GroupBoxView";class r extends d.LayoutDOM{constructor(e){super(e)}}s.GroupBox=r,c=r,r.__name__="GroupBox",c.prototype.default_view=_,c.define((({Boolean:e,String:t,Nullable:s,Ref:l})=>({title:[s(t),null],child:[l(o.UIElement)],checkable:[e,!1]})))},
function _(d,a,e,l,i){l(),e.default="legend{display:flex;gap:0.5em;padding:0 calc(var(--padding-horizontal) / 2);}fieldset{border:1px solid #ccc;}"},
function _(e,n,l,t,s){var i;t();const o=e(378),c=e(238),r=e(266),a=e(21),d=(0,a.Struct)({child:(0,a.Ref)(r.UIElement),col:(0,a.Opt)(c.Index),span:(0,a.Opt)(c.Span)});class _ extends o.CSSGridBoxView{connect_signals(){super.connect_signals();const{children:e,cols:n}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change(n,(()=>this.invalidate_layout()))}get _children(){return this.model.children.map((({child:e,col:n,span:l},t)=>[e,0,null!=n?n:t,1,null!=l?l:1]))}get _rows(){return null}get _cols(){return this.model.cols}}l.HBoxView=_,_.__name__="HBoxView";class h extends o.CSSGridBox{constructor(e){super(e)}}l.HBox=h,i=h,h.__name__="HBox",i.prototype.default_view=_,i.define((({Array:e,Nullable:n})=>({children:[e(d),[]],cols:[n(c.TracksSizing),null]})))},
function _(e,o,t,s,_){var n;s();const r=e(372);class c extends r.FlexBoxView{constructor(){super(...arguments),this._direction="row"}}t.RowView=c,c.__name__="RowView";class w extends r.FlexBox{constructor(e){super(e)}}t.Row=w,n=w,w.__name__="Row",n.prototype.default_view=c},
function _(e,l,o,t,r){var s;t();const a=e(373),c=e(266),i=e(20);class n extends a.LayoutDOMView{stylesheets(){return[...super.stylesheets()]}connect_signals(){super.connect_signals();const{child:e,horizontal_scrollbar:l,vertical_scrollbar:o}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change([l,o],(()=>this.invalidate_layout()))}get child_models(){return[this.model.child]}_update_layout(){function e(e){switch(e){case"auto":return"auto";case"visible":return"scroll";case"hidden":return"hidden"}}super._update_layout();const{horizontal_scrollbar:l,vertical_scrollbar:o}=this.model;this.style.append(":host",{overflow_x:e(l),overflow_y:e(o)})}}o.ScrollBoxView=n,n.__name__="ScrollBoxView";class _ extends a.LayoutDOM{constructor(e){super(e)}}o.ScrollBox=_,s=_,_.__name__="ScrollBox",s.prototype.default_view=n,s.define((({Ref:e})=>({child:[e(c.UIElement)],horizontal_scrollbar:[i.ScrollbarPolicy,"auto"],vertical_scrollbar:[i.ScrollbarPolicy,"auto"]})))},
function _(t,e,a,o,_){var r;o();const s=t(373);class c extends s.LayoutDOMView{constructor(){super(...arguments),this._auto_width="auto",this._auto_height="auto"}get child_models(){return[]}}a.SpacerView=c,c.__name__="SpacerView";class u extends s.LayoutDOM{constructor(t){super(t)}}a.Spacer=u,r=u,u.__name__="Spacer",r.prototype.default_view=c},
function _(e,n,l,a,t){var o;a();const s=e(50),c=e(266);class d extends s.Model{constructor(e){super(e)}}l.TabPanel=d,o=d,d.__name__="TabPanel",o.define((({Boolean:e,String:n,Ref:l})=>({title:[n,""],child:[l(c.UIElement)],closable:[e,!1],disabled:[e,!1]})))},
function _(e,t,s,a,i){var o;a();const d=e(1),l=e(56),n=e(10),c=e(233),h=e(20),r=e(373),_=e(385),u=e(376),p=d.__importStar(e(387)),m=p,v=d.__importDefault(e(278));class b extends r.LayoutDOMView{connect_signals(){super.connect_signals();const{tabs:e,active:t}=this.model.properties;this.on_change(e,(()=>{this._update_headers(),this.update_children()})),this.on_change(t,(()=>{this.update_active()}))}stylesheets(){return[...super.stylesheets(),p.default,v.default]}get child_models(){return this.model.tabs.map((e=>e.child))}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){super._update_layout();const e=this.model.tabs_location;this.class_list.remove([...h.Location].map((e=>m[e]))),this.class_list.add(m[e]);const t=new c.Container;for(const e of this.child_views)e.style.append(":host",{grid_area:"stack"}),e instanceof r.LayoutDOMView&&null!=e.layout&&t.add({r0:0,c0:0,r1:1,c1:1},e);0!=t.size?(this.layout=new u.GridAlignmentLayout(t),this.layout.set_sizing()):delete this.layout}_after_layout(){super._after_layout();const{child_views:e}=this;for(const t of e)(0,l.hide)(t.el);const{active:t}=this.model;if(t in e){const s=e[t];(0,l.show)(s.el)}}render(){super.render(),this.header_el=(0,l.div)({class:m.header}),this.shadow_el.append(this.header_el),this._update_headers()}_update_headers(){const{active:e}=this.model,t=this.model.tabs.map(((t,s)=>{const a=(0,l.div)({class:[m.tab,s==e?m.active:null],tabIndex:0},t.title);if(a.addEventListener("click",(e=>{this.model.disabled||e.target==e.currentTarget&&this.change_active(s)})),t.closable){const e=(0,l.div)({class:m.close});e.addEventListener("click",(e=>{if(e.target==e.currentTarget){this.model.tabs=(0,n.remove_at)(this.model.tabs,s);const e=this.model.tabs.length;this.model.active>e-1&&(this.model.active=e-1)}})),a.appendChild(e)}return(this.model.disabled||t.disabled)&&a.classList.add(m.disabled),a}));this.header_els=t,(0,l.empty)(this.header_el),this.header_el.append(...t)}change_active(e){e!=this.model.active&&(this.model.active=e)}update_active(){const e=this.model.active,{header_els:t}=this;for(const e of t)e.classList.remove(m.active);e in t&&t[e].classList.add(m.active);const{child_views:s}=this;for(const e of s)(0,l.hide)(e.el);e in s&&(0,l.show)(s[e].el)}}s.TabsView=b,b.__name__="TabsView";class f extends r.LayoutDOM{constructor(e){super(e)}}s.Tabs=f,o=f,f.__name__="Tabs",o.prototype.default_view=b,o.define((({Int:e,Array:t,Ref:s})=>({tabs:[t(s(_.TabPanel)),[]],tabs_location:[h.Location,"above"],active:[e,0]})))},
function _(e,r,o,t,a){t(),o.above="bk-above",o.below="bk-below",o.left="bk-left",o.right="bk-right",o.header="bk-header",o.tab="bk-tab",o.active="bk-active",o.close="bk-close",o.disabled="bk-disabled",o.default=':host{display:grid;}:host(.bk-above){grid-template:"header" max-content "stack" 1fr / 1fr;}:host(.bk-below){grid-template:"stack" 1fr "header" max-content / 1fr;}:host(.bk-left){grid-template:"header stack" 1fr / max-content 1fr;}:host(.bk-right){grid-template:"stack header" 1fr / 1fr max-content;}.bk-header{grid-area:"header";display:flex;flex-wrap:nowrap;align-items:stretch;user-select:none;-webkit-user-select:none;}:host(.bk-above) .bk-header,:host(.bk-below) .bk-header{flex-direction:row;}:host(.bk-left) .bk-header,:host(.bk-right) .bk-header{flex-direction:column;}:host(.bk-above) .bk-header{border-bottom:1px solid #e6e6e6;}:host(.bk-right) .bk-header{border-left:1px solid #e6e6e6;}:host(.bk-below) .bk-header{border-top:1px solid #e6e6e6;}:host(.bk-left) .bk-header{border-right:1px solid #e6e6e6;}.bk-tab{padding:4px 8px;border:solid transparent;outline:0;outline-offset:-5px;white-space:nowrap;cursor:pointer;text-align:center;}.bk-tab:hover{background-color:#f2f2f2;}.bk-tab:focus,.bk-tab:active{outline:1px dotted #ccc;}.bk-tab.bk-active{color:#4d4d4d;background-color:white;border-color:#e6e6e6;}.bk-tab .bk-close{margin-left:10px;}.bk-tab.bk-disabled{cursor:not-allowed;pointer-events:none;opacity:0.65;}:host(.bk-above) .bk-tab{border-width:3px 1px 0px 1px;border-radius:var(--border-radius) var(--border-radius) 0 0;}:host(.bk-right) .bk-tab{border-width:1px 3px 1px 0px;border-radius:0 var(--border-radius) var(--border-radius) 0;}:host(.bk-below) .bk-tab{border-width:0px 1px 3px 1px;border-radius:0 0 var(--border-radius) var(--border-radius);}:host(.bk-left) .bk-tab{border-width:1px 0px 1px 3px;border-radius:var(--border-radius) 0 0 var(--border-radius);}.bk-close{display:inline-block;vertical-align:middle;width:14px;height:14px;cursor:pointer;background-color:gray;mask-image:var(--bokeh-icon-x);mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:var(--bokeh-icon-x);-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;}.bk-close:hover{background-color:red;}'},
function _(e,n,t,r,s){var l;r();const i=e(378),o=e(238),c=e(266),a=e(21),d=(0,a.Struct)({child:(0,a.Ref)(c.UIElement),row:(0,a.Opt)(o.Index),span:(0,a.Opt)(o.Span)});class _ extends i.CSSGridBoxView{connect_signals(){super.connect_signals();const{children:e,rows:n}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.on_change(n,(()=>this.invalidate_layout()))}get _children(){return this.model.children.map((({child:e,row:n,span:t},r)=>[e,null!=n?n:r,0,null!=t?t:1,1]))}get _rows(){return this.model.rows}get _cols(){return null}}t.VBoxView=_,_.__name__="VBoxView";class h extends i.CSSGridBox{constructor(e){super(e)}}t.VBox=h,l=h,h.__name__="VBox",l.prototype.default_view=_,l.define((({Array:e,Nullable:n})=>({children:[e(d),[]],rows:[n(o.TracksSizing),null]})))},
function _(i,n,c,e,o){e(),o("Menu",i(374).Menu),o("Action",i(390).Action),o("CheckAction",i(392).CheckAction),o("Section",i(393).Section),o("Divider",i(394).Divider)},
function _(e,n,t,i,l){var s;i();const c=e(375),d=e(374),o=e(391),r=e(56);class a extends c.MenuItemView{_click(){}render(){super.render();const{label:e,description:n}=this.model;this.el.tabIndex=0,this.el.title=null!=n?n:"",this.el.appendChild((0,r.span)(e)),this.el.addEventListener("click",(()=>{this._click()})),this.el.addEventListener("keydown",(e=>{"Enter"==e.key&&this._click()}))}}t.ActionView=a,a.__name__="ActionView";class u extends c.MenuItem{constructor(e){super(e)}}t.Action=u,s=u,u.__name__="Action",s.prototype.default_view=a,s.define((({String:e,Nullable:n,Ref:t})=>({icon:[n(t(o.Icon)),null],label:[e],description:[n(e),null],menu:[n(t(d.Menu)),null]})))},
function _(e,n,o,c,s){var _;c();const t=e(50),i=e(55);class r extends i.DOMComponentView{}o.IconView=r,r.__name__="IconView";class a extends t.Model{constructor(e){super(e)}}o.Icon=a,_=a,a.__name__="Icon",_.define((({Number:e,Or:n,CSSLength:o})=>({size:[n(e,o),"1em"]})))},
function _(e,c,n,t,o){var i;t();const _=e(390);class s extends _.ActionView{}n.CheckActionView=s,s.__name__="CheckActionView";class a extends _.Action{constructor(e){super(e)}}n.CheckAction=a,i=a,a.__name__="CheckAction",i.prototype.default_view=s,i.define((({Boolean:e})=>({checked:[e,!1]})))},
function _(e,n,t,r,i){var s;r();const c=e(375);class o extends c.MenuItemView{render(){super.render()}}t.SectionView=o,o.__name__="SectionView";class _ extends c.MenuItem{constructor(e){super(e)}}t.Section=_,s=_,_.__name__="Section",s.prototype.default_view=o,s.define((({Array:e,Ref:n})=>({items:[e(n(c.MenuItem)),[]]})))},
function _(e,i,r,t,s){var d;t();const n=e(1),_=e(375),a=n.__importStar(e(277));class c extends _.MenuItemView{render(){super.render(),this.el.classList.add(a.divider)}}r.DividerView=c,c.__name__="DividerView";class o extends _.MenuItem{constructor(e){super(e)}}r.Divider=o,d=o,o.__name__="Divider",d.prototype.default_view=c},
function _(t,a,i,e,M){e();var T=t(151);M("MathText",T.MathText),M("Ascii",T.Ascii),M("MathML",T.MathML),M("TeX",T.TeX),M("PlainText",t(158).PlainText)},
function _(r,o,t,e,n){e(),n("CustomJSTransform",r(397).CustomJSTransform),n("Dodge",r(398).Dodge),n("Interpolator",r(400).Interpolator),n("Jitter",r(401).Jitter),n("LinearInterpolator",r(403).LinearInterpolator),n("StepInterpolator",r(404).StepInterpolator),n("Transform",r(86).Transform)},
function _(r,t,s,n,e){var a;n();const u=r(86),o=r(9),m=r(40);class _ extends u.Transform{constructor(r){super(r)}get names(){return(0,o.keys)(this.args)}get values(){return(0,o.values)(this.args)}_make_transform(r,t){return new Function(...this.names,r,(0,m.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(r){return this.scalar_transform(...this.values,r)}v_compute(r){return this.vector_transform(...this.values,r)}}s.CustomJSTransform=_,a=_,_.__name__="CustomJSTransform",a.define((({Unknown:r,String:t,Dict:s})=>({args:[s(r),{}],func:[t,""],v_func:[t,""]})))},
function _(e,n,r,o,s){var t;o();const u=e(399);class a extends u.RangeTransform{constructor(e){super(e)}_compute(e){return e+this.value}}r.Dodge=a,t=a,a.__name__="Dodge",t.define((({Number:e})=>({value:[e,0]})))},
function _(e,n,t,r,a){var s;r();const c=e(86),o=e(87),i=e(98),u=e(24),h=e(8),l=e(12);class g extends c.Transform{constructor(e){super(e)}v_compute(e){let n;this.range instanceof i.FactorRange?n=this.range.v_synthetic(e):(0,h.isArrayableOf)(e,h.isNumber)?n=e:(0,l.unreachable)();const t=new((0,u.infer_type)(n))(n.length);for(let e=0;e<n.length;e++){const r=n[e];t[e]=this._compute(r)}return t}compute(e){return this.range instanceof i.FactorRange?this._compute(this.range.synthetic(e)):(0,h.isNumber)(e)?this._compute(e):void(0,l.unreachable)()}}t.RangeTransform=g,s=g,g.__name__="RangeTransform",s.define((({Ref:e,Nullable:n})=>({range:[n(e(o.Range)),null]})))},
function _(t,e,r,n,s){var o;n();const i=t(86),a=t(101),h=t(24),l=t(10),d=t(8);class c extends i.Transform{constructor(t){super(t),this._sorted_dirty=!0}connect_signals(){super.connect_signals(),this.connect(this.change,(()=>this._sorted_dirty=!0))}v_compute(t){const e=new((0,h.infer_type)(t))(t.length);for(let r=0;r<t.length;r++){const n=t[r];e[r]=this.compute(n)}return e}sort(t=!1){if(!this._sorted_dirty)return;let e,r;if((0,d.isString)(this.x)&&(0,d.isString)(this.y)&&null!=this.data){const t=this.data.columns();if(!(0,l.includes)(t,this.x))throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(!(0,l.includes)(t,this.y))throw new Error("The y parameter does not correspond to a valid column name defined in the data parameter");e=this.data.get_column(this.x),r=this.data.get_column(this.y)}else{if(!(0,d.isArray)(this.x)||!(0,d.isArray)(this.y))throw new Error("parameters 'x' and 'y' must be both either string fields or arrays");e=this.x,r=this.y}if(e.length!==r.length)throw new Error("The length for x and y do not match");if(e.length<2)throw new Error("x and y must have at least two elements to support interpolation");const n=e.length,s=new Uint32Array(n);for(let t=0;t<n;t++)s[t]=t;const o=t?-1:1;s.sort(((t,r)=>o*(e[t]-e[r]))),this._x_sorted=new((0,h.infer_type)(e))(n),this._y_sorted=new((0,h.infer_type)(r))(n);for(let t=0;t<n;t++)this._x_sorted[t]=e[s[t]],this._y_sorted[t]=r[s[t]];this._sorted_dirty=!1}}r.Interpolator=c,o=c,c.__name__="Interpolator",o.define((({Boolean:t,Number:e,String:r,Ref:n,Array:s,Or:o,Nullable:i})=>({x:[o(r,s(e))],y:[o(r,s(e))],data:[i(n(a.ColumnarDataSource)),null],clip:[t,!0]})))},
function _(t,e,n,r,i){var s;r();const o=t(399),a=t(98),u=t(402),_=t(20),h=t(13),m=t(271);class l extends o.RangeTransform{constructor(t){super(t),this._previous_offsets=null}initialize(){var t,e;super.initialize(),this._generator=null!==(e=null===(t=this.random_generator)||void 0===t?void 0:t.generator())&&void 0!==e?e:new m.SystemRandom}v_compute(t){const e=(()=>this.range instanceof a.FactorRange?this.range.v_synthetic(t):t)(),n=(()=>{var t;const n=e.length;return(null===(t=this._previous_offsets)||void 0===t?void 0:t.length)!=n&&(this._previous_offsets=this._v_compute(n)),this._previous_offsets})();return(0,h.map)(n,((t,n)=>t+e[n]))}_compute(){const{mean:t,width:e}=this;switch(this.distribution){case"uniform":return this._generator.uniform(t,e);case"normal":return this._generator.normal(t,e)}}_v_compute(t){const{mean:e,width:n}=this;switch(this.distribution){case"uniform":return this._generator.uniforms(e,n,t);case"normal":return this._generator.normals(e,n,t)}}}n.Jitter=l,s=l,l.__name__="Jitter",s.define((({Number:t})=>({mean:[t,0],width:[t,1],distribution:[_.Distribution,"uniform"]}))),s.internal((({Nullable:t,Ref:e})=>({random_generator:[t(e(u.RandomGenerator)),null]})))},
function _(n,e,o,r,t){r();const a=n(50);class s extends a.Model{constructor(n){super(n)}}o.RandomGenerator=s,s.__name__="RandomGenerator"},
function _(t,s,_,r,e){r();const i=t(10),o=t(400);class n extends o.Interpolator{constructor(t){super(t)}compute(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}if(t==this._x_sorted[0])return this._y_sorted[0];const s=(0,i.find_last_index)(this._x_sorted,(s=>s<t)),_=this._x_sorted[s],r=this._x_sorted[s+1],e=this._y_sorted[s],o=this._y_sorted[s+1];return e+(t-_)/(r-_)*(o-e)}}_.LinearInterpolator=n,n.__name__="LinearInterpolator"},
function _(t,e,s,r,o){var _;r();const i=t(400),n=t(20),d=t(10);class h extends i.Interpolator{constructor(t){super(t)}compute(t){if(this.sort(!1),this.clip){if(t<this._x_sorted[0]||t>this._x_sorted[this._x_sorted.length-1])return NaN}else{if(t<this._x_sorted[0])return this._y_sorted[0];if(t>this._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}let e;switch(this.mode){case"after":e=(0,d.find_last_index)(this._x_sorted,(e=>t>=e));break;case"before":e=(0,d.find_index)(this._x_sorted,(e=>t<=e));break;case"center":{const s=(0,d.map)(this._x_sorted,(e=>Math.abs(e-t))),r=(0,d.min)(s);e=(0,d.find_index)(s,(t=>r===t));break}default:throw new Error(`unknown mode: ${this.mode}`)}return-1!=e?this._y_sorted[e]:NaN}}s.StepInterpolator=h,_=h,h.__name__="StepInterpolator",_.define((()=>({mode:[n.StepMode,"after"]})))},
function _(p,o,t,i,a){i(),a("MapOptions",p(406).MapOptions),a("GMapOptions",p(406).GMapOptions),a("GMapPlot",p(406).GMapPlot),a("GMap",p(414).GMap),a("Plot",p(407).Plot),a("GridPlot",p(415).GridPlot),a("Figure",p(416).Figure)},
function _(e,t,a,n,o){var p,s,l;n();const _=e(407),i=e(20),r=e(50),c=e(88),d=e(413);o("GMapPlotView",d.GMapPlotView);class u extends r.Model{constructor(e){super(e)}}a.MapOptions=u,p=u,u.__name__="MapOptions",p.define((({Int:e,Number:t})=>({lat:[t],lng:[t],zoom:[e,12]})));class M extends u{constructor(e){super(e)}}a.GMapOptions=M,s=M,M.__name__="GMapOptions",s.define((({Boolean:e,Int:t,String:a,Nullable:n})=>({map_type:[i.MapType,"roadmap"],scale_control:[e,!1],styles:[n(a),null],tilt:[t,45]})));class m extends _.Plot{constructor(e){super(e),this.use_map=!0}}a.GMapPlot=m,l=m,m.__name__="GMapPlot",l.prototype.default_view=d.GMapPlotView,l.define((({String:e,Bytes:t,Ref:a})=>({map_options:[a(M)],api_key:[t],api_version:[e,"weekly"]}))),l.override({x_range:()=>new c.Range1d,y_range:()=>new c.Range1d,background_fill_alpha:0})},
function _(e,t,o,r,n){var a;r();const l=e(1),i=l.__importStar(e(78)),s=l.__importStar(e(18)),_=e(15),d=e(20),c=e(10),h=e(44),u=e(8),g=e(373),b=e(161),f=e(369),m=e(73),p=e(144),w=e(90),y=e(265),v=e(87),x=e(85),S=e(106),R=e(74),A=e(202),D=e(201),L=e(273),O=e(95),P=e(408);n("PlotView",P.PlotView);class T extends g.LayoutDOM{constructor(e){super(e),this.use_map=!1,this.reset=new _.Signal0(this,"reset")}add_layout(e,t="center"){const o=this.properties[t].get_value();this.setv({[t]:[...o,e]})}remove_layout(e){const t=t=>{(0,c.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 A.DataRenderer))}add_renderers(...e){this.renderers=[...this.renderers,...e]}add_glyph(e,t=new S.ColumnDataSource,o={}){const r=new D.GlyphRenderer(Object.assign(Object.assign({},o),{data_source:t,glyph:e}));return this.add_renderers(r),r}add_tools(...e){const t=e.map((e=>e instanceof L.Tool?e:L.Tool.from_string(e)));this.toolbar.tools=[...this.toolbar.tools,...t]}remove_tools(...e){this.toolbar.tools=[...(0,h.difference)(new Set(this.toolbar.tools),new Set(e))]}get panels(){return[...this.side_panels,...this.center]}get side_panels(){const{above:e,below:t,left:o,right:r}=this;return(0,c.concat)([e,t,o,r])}}o.Plot=T,a=T,T.__name__="Plot",a.prototype.default_view=P.PlotView,a.mixins([["outline_",i.Line],["background_",i.Fill],["border_",i.Fill]]),a.define((({Boolean:e,Number:t,String:o,Array:r,Dict:n,Or:a,Ref:l,Null:i,Nullable:_,Struct:c,Opt:h})=>({toolbar:[l(y.Toolbar),()=>new y.Toolbar],toolbar_location:[_(d.Location),"right"],toolbar_sticky:[e,!0],toolbar_inner:[e,!1],frame_width:[_(t),null],frame_height:[_(t),null],frame_align:[a(e,c({left:h(e),right:h(e),top:h(e),bottom:h(e)})),!0],title:[a(l(p.Title),o,i),"",{convert:e=>(0,u.isString)(e)?new p.Title({text:e}):e}],title_location:[_(d.Location),"above"],above:[r(a(l(m.Annotation),l(b.Axis))),[]],below:[r(a(l(m.Annotation),l(b.Axis))),[]],left:[r(a(l(m.Annotation),l(b.Axis))),[]],right:[r(a(l(m.Annotation),l(b.Axis))),[]],center:[r(a(l(m.Annotation),l(f.Grid))),[]],renderers:[r(l(R.Renderer)),[]],x_range:[l(v.Range),()=>new O.DataRange1d],y_range:[l(v.Range),()=>new O.DataRange1d],x_scale:[l(x.Scale),()=>new w.LinearScale],y_scale:[l(x.Scale),()=>new w.LinearScale],extra_x_ranges:[n(l(v.Range)),{}],extra_y_ranges:[n(l(v.Range)),{}],extra_x_scales:[n(l(x.Scale)),{}],extra_y_scales:[n(l(x.Scale)),{}],lod_factor:[t,10],lod_interval:[t,300],lod_threshold:[_(t),2e3],lod_timeout:[t,500],hidpi:[e,!0],output_backend:[d.OutputBackend,"canvas"],min_border:[_(t),5],min_border_top:[_(t),null],min_border_left:[_(t),null],min_border_bottom:[_(t),null],min_border_right:[_(t),null],inner_width:[t,s.unset,{readonly:!0}],inner_height:[t,s.unset,{readonly:!0}],outer_width:[t,s.unset,{readonly:!0}],outer_height:[t,s.unset,{readonly:!0}],match_aspect:[e,!1],aspect_scale:[t,1],reset_policy:[d.ResetPolicy,"standard"],hold_render:[e,!1]}))),a.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 a=e(1),r=e(159),o=e(300),l=e(274),_=e(373),h=e(73),d=e(144),c=e(161),u=e(264),p=e(95),g=e(52),m=e(59),b=e(75),v=e(19),f=e(52),w=e(15),y=e(409),x=e(8),z=e(10),k=e(34),S=e(269),M=e(232),$=e(234),q=e(233),V=e(146),O=e(57),R=e(154),j=e(410),P=e(411),T=e(29),C=e(56),B=a.__importDefault(e(412)),{max:A}=Math;class H extends _.LayoutDOMView{constructor(){super(...arguments),this.repainted=new w.Signal0(this,"repainted"),this._computed_style=new C.InlineStyleSheet,this._outer_bbox=new O.BBox,this._inner_bbox=new O.BBox,this._needs_paint=!0,this._invalidated_painters=new Set,this._invalidate_all=!0,this.renderer_views=new Map,this.tool_views=new Map,this._needs_notify=!1}get canvas(){return this.canvas_view}stylesheets(){return[...super.stylesheets(),B.default,this._computed_style]}get toolbar_panel(){return null!=this._toolbar?this.renderer_view(this._toolbar):void 0}get state(){return this._state_manager}set invalidate_dataranges(e){this._range_manager.invalidate_dataranges=e}get computed_renderer_views(){return this.computed_renderers.map((e=>this.renderer_views.get(e)))}renderer_view(e){const t=this.renderer_views.get(e);if(null==t)for(const[,t]of this.renderer_views){const i=t.renderer_view(e);if(null!=i)return i}return t}get auto_ranged_renderers(){return this.model.renderers.map((e=>this.renderer_view(e))).filter(p.is_auto_ranged)}get base_font_size(){const e=getComputedStyle(this.el).fontSize,t=(0,R.parse_css_font_size)(e);if(null!=t){const{value:e,unit:i}=t;if("px"==i)return e}return null}*children(){yield*super.children(),yield*this.renderer_views.values(),yield*this.tool_views.values(),yield this.canvas}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=Math.max(this._is_paused-1,0),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,x.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.request_paint("everything")}reset(){"standard"==this.model.reset_policy&&(this.state.clear(),this.reset_range(),this.reset_selection()),this.model.trigger_event(new g.Reset)}remove(){for(const e of this.frame.ranges.values())e.plots.delete(this);(0,m.remove_views)(this.renderer_views),(0,m.remove_views)(this.tool_views),this.canvas_view.remove(),super.remove()}render(){super.render(),this.shadow_el.appendChild(this.canvas_view.el),this.canvas_view.render()}initialize(){this.pause(),super.initialize(),this.lod_started=!1,this.visuals=new b.Visuals(this),this._initial_state={selection: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);for(const e of this.frame.ranges.values())e.plots.add(this);this._range_manager=new j.RangeManager(this),this._state_manager=new P.StateManager(this,this._initial_state),this.throttled_paint=(0,y.throttle)((()=>{this._removed||this.repaint()}),1e3/60);const{title_location:e,title:t}=this.model;null!=e&&null!=t&&(this._title=t instanceof d.Title?t:new d.Title({text:t}));const{toolbar_location:i,toolbar_inner:s,toolbar:n}=this.model;null!=i&&(this._toolbar=new u.ToolbarPanel({toolbar:n}),n.location=i,n.inner=s)}async lazy_initialize(){await super.lazy_initialize();const{hidpi:e,output_backend:t}=this.model,i=new o.Canvas({hidpi:e,output_backend:t});this.canvas_view=await(0,m.build_view)(i,{parent:this}),this.canvas_view.plot_views=[this],await this.build_tool_views(),await this.build_renderer_views(),this._range_manager.update_dataranges()}box_sizing(){const e=super.box_sizing(),{width_policy:t,height_policy:i}=e,s=a.__rest(e,["width_policy","height_policy"]),{frame_width:n,frame_height:r}=this.model;return Object.assign(Object.assign({},s),{width_policy:null!=n&&"auto"==t?"fit":t,height_policy:null!=r&&"auto"==i?"fit":i})}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"grid"}}_update_layout(){var e,t,i,s,n;super._update_layout(),this._invalidate_all=!0,this._needs_paint=!0;const a=new $.BorderLayout,{frame_align:r}=this.model;if(a.aligns=(()=>{if((0,x.isBoolean)(r))return{left:r,right:r,top:r,bottom:r};{const{left:e=!0,right:t=!0,top:i=!0,bottom:s=!0}=r;return{left:e,right:t,top:i,bottom:s}}})(),a.set_sizing({width_policy:"max",height_policy:"max"}),this.visuals.outline_line.doit){const e=this.visuals.outline_line.line_width.get_value();a.center_border_width=e}const o=(0,z.copy)(this.model.above),l=(0,z.copy)(this.model.below),_=(0,z.copy)(this.model.left),c=(0,z.copy)(this.model.right),p=[],g=[],m=[],b=[],v=(e,t=!1)=>{switch(e){case"above":return t?p:o;case"below":return t?g:l;case"left":return t?m:_;case"right":return t?b:c}},{title_location:f}=this.model;if(null!=f&&null!=this._title&&v(f).push(this._title),null!=this._toolbar){const{location:e}=this._toolbar.toolbar;if(this.model.toolbar_inner){v(e,!0).push(this._toolbar)}else{const t=v(e);let i=!0;if(this.model.toolbar_sticky)for(let s=0;s<t.length;s++){const n=t[s];if(n instanceof d.Title){t[s]="above"==e||"below"==e?[n,this._toolbar]:[this._toolbar,n],i=!1;break}}i&&t.push(this._toolbar)}}const w=(e,t)=>{var i;const s=this.renderer_view(t);return s.panel=new V.Panel(e),null===(i=s.update_layout)||void 0===i||i.call(s),s.layout},y=(e,t)=>{const i="above"==e||"below"==e,s=[];for(const n of t)if((0,x.isArray)(n)){const t=n.map((t=>{const s=w(e,t);if(null!=s){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}})).filter((e=>null!=e));let a;i?(a=new q.Row(t),a.set_sizing({width_policy:"max",height_policy:"min"})):(a=new q.Column(t),a.set_sizing({width_policy:"min",height_policy:"max"})),a.absolute=!0,s.push(a)}else{const t=w(e,n);null!=t&&s.push(t)}return s},k=null!==(e=this.model.min_border)&&void 0!==e?e:0;a.min_border={left:null!==(t=this.model.min_border_left)&&void 0!==t?t:k,top:null!==(i=this.model.min_border_top)&&void 0!==i?i:k,right:null!==(s=this.model.min_border_right)&&void 0!==s?s:k,bottom:null!==(n=this.model.min_border_bottom)&&void 0!==n?n:k};const S=new M.NodeLayout,O=new M.VStack,R=new M.VStack,j=new M.HStack,P=new M.HStack,T=new M.VStack,C=new M.VStack,B=new M.HStack,A=new M.HStack;S.absolute=!0,O.absolute=!0,R.absolute=!0,j.absolute=!0,P.absolute=!0,T.absolute=!0,C.absolute=!0,B.absolute=!0,A.absolute=!0,S.children=this.model.center.filter((e=>e instanceof h.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:H,frame_height:L}=this.model;S.set_sizing(Object.assign(Object.assign({},null!=H?{width_policy:"fixed",width:H}:{width_policy:"fit"}),null!=L?{height_policy:"fixed",height:L}:{height_policy:"fit"})),S.on_resize((e=>this.frame.set_geometry(e))),O.children=(0,z.reversed)(y("above",o)),R.children=y("below",l),j.children=(0,z.reversed)(y("left",_)),P.children=y("right",c),T.children=y("above",p),C.children=y("below",g),B.children=y("left",m),A.children=y("right",b),O.set_sizing({width_policy:"fit",height_policy:"min"}),R.set_sizing({width_policy:"fit",height_policy:"min"}),j.set_sizing({width_policy:"min",height_policy:"fit"}),P.set_sizing({width_policy:"min",height_policy:"fit"}),T.set_sizing({width_policy:"fit",height_policy:"min"}),C.set_sizing({width_policy:"fit",height_policy:"min"}),B.set_sizing({width_policy:"min",height_policy:"fit"}),A.set_sizing({width_policy:"min",height_policy:"fit"}),a.center_panel=S,a.top_panel=O,a.bottom_panel=R,a.left_panel=j,a.right_panel=P,0!=T.children.length&&(a.inner_top_panel=T),0!=C.children.length&&(a.inner_bottom_panel=C),0!=B.children.length&&(a.inner_left_panel=B),0!=A.children.length&&(a.inner_right_panel=A),this.layout=a}_measure_layout(){const{frame_width:e,frame_height:t}=this.model,i=null==e?"1fr":(0,C.px)(e),s=null==t?"1fr":(0,C.px)(t),{layout:n}=this,a=n.top_panel.measure({width:1/0,height:1/0}),r=n.bottom_panel.measure({width:1/0,height:1/0}),o=n.left_panel.measure({width:1/0,height:1/0}),l=n.right_panel.measure({width:1/0,height:1/0}),_=A(a.height,n.min_border.top),h=A(r.height,n.min_border.bottom),d=A(o.width,n.min_border.left),c=A(l.width,n.min_border.right);this._computed_style.replace(`\n :host {\n grid-template-rows: ${_}px ${s} ${h}px;\n grid-template-columns: ${d}px ${i} ${c}px;\n }\n `)}get axis_views(){const e=[];for(const[,t]of this.renderer_views)t instanceof c.AxisView&&e.push(t);return e}update_range(e,t){this.pause(),this._range_manager.update(e,t),this.unpause()}reset_range(){this.pause(),this._range_manager.reset(),this.unpause(),this.trigger_ranges_update_event()}trigger_ranges_update_event(){const{x_range:e,y_range:t}=this.model,i=new Set([...e.plots,...t.plots]);for(const e of i){const{x_range:t,y_range:i}=e.model;e.model.trigger_event(new f.RangesUpdate(t.start,t.end,i.start,i.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_if_needed(){(()=>{var e,t;for(const i of this.model.side_panels){const s=this.renderer_views.get(i);if(null!==(t=null===(e=s.layout)||void 0===e?void 0:e.has_size_changed())&&void 0!==t&&t)return this.invalidate_painters(s),!0}return!1})()&&this.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:a}=this.model;yield*a,yield*e,yield*t,yield*i,yield*s,yield*n,null!=this._title&&(yield this._title),null!=this._toolbar&&(yield this._toolbar);for(const[,e]of this.tool_views)yield*e.overlays}async build_renderer_views(){this.computed_renderers=[...this._compute_renderers()],await(0,m.build_views)(this.renderer_views,this.computed_renderers,{parent:this})}async build_tool_views(){const e=(0,k.flat_map)(this.model.toolbar.tools,(e=>e instanceof l.ToolProxy?e.tools:[e])),{created:t}=await(0,m.build_views)(this.tool_views,[...e],{parent:this});t.map((e=>this.canvas_view.ui_event_bus.register_tool(e)))}connect_signals(){super.connect_signals();const{extra_x_ranges:e,extra_y_ranges:t,extra_x_scales:i,extra_y_scales:s}=this.model.properties;this.on_change([e,t,i,s],(()=>{this.frame.x_range=this.model.x_range,this.frame.y_range=this.model.y_range,this.frame.in_x_scale=this.model.x_scale,this.frame.in_y_scale=this.model.y_scale,this.frame.extra_x_ranges=this.model.extra_x_ranges,this.frame.extra_y_ranges=this.model.extra_y_ranges,this.frame.extra_x_scales=this.model.extra_x_scales,this.frame.extra_y_scales=this.model.extra_y_scales,this.frame.configure_scales()}));const{above:n,below:a,left:r,right:o,center:l,renderers:_}=this.model.properties,h=[n,a,r,o,l];this.on_change(_,(async()=>{await this.build_renderer_views()})),this.on_change(h,(async()=>{await this.build_renderer_views(),this.invalidate_layout()})),this.connect(this.model.toolbar.properties.tools.change,(async()=>{await this.build_tool_views(),await this.build_renderer_views()}));const{x_ranges:d,y_ranges:c}=this.frame;for(const[,e]of d)this.connect(e.change,(()=>{this.request_paint("everything")}));for(const[,e]of c)this.connect(e.change,(()=>{this.request_paint("everything")}));this.connect(this.model.change,(()=>this.request_paint("everything"))),this.connect(this.model.reset,(()=>this.reset()));const{toolbar_location:p}=this.model.properties;this.on_change(p,(async()=>{const{toolbar_location:e}=this.model;if(null!=this._toolbar)null!=e?this._toolbar.toolbar.location=e:(this._toolbar=void 0,await this.build_renderer_views());else if(null!=e){const{toolbar:t,toolbar_inner:i}=this.model;this._toolbar=new u.ToolbarPanel({toolbar:t}),t.location=e,t.inner=i,await this.build_renderer_views()}this.invalidate_layout()}));const{hold_render:g}=this.model.properties;this.on_change(g,(()=>this._hold_render_changed()))}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(),this.unpause(!0);const t=this.layout.left_panel.bbox,i=this.layout.right_panel.bbox,s=this.layout.center_panel.bbox,n=this.layout.top_panel.bbox,a=this.layout.bottom_panel.bbox,{bbox:r}=this,o=n.bottom,l=r.height-a.top,_=t.right,d=r.width-i.left;this.canvas.style.replace(`\n .bk-layer.bk-events {\n display: grid;\n grid-template-areas:\n ". above . "\n "left center right"\n ". below . ";\n grid-template-rows: ${(0,C.px)(o)} ${(0,C.px)(s.height)} ${(0,C.px)(l)};\n grid-template-columns: ${(0,C.px)(_)} ${(0,C.px)(s.width)} ${(0,C.px)(d)};\n }\n `);for(const[,t]of this.renderer_views)t instanceof h.AnnotationView&&(null===(e=t.after_layout)||void 0===e||e.call(t));this.model.setv({inner_width:Math.round(this.frame.bbox.width),inner_height:Math.round(this.frame.bbox.height),outer_width:Math.round(this.bbox.width),outer_height:Math.round(this.bbox.height)},{no_change:!0}),this.model.match_aspect&&(this.pause(),this._range_manager.update_dataranges(),this.unpause(!0)),this._outer_bbox.equals(this.bbox)||(this.canvas_view.resize(),this._outer_bbox=this.bbox,this._invalidate_all=!0,this._needs_paint=!0);const{inner_bbox:c}=this.layout;this._inner_bbox.equals(c)||(this._inner_bbox=c,this._invalidate_all=!0,this._needs_paint=!0),this._needs_paint&&this.paint()}repaint(){this._invalidate_layout_if_needed(),this.paint()}paint(){if(!this.is_paused){if(this.is_displayed)v.logger.trace(`${this.toString()}.paint()`),this._actual_paint();else for(const e of this.computed_renderer_views)e.mark_finished();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_if_needed());let i=!1,s=!1;if(this._invalidate_all)i=!0,s=!0;else for(const e of this._invalidated_painters){const{level:t}=e.model;if("overlay"!=t?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:a,overlays:r}=this.canvas_view;i&&(a.prepare(),this.canvas_view.prepare_webgl(n),this._paint_empty(a.ctx,n),this._paint_outline(a.ctx,n),this._paint_levels(a.ctx,"image",n,!0),this._paint_levels(a.ctx,"underlay",n,!0),this._paint_levels(a.ctx,"glyph",n,!0),this._paint_levels(a.ctx,"guide",n,!1),this._paint_levels(a.ctx,"annotation",n,!1),a.finish()),(s||T.settings.wireframe)&&(r.prepare(),this._paint_levels(r.ctx,"overlay",n,!1),T.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,this.repainted.emit()}_paint_levels(e,t,i,s){for(const n of this.computed_renderers){if(n.level!=t)continue;const a=this.renderer_views.get(n);e.save(),(s||a.needs_clip)&&(e.beginPath(),e.rect(...i),e.clip()),a.render(),e.restore(),a.has_webgl&&this.canvas_view.blit_webgl(e)}}paint_layout(e,t){const{x:i,y:s,width:n,height:a}=t.bbox;e.strokeStyle="blue",e.strokeRect(i,s,n,a);for(const n of t)e.save(),t.absolute||e.translate(i,s),this.paint_layout(e,n),e.restore()}_paint_empty(e,t){const[i,s,n,a]=[0,0,this.bbox.width,this.bbox.height],[r,o,l,_]=t;this.visuals.border_fill.doit&&(this.visuals.border_fill.set_value(e),e.fillRect(i,s,n,a),e.clearRect(r,o,l,_)),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(e),e.fillRect(r,o,l,_))}_paint_outline(e,t){if(this.visuals.outline_line.doit){e.save(),this.visuals.outline_line.set_value(e);let[i,s,n,a]=t;i+n==this.bbox.width&&(n-=1),s+a==this.bbox.height&&(a-=1),e.strokeRect(i,s,n,a),e.restore()}}export(e="auto",t=!0){const i=(()=>{switch(e){case"auto":return this.canvas_view.model.output_backend;case"png":return"canvas";case"svg":return"svg"}})(),s=new S.CanvasLayer(i,t),{width:n,height:a}=this.bbox;if(s.resize(n,a),0!=n&&0!=a){const{canvas:e}=this.canvas_view.compose();s.ctx.drawImage(e,0,0)}return s}serializable_state(){const e=super.serializable_state(),{children:t}=e,i=a.__rest(e,["children"]),s=this.get_renderer_views().filter((e=>e.model.syncable)).map((e=>e.serializable_state())).filter((e=>null!=e.bbox)),n={type:"CartesianFrame",bbox:this.frame.bbox};return Object.assign(Object.assign({},i),{children:[...null!=t?t:[],n,...s]})}_hold_render_changed(){this.model.hold_render?this.pause():this.unpause()}}i.PlotView=H,H.__name__="PlotView"},
function _(n,t,e,l,u){l(),e.throttle=function(n,t){let e,l=null,u=null,o=0,i=!1;const r=function(){return new Promise(((r,c)=>{e=r;const a=function(){o=Date.now(),l=null,u=null,i=!1;try{n(),r()}catch(n){c(n)}},m=Date.now(),s=t-(m-o);s<=0&&!i?(null!=l&&clearTimeout(l),i=!0,u=requestAnimationFrame(a)):null!=l||i?r():l=setTimeout((()=>u=requestAnimationFrame(a)),s)}))};return r.stop=function(){null!=l&&clearTimeout(l),null!=u&&cancelAnimationFrame(u),e()},r}},
function _(t,n,e,a,s){a();const o=t(95),r=t(19);class l{constructor(t){this.invalidate_dataranges=!0,this.parent=t}get frame(){return this.parent.frame}update(t,n={}){var e;const a=new Map;for(const[n,e]of t.xrs)a.set(n,e);for(const[n,e]of t.yrs)a.set(n,e);null!==(e=n.scrolling)&&void 0!==e&&e&&this._update_ranges_together(a),this._update_ranges_individually(a,n)}reset(){const{x_ranges:t,y_ranges:n}=this.frame;for(const n of t.values())n.reset();for(const t of n.values())t.reset();for(const t of this.parent.model.data_renderers){const{coordinates:n}=t;null!=n&&(n.x_source.reset(),n.y_source.reset())}this.update_dataranges()}_update_dataranges(t){const n=new Map,e=new Map;let a=!1;for(const[,n]of t.x_ranges)n instanceof o.DataRange1d&&"log"==n.scale_hint&&(a=!0);for(const[,n]of t.y_ranges)n instanceof o.DataRange1d&&"log"==n.scale_hint&&(a=!0);for(const t of this.parent.auto_ranged_renderers){const s=t.bounds();if(n.set(t.model,s),a){const n=t.log_bounds();e.set(t.model,n)}}let s=!1,l=!1;const i=t.x_target.span,d=t.y_target.span;let _;!1!==this.parent.model.match_aspect&&0!=i&&0!=d&&(_=1/this.parent.model.aspect_scale*(i/d));for(const[,a]of t.x_ranges){if(a instanceof o.DataRange1d){const t="log"==a.scale_hint?e:n;a.update(t,0,this.parent,_),null!=a.follow&&(s=!0)}null!=a.bounds&&(l=!0)}for(const[,a]of t.y_ranges){if(a instanceof o.DataRange1d){const t="log"==a.scale_hint?e:n;a.update(t,1,this.parent,_),null!=a.follow&&(s=!0)}null!=a.bounds&&(l=!0)}if(s&&l){r.logger.warn("Follow enabled so bounds are unset.");for(const[,n]of t.x_ranges)n.bounds=null;for(const[,n]of t.y_ranges)n.bounds=null}}update_dataranges(){this._update_dataranges(this.frame);for(const t of this.parent.auto_ranged_renderers){const{coordinates:n}=t.model;null!=n&&this._update_dataranges(n)}null!=this.compute_initial()&&(this.invalidate_dataranges=!1)}compute_initial(){let t=!0;const{x_ranges:n,y_ranges:e}=this.frame,a=new Map,s=new Map;for(const[,e]of n){const{start:n,end:s}=e;if(isNaN(n+s)){t=!1;break}a.set(e,{start:n,end:s})}if(t)for(const[,n]of e){const{start:e,end:a}=n;if(isNaN(e+a)){t=!1;break}s.set(n,{start:e,end:a})}return t?{xrs:a,yrs:s}:(r.logger.warn("could not set initial ranges"),null)}_update_ranges_together(t){let n=1;for(const[e,a]of t)n=Math.min(n,this._get_weight_to_constrain_interval(e,a));if(n<1)for(const[e,a]of t)a.start=n*a.start+(1-n)*e.start,a.end=n*a.end+(1-n)*e.end}_update_ranges_individually(t,n={}){var e,a,s;const o=null!==(e=n.panning)&&void 0!==e&&e,r=null!==(a=n.scrolling)&&void 0!==a&&a,l=null!==(s=n.maintain_focus)&&void 0!==s&&s;let i=!1;for(const[n,e]of t){if(!r){const t=this._get_weight_to_constrain_interval(n,e);t<1&&(e.start=t*e.start+(1-t)*n.start,e.end=t*e.end+(1-t)*n.end)}if(null!=n.bounds){const[t,a]=n.computed_bounds,s=Math.abs(e.end-e.start);n.is_reversed?(t>e.end&&(i=!0,e.end=t,(o||r)&&(e.start=t+s)),a<e.start&&(i=!0,e.start=a,(o||r)&&(e.end=a-s))):(t>e.start&&(i=!0,e.start=t,(o||r)&&(e.end=t+s)),a<e.end&&(i=!0,e.end=a,(o||r)&&(e.start=a-s)))}}if(!(r&&i&&l))for(const[n,e]of t)n.have_updated_interactively=!0,n.start==e.start&&n.end==e.end||n.setv(e)}_get_weight_to_constrain_interval(t,n){const{min_interval:e}=t;let{max_interval:a}=t;if(null!=t.bounds&&"auto"!=t.bounds){const[n,e]=t.bounds;if(null!=n&&null!=e){const t=Math.abs(e-n);a=null!=a?Math.min(a,t):t}}let s=1;if(null!=e||null!=a){const o=Math.abs(t.end-t.start),r=Math.abs(n.end-n.start);null!=e&&e>0&&r<e&&(s=(o-e)/(o-r)),null!=a&&a>0&&r>a&&(s=(a-o)/(r-o)),s=Math.max(0,Math.min(1,s))}return s}}e.RangeManager=l,l.__name__="RangeManager"},
function _(t,i,s,e,n){e();const h=t(15);class a{constructor(t,i){this.history=[],this.index=-1,this.parent=t,this.initial_state=i,this.changed=new h.Signal0(this.parent,"state_changed")}_do_state_change(t){const i=t in this.history?this.history[t].state:this.initial_state;return null!=i.range&&this.parent.update_range(i.range),null!=i.selection&&this.parent.update_selection(i.selection),i}peek(){return this.can_undo?this.history[this.index]:null}push(t,i){const{history:s,index:e}=this,n=e in s?s[e].state:{},h=Object.assign(Object.assign(Object.assign({},this.initial_state),n),i);this.history=this.history.slice(0,this.index+1),this.history.push({type:t,state:h}),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 t=this._do_state_change(this.index);return this.changed.emit(),t}return null}redo(){if(this.can_redo){this.index+=1;const t=this._do_state_change(this.index);return this.changed.emit(),t}return null}get can_undo(){return this.index>=0}get can_redo(){return this.index<this.history.length-1}}s.StateManager=a,a.__name__="StateManager"},
function _(a,r,t,e,n){e(),t.Canvas="bk-Canvas",t.default=':host{display:grid;grid-template-areas:". above . " "left center right" ". below . ";grid-template-rows:0px 1fr 0px;grid-template-columns:0px 1fr 0px;}.bk-Canvas{grid-row-start:1;grid-row-end:span 3;grid-column-start:1;grid-column-end:span 3;}'},
function _(t,e,s,i,o){i();const a=t(19),n=t(15),p=t(56),_=t(107),l=t(408);const h=new n.Signal0({},"gmaps_ready");class m extends l.PlotView{initialize(){super.initialize(),this._tiles_loaded=!1,this.zoom_count=0;const{zoom:t,lat:e,lng:s}=this.model.map_options;this.initial_zoom=t,this.initial_lat=e,this.initial_lng=s;const i=new TextDecoder("utf-8");if(this._api_key=i.decode(this.model.api_key),""==this._api_key){const t="https://developers.google.com/maps/documentation/javascript/get-api-key";a.logger.error(`api_key is required. See ${t} for more information on how to obtain your own.`)}}async lazy_initialize(){if(await super.lazy_initialize(),this.map_el=(0,p.div)({style:{position:"absolute"}}),this.canvas_view.add_underlay(this.map_el),"undefined"==typeof google||void 0===google.maps){if(void 0===window._bokeh_gmaps_callback){const{api_version:t}=this.model;!function(t,e){window._bokeh_gmaps_callback=()=>h.emit();const s=encodeURIComponent,i=document.createElement("script");i.type="text/javascript",i.src=`https://maps.googleapis.com/maps/api/js?v=${s(e)}&key=${s(t)}&callback=_bokeh_gmaps_callback`,document.body.appendChild(i)}(this._api_key,t)}h.connect((()=>{this._build_map(),this.request_paint("everything")}))}else this._build_map()}remove(){(0,p.remove)(this.map_el),super.remove()}update_range(t,e){var s,i;if(null==t)this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),super.reset_range();else if(null!=t.sdx||null!=t.sdy)this.map.panBy(null!==(s=t.sdx)&&void 0!==s?s:0,null!==(i=t.sdy)&&void 0!==i?i:0),super.update_range(t,e);else if(null!=t.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),super.update_range(t,e);const s=t.factor<0?-1:1,i=this.map.getZoom();if(null!=i){const t=i+s;if(t>=2){this.map.setZoom(t);const[e,s]=this._get_projected_bounds();s-e<0&&this.map.setZoom(i)}}this.unpause()}this._set_bokeh_ranges()}_build_map(){const{maps:t}=google;this.map_types={satellite:t.MapTypeId.SATELLITE,terrain:t.MapTypeId.TERRAIN,roadmap:t.MapTypeId.ROADMAP,hybrid:t.MapTypeId.HYBRID};const e=this.model.map_options,s={center:new t.LatLng(e.lat,e.lng),zoom:e.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[e.map_type],scaleControl:e.scale_control,tilt:e.tilt};null!=e.styles&&(s.styles=JSON.parse(e.styles)),this.map=new t.Map(this.map_el,s),t.event.addListener(this.map,"idle",(()=>this._set_bokeh_ranges())),t.event.addListener(this.map,"bounds_changed",(()=>this._set_bokeh_ranges())),t.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_styling())),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 t=this.map.getBounds(),e=t.getNorthEast(),s=t.getSouthWest();return[s.lng(),e.lng(),s.lat(),e.lat()]}_get_projected_bounds(){const[t,e,s,i]=this._get_latlon_bounds(),[o,a]=_.wgs84_mercator.compute(t,s),[n,p]=_.wgs84_mercator.compute(e,i);return[o,n,a,p]}_set_bokeh_ranges(){const[t,e,s,i]=this._get_projected_bounds();this.frame.x_range.setv({start:t,end:e}),this.frame.y_range.setv({start:s,end:i})}_update_center(t){var e;const s=null===(e=this.map.getCenter())||void 0===e?void 0:e.toJSON();null!=s&&(s[t]=this.model.map_options[t],this.map.setCenter(s),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_styling(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()}_update_styling(){const{styles:t}=this.model.map_options;this.map.setOptions({styles:null!=t?JSON.parse(t):null})}_update_zoom(){this.map.setOptions({zoom:this.model.map_options.zoom}),this._set_bokeh_ranges()}_after_layout(){super._after_layout();const{left:t,top:e,width:s,height:i}=this.frame.bbox;this.map_el.style.top=`${e}px`,this.map_el.style.left=`${t}px`,this.map_el.style.width=`${s}px`,this.map_el.style.height=`${i}px`}}s.GMapPlotView=m,m.__name__="GMapPlotView"},
function _(e,a,t,s,n){var p;s();const _=e(406);class i extends _.GMapPlotView{serializable_state(){const e=super.serializable_state();return Object.assign(Object.assign({},e),{type:"GMapPlot"})}}t.GMapView=i,i.__name__="GMapView";class l extends _.GMapPlot{constructor(e){super(e)}}t.GMap=l,p=l,l.__name__="GMap",p.prototype.default_view=i},
function _(i,o,e,t,s){var l;t();const r=i(373),n=i(377),a=i(238),c=i(265),_=i(283),d=i(59),h=i(20);class u extends r.LayoutDOMView{constructor(){super(...arguments),this._tool_views=new Map}get toolbar_view(){return this.child_views.find((i=>i.model==this.model.toolbar))}get grid_box_view(){return this.child_views.find((i=>i.model==this._grid_box))}_update_location(){const i=this.model.toolbar_location;null==i?this.model.toolbar.visible=!1:this.model.toolbar.setv({visible:!0,location:i})}initialize(){super.initialize(),this._update_location();const{children:i,rows:o,cols:e,spacing:t}=this.model;this._grid_box=new n.GridBox({children:i,rows:o,cols:e,spacing:t,sizing_mode:"inherit"})}async lazy_initialize(){await super.lazy_initialize(),await this.build_tool_views()}connect_signals(){super.connect_signals();const{toolbar:i,toolbar_location:o,children:e,rows:t,cols:s,spacing:l}=this.model.properties;this.on_change(o,(()=>{this._update_location(),this.rebuild()})),this.on_change([i,e,t,s,l],(()=>{this.rebuild()})),this.on_change(this.model.toolbar.properties.tools,(async()=>{await this.build_tool_views()})),this.mouseenter.connect((()=>{this.toolbar_view.set_visibility(!0)})),this.mouseleave.connect((()=>{this.toolbar_view.set_visibility(!1)}))}remove(){(0,d.remove_views)(this._tool_views),super.remove()}async build_tool_views(){const i=this.model.toolbar.tools.filter((i=>i instanceof _.ActionTool));await(0,d.build_views)(this._tool_views,i,{parent:this})}*children(){yield*super.children(),yield*this._tool_views.values()}get child_models(){return[this.model.toolbar,this._grid_box]}_intrinsic_display(){return{inner:this.model.flow_mode,outer:"flex"}}_update_layout(){super._update_layout();const{location:i}=this.model.toolbar,o=(()=>{switch(i){case"above":return"column";case"below":return"column-reverse";case"left":return"row";case"right":return"row-reverse"}})();this.style.append(":host",{flex_direction:o})}}e.GridPlotView=u,u.__name__="GridPlotView";class b extends r.LayoutDOM{constructor(i){super(i)}}e.GridPlot=b,l=b,b.__name__="GridPlot",l.prototype.default_view=u,l.define((({Array:i,Ref:o,Nullable:e})=>({toolbar:[o(c.Toolbar),()=>new c.Toolbar],toolbar_location:[e(h.Location),"above"],children:[i((0,a.GridChild)(r.LayoutDOM)),[]],rows:[e(a.TracksSizing),null],cols:[e(a.TracksSizing),null],spacing:[a.GridSpacing,0]})))},
function _(e,t,s,i,a){var r;i();const n=e(407);class _ extends n.PlotView{serializable_state(){const e=super.serializable_state();return Object.assign(Object.assign({},e),{type:"Plot"})}}s.FigureView=_,_.__name__="FigureView";class l extends n.Plot{constructor(e){super(e)}}s.Figure=l,r=l,l.__name__="Figure",r.prototype.default_view=_},
function _(t,_,n,o,r){o();t(1).__exportStar(t(165),n)},
function _(l,r,i,a,e){a(),e("ParkMillerLCG",l(419).ParkMillerLCG)},
function _(e,n,r,a,l){var t;a();const o=e(402),s=e(271);class d extends o.RandomGenerator{constructor(e){super(e)}generator(){var e;return new s.LCGRandom(null!==(e=this.seed)&&void 0!==e?e:Date.now())}}r.ParkMillerLCG=d,t=d,d.__name__="ParkMillerLCG",t.define((({Int:e,Nullable:n})=>({seed:[n(e),null]})))},
function _(e,r,n,d,R){d(),R("ContourRenderer",e(421).ContourRenderer),R("GlyphRenderer",e(201).GlyphRenderer),R("GraphRenderer",e(422).GraphRenderer),R("GuideRenderer",e(162).GuideRenderer);var G=e(74);R("Renderer",G.Renderer),R("RendererGroup",G.RendererGroup)},
function _(e,i,r,n,l){var t;n();const _=e(202),s=e(201),d=e(59);class a extends _.DataRendererView{*children(){yield*super.children(),yield this.fill_view,yield this.line_view}get glyph_view(){return this.fill_view.glyph.data_size>0?this.fill_view.glyph:this.line_view.glyph}async lazy_initialize(){await super.lazy_initialize();const{parent:e}=this,{fill_renderer:i,line_renderer:r}=this.model;this.fill_view=await(0,d.build_view)(i,{parent:e}),this.line_view=await(0,d.build_view)(r,{parent:e})}remove(){this.fill_view.remove(),this.line_view.remove(),super.remove()}_render(){this.fill_view.render(),this.line_view.render()}renderer_view(e){if(e instanceof s.GlyphRenderer){if(e==this.fill_view.model)return this.fill_view;if(e==this.line_view.model)return this.line_view}return super.renderer_view(e)}}r.ContourRendererView=a,a.__name__="ContourRendererView";class h extends _.DataRenderer{constructor(e){super(e)}get_selection_manager(){return this.fill_renderer.data_source.selection_manager}}r.ContourRenderer=h,t=h,h.__name__="ContourRenderer",t.prototype.default_view=a,t.define((({Array:e,Number:i,Ref:r})=>({fill_renderer:[r(s.GlyphRenderer)],line_renderer:[r(s.GlyphRenderer)],levels:[e(i),[]]})))},
function _(e,r,i,n,t){var s;n();const d=e(202),o=e(201),a=e(366),l=e(365),h=e(59),_=e(204),p=e(344),y=e(346);class g extends d.DataRendererView{get glyph_view(){return this.node_view.glyph}*children(){yield*super.children(),yield this.edge_view,yield this.node_view}async lazy_initialize(){await super.lazy_initialize(),this.apply_coordinates();const{parent:e}=this,{edge_renderer:r,node_renderer:i}=this.model;this.edge_view=await(0,h.build_view)(r,{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:r}=this.model;if(!(e.glyph instanceof p.MultiLine||e.glyph instanceof y.Patches))throw new Error(`${this}.edge_renderer.glyph must be a MultiLine glyph`);if(!(r.glyph instanceof _.XYGlyph))throw new Error(`${this}.node_renderer.glyph must be a XYGlyph glyph`);const i=this.model.layout_provider.edge_coordinates,n=this.model.layout_provider.node_coordinates;e.glyph.properties.xs.internal=!0,e.glyph.properties.ys.internal=!0,r.glyph.properties.x.internal=!0,r.glyph.properties.y.internal=!0,e.glyph.xs={expr:i.x},e.glyph.ys={expr:i.y},r.glyph.x={expr:n.x},r.glyph.y={expr:n.y}}remove(){this.edge_view.remove(),this.node_view.remove(),super.remove()}_render(){this.edge_view.render(),this.node_view.render()}get has_webgl(){return this.edge_view.has_webgl||this.node_view.has_webgl}renderer_view(e){if(e instanceof o.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=g,g.__name__="GraphRendererView";class c extends d.DataRenderer{constructor(e){super(e)}get_selection_manager(){return this.node_renderer.data_source.selection_manager}}i.GraphRenderer=c,s=c,c.__name__="GraphRenderer",s.prototype.default_view=g,s.define((({Ref:e})=>({layout_provider:[e(a.LayoutProvider)],node_renderer:[e(o.GlyphRenderer)],edge_renderer:[e(o.GlyphRenderer)],selection_policy:[e(l.GraphHitTestPolicy),()=>new l.NodesOnly],inspection_policy:[e(l.GraphHitTestPolicy),()=>new l.NodesOnly]})))},
function _(e,t,n,o,c){o();e(1).__exportStar(e(104),n),c("Selection",e(103).Selection)},
function _(y,B,a,s,C){s(),C("ByID",y(425).ByID),C("ByClass",y(427).ByClass),C("ByCSS",y(428).ByCSS),C("ByXPath",y(429).ByXPath)},
function _(e,n,r,t,c){t();const o=e(426);class s extends o.Selector{constructor(e){super(e)}find_one(e){return e.querySelector(`#${this.query}`)}}r.ByID=s,s.__name__="ByID"},
function _(e,n,r,t,c){var o;t();const s=e(50);class _ extends s.Model{constructor(e){super(e)}}r.Selector=_,o=_,_.__name__="Selector",o.define((({String:e})=>({query:[e]})))},
function _(e,s,n,r,t){r();const c=e(426);class o extends c.Selector{constructor(e){super(e)}find_one(e){return e.querySelector(`.${this.query}`)}}n.ByClass=o,o.__name__="ByClass"},
function _(e,n,r,t,c){t();const o=e(426);class s extends o.Selector{constructor(e){super(e)}find_one(e){return e.querySelector(this.query)}}r.ByCSS=s,s.__name__="ByCSS"},
function _(e,t,n,r,a){r();const c=e(426);class o extends c.Selector{constructor(e){super(e)}find_one(e){return document.evaluate(this.query,e).iterateNext()}}n.ByXPath=o,o.__name__="ByXPath"},
function _(a,e,S,o,r){o(),r("ServerSentDataSource",a(431).ServerSentDataSource),r("AjaxDataSource",a(433).AjaxDataSource),r("ColumnDataSource",a(106).ColumnDataSource),r("ColumnarDataSource",a(101).ColumnarDataSource),r("CDSView",a(220).CDSView),r("DataSource",a(105).DataSource),r("GeoJSONDataSource",a(434).GeoJSONDataSource),r("WebDataSource",a(432).WebDataSource)},
function _(e,t,a,i,s){i();const n=e(432);class r extends n.WebDataSource{constructor(e){super(e),this.initialized=!1}setup(){if(!this.initialized){this.initialized=!0;new EventSource(this.data_url).onmessage=async e=>{var t;await this.load_data(JSON.parse(e.data),this.mode,null!==(t=this.max_size)&&void 0!==t?t:void 0)}}}}a.ServerSentDataSource=r,r.__name__="ServerSentDataSource"},
function _(t,a,e,n,s){var r;n();const l=t(106),i=t(20);class c extends l.ColumnDataSource{constructor(t){super(t)}get_column(t){return t in this.data?this.data[t]:[]}get_length(){var t;return null!==(t=super.get_length())&&void 0!==t?t:0}initialize(){super.initialize(),this.setup()}async load_data(t,a,e){const{adapter:n}=this;let s;switch(s=null!=n?await n.execute(this,{response:t}):t,a){case"replace":this.data=s;break;case"append":{const t=this.data;for(const a of this.columns()){const n=Array.from(t[a]),r=Array.from(s[a]),l=n.concat(r);s[a]=null!=e?l.slice(-e):l}this.data=s;break}}}}e.WebDataSource=c,r=c,c.__name__="WebDataSource",r.define((({Any:t,Int:a,String:e,Nullable:n})=>({max_size:[n(a),null],mode:[i.UpdateMode,"replace"],adapter:[n(t),null],data_url:[e]})))},
function _(t,e,i,s,a){var n;s();const r=t(432),o=t(20),l=t(19),d=t(9);class h extends r.WebDataSource{constructor(t){super(t),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 t=()=>this.get_data(this.mode,this.max_size,this.if_modified);this.interval=setInterval(t,this.polling_interval)}}get_data(t,e=null,i=!1){const s=this.prepare_request();s.addEventListener("load",(()=>this.do_load(s,t,null!=e?e:void 0))),s.addEventListener("error",(()=>this.do_error(s))),s.send()}prepare_request(){const t=new XMLHttpRequest;t.open(this.method,this.data_url,!0),t.withCredentials=!1,t.setRequestHeader("Content-Type",this.content_type);const e=this.http_headers;for(const[i,s]of(0,d.entries)(e))t.setRequestHeader(i,s);return t}async do_load(t,e,i){if(200==t.status){const s=JSON.parse(t.responseText);await this.load_data(s,e,i)}}do_error(t){l.logger.error(`Failed to fetch JSON from ${this.data_url} with code ${t.status}`)}}i.AjaxDataSource=h,n=h,h.__name__="AjaxDataSource",n.define((({Boolean:t,Int:e,String:i,Dict:s,Nullable:a})=>({polling_interval:[a(e),null],content_type:[i,"application/json"],http_headers:[s(i),{}],method:[o.HTTPMethod,"POST"],if_modified:[t,!1]})))},
function _(e,t,o,r,n){var s;r();const a=e(101),i=e(19),l=e(8),c=e(10),_=e(9);function g(e){return null!=e?e:NaN}const{hasOwnProperty:u}=Object.prototype;class y extends a.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,c.range)(0,e).map((e=>[]))}_get_new_nan_array(e){return(0,c.range)(0,e).map((e=>NaN))}_add_properties(e,t,o,r){var n;const s=null!==(n=e.properties)&&void 0!==n?n:{};for(const[e,n]of(0,_.entries)(s))u.call(t,e)||(t[e]=this._get_new_nan_array(r)),t[e][o]=g(n)}_add_geometry(e,t,o){function r(e,t){return e.concat([[NaN,NaN,NaN]]).concat(t)}switch(e.type){case"Point":{const[r,n,s]=e.coordinates;t.x[o]=r,t.y[o]=n,t.z[o]=g(s);break}case"LineString":{const{coordinates:r}=e;for(let e=0;e<r.length;e++){const[n,s,a]=r[e];t.xs[o][e]=n,t.ys[o][e]=s,t.zs[o][e]=g(a)}break}case"Polygon":{e.coordinates.length>1&&i.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used.");const r=e.coordinates[0];for(let e=0;e<r.length;e++){const[n,s,a]=r[e];t.xs[o][e]=n,t.ys[o][e]=s,t.zs[o][e]=g(a)}break}case"MultiPoint":i.logger.warn("MultiPoint not supported in Bokeh");break;case"MultiLineString":{const n=e.coordinates.reduce(r);for(let e=0;e<n.length;e++){const[r,s,a]=n[e];t.xs[o][e]=r,t.ys[o][e]=s,t.zs[o][e]=g(a)}break}case"MultiPolygon":{const n=[];for(const t of e.coordinates)t.length>1&&i.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),n.push(t[0]);const s=n.reduce(r);for(let e=0;e<s.length;e++){const[r,n,a]=s[e];t.xs[o][e]=r,t.ys[o][e]=n,t.zs[o][e]=g(a)}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((0,l.is_undefined)(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((0,l.is_undefined)(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 o=0;for(const e of t){const t="Feature"===e.type?e.geometry:e;"GeometryCollection"==t.type?o+=t.geometries.length:o+=1}const r={x:this._get_new_nan_array(o),y:this._get_new_nan_array(o),z:this._get_new_nan_array(o),xs:this._get_new_list_array(o),ys:this._get_new_list_array(o),zs:this._get_new_list_array(o)};let n=0;for(const e of t){const t="Feature"==e.type?e.geometry:e;if("GeometryCollection"==t.type)for(const s of t.geometries)this._add_geometry(s,r,n),"Feature"===e.type&&this._add_properties(e,r,n,o),n+=1;else this._add_geometry(t,r,n),"Feature"===e.type&&this._add_properties(e,r,n,o),n+=1}return r}}o.GeoJSONDataSource=y,s=y,y.__name__="GeoJSONDataSource",s.define((({String:e})=>({geojson:[e]}))),s.internal((({Any:e,Dict:t,Arrayable:o})=>({data:[t(o(e)),{}]})))},
function _(e,r,T,o,S){o(),S("BBoxTileSource",e(436).BBoxTileSource),S("MercatorTileSource",e(437).MercatorTileSource),S("QUADKEYTileSource",e(440).QUADKEYTileSource),S("TileRenderer",e(441).TileRenderer),S("TileSource",e(438).TileSource),S("TMSTileSource",e(444).TMSTileSource),S("WMTSTileSource",e(442).WMTSTileSource)},
function _(e,t,r,o,l){var i;o();const n=e(437);class s extends n.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,r){const o=this.string_lookup_replace(this.url,this.extra_url_vars);let l,i,n,s;return this.use_latlon?[i,s,l,n]=this.get_tile_geographic_bounds(e,t,r):[i,s,l,n]=this.get_tile_meter_bounds(e,t,r),o.replace("{XMIN}",i.toString()).replace("{YMIN}",s.toString()).replace("{XMAX}",l.toString()).replace("{YMAX}",n.toString())}}r.BBoxTileSource=s,i=s,s.__name__="BBoxTileSource",i.define((({Boolean:e})=>({use_latlon:[e,!1]})))},
function _(t,e,i,_,s){var r;_();const o=t(438),n=t(10),l=t(439);class u extends o.TileSource{constructor(t){super(t)}initialize(){super.initialize(),this._resolutions=(0,n.range)(this.min_zoom,this.max_zoom+1).map((t=>this.get_resolution(t)))}_computed_initial_resolution(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size}is_valid_tile(t,e,i){return!(!this.wrap_around&&(t<0||t>=2**i))&&!(e<0||e>=2**i)}parent_by_tile_xyz(t,e,i){const _=this.tile_xyz_to_quadkey(t,e,i),s=_.substring(0,_.length-1);return this.quadkey_to_tile_xyz(s)}get_resolution(t){return this._computed_initial_resolution()/2**t}get_resolution_by_extent(t,e,i){return[(t[2]-t[0])/i,(t[3]-t[1])/e]}get_level_by_extent(t,e,i){const _=(t[2]-t[0])/i,s=(t[3]-t[1])/e,r=Math.max(_,s);let o=0;for(const t of this._resolutions){if(r>t){if(0==o)return 0;if(o>0)return o-1}o+=1}return o-1}get_closest_level_by_extent(t,e,i){const _=(t[2]-t[0])/i,s=(t[3]-t[1])/e,r=Math.max(_,s),o=this._resolutions.reduce((function(t,e){return Math.abs(e-r)<Math.abs(t-r)?e:t}));return this._resolutions.indexOf(o)}snap_to_zoom_level(t,e,i,_){const[s,r,o,n]=t,l=this._resolutions[_];let u=i*l,a=e*l;if(!this.snap_to_zoom){const t=(o-s)/u,e=(n-r)/a;t>e?(u=o-s,a*=t):(u*=e,a=n-r)}const h=(u-(o-s))/2,c=(a-(n-r))/2;return[s-h,r-c,o+h,n+c]}tms_to_wmts(t,e,i){return[t,2**i-1-e,i]}wmts_to_tms(t,e,i){return[t,2**i-1-e,i]}pixels_to_meters(t,e,i){const _=this.get_resolution(i);return[t*_-this.x_origin_offset,e*_-this.y_origin_offset]}meters_to_pixels(t,e,i){const _=this.get_resolution(i);return[(t+this.x_origin_offset)/_,(e+this.y_origin_offset)/_]}pixels_to_tile(t,e){let i=Math.ceil(t/this.tile_size);i=0===i?i:i-1;return[i,Math.max(Math.ceil(e/this.tile_size)-1,0)]}pixels_to_raster(t,e,i){return[t,(this.tile_size<<i)-e]}meters_to_tile(t,e,i){const[_,s]=this.meters_to_pixels(t,e,i);return this.pixels_to_tile(_,s)}get_tile_meter_bounds(t,e,i){const[_,s]=this.pixels_to_meters(t*this.tile_size,e*this.tile_size,i),[r,o]=this.pixels_to_meters((t+1)*this.tile_size,(e+1)*this.tile_size,i);return[_,s,r,o]}get_tile_geographic_bounds(t,e,i){const _=this.get_tile_meter_bounds(t,e,i),[s,r,o,n]=(0,l.meters_extent_to_geographic)(_);return[s,r,o,n]}get_tiles_by_extent(t,e,i=1){const[_,s,r,o]=t;let[n,l]=this.meters_to_tile(_,s,e),[u,a]=this.meters_to_tile(r,o,e);n-=i,l-=i,u+=i,a+=i;const h=[];for(let t=a;t>=l;t--)for(let i=n;i<=u;i++)this.is_valid_tile(i,t,e)&&h.push([i,t,e,this.get_tile_meter_bounds(i,t,e)]);return this.sort_tiles_from_center(h,[n,l,u,a]),h}quadkey_to_tile_xyz(t){let e=0,i=0;const _=t.length;for(let s=_;s>0;s--){const r=1<<s-1;switch(t.charAt(_-s)){case"0":continue;case"1":e|=r;break;case"2":i|=r;break;case"3":e|=r,i|=r;break;default:throw new TypeError(`Invalid Quadkey: ${t}`)}}return[e,i,_]}tile_xyz_to_quadkey(t,e,i){let _="";for(let s=i;s>0;s--){const i=1<<s-1;let r=0;0!=(t&i)&&(r+=1),0!=(e&i)&&(r+=2),_+=r.toString()}return _}children_by_tile_xyz(t,e,i){const _=this.tile_xyz_to_quadkey(t,e,i),s=[];for(let t=0;t<=3;t++){const[e,i,r]=this.quadkey_to_tile_xyz(_+t.toString()),o=this.get_tile_meter_bounds(e,i,r);s.push([e,i,r,o])}return s}get_closest_parent_by_tile_xyz(t,e,i){const _=this.calculate_world_x_by_tile_xyz(t,e,i);[t,e,i]=this.normalize_xyz(t,e,i);let s=this.tile_xyz_to_quadkey(t,e,i);for(;s.length>0;)if(s=s.substring(0,s.length-1),[t,e,i]=this.quadkey_to_tile_xyz(s),[t,e,i]=this.denormalize_xyz(t,e,i,_),this.tiles.has(this.tile_xyz_to_key(t,e,i)))return[t,e,i];return[0,0,0]}normalize_xyz(t,e,i){if(this.wrap_around){const _=2**i;return[(t%_+_)%_,e,i]}return[t,e,i]}denormalize_xyz(t,e,i,_){return[t+_*2**i,e,i]}denormalize_meters(t,e,i,_){return[t+2*_*Math.PI*6378137,e]}calculate_world_x_by_tile_xyz(t,e,i){return Math.floor(t/2**i)}}i.MercatorTileSource=u,r=u,u.__name__="MercatorTileSource",r.define((({Boolean:t})=>({snap_to_zoom:[t,!1],wrap_around:[t,!0]}))),r.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},
function _(e,t,r,i,n){var l;i();const a=e(50),s=e(9);class c extends a.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 r=e;for(const[e,i]of(0,s.entries)(t))r=r.replace(`{${e}}`,i);return r}_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,r){return`${e}:${t}:${r}`}key_to_tile_xyz(e){const[t,r,i]=e.split(":").map((e=>parseInt(e)));return[t,r,i]}sort_tiles_from_center(e,t){const[r,i,n,l]=t,a=(n-r)/2+r,s=(l-i)/2+i;e.sort((function(e,t){return Math.sqrt((a-e[0])**2+(s-e[1])**2)-Math.sqrt((a-t[0])**2+(s-t[1])**2)}))}get_image_url(e,t,r){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",t.toString()).replace("{Z}",r.toString())}}r.TileSource=c,l=c,c.__name__="TileSource",l.define((({Number:e,String:t,Dict:r,Nullable:i})=>({url:[t,""],tile_size:[e,256],max_zoom:[e,30],min_zoom:[e,0],extra_url_vars:[r(t),{}],attribution:[t,""],x_origin_offset:[e],y_origin_offset:[e],initial_resolution:[i(e),null]})))},
function _(t,e,r,n,o){n();const c=t(107);function _(t,e){return c.wgs84_mercator.compute(t,e)}function g(t,e){return c.wgs84_mercator.invert(t,e)}r.geographic_to_meters=_,r.meters_to_geographic=g,r.geographic_extent_to_meters=function(t){const[e,r,n,o]=t,[c,g]=_(e,r),[i,u]=_(n,o);return[c,g,i,u]},r.meters_extent_to_geographic=function(t){const[e,r,n,o]=t,[c,_]=g(e,r),[i,u]=g(n,o);return[c,_,i,u]}},
function _(e,t,r,s,_){s();const o=e(437);class c extends o.MercatorTileSource{constructor(e){super(e)}get_image_url(e,t,r){const s=this.string_lookup_replace(this.url,this.extra_url_vars),[_,o,c]=this.tms_to_wmts(e,t,r),i=this.tile_xyz_to_quadkey(_,o,c);return s.replace("{Q}",i)}}r.QUADKEYTileSource=c,c.__name__="QUADKEYTileSource"},
function _(t,e,i,s,_){var n;s();const a=t(1),h=t(438),r=t(442),o=t(74),l=t(88),d=t(56),m=t(152),c=t(10),u=t(8),p=t(12),b=a.__importDefault(t(443));class g extends o.RendererView{constructor(){super(...arguments),this._tiles=null}mark_finished(){super.mark_finished(),this._tiles=[]}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,d.remove)(this.attribution_el),super.remove()}get_extent(){const{x_range:t,y_range:e}=this,i=t.start,s=e.start,_=t.end,n=e.end;return(0,p.assert)(isFinite(i)),(0,p.assert)(isFinite(s)),(0,p.assert)(isFinite(_)),(0,p.assert)(isFinite(n)),[i,s,_,n]}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,d.remove)(this.attribution_el);const{attribution:t}=this.model.tile_source;if((0,u.isString)(t)&&t.length>0){const{layout:e,frame:i}=this.plot_view,s=e.bbox.width-i.bbox.right,_=e.bbox.height-i.bbox.bottom,n=i.bbox.width;this.attribution_el=(0,d.div)({style:{right:`${s}px`,bottom:`${_}px`,"max-width":`${n}px`}});const a=(0,d.div)();a.innerHTML=t;const h=this.attribution_el.attachShadow({mode:"open"});new d.InlineStyleSheet(b.default).install(h),h.appendChild(a),this.attribution_el.title=a.textContent.replace(/\s*\n\s*/g," "),this.plot_view.canvas_view.add_event(this.attribution_el)}}_map_data(){this.initial_extent=this.get_extent();const t=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width),e=this.model.tile_source.snap_to_zoom_level(this.initial_extent,this.map_frame.bbox.height,this.map_frame.bbox.width,t);this.x_range.start=e[0],this.y_range.start=e[1],this.x_range.end=e[2],this.y_range.end=e[3],this.x_range instanceof l.Range1d&&(this.x_range.reset_start=e[0],this.x_range.reset_end=e[2]),this.y_range instanceof l.Range1d&&(this.y_range.reset_start=e[1],this.y_range.reset_end=e[3]),this._update_attribution()}_create_tile(t,e,i,s,_=!1){const n=this.model.tile_source.tile_xyz_to_quadkey(t,e,i),a=this.model.tile_source.tile_xyz_to_key(t,e,i);if(this.model.tile_source.tiles.has(a))return;const[h,r,o]=this.model.tile_source.normalize_xyz(t,e,i),l=this.model.tile_source.get_image_url(h,r,o),d={img:void 0,tile_coords:[t,e,i],normalized_coords:[h,r,o],quadkey:n,cache_key:a,bounds:s,loaded:!1,finished:!1,x_coord:s[0],y_coord:s[3]};this.model.tile_source.tiles.set(a,d),null==this._tiles&&(this._tiles=[]),this._tiles.push(d),new m.ImageLoader(l,{loaded:t=>{Object.assign(d,{img:t,loaded:!0}),_?(d.finished=!0,this.notify_finished()):this.request_render()},failed(){d.finished=!0}})}_enforce_aspect_ratio(){if(this._last_height!==this.map_frame.bbox.height||this._last_width!==this.map_frame.bbox.width){const t=this.get_extent(),e=this.model.tile_source.get_level_by_extent(t,this.map_frame.bbox.height,this.map_frame.bbox.width),i=this.model.tile_source.snap_to_zoom_level(t,this.map_frame.bbox.height,this.map_frame.bbox.width,e);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(null==this._tiles)return!1;for(const t of this._tiles)if(!t.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(t){const e=this.model.tile_source.tiles.get(t);if(null!=e&&e.loaded){const[[t],[i]]=this.coordinates.map_to_screen([e.bounds[0]],[e.bounds[3]]),[[s],[_]]=this.coordinates.map_to_screen([e.bounds[2]],[e.bounds[1]]),n=s-t,a=_-i,h=t,r=i,o=this.map_canvas.imageSmoothingEnabled;this.map_canvas.imageSmoothingEnabled=this.model.smoothing,this.map_canvas.drawImage(e.img,h,r,n,a),this.map_canvas.imageSmoothingEnabled=o,e.finished=!0}}_set_rect(){const t=this.plot_model.outline_line_width,e=this.map_frame.bbox.left+t/2,i=this.map_frame.bbox.top+t/2,s=this.map_frame.bbox.width-t,_=this.map_frame.bbox.height-t;this.map_canvas.rect(e,i,s,_),this.map_canvas.clip()}_render_tiles(t){this.map_canvas.save(),this._set_rect(),this.map_canvas.globalAlpha=this.model.alpha;for(const e of t)this._draw_tile(e);this.map_canvas.restore()}_prefetch_tiles(){const{tile_source:t}=this.model,e=this.get_extent(),i=this.map_frame.bbox.height,s=this.map_frame.bbox.width,_=this.model.tile_source.get_level_by_extent(e,i,s),n=this.model.tile_source.get_tiles_by_extent(e,_);for(let e=0,i=Math.min(10,n.length);e<i;e++){const[i,s,_]=n[e],a=this.model.tile_source.children_by_tile_xyz(i,s,_);for(const e of a){const[i,s,_,n]=e;t.tiles.has(t.tile_xyz_to_key(i,s,_))||this._create_tile(i,s,_,n,!0)}}}_fetch_tiles(t){for(const e of t){const[t,i,s,_]=e;this._create_tile(t,i,s,_)}}_update(){const{tile_source:t}=this.model,{min_zoom:e}=t,{max_zoom:i}=t;let s=this.get_extent();const _=this.extent[2]-this.extent[0]<s[2]-s[0],n=this.map_frame.bbox.height,a=this.map_frame.bbox.width;let h=t.get_level_by_extent(s,n,a),r=!1;h<e?(s=this.extent,h=e,r=!0):h>i&&(s=this.extent,h=i,r=!0),r&&(this.x_range.setv({start:s[0],end:s[2]}),this.y_range.setv({start:s[1],end:s[3]})),this.extent=s;const o=t.get_tiles_by_extent(s,h),l=[],d=[],m=[],u=[];for(const e of o){const[i,s,n]=e,a=t.tile_xyz_to_key(i,s,n),h=t.tiles.get(a);if(null!=h&&h.loaded)d.push(a);else if(this.model.render_parents){const[e,a,h]=t.get_closest_parent_by_tile_xyz(i,s,n),r=t.tile_xyz_to_key(e,a,h),o=t.tiles.get(r);if(null!=o&&o.loaded&&!(0,c.includes)(m,r)&&m.push(r),_){const e=t.children_by_tile_xyz(i,s,n);for(const[i,s,_]of e){const e=t.tile_xyz_to_key(i,s,_);t.tiles.has(e)&&u.push(e)}}}null==h&&l.push(e)}this._render_tiles(m),this._render_tiles(u),this._render_tiles(d),null!=this.render_timer&&clearTimeout(this.render_timer),this.render_timer=setTimeout((()=>this._fetch_tiles(l)),65)}}i.TileRendererView=g,g.__name__="TileRendererView";class f extends o.Renderer{constructor(t){super(t)}}i.TileRenderer=f,n=f,f.__name__="TileRenderer",n.prototype.default_view=g,n.define((({Boolean:t,Number:e,Ref:i})=>({alpha:[e,1],smoothing:[t,!0],tile_source:[i(h.TileSource),()=>new r.WMTSTileSource],render_parents:[t,!0]}))),n.override({level:"image"})},
function _(t,e,r,o,s){o();const c=t(437);class i extends c.MercatorTileSource{constructor(t){super(t)}get_image_url(t,e,r){const o=this.string_lookup_replace(this.url,this.extra_url_vars),[s,c,i]=this.tms_to_wmts(t,e,r);return o.replace("{X}",s.toString()).replace("{Y}",c.toString()).replace("{Z}",i.toString())}}r.WMTSTileSource=i,i.__name__="WMTSTileSource"},
function _(o,e,i,l,t){l(),i.default=":host{position:absolute;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;}a{color:black;}"},
function _(e,r,t,c,o){c();const i=e(437);class l extends i.MercatorTileSource{constructor(e){super(e)}get_image_url(e,r,t){return this.string_lookup_replace(this.url,this.extra_url_vars).replace("{X}",e.toString()).replace("{Y}",r.toString()).replace("{Z}",t.toString())}}t.TMSTileSource=l,l.__name__="TMSTileSource"},
function _(e,t,u,a,r){a(),r("CanvasTexture",e(446).CanvasTexture),r("ImageURLTexture",e(448).ImageURLTexture),r("Texture",e(447).Texture)},
function _(t,e,n,c,s){var r;c();const o=t(447),a=t(40);class u extends o.Texture{constructor(t){super(t)}get func(){const t=(0,a.use_strict)(this.code);return new Function("ctx","color","scale","weight",t)}get_pattern(t,e,n){const c=document.createElement("canvas");c.width=e,c.height=e;const s=c.getContext("2d");return this.func.call(this,s,t,e,n),c}}n.CanvasTexture=u,r=u,u.__name__="CanvasTexture",r.define((({String:t})=>({code:[t]})))},
function _(e,t,n,r,o){var i;r();const s=e(50),u=e(20);class c extends s.Model{constructor(e){super(e)}}n.Texture=c,i=c,c.__name__="Texture",i.define((()=>({repetition:[u.TextureRepetition,"repeat"]})))},
function _(e,t,i,r,n){var a;r();const s=e(447),o=e(152);class u extends s.Texture{constructor(e){super(e)}initialize(){super.initialize(),this._loader=new o.ImageLoader(this.url)}get_pattern(e,t,i){const{_loader:r}=this;return this._loader.finished?r.image:r.promise}}i.ImageURLTexture=u,a=u,u.__name__="ImageURLTexture",a.define((({String:e})=>({url:[e]})))},
function _(e,n,o,a,i){a();e(1).__exportStar(e(450),o),i("Dialog",e(454).Dialog),i("Examiner",e(458).Examiner),i("Pane",e(460).Pane),i("Tooltip",e(461).Tooltip),i("UIElement",e(266).UIElement)},
function _(n,c,o,I,i){I(),i("BuiltinIcon",n(451).BuiltinIcon),i("SVGIcon",n(452).SVGIcon),i("TablerIcon",n(453).TablerIcon)},
function _(e,n,t,i,s){var o;i();const r=e(1),a=e(391),l=e(56),c=e(22),m=e(8),u=r.__importDefault(e(278));class _ extends a.IconView{constructor(){super(...arguments),this._style=new l.InlineStyleSheet}stylesheets(){return[...super.stylesheets(),u.default,this._style]}render(){super.render();const e=`var(--bokeh-icon-${this.model.icon_name})`,n=(0,c.color2css)(this.model.color),t=(()=>{const{size:e}=this.model;return(0,m.isNumber)(e)?`${e}px`:e})();this._style.replace(`\n :host {\n display: inline-block;\n vertical-align: middle;\n width: ${t};\n height: ${t};\n background-color: ${n};\n mask-image: ${e};\n mask-size: contain;\n mask-repeat: no-repeat;\n -webkit-mask-image: ${e};\n -webkit-mask-size: contain;\n -webkit-mask-repeat: no-repeat;\n }\n `)}}t.BuiltinIconView=_,_.__name__="BuiltinIconView";class d extends a.Icon{constructor(e){super(e)}}t.BuiltinIcon=d,o=d,d.__name__="BuiltinIcon",o.prototype.default_view=_,o.define((({String:e,Color:n})=>({icon_name:[e],color:[n,"gray"]})))},
function _(e,n,s,t,r){var i;t();const o=e(391),l=e(56),c=e(8);class a extends o.IconView{constructor(){super(...arguments),this._style=new l.InlineStyleSheet}stylesheets(){return[...super.stylesheets(),this._style]}render(){super.render();const e=(()=>{const{size:e}=this.model;return(0,c.isNumber)(e)?`${e}px`:e})();this._style.replace(`\n :host {\n display: inline-block;\n vertical-align: middle;\n }\n :host svg {\n width: ${e};\n height: ${e};\n }\n `);const n=(new DOMParser).parseFromString(this.model.svg,"image/svg+xml");this.shadow_el.append(n.documentElement)}}s.SVGIconView=a,a.__name__="SVGIconView";class d extends o.Icon{constructor(e){super(e)}}s.SVGIcon=d,i=d,d.__name__="SVGIcon",i.prototype.default_view=a,i.define((({String:e})=>({svg:[e]})))},
function _(e,n,t,s,r){var o,l;s();const i=e(391),a=e(56),c=e(8);class f extends i.IconView{constructor(){super(...arguments),this._tabler=new a.ImportedStyleSheet(`${o._url}/tabler-icons.min.css`),this._style=new a.InlineStyleSheet}stylesheets(){return[...super.stylesheets(),o._fonts,this._tabler,this._style]}render(){super.render();const e=(()=>{const{size:e}=this.model;return(0,c.isNumber)(e)?`${e}px`:e})();this._style.replace(`\n :host {\n display: inline-block;\n vertical-align: middle;\n font-size: ${e};\n }\n `);const n=(0,a.span)({class:["ti",`ti-${this.model.icon_name}`]});this.shadow_el.appendChild(n)}}t.TablerIconView=f,o=f,f.__name__="TablerIconView",f._url="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest",f._fonts=new a.GlobalInlineStyleSheet(` /*!\n * Tabler Icons 1.68.0 by tabler - https://tabler.io\n * License - https://github.com/tabler/tabler-icons/blob/master/LICENSE\n */\n @font-face {\n font-family: "tabler-icons";\n font-style: normal;\n font-weight: 400;\n src: url("${o._url}/fonts/tabler-icons.eot");\n src: url("${o._url}/fonts/tabler-icons.eot?#iefix") format("embedded-opentype"),\n url("${o._url}/fonts/tabler-icons.woff2") format("woff2"),\n url("${o._url}/fonts/tabler-icons.woff") format("woff"),\n url("${o._url}/fonts/tabler-icons.ttf") format("truetype"),\n url("${o._url}/fonts/tabler-icons.svg#tabler-icons") format("svg");\n }\n\n @media screen and (-webkit-min-device-pixel-ratio: 0) {\n @font-face {\n font-family: "tabler-icons";\n src: url("${o._url}/fonts/tabler-icons.svg#tabler-icons") format("svg");\n }\n }\n`);class b extends i.Icon{constructor(e){super(e)}}t.TablerIcon=b,l=b,b.__name__="TablerIcon",l.prototype.default_view=f,l.define((({String:e})=>({icon_name:[e]})))},
function _(e,t,i,s,n){var l;s();const o=e(1),a=e(266),d=e(455),r=e(456),c=e(56),h=e(8),_=e(59),p=o.__importStar(e(457)),u=p,m=o.__importDefault(e(278)),v=a.UIElement;class w extends a.UIElementView{*children(){yield*super.children(),yield this._content}stylesheets(){return[...super.stylesheets(),p.default,m.default]}async lazy_initialize(){await super.lazy_initialize();const e=(()=>{const{content:e}=this.model;return(0,h.isString)(e)?new r.Text({content:e}):e})();this._content=await(0,_.build_view)(e,{parent:this})}connect_signals(){super.connect_signals();const{visible:e}=this.model.properties;this.on_change(e,(()=>this.render()))}remove(){this._content.remove(),super.remove()}render(){if(super.render(),!this.model.visible)return void this.el.remove();document.body.appendChild(this.el),this._content.render();const e=(0,c.div)({class:u.title}),t=(0,c.div)({class:u.content},this._content.el),i=(0,c.div)({class:u.buttons});if(this.shadow_el.appendChild(e),this.shadow_el.appendChild(t),this.shadow_el.appendChild(i),this.model.closable){const e=(0,c.div)({class:u.close});e.addEventListener("click",(()=>this.model.visible=!1)),this.shadow_el.appendChild(e)}}}i.DialogView=w,w.__name__="DialogView";class b extends a.UIElement{constructor(e){super(e)}}i.Dialog=b,l=b,b.__name__="Dialog",l.prototype.default_view=w,l.define((({Boolean:e,String:t,Array:i,Ref:s,Or:n,Nullable:l})=>({title:[l(n(t,s(d.DOMNode))),null],content:[n(t,s(d.DOMNode),s(a.UIElement))],buttons:[i(s(v)),[]],modal:[e,!1],closable:[e,!0],draggable:[e,!0]})))},
function _(e,o,_,d,s){d();const n=e(55),c=e(50);class t extends n.DOMView{}_.DOMNodeView=t,t.__name__="DOMNodeView";class M extends c.Model{constructor(e){super(e)}}_.DOMNode=M,M.__name__="DOMNode",M.__module__="bokeh.models.dom"},
function _(e,t,n,o,r){var c;o();const s=e(455);class _ extends s.DOMNodeView{render(){this.el.textContent=this.model.content}_createElement(){return document.createTextNode("")}}n.TextView=_,_.__name__="TextView";class d extends s.DOMNode{constructor(e){super(e)}}n.Text=d,c=d,d.__name__="Text",c.prototype.default_view=_,c.define((({String:e})=>({content:[e,""]})))},
function _(o,e,t,i,r){i(),t.title="bk-title",t.content="bk-content",t.buttons="bk-buttons",t.close="bk-close",t.default=":host{--bokeh-bg-color:white;--bokeh-border-color:#e5e5e5;--bokeh-shadow-color:#e5e5e5;}:host{position:fixed;z-index:1000;left:0;right:0;top:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;width:80vw;height:60vh;overflow:hidden;display:flex;flex-direction:column;flex-wrap:nowrap;background-color:var(--bokeh-bg-color);border:1px solid var(--bokeh-border-color);box-shadow:5px 5px 10px var(--bokeh-shadow-color);}.bk-title{position:relative;flex:1;min-height:0;}.bk-content{position:relative;flex:1;min-height:100%;display:flex;}.bk-buttons{position:relative;flex:1;min-height:0;}.bk-close{position:absolute;top:0;right:0;width:18px;height:18px;cursor:pointer;background-color:gray;mask-image:var(--bokeh-icon-x);mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:var(--bokeh-icon-x);-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;}.bk-close:hover{background-color:red;}"},
function _(t,e,s,n,o){var i;n();const a=t(1),l=t(266),r=a.__importStar(t(18)),c=t(14),d=t(56),p=t(42),h=t(50),u=t(8),f=t(9),_=t(10),v=t(34),g=t(15),m=t(38),b=a.__importDefault(t(459));class y{constructor(t,e,s){this.visited=new WeakSet,this.depth=0,this.click=t,this.max_items=e,this.max_depth=s}to_html(t){if((0,u.isObject)(t)){if(this.visited.has(t))return(0,d.span)("<circular>");this.visited.add(t)}return null==t?this.null():(0,u.isBoolean)(t)?this.boolean(t):(0,u.isNumber)(t)?this.number(t):(0,u.isString)(t)?this.string(t):(0,u.isSymbol)(t)?this.symbol(t):t instanceof h.Model?this.model(t):t instanceof r.Property?this.property(t):(0,u.isPlainObject)(t)?this.object(t):(0,u.isArray)(t)?this.array(t):(0,u.isIterable)(t)?this.iterable(t):(0,d.span)((0,p.to_string)(t))}null(){return(0,d.span)({class:"null"},"null")}token(t){return(0,d.span)({class:"token"},t)}boolean(t){return(0,d.span)({class:"boolean"},`${t}`)}number(t){return(0,d.span)({class:"number"},`${t}`)}string(t){const e=t.includes("'"),s=t.includes('"'),n=e&&s?`\`${t.replace(/`/g,"\\`")}\``:s?`'${t}'`:`"${t}"`;return(0,d.span)({class:"string"},n)}symbol(t){return(0,d.span)({class:"symbol"},t.toString())}array(t){const e=this.token,s=[];let n=0;for(const e of t)if(s.push(this.to_html(e)),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"array"},e("["),...(0,v.interleave)(s,(()=>e(", "))),e("]"))}iterable(t){var e;const s=this.token,n=null!==(e=Object(t)[Symbol.toStringTag])&&void 0!==e?e:"Object",o=this.array([...t]);return(0,d.span)({class:"iterable"},`${n}`,s("("),o,s(")"))}object(t){const e=this.token,s=[];let n=0;for(const[o,i]of(0,f.entries)(t))if(s.push((0,d.span)(`${o}`,e(": "),this.to_html(i))),n++>this.max_items){s.push((0,d.span)("\u2026"));break}return(0,d.span)({class:"object"},e("{"),...(0,v.interleave)(s,(()=>e(", "))),e("}"))}model(t){const e=this.token,s=(0,d.span)({class:"model"},t.constructor.__qualified__,e("("),this.to_html(t.id),e(")"));return s.addEventListener("click",(()=>this.click(t))),s}property(t){const e=this.model(t.obj),s=(0,d.span)({class:"attr"},t.attr);return(0,d.span)(e,this.token("."),s)}}s.HTMLPrinter=y,y.__name__="HTMLPrinter";class k extends l.UIElementView{constructor(){super(...arguments),this.prev_listener=null,this.watched_props=new Set}stylesheets(){return[...super.stylesheets(),b.default]}render(){super.render(),null!=this.prev_listener&&m.diagnostics.disconnect(this.prev_listener);const t=[],e=[],s=[],n=new WeakMap;m.diagnostics.connect((o=>{if(o instanceof r.Property){for(const[e,s]of t)e==o.obj&&i(s);for(const[t,s]of e)if(t==o){const[,,,e]=s.children;a(t,s,e);break}for(const[t,e]of s)if(t==o){const[,s]=e.children;a(t,e,s);break}}function i(t){const e=n.get(t);null!=e&&e.cancel();const s=t.animate([{backgroundColor:"#def189"},{backgroundColor:"initial"}],{duration:2e3});n.set(t,s)}function a(t,e,s){e.classList.toggle("dirty",t.dirty),(0,d.empty)(s);const n=t.is_unset?(0,d.span)("unset"):C(t.get_value());s.appendChild(n),i(s)}}));const o=(()=>{const e=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return e.addEventListener("keyup",(()=>{const s=e.value;for(const[e,n]of t){const t=e.constructor.__qualified__.includes(s);n.classList.toggle("hidden",!t)}})),(0,d.div)({class:"toolbar"},e)})(),i=(0,d.input)({type:"checkbox",checked:!0}),a=(0,d.input)({type:"checkbox",checked:!0}),l=()=>{for(const[t,s]of e){const e=i.checked,n=a.checked,o=!t.dirty&&!e||t.internal&&!n;s.classList.toggle("hidden",o)}};i.addEventListener("change",(()=>l())),a.addEventListener("change",(()=>l()));const p=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"}),s=(0,d.span)({class:"checkbox"},(0,d.input)({type:"checkbox",checked:!0}),(0,d.span)("Group")),n=(0,d.span)({class:"checkbox"},i,(0,d.span)("Initial?")),o=(0,d.span)({class:"checkbox"},a,(0,d.span)("Internal?"));return t.addEventListener("keyup",(()=>{const s=t.value;for(const[t,n]of e){const e=t.attr.includes(s);n.classList.toggle("hidden",!e)}})),(0,d.div)({class:"toolbar"},t,s,n,o)})(),u=(()=>{const t=(0,d.input)({class:"filter",type:"text",placeholder:"Filter"});return t.addEventListener("keyup",(()=>{const e=t.value;for(const[t,n]of s){const s=t.attr.includes(e);n.classList.toggle("hidden",!s)}})),(0,d.div)({class:"toolbar"},t)})(),v=(0,d.div)({class:"models-list"}),b=(0,d.div)({class:"props-list"}),k=(0,d.div)({class:"watches-list"}),x=(0,d.div)({class:"models-panel"},o,v),w=(0,d.div)({class:"props-panel"},p,b),L=(0,d.div)({class:"watches-panel"},u,k),E=(0,d.div)({class:"col",style:{width:"100%"}},L,w),j=(0,d.div)({class:"examiner"},x,E);function S(t){t instanceof h.Model&&O(t)}function C(t){return new y(S,5,3).to_html(t)}const P=(e,s)=>{(0,_.clear)(t),(0,d.empty)(v);const n=null!=s?new Set(s.roots()):new Set;for(const s of e){const e=n.has(s)?(0,d.span)({class:"tag"},"root"):null,o=(0,d.span)({class:"model-ref",tabIndex:0},C(s),e);o.addEventListener("keydown",(t=>{"Enter"==t.key&&O(s)})),t.push([s,o]),v.appendChild(o)}},O=s=>{var n;(0,_.clear)(e),(0,d.empty)(b);for(const[e,n]of t)n.classList.toggle("active",s==e);const o=(()=>{const t=[];let e=Object.getPrototypeOf(s);do{t.push([e.constructor,(0,f.keys)(e._props)]),e=Object.getPrototypeOf(e)}while(e.constructor!=c.HasProps);t.reverse();const n=[];for(const[,e]of t)e.splice(0,n.length),n.push(...e);return t})(),l=null!==(n=g.receivers_for_sender.get(s))&&void 0!==n?n:[];for(const[t,n]of o){if(0==n.length)continue;const o=(0,d.span)({class:["expander"]}),r=(0,d.div)({class:"base"},o,"inherited from"," ",(0,d.span)({class:"monospace"},t.__qualified__));b.appendChild(r);const c=[];for(const t of n){const n=s.property(t),o=n.kind.toString(),r=n.is_unset?(0,d.span)("unset"):C(n.get_value()),p=n.internal?(0,d.span)({class:"tag"},"internal"):null,h=l.filter((t=>t.signal==n.change)).length,u=0!=h?(0,d.span)({class:"tag"},`${h}`):null,f=this.watched_props.has(n),_=(0,d.input)({type:"checkbox",checked:f}),v=(0,d.div)({class:"prop-attr",tabIndex:0},_,(0,d.span)({class:"attr"},t),p),g=(0,d.div)({class:"prop-conns"},u),m=(0,d.div)({class:"prop-kind"},o),y=(0,d.div)({class:"prop-value"},r),k=n.dirty?"dirty":null,x=n.internal?"internal":null,w=i.checked,L=a.checked,E=!n.dirty&&!w||n.internal&&!L?"hidden":null,j=(0,d.div)({class:["prop",k,x,E]},v,g,m,y);c.push(j),e.push([n,j]),b.appendChild(j),_.addEventListener("change",(()=>{this.watched_props[_.checked?"add":"delete"](n),$()}))}r.addEventListener("click",(()=>{o.classList.toggle("closed");for(const t of c)t.classList.toggle("closed")}))}},$=()=>{if((0,_.clear)(s),(0,d.empty)(k),0==this.watched_props.size){const t=(0,d.div)({class:"nothing"},"No watched properties");k.appendChild(t)}else for(const t of this.watched_props){const e=(0,d.span)(C(t)),n=(0,d.span)(t.is_unset?(0,d.span)("unset"):C(t.get_value())),o=(0,d.div)({class:["prop",t.dirty?"dirty":null]},e,n);s.push([t,o]),k.appendChild(o)}};this.shadow_el.appendChild(j);const{target:I}=this.model;if(null!=I){const t=I.references(),{document:e}=I;P(t,e),O(I)}else{const{document:t}=this.model;if(null!=t){P(t._all_models.values(),t);const e=t.roots();if(0!=e.length){const[t]=e;O(t)}}}$()}}s.ExaminerView=k,k.__name__="ExaminerView";class x extends l.UIElement{constructor(t){super(t)}}s.Examiner=x,i=x,x.__name__="Examiner",i.prototype.default_view=k,i.define((({Ref:t,Nullable:e})=>({target:[e(t(c.HasProps)),null]})))},
function _(o,e,r,i,l){i(),r.default='.null{color:#7724c1;}.token{color:#881280;}.boolean{color:#007500;}.number{color:#1a1aa6;}.string{color:#994500;}.symbol{color:#c80000;}.model{cursor:pointer;}.attr{color:#c80000;}:root{--common-padding:3px;--common-outline:#1a73e8 solid 1px;--panel-bg-color:#f1f3f4;--panel-border-color:#cacdd1;}.monospace{font-family:var(--mono-font);}.hidden{display:none !important;}.col{display:flex;flex-direction:column;}.row{display:flex;flex-direction:row;}.toolbar{display:flex;flex-direction:row;gap:1em;background-color:var(--panel-bg-color);border-bottom:1px solid var(--panel-border-color);padding:var(--common-padding);}.checkbox{display:flex;flex-direction:row;align-items:center;gap:0.25em;}.filter:focus{outline:var(--common-outline);}.examiner{height:100%;display:flex;border:1px solid var(--panel-border-color);}.models-panel{display:flex;flex-direction:column;border-right:1px solid var(--panel-border-color);}.props-panel{display:flex;flex-direction:column;height:100%;overflow:auto;}.watches-panel{display:flex;flex-direction:column;border-bottom:1px solid var(--panel-border-color);}.models-list{display:flex;flex-direction:column;height:min-content;padding:var(--common-padding);overflow-x:hidden;overflow-y:auto;}.props-list{display:grid;grid-template-columns:min-content min-content 1fr 1fr;column-gap:1em;padding:var(--common-padding);}.watches-list{display:grid;grid-template-columns:1fr 1fr;column-gap:1em;padding:var(--common-padding);}.nothing{grid-column:1 / span 2;font-style:italic;text-align:center;}.prop{display:contents;}.prop.closed{display:none;}.prop > *{opacity:0.6;}.prop.dirty > *{opacity:1;}.model-ref{display:flex;align-items:center;flex-direction:row;font-family:var(--mono-font);}.model-ref:focus-visible{outline:var(--common-outline);}.model-ref:hover{background-color:#e2e2e2;}.model-ref.active{background-color:#c8e0ee;}.tag{margin-left:1em;padding:0 4px;font-size:60%;border-width:1px;border-style:solid;border-radius:4px;color:#202124;background-color:#f1f3f4;border-color:#cacdd1;}.expander{margin:0 2px;display:inline-block;vertical-align:middle;background-color:#5f6368;--open-image:url(\'data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="6"> <path d="M 0 1 L 6 1 3 5 Z"/> </svg>\');--closed-image:url(\'data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="6"> <path d="M 1 0 L 5 3 1 6 Z"/> </svg>\');}.expander{width:6px;height:6px;mask-image:var(--open-image);-webkit-mask-image:var(--open-image);}.expander.closed{width:6px;height:6px;mask-image:var(--closed-image);-webkit-mask-image:var(--closed-image);}.base{grid-column:1 / span 4;color:#5f6368;cursor:pointer;}.prop-attr,.prop-conns,.prop-kind,.prop-value{display:flex;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-family:var(--mono-font);}.prop-attr > input[type="checkbox"]{visibility:hidden;margin-right:0.25em;}.prop-attr > input[type="checkbox"]:checked,.prop-attr:hover > input{visibility:visible;}.prop-attr:focus-visible{outline:var(--common-outline);}'},
function _(e,i,s,t,n){var r;t();const l=e(266),_=e(59),a=e(8);class h extends l.UIElementView{constructor(){super(...arguments),this._child_views=new Map}get _ui_elements(){return this.model.children.filter((e=>e instanceof l.UIElement))}get child_views(){return this._ui_elements.map((e=>this._child_views.get(e)))}*children(){yield*super.children(),yield*this._child_views.values()}async lazy_initialize(){await super.lazy_initialize(),await this._rebuild_views()}async _rebuild_views(){await(0,_.build_views)(this._child_views,this._ui_elements,{parent:this})}remove(){(0,_.remove_views)(this._child_views),super.remove()}connect_signals(){super.connect_signals();const{children:e}=this.model.properties;this.on_change(e,(()=>{this._rebuild_views(),this.render()}))}render(){super.render();for(const e of this.model.children)if((0,a.isString)(e)){const i=document.createTextNode(e);this.shadow_el.append(i)}else{const i=this._child_views.get(e);i.render(),this.shadow_el.append(i.el),i.after_render()}}has_finished(){if(!super.has_finished())return!1;for(const e of this.child_views)if(!e.has_finished())return!1;return!0}serializable_state(){return Object.assign(Object.assign({},super.serializable_state()),{children:this.child_views.map((e=>e.serializable_state()))})}}s.PaneView=h,h.__name__="PaneView";class d extends l.UIElement{constructor(e){super(e)}}s.Pane=d,r=d,d.__name__="Pane",r.prototype.default_view=h,r.define((({String:e,Array:i,Ref:s,Or:t})=>({children:[i(t(e,s(l.UIElement))),[]]})))},
function _(t,e,r,i,n){var o;i();const s=t(1),l=t(266),a=t(426),h=t(462),c=t(20),_=t(56),u=t(55),d=t(8),g=t(12),p=t(57),f=t(19),m=t(59),b=s.__importStar(t(463)),v=b,w=s.__importDefault(t(278));class y extends l.UIElementView{constructor(){super(...arguments),this._html=null}get target(){return this._target}set target(t){this._target=t}_init_target(){const{target:t}=this.model,e=(()=>{var e,r;if(t instanceof l.UIElement)return null!==(r=null===(e=this.owner.find_one(t))||void 0===e?void 0:e.el)&&void 0!==r?r:null;if(t instanceof a.Selector)return t.find_one(document);if(t instanceof Node)return t;{const{parent:t}=this;return t instanceof u.DOMElementView?t.el:null}})();e instanceof Element?this._target=e:(f.logger.warn(`unable to resolve target '${t}' for '${this}'`),this._target=document.body)}initialize(){super.initialize(),this._init_target()}*children(){yield*super.children(),null!=this._html&&(yield this._html)}async lazy_initialize(){await super.lazy_initialize();const{content:t}=this.model;t instanceof h.HTML&&(this._html=await(0,m.build_view)(t,{parent:this})),this.render()}connect_signals(){super.connect_signals(),this._observer=new ResizeObserver((()=>{this._reposition()})),this._observer.observe(this.target);const{target:t,content:e,closable:r,interactive:i,position:n,attachment:o,visible:s}=this.model.properties;this.on_change(t,(()=>{this._init_target(),this._observer.disconnect(),this._observer.observe(this.target),this.render()})),this.on_change([e,r,i],(()=>this.render())),this.on_change([n,o,s],(()=>this._reposition()))}remove(){var t;null===(t=this._html)||void 0===t||t.remove(),this._observer.disconnect(),super.remove()}stylesheets(){return[...super.stylesheets(),b.default,w.default]}get content(){const{content:t}=this.model;return(0,d.isString)(t)?document.createTextNode(t):t instanceof h.HTML?((0,g.assert)(null!=this._html),this._html.el):t}render(){var t;if(super.render(),null===(t=this._html)||void 0===t||t.render(),this.arrow_el=(0,_.div)({class:[v.arrow]}),this.content_el=(0,_.div)({class:v.tooltip_content},this.content),this.shadow_el.append(this.arrow_el,this.content_el),this.model.closable){const t=(0,_.div)({class:v.close});t.addEventListener("click",(()=>{this.model.visible=!1})),this.shadow_el.appendChild(t)}this.el.classList.toggle(v.show_arrow,this.model.show_arrow),this.el.classList.toggle(v.non_interactive,!this.model.interactive),this._reposition()}_anchor_to_align(t){switch(t){case"top_left":return["top","left"];case"top":case"top_center":return["top","center"];case"top_right":return["top","right"];case"left":case"center_left":return["center","left"];case"center":case"center_center":return["center","center"];case"right":case"center_right":return["center","right"];case"bottom_left":return["bottom","left"];case"bottom":case"bottom_center":return["bottom","center"];case"bottom_right":return["bottom","right"]}}_reposition(){var t;const{position:e,visible:r}=this.model;if(null==e||!r)return void this.el.remove();(null!==(t=this.target.shadowRoot)&&void 0!==t?t:this.target).appendChild(this.el);const i=(0,_.bounding_box)(this.target),[n,o]=(()=>{if((0,d.isString)(e)){const[t,r]=this._anchor_to_align(e);return[(()=>{switch(r){case"left":return i.left;case"center":return i.hcenter;case"right":return i.right}})(),(()=>{switch(t){case"top":return i.top;case"center":return i.vcenter;case"bottom":return i.bottom}})()]}{const[t,r]=e;return[i.left+t,i.top+r]}})(),s=new p.BBox({x:0,y:0,width:window.innerWidth,height:window.innerHeight}),l=(0,_.box_size)(this.arrow_el),a=(()=>{const t=(()=>{const{attachment:t}=this.model;if("auto"==t){if((0,d.isString)(e)){const[t,r]=this._anchor_to_align(e);if("center"!=r)return"left"==r?"left":"right";if("center"!=t)return"top"==t?"above":"below"}return"horizontal"}return t})(),r=(0,_.box_size)(this.el),a=r.width+l.width,h=r.height+l.height;switch(t){case"horizontal":return n<i.hcenter?n+a<=s.right?"right":"left":n-a>=s.left?"left":"right";case"vertical":return o<i.vcenter?o+h<=s.bottom?"below":"above":o-h>=s.top?"above":"below";default:return t}})();this.class_list.remove(v.right,v.left,v.above,v.below),this.class_list.add((()=>{switch(a){case"left":return v.right;case"right":return v.left;case"above":return v.below;case"below":return v.above}})()),this.arrow_el.style.left=`${n}px`,this.arrow_el.style.top=`${o}px`;const{left:h,top:c}=(()=>{const{width:t,height:e}=(0,_.box_size)(this.el);function r(t){return t<s.top?s.top:t+e>s.bottom?s.bottom-e:t}function i(e){return e<s.left?s.left:e+t>s.right?s.right-t:e}switch(a){case"left":return{left:n-t-l.width,top:r(o-e/2)};case"right":return{left:n+l.width,top:r(o-e/2)};case"above":return{left:i(n-t/2),top:o-e-l.height};case"below":return{left:i(n-t/2),top:o+l.height}}})();this.el.style.top=`${c}px`,this.el.style.left=`${h}px`}}r.TooltipView=y,y.__name__="TooltipView";class x extends l.UIElement{constructor(t){super(t)}clear(){this.position=null}}r.Tooltip=x,o=x,x.__name__="Tooltip",o.prototype.default_view=y,o.define((({Boolean:t,Number:e,String:r,Tuple:i,Or:n,Ref:o,Nullable:s,Auto:_})=>({target:[n(o(l.UIElement),o(a.Selector),o(Node),_),"auto"],position:[s(n(c.Anchor,i(e,e))),null],content:[n(r,o(h.HTML),o(Node))],attachment:[n(c.TooltipAttachment,_),"auto"],show_arrow:[t,!0],closable:[t,!1],interactive:[t,!0]}))),o.override({visible:!1})},
function _(e,t,r,s,i){var n;s();const o=e(455),l=e(266),d=e(59),a=e(56),c=e(12),_=e(8);class f extends o.DOMNodeView{constructor(){super(...arguments),this._refs=new Map}*children(){yield*super.children(),yield*this._refs.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,d.build_views)(this._refs,this.model.refs)}remove(){(0,d.remove_views)(this._refs),super.remove()}render(){(0,a.empty)(this.el),this.el.style.display="contents";const e=new DOMParser,t=(()=>{const{html:t}=this.model;if((0,_.isString)(t)){const r=e.parseFromString(t,"text/html"),s=r.createNodeIterator(r,NodeFilter.SHOW_ELEMENT,(e=>"ref"==e.nodeName.toLowerCase()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT));let i;for(;null!=(i=s.nextNode());){(0,c.assert)(i instanceof Element);const e=i.getAttribute("id");if(null!=e)for(const[t,r]of this._refs)if(t.id==e){r.render(),i.replaceWith(r.el);break}}return[...r.body.childNodes]}return[]})();for(const e of t)this.el.appendChild(e)}}r.HTMLView=f,f.__name__="HTMLView";class h extends o.DOMNode{constructor(e){super(e)}}r.HTML=h,n=h,h.__name__="HTML",n.prototype.default_view=f,n.define((({String:e,Array:t,Or:r,Ref:s})=>({html:[r(e,t(r(e,s(o.DOMNode),s(l.UIElement))))],refs:[t(r(s(o.DOMNode),s(l.UIElement))),[]]})))},
function _(o,t,r,i,a){i(),r.non_interactive="bk-non-interactive",r.arrow="bk-arrow",r.show_arrow="bk-show-arrow",r.left="bk-left",r.right="bk-right",r.above="bk-above",r.below="bk-below",r.tooltip_content="bk-tooltip-content",r.tooltip_row_label="bk-tooltip-row-label",r.tooltip_row_value="bk-tooltip-row-value",r.tooltip_color_block="bk-tooltip-color-block",r.close="bk-close",r.default=':host{--tooltip-border:#e5e5e5;--tooltip-color:white;--tooltip-text:#2f2f2f;--tooltip-arrow-color:#909599;--tooltip-arrow-width:10px;--tooltip-arrow-height:10px;--tooltip-arrow-half-width:7px;--tooltip-arrow-half-height:7px;}:host{width:max-content;font-weight:300;font-size:12px;position:fixed;padding:5px;border:1px solid var(--tooltip-border);color:var(--tooltip-text);background-color:var(--tooltip-color);opacity:0.95;z-index:100;}:host(.bk-non-interactive){pointer-events:none;}.bk-arrow{position:fixed;width:0;height:0;content:" ";border-style:solid;border-color:transparent;}:host(:not(.bk-show-arrow)) .bk-arrow{display:none;}:host(.bk-left) .bk-arrow,:host(.bk-right) .bk-arrow{border-width:var(--tooltip-arrow-half-height) 0 var(--tooltip-arrow-half-height) 0;}:host(.bk-above) .bk-arrow,:host(.bk-below) .bk-arrow{border-width:0 var(--tooltip-arrow-half-width) 0 var(--tooltip-arrow-half-width);}:host(.bk-left) .bk-arrow{transform:translate(0%, -50%);border-right-width:var(--tooltip-arrow-width);border-right-color:var(--tooltip-arrow-color);}:host(.bk-right) .bk-arrow{transform:translate(-100%, -50%);border-left-width:var(--tooltip-arrow-width);border-left-color:var(--tooltip-arrow-color);}:host(.bk-above) .bk-arrow{transform:translate(-50%, 0%);border-bottom-width:var(--tooltip-arrow-height);border-bottom-color:var(--tooltip-arrow-color);}:host(.bk-below) .bk-arrow{transform:translate(-50%, -100%);border-top-width:var(--tooltip-arrow-height);border-top-color:var(--tooltip-arrow-color);}.bk-tooltip-content > div:not(:first-child){margin-top:5px;border-top:var(--tooltip-border) 1px dashed;}.bk-tooltip-row-label{text-align:right;color:#26aae1;}.bk-tooltip-row-value{color:none;}.bk-tooltip-color-block{width:12px;height:12px;margin-left:5px;margin-right:5px;outline:#dddddd solid 1px;display:inline-block;}.bk-close{position:absolute;top:2px;right:2px;width:12px;height:12px;cursor:pointer;background-color:gray;mask-image:var(--bokeh-icon-x);mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:var(--bokeh-icon-x);-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;}.bk-close:hover{background-color:red;}'},
function _(o,t,r,n,l){n();const _=o(1);_.__exportStar(o(465),r),_.__exportStar(o(479),r),_.__exportStar(o(489),r),_.__exportStar(o(501),r),l("Tool",o(273).Tool),l("ToolProxy",o(274).ToolProxy),l("Toolbar",o(265).Toolbar),l("ToolButton",o(275).ToolButton),l("OnOffButton",o(281).OnOffButton),l("ClickButton",o(284).ClickButton)},
function _(o,l,T,e,n){e(),n("ActionTool",o(283).ActionTool),n("CopyTool",o(466).CopyTool),n("CustomAction",o(467).CustomAction),n("FullscreenTool",o(468).FullscreenTool),n("HelpTool",o(285).HelpTool),n("ExamineTool",o(469).ExamineTool),n("RedoTool",o(470).RedoTool),n("ResetTool",o(472).ResetTool),n("SaveTool",o(473).SaveTool),n("UndoTool",o(474).UndoTool),n("ZoomInTool",o(475).ZoomInTool),n("ZoomOutTool",o(478).ZoomOutTool)},
function _(o,t,e,i,a){var n;i();const c=o(283),p=o(278);class s extends c.ActionToolView{async copy(){const o=await this.parent.export().to_blob(),t=new ClipboardItem({[o.type]:o});await navigator.clipboard.write([t])}doit(){this.copy()}}e.CopyToolView=s,s.__name__="CopyToolView";class l extends c.ActionTool{constructor(o){super(o),this.tool_name="Copy",this.tool_icon=p.tool_icon_copy}}e.CopyTool=l,n=l,l.__name__="CopyTool",n.prototype.default_view=s,n.register_alias("copy",(()=>new n))},
function _(o,t,n,e,i){var c;e();const l=o(1),s=o(283),_=l.__importStar(o(278));class a extends s.ActionToolView{doit(){var o;null===(o=this.model.callback)||void 0===o||o.execute(this.model)}}n.CustomActionView=a,a.__name__="CustomActionView";class u extends s.ActionTool{constructor(o){super(o),this.tool_name="Custom Action",this.tool_icon=_.tool_icon_unknown}}n.CustomAction=u,c=u,u.__name__="CustomAction",c.prototype.default_view=a,c.define((({Any:o,Nullable:t})=>({callback:[t(o),null]}))),c.override({description:"Perform a Custom Action"})},
function _(e,l,o,t,n){var s;t();const c=e(1),r=e(283),u=c.__importStar(e(278)),i=void 0!==Element.prototype.webkitRequestFullscreen?(e,l)=>e.webkitRequestFullscreen(l):(e,l)=>e.requestFullscreen(l);class _ extends r.ActionToolView{doit(){null!=document.fullscreenElement?document.exitFullscreen():(async()=>{await i(this.parent.el)})()}}o.FullscreenToolView=_,_.__name__="FullscreenToolView";class a extends r.ActionTool{constructor(e){super(e),this.tool_name="Fullscreen",this.tool_icon=u.tool_icon_fullscreen}}o.FullscreenTool=a,s=a,a.__name__="FullscreenTool",s.prototype.default_view=_,s.register_alias("fullscreen",(()=>new s))},
function _(i,e,o,t,a){var n;t();const l=i(1),s=i(283),_=l.__importStar(i(278)),r=i(454),c=i(458),d=i(59);class m extends s.ActionToolView{*children(){yield*super.children(),yield this._dialog}async lazy_initialize(){await super.lazy_initialize();const i=new r.Dialog({content:new c.Examiner({target:this.parent.model}),closable:!0,visible:!1});this._dialog=await(0,d.build_view)(i,{parent:this.parent})}doit(){this._dialog.model.visible=!0}}o.ExamineToolView=m,m.__name__="ExamineToolView";class w extends s.ActionTool{constructor(i){super(i),this.tool_name="Examine",this.tool_icon=_.tool_icon_settings}}o.ExamineTool=w,n=w,w.__name__="ExamineTool",n.prototype.default_view=m,n.register_alias("examine",(()=>new n))},
function _(o,e,t,i,s){var n;i();const l=o(471),_=o(278);class d extends l.PlotActionToolView{connect_signals(){super.connect_signals(),this.connect(this.plot_view.state.changed,(()=>this.model.disabled=!this.plot_view.state.can_redo))}doit(){const o=this.plot_view.state.redo();null!=(null==o?void 0:o.range)&&this.plot_view.trigger_ranges_update_event()}}t.RedoToolView=d,d.__name__="RedoToolView";class a extends l.PlotActionTool{constructor(o){super(o),this.tool_name="Redo",this.tool_icon=_.tool_icon_redo}}t.RedoTool=a,n=a,a.__name__="RedoTool",n.prototype.default_view=d,n.override({disabled:!0}),n.register_alias("redo",(()=>new n))},
function _(o,t,n,e,l){e();const c=o(283);class i extends c.ActionToolView{get plot_view(){return this.parent}}n.PlotActionToolView=i,i.__name__="PlotActionToolView";class s extends c.ActionTool{constructor(o){super(o)}}n.PlotActionTool=s,s.__name__="PlotActionTool"},
function _(e,o,t,s,i){var l;s();const _=e(471),n=e(278);class c extends _.PlotActionToolView{doit(){this.plot_view.reset()}}t.ResetToolView=c,c.__name__="ResetToolView";class r extends _.PlotActionTool{constructor(e){super(e),this.tool_name="Reset",this.tool_icon=n.tool_icon_reset}}t.ResetTool=r,l=r,r.__name__="ResetTool",l.prototype.default_view=c,l.register_alias("reset",(()=>new l))},
function _(e,o,t,a,n){var i;a();const l=e(283),s=e(278);class c extends l.ActionToolView{async copy(){const e=await this.parent.export().to_blob(),o=new ClipboardItem({[e.type]:e});await navigator.clipboard.write([o])}async save(e){const o=await this.parent.export().to_blob(),t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=e,t.target="_blank",t.dispatchEvent(new MouseEvent("click"))}doit(e="save"){var o;switch(e){case"save":{const e=null!==(o=this.model.filename)&&void 0!==o?o:prompt("Enter filename","bokeh_plot");null!=e&&this.save(e);break}case"copy":this.copy()}}}t.SaveToolView=c,c.__name__="SaveToolView";class r extends l.ActionTool{constructor(e){super(e),this.tool_name="Save",this.tool_icon=s.tool_icon_save}get menu(){return[{icon:"bk-tool-icon-copy",tooltip:"Copy image to clipboard",if:()=>"undefined"!=typeof ClipboardItem,handler:()=>{this.do.emit("copy")}}]}}t.SaveTool=r,i=r,r.__name__="SaveTool",i.prototype.default_view=c,i.define((({String:e,Nullable:o})=>({filename:[o(e),null]}))),i.register_alias("save",(()=>new i))},
function _(o,t,e,n,i){var s;n();const l=o(471),_=o(278);class d extends l.PlotActionToolView{connect_signals(){super.connect_signals(),this.connect(this.plot_view.state.changed,(()=>this.model.disabled=!this.plot_view.state.can_undo))}doit(){const o=this.plot_view.state.undo();null!=(null==o?void 0:o.range)&&this.plot_view.trigger_ranges_update_event()}}e.UndoToolView=d,d.__name__="UndoToolView";class a extends l.PlotActionTool{constructor(o){super(o),this.tool_name="Undo",this.tool_icon=_.tool_icon_undo}}e.UndoTool=a,s=a,a.__name__="UndoTool",s.prototype.default_view=d,s.override({disabled:!0}),s.register_alias("undo",(()=>new s))},
function _(o,e,n,i,s){var t;i();const _=o(476),a=o(278);class m extends _.ZoomBaseToolView{get factor(){return this.model.factor}}n.ZoomInToolView=m,m.__name__="ZoomInToolView";class l extends _.ZoomBaseTool{constructor(o){super(o),this.maintain_focus=!0,this.tool_name="Zoom In",this.tool_icon=a.tool_icon_zoom_in}}n.ZoomInTool=l,t=l,l.__name__="ZoomInTool",t.prototype.default_view=m,t.register_alias("zoom_in",(()=>new t({dimensions:"both"}))),t.register_alias("xzoom_in",(()=>new t({dimensions:"width"}))),t.register_alias("yzoom_in",(()=>new t({dimensions:"height"})))},
function _(e,o,t,s,n){var a;s();const i=e(471),r=e(202),l=e(94),c=e(20),_=e(477),d=e(12),m=e(19);class h extends i.PlotActionToolView{doit(){var e;const{dimensions:o}=this.model,t="width"==o||"both"==o,s="height"==o||"both"==o,{frame:n}=this.plot_view,{x_target:a,y_target:i}=n,r=new Map(n.x_scales),c=new Map(n.y_scales),{renderers:h}=this.model;if("auto"!=h){const e=new Set,o=new Set;for(const t of h)null==t.coordinates&&(e.add(t.x_range_name),o.add(t.y_range_name));for(const o of r.keys())e.has(o)||r.delete(o);for(const e of c.keys())o.has(e)||c.delete(e)}const u=[...r.values()],f=[...c.values()],p="auto"!=h?h:this.plot_view.model.data_renderers;for(const e of p){if(null==e.coordinates)continue;const o=this.plot_view.renderer_view(e);(0,d.assert)(null!=o);const t=(e,o)=>{const{level:t}=this.model;for(let s=0;s<t;s++){if(!(e instanceof l.CompositeScale)){m.logger.warn(`can't reach sub-coordinate level ${t} for ${e} in ${o} dimension; stopped at ${s}`);break}e=e.source_scale}return e instanceof l.CompositeScale?e.target_scale:e},{x_scale:s,y_scale:n}=o.coordinates;u.push(t(s,"x")),f.push(t(n,"y"))}const v=(0,_.scale_range)(u,f,a,i,this.factor,t,s);this.plot_view.state.push("zoom_out",{range:v}),this.plot_view.update_range(v,{scrolling:!0,maintain_focus:this.model.maintain_focus}),null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model),this.plot_view.trigger_ranges_update_event()}}t.ZoomBaseToolView=h,h.__name__="ZoomBaseToolView";class u extends i.PlotActionTool{constructor(e){super(e)}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}t.ZoomBaseTool=u,a=u,u.__name__="ZoomBaseTool",a.define((({Percent:e,Or:o,Array:t,Ref:s,Auto:n,NonNegative:a,Int:i})=>({factor:[e,.1],dimensions:[c.Dimensions,"both"],renderers:[o(t(s(r.DataRenderer)),n),"auto"],level:[a(i),0]})))},
function _(n,t,r,e,o){e();const s=n(11);function c(n,t,r){const[e,o]=(0,s.minmax)(n.start,n.end),c=null!=r?r:(o+e)/2;return[e-(e-c)*t,o-(o-c)*t]}function a(n,t,r){const e=new Map;for(const o of n){const[n,s]=c(o.target_range,t,r),[a,u]=o.r_invert(n,s);e.set(o.source_range,{start:a,end:u})}return e}r.scale_interval=c,r.get_info=function(n,[t,r]){const e=new Map;for(const o of n){const[n,s]=o.r_invert(t,r);e.set(o.source_range,{start:n,end:s})}return e},r.rescale=a,r.scale_range=function(n,t,r,e,o,s=!0,c=!0,u){return{xrs:a(n,s?o:0,null==u?void 0:u.x),yrs:a(t,c?o:0,null==u?void 0:u.y),factor:o}}},
function _(o,t,e,s,i){var n;s();const _=o(476),a=o(278);class m extends _.ZoomBaseToolView{get factor(){const{factor:o}=this.model;return-o/(1-o)}}e.ZoomOutToolView=m,m.__name__="ZoomOutToolView";class l extends _.ZoomBaseTool{constructor(o){super(o),this.tool_name="Zoom Out",this.tool_icon=a.tool_icon_zoom_out}}e.ZoomOutTool=l,n=l,l.__name__="ZoomOutTool",n.prototype.default_view=m,n.define((({Boolean:o})=>({maintain_focus:[o,!0]}))),n.register_alias("zoom_out",(()=>new n({dimensions:"both"}))),n.register_alias("xzoom_out",(()=>new n({dimensions:"width"}))),n.register_alias("yzoom_out",(()=>new n({dimensions:"height"})))},
function _(o,l,T,i,t){i(),t("EditTool",o(480).EditTool),t("BoxEditTool",o(481).BoxEditTool),t("FreehandDrawTool",o(482).FreehandDrawTool),t("LineEditTool",o(483).LineEditTool),t("PointDrawTool",o(485).PointDrawTool),t("PolyDrawTool",o(486).PolyDrawTool),t("PolyTool",o(487).PolyTool),t("PolyEditTool",o(488).PolyEditTool)},
function _(e,t,s,o,n){var i;o();const r=e(10),c=e(8),_=e(12),a=e(280);class l extends a.GestureToolView{constructor(){super(...arguments),this._mouse_in_frame=!0}_select_mode(e){const{shift:t,ctrl:s}=e.modifiers;return t||s?t&&!s?"append":!t&&s?"intersect":t&&s?"subtract":void(0,_.unreachable)():"replace"}_move_enter(e){this._mouse_in_frame=!0}_move_exit(e){this._mouse_in_frame=!1}_map_drag(e,t,s){if(!this.plot_view.frame.bbox.contains(e,t))return null;const o=this.plot_view.renderer_view(s);if(null==o)return null;return[o.coordinates.x_scale.invert(e),o.coordinates.y_scale.invert(t)]}_delete_selected(e){const t=e.data_source,s=t.selected.indices;s.sort();for(const e of t.columns()){const o=t.get_array(e);for(let e=0;e<s.length;e++){const t=s[e];o.splice(t-e,1)}}this._emit_cds_changes(t)}_pop_glyphs(e,t){const s=e.columns();if(0!=t&&0!=s.length)for(const o of s){let s=e.get_array(o);const n=s.length-t+1;n<1||((0,c.isArray)(s)||(s=Array.from(s),e.data[o]=s),s.splice(0,n))}}_emit_cds_changes(e,t=!0,s=!0,o=!0){if(s&&e.selection_manager.clear(),t&&e.change.emit(),o){const{data:t}=e;e.setv({data:t},{check_eq:!1})}}_drag_points(e,t,s="both"){if(null==this._basepoint)return;const[o,n]=this._basepoint;for(const i of t){const t=this._map_drag(o,n,i),r=this._map_drag(e.sx,e.sy,i);if(null==r||null==t)continue;const[c,_]=r,[a,l]=t,[d,u]=[c-a,_-l],h=i.glyph,f=i.data_source,[m,p]=[h.x.field,h.y.field];for(const e of f.selected.indices)!m||"width"!=s&&"both"!=s||(f.data[m][e]+=d),!p||"height"!=s&&"both"!=s||(f.data[p][e]+=u);f.change.emit()}this._basepoint=[e.sx,e.sy]}_pad_empty_columns(e,t){for(const s of e.columns())(0,r.includes)(t,s)||e.get_array(s).push(this.model.empty_value)}_select_event(e,t,s){const o=this.plot_view.frame,{sx:n,sy:i}=e;if(!o.bbox.contains(n,i))return[];const r={type:"point",sx:n,sy:i},c=[];for(const e of s){const s=e.get_selection_manager(),o=e.data_source,n=this.plot_view.renderer_view(e);if(null!=n){s.select([n],r,!0,t)&&c.push(e),o.properties.selected.change.emit()}}return c}}s.EditToolView=l,l.__name__="EditToolView";class d extends a.GestureTool{constructor(e){super(e)}}s.EditTool=d,i=d,d.__name__="EditTool",i.define((({Unknown:e})=>({empty_value:[e,0]})))},
function _(e,i,t,s,l){var n;s();const o=e(20),d=e(28),r=e(204),_=e(350),f=e(330),a=e(347),h=e(335),c=e(359),p=e(337),u=e(361),m=e(201),F=e(480),b=e(278),x=e(12),y=e(9);class g extends F.EditToolView{constructor(){super(...arguments),this._recent_renderers=[]}_tap(e){null==this._draw_basepoint&&null==this._basepoint&&(this._recent_renderers=this._select_event(e,this._select_mode(e),this.model.renderers))}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const i of this.model.renderers)if("Backspace"==e.key)this._delete_selected(i);else if("Escape"==e.key){i.data_source.selection_manager.clear()}}_set_extent([e,i],[t,s],l,n=!1){var o;const r=null!==(o=this._recent_renderers[0])&&void 0!==o?o:this.model.renderers[0],m=this.plot_view.renderer_view(r);if(null==m)return;const{glyph:F}=r,b=r.data_source,[g,w]=m.coordinates.x_scale.r_invert(e,i),[v,B]=m.coordinates.y_scale.r_invert(t,s),E=(()=>{if(F instanceof _.Rect){const{x:e,y:i,width:t,height:s}=F;if((0,d.isField)(e)&&(0,d.isField)(i)&&(0,d.isField)(t)&&(0,d.isField)(s))return{[e.field]:(g+w)/2,[i.field]:(v+B)/2,[t.field]:w-g,[s.field]:B-v}}else if(F instanceof f.Block){const{x:e,y:i,width:t,height:s}=F;if((0,d.isField)(e)&&(0,d.isField)(i)&&(0,d.isField)(t)&&(0,d.isField)(s))return{[e.field]:g,[i.field]:v,[t.field]:w-g,[s.field]:B-v}}else if(F instanceof a.Quad){const{right:e,bottom:i,left:t,top:s}=F;if((0,d.isField)(e)&&(0,d.isField)(i)&&(0,d.isField)(t)&&(0,d.isField)(s))return{[e.field]:w,[i.field]:v,[t.field]:g,[s.field]:B}}else if(F instanceof h.HBar){const{left:e,y:i,height:t,right:s}=F;if((0,d.isField)(e)&&(0,d.isField)(i)&&(0,d.isField)(t)&&(0,d.isField)(s))return{[e.field]:g,[i.field]:B,[t.field]:B-v,[s.field]:w}}else if(F instanceof c.VBar){const{x:e,bottom:i,width:t,top:s}=F;if((0,d.isField)(e)&&(0,d.isField)(i)&&(0,d.isField)(t)&&(0,d.isField)(s))return{[e.field]:g,[i.field]:v,[t.field]:w-g,[s.field]:B}}else if(F instanceof p.HStrip){const{y0:e,y1:i}=F;if((0,d.isField)(e)&&(0,d.isField)(i))return{[e.field]:e,[i.field]:i}}else if(F instanceof u.VStrip){const{x0:e,x1:i}=F;if((0,d.isField)(e)&&(0,d.isField)(i))return{[e.field]:e,[i.field]:i}}else(0,x.unreachable)(`'${F.type}' is not supported"`);return null})();if(null!=E){if(l){this._pop_glyphs(b,this.model.num_objects);for(const[e,i]of(0,y.entries)(E))b.get_array(e).push(i);this._pad_empty_columns(b,(0,y.keys)(E))}else{const e=b.get_length();if(null==e)return;const i=e-1;for(const[e,t]of(0,y.entries)(E))b.data[e][i]=t}this._emit_cds_changes(b,!0,!1,n)}}_update_box(e,i=!1,t=!1){if(null==this._draw_basepoint)return;const s=[e.sx,e.sy],l=this.plot_view.frame,n=this.model.dimensions,[o,d]=this.model._get_dim_limits(this._draw_basepoint,s,l,n);this._set_extent(o,d,i,t)}_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.modifiers.shift){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._recent_renderers=this._select_event(e,"append",this.model.renderers),this._basepoint=[e.sx,e.sy]}}_pan(e,i=!1,t=!1){if(e.modifiers.shift){if(null==this._draw_basepoint)return;this._update_box(e,i,t)}else{if(null==this._basepoint)return;this._drag_points(e,this.model.renderers)}}_drag_points(e,i,t="both"){if(null==this._basepoint)return;const[s,l]=this._basepoint;for(const n of i){const i=this._map_drag(s,l,n),o=this._map_drag(e.sx,e.sy,n);if(null==o||null==i)continue;const[_,m]=o,[F,b]=i,g="width"==t||"both"==t?_-F:0,w="height"==t||"both"==t?m-b:0,{glyph:v}=n,B=n.data_source,E={};if(v instanceof r.XYGlyph){const{x:e,y:i}=v;(0,d.isField)(e)&&(E[e.field]=g),(0,d.isField)(i)&&(E[i.field]=w)}else if(v instanceof f.Block){const{x:e,y:i}=v;(0,d.isField)(e)&&(E[e.field]=g),(0,d.isField)(i)&&(E[i.field]=w)}else if(v instanceof a.Quad){const{right:e,bottom:i,left:t,top:s}=v;(0,d.isField)(t)&&(0,d.isField)(e)&&(E[t.field]=g,E[e.field]=g),(0,d.isField)(s)&&(0,d.isField)(i)&&(E[s.field]=w,E[i.field]=w)}else if(v instanceof h.HBar){const{left:e,right:i,y:t}=v;(0,d.isField)(e)&&(0,d.isField)(i)&&(E[e.field]=g,E[i.field]=g),(0,d.isField)(t)&&(E[t.field]=w)}else if(v instanceof c.VBar){const{x:e,top:i,bottom:t}=v;(0,d.isField)(e)&&(E[e.field]=g),(0,d.isField)(i)&&(0,d.isField)(t)&&(E[i.field]=w,E[t.field]=w)}else if(v instanceof p.HStrip){const{y0:e,y1:i}=v;(0,d.isField)(e)&&(0,d.isField)(i)&&(E[e.field]=w,E[i.field]=w)}else if(v instanceof u.VStrip){const{x0:e,x1:i}=v;(0,d.isField)(e)&&(0,d.isField)(i)&&(E[e.field]=g,E[i.field]=g)}else(0,x.unreachable)(`'${v.type}' is not supported"`);for(const e of B.selected.indices)for(const[i,t]of(0,y.entries)(E))B.data[i][e]+=t;B.change.emit()}this._basepoint=[e.sx,e.sy]}_pan_end(e){if(this._pan(e,!1,!0),e.modifiers.shift)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)}}}t.BoxEditToolView=g,g.__name__="BoxEditToolView";class w extends F.EditTool{constructor(e){super(e),this.tool_name="Box Edit Tool",this.tool_icon=b.tool_icon_box_edit,this.event_type=["tap","pan","move"],this.default_order=1}}t.BoxEditTool=w,n=w,w.__name__="BoxEditTool",n.prototype.default_view=g,n.define((({Int:e,Array:i,Ref:t})=>({dimensions:[o.Dimensions,"both"],num_objects:[e,0],renderers:[i(t(m.GlyphRenderer)),[]]})))},
function _(e,t,a,r,s){var _;r();const d=e(8),o=e(480),n=e(201),i=e(278);class l extends o.EditToolView{_draw(e,t,a=!1){if(!this.model.active)return;const r=this.model.renderers[0],s=this._map_drag(e.sx,e.sy,r);if(null==s)return;const[_,o]=s,n=r.data_source,i=r.glyph,[l,h]=[i.xs.field,i.ys.field];if("new"==t)this._pop_glyphs(n,this.model.num_objects),l&&n.get_array(l).push([_]),h&&n.get_array(h).push([o]),this._pad_empty_columns(n,[l,h]);else if("add"==t){if(l){const e=n.data[l].length-1;let t=n.get_array(l)[e];(0,d.isArray)(t)||(t=Array.from(t),n.data[l][e]=t),t.push(_)}if(h){const e=n.data[h].length-1;let t=n.get_array(h)[e];(0,d.isArray)(t)||(t=Array.from(t),n.data[h][e]=t),t.push(o)}}this._emit_cds_changes(n,!0,!0,a)}_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)"Escape"==e.key?t.data_source.selection_manager.clear():"Backspace"==e.key&&this._delete_selected(t)}}a.FreehandDrawToolView=l,l.__name__="FreehandDrawToolView";class h extends o.EditTool{constructor(e){super(e),this.tool_name="Freehand Draw Tool",this.tool_icon=i.tool_icon_freehand_draw,this.event_type=["pan","tap"],this.default_order=3}}a.FreehandDrawTool=h,_=h,h.__name__="FreehandDrawTool",_.prototype.default_view=l,_.define((({Int:e,Array:t,Ref:a})=>({num_objects:[e,0],renderers:[t(a(n.GlyphRenderer)),[]]}))),_.register_alias("freehand_draw",(()=>new _))},
function _(e,t,s,i,r){var n;i();const _=e(20),d=e(201),o=e(484),l=e(278);class h extends o.LineToolView{constructor(){super(...arguments),this._drawing=!1}_doubletap(e){if(!this.model.active)return;const t=this.model.renderers;for(const s of t){1==this._select_event(e,"replace",[s]).length&&(this._selected_renderer=s)}this._show_intersections(),this._update_line_cds()}_show_intersections(){if(!this.model.active)return;if(null==this._selected_renderer)return;if(0==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,[s,i]=[t.x.field,t.y.field],r=e.get_array(s),n=e.get_array(i);this._set_intersection(r,n)}_tap(e){const t=this.model.intersection_renderer;if(null==this._map_drag(e.sx,e.sy,t))return;if(this._drawing&&null!=this._selected_renderer){const s=this._select_mode(e);if(0==this._select_event(e,s,[t]).length)return}const s=this._select_mode(e);this._select_event(e,s,[t]),this._select_event(e,s,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,[s,i]=[e.x.field,e.y.field];if(s&&i){const e=t.data[s],r=t.data[i];this._selected_renderer.data_source.data[s]=e,this._selected_renderer.data_source.data[i]=r}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),null!=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),null!=this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source),this._basepoint=null)}activate(){this._drawing=!0}deactivate(){null!=this._selected_renderer&&(this._drawing&&(this._drawing=!1),this._hide_intersections())}}s.LineEditToolView=h,h.__name__="LineEditToolView";class c extends o.LineTool{constructor(e){super(e),this.tool_name="Line Edit Tool",this.tool_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)}}s.LineEditTool=c,n=c,c.__name__="LineEditTool",n.prototype.default_view=h,n.define((({Array:e,Ref:t})=>({dimensions:[_.Dimensions,"both"],renderers:[e(t(d.GlyphRenderer)),[]]})))},
function _(e,i,n,t,s){var o;t();const r=e(8),_=e(480);class d extends _.EditToolView{_set_intersection(e,i){const n=this.model.intersection_renderer.glyph,t=this.model.intersection_renderer.data_source,[s,o]=[n.x.field,n.y.field];s&&((0,r.isArray)(e)?t.data[s]=e:n.x={value:e}),o&&((0,r.isArray)(i)?t.data[o]=i:n.y={value:i}),this._emit_cds_changes(t,!0,!0,!1)}_hide_intersections(){this._set_intersection([],[])}}n.LineToolView=d,d.__name__="LineToolView";class a extends _.EditTool{constructor(e){super(e)}}n.LineTool=a,o=a,a.__name__="LineTool",o.define((({AnyRef:e})=>({intersection_renderer:[e()]})))},
function _(e,t,s,o,a){var r;o();const i=e(201),n=e(480),_=e(278);class d extends n.EditToolView{_tap(e){if(0!=this._select_event(e,this._select_mode(e),this.model.renderers).length||!this.model.add)return;const t=this.model.renderers[0],s=this._map_drag(e.sx,e.sy,t);if(null==s)return;const o=t.glyph,a=t.data_source,[r,i]=[o.x.field,o.y.field],[n,_]=s;this._pop_glyphs(a,this.model.num_objects),r&&a.get_array(r).push(n),i&&a.get_array(i).push(_),this._pad_empty_columns(a,[r,i]);const{data:d}=a;a.setv({data:d},{check_eq:!1})}_keyup(e){if(this.model.active&&this._mouse_in_frame)for(const t of this.model.renderers)"Backspace"==e.key?this._delete_selected(t):"Escape"==e.key&&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}}}s.PointDrawToolView=d,d.__name__="PointDrawToolView";class l extends n.EditTool{constructor(e){super(e),this.tool_name="Point Draw Tool",this.tool_icon=_.tool_icon_point_draw,this.event_type=["tap","pan","move"],this.default_order=2}}s.PointDrawTool=l,r=l,l.__name__="PointDrawTool",r.prototype.default_view=d,r.define((({Boolean:e,Int:t,Array:s,Ref:o})=>({add:[e,!0],drag:[e,!0],num_objects:[t,0],renderers:[s(o(i.GlyphRenderer)),[]]})))},
function _(e,t,s,i,r){var a;i();const o=e(8),n=e(201),d=e(487),_=e(278);class l extends d.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,s=!1){const i=this.model.renderers[0],r=this._map_drag(e.sx,e.sy,i);if(this._initialized||this.activate(),null==r)return;const[a,n]=this._snap_to_vertex(e,...r),d=i.data_source,_=i.glyph,[l,h]=[_.xs.field,_.ys.field];if("new"==t)this._pop_glyphs(d,this.model.num_objects),l&&d.get_array(l).push([a,a]),h&&d.get_array(h).push([n,n]),this._pad_empty_columns(d,[l,h]);else if("edit"==t){if(l){const e=d.data[l][d.data[l].length-1];e[e.length-1]=a}if(h){const e=d.data[h][d.data[h].length-1];e[e.length-1]=n}}else if("add"==t){if(l){const e=d.data[l].length-1;let t=d.get_array(l)[e];const s=t[t.length-1];t[t.length-1]=a,(0,o.isArray)(t)||(t=Array.from(t),d.data[l][e]=t),t.push(s)}if(h){const e=d.data[h].length-1;let t=d.get_array(h)[e];const s=t[t.length-1];t[t.length-1]=n,(0,o.isArray)(t)||(t=Array.from(t),d.data[h][e]=t),t.push(s)}}this._emit_cds_changes(d,!0,!1,s)}_show_vertices(){if(!this.model.active)return;const e=[],t=[];for(let s=0;s<this.model.renderers.length;s++){const i=this.model.renderers[s],r=i.data_source,a=i.glyph,[o,n]=[a.xs.field,a.ys.field];if(o)for(const t of r.get_array(o))e.push(...t);if(n)for(const e of r.get_array(n))t.push(...e);this._drawing&&s==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,s=e.glyph,[i,r]=[s.xs.field,s.ys.field];if(i){const e=t.data[i].length-1,s=t.get_array(i)[e];s.splice(s.length-1,1)}if(r){const e=t.data[r].length-1,s=t.get_array(r)[e];s.splice(s.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)"Backspace"==e.key?this._delete_selected(t):"Escape"==e.key&&(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,s]=this._basepoint;for(const i of this.model.renderers){const r=this._map_drag(t,s,i),a=this._map_drag(e.sx,e.sy,i);if(null==a||null==r)continue;const o=i.data_source,n=i.glyph,[d,_]=[n.xs.field,n.ys.field];if(!d&&!_)continue;const[l,h]=a,[c,g]=r,[f,p]=[l-c,h-g];for(const e of o.selected.indices){let t,s,i;d&&(s=o.data[d][e]),_?(i=o.data[_][e],t=i.length):t=s.length;for(let e=0;e<t;e++)s&&(s[e]+=f),i&&(i[e]+=p)}o.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(null!=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),null!=this.model.vertex_renderer&&this._hide_vertices()}}s.PolyDrawToolView=l,l.__name__="PolyDrawToolView";class h extends d.PolyTool{constructor(e){super(e),this.tool_name="Polygon Draw Tool",this.tool_icon=_.tool_icon_poly_draw,this.event_type=["pan","tap","move"],this.default_order=3}}s.PolyDrawTool=h,a=h,h.__name__="PolyDrawTool",a.prototype.default_view=l,a.define((({Boolean:e,Int:t,Array:s,Ref:i})=>({drag:[e,!0],num_objects:[t,0],renderers:[s(i(n.GlyphRenderer)),[]]})))},
function _(e,t,r,l,s){var o;l();const _=e(8),i=e(12),n=e(480);class d extends n.EditToolView{_set_vertices(e,t){const{vertex_renderer:r}=this.model;(0,i.assert)(null!=r);const l=r.glyph,s=r.data_source,[o,n]=[l.x.field,l.y.field];o&&((0,_.isArray)(e)?s.data[o]=e:l.x={value:e}),n&&((0,_.isArray)(t)?s.data[n]=t:l.y={value:t}),this._emit_cds_changes(s,!0,!0,!1)}_hide_vertices(){this._set_vertices([],[])}_snap_to_vertex(e,t,r){if(null!=this.model.vertex_renderer){const l=this._select_event(e,"replace",[this.model.vertex_renderer]),s=this.model.vertex_renderer.data_source,o=this.model.vertex_renderer.glyph,[_,i]=[o.x.field,o.y.field];if(0!=l.length){const e=s.selected.indices[0];_&&(t=s.data[_][e]),i&&(r=s.data[i][e]),s.selection_manager.clear()}}return[t,r]}}r.PolyToolView=d,d.__name__="PolyToolView";class a extends n.EditTool{constructor(e){super(e)}}r.PolyTool=a,o=a,a.__name__="PolyTool",o.define((({AnyRef:e,Nullable:t})=>({vertex_renderer:[t(e()),null]})))},
function _(e,t,r,s,i){var _;s();const n=e(8),d=e(201),l=e(487),a=e(278);class c extends l.PolyToolView{constructor(){super(...arguments),this._drawing=!1,this._cur_index=null}_doubletap(e){if(null==this.model.vertex_renderer||!this.model.active)return;const t=this._map_drag(e.sx,e.sy,this.model.vertex_renderer);if(null==t)return;const[r,s]=t,i=this._select_event(e,"replace",[this.model.vertex_renderer]),_=this.model.vertex_renderer.data_source,n=this.model.vertex_renderer.glyph,[d,l]=[n.x.field,n.y.field];if(0!=i.length&&null!=this._selected_renderer){const e=_.selected.indices[0];this._drawing?(this._drawing=!1,_.selection_manager.clear()):(_.selected.indices=[e+1],d&&_.get_array(d).splice(e+1,0,r),l&&_.get_array(l).splice(e+1,0,s),this._drawing=!0),_.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}else this._show_vertices(e)}_show_vertices(e){if(!this.model.active)return;if(0==this.model.renderers.length)return;const t=this.model.renderers[0],r=()=>this._update_vertices(t),s=t.data_source,i=this._select_event(e,"replace",this.model.renderers);if(0==i.length)return this._set_vertices([],[]),this._selected_renderer=null,this._drawing=!1,this._cur_index=null,void s.disconnect(s.properties.data.change,r);s.connect(s.properties.data.change,r),this._cur_index=i[0].data_source.selected.indices[0],this._update_vertices(i[0])}_update_vertices(e){const t=e.glyph,r=e.data_source,s=this._cur_index,[i,_]=[t.xs.field,t.ys.field];if(this._drawing)return;if(null==s&&(i||_))return;let d,l;i&&null!=s?(d=r.data[i][s],(0,n.isArray)(d)||(r.data[i][s]=d=Array.from(d))):d=t.xs.value,_&&null!=s?(l=r.data[_][s],(0,n.isArray)(l)||(r.data[_][s]=l=Array.from(l))):l=t.ys.value,this._selected_renderer=e,this._set_vertices(d,l)}_move(e){if(this._drawing&&null!=this._selected_renderer){const t=this.model.vertex_renderer;if(null==t)return;const r=t.data_source,s=t.glyph,i=this._map_drag(e.sx,e.sy,t);if(null==i)return;let[_,n]=i;const d=r.selected.indices;[_,n]=this._snap_to_vertex(e,_,n),r.selected.indices=d;const[l,a]=[s.x.field,s.y.field],c=d[0];l&&(r.data[l][c]=_),a&&(r.data[a][c]=n),r.change.emit(),this._selected_renderer.data_source.change.emit()}}_tap(e){const t=this.model.vertex_renderer;if(null==t)return;const r=this._map_drag(e.sx,e.sy,t);if(null==r)return;if(this._drawing&&null!=this._selected_renderer){let[s,i]=r;const _=t.data_source,n=t.glyph,[d,l]=[n.x.field,n.y.field],a=_.selected.indices;[s,i]=this._snap_to_vertex(e,s,i);const c=a[0];if(_.selected.indices=[c+1],d){const e=_.get_array(d),t=e[c];e[c]=s,e.splice(c+1,0,t)}if(l){const e=_.get_array(l),t=e[c];e[c]=i,e.splice(c+1,0,t)}return _.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||null==this._selected_renderer)return;const e=this.model.vertex_renderer;if(null==e)return;const t=e.data_source,r=e.glyph,s=t.selected.indices[0],[i,_]=[r.x.field,r.y.field];i&&t.get_array(i).splice(s,1),_&&t.get_array(_).splice(s,1),t.change.emit(),this._emit_cds_changes(this._selected_renderer.data_source)}_pan_start(e){null!=this.model.vertex_renderer&&(this._select_event(e,"append",[this.model.vertex_renderer]),this._basepoint=[e.sx,e.sy])}_pan(e){null!=this._basepoint&&null!=this.model.vertex_renderer&&(this._drag_points(e,[this.model.vertex_renderer]),null!=this._selected_renderer&&this._selected_renderer.data_source.change.emit())}_pan_end(e){null!=this._basepoint&&null!=this.model.vertex_renderer&&(this._drag_points(e,[this.model.vertex_renderer]),this._emit_cds_changes(this.model.vertex_renderer.data_source,!1,!0,!0),null!=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;if(null!=this._selected_renderer){const{vertex_renderer:e}=this.model;t=null!=e?[e]:[]}else t=this.model.renderers;for(const r of t)"Backspace"==e.key?(this._delete_selected(r),null!=this._selected_renderer&&this._emit_cds_changes(this._selected_renderer.data_source)):"Escape"==e.key&&(this._drawing?(this._remove_vertex(),this._drawing=!1):null!=this._selected_renderer&&this._hide_vertices(),r.data_source.selection_manager.clear())}deactivate(){null!=this._selected_renderer&&(this._drawing&&(this._remove_vertex(),this._drawing=!1),this._hide_vertices())}}r.PolyEditToolView=c,c.__name__="PolyEditToolView";class o extends l.PolyTool{constructor(e){super(e),this.tool_name="Poly Edit Tool",this.tool_icon=a.tool_icon_poly_edit,this.event_type=["tap","pan","move"],this.default_order=4}}r.PolyEditTool=o,_=o,o.__name__="PolyEditTool",_.prototype.default_view=c,_.define((({Array:e,Ref:t})=>({renderers:[e(t(d.GlyphRenderer)),[]]})))},
function _(o,l,e,T,t){T(),t("BoxSelectTool",o(490).BoxSelectTool),t("BoxZoomTool",o(493).BoxZoomTool),t("GestureTool",o(280).GestureTool),t("LassoSelectTool",o(494).LassoSelectTool),t("PanTool",o(496).PanTool),t("PolySelectTool",o(495).PolySelectTool),t("RangeTool",o(497).RangeTool),t("SelectTool",o(492).SelectTool),t("TapTool",o(498).TapTool),t("WheelPanTool",o(499).WheelPanTool),t("WheelZoomTool",o(500).WheelZoomTool)},
function _(t,e,i,o,s){var n;o();const l=t(1),_=t(491),r=t(237),c=t(241),a=t(20),h=l.__importStar(t(278));class p extends _.RegionSelectToolView{connect_signals(){super.connect_signals();const{pan:t}=this.model.overlay;this.connect(t,(([t,e])=>{if("pan"==t&&this._is_continuous(e)||"pan:end"==t){const{left:t,top:i,right:o,bottom:s}=this.model.overlay;if(!(t instanceof c.Node||i instanceof c.Node||o instanceof c.Node||s instanceof c.Node)){const n=this._compute_lrtb({left:t,right:o,top:i,bottom:s});this._do_select([n.left,n.right],[n.top,n.bottom],!1,this._select_mode(e))}}}));const{active:e}=this.model.properties;this.on_change(e,(()=>{this.model.active||this.model.persistent||this._clear_overlay()}))}_compute_limits(t){const e=this.plot_view.frame,i=this.model.dimensions;let o=this._base_point;if("center"==this.model.origin){const[e,i]=o,[s,n]=t;o=[e-(s-e),i-(n-i)]}return this.model._get_dim_limits(o,t,e,i)}_mappers(){const t=(t,e,i,o)=>{switch(t){case"canvas":return o;case"screen":return i;case"data":return e}},{overlay:e}=this.model,{frame:i,canvas:o}=this.plot_view,{x_scale:s,y_scale:n}=i,{x_view:l,y_view:_}=i.bbox,{x_screen:r,y_screen:c}=o.bbox;return{left:t(e.left_units,s,l,r),right:t(e.right_units,s,l,r),top:t(e.top_units,n,_,c),bottom:t(e.bottom_units,n,_,c)}}_compute_lrtb({left:t,right:e,top:i,bottom:o}){const s=this._mappers();return{left:s.left.compute(t),right:s.right.compute(e),top:s.top.compute(i),bottom:s.bottom.compute(o)}}_invert_lrtb({left:t,right:e,top:i,bottom:o}){const s=this._mappers();return{left:s.left.invert(t),right:s.right.invert(e),top:s.top.invert(i),bottom:s.bottom.invert(o)}}_pan_start(t){const{sx:e,sy:i}=t,{frame:o}=this.plot_view;o.bbox.contains(e,i)&&(this._clear_other_overlays(),this._base_point=[e,i])}_pan(t){if(null==this._base_point)return;const{sx:e,sy:i}=t,[o,s]=this._compute_limits([e,i]),[[n,l],[_,r]]=[o,s];this.model.overlay.update(this._invert_lrtb({left:n,right:l,top:_,bottom:r})),this._is_continuous(t.modifiers)&&this._do_select(o,s,!1,this._select_mode(t.modifiers))}_pan_end(t){if(null==this._base_point)return;const{sx:e,sy:i}=t,[o,s]=this._compute_limits([e,i]);this._do_select(o,s,!0,this._select_mode(t.modifiers)),this.model.persistent||this._clear_overlay(),this._base_point=null,this.plot_view.state.push("box_select",{selection:this.plot_view.get_selection()})}get _is_selecting(){return null!=this._base_point}_stop(){this._clear_overlay(),this._base_point=null}_keyup(t){if(this.model.active){if("Escape"==t.key){if(this._is_selecting)return void this._stop();if(this.model.overlay.visible)return void this._clear_overlay()}super._keyup(t)}}_clear_selection(){this.model.overlay.visible?this._clear_overlay():super._clear_selection()}_do_select([t,e],[i,o],s,n="replace"){const{greedy:l}=this.model,_={type:"rect",sx0:t,sx1:e,sy0:i,sy1:o,greedy:l};this._select(_,s,n)}}i.BoxSelectToolView=p,p.__name__="BoxSelectToolView";const m=()=>new r.BoxAnnotation({syncable:!1,level:"overlay",visible:!1,editable:!0,top_units:"data",left_units:"data",bottom_units:"data",right_units:"data",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class d extends _.RegionSelectTool{constructor(t){super(t),this.tool_name="Box Select",this.event_type="pan",this.default_order=30}initialize(){super.initialize();const[t,e]=(()=>{switch(this.dimensions){case"width":return["x","x"];case"height":return["y","y"];case"both":return["all","both"]}})(),i="center"==this.origin;this.overlay.setv({resizable:t,movable:e,symmetric:i})}get computed_icon(){const t=super.computed_icon;if(null!=t)return t;switch(this.dimensions){case"both":return`.${h.tool_icon_box_select}`;case"width":return`.${h.tool_icon_x_box_select}`;case"height":return`.${h.tool_icon_y_box_select}`}}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.BoxSelectTool=d,n=d,d.__name__="BoxSelectTool",n.prototype.default_view=p,n.define((({Ref:t})=>({dimensions:[a.Dimensions,"both"],overlay:[t(r.BoxAnnotation),m],origin:[a.BoxOrigin,"corner"]}))),n.register_alias("box_select",(()=>new n)),n.register_alias("xbox_select",(()=>new n({dimensions:"width"}))),n.register_alias("ybox_select",(()=>new n({dimensions:"height"})))},
function _(e,o,t,s,l){var n;s();const r=e(492);class c extends r.SelectToolView{get overlays(){return[...super.overlays,this.model.overlay]}_is_continuous(e){return this.model.continuous!=e.alt}_select(e,o,t){const s=this._computed_renderers_by_data_source();for(const[,l]of s){const s=l[0].get_selection_manager(),n=[];for(const e of l){const o=this.plot_view.renderer_view(e);null!=o&&n.push(o)}s.select(n,e,o,t)}this._emit_selection_event(e,o)}_clear_overlay(){super._clear_overlay(),this.model.overlay.clear()}}t.RegionSelectToolView=c,c.__name__="RegionSelectToolView";class _ extends r.SelectTool{constructor(e){super(e)}}t.RegionSelectTool=_,n=_,_.__name__="RegionSelectTool",n.define((({Boolean:e})=>({continuous:[e,!1],persistent:[e,!1],greedy:[e,!1]})))},
function _(e,t,r,s,o){var n;s();const i=e(280),c=e(201),a=e(422),l=e(202),_=e(97),d=e(20),h=e(52),p=e(15),u=e(12);class v extends i.GestureToolView{connect_signals(){super.connect_signals(),this.model.clear.connect((()=>this._clear_selection()))}get computed_renderers(){const{renderers:e}=this.model,t=this.plot_view.model.data_renderers;return(0,_.compute_renderers)(e,t)}_computed_renderers_by_data_source(){var e;const t=new Map;for(const r of this.computed_renderers){let s;if(r instanceof c.GlyphRenderer)s=r.data_source;else{if(!(r instanceof a.GraphRenderer))continue;s=r.node_renderer.data_source}const o=null!==(e=t.get(s))&&void 0!==e?e:[];t.set(s,[...o,r])}return t}_clear_overlay(){}_clear_other_overlays(){for(const e of this.plot_view.tool_views.values())e instanceof v&&e!=this&&e._clear_overlay()}_clear_selection(){this._clear()}_select_mode(e){const{shift:t,ctrl:r}=e;return t||r?t&&!r?"append":!t&&r?"intersect":t&&r?"subtract":void(0,u.unreachable)():this.model.mode}_keyup(e){this.model.active&&"Escape"==e.key&&this._clear()}_clear(){for(const e of this.computed_renderers)e.get_selection_manager().clear();const e=this.computed_renderers.map((e=>this.plot_view.renderer_view(e)));this.plot_view.request_paint(e)}_emit_selection_event(e,t=!0){const{x_scale:r,y_scale:s}=this.plot_view.frame,o=(()=>{switch(e.type){case"point":{const{sx:t,sy:o}=e,n=r.invert(t),i=s.invert(o);return Object.assign(Object.assign({},e),{x:n,y:i})}case"span":{const{sx:t,sy:o}=e,n=r.invert(t),i=s.invert(o);return Object.assign(Object.assign({},e),{x:n,y:i})}case"rect":{const{sx0:t,sx1:o,sy0:n,sy1:i}=e,[c,a]=r.r_invert(t,o),[l,_]=s.r_invert(n,i);return Object.assign(Object.assign({},e),{x0:c,y0:l,x1:a,y1:_})}case"poly":{const{sx:t,sy:o}=e,n=r.v_invert(t),i=s.v_invert(o);return Object.assign(Object.assign({},e),{x:n,y:i})}}})();this.plot_view.model.trigger_event(new h.SelectionGeometry(o,t))}}r.SelectToolView=v,v.__name__="SelectToolView";class m extends i.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 and/or selection overlay (Esc)",handler:()=>{this.clear.emit()}}]}}r.SelectTool=m,n=m,m.__name__="SelectTool",n.define((({Array:e,Ref:t,Or:r,Auto:s})=>({renderers:[r(e(t(l.DataRenderer)),s),"auto"],mode:[d.SelectionMode,"replace"]})))},
function _(o,t,e,i,s){var n;i();const a=o(1),_=o(280),r=o(237),l=o(20),h=a.__importStar(o(278));class c extends _.GestureToolView{constructor(){super(...arguments),this._base_point=null}get overlays(){return[...super.overlays,this.model.overlay]}_match_aspect([o,t],[e,i],s){const n=s.bbox.aspect,a=s.bbox.h_range.end,_=s.bbox.h_range.start,r=s.bbox.v_range.end,l=s.bbox.v_range.start;let h=Math.abs(o-e),c=Math.abs(t-i);const m=0==c?0:h/c,[d]=m>=n?[1,m/n]:[n/m,1];let u,p,b,x;return o<=e?(u=o,p=o+h*d,p>a&&(p=a)):(p=o,u=o-h*d,u<_&&(u=_)),h=Math.abs(p-u),t<=i?(x=t,b=t+h/n,b>r&&(b=r)):(b=t,x=t-h/n,x<l&&(x=l)),c=Math.abs(b-x),o<=e?p=o+n*c:u=o-n*c,[[u,p],[x,b]]}_compute_limits(o,t){const{frame:e}=this.plot_view;if("center"==this.model.origin){const[e,i]=o,[s,n]=t;o=[e-(s-e),i-(n-i)]}const i=(()=>{const{dimensions:e}=this.model;if("auto"==e){const[e,i]=o,[s,n]=t,a=Math.abs(e-s),_=Math.abs(i-n),r=5;return a<r&&_>r?"height":a>r&&_<r?"width":"both"}return e})();return this.model.match_aspect&&"both"==i?this._match_aspect(o,t,e):this.model._get_dim_limits(o,t,e,i)}_pan_start(o){const{sx:t,sy:e}=o;this.plot_view.frame.bbox.contains(t,e)&&(this._base_point=[t,e])}_pan(o){if(null==this._base_point)return;const[[t,e],[i,s]]=this._compute_limits(this._base_point,[o.sx,o.sy]);this.model.overlay.update({left:t,right:e,top:i,bottom:s})}_pan_end(o){if(null==this._base_point)return;const[t,e]=this._compute_limits(this._base_point,[o.sx,o.sy]);this._update(t,e),this._stop()}_stop(){this.model.overlay.clear(),this._base_point=null}_keydown(o){"Escape"==o.key&&this._stop()}_doubletap(o){var t;const{state:e}=this.plot_view;"box_zoom"==(null===(t=e.peek())||void 0===t?void 0:t.type)&&e.undo()}_update([o,t],[e,i]){if(Math.abs(t-o)<=5||Math.abs(i-e)<=5)return;const{x_scales:s,y_scales:n}=this.plot_view.frame,a=new Map;for(const[,e]of s){const[i,s]=e.r_invert(o,t);a.set(e.source_range,{start:i,end:s})}const _=new Map;for(const[,o]of n){const[t,s]=o.r_invert(e,i);_.set(o.source_range,{start:t,end:s})}const r={xrs:a,yrs:_};this.plot_view.state.push("box_zoom",{range:r}),this.plot_view.update_range(r),this.plot_view.trigger_ranges_update_event()}}e.BoxZoomToolView=c,c.__name__="BoxZoomToolView";const m=()=>new r.BoxAnnotation({syncable:!1,level:"overlay",visible:!1,editable:!1,top_units:"canvas",left_units:"canvas",bottom_units:"canvas",right_units:"canvas",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class d extends _.GestureTool{constructor(o){super(o),this.tool_name="Box Zoom",this.event_type=["pan","doubletap"],this.default_order=20}get event_role(){return"pan"}get computed_icon(){const o=super.computed_icon;if(null!=o)return o;switch(this.dimensions){case"both":return`.${h.tool_icon_box_zoom}`;case"width":return`.${h.tool_icon_x_box_zoom}`;case"height":return`.${h.tool_icon_y_box_zoom}`;case"auto":return`.${h.tool_icon_auto_box_zoom}`}}get tooltip(){return this._get_dim_tooltip(this.dimensions)}get menu(){return[{icon:h.tool_icon_box_zoom,tooltip:"Box zoom in both dimensions",active:()=>"both"==this.dimensions,handler:()=>{this.dimensions="both",this.active=!0}},{icon:h.tool_icon_x_box_zoom,tooltip:"Box zoom in x-dimension",active:()=>"width"==this.dimensions,handler:()=>{this.dimensions="width",this.active=!0}},{icon:h.tool_icon_y_box_zoom,tooltip:"Box zoom in y-dimension",active:()=>"height"==this.dimensions,handler:()=>{this.dimensions="height",this.active=!0}},{icon:h.tool_icon_auto_box_zoom,tooltip:"Automatic mode (box zoom in x, y or both dimensions, depending on the mouse gesture)",active:()=>"auto"==this.dimensions,handler:()=>{this.dimensions="auto",this.active=!0}}]}}e.BoxZoomTool=d,n=d,d.__name__="BoxZoomTool",n.prototype.default_view=c,n.define((({Boolean:o,Ref:t,Or:e,Auto:i})=>({dimensions:[e(l.Dimensions,i),"both"],overlay:[t(r.BoxAnnotation),m],match_aspect:[o,!1],origin:[l.BoxOrigin,"corner"]}))),n.register_alias("box_zoom",(()=>new n({dimensions:"both"}))),n.register_alias("xbox_zoom",(()=>new n({dimensions:"width"}))),n.register_alias("ybox_zoom",(()=>new n({dimensions:"height"}))),n.register_alias("auto_box_zoom",(()=>new n({dimensions:"auto"})))},
function _(e,s,t,o,i){var _;o();const l=e(491),n=e(259),c=e(495),r=e(12),a=e(278);class h extends l.RegionSelectToolView{constructor(){super(...arguments),this._is_selecting=!1}_mappers(){const e=(e,s,t,o)=>{switch(e){case"canvas":return o;case"screen":return t;case"data":return s}},{overlay:s}=this.model,{frame:t,canvas:o}=this.plot_view,{x_scale:i,y_scale:_}=t,{x_view:l,y_view:n}=t.bbox,{x_screen:c,y_screen:r}=o.bbox;return{x:e(s.xs_units,i,l,c),y:e(s.ys_units,_,n,r)}}_v_compute(e,s){const{x:t,y:o}=this._mappers();return[t.v_compute(e),o.v_compute(s)]}_v_invert(e,s){const{x:t,y:o}=this._mappers();return[t.v_invert(e),o.v_invert(s)]}connect_signals(){super.connect_signals();const{pan:e}=this.model.overlay;this.connect(e,(([e,s])=>{if("pan"==e&&this._is_continuous(s)||"pan:end"==e){const{xs:e,ys:t}=this.model.overlay,[o,i]=this._v_compute(e,t);this._do_select(o,i,!1,this._select_mode(s))}}));const{active:s}=this.model.properties;this.on_change(s,(()=>{this.model.active||this.model.persistent||this._clear_overlay()}))}_pan_start(e){const{sx:s,sy:t}=e,{frame:o}=this.plot_view;if(!o.bbox.contains(s,t))return;this._clear_other_overlays(),this._is_selecting=!0;const[i,_]=this._v_invert([s],[t]);this.model.overlay.update({xs:i,ys:_})}_pan(e){(0,r.assert)(this._is_selecting);const[s,t]=(()=>{const{xs:e,ys:s}=this.model.overlay,[t,o]=this._v_compute(e,s);return[[...t],[...o]]})(),[o,i]=this.plot_view.frame.bbox.clip(e.sx,e.sy);s.push(o),t.push(i);const[_,l]=this._v_invert(s,t);this.model.overlay.update({xs:_,ys:l}),this._is_continuous(e.modifiers)&&this._do_select(s,t,!1,this._select_mode(e.modifiers))}_pan_end(e){(0,r.assert)(this._is_selecting),this._is_selecting=!1;const{xs:s,ys:t}=this.model.overlay,[o,i]=this._v_compute(s,t);this._do_select(o,i,!0,this._select_mode(e.modifiers)),this.plot_view.state.push("lasso_select",{selection:this.plot_view.get_selection()}),this.model.persistent||this._clear_overlay()}_keyup(e){this.model.active&&("Escape"==e.key&&this.model.overlay.visible?this._clear_overlay():super._keyup(e))}_clear_selection(){this.model.overlay.visible?this._clear_overlay():super._clear_selection()}_do_select(e,s,t,o){const{greedy:i}=this.model,_={type:"poly",sx:e,sy:s,greedy:i};this._select(_,t,o)}}t.LassoSelectToolView=h,h.__name__="LassoSelectToolView";class v extends l.RegionSelectTool{constructor(e){super(e),this.tool_name="Lasso Select",this.tool_icon=a.tool_icon_lasso_select,this.event_type="pan",this.default_order=12}}t.LassoSelectTool=v,_=v,v.__name__="LassoSelectTool",_.prototype.default_view=h,_.define((({Ref:e})=>({overlay:[e(n.PolyAnnotation),c.DEFAULT_POLY_OVERLAY]}))),_.override({continuous:!0}),_.register_alias("lasso_select",(()=>new _))},
function _(e,s,t,i,o){var _;i();const l=e(491),n=e(259),c=e(278);class r extends l.RegionSelectToolView{constructor(){super(...arguments),this._is_selecting=!1}_mappers(){const e=(e,s,t,i)=>{switch(e){case"canvas":return i;case"screen":return t;case"data":return s}},{overlay:s}=this.model,{frame:t,canvas:i}=this.plot_view,{x_scale:o,y_scale:_}=t,{x_view:l,y_view:n}=t.bbox,{x_screen:c,y_screen:r}=i.bbox;return{x:e(s.xs_units,o,l,c),y:e(s.ys_units,_,n,r)}}_v_compute(e,s){const{x:t,y:i}=this._mappers();return[t.v_compute(e),i.v_compute(s)]}_v_invert(e,s){const{x:t,y:i}=this._mappers();return[t.v_invert(e),i.v_invert(s)]}connect_signals(){super.connect_signals();const{pan:e}=this.model.overlay;this.connect(e,(([e,s])=>{if("pan"==e&&this._is_continuous(s)||"pan:end"==e&&!this._is_selecting){const{xs:e,ys:t}=this.model.overlay,[i,o]=this._v_compute(e,t);this._do_select(i,o,!1,this._select_mode(s))}}));const{active:s}=this.model.properties;this.on_change(s,(()=>{this.model.active||this.model.persistent||this._clear_overlay()}))}_tap(e){const{sx:s,sy:t}=e,{frame:i}=this.plot_view;if(!i.bbox.contains(s,t))return;this._clear_other_overlays();const[o,_]=(()=>{if(this._is_selecting){const{xs:e,ys:s}=this.model.overlay,[t,i]=this._v_compute(e,s);return[[...t],[...i]]}return this._is_selecting=!0,[[],[]]})();o.push(s),_.push(t);const[l,n]=this._v_invert(o,_);this.model.overlay.update({xs:l,ys:n}),this._is_continuous(e.modifiers)&&this._do_select(o,_,!0,this._select_mode(e.modifiers))}_finish_selection(e){this._is_selecting=!1;const{xs:s,ys:t}=this.model.overlay,[i,o]=this._v_compute(s,t);this._do_select(i,o,!0,this._select_mode(e)),this.plot_view.state.push("poly_select",{selection:this.plot_view.get_selection()}),this.model.persistent||this._clear_overlay()}_doubletap(e){this._finish_selection(e.modifiers)}_keyup(e){this.model.active&&("Enter"!=e.key?"Escape"==e.key&&this.model.overlay.visible?this._clear_overlay():super._keyup(e):this._finish_selection(e.modifiers))}_clear_selection(){this.model.overlay.visible?this._clear_overlay():(this._is_selecting=!1,super._clear_selection())}_clear_overlay(){this._is_selecting=!1,super._clear_overlay()}_do_select(e,s,t,i){const{greedy:o}=this.model,_={type:"poly",sx:e,sy:s,greedy:o};this._select(_,t,i)}}t.PolySelectToolView=r,r.__name__="PolySelectToolView";t.DEFAULT_POLY_OVERLAY=()=>new n.PolyAnnotation({syncable:!1,level:"overlay",visible:!1,editable:!0,xs_units:"data",ys_units:"data",fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:2,line_dash:[4,4]});class a extends l.RegionSelectTool{constructor(e){super(e),this.tool_name="Poly Select",this.tool_icon=c.tool_icon_polygon_select,this.event_type="tap",this.default_order=11}}t.PolySelectTool=a,_=a,a.__name__="PolySelectTool",_.prototype.default_view=r,_.define((({Ref:e})=>({overlay:[e(n.PolyAnnotation),t.DEFAULT_POLY_OVERLAY]}))),_.register_alias("poly_select",(()=>new _))},
function _(t,i,n,s,e){var o;s();const a=t(1),_=t(280),r=t(20),h=a.__importStar(t(278));function d(t,i,n){const s=new Map;for(const[,e]of t){const[t,o]=e.r_invert(i,n);s.set(e.source_range,{start:t,end:o})}return s}n.update_ranges=d;class l extends _.GestureToolView{cursor(t,i){const n=this.plot_view.axis_views.find((n=>n.bbox.contains(t,i)));if(null==n)return this.plot_view.frame.bbox.contains(t,i)?"move":super.cursor(t,i);switch(n.dimension){case 0:return"ew-resize";case 1:return"ns-resize"}}_pan_start(t){var i;this.last_dx=0,this.last_dy=0;const{sx:n,sy:s}=t,e=this.plot_view.frame.bbox;if(!e.contains(n,s)){const t=e.h_range,i=e.v_range;(n<t.start||n>t.end)&&(this.v_axis_only=!0),(s<i.start||s>i.end)&&(this.h_axis_only=!0)}null===(i=this.model.document)||void 0===i||i.interactive_start(this.plot_view.model)}_pan(t){var i;this._update(t.dx,t.dy),null===(i=this.model.document)||void 0===i||i.interactive_start(this.plot_view.model)}_pan_end(t){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(t,i){const n=this.plot_view.frame,s=t-this.last_dx,e=i-this.last_dy,o=n.bbox.h_range,a=o.start-s,_=o.end-s,r=n.bbox.v_range,h=r.start-e,l=r.end-e,c=this.model.dimensions;let p,u,m,v,w,x;"width"!=c&&"both"!=c||this.v_axis_only?(p=o.start,u=o.end,m=0):(p=a,u=_,m=-s),"height"!=c&&"both"!=c||this.h_axis_only?(v=r.start,w=r.end,x=0):(v=h,w=l,x=-e),this.last_dx=t,this.last_dy=i;const{x_scales:g,y_scales:y}=n,b=d(g,p,u),f=d(y,v,w);this.pan_info={xrs:b,yrs:f,sdx:m,sdy:x},this.plot_view.update_range(this.pan_info,{panning:!0})}}n.PanToolView=l,l.__name__="PanToolView";class c extends _.GestureTool{constructor(t){super(t),this.tool_name="Pan",this.event_type="pan",this.default_order=10}get tooltip(){return this._get_dim_tooltip(this.dimensions)}get computed_icon(){const t=super.computed_icon;if(null!=t)return t;switch(this.dimensions){case"both":return`.${h.tool_icon_pan}`;case"width":return`.${h.tool_icon_x_pan}`;case"height":return`.${h.tool_icon_y_pan}`}}get menu(){return[{icon:h.tool_icon_pan,tooltip:"Pan in both dimensions",active:()=>"both"==this.dimensions,handler:()=>{this.dimensions="both",this.active=!0}},{icon:h.tool_icon_x_pan,tooltip:"Pan in x-dimension",active:()=>"width"==this.dimensions,handler:()=>{this.dimensions="width",this.active=!0}},{icon:h.tool_icon_y_pan,tooltip:"Pan in y-dimension",active:()=>"height"==this.dimensions,handler:()=>{this.dimensions="height",this.active=!0}}]}}n.PanTool=c,o=c,c.__name__="PanTool",o.prototype.default_view=l,o.define((()=>({dimensions:[r.Dimensions,"both"]}))),o.register_alias("pan",(()=>new o({dimensions:"both"}))),o.register_alias("xpan",(()=>new o({dimensions:"width"}))),o.register_alias("ypan",(()=>new o({dimensions:"height"})))},
function _(e,t,o,a,n){var l;a();const i=e(273),r=e(281),s=e(237),_=e(88),h=e(19),g=e(278),y=e(241),d=new y.Node({target:"frame",symbol:"left"}),c=new y.Node({target:"frame",symbol:"right"}),m=new y.Node({target:"frame",symbol:"top"}),v=new y.Node({target:"frame",symbol:"bottom"});class u extends i.ToolView{get overlays(){return[...super.overlays,this.model.overlay]}initialize(){super.initialize(),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())),this.model.overlay.pan.connect((([e,t])=>{"pan"==e?this.model.update_ranges_from_overlay():"pan:end"==e&&this.parent.trigger_ranges_update_event()}));const{active:e}=this.model.properties;this.on_change(e,(()=>{this.model.overlay.editable=this.model.active}))}}o.RangeToolView=u,u.__name__="RangeToolView";const p=()=>new s.BoxAnnotation({syncable:!1,level:"overlay",visible:!0,editable:!0,propagate_hover:!0,left_limit:d,right_limit:c,top_limit:m,bottom_limit:v,fill_color:"lightgrey",fill_alpha:.5,line_color:"black",line_alpha:1,line_width:.5,line_dash:[2,2]});class b extends i.Tool{constructor(e){super(e),this.tool_name="Range Tool",this.tool_icon=g.tool_icon_range}initialize(){super.initialize(),this.overlay.editable=this.active;const e=null!=this.x_range&&this.x_interaction,t=null!=this.y_range&&this.y_interaction;e&&t?(this.overlay.movable="both",this.overlay.resizable="all"):e?(this.overlay.movable="x",this.overlay.resizable="x"):t?(this.overlay.movable="y",this.overlay.resizable="y"):(this.overlay.movable="none",this.overlay.resizable="none")}update_ranges_from_overlay(){const{left:e,right:t,top:o,bottom:a}=this.overlay;null!=this.x_range&&this.x_interaction&&this.x_range.setv({start:e,end:t}),null!=this.y_range&&this.y_interaction&&this.y_range.setv({start:a,end:o})}update_overlay_from_ranges(){const{x_range:e,y_range:t}=this,o=null!=e,a=null!=t;this.overlay.update({left:o?e.start:d,right:o?e.end:c,top:a?t.end:m,bottom:a?t.start:v}),o||a||(h.logger.warn("RangeTool not configured with any Ranges."),this.overlay.clear())}tool_button(){return new r.OnOffButton({tool:this})}}o.RangeTool=b,l=b,b.__name__="RangeTool",l.prototype.default_view=u,l.define((({Boolean:e,Ref:t,Nullable:o})=>({x_range:[o(t(_.Range1d)),null],y_range:[o(t(_.Range1d)),null],x_interaction:[e,!0],y_interaction:[e,!0],overlay:[t(s.BoxAnnotation),p]}))),l.override({active:!0})},
function _(e,t,s,i,o){var l;i();const a=e(1),r=e(492),n=a.__importStar(e(52)),c=e(20),_=e(278);class p 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{modifiers:t}=this.model;if(null!=t.shift&&t.shift!=e.modifiers.shift)return;if(null!=t.ctrl&&t.ctrl!=e.modifiers.ctrl)return;if(null!=t.alt&&t.alt!=e.modifiers.alt)return;const{sx:s,sy:i}=e,{frame:o}=this.plot_view;if(!o.bbox.contains(s,i))return;this._clear_other_overlays();const l={type:"point",sx:s,sy:i};"select"==this.model.behavior?this._select(l,!0,this._select_mode(e.modifiers)):this._inspect(l,e.modifiers)}_select(e,t,s){const i=this._computed_renderers_by_data_source();for(const[,o]of i){const i=o[0].get_selection_manager(),l=o.map((e=>this.plot_view.renderer_view(e))).filter((e=>null!=e));if(i.select(l,e,t,s)){const[t]=l;this._emit_callback(t,e,i.source)}}this._emit_selection_event(e),this.plot_view.state.push("tap",{selection:this.plot_view.get_selection()})}_inspect(e,t){for(const s of this.computed_renderers){const i=this.plot_view.renderer_view(s);if(null==i)continue;const o=s.get_selection_manager();o.inspect(i,e)&&this._emit_callback(i,e,o.source,t)}}_emit_callback(e,t,s,i){const{callback:o}=this.model;if(null!=o){const l=e.coordinates.x_scale.invert(t.sx),a=e.coordinates.y_scale.invert(t.sy),r={geometries:Object.assign(Object.assign({},t),{x:l,y:a}),source:s,event:{modifiers:i}};o.execute(this.model,r)}}}s.TapToolView=p,p.__name__="TapToolView";class d extends r.SelectTool{constructor(e){super(e),this.tool_name="Tap",this.tool_icon=_.tool_icon_tap_select,this.event_type="tap",this.default_order=10}}s.TapTool=d,l=d,d.__name__="TapTool",l.prototype.default_view=p,l.define((({Any:e,Nullable:t})=>({behavior:[c.TapBehavior,"select"],gesture:[c.TapGesture,"tap"],modifiers:[n.KeyModifiers,{}],callback:[t(e),null]}))),l.register_alias("click",(()=>new l({behavior:"inspect"}))),l.register_alias("tap",(()=>new l)),l.register_alias("doubletap",(()=>new l({gesture:"doubletap"})))},
function _(e,t,s,i,n){var o;i();const a=e(280),l=e(20),_=e(278),r=e(496);class h extends a.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:s}=this.plot_view,i=s.bbox.h_range,n=s.bbox.v_range,[o,a]=[i.start,i.end],[l,_]=[n.start,n.end];let h,d,p,c;switch(this.model.dimension){case"height":{const t=Math.abs(_-l);h=o,d=a,p=l-t*e,c=_-t*e;break}case"width":{const t=Math.abs(a-o);h=o-t*e,d=a-t*e,p=l,c=_;break}}const{x_scales:w,y_scales:g}=s,u={xrs:(0,r.update_ranges)(w,h,d),yrs:(0,r.update_ranges)(g,p,c),factor:e};this.plot_view.state.push("wheel_pan",{range:u}),this.plot_view.update_range(u,{scrolling:!0}),null===(t=this.model.document)||void 0===t||t.interactive_start(this.plot_view.model,(()=>this.plot_view.trigger_ranges_update_event()))}}s.WheelPanToolView=h,h.__name__="WheelPanToolView";class d extends a.GestureTool{constructor(e){super(e),this.tool_name="Wheel Pan",this.tool_icon=_.tool_icon_wheel_pan,this.event_type="scroll",this.default_order=12}get tooltip(){return this._get_dim_tooltip(this.dimension)}}s.WheelPanTool=d,o=d,d.__name__="WheelPanTool",o.prototype.default_view=h,o.define((()=>({dimension:[l.Dimension,"width"]}))),o.internal((({Number:e})=>({speed:[e,.001]}))),o.register_alias("xwheel_pan",(()=>new o({dimension:"width"}))),o.register_alias("ywheel_pan",(()=>new o({dimension:"height"})))},
function _(e,o,t,s,n){var i;s();const l=e(280),a=e(202),r=e(94),c=e(477),_=e(20),d=e(19),h=e(27),m=e(12),u=e(278),w=e(21),f=(0,w.Enum)("none","cross","all"),p=(0,w.Or)((0,w.Array)((0,w.Ref)(a.DataRenderer)),w.Auto);class g extends l.GestureToolView{_pinch(e){const{sx:o,sy:t,scale:s,modifiers:n}=e;let i;i=s>=1?20*(s-1):-20/s,this._scroll({type:"wheel",sx:o,sy:t,delta:i,modifiers:n})}_scroll(e){var o;const{sx:t,sy:s}=e,n=this.plot_view.axis_views.find((e=>e.bbox.contains(t,s)));if(null!=n&&!this.model.zoom_on_axis)return;const{frame:i}=this.plot_view;if(null==n&&!i.bbox.contains(t,s))return;const[l,a]=(()=>{const e=[...i.x_scales.values()],o=[...i.y_scales.values()];if(null==n)return[e,o];{const{zoom_together:t}=this.model;if("all"==t)return 0==n.dimension?[e,[]]:[[],o];{const{x_scale:e,y_scale:o}=n.coordinates;switch(t){case"cross":return[[e],[o]];case"none":return 0==n.dimension?[[e],[]]:[[],[o]]}}}})(),_=new Set(l),h=new Set(a),u=new Set,w=new Set,{renderers:f}=this.model,p="auto"!=f?f:this.plot_view.model.data_renderers;for(const e of p){if(null==e.coordinates)continue;const o=this.plot_view.renderer_view(e);(0,m.assert)(null!=o);const{x_scale:t,y_scale:s}=o.coordinates;t instanceof r.CompositeScale&&_.has(t.target_scale)&&u.add(t),s instanceof r.CompositeScale&&h.has(s.target_scale)&&w.add(s)}const[g,v]="auto"==f?[new Set([..._,...u]),new Set([...h,...w])]:[u,w],x={x:!1,y:!1},y=(e,o)=>{const{level:t}=this.model;for(let s=0;s<t;s++){if(!(e instanceof r.CompositeScale)){d.logger.warn(`can't reach sub-coordinate level ${t} for ${e} in ${o} dimension; stopped at ${s}`);break}x[o]=!0,e=e.source_scale}return e instanceof r.CompositeScale?e.target_scale:e},b=new Set,S=new Set;for(const e of g)b.add(y(e,"x"));for(const e of v)S.add(y(e,"y"));const z=(()=>{const e=x.x?null:t,o=x.y?null:s;return null!=n?0==n.dimension?{x:e,y:null}:{x:null,y:o}:{x:e,y:o}})(),T=this.model.dimensions,W="width"==T||"both"==T,Z="height"==T||"both"==T,{x_target:C,y_target:$}=i,N=this.model.speed*e.delta,V=(0,c.scale_range)(b,S,C,$,N,W,Z,z);this.plot_view.state.push("wheel_zoom",{range:V});const{maintain_focus:A}=this.model;this.plot_view.update_range(V,{scrolling:!0,maintain_focus:A}),null===(o=this.model.document)||void 0===o||o.interactive_start(this.plot_view.model,(()=>this.plot_view.trigger_ranges_update_event()))}}t.WheelZoomToolView=g,g.__name__="WheelZoomToolView";class v extends l.GestureTool{constructor(e){super(e),this.tool_name="Wheel Zoom",this.tool_icon=u.tool_icon_wheel_zoom,this.event_type=h.is_mobile?"pinch":"scroll",this.default_order=10}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}t.WheelZoomTool=v,i=v,v.__name__="WheelZoomTool",i.prototype.default_view=g,i.define((({Boolean:e,Number:o,NonNegative:t,Int:s})=>({dimensions:[_.Dimensions,"both"],renderers:[p,"auto"],level:[t(s),0],maintain_focus:[e,!0],zoom_on_axis:[e,!0],zoom_together:[f,"all"],speed:[o,1/600]}))),i.register_alias("wheel_zoom",(()=>new i({dimensions:"both"}))),i.register_alias("xwheel_zoom",(()=>new i({dimensions:"width"}))),i.register_alias("ywheel_zoom",(()=>new i({dimensions:"height"})))},
function _(o,r,s,e,l){e(),l("CrosshairTool",o(502).CrosshairTool),l("CustomJSHover",o(503).CustomJSHover),l("HoverTool",o(504).HoverTool),l("InspectTool",o(282).InspectTool)},
function _(s,e,i,t,o){var n;t();const a=s(282),r=s(263),l=s(20),_=s(8),h=s(278);class c extends a.InspectToolView{get overlays(){return[...super.overlays,...this._spans]}initialize(){super.initialize(),this._update_overlays()}connect_signals(){super.connect_signals();const{overlay:s,dimensions:e,line_color:i,line_width:t,line_alpha:o}=this.model.properties;this.on_change([s,e,i,t,o],(()=>{this._update_overlays()}))}_update_overlays(){const{overlay:s}=this.model;if("auto"==s){const{dimensions:e,line_color:i,line_alpha:t,line_width:o}=this.model;function n(s){return new r.Span({dimension:s,location_units:"canvas",level:"overlay",line_color:i,line_width:o,line_alpha:t})}switch(e){case"width":this._spans=[n("width")];break;case"height":this._spans=[n("height")];break;case"both":this._spans=[n("width"),n("height")]}}else(0,_.isArray)(s)?this._spans=[...s]:this._spans=[s]}_move(s){if(!this.model.active)return;const{sx:e,sy:i}=s;this.plot_view.frame.bbox.contains(e,i)?this._update_spans(e,i):this._update_spans(NaN,NaN)}_move_exit(s){this._update_spans(NaN,NaN)}_update_spans(s,e){const{frame:i}=this.plot_view;function t(s,e,t){const{dimension:o}=s;switch(s.location_units){case"canvas":return"width"==o?t:e;case"screen":{const{xview:s,yview:n}=i.bbox;return"width"==o?n.invert(t):s.invert(e)}case"data":{const{x_scale:s,y_scale:n}=i;return"width"==o?n.invert(t):s.invert(e)}}}for(const i of this._spans)i.location=t(i,s,e)}}i.CrosshairToolView=c,c.__name__="CrosshairToolView";class p extends a.InspectTool{constructor(s){super(s),this.tool_name="Crosshair",this.tool_icon=h.tool_icon_crosshair}get tooltip(){return this._get_dim_tooltip(this.dimensions)}}i.CrosshairTool=p,n=p,p.__name__="CrosshairTool",n.prototype.default_view=c,n.define((({Alpha:s,Number:e,Color:i,Auto:t,Tuple:o,Ref:n,Or:a})=>({overlay:[a(t,n(r.Span),o(n(r.Span),n(r.Span))),"auto"],dimensions:[l.Dimensions,"both"],line_color:[i,"black"],line_width:[e,1],line_alpha:[s,1]}))),n.register_alias("crosshair",(()=>new n))},
function _(e,s,t,r,n){var o;r();const a=e(50),u=e(9),c=e(40);class i extends a.Model{constructor(e){super(e)}get values(){return(0,u.values)(this.args)}_make_code(e,s,t,r){return new Function(...(0,u.keys)(this.args),e,s,t,(0,c.use_strict)(r))}format(e,s,t){return this._make_code("value","format","special_vars",this.code)(...this.values,e,s,t)}}t.CustomJSHover=i,o=i,i.__name__="CustomJSHover",o.define((({Unknown:e,String:s,Dict:t})=>({args:[t(e),{}],code:[s,""]})))},
function _(e,t,n,s,i){var o;s();const r=e(1),l=e(59),a=e(56),c=e(20),_=r.__importStar(e(212)),p=e(15),d=e(12),u=e(22),h=e(34),m=e(9),y=e(172),f=e(8),v=e(278),x=r.__importStar(e(463)),w=e(461),g=e(505),b=e(217),S=e(214),C=e(340),T=e(203),V=e(344),$=e(213),A=e(219),k=e(218),H=e(202),M=e(201),R=e(422),z=e(97),G=e(503),P=e(282);function N(e,t,n,s){const i={x:n[e],y:s[e]},o={x:n[e+1],y:s[e+1]},{sx:r,sy:l}=t,[a,c]=function(){if("span"==t.type)return"h"==t.direction?[Math.abs(i.x-r),Math.abs(o.x-r)]:[Math.abs(i.y-l),Math.abs(o.y-l)];const e={x:r,y:l};return[_.dist_2_pts(i,e),_.dist_2_pts(o,e)]}();return a<c?[[i.x,i.y],e]:[[o.x,o.y],e+1]}function O(e,t,n){return[[e[n],t[n]],n]}n._nearest_line_hit=N,n._line_hit=O;class q extends P.InspectToolView{constructor(){super(...arguments),this._current_sxy=null,this.ttmodels=new Map,this._ttviews=new Map}*children(){yield*super.children(),yield*this._ttviews.values(),null!=this._template_view&&(yield this._template_view)}async lazy_initialize(){await super.lazy_initialize(),await this._update_ttmodels();const{tooltips:e}=this.model;e instanceof g.Template&&(this._template_view=await(0,l.build_view)(e,{parent:this.plot_view.canvas}),this._template_view.render())}remove(){var e;null===(e=this._template_view)||void 0===e||e.remove(),(0,l.remove_views)(this._ttviews),super.remove()}connect_signals(){super.connect_signals();const e=this.plot_view.model.properties.renderers,{renderers:t,tooltips:n}=this.model.properties;this.on_change(n,(()=>delete this._template_el)),this.on_change([e,t,n],(async()=>await this._update_ttmodels())),this.connect(this.plot_view.repainted,(()=>{if(this.model.active&&null!=this._current_sxy){const[e,t]=this._current_sxy;this._inspect(e,t)}}))}async _update_ttmodels(){const{ttmodels:e}=this;e.clear();const{tooltips:t}=this.model;if(null==t)return;const{computed_renderers:n}=this;for(const t of n){const n=new w.Tooltip({content:document.createElement("div"),attachment:this.model.attachment,show_arrow:this.model.show_arrow,interactive:!1,visible:!0,position:null,target:this.parent.canvas.overlays_el});t instanceof M.GlyphRenderer?e.set(t,n):t instanceof R.GraphRenderer&&(e.set(t.node_renderer,n),e.set(t.edge_renderer,n))}await(0,l.build_views)(this._ttviews,[...e.values()],{parent:this.plot_view});const s=[...function*(){for(const e of n)e instanceof M.GlyphRenderer?yield e:e instanceof R.GraphRenderer&&(yield e.node_renderer,yield e.edge_renderer)}()],i=this._slots.get(this.update);if(null!=i){const e=new Set(s.map((e=>e.data_source)));p.Signal.disconnect_receiver(this,i,e)}for(const e of s)this.connect(e.data_source.inspect,this.update)}get computed_renderers(){const{renderers:e}=this.model,t=this.plot_view.model.data_renderers;return(0,z.compute_renderers)(e,t)}_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:n}=e;this.plot_view.frame.bbox.contains(t,n)?(this._current_sxy=[t,n],this._inspect(t,n)):this._clear()}_move_exit(){this._current_sxy=null,this._clear()}_inspect(e,t){const n=(()=>{if("mouse"==this.model.mode)return{type:"point",sx:e,sy:t};return{type:"span",direction:"vline"==this.model.mode?"h":"v",sx:e,sy:t}})();for(const e of this.computed_renderers){const t=e.get_selection_manager(),s=this.plot_view.renderer_view(e);null!=s&&t.inspect(s,n)}this._emit_callback(n)}_update(e,t,n){var s,i;const o=e.get_selection_manager(),r=o.inspectors.get(e),l=e.view.convert_selection_to_subset(r);if(r.is_empty()&&null==r.view)return void n.clear();const c=o.source,_=this.plot_view.renderer_view(e);if(null==_)return;const{sx:p,sy:u}=t,h=_.coordinates.x_scale,y=_.coordinates.y_scale,f=h.invert(p),v=y.invert(u),{glyph:x}=_,w=[];if(x instanceof $.PatchView){const[t,n]=[p,u],[s,i]=[f,v],o={index:null,glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:s,snap_y:i,snap_sx:t,snap_sy:n,name:e.name},r=this._render_tooltips(c,o);w.push([t,n,r])}else if(x instanceof S.HAreaStepView||x instanceof b.HAreaView||x instanceof k.VAreaStepView||x instanceof A.VAreaView)for(const t of l.line_indices){const[n,s]=[f,v],[i,o]=[p,u],r={index:t,glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:n,snap_y:s,snap_sx:i,snap_sy:o,name:e.name,indices:l.line_indices},a=this._render_tooltips(c,r);w.push([i,o,a])}else if(x instanceof T.LineView){const{line_policy:n}=this.model;for(const s of l.line_indices){const[[i,o],[r,a],d]=(()=>{const[e,i]=[x._x,x._y];switch(n){case"interp":{const[e,n]=x.get_interpolation_hit(s,t);return[[e,n],[h.compute(e),y.compute(n)],s]}case"prev":{const[t,n]=O(x.sx,x.sy,s);return[[e[s+1],i[s+1]],t,n]}case"next":{const[t,n]=O(x.sx,x.sy,s+1);return[[e[s+1],i[s+1]],t,n]}case"nearest":{const[n,o]=N(s,t,x.sx,x.sy);return[[e[o],i[o]],n,o]}case"none":{const e=_.coordinates.x_scale,t=_.coordinates.y_scale;return[[e.invert(p),t.invert(u)],[p,u],s]}}})(),m={index:d,glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:i,snap_y:o,snap_sx:r,snap_sy:a,name:e.name,indices:l.line_indices},g=this._render_tooltips(c,m);w.push([r,a,g])}}else if(x instanceof C.ImageBaseView)for(const t of r.image_indices){const[n,s]=[p,u],[i,o]=[f,v],r={index:t.index,glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:i,snap_y:o,snap_sx:n,snap_sy:s,name:e.name,image_index:t},l=this._render_tooltips(c,r);w.push([n,s,l])}else for(const n of l.indices)if(x instanceof V.MultiLineView&&!(0,m.is_empty)(l.multiline_indices)){const{line_policy:s}=this.model;for(const i of l.multiline_indices[n.toString()]){const[[o,r],[a,_],d]=function(){if("interp"==s){const[e,s]=x.get_interpolation_hit(n,i,t);return[[e,s],[h.compute(e),y.compute(s)],i]}const[e,o]=[x._xs.get(n),x._ys.get(n)];if("prev"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i);return[[e[i],o[i]],t,s]}if("next"==s){const[t,s]=O(x.sxs.get(n),x.sys.get(n),i+1);return[[e[i],o[i]],t,s]}if("nearest"==s){const[s,r]=N(i,t,x.sxs.get(n),x.sys.get(n));return[[e[r],o[r]],s,r]}throw new Error("shouldn't have happened")}(),m={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:o,snap_y:r,snap_sx:a,snap_sy:_,name:e.name,indices:l.multiline_indices,segment_index:d},g=this._render_tooltips(c,m);w.push([a,_,g])}}else{const t=null===(s=x._x)||void 0===s?void 0:s[n],o=null===(i=x._y)||void 0===i?void 0:i[n],{point_policy:r,anchor:a}=this.model,[_,d]=function(){if("snap_to_data"==r){const e=x.get_anchor_point(a,n,[p,u]);if(null!=e)return[e.x,e.y];const t=x.get_anchor_point("center",n,[p,u]);return null!=t?[t.x,t.y]:[p,u]}return[p,u]}(),h={index:e.view.convert_indices_from_subset([n])[0],glyph_view:x,type:x.model.type,x:f,y:v,sx:p,sy:u,snap_x:t,snap_y:o,snap_sx:_,snap_sy:d,name:e.name,indices:l.indices},m=this._render_tooltips(c,h);w.push([_,d,m])}const{bbox:g}=this.plot_view.frame,H=w.filter((([e,t])=>g.contains(e,t)));if(0==H.length)n.clear();else{const{content:e}=n;(0,d.assert)(e instanceof Element),(0,a.empty)(e);for(const[,,t]of H)null!=t&&e.appendChild(t);const[t,s]=H[H.length-1];n.setv({position:[t,s]},{check_eq:!1})}}update([e,{geometry:t}]){if(!this.model.active)return;if("point"!=t.type&&"span"!=t.type)return;if("ignore"==this.model.muted_policy&&e.muted)return;const n=this.ttmodels.get(e);(0,f.is_undefined)(n)||this._update(e,t,n)}_emit_callback(e){const{callback:t}=this.model;if(null!=t)for(const n of this.computed_renderers){if(!(n instanceof M.GlyphRenderer))continue;const s=this.plot_view.renderer_view(n);if(null==s)continue;const{x_scale:i,y_scale:o}=s.coordinates,r=i.invert(e.sx),l=o.invert(e.sy),a=n.data_source.inspected;t.execute(this.model,{geometry:Object.assign({x:r,y:l},e),renderer:n,index:a})}}_create_template(e){const t=(0,a.div)({style:{display:"table",borderSpacing:"2px"}});for(const[n]of e){const e=(0,a.div)({style:{display:"table-row"}});t.appendChild(e);const s=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_label},0!=n.length?`${n}: `:"");e.appendChild(s);const i=(0,a.span)();i.dataset.value="";const o=(0,a.span)({class:x.tooltip_color_block}," ");o.dataset.swatch="",(0,a.undisplay)(o);const r=(0,a.div)({style:{display:"table-cell"},class:x.tooltip_row_value},i,o);e.appendChild(r)}return t}_render_template(e,t,n,s){const i=e.cloneNode(!0),o=(0,f.is_undefined)(s.image_index)?s.index:s.image_index,r=i.querySelectorAll("[data-value]"),l=i.querySelectorAll("[data-swatch]"),c=/\$color(\[.*\])?:(\w*)/,_=/\$swatch:(\w*)/;for(const[[,e],i]of(0,h.enumerate)(t)){const t=e.match(_),p=e.match(c);if(null!=t||null!=p){if(null!=t){const[,e]=t,s=n.get_column(e);if(null==s)r[i].textContent=`${e} unknown`;else{const e=(0,f.isNumber)(o)?s[o]:null;null!=e&&(l[i].style.backgroundColor=(0,u.color2css)(e),(0,a.display)(l[i]))}}if(null!=p){const[,e="",t]=p,s=n.get_column(t);if(null==s){r[i].textContent=`${t} unknown`;continue}const c=e.indexOf("hex")>=0,_=e.indexOf("swatch")>=0,d=(0,f.isNumber)(o)?s[o]:null;if(null==d){r[i].textContent="(null)";continue}r[i].textContent=c?(0,u.color2hex)(d):(0,u.color2css)(d),_&&(l[i].style.backgroundColor=(0,u.color2css)(d),(0,a.display)(l[i]))}}else{const t=(0,y.replace_placeholders)(e.replace("$~","$data_"),n,o,this.model.formatters,s);if((0,f.isString)(t))r[i].textContent=t;else for(const e of t)r[i].appendChild(e)}}return i}_render_tooltips(e,t){var n;const{tooltips:s}=this.model,i=t.index;if((0,f.isString)(s)){const n=(0,y.replace_placeholders)({html:s},e,i,this.model.formatters,t);return(0,a.div)(n)}if((0,f.isFunction)(s))return s(e,t);if(s instanceof g.Template)return this._template_view.update(e,i,t),this._template_view.el;if(null!=s){const i=null!==(n=this._template_el)&&void 0!==n?n:this._template_el=this._create_template(s);return this._render_template(i,s,e,t)}return null}}n.HoverToolView=q,q.__name__="HoverToolView";class E extends P.InspectTool{constructor(e){super(e),this.tool_name="Hover",this.tool_icon=v.tool_icon_hover}}n.HoverTool=E,o=E,E.__name__="HoverTool",o.prototype.default_view=q,o.define((({Any:e,Boolean:t,String:n,Array:s,Tuple:i,Dict:o,Or:r,Ref:l,Function:a,Auto:_,Nullable:p})=>({tooltips:[p(r(l(g.Template),n,s(i(n,n)),a())),[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[o(r(l(G.CustomJSHover),y.FormatterType)),{}],renderers:[r(s(l(H.DataRenderer)),_),"auto"],mode:[c.HoverMode,"mouse"],muted_policy:[c.MutedPolicy,"show"],point_policy:[c.PointPolicy,"snap_to_data"],line_policy:[c.LinePolicy,"nearest"],show_arrow:[t,!0],anchor:[c.Anchor,"center"],attachment:[c.TooltipAttachment,"horizontal"],callback:[p(e),null]}))),o.register_alias("hover",(()=>new o))},
function _(e,i,t,a,s){var n;a();const o=e(506),l=e(507),c=e(508),_=e(59);class r extends o.DOMElementView{constructor(){super(...arguments),this.action_views=new Map}*children(){yield*super.children(),yield*this.action_views.values()}async lazy_initialize(){await super.lazy_initialize(),await(0,_.build_views)(this.action_views,this.model.actions,{parent:this})}remove(){(0,_.remove_views)(this.action_views),super.remove()}update(e,i,t={}){!function a(s){for(const n of s.child_views.values())n instanceof c.PlaceholderView?n.update(e,i,t):n instanceof o.DOMElementView&&a(n)}(this);for(const a of this.action_views.values())a.update(e,i,t)}}t.TemplateView=r,r.__name__="TemplateView",r.tag_name="div";class v extends o.DOMElement{}t.Template=v,n=v,v.__name__="Template",n.prototype.default_view=r,n.define((({Array:e,Ref:i})=>({actions:[e(i(l.Action)),[]]})))},
function _(e,t,i,s,l){var n;s();const r=e(455),o=e(267),c=e(266),h=e(59),a=e(9),d=e(8);class _ extends r.DOMNodeView{constructor(){super(...arguments),this.child_views=new Map}*children(){yield*super.children(),yield*this.child_views.values()}async lazy_initialize(){await super.lazy_initialize();const e=this.model.children.filter((e=>!(0,d.isString)(e)));await(0,h.build_views)(this.child_views,e,{parent:this})}remove(){(0,h.remove_views)(this.child_views),super.remove()}render(){const{style:e}=this.model;if(null!=e)if(e instanceof o.Styles)for(const t of e){const e=t.get_value();if((0,d.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,a.entries)(e)){const e=t.replace(/_/g,"-");this.el.style.hasOwnProperty(e)&&this.el.style.setProperty(e,i)}for(const e of this.model.children)if((0,d.isString)(e)){const t=document.createTextNode(e);this.el.appendChild(t)}else{this.child_views.get(e).render_to(this.el)}this.finish()}}i.DOMElementView=_,_.__name__="DOMElementView";class y extends r.DOMNode{constructor(e){super(e)}}i.DOMElement=y,n=y,y.__name__="DOMElement",n.define((({String:e,Array:t,Dict:i,Or:s,Nullable:l,Ref:n})=>({style:[l(s(n(o.Styles),i(e))),null],children:[t(s(e,n(r.DOMNode),n(c.UIElement))),[]]})))},
function _(e,o,_,n,c){n();const s=e(50),t=e(54);class i extends t.View{}_.ActionView=i,i.__name__="ActionView";class d extends s.Model{constructor(e){super(e)}}_.Action=d,d.__name__="Action",d.__module__="bokeh.models.dom"},
function _(e,a,n,c,l){c();const o=e(455);class s extends o.DOMNodeView{render(){}}n.PlaceholderView=s,s.__name__="PlaceholderView",s.tag_name="span";class _ extends o.DOMNode{constructor(e){super(e)}}n.Placeholder=_,_.__name__="Placeholder"},
function _(e,l,t,o,a){o(),a("Action",e(507).Action),a("ColorRef",e(510).ColorRef),a("DOMElement",e(506).DOMElement),a("DOMNode",e(455).DOMNode);var S=e(512);a("Span",S.Span),a("Div",S.Div),a("Table",S.Table),a("TableRow",S.TableRow),a("HTML",e(462).HTML),a("Index",e(513).Index),a("Placeholder",e(508).Placeholder),a("Styles",e(267).Styles);var n=e(268);a("InlineStyleSheet",n.InlineStyleSheet),a("GlobalInlineStyleSheet",n.GlobalInlineStyleSheet),a("ImportedStyleSheet",n.ImportedStyleSheet),a("GlobalImportedStyleSheet",n.GlobalImportedStyleSheet),a("Template",e(505).Template),a("Text",e(456).Text),a("ToggleGroup",e(514).ToggleGroup),a("ValueOf",e(515).ValueOf),a("ValueRef",e(511).ValueRef)},
function _(e,l,t,o,s){var a;o();const n=e(1),_=e(511),i=e(172),r=e(56),c=n.__importStar(e(463));class h extends _.ValueRefView{render(){super.render(),this.value_el=(0,r.span)(),this.swatch_el=(0,r.span)({class:c.tooltip_color_block}," "),this.el.appendChild(this.value_el),this.el.appendChild(this.swatch_el)}update(e,l,t){const o=(0,i._get_column_value)(this.model.field,e,l),s=null==o?"???":`${o}`;this.el.textContent=s}}t.ColorRefView=h,h.__name__="ColorRefView";class d extends _.ValueRef{constructor(e){super(e)}}t.ColorRef=d,a=d,d.__name__="ColorRef",a.prototype.default_view=h,a.define((({Boolean:e})=>({hex:[e,!0],swatch:[e,!0]})))},
function _(e,l,t,n,a){var _;n();const o=e(508),s=e(172);class u extends o.PlaceholderView{update(e,l,t){const n=(0,s._get_column_value)(this.model.field,e,l),a=null==n?"???":`${n}`;this.el.textContent=a}}t.ValueRefView=u,u.__name__="ValueRefView";class i extends o.Placeholder{constructor(e){super(e)}}t.ValueRef=i,_=i,i.__name__="ValueRef",_.prototype.default_view=u,_.define((({String:e})=>({field:[e]})))},
function _(e,a,_,n,t){var l,s,i,m;n();const w=e(506);class o extends w.DOMElementView{}_.SpanView=o,o.__name__="SpanView",o.tag_name="span";class d extends w.DOMElement{}_.Span=d,l=d,d.__name__="Span",l.prototype.default_view=o;class p extends w.DOMElementView{}_.DivView=p,p.__name__="DivView",p.tag_name="div";class D extends w.DOMElement{}_.Div=D,s=D,D.__name__="Div",s.prototype.default_view=p;class V extends w.DOMElementView{}_.TableView=V,V.__name__="TableView",V.tag_name="table";class c extends w.DOMElement{}_.Table=c,i=c,c.__name__="Table",i.prototype.default_view=V;class v extends w.DOMElementView{}_.TableRowView=v,v.__name__="TableRowView",v.tag_name="tr";class b extends w.DOMElement{}_.TableRow=b,m=b,b.__name__="TableRow",m.prototype.default_view=v},
function _(e,n,t,l,d){var o;l();const s=e(508);class _ extends s.PlaceholderView{update(e,n,t){this.el.textContent=null==n?"(null)":n.toString()}}t.IndexView=_,_.__name__="IndexView";class a extends s.Placeholder{constructor(e){super(e)}}t.Index=a,o=a,a.__name__="Index",o.prototype.default_view=_},
function _(e,o,r,t,n){var s;t();const u=e(507),i=e(74),p=e(34);class g extends u.ActionView{update(e,o,r){for(const[e,r]of(0,p.enumerate)(this.model.groups))e.visible=o==r}}r.ToggleGroupView=g,g.__name__="ToggleGroupView";class _ extends u.Action{constructor(e){super(e)}}r.ToggleGroup=_,s=_,_.__name__="ToggleGroup",s.prototype.default_view=g,s.define((({Array:e,Ref:o})=>({groups:[e(o(i.RendererGroup)),[]]})))},
function _(e,t,n,s,o){var r;s();const i=e(455),a=e(14),l=e(56),c=e(42);class p extends i.DOMNodeView{connect_signals(){super.connect_signals();const{obj:e,attr:t}=this.model;t in e.properties&&this.on_change(e.properties[t],(()=>this.render()))}render(){(0,l.empty)(this.el),this.el.style.display="contents";const e=(()=>{const{obj:e,attr:t}=this.model;if(t in e.properties){const n=e.properties[t].get_value();return(0,c.to_string)(n)}return`<not found: ${e.type}.${t}>`})();this.el.textContent=e}}n.ValueOfView=p,p.__name__="ValueOfView";class _ extends i.DOMNode{constructor(e){super(e)}}n.ValueOf=_,r=_,_.__name__="ValueOf",r.prototype.default_view=p,r.define((({String:e,Ref:t})=>({obj:[t(a.HasProps)],attr:[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/object":9,"core/util/array":10,"core/util/math":11,"core/util/assert":12,"core/util/arrayable":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/vectorization":28,"core/settings":29,"core/util/ndarray":30,"core/util/cloneable":31,"core/serialization/index":32,"core/serialization/serializer":33,"core/util/iterator":34,"core/serialization/buffer":35,"core/util/buffer":36,"core/serialization/reps":37,"core/diagnostics":38,"core/uniforms":39,"core/util/string":40,"document/events":41,"core/util/pretty":42,"core/patching":43,"core/util/set":44,"core/util/typed_array":45,"core/resolvers":46,"core/serialization/deserializer":47,"core/util/slice":48,"core/util/version":49,"model":50,"document/defs":51,"core/bokeh_events":52,"embed/standalone":53,"core/view":54,"core/dom_view":55,"core/dom":56,"core/util/bbox":57,"styles/base.css":58,"core/build_views":59,"embed/server":60,"client/connection":61,"protocol/message":62,"protocol/receiver":63,"client/session":64,"embed/dom":65,"embed/notebook":66,"protocol/index":67,"testing":68,"safely":69,"models/main":70,"models/index":71,"models/annotations/index":72,"models/annotations/annotation":73,"models/renderers/renderer":74,"core/visuals/index":75,"core/visuals/line":76,"core/visuals/visual":77,"core/property_mixins":78,"core/visuals/fill":79,"core/visuals/text":80,"core/visuals/hatch":81,"core/visuals/patterns":82,"core/visuals/image":83,"models/coordinates/coordinate_mapping":84,"models/scales/scale":85,"models/transforms/transform":86,"models/ranges/range":87,"models/ranges/range1d":88,"models/ranges/numerical_range":89,"models/scales/linear_scale":90,"models/scales/continuous_scale":91,"models/scales/log_scale":92,"models/scales/categorical_scale":93,"models/scales/composite_scale":94,"models/ranges/data_range1d":95,"models/ranges/data_range":96,"models/util":97,"models/ranges/factor_range":98,"models/annotations/arrow":99,"models/annotations/data_annotation":100,"models/sources/columnar_data_source":101,"core/selection_manager":102,"models/selections/selection":103,"models/selections/interaction_policy":104,"models/sources/data_source":105,"models/sources/column_data_source":106,"core/util/projections":107,"models/annotations/arrow_head":141,"models/graphics/marking":142,"models/annotations/base_color_bar":143,"models/annotations/title":144,"models/annotations/text_annotation":145,"core/layout/side_panel":146,"core/layout/types":147,"core/layout/layoutable":148,"models/text/base_text":149,"models/text/utils":150,"models/text/math_text":151,"core/util/image":152,"core/graphics":153,"core/util/text":154,"core/util/affine":155,"models/text/providers":156,"core/util/modules":157,"models/text/plain_text":158,"models/canvas/cartesian_frame":159,"models/axes/index":160,"models/axes/axis":161,"models/renderers/guide_renderer":162,"models/tickers/ticker":163,"models/formatters/tick_formatter":164,"models/policies/labeling":165,"models/axes/categorical_axis":166,"models/tickers/categorical_ticker":167,"models/formatters/categorical_tick_formatter":168,"models/axes/continuous_axis":169,"models/axes/datetime_axis":170,"models/formatters/datetime_tick_formatter":171,"core/util/templating":172,"models/tickers/util":176,"models/tickers/datetime_ticker":177,"models/tickers/adaptive_ticker":178,"models/tickers/continuous_ticker":179,"models/tickers/composite_ticker":180,"models/tickers/days_ticker":181,"models/tickers/single_interval_ticker":182,"models/tickers/months_ticker":183,"models/tickers/years_ticker":184,"models/tickers/basic_ticker":185,"models/axes/linear_axis":186,"models/formatters/basic_tick_formatter":187,"models/axes/log_axis":188,"models/formatters/log_tick_formatter":189,"models/tickers/log_ticker":190,"models/axes/mercator_axis":191,"models/formatters/mercator_tick_formatter":192,"models/tickers/mercator_ticker":193,"models/tickers/index":194,"models/tickers/fixed_ticker":195,"models/tickers/binned_ticker":196,"models/mappers/scanning_color_mapper":197,"models/mappers/continuous_color_mapper":198,"models/mappers/color_mapper":199,"models/mappers/mapper":200,"models/renderers/glyph_renderer":201,"models/renderers/data_renderer":202,"models/glyphs/line":203,"models/glyphs/xy_glyph":204,"models/glyphs/glyph":205,"core/util/ragged_array":206,"core/util/spatial":207,"models/graphics/decoration":210,"models/glyphs/utils":211,"core/hittest":212,"models/glyphs/patch":213,"models/glyphs/harea_step":214,"models/glyphs/area":215,"core/util/flip_step_mode":216,"models/glyphs/harea":217,"models/glyphs/varea_step":218,"models/glyphs/varea":219,"models/sources/cds_view":220,"models/filters/filter":221,"models/filters/all_indices":222,"models/filters/intersection_filter":223,"models/formatters/index":224,"models/formatters/customjs_tick_formatter":225,"models/formatters/numeral_tick_formatter":226,"models/formatters/printf_tick_formatter":227,"models/scales/index":228,"models/scales/linear_interpolation_scale":229,"models/ranges/index":230,"core/layout/index":231,"core/layout/alignments":232,"core/layout/grid":233,"core/layout/border":234,"models/annotations/band":235,"models/annotations/upper_lower":236,"models/annotations/box_annotation":237,"models/common/kinds":238,"models/common/painting":239,"models/common/resolve":240,"models/coordinates/node":241,"models/coordinates/coordinate":242,"models/annotations/color_bar":243,"models/mappers/index":244,"models/mappers/categorical_color_mapper":245,"models/mappers/categorical_mapper":246,"models/mappers/categorical_marker_mapper":247,"models/mappers/categorical_pattern_mapper":248,"models/mappers/linear_color_mapper":249,"models/mappers/log_color_mapper":250,"models/mappers/eqhist_color_mapper":251,"models/mappers/stack_color_mapper":252,"models/mappers/weighted_stack_color_mapper":253,"models/annotations/contour_color_bar":254,"models/annotations/label":255,"models/annotations/label_set":256,"models/annotations/legend":257,"models/annotations/legend_item":258,"models/annotations/poly_annotation":259,"models/annotations/scale_bar":260,"models/annotations/dimensional":261,"models/annotations/slope":262,"models/annotations/span":263,"models/annotations/toolbar_panel":264,"models/tools/toolbar":265,"models/ui/ui_element":266,"models/dom/styles":267,"models/dom/stylesheets":268,"core/util/canvas":269,"core/util/svg":270,"core/util/random":271,"styles/ui.css":272,"models/tools/tool":273,"models/tools/tool_proxy":274,"models/tools/tool_button":275,"core/util/menus":276,"styles/menus.css":277,"styles/icons.css":278,"styles/tool_button.css":279,"models/tools/gestures/gesture_tool":280,"models/tools/on_off_button":281,"models/tools/inspectors/inspect_tool":282,"models/tools/actions/action_tool":283,"models/tools/click_button":284,"models/tools/actions/help_tool":285,"styles/toolbar.css":286,"styles/logo.css":287,"models/annotations/whisker":288,"models/annotations/html/index":289,"models/annotations/html/label":290,"models/annotations/html/text_annotation":291,"models/annotations/html/label_set":292,"models/annotations/html/title":293,"models/callbacks/index":294,"models/callbacks/customjs":295,"models/callbacks/callback":296,"models/callbacks/open_url":297,"models/callbacks/set_value":298,"models/canvas/index":299,"models/canvas/canvas":300,"core/ui_events":301,"core/util/wheel":303,"styles/canvas.css":304,"models/coordinates/index":305,"models/expressions/index":306,"models/expressions/expression":307,"models/expressions/customjs_expr":308,"models/expressions/stack":309,"models/expressions/cumsum":310,"models/expressions/minimum":311,"models/expressions/maximum":312,"models/expressions/coordinate_transform":313,"models/expressions/polar":314,"models/filters/index":315,"models/filters/boolean_filter":316,"models/filters/customjs_filter":317,"models/filters/group_filter":318,"models/filters/index_filter":319,"models/filters/inversion_filter":320,"models/filters/union_filter":321,"models/filters/difference_filter":322,"models/filters/symmetric_difference_filter":323,"models/glyphs/index":324,"models/glyphs/annular_wedge":325,"models/glyphs/annulus":326,"models/glyphs/arc":327,"models/glyphs/bezier":328,"core/util/algorithms":329,"models/glyphs/block":330,"models/glyphs/lrtb":331,"models/glyphs/circle":332,"models/glyphs/ellipse":333,"models/glyphs/center_rotatable":334,"models/glyphs/hbar":335,"models/glyphs/hspan":336,"models/glyphs/hstrip":337,"models/glyphs/hex_tile":338,"models/glyphs/image":339,"models/glyphs/image_base":340,"models/glyphs/image_rgba":341,"models/glyphs/image_stack":342,"models/glyphs/image_url":343,"models/glyphs/multi_line":344,"models/glyphs/multi_polygons":345,"models/glyphs/patches":346,"models/glyphs/quad":347,"models/glyphs/quadratic":348,"models/glyphs/ray":349,"models/glyphs/rect":350,"models/glyphs/scatter":351,"models/glyphs/marker":352,"models/glyphs/defs":353,"models/glyphs/segment":354,"models/glyphs/spline":355,"core/util/interpolation":356,"models/glyphs/step":357,"models/glyphs/text":358,"models/glyphs/vbar":359,"models/glyphs/vspan":360,"models/glyphs/vstrip":361,"models/glyphs/wedge":362,"models/graphics/index":363,"models/graphs/index":364,"models/graphs/graph_hit_test_policy":365,"models/graphs/layout_provider":366,"models/graphs/static_layout_provider":367,"models/grids/index":368,"models/grids/grid":369,"models/layouts/index":370,"models/layouts/column":371,"models/layouts/flex_box":372,"models/layouts/layout_dom":373,"models/menus/menu":374,"models/menus/menu_item":375,"models/layouts/alignments":376,"models/layouts/grid_box":377,"models/layouts/css_grid_box":378,"models/layouts/group_box":379,"styles/group_box.css":380,"models/layouts/hbox":381,"models/layouts/row":382,"models/layouts/scroll_box":383,"models/layouts/spacer":384,"models/layouts/tab_panel":385,"models/layouts/tabs":386,"styles/tabs.css":387,"models/layouts/vbox":388,"models/menus/index":389,"models/menus/action":390,"models/ui/icons/icon":391,"models/menus/check_action":392,"models/menus/section":393,"models/menus/divider":394,"models/text/index":395,"models/transforms/index":396,"models/transforms/customjs_transform":397,"models/transforms/dodge":398,"models/transforms/range_transform":399,"models/transforms/interpolator":400,"models/transforms/jitter":401,"models/random/random_generator":402,"models/transforms/linear_interpolator":403,"models/transforms/step_interpolator":404,"models/plots/index":405,"models/plots/gmap_plot":406,"models/plots/plot":407,"models/plots/plot_canvas":408,"core/util/throttle":409,"models/plots/range_manager":410,"models/plots/state_manager":411,"styles/plots.css":412,"models/plots/gmap_plot_canvas":413,"models/plots/gmap":414,"models/plots/grid_plot":415,"models/plots/figure":416,"models/policies/index":417,"models/random/index":418,"models/random/park_miller_lcg":419,"models/renderers/index":420,"models/renderers/contour_renderer":421,"models/renderers/graph_renderer":422,"models/selections/index":423,"models/selectors/index":424,"models/selectors/by_id":425,"models/selectors/selector":426,"models/selectors/by_class":427,"models/selectors/by_css":428,"models/selectors/by_xpath":429,"models/sources/index":430,"models/sources/server_sent_data_source":431,"models/sources/web_data_source":432,"models/sources/ajax_data_source":433,"models/sources/geojson_data_source":434,"models/tiles/index":435,"models/tiles/bbox_tile_source":436,"models/tiles/mercator_tile_source":437,"models/tiles/tile_source":438,"models/tiles/tile_utils":439,"models/tiles/quadkey_tile_source":440,"models/tiles/tile_renderer":441,"models/tiles/wmts_tile_source":442,"styles/attribution.css":443,"models/tiles/tms_tile_source":444,"models/textures/index":445,"models/textures/canvas_texture":446,"models/textures/texture":447,"models/textures/image_url_texture":448,"models/ui/index":449,"models/ui/icons/index":450,"models/ui/icons/builtin_icon":451,"models/ui/icons/svg_icon":452,"models/ui/icons/tabler_icon":453,"models/ui/dialog":454,"models/dom/dom_node":455,"models/dom/text":456,"styles/dialogs.css":457,"models/ui/examiner":458,"styles/examiner.css":459,"models/ui/pane":460,"models/ui/tooltip":461,"models/dom/html":462,"styles/tooltips.css":463,"models/tools/index":464,"models/tools/actions/index":465,"models/tools/actions/copy_tool":466,"models/tools/actions/custom_action":467,"models/tools/actions/fullscreen_tool":468,"models/tools/actions/examine_tool":469,"models/tools/actions/redo_tool":470,"models/tools/actions/plot_action_tool":471,"models/tools/actions/reset_tool":472,"models/tools/actions/save_tool":473,"models/tools/actions/undo_tool":474,"models/tools/actions/zoom_in_tool":475,"models/tools/actions/zoom_base_tool":476,"core/util/zoom":477,"models/tools/actions/zoom_out_tool":478,"models/tools/edit/index":479,"models/tools/edit/edit_tool":480,"models/tools/edit/box_edit_tool":481,"models/tools/edit/freehand_draw_tool":482,"models/tools/edit/line_edit_tool":483,"models/tools/edit/line_tool":484,"models/tools/edit/point_draw_tool":485,"models/tools/edit/poly_draw_tool":486,"models/tools/edit/poly_tool":487,"models/tools/edit/poly_edit_tool":488,"models/tools/gestures/index":489,"models/tools/gestures/box_select_tool":490,"models/tools/gestures/region_select_tool":491,"models/tools/gestures/select_tool":492,"models/tools/gestures/box_zoom_tool":493,"models/tools/gestures/lasso_select_tool":494,"models/tools/gestures/poly_select_tool":495,"models/tools/gestures/pan_tool":496,"models/tools/gestures/range_tool":497,"models/tools/gestures/tap_tool":498,"models/tools/gestures/wheel_pan_tool":499,"models/tools/gestures/wheel_zoom_tool":500,"models/tools/inspectors/index":501,"models/tools/inspectors/crosshair_tool":502,"models/tools/inspectors/customjs_hover":503,"models/tools/inspectors/hover_tool":504,"models/dom/template":505,"models/dom/dom_element":506,"models/dom/action":507,"models/dom/placeholder":508,"models/dom/index":509,"models/dom/color_ref":510,"models/dom/value_ref":511,"models/dom/elements":512,"models/dom/index_":513,"models/dom/toggle_group":514,"models/dom/value_of":515}, {});});
/* END bokeh.min.js */
</script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
</head>
<body>
<div id="af5e1fa3-831a-4a98-929c-8e43d5c114d0" data-root-id="p1488" style="display: contents;"></div>
<script type="application/json" id="p1559">
{"3d6bca65-e3ce-42c2-af0d-cb1c442878c3":{"version":"3.3.0","title":"Bokeh Application","roots":[{"type":"object","name":"Figure","id":"p1488","attributes":{"width":550,"height":900,"x_range":{"type":"object","name":"Range1d","id":"p1498","attributes":{"start":-4.789371354504213,"end":100.57679844458846}},"y_range":{"type":"object","name":"FactorRange","id":"p1499","attributes":{"factors":["New Jersey","Washington","Illinois","Hawaii","New York","Montana","Rhode Island","Maryland","Delaware","Louisiana","Nevada","Missouri","Pennsylvania","Florida","Arizona","Indiana","Wisconsin","Tennessee","Mississippi","New Hampshire","Virginia","Ohio","Utah","Iowa","Vermont","Kansas","North Carolina","Oregon","Minnesota","Michigan","Alabama","South Dakota","Connecticut","Oklahoma","Texas","Massachusetts","Colorado","Kentucky","California","South Carolina","Nebraska","Idaho","West Virginia","Arkansas","Maine","Georgia","North Dakota","New Mexico","Alaska","Wyoming"],"range_padding":0.02}},"x_scale":{"type":"object","name":"LinearScale","id":"p1500"},"y_scale":{"type":"object","name":"CategoricalScale","id":"p1501"},"title":{"type":"object","name":"Title","id":"p1491","attributes":{"text_color":"#434244","text_font_size":"0pt"}},"renderers":[{"type":"object","name":"GlyphRenderer","id":"p1526","attributes":{"name":"rain_pct","data_source":{"type":"object","name":"ColumnDataSource","id":"p1485","attributes":{"selected":{"type":"object","name":"Selection","id":"p1486","attributes":{"indices":[],"line_indices":[]}},"selection_policy":{"type":"object","name":"UnionRenderers","id":"p1487"},"data":{"type":"map","entries":[["index",{"type":"ndarray","array":{"type":"bytes","data":"HQAAAC4AAAAMAAAACgAAAB8AAAAZAAAAJgAAABMAAAAHAAAAEQAAABsAAAAYAAAAJQAAAAgAAAACAAAADQAAADAAAAApAAAAFwAAABwAAAAtAAAAIgAAACsAAAAOAAAALAAAAA8AAAAgAAAAJAAAABYAAAAVAAAAAAAAACgAAAAGAAAAIwAAACoAAAAUAAAABQAAABAAAAAEAAAAJwAAABoAAAALAAAALwAAAAMAAAASAAAACQAAACEAAAAeAAAAAQAAADEAAAA="},"shape":[50],"dtype":"int32","order":"little"}],["state",{"type":"ndarray","array":["New Jersey","Washington","Illinois","Hawaii","New York","Montana","Rhode Island","Maryland","Delaware","Louisiana","Nevada","Missouri","Pennsylvania","Florida","Arizona","Indiana","Wisconsin","Tennessee","Mississippi","New Hampshire","Virginia","Ohio","Utah","Iowa","Vermont","Kansas","North Carolina","Oregon","Minnesota","Michigan","Alabama","South Dakota","Connecticut","Oklahoma","Texas","Massachusetts","Colorado","Kentucky","California","South Carolina","Nebraska","Idaho","West Virginia","Arkansas","Maine","Georgia","North Dakota","New Mexico","Alaska","Wyoming"],"shape":[50],"dtype":"object","order":"little"}],["rain_pct",{"type":"ndarray","array":{"type":"bytes","data":"AAAAAAAAAABmMcWP47XxP9ysQIJkd/o/bXaDpOV5DUBc4TtP+HMPQJpzfsWUJRFAJdqzSBVSFUA8Grt9L+kVQBPtc1jUKhZAVF4iwSFsG0AnsENcFUEdQI130bUhgB1AORZqR3K0HUA3MGIo/GUeQBUUkdmXrh5AGgNzN8aOIUDi3OLpTeUhQCGQQ026FCJAAt/hYwQdI0A5BS+n4OUjQB8Yn3IQCiRA0nW8jYkWJEARX3XJBCckQHb+XaCVcSRA7kdGr4S7JkDX4ktcZaYnQER3W0Bo/idA/nC9rFdQKEDnGnu1M8MoQDctPDTqYSpAkg5rZ05jKkCnU9hMAAIuQBbHUl5XBzBAysW2+3xrMECo7N2RTMowQA7xaOtWNzFA14hKtjqlMkDmoXoz+PcyQLmSpsxZNzNAa1bPqCJAM0AjRowYMdozQOEPF5l3+DNAvOIAJY0uNEAFe9Mwhbg0QEA5VpiwRDZAEc2F0LxpNkC1W1X3xys6QEQlvJnF7j1AxXj9b/xXSUBd+Zc0ZfJXQA=="},"shape":[50],"dtype":"float64","order":"little"}],["rain_dol",{"type":"ndarray","array":{"type":"bytes","data":"AAAAAAAAAABmZmZmZoZzQAAAAAAAeIdAzczMzMxcdEAAAAAAAO6pQAAAAAAAgF1ALV4sDNFxcUDNzMzMzCSSQM3MzMzMhHFAw4GQLIAjiEAAAAAAAEB1QM3MzMzMIIhAAAAAAABkpkBmZmZmZlSlQJqZmZmZsY5AZmZmZmZCmUAzMzMzMxebQAAAAAAAOJhAzczMzMxggUDNzMzMzPxjQLIwfvlirqRAZmZmZmYkpUDNzMzMzCSQQGZmZmZm8olA7FG4HoWTcECamZmZmUmOQAAAAAAAWKhAB0FHq5rumUA9CtejsCSpQAAAAAAA+JhAAAAAAACklkCamZmZmTFzQM3MzMzM4qlAAAAAAAAYk0CamZmZWbvEQAAAAACAGbtAmJmZmZkQqUBxPQrXI3+jQGdmZmaWy+ZAMzMzMzPdnEAAAAAAAPyMQGZmZmZmkotAmpmZmZnljUAAAAAAAPCSQM3MzMzMWIxAxhSscTp4tEAzMzMzM2uGQNmPNSvWXKVAzczMzMwrpUAAAAAAABiXQA=="},"shape":[50],"dtype":"float64","order":"little"}],["rain_color",{"type":"ndarray","array":["#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#EED17E","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53","#D5AB53"],"shape":[50],"dtype":"object","order":"little"}],["totbal_pct",{"type":"ndarray","array":{"type":"bytes","data":"nsNhCVEsLEAn7AuykJgyQBlgNXZ8HxBAHEvJYcqmQEDgNe1ZtZNDQOrCpnvQ6VFAGbpEAcHuIkB2rhitrGo/QIdbtLp4wUlAGsmO5ViPG0BPiCkekBxEQAens8rnFUtAFS/GC1HGNUAdDy+DVOVQQLR7ma3/cEVAt/n+ekKhQEDC3xCEYSI/QNbAMpvBgEJArwdA8f5DI0BWOW43lbU5QKjjKzEi7ztAsgKZ2OorQUDxMFbh+VtFQMFzFmnQ5EBAp3LS8wj4MkC/CO5LsRpBQGsGr6HxykNAnxlVmd2MSUC3rEQ9zrNAQFrhWexJT05Am8IX0WTyQkD1Ce3WmKU0QBbHUl5XBzBAXMRTUGyATEDkh7Dd/TFFQLApZhtFWkZA14hKtjqlMkAR4CK3UZ9AQPRFI/f5+TRAczbxfiDjUUDz48ePH09SQP0d3Qzx4DpABuP5cHYfT0CWgSr8xPRGQP3w6YnZFzdAV+azc7tfSUD6SXTr7ZNOQCcwnoj+a0FAxXj9b/xXSUBd+Zc0ZfJXQA=="},"shape":[50],"dtype":"float64","order":"little"}],["totbal_dol",{"type":"ndarray","array":{"type":"bytes","data":"AAAAAADAvEDKzMzMTIC0QAAAAAAAmJxAFtnO95MBp0AAAAAAoCPgQDQY6Wab0Z5ATVp/S0D7fkBnZmZm5gO6QMzMzMzMWqRAo8qFyn9CiEA0zQBZvDedQF6PwvUoJ7ZAAAAAAMBpwEDNzMzM7LXXQJmZmZkZc7VANjMzM7Pst0DNzMzMzJC3QDQzMzOzyLhA/dajcD2EgUAyMzMzM9N5QFkYv3wx1LxAmpmZmZkSwkAllSnmTByxQAAAAAAAcaVATLgeheupe0CWmZmZmeelQJiZmZnZFMRA9LskjDFAu0C2yHa+j/XAQP7///9/r7xAnJmZmZlBsECamZmZmWl6QM3MzMzM4qlAzMzMzEySsEBlZmZmxivaQAZYau+ml9FAmJmZmZkQqUDuUbgexRWxQGu8dJMk4uhAaGZmZubRukA0MzMzM7uqQPv/////jZJAaGZmZmYNp0AAAAAAAPukQJ2ZmZmZZY1AjP5ton8sx0CcmZmZmTGaQLxVzzAZ3qhAzczMzMwrpUAAAAAAABiXQA=="},"shape":[50],"dtype":"float64","order":"little"}],["totbal_color",{"type":"ndarray","array":["#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#74AAC7","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5","#3477A5"],"shape":[50],"dtype":"object","order":"little"}],["totbal_rain_pct_dif",{"type":"ndarray","array":{"type":"bytes","data":"nsNhCVEsLEARmQ95Mn0xQMRpSqtGAwNAaicCD1iePUDKd/nUdZxBQLDbTi9311BADZrVuWyLEEDn56nNYPA5QOXdpS8e/EZAAGM1NpKboT9KEqFybXRAQBV4+ZPjZUdADlPX82iyLEAz2FGB6f1NQDFZZ7Ism0FA4XFE2iF7OEBRcR+Pui82QJy5ww8m9ztAgFYUr0Z9sz9zba3HSYUvQJhX3PcZ6jFAe8pT6pBMOEAt2fiuOFJAQEfo/QHWkDdAwDq9cBppHkASILbpL2I2QDRRMCOvljtAYL0lrsd4Q0D6y8ufAgY1QAzWSl/PtkdA7f15biKzOECGgAPCYpIWQAAAAAAAAAAAd2F40q1KREAgI4Mpr5k5QFJiY0szfTtAAAAAAAAAAAB4PJZ1Vo0sQLAzy6cCKvw/sMF6qS8mSkDUpEmTJrFKQHA4GM/loRtAqHF53i8IRUAniIHHBDE5QKD3djIeZeo/nf/hFrpVPEAgnMnvCX5BQCjsAN7dpBNAAAAAAAAAAAAAAAAAAAAAAA=="},"shape":[50],"dtype":"float64","order":"little"}]]}}},"view":{"type":"object","name":"CDSView","id":"p1527","attributes":{"filter":{"type":"object","name":"AllIndices","id":"p1528"}}},"glyph":{"type":"object","name":"HBar","id":"p1523","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"type":"object","name":"Stack","id":"p1516","attributes":{"fields":[]}}},"right":{"type":"expr","expr":{"type":"object","name":"Stack","id":"p1517","attributes":{"fields":["rain_pct"]}}},"line_color":{"type":"field","field":"rain_color"},"fill_color":{"type":"field","field":"rain_color"},"hatch_color":{"type":"field","field":"rain_color"}}},"nonselection_glyph":{"type":"object","name":"HBar","id":"p1524","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"id":"p1516"}},"right":{"type":"expr","expr":{"id":"p1517"}},"line_color":{"type":"field","field":"rain_color"},"line_alpha":{"type":"value","value":0.1},"fill_color":{"type":"field","field":"rain_color"},"fill_alpha":{"type":"value","value":0.1},"hatch_color":{"type":"field","field":"rain_color"},"hatch_alpha":{"type":"value","value":0.1}}},"muted_glyph":{"type":"object","name":"HBar","id":"p1525","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"id":"p1516"}},"right":{"type":"expr","expr":{"id":"p1517"}},"line_color":{"type":"field","field":"rain_color"},"line_alpha":{"type":"value","value":0.2},"fill_color":{"type":"field","field":"rain_color"},"fill_alpha":{"type":"value","value":0.2},"hatch_color":{"type":"field","field":"rain_color"},"hatch_alpha":{"type":"value","value":0.2}}}}},{"type":"object","name":"GlyphRenderer","id":"p1537","attributes":{"name":"totbal_rain_pct_dif","data_source":{"id":"p1485"},"view":{"type":"object","name":"CDSView","id":"p1538","attributes":{"filter":{"type":"object","name":"AllIndices","id":"p1539"}}},"glyph":{"type":"object","name":"HBar","id":"p1534","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"type":"object","name":"Stack","id":"p1518","attributes":{"fields":["rain_pct"]}}},"right":{"type":"expr","expr":{"type":"object","name":"Stack","id":"p1519","attributes":{"fields":["rain_pct","totbal_rain_pct_dif"]}}},"line_color":{"type":"field","field":"totbal_color"},"fill_color":{"type":"field","field":"totbal_color"},"hatch_color":{"type":"field","field":"totbal_color"}}},"nonselection_glyph":{"type":"object","name":"HBar","id":"p1535","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"id":"p1518"}},"right":{"type":"expr","expr":{"id":"p1519"}},"line_color":{"type":"field","field":"totbal_color"},"line_alpha":{"type":"value","value":0.1},"fill_color":{"type":"field","field":"totbal_color"},"fill_alpha":{"type":"value","value":0.1},"hatch_color":{"type":"field","field":"totbal_color"},"hatch_alpha":{"type":"value","value":0.1}}},"muted_glyph":{"type":"object","name":"HBar","id":"p1536","attributes":{"y":{"type":"field","field":"state"},"height":{"type":"value","value":0.9},"left":{"type":"expr","expr":{"id":"p1518"}},"right":{"type":"expr","expr":{"id":"p1519"}},"line_color":{"type":"field","field":"totbal_color"},"line_alpha":{"type":"value","value":0.2},"fill_color":{"type":"field","field":"totbal_color"},"fill_alpha":{"type":"value","value":0.2},"hatch_color":{"type":"field","field":"totbal_color"},"hatch_alpha":{"type":"value","value":0.2}}}}}],"toolbar":{"type":"object","name":"Toolbar","id":"p1497","attributes":{"logo":null,"tools":[{"type":"object","name":"SaveTool","id":"p1512"},{"type":"object","name":"HelpTool","id":"p1513"},{"type":"object","name":"HoverTool","id":"p1541","attributes":{"toggleable":false,"renderers":"auto","tooltips":[["State","@state"],["Rainy day fund % exps.","@rain_pct{0.0}%"],["Total balances % exps.","@totbal_pct{0.0}%"]]}}],"active_drag":null,"active_scroll":null,"active_tap":null}},"left":[{"type":"object","name":"CategoricalAxis","id":"p1507","attributes":{"ticker":{"type":"object","name":"CategoricalTicker","id":"p1508"},"formatter":{"type":"object","name":"CategoricalTickFormatter","id":"p1509"},"axis_label_text_font_size":"9pt","major_label_policy":{"type":"object","name":"AllLabels","id":"p1510"},"major_label_text_color":"#434244","major_label_text_font_size":"9pt","axis_line_color":"#434244","major_tick_line_color":"#434244","minor_tick_line_color":"#434244"}}],"below":[{"type":"object","name":"LinearAxis","id":"p1502","attributes":{"ticker":{"type":"object","name":"SingleIntervalTicker","id":"p1514","attributes":{"interval":10}},"formatter":{"type":"object","name":"BasicTickFormatter","id":"p1504"},"axis_label":"Percentage of general fund expenditures","axis_label_text_font_size":"11pt","major_label_policy":{"type":"object","name":"AllLabels","id":"p1505"},"major_label_text_color":"#434244","major_label_text_font_size":"11pt","axis_line_color":"#434244","major_tick_line_color":"#434244","minor_tick_line_color":"#434244"}},{"type":"object","name":"Title","id":"p1542","attributes":{"text":"Source: Pew Charitable Trusts, \"Fiscal 50: State Trends and","text_color":"#434244","text_font_size":"11pt","text_font_style":"normal"}},{"type":"object","name":"Title","id":"p1543","attributes":{"text":" Analysis,\" May 17, 2023, accessed May 26, 2023.","text_color":"#434244","text_font_size":"11pt","text_font_style":"normal"}},{"type":"object","name":"Title","id":"p1544","attributes":{"text":"Note: For states in which the blue bar is not visible for total balances","text_color":"#434244","text_font_size":"11pt","text_font_style":"normal"}},{"type":"object","name":"Title","id":"p1545","attributes":{"text":" and reserves, the value equals the rainy day fund balance","text_color":"#434244","text_font_size":"11pt","text_font_style":"normal"}},{"type":"object","name":"Title","id":"p1546","attributes":{"text":" percentage.","text_color":"#434244","text_font_size":"11pt","text_font_style":"normal"}}],"center":[{"type":"object","name":"Grid","id":"p1506","attributes":{"axis":{"id":"p1502"},"ticker":{"type":"object","name":"SingleIntervalTicker","id":"p1515","attributes":{"interval":10}}}},{"type":"object","name":"Grid","id":"p1511","attributes":{"dimension":1,"axis":{"id":"p1507"}}},{"type":"object","name":"Legend","id":"p1529","attributes":{"location":[210,240],"border_line_color":"#434244","border_line_alpha":1,"label_text_color":"#434244","label_text_font_size":"11pt","items":[{"type":"object","name":"LegendItem","id":"p1530","attributes":{"label":{"type":"value","value":"Rainy day fund"},"renderers":[{"id":"p1526"}]}},{"type":"object","name":"LegendItem","id":"p1540","attributes":{"label":{"type":"value","value":"Total reserves and balances"},"renderers":[{"id":"p1537"}]}}]}}]}}]}}
</script>
<script type="text/javascript">
(function() {
const fn = function() {
Bokeh.safely(function() {
(function(root) {
function embed_document(root) {
const docs_json = document.getElementById('p1559').textContent;
const render_items = [{"docid":"3d6bca65-e3ce-42c2-af0d-cb1c442878c3","roots":{"p1488":"af5e1fa3-831a-4a98-929c-8e43d5c114d0"},"root_ids":["p1488"]}];
root.Bokeh.embed.embed_items(docs_json, render_items);
}
if (root.Bokeh !== undefined) {
embed_document(root);
} else {
let attempts = 0;
const timer = setInterval(function(root) {
if (root.Bokeh !== undefined) {
clearInterval(timer);
embed_document(root);
} else {
attempts++;
if (attempts > 100) {
clearInterval(timer);
console.log("Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing");
}
}
}, 10, root)
}
})(window);
});
};
if (document.readyState != "loading") fn();
else document.addEventListener("DOMContentLoaded", fn);
})();
</script>
</body>
</html>