@stlite/desktop 0.90.13 → 0.90.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/assets/{ErrorOutline.esm-CJGMKtXr.js → ErrorOutline.esm-8R3U-65K.js} +1 -1
  3. package/build/assets/{FileDownload.esm-DVbGfwz7.js → FileDownload.esm-BFOXuaE0.js} +1 -1
  4. package/build/assets/{FileHelper-BAjDG49X.js → FileHelper-CX-ki3eU.js} +1 -1
  5. package/build/assets/{FormClearHelper-CaLJK07N.js → FormClearHelper-CXfZggoC.js} +1 -1
  6. package/build/assets/{Hooks-D54IehuR.js → Hooks-rH_bDoeH.js} +1 -1
  7. package/build/assets/{InputInstructions-BLplNLW9.js → InputInstructions-DBvcFAZU.js} +1 -1
  8. package/build/assets/{Particles-VYhfVp_p.js → Particles-CC5U4uC2.js} +1 -1
  9. package/build/assets/{ProgressBar-DX8k7XSZ.js → ProgressBar-CUUN2Jn1.js} +1 -1
  10. package/build/assets/{Toolbar-BbbydoLD.js → Toolbar-CAXs2ssX.js} +1 -1
  11. package/build/assets/{base-input-d4WKPeU6.js → base-input-CaoUSnQs.js} +1 -1
  12. package/build/assets/{checkbox-DUA9ewQT.js → checkbox-C6QD2M1R.js} +1 -1
  13. package/build/assets/{createSuper-CoIMxZYP.js → createSuper-C2tKBwhP.js} +1 -1
  14. package/build/assets/{data-grid-overlay-editor-cvHWuOOd.js → data-grid-overlay-editor-B6zYg3nK.js} +1 -1
  15. package/build/assets/{downloader-CR6bzPv-.js → downloader-Dkst_JYU.js} +1 -1
  16. package/build/assets/{es6-BCBcAdQS.js → es6-COIX_UTS.js} +2 -2
  17. package/build/assets/{iframeResizer.contentWindow-CEqjsNrn.js → iframeResizer.contentWindow-CLXvvjGK.js} +1 -1
  18. package/build/assets/{index-HqlJZ3Ag.js → index-B1mnHG1O.js} +1 -1
  19. package/build/assets/{index-C91sP-jG.js → index-BAuLAaYe.js} +1 -1
  20. package/build/assets/{index-BGUuVZft.js → index-BI0ZZeqT.js} +1 -1
  21. package/build/assets/{index-mHvUvPYI.js → index-BKmCVz-X.js} +1 -1
  22. package/build/assets/{index-Bwfh73dd.js → index-BS4li24f.js} +1 -1
  23. package/build/assets/{index-vLb3c1eZ.js → index-BeWWu5Gh.js} +1 -1
  24. package/build/assets/{index-CeNNLDtJ.js → index-Bot-HFGd.js} +1 -1
  25. package/build/assets/{index-Bhgfj5y5.js → index-Bt2KSUC2.js} +1 -1
  26. package/build/assets/{index-CdAXvPf5.js → index-Bvl3bY4R.js} +1 -1
  27. package/build/assets/{index-PHqcnj3c.js → index-C0Q8yE7v.js} +1 -1
  28. package/build/assets/{index-B3GOsGpL.js → index-C12OFcIh.js} +1 -1
  29. package/build/assets/{index-BdVfRySM.js → index-C7nKmor1.js} +1 -1
  30. package/build/assets/{index-DOiS7VE9.js → index-CADKCir8.js} +1 -1
  31. package/build/assets/{index-CTZrIDfL.js → index-CCXHPMUB.js} +1 -1
  32. package/build/assets/{index-j6pFDYKO.js → index-CJikVwcT.js} +1 -1
  33. package/build/assets/{index-NigQ67t-.js → index-CKIZeYUq.js} +1 -1
  34. package/build/assets/{index-XsxWL5x-.js → index-C_m1xqoG.js} +1 -1
  35. package/build/assets/{index-CD0SY35r.js → index-CcI6rcYL.js} +1 -1
  36. package/build/assets/{index-CJWk1YT9.js → index-CqPiUIzz.js} +1 -1
  37. package/build/assets/{index-BRiK5gVx.js → index-CzNOzdMD.js} +1 -1
  38. package/build/assets/{index-BMSSeqlt.js → index-D57JlMpf.js} +1 -1
  39. package/build/assets/{index-D_4iXBI5.js → index-DH8imcpD.js} +1 -1
  40. package/build/assets/{index-VVwti7cA.js → index-DKIJUmSp.js} +1 -1
  41. package/build/assets/{index-wUVGuFfU.js → index-DRv0ltn2.js} +1 -1
  42. package/build/assets/{index-B7yzG-4X.js → index-DZKUZQ4z.js} +5 -5
  43. package/build/assets/{index-CIRTE79j.js → index-DpusuKed.js} +1 -1
  44. package/build/assets/{index-DCv3Ovf7.js → index-P8waswk0.js} +1 -1
  45. package/build/assets/{index-CwPp5UqK.js → index-PiPju_F7.js} +1 -1
  46. package/build/assets/{index-B58bWjQH.js → index-R9kIgYTc.js} +1 -1
  47. package/build/assets/{index-CHBxMYoz.js → index-W7pMcdM5.js} +1 -1
  48. package/build/assets/{index-DoQHaClc.js → index-WXxfAlRg.js} +1 -1
  49. package/build/assets/{index-D9P3ZYiC.js → index-gnMTbBzT.js} +1 -1
  50. package/build/assets/{index-wnKDraWU.js → index-k4Zz_A0O.js} +217 -212
  51. package/build/assets/{index-BJK2Ym_S.js → index-k4zlsY75.js} +1 -1
  52. package/build/assets/{index-gb2ePejP.js → index-onhde1_u.js} +1 -1
  53. package/build/assets/{index-Dynm-1sH.js → index-qNX4xGHy.js} +1 -1
  54. package/build/assets/{index-BD2ZweM9.js → index-sKFQbsJX.js} +1 -1
  55. package/build/assets/{inherits-xHSaJdUZ.js → inherits-CEwp2qJ3.js} +1 -1
  56. package/build/assets/{input-PliHooUw.js → input-F2PGHPo-.js} +1 -1
  57. package/build/assets/{memory-BJMhKXeY.js → memory-DrewVBU3.js} +1 -1
  58. package/build/assets/{number-overlay-editor-DRf5xgI3.js → number-overlay-editor-b3bkPSy4.js} +1 -1
  59. package/build/assets/{sandbox-DBdCCxaG.js → sandbox-NITkBzy4.js} +1 -1
  60. package/build/assets/{slicedToArray-Cuk3tbTR.js → slicedToArray-CyBE-4ry.js} +1 -1
  61. package/build/assets/{timepicker-DjzHzJAt.js → timepicker-DRJ4YL4p.js} +1 -1
  62. package/build/assets/{uniqueId-ikSpJ9AP.js → uniqueId-CbEiG62v.js} +1 -1
  63. package/build/assets/{useBasicWidgetState-raTjAqZP.js → useBasicWidgetState-CMQ4ds3J.js} +1 -1
  64. package/build/assets/{useTextInputAutoExpand-Uac3U0I_.js → useTextInputAutoExpand-BfLYssNQ.js} +1 -1
  65. package/build/assets/{useUpdateUiValue-BbEmiOZQ.js → useUpdateUiValue-B81sk7L2.js} +1 -1
  66. package/build/assets/{withFullScreenWrapper-C7u7nPsK.js → withFullScreenWrapper-Bc57_5Q4.js} +1 -1
  67. package/build/assets/{worker-CiNU4sgs.js → worker-CO569BKa.js} +4 -4
  68. package/build/electron/worker.js +5 -5
  69. package/build/index.html +1 -1
  70. package/package.json +4 -4
  71. package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsxRuntimeExports}from"./index-wnKDraWU.js";const main=(function(V,Q,O,e){O===void 0&&(O={}),e===void 0&&(e={});const C={},R=function(g){if(typeof g=="number")return g;if(g==="bokehjs")return Q;if(!e[g]){const o="@bokehjs/";g.slice(0,o.length)===o&&(g=g.slice(o.length))}const p=O[g];if(p!=null)return p;const T=g.length>0&&g[g.lenght-1]==="/",c=O[g+(T?"":"/")+"index"];return c??g},v=function(g){let p=C[g];if(!p){const T=R(g);if(p=C[T],p)C[g]=p;else{let c=function(){Object.defineProperty(p.exports,"__esModule",{value:!0})},o=function(r,i){Object.defineProperty(p.exports,r,{enumerable:!0,get:function(){return i}})};if(!V[T]){if(e[T]===!1||e[T]==!0&&parent_require)try{return p={exports:e[T]?parent_require(T):{}},C[T]=C[g]=p,p.exports}catch{}const r=new Error("Cannot find module '"+g+"'");throw r.code="MODULE_NOT_FOUND",r}p={exports:{}},C[T]=C[g]=p,V[T].call(p.exports,v,p,p.exports,c,o)}}return p.exports};v.resolve=function(g){return""};const w=v(Q);return w.require=v,typeof Proxy<"u"&&(w.loader=new Proxy({},{get:function(g,p){return v(p)}})),w.register_plugin=function(g,p,T,c){T===void 0&&(T={}),c===void 0&&(c={});for(let r in g)V[r]=g[r];for(let r in T)O[r]=T[r];for(let r in c)e[r]=c[r];const o=v(p);for(let r in o)w[r]=o[r];return o},w})([function(V,Q,O,e,C){e(),(0,V(1).__exportStar)(V(2),O)},function(Q,O,e,C,R){C();var v=function(c,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])},v(c,o)};e.__extends=function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=c}v(c,o),c.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)};function w(c){var o=typeof Symbol=="function"&&Symbol.iterator,r=o&&c[o],i=0;if(r)return r.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&i>=c.length&&(c=void 0),{value:c&&c[i++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(c,o){var r=typeof Symbol=="function"&&c[Symbol.iterator];if(!r)return c;var i,t,s=r.call(c),a=[];try{for(;(o===void 0||o-- >0)&&!(i=s.next()).done;)a.push(i.value)}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function p(c){return this instanceof p?(this.v=c,this):new p(c)}e.__assign=function(){return e.__assign=Object.assign||function(c){for(var o,r=1,i=arguments.length;r<i;r++)for(var t in o=arguments[r])Object.prototype.hasOwnProperty.call(o,t)&&(c[t]=o[t]);return c},e.__assign.apply(this,arguments)},e.__rest=function(c,o){var r={};for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&o.indexOf(i)<0&&(r[i]=c[i]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var t=0;for(i=Object.getOwnPropertySymbols(c);t<i.length;t++)o.indexOf(i[t])<0&&Object.prototype.propertyIsEnumerable.call(c,i[t])&&(r[i[t]]=c[i[t]])}return r},e.__decorate=function(c,o,r,i){var t,s=arguments.length,a=s<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(c,o,r,i);else for(var u=c.length-1;u>=0;u--)(t=c[u])&&(a=(s<3?t(a):s>3?t(o,r,a):t(o,r))||a);return s>3&&a&&Object.defineProperty(o,r,a),a},e.__param=function(c,o){return function(r,i){o(r,i,c)}},e.__metadata=function(c,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(c,o)},e.__awaiter=function(c,o,r,i){return new(r||(r=Promise))(function(t,s){function a(d){try{l(i.next(d))}catch(m){s(m)}}function u(d){try{l(i.throw(d))}catch(m){s(m)}}function l(d){var m;d.done?t(d.value):(m=d.value,m instanceof r?m:new r(function(f){f(m)})).then(a,u)}l((i=i.apply(c,o||[])).next())})},e.__generator=function(c,o){var r,i,t,s,a={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(l){return function(d){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(t=2&m[0]?i.return:m[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,m[1])).done)return t;switch(i=0,t&&(m=[2&m[0],t.value]),m[0]){case 0:case 1:t=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,i=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(t=a.trys,!((t=t.length>0&&t[t.length-1])||m[0]!==6&&m[0]!==2)){a=0;continue}if(m[0]===3&&(!t||m[1]>t[0]&&m[1]<t[3])){a.label=m[1];break}if(m[0]===6&&a.label<t[1]){a.label=t[1],t=m;break}if(t&&a.label<t[2]){a.label=t[2],a.ops.push(m);break}t[2]&&a.ops.pop(),a.trys.pop();continue}m=o.call(c,a)}catch(f){m=[6,f],i=0}finally{r=t=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,d])}}},e.__createBinding=Object.create?function(c,o,r,i){i===void 0&&(i=r),Object.defineProperty(c,i,{enumerable:!0,get:function(){return o[r]}})}:function(c,o,r,i){i===void 0&&(i=r),c[i]=o[r]},e.__exportStar=function(c,o){for(var r in c)r==="default"||Object.prototype.hasOwnProperty.call(o,r)||(0,e.__createBinding)(o,c,r)},e.__values=w,e.__read=g,e.__spread=function(){for(var c=[],o=0;o<arguments.length;o++)c=c.concat(g(arguments[o]));return c},e.__spreadArrays=function(){for(var c=0,o=0,r=arguments.length;o<r;o++)c+=arguments[o].length;var i=Array(c),t=0;for(o=0;o<r;o++)for(var s=arguments[o],a=0,u=s.length;a<u;a++,t++)i[t]=s[a];return i},e.__spreadArray=function(c,o,r){if(r||arguments.length===2)for(var i,t=0,s=o.length;t<s;t++)!i&&t in o||(i||(i=Array.prototype.slice.call(o,0,t)),i[t]=o[t]);return c.concat(i||Array.prototype.slice.call(o))},e.__await=p,e.__asyncGenerator=function(c,o,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,t=r.apply(c,o||[]),s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(f){t[f]&&(i[f]=function(b){return new Promise(function(y,A){s.push([f,b,y,A])>1||u(f,b)})})}function u(f,b){try{(y=t[f](b)).value instanceof p?Promise.resolve(y.value.v).then(l,d):m(s[0][2],y)}catch(A){m(s[0][3],A)}var y}function l(f){u("next",f)}function d(f){u("throw",f)}function m(f,b){f(b),s.shift(),s.length&&u(s[0][0],s[0][1])}},e.__asyncDelegator=function(c){var o,r;return o={},i("next"),i("throw",function(t){throw t}),i("return"),o[Symbol.iterator]=function(){return this},o;function i(t,s){o[t]=c[t]?function(a){return(r=!r)?{value:p(c[t](a)),done:t==="return"}:s?s(a):a}:s}},e.__asyncValues=function(c){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=c[Symbol.asyncIterator];return r?r.call(c):(c=w(c),o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o);function i(t){o[t]=c[t]&&function(s){return new Promise(function(a,u){(function(l,d,m,f){Promise.resolve(f).then(function(b){l({value:b,done:m})},d)})(a,u,(s=c[t](s)).done,s.value)})}}},e.__makeTemplateObject=function(c,o){return Object.defineProperty?Object.defineProperty(c,"raw",{value:o}):c.raw=o,c};var T=Object.create?function(c,o){Object.defineProperty(c,"default",{enumerable:!0,value:o})}:function(c,o){c.default=o};e.__importStar=function(c){if(c&&c.__esModule)return c;var o={};if(c!=null)for(var r in c)r!=="default"&&Object.prototype.hasOwnProperty.call(c,r)&&(0,e.__createBinding)(o,c,r);return T(o,c),o},e.__importDefault=function(c){return c&&c.__esModule?c:{default:c}},e.__classPrivateFieldGet=function(c,o,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?c!==o||!i:!o.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(c):i?i.value:o.get(c)},e.__classPrivateFieldSet=function(c,o,r,i,t){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!t)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?c!==o||!t:!o.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?t.call(c,r):t?t.value=r:o.set(c,r),r}},function(Q,O,e,C,R){C();const v=Q(1);R("version",Q(3).version),R("index",Q(4).index),e.embed=(0,v.__importStar)(Q(4)),e.protocol=(0,v.__importStar)(Q(406)),e._testing=(0,v.__importStar)(Q(407));var w=Q(19);R("logger",w.logger),R("set_log_level",w.set_log_level),R("settings",Q(28).settings),R("Models",Q(7).Models),R("documents",Q(5).documents),R("safely",Q(408).safely)},function(Q,O,e,C,R){C(),e.version="2.4.3"},function(Q,O,e,C,R){C();const v=Q(5),w=Q(19),g=Q(34),p=Q(13),T=Q(8),c=Q(16),o=Q(397),r=Q(399),i=Q(398);var t=Q(397);R("add_document_standalone",t.add_document_standalone),R("index",t.index),R("add_document_from_session",Q(399).add_document_from_session);var s=Q(404);async function a(u,l,d,m){(0,T.isString)(u)&&(u=JSON.parse((0,g.unescape)(u)));const f={};for(const[y,A]of(0,p.entries)(u))f[y]=v.Document.from_json(A);const b=[];for(const y of l){const A=(0,i._resolve_element)(y),L=(0,i._resolve_root_elements)(y);if(y.docid!=null)b.push(await(0,o.add_document_standalone)(f[y.docid],A,L,y.use_for_title));else{if(y.token==null)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const x=(0,r._get_ws_url)(d,m);w.logger.debug(`embed: computed ws url: ${x}`);try{b.push(await(0,r.add_document_from_session)(x,y.token,A,L,y.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(H){console.log("Error rendering Bokeh items:",H)}}}}return b}R("embed_items_notebook",s.embed_items_notebook),R("kernels",s.kernels),R("BOKEH_ROOT",Q(398).BOKEH_ROOT),e.embed_item=async function(u,l){const d={},m=(0,g.uuid4)();d[m]=u.doc,l==null&&(l=u.target_id);const f=document.getElementById(l);f?.classList.add(i.BOKEH_ROOT);const b={roots:{[u.root_id]:l},root_ids:[u.root_id],docid:m};await(0,c.defer)();const[y]=await a(d,[b]);return y},e.embed_items=async function(u,l,d,m){return await(0,c.defer)(),a(u,l,d,m)}},function(V,Q,O,e,C){e();const R=V(1);(0,R.__exportStar)(V(6),O),(0,R.__exportStar)(V(35),O)},function(Q,O,e,C,R){C();const v=Q(1),w=Q(7),g=Q(3),p=Q(19),T=Q(251),c=Q(14),o=Q(30),r=Q(15),i=Q(17),t=Q(31),s=Q(29),a=Q(9),u=Q(13),l=(0,v.__importStar)(Q(77)),d=Q(26),m=Q(8),f=Q(309),b=Q(75),y=Q(53),A=Q(396),L=Q(35);class x{constructor(k){this.document=k,this.session=null,this.subscribed_models=new Set}send_event(k){const E=new L.MessageSentEvent(this.document,"bokeh_event",k.to_json());this.document._trigger_on_change(E)}trigger(k){for(const E of this.subscribed_models)k.origin!=null&&k.origin!=E||E._process_event(k)}}e.EventManager=x,x.__name__="EventManager",e.documents=[],e.DEFAULT_TITLE="Bokeh Application";class H{constructor(k){var E;e.documents.push(this),this._init_timestamp=Date.now(),this._resolver=(E=k?.resolver)!==null&&E!==void 0?E:new w.ModelResolver,this._title=e.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new x(this),this.idle=new r.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}get layoutables(){return this._roots.filter(k=>k instanceof f.LayoutDOM)}get is_idle(){for(const k of this.layoutables)if(!this._idle_roots.has(k))return!1;return!0}notify_idle(k){this._idle_roots.set(k,!0),this.is_idle&&(p.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new T.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(k,E=null){this._interactive_plot==null&&(this._interactive_plot=k,this._interactive_plot.trigger_event(new T.LODStart)),this._interactive_finalize=E,this._interactive_timestamp=Date.now()}interactive_stop(){this._interactive_plot!=null&&(this._interactive_plot.trigger_event(new T.LODEnd),this._interactive_finalize!=null&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return this._interactive_timestamp==null?-1:Date.now()-this._interactive_timestamp}destructively_move(k){if(k===this)throw new Error("Attempted to overwrite a document with itself");k.clear();const E=(0,a.copy)(this._roots);this.clear();for(const P of E)if(P.document!=null)throw new Error(`Somehow we didn't detach ${P}`);if(this._all_models.size!=0)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const P of E)k.add_root(P);k.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,this._all_models_freeze_count===0&&this._recompute_all_models()}_invalidate_all_models(){p.logger.debug("invalidating document models"),this._all_models_freeze_count===0&&this._recompute_all_models()}_recompute_all_models(){let k=new Set;for(const D of this._roots)k=l.union(k,D.references());const E=new Set(this._all_models.values()),P=l.difference(E,k),N=l.difference(k,E),B=new Map;for(const D of k)B.set(D.id,D);for(const D of P)D.detach_document();for(const D of N)D.attach_document(this);this._all_models=B}roots(){return this._roots}add_root(k,E){if(p.logger.debug(`Adding root: ${k}`),!(0,a.includes)(this._roots,k)){this._push_all_models_freeze();try{this._roots.push(k)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new L.RootAddedEvent(this,k,E))}}remove_root(k,E){const P=this._roots.indexOf(k);if(!(P<0)){this._push_all_models_freeze();try{this._roots.splice(P,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new L.RootRemovedEvent(this,k,E))}}title(){return this._title}set_title(k,E){k!==this._title&&(this._title=k,this._trigger_on_change(new L.TitleChangedEvent(this,k,E)))}get_model_by_id(k){var E;return(E=this._all_models.get(k))!==null&&E!==void 0?E:null}get_model_by_name(k){const E=[];for(const P of this._all_models.values())P instanceof y.Model&&P.name==k&&E.push(P);switch(E.length){case 0:return null;case 1:return E[0];default:throw new Error(`Multiple models are named '${k}'`)}}on_message(k,E){const P=this._message_callbacks.get(k);P==null?this._message_callbacks.set(k,new Set([E])):P.add(E)}remove_on_message(k,E){var P;(P=this._message_callbacks.get(k))===null||P===void 0||P.delete(E)}_trigger_on_message(k,E){const P=this._message_callbacks.get(k);if(P!=null)for(const N of P)N(E)}on_change(k,E=!1){this._callbacks.has(k)||this._callbacks.set(k,E)}remove_on_change(k){this._callbacks.delete(k)}_trigger_on_change(k){for(const[E,P]of this._callbacks)if(!P&&k instanceof L.DocumentEventBatch)for(const N of k.events)E(N);else E(k)}_notify_change(k,E,P,N,B){this._trigger_on_change(new L.ModelChangedEvent(this,k,E,P,N,B?.setter_id,B?.hint))}static _instantiate_object(k,E,P,N){const B=Object.assign(Object.assign({},P),{id:k,__deferred__:!0});return new(N.get(E))(B)}static _instantiate_references_json(k,E,P){var N;const B=new Map;for(const D of k){const j=D.id,M=D.type,F=(N=D.attributes)!==null&&N!==void 0?N:{};let W=E.get(j);W==null&&(W=H._instantiate_object(j,M,F,P),D.subtype!=null&&W.set_subtype(D.subtype)),B.set(W.id,W)}return B}static _resolve_refs(k,E,P,N){function B(D){var j;if((0,i.is_ref)(D)){const M=(j=E.get(D.id))!==null&&j!==void 0?j:P.get(D.id);if(M!=null)return M;throw new Error(`reference ${JSON.stringify(D)} isn't known (not in Document?)`)}if((0,t.is_NDArray_ref)(D)){const{buffer:M,dtype:F,shape:W}=(0,t.decode_NDArray)(D,N);return(0,s.ndarray)(M,{dtype:F,shape:W})}return(0,m.isArray)(D)?(function(M){const F=[];for(const W of M)F.push(B(W));return F})(D):(0,m.isPlainObject)(D)?(function(M){const F={};for(const[W,U]of(0,u.entries)(M))F[W]=B(U);return F})(D):D}return B(k)}static _initialize_references_json(k,E,P,N){const B=new Map;for(const{id:F,attributes:W}of k){const U=!E.has(F),q=U?P.get(F):E.get(F),X=H._resolve_refs(W,E,P,N);q.setv(X,{silent:!0}),B.set(F,{instance:q,is_new:U})}const D=[],j=new Set;function M(F){if(F instanceof c.HasProps){if(B.has(F.id)&&!j.has(F.id)){j.add(F.id);const{instance:W,is_new:U}=B.get(F.id),{attributes:q}=W;for(const X of(0,u.values)(q))M(X);U&&(W.finalize(),D.push(W))}}else if((0,m.isArray)(F))for(const W of F)M(W);else if((0,m.isPlainObject)(F))for(const W of(0,u.values)(F))M(W)}for(const F of B.values())M(F.instance);for(const F of D)F.connect_signals()}static _event_for_attribute_change(k,E,P,N,B){if(N.get_model_by_id(k.id).property(E).syncable){const D={kind:"ModelChanged",model:{id:k.id},attr:E,new:P};return c.HasProps._json_record_references(N,P,B,{recursive:!0}),D}return null}static _events_to_sync_objects(k,E,P,N){const B=Object.keys(k.attributes),D=Object.keys(E.attributes),j=(0,a.difference)(B,D),M=(0,a.difference)(D,B),F=(0,a.intersection)(B,D),W=[];for(const U of j)p.logger.warn(`Server sent key ${U} but we don't seem to have it in our JSON`);for(const U of M){const q=E.attributes[U];W.push(H._event_for_attribute_change(k,U,q,P,N))}for(const U of F){const q=k.attributes[U],X=E.attributes[U];q==null&&X==null||(q==null||X==null?W.push(H._event_for_attribute_change(k,U,X,P,N)):U=="data"||(0,d.is_equal)(q,X)||W.push(H._event_for_attribute_change(k,U,X,P,N)))}return W.filter(U=>U!=null)}static _compute_patch_since_json(k,E){const P=E.to_json(!1);function N(ae){const me=new Map;for(const Ve of ae.roots.references)me.set(Ve.id,Ve);return me}const B=N(k),D=new Map,j=[];for(const ae of k.roots.root_ids)D.set(ae,B.get(ae)),j.push(ae);const M=N(P),F=new Map,W=[];for(const ae of P.roots.root_ids)F.set(ae,M.get(ae)),W.push(ae);if(j.sort(),W.sort(),(0,a.difference)(j,W).length>0||(0,a.difference)(W,j).length>0)throw new Error("Not implemented: computing add/remove of document roots");const U=new Set;let q=[];for(const ae of E._all_models.keys())if(B.has(ae)){const me=H._events_to_sync_objects(B.get(ae),M.get(ae),E,U);q=q.concat(me)}const X=new o.Serializer({include_defaults:!1});return X.to_serializable([...U]),{references:[...X.definitions],events:q}}to_json_string(k=!0){return JSON.stringify(this.to_json(k))}to_json(k=!0){const E=new o.Serializer({include_defaults:k}),P=E.to_serializable(this._roots);return{version:g.version,title:this._title,roots:{root_ids:P.map(N=>N.id),references:[...E.definitions]}}}static from_json_string(k){const E=JSON.parse(k);return H.from_json(E)}static from_json(k){p.logger.debug("Creating Document from JSON");const E=k.version,P=E.indexOf("+")!==-1||E.indexOf("-")!==-1,N=`Library versions: JS (${g.version}) / Python (${E})`;P||g.version.replace(/-(dev|rc)\./,"$1")==E?p.logger.debug(N):(p.logger.warn("JS/Python version mismatch"),p.logger.warn(N));const B=new w.ModelResolver;k.defs!=null&&(0,A.resolve_defs)(k.defs,B);const D=k.roots,j=D.root_ids,M=D.references,F=H._instantiate_references_json(M,new Map,B);H._initialize_references_json(M,new Map,F,new Map);const W=new H({resolver:B});W._push_all_models_freeze();for(const U of j){const q=F.get(U);q!=null&&W.add_root(q)}return W._pop_all_models_freeze(),W.set_title(k.title),W}replace_with_json(k){H.from_json(k).destructively_move(this)}create_json_patch_string(k){return JSON.stringify(this.create_json_patch(k))}create_json_patch(k){for(const N of k)if(N.document!=this)throw new Error("Cannot create a patch using events from a different document");const E=new o.Serializer,P=E.to_serializable(k);for(const N of this._all_models.values())E.remove_def(N);return{events:P,references:[...E.definitions]}}apply_json_patch(k,E=new Map,P){const N=k.references,B=k.events,D=H._instantiate_references_json(N,this._all_models,this._resolver);E instanceof Map||(E=new Map(E));for(const F of B)switch(F.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":{const W=F.model.id,U=this._all_models.get(W);if(U!=null)D.set(W,U);else if(!D.has(W))throw p.logger.warn(`Got an event for unknown model ${F.model}"`),new Error("event model wasn't known");break}}const j=new Map(this._all_models),M=new Map;for(const[F,W]of D)j.has(F)||M.set(F,W);H._initialize_references_json(N,j,M,E);for(const F of B)switch(F.kind){case"MessageSent":{const{msg_type:W,msg_data:U}=F;let q;if(U===void 0){if(E.size!=1)throw new Error("expected exactly one buffer");{const[[,X]]=E;q=X}}else q=H._resolve_refs(U,j,M,E);this._trigger_on_message(W,q);break}case"ModelChanged":{const W=F.model.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot apply patch to ${W} which is not in the document`);const q=F.attr,X=H._resolve_refs(F.new,j,M,E);U.setv({[q]:X},{setter_id:P});break}case"ColumnDataChanged":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot stream to ${W} which is not in the document`);const q=H._resolve_refs(F.new,new Map,new Map,E);if(F.cols!=null)for(const X in U.data)X in q||(q[X]=U.data[X]);U.setv({data:q},{setter_id:P,check_eq:!1});break}case"ColumnsStreamed":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot stream to ${W} which is not in the document`);if(!(U instanceof b.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");const q=F.data,X=F.rollover;U.stream(q,X,P);break}case"ColumnsPatched":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot patch ${W} which is not in the document`);if(!(U instanceof b.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");const q=F.patches;U.patch(q,P);break}case"RootAdded":{const W=F.model.id,U=D.get(W);this.add_root(U,P);break}case"RootRemoved":{const W=F.model.id,U=D.get(W);this.remove_root(U,P);break}case"TitleChanged":this.set_title(F.title,P);break;default:throw new Error(`Unknown patch event ${JSON.stringify(F)}`)}}}e.Document=H,H.__name__="Document"},function(Q,O,e,C,R){C();const v=Q(1),w=Q(8),g=Q(13),p=Q(14);e.overrides={};const T=new Map;e.Models=i=>{const t=e.Models.get(i);if(t!=null)return t;throw new Error(`Model '${i}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)},e.Models.get=i=>{var t;return(t=e.overrides[i])!==null&&t!==void 0?t:T.get(i)},e.Models.register=(i,t)=>{e.overrides[i]=t},e.Models.unregister=i=>{delete e.overrides[i]},e.Models.register_models=(i,t=!1,s)=>{var a;if(i!=null){for(const u of(0,w.isArray)(i)?i:(0,g.values)(i))if(a=u,(0,w.isObject)(a)&&a.prototype instanceof p.HasProps){const l=u.__qualified__;t||!T.has(l)?T.set(l,u):s!=null?s(l):console.warn(`Model '${l}' was already registered`)}}},e.register_models=e.Models.register_models,e.Models.registered_names=()=>[...T.keys()];class c{constructor(){this._known_models=new Map}get(t,s){var a;const u=(a=e.Models.get(t))!==null&&a!==void 0?a:this._known_models.get(t);if(u!=null)return u;if(s!==void 0)return s;throw new Error(`Model '${t}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)}register(t){const s=t.__qualified__;this.get(s,null)==null?this._known_models.set(s,t):console.warn(`Model '${s}' was already registered with this resolver`)}}e.ModelResolver=c,c.__name__="ModelResolver";const o=(0,v.__importStar)(Q(38));(0,e.register_models)(o);const r=(0,v.__importStar)(Q(392));(0,e.register_models)(r)},function(Q,O,e,C,R){C();const v=Q(9),w=Object.prototype.toString;function g(i){return i===!0||i===!1||w.call(i)==="[object Boolean]"}function p(i){return w.call(i)==="[object Number]"}function T(i){return w.call(i)==="[object String]"}function c(i){return typeof i=="symbol"}function o(i){const t=typeof i;return t==="function"||t==="object"&&!!i}function r(i){return o(i)&&i[Symbol.iterator]!==void 0}e.isBoolean=g,e.isNumber=p,e.isInteger=function(i){return p(i)&&Number.isInteger(i)},e.isString=T,e.isSymbol=c,e.isPrimitive=function(i){return i===null||g(i)||p(i)||T(i)||c(i)},e.isFunction=function(i){return w.call(i)==="[object Function]"},e.isArray=function(i){return Array.isArray(i)},e.isArrayOf=function(i,t){return(0,v.every)(i,t)},e.isArrayableOf=function(i,t){for(let s=0,a=i.length;s<a;s++)if(!t(i[s]))return!1;return!0},e.isTypedArray=function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},e.isObject=o,e.isPlainObject=function(i){return o(i)&&(i.constructor==null||i.constructor===Object)},e.isIterable=r,e.isArrayable=function(i){return r(i)&&"length"in i}},function(Q,O,e,C,R){C();const v=Q(10),w=Q(11),g=Q(12);R("map",g.map),R("reduce",g.reduce),R("min",g.min),R("min_by",g.min_by),R("max",g.max),R("max_by",g.max_by),R("sum",g.sum),R("cumsum",g.cumsum),R("every",g.every),R("some",g.some),R("find",g.find),R("find_last",g.find_last),R("find_index",g.find_index),R("find_last_index",g.find_last_index),R("sorted_index",g.sorted_index),R("is_empty",g.is_empty);const p=Array.prototype.slice;function T(i){return p.call(i)}function c(i){return[].concat(...i)}function o(i,t){return i.indexOf(t)!==-1}function r(i,t,s=1){(0,w.assert)(s>0,"'step' must be a positive number"),t==null&&(t=i,i=0);const{max:a,ceil:u,abs:l}=Math,d=i<=t?s:-s,m=a(u(l(t-i)/s),0),f=new Array(m);for(let b=0;b<m;b++,i+=d)f[b]=i;return f}e.head=function(i){return i[0]},e.tail=function(i){return i[i.length-1]},e.last=function(i){return i[i.length-1]},e.copy=T,e.concat=c,e.includes=o,e.contains=o,e.nth=function(i,t){return i[t>=0?t:i.length+t]},e.zip=function(...i){if(i.length==0)return[];const t=(0,g.min)(i.map(u=>u.length)),s=i.length,a=new Array(t);for(let u=0;u<t;u++){a[u]=new Array(s);for(let l=0;l<s;l++)a[u][l]=i[l][u]}return a},e.unzip=function(i){const t=i.length,s=(0,g.min)(i.map(u=>u.length)),a=Array(s);for(let u=0;u<s;u++)a[u]=new Array(t);for(let u=0;u<t;u++)for(let l=0;l<s;l++)a[l][u]=i[u][l];return a},e.range=r,e.linspace=function(i,t,s=100){const a=(t-i)/(s-1),u=new Array(s);for(let l=0;l<s;l++)u[l]=i+a*l;return u},e.transpose=function(i){const t=i.length,s=i[0].length,a=[];for(let u=0;u<s;u++){a[u]=[];for(let l=0;l<t;l++)a[u][l]=i[l][u]}return a},e.argmin=function(i){return(0,g.min_by)(r(i.length),t=>i[t])},e.argmax=function(i){return(0,g.max_by)(r(i.length),t=>i[t])},e.sort_by=function(i,t){const s=i.map((a,u)=>({value:a,index:u,key:t(a)}));return s.sort((a,u)=>{const l=a.key,d=u.key;if(l!==d){if(l>d||l===void 0)return 1;if(l<d||d===void 0)return-1}return a.index-u.index}),s.map(a=>a.value)},e.uniq=function(i){const t=new Set;for(const s of i)t.add(s);return[...t]},e.uniq_by=function(i,t){const s=[],a=[];for(const u of i){const l=t(u);o(a,l)||(a.push(l),s.push(u))}return s},e.union=function(...i){const t=new Set;for(const s of i)for(const a of s)t.add(a);return[...t]},e.intersection=function(i,...t){const s=[];e:for(const a of i)if(!o(s,a)){for(const u of t)if(!o(u,a))continue e;s.push(a)}return s},e.difference=function(i,...t){const s=c(t);return i.filter(a=>!o(s,a))},e.remove_at=function(i,t){const s=T(i);return s.splice(t,1),s},e.remove_by=function(i,t){for(let s=0;s<i.length;)t(i[s])?i.splice(s,1):s++},e.shuffle=function(i){const t=i.length,s=new Array(t);for(let a=0;a<t;a++){const u=(0,v.randomIn)(0,a);u!==a&&(s[a]=s[u]),s[u]=i[a]}return s},e.pairwise=function(i,t){const s=i.length,a=new Array(s-1);for(let u=0;u<s-1;u++)a[u]=t(i[u],i[u+1]);return a},e.reversed=function(i){const t=i.length,s=new Array(t);for(let a=0;a<t;a++)s[t-a-1]=i[a];return s},e.repeat=function(i,t){const s=new Array(t);for(let a=0;a<t;a++)s[a]=i;return s}},function(Q,O,e,C,R){C();const{PI:v}=Math;function w(c){if(c==0)return 0;for(;c<=0;)c+=2*v;for(;c>2*v;)c-=2*v;return c}function g(c,o){return w(c-o)}function p(){return Math.random()}function T(c){switch(c){case"deg":return v/180;case"rad":return 1;case"grad":return v/200;case"turn":return 2*v}}e.angle_norm=w,e.angle_dist=g,e.angle_between=function(c,o,r,i=!1){const t=g(o,r);if(t==0)return!1;if(t==2*v)return!0;const s=w(c),a=g(o,s)<=t&&g(s,r)<=t;return i?!a:a},e.random=p,e.randomIn=function(c,o){return o==null&&(o=c,c=0),c+Math.floor(Math.random()*(o-c+1))},e.atan2=function(c,o){return Math.atan2(o[1]-c[1],o[0]-c[0])},e.radians=function(c){return c*(v/180)},e.degrees=function(c){return c/(v/180)},e.resolve_angle=function(c,o){return-T(o)*c},e.to_radians_coeff=T,e.rnorm=function(c,o){let r,i;for(;r=p(),i=p(),i=(2*i-1)*Math.sqrt(1/Math.E*2),!(-4*r*r*Math.log(r)>=i*i););let t=i/r;return t=c+o*t,t},e.clamp=function(c,o,r){return c<o?o:c>r?r:c},e.log=function(c,o=Math.E){return Math.log(c)/Math.log(o)},e.float32_epsilon=11920928955078125e-23},function(Q,O,e,C,R){C();class v extends Error{}e.AssertionError=v,v.__name__="AssertionError",e.assert=function(w,g){if(!(w===!0||w!==!1&&w()))throw new v(g??"Assertion failed")},e.unreachable=function(){throw new Error("unreachable code")}},function(Q,O,e,C,R){C();const v=Q(10);function w(t,s,a,...u){const l=t.length;s<0&&(s+=l),s<0?s=0:s>l&&(s=l),a==null||a>l-s?a=l-s:a<0&&(a=0);const d=l-a+u.length,m=new t.constructor(d);let f=0;for(;f<s;f++)m[f]=t[f];for(const b of u)m[f++]=b;for(let b=s+a;b<l;b++)m[f++]=t[b];return m}function g(t,s){return w(t,s,t.length-s)}function p(t,s){const a=t.length,u=new t.constructor(a);for(let l=0;l<a;l++)u[l]=s(t[l],l,t);return u}function T(t,s,a){const u=t.length;if(a===void 0&&u==0)throw new Error("can't reduce an empty array without an initial value");let l,d;for(a===void 0?(l=t[0],d=1):(l=a,d=0);d<u;d++)l=s(l,t[d],d,t);return l}function c(t){return function(s,a){const u=s.length;let l=t>0?0:u-1;for(;l>=0&&l<u;l+=t)if(a(s[l]))return l;return-1}}function o(t,s){let a=0,u=t.length;for(;a<u;){const l=Math.floor((a+u)/2);t[l]<s?a=l+1:u=l}return a}function r(t,s,a,u,l){const d=(l-a)/(u-s);let m=d*(t-s)+a;return isFinite(m)||(m=d*(t-u)+l,isFinite(m)||a!=l||(m=a)),m}function i(t,s){if(t<s[0])return-1;if(t>s[s.length-1])return s.length;let a=0,u=s.length-1;for(;u-a!=1;){const l=a+Math.floor((u-a)/2);t>=s[l]?a=l:u=l}return a}e.is_empty=function(t){return t.length==0},e.copy=function(t){return Array.isArray(t)?t.slice():new t.constructor(t)},e.splice=w,e.head=g,e.insert=function(t,s,a){return w(t,a,0,s)},e.append=function(t,s){return w(t,t.length,0,s)},e.prepend=function(t,s){return w(t,0,0,s)},e.indexOf=function(t,s){for(let a=0,u=t.length;a<u;a++)if(t[a]===s)return a;return-1},e.subselect=function(t,s){const a=s.length,u=new t.constructor(a);for(let l=0;l<a;l++)u[l]=t[s[l]];return u},e.mul=function(t,s,a){const u=t.length,l=a??new t.constructor(u);for(let d=0;d<u;d++)l[d]=t[d]*s;return l},e.map=p,e.inplace_map=function(t,s,a){const u=t.length,l=a??t;for(let d=0;d<u;d++)l[d]=s(t[d],d)},e.filter=function(t,s){const a=t.length,u=new t.constructor(a);let l=0;for(let d=0;d<a;d++){const m=t[d];s(m,d,t)&&(u[l++]=m)}return g(u,l)},e.reduce=T,e.min=function(t){let s,a=1/0;for(let u=0,l=t.length;u<l;u++)s=t[u],!isNaN(s)&&s<a&&(a=s);return a},e.max=function(t){let s,a=-1/0;for(let u=0,l=t.length;u<l;u++)s=t[u],!isNaN(s)&&s>a&&(a=s);return a},e.minmax=function(t){let s,a=1/0,u=-1/0;for(let l=0,d=t.length;l<d;l++)s=t[l],isNaN(s)||(s<a&&(a=s),s>u&&(u=s));return[a,u]},e.minmax2=function(t,s){let a,u,l=1/0,d=-1/0,m=1/0,f=-1/0;const b=Math.min(t.length,s.length);for(let y=0;y<b;y++)a=t[y],u=s[y],isNaN(a)||isNaN(u)||(a<l&&(l=a),a>d&&(d=a),u<m&&(m=u),u>f&&(f=u));return[l,d,m,f]},e.min_by=function(t,s){if(t.length==0)throw new Error("min_by() called with an empty array");let a=t[0],u=s(a);for(let l=1,d=t.length;l<d;l++){const m=t[l],f=s(m);f<u&&(a=m,u=f)}return a},e.max_by=function(t,s){if(t.length==0)throw new Error("max_by() called with an empty array");let a=t[0],u=s(a);for(let l=1,d=t.length;l<d;l++){const m=t[l],f=s(m);f>u&&(a=m,u=f)}return a},e.sum=function(t){let s=0;for(let a=0,u=t.length;a<u;a++)s+=t[a];return s},e.cumsum=function(t){const s=new t.constructor(t.length);return T(t,(a,u,l)=>s[l]=a+u,0),s},e.every=function(t,s){for(let a=0,u=t.length;a<u;a++)if(!s(t[a]))return!1;return!0},e.some=function(t,s){for(let a=0,u=t.length;a<u;a++)if(s(t[a]))return!0;return!1},e.index_of=function(t,s){for(let a=0,u=t.length;a<u;a++)if(t[a]===s)return a;return-1},e.find_index=c(1),e.find_last_index=c(-1),e.find=function(t,s){const a=(0,e.find_index)(t,s);return a==-1?void 0:t[a]},e.find_last=function(t,s){const a=(0,e.find_last_index)(t,s);return a==-1?void 0:t[a]},e.sorted_index=o,e.bin_counts=function(t,s){const a=s.length-1,u=Array(a).fill(0);for(let l=0;l<t.length;l++){const d=o(s,t[l]);u[(0,v.clamp)(d-1,0,a-1)]+=1}return u},e.interpolate=function(t,s,a){const u=t.length,l=new Array(u);for(let d=0;d<u;d++){const m=t[d];if(isNaN(m)){l[d]=m;continue}const f=i(m,s);if(f==-1)l[d]=a[0];else if(f==s.length)l[d]=a[a.length-1];else if(f==s.length-1||s[f]==m)l[d]=a[f];else{const b=s[f],y=a[f],A=s[f+1],L=a[f+1];l[d]=r(m,b,y,A,L)}}return l},e.left_edge_index=i,e.norm=function(t,s,a){const u=a-s;return p(t,l=>(l-s)/u)}},function(Q,O,e,C,R){C();const v=Q(9),{hasOwnProperty:w}=Object.prototype;function g(T){return Object.keys(T).length}function p(T){return g(T)==0}e.keys=Object.keys,e.values=Object.values,e.entries=Object.entries,e.extend=Object.assign,e.clone=function(T){return Object.assign({},T)},e.merge=function(T,c){const o=Object.create(Object.prototype),r=(0,v.concat)([Object.keys(T),Object.keys(c)]);for(const i of r){const t=w.call(T,i)?T[i]:[],s=w.call(c,i)?c[i]:[];o[i]=(0,v.union)(t,s)}return o},e.size=g,e.is_empty=p,e.isEmpty=p,e.to_object=function(T){const c={};for(const[o,r]of T)c[o]=r;return c}},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(15),p=Q(17),T=(0,v.__importStar)(Q(18)),c=(0,v.__importStar)(Q(21)),o=Q(34),r=Q(13),i=Q(8),t=Q(26),s=Q(30),a=Q(35),u=Q(26),l=Q(36),d=Q(37),m=(0,v.__importStar)(Q(21));class f extends(0,g.Signalable)(){constructor(y={}){var A,L;super(),this._subtype=void 0,this.document=null,this.destroyed=new g.Signal0(this,"destroyed"),this.change=new g.Signal0(this,"change"),this.transformchange=new g.Signal0(this,"transformchange"),this.exprchange=new g.Signal0(this,"exprchange"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const x=y instanceof Map?y.get.bind(y):H=>y[H];this.id=(A=x("id"))!==null&&A!==void 0?A:(0,o.uniqueId)();for(const[H,{type:S,default_value:k,options:E}]of(0,r.entries)(this._props)){let P;S instanceof T.PropertyAlias?Object.defineProperty(this.properties,H,{get:()=>this.properties[S.attr],configurable:!1,enumerable:!1}):(P=S instanceof c.Kind?new T.PrimitiveProperty(this,H,S,k,x(H),E):new S(this,H,c.Any,k,x(H),E),this.properties[H]=P)}(L=x("__deferred__"))!==null&&L!==void 0&&L||(this.finalize(),this.connect_signals())}get is_syncable(){return!0}set type(y){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=y}get type(){return this.constructor.__qualified__}static get __qualified__(){const{__module__:y,__name__:A}=this;return y!=null?`${y}.${A}`:A}static get[Symbol.toStringTag](){return this.__name__}static _fix_default(y,A){if(y===void 0||(0,i.isFunction)(y))return y;if((0,i.isPrimitive)(y))return()=>y;{const L=new d.Cloner;return()=>L.clone(y)}}static define(y){for(const[A,L]of(0,r.entries)((0,i.isFunction)(y)?y(m):y)){if(this.prototype._props[A]!=null)throw new Error(`attempted to redefine property '${this.prototype.type}.${A}'`);if(this.prototype[A]!=null)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${A}'`);Object.defineProperty(this.prototype,A,{get(){return this.properties[A].get_value()},set(P){return this.setv({[A]:P}),this},configurable:!1,enumerable:!0});const[x,H,S={}]=L,k={type:x,default_value:this._fix_default(H,A),options:S},E=Object.assign({},this.prototype._props);E[A]=k,this.prototype._props=E}}static internal(y){const A={};for(const[L,x]of(0,r.entries)((0,i.isFunction)(y)?y(m):y)){const[H,S,k={}]=x;A[L]=[H,S,Object.assign(Object.assign({},k),{internal:!0})]}this.define(A)}static mixins(y){function A(H,S){const k={};for(const[E,P]of(0,r.entries)(S))k[H+E]=P;return k}const L={},x=[];for(const H of(0,i.isArray)(y)?y:[y])if((0,i.isArray)(H)){const[S,k]=H;(0,r.extend)(L,A(S,k)),x.push([S,k])}else{const S=H;(0,r.extend)(L,S),x.push(["",S])}this.define(L),this.prototype._mixins=[...this.prototype._mixins,...x]}static override(y){for(const[A,L]of(0,r.entries)(y)){const x=this._fix_default(L,A),H=this.prototype._props[A];if(H==null)throw new Error(`attempted to override nonexistent '${this.prototype.type}.${A}'`);const S=Object.assign({},this.prototype._props);S[A]=Object.assign(Object.assign({},H),{default_value:x}),this.prototype._props=S}}toString(){return`${this.type}(${this.id})`}property(y){const A=this.properties[y];if(A!=null)return A;throw new Error(`unknown property ${this.type}.${y}`)}get attributes(){const y={};for(const A of this)y[A.attr]=A.get_value();return y}[d.clone](y){const A=new Map;for(const L of this)L.dirty&&A.set(L.attr,y.clone(L.get_value()));return new this.constructor(A)}[u.equals](y,A){for(const L of this){const x=y.property(L.attr);if(!A.eq(L.get_value(),x.get_value()))return!1}return!0}[l.pretty](y){const A=y.token,L=[];for(const x of this)if(x.dirty){const H=x.get_value();L.push(`${x.attr}${A(":")} ${y.to_string(H)}`)}return`${this.constructor.__qualified__}${A("(")}${A("{")}${L.join(`${A(",")} `)}${A("}")}${A(")")}`}[s.serialize](y){const A=this.ref();y.add_ref(this,A);const L=this.struct();for(const x of this)x.syncable&&(y.include_defaults||x.dirty)&&(L.attributes[x.attr]=y.to_serializable(x.get_value()));return y.add_def(this,L),A}finalize(){for(const y of this){if(!(y instanceof T.VectorSpec||y instanceof T.ScalarSpec))continue;const A=y.get_value();if(A!=null){const{transform:L,expr:x}=A;L!=null&&this.connect(L.change,()=>this.transformchange.emit()),x!=null&&this.connect(x.change,()=>this.exprchange.emit())}}this.initialize()}initialize(){}connect_signals(){}disconnect_signals(){g.Signal.disconnectReceiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return new d.Cloner().clone(this)}changed_for(y){const A=this._watchers.get(y);return this._watchers.set(y,!1),A==null||A}_setv(y,A){const L=A.check_eq,x=[],H=this._changing;this._changing=!0;for(const[S,k]of y)L!==!1&&(0,t.is_equal)(S.get_value(),k)||(S.set_value(k),x.push(S));x.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(const S of x)S.change.emit();if(!H){if(!A.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}setv(y,A={}){const L=(0,r.entries)(y);if(L.length==0)return;if(A.silent===!0){this._watchers=new WeakMap;for(const[k,E]of L)this.properties[k].set_value(E);return}const x=new Map,H=new Map;for(const[k,E]of L){const P=this.properties[k];x.set(P,E),H.set(P,P.get_value())}this._setv(x,A);const{document:S}=this;if(S!=null){const k=[];for(const[E,P]of H)k.push([E,P,E.get_value()]);for(const[,E,P]of k)if(this._needs_invalidate(E,P)){S._invalidate_all_models();break}this._push_changes(k,A)}}getv(y){return this.property(y).get_value()}ref(){return{id:this.id}}struct(){const y={type:this.type,id:this.id,attributes:{}};return this._subtype!=null&&(y.subtype=this._subtype),y}set_subtype(y){this._subtype=y}*[Symbol.iterator](){yield*(0,r.values)(this.properties)}*syncable_properties(){for(const y of this)y.syncable&&(yield y)}serializable_attributes(){const y={};for(const A of this.syncable_properties())y[A.attr]=A.get_value();return y}static _json_record_references(y,A,L,x){const{recursive:H}=x;if((0,p.is_ref)(A)){const S=y.get_model_by_id(A.id);S==null||L.has(S)||f._value_record_references(S,L,{recursive:H})}else if((0,i.isArray)(A))for(const S of A)f._json_record_references(y,S,L,{recursive:H});else if((0,i.isPlainObject)(A))for(const S of(0,r.values)(A))f._json_record_references(y,S,L,{recursive:H})}static _value_record_references(y,A,L){const{recursive:x}=L;if(y instanceof f){if(!A.has(y)&&(A.add(y),x))for(const H of y.syncable_properties()){const S=H.get_value();f._value_record_references(S,A,{recursive:x})}}else if((0,i.isArray)(y))for(const H of y)f._value_record_references(H,A,{recursive:x});else if((0,i.isPlainObject)(y))for(const H of(0,r.values)(y))f._value_record_references(H,A,{recursive:x})}references(){const y=new Set;return f._value_record_references(this,y,{recursive:!0}),y}_doc_attached(){}_doc_detached(){}attach_document(y){if(this.document!=null&&this.document!=y)throw new Error("models must be owned by only a single document");this.document=y,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(y,A){const L=new Set;f._value_record_references(A,L,{recursive:!1});const x=new Set;f._value_record_references(y,x,{recursive:!1});for(const H of L)if(!x.has(H))return!0;for(const H of x)if(!L.has(H))return!0;return!1}_push_changes(y,A={}){if(!this.is_syncable)return;const{document:L}=this;if(L==null)return;const{setter_id:x}=A,H=[];for(const[S,k,E]of y)S.syncable&&H.push(new a.ModelChangedEvent(L,this,S.attr,k,E,x));if(H.length!=0){let S;H.length==1?[S]=H:S=new a.DocumentEventBatch(L,H,x),L._trigger_on_change(S)}}on_change(y,A){for(const L of(0,i.isArray)(y)?y:[y])this.connect(L.change,A)}}e.HasProps=f,(w=f).prototype._props={},w.prototype._mixins=[]},function(Q,O,e,C,R){C();const v=Q(16),w=Q(9);class g{constructor(s,a){this.sender=s,this.name=a}connect(s,a=null){T.has(this.sender)||T.set(this.sender,[]);const u=T.get(this.sender);if(o(u,this,s,a)!=null)return!1;const l=a??s;c.has(l)||c.set(l,[]);const d=c.get(l),m={signal:this,slot:s,context:a};return u.push(m),d.push(m),!0}disconnect(s,a=null){const u=T.get(this.sender);if(u==null||u.length===0)return!1;const l=o(u,this,s,a);if(l==null)return!1;const d=a??s,m=c.get(d);return l.signal=null,i(u),i(m),!0}emit(s){var a;const u=(a=T.get(this.sender))!==null&&a!==void 0?a:[];for(const{signal:l,slot:d,context:m}of u)l===this&&d.call(m,s,this.sender)}}e.Signal=g,g.__name__="Signal";class p extends g{emit(){super.emit(void 0)}}e.Signal0=p,p.__name__="Signal0",(function(t){function s(d,m){const f=T.get(d);if(f==null||f.length===0)return;const b=c.get(m);if(b!=null&&b.length!==0){for(const y of b){if(y.signal==null)return;y.signal.sender===d&&(y.signal=null)}i(f),i(b)}}function a(d){var m;const f=T.get(d);if(f!=null&&f.length!==0){for(const b of f){if(b.signal==null)return;const y=(m=b.context)!==null&&m!==void 0?m:b.slot;b.signal=null,i(c.get(y))}i(f)}}function u(d,m,f){const b=c.get(d);if(b!=null&&b.length!==0){for(const y of b){if(y.signal==null)return;if(m!=null&&y.slot!=m)continue;const A=y.signal.sender;f!=null&&f.has(A)||(y.signal=null,i(T.get(A)))}i(b)}}function l(d){const m=T.get(d);if(m!=null&&m.length!==0){for(const b of m)b.signal=null;i(m)}const f=c.get(d);if(f!=null&&f.length!==0){for(const b of f)b.signal=null;i(f)}}t.disconnect_between=s,t.disconnect_sender=a,t.disconnect_receiver=u,t.disconnect_all=l,t.disconnectBetween=s,t.disconnectSender=a,t.disconnectReceiver=u,t.disconnectAll=l})(g||(e.Signal=g={})),e.Signalable=function(){return class{connect(t,s){return t.connect(s,this)}disconnect(t,s){return t.disconnect(s,this)}}};const T=new WeakMap,c=new WeakMap;function o(t,s,a,u){return(0,w.find)(t,l=>l.signal===s&&l.slot===a&&l.context===u)}const r=new Set;function i(t){r.size===0&&(async()=>(await(0,v.defer)(),(function(){for(const s of r)(0,w.remove_by)(s,a=>a.signal==null);r.clear()})()))(),r.add(t)}},function(Q,O,e,C,R){C();const v=new MessageChannel,w=new Map;v.port1.onmessage=p=>{const T=p.data,c=w.get(T);if(c!=null)try{c()}finally{w.delete(T)}};let g=1;e.defer=function(){return new Promise(p=>{const T=g++;w.set(T,p),v.port2.postMessage(T)})},e.wait=function(p){return new Promise(T=>setTimeout(T,p))}},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13);e.is_ref=function(g){if((0,v.isPlainObject)(g)){const p=(0,w.keys)(g);return p.length==1&&p[0]=="id"}return!1}},function(Q,O,e,C,R){C(),e.YCoordinateSeqSeqSeqSpec=e.XCoordinateSeqSeqSeqSpec=e.YCoordinateSeqSpec=e.XCoordinateSeqSpec=e.YCoordinateSpec=e.XCoordinateSpec=e.CoordinateSeqSeqSeqSpec=e.CoordinateSeqSpec=e.CoordinateSpec=e.BaseCoordinateSpec=e.NumberUnitsSpec=e.UnitsSpec=e.DataSpec=e.VectorSpec=e.TextBaselineScalar=e.TextAlignScalar=e.FontStyleScalar=e.FontSizeScalar=e.FontScalar=e.LineDashScalar=e.LineCapScalar=e.LineJoinScalar=e.ArrayScalar=e.NullStringScalar=e.StringScalar=e.NumberScalar=e.ColorScalar=e.AnyScalar=e.ScalarSpec=e.VerticalAlign=e.UpdateMode=e.TooltipAttachment=e.TickLabelOrientation=e.TextureRepetition=e.TextBaseline=e.TextAlign=e.TapBehavior=e.StepMode=e.StartEnd=e.SpatialUnits=e.Sort=e.SizingMode=e.Side=e.RoundingFunction=e.ResetPolicy=e.RenderMode=e.RenderLevel=e.RadiusDimension=e.PointPolicy=e.Place=void 0,e.TextBaselineSpec=e.TextAlignSpec=e.FontStyleSpec=e.FontSizeSpec=e.FontSpec=e.LineDashSpec=e.LineCapSpec=e.LineJoinSpec=e.MarkerSpec=e.ArraySpec=e.NullStringSpec=e.StringSpec=e.AnySpec=e.NDArraySpec=e.ColorSpec=e.ScreenSizeSpec=e.NumberSpec=e.IntSpec=e.BooleanSpec=e.NullDistanceSpec=e.DistanceSpec=e.AngleSpec=void 0;const v=Q(1),w=Q(15),g=Q(19),p=(0,v.__importStar)(Q(20)),T=Q(24),c=Q(9),o=Q(12),r=Q(10),i=Q(22),t=Q(27),s=Q(8),a=Q(28),u=Q(29),l=Q(33);function d(se){try{return JSON.stringify(se)}catch{return se.toString()}}function m(se){return(0,s.isPlainObject)(se)&&(se.value===void 0?0:1)+(se.field===void 0?0:1)+(se.expr===void 0?0:1)==1}R("Uniform",l.Uniform),R("UniformScalar",l.UniformScalar),R("UniformVector",l.UniformVector),e.isSpec=m;class f{constructor(ne,J,re,Qe,Le,Re={}){var ct;let Y;if(this.obj=ne,this.attr=J,this.kind=re,this.default_value=Qe,this._dirty=!1,this.change=new w.Signal0(this.obj,"change"),this.internal=(ct=Re.internal)!==null&&ct!==void 0&&ct,this.convert=Re.convert,this.on_update=Re.on_update,Le!==void 0)Y=Le,this._dirty=!0;else{const de=this._default_override();if(de!==void 0)Y=de;else{if(Qe===void 0)return void(this.spec={value:null});Y=Qe(ne)}}this._update(Y)}get is_value(){return this.spec.value!==void 0}get syncable(){return!this.internal}get_value(){return this.spec.value}set_value(ne){this._update(ne),this._dirty=!0}_default_override(){}get dirty(){return this._dirty}_update(ne){var J;if(this.validate(ne),this.convert!=null){const re=this.convert(ne);re!==void 0&&(ne=re)}this.spec={value:ne},(J=this.on_update)===null||J===void 0||J.call(this,ne,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, spec: ${d(this.spec)})`}normalize(ne){return ne}validate(ne){if(!this.valid(ne))throw new Error(`${this.obj}.${this.attr} given invalid value: ${d(ne)}`)}valid(ne){return this.kind.valid(ne)}_value(ne=!0){if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");let J=this.normalize([this.spec.value])[0];return this.spec.transform!=null&&ne&&(J=this.spec.transform.compute(J)),J}}e.Property=f,f.__name__="Property";class b{constructor(ne){this.attr=ne}}e.PropertyAlias=b,b.__name__="PropertyAlias",e.Alias=function(se){return new b(se)};class y extends f{}e.PrimitiveProperty=y,y.__name__="PrimitiveProperty";class A extends f{}e.Any=A,A.__name__="Any";class L extends f{valid(ne){return(0,s.isArray)(ne)||(0,s.isTypedArray)(ne)}}e.Array=L,L.__name__="Array";class x extends f{valid(ne){return(0,s.isBoolean)(ne)}}e.Boolean=x,x.__name__="Boolean";class H extends f{valid(ne){return(0,i.is_Color)(ne)}}e.Color=H,H.__name__="Color";class S extends f{}e.Instance=S,S.__name__="Instance";class k extends f{valid(ne){return(0,s.isNumber)(ne)}}e.Number=k,k.__name__="Number";class E extends k{valid(ne){return(0,s.isNumber)(ne)&&(0|ne)==ne}}e.Int=E,E.__name__="Int";class P extends k{}e.Angle=P,P.__name__="Angle";class N extends k{valid(ne){return(0,s.isNumber)(ne)&&0<=ne&&ne<=1}}e.Percent=N,N.__name__="Percent";class B extends f{valid(ne){return(0,s.isString)(ne)}}e.String=B,B.__name__="String";class D extends f{valid(ne){return ne===null||(0,s.isString)(ne)}}e.NullString=D,D.__name__="NullString";class j extends B{}e.FontSize=j,j.__name__="FontSize";class M extends B{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.Font=M,M.__name__="Font";class F extends f{valid(ne){return(0,s.isString)(ne)&&(0,c.includes)(this.enum_values,ne)}}function W(se){return class extends F{get enum_values(){return[...se]}}}e.EnumProperty=F,F.__name__="EnumProperty",e.Enum=W;class U extends F{get enum_values(){return[...p.Direction]}normalize(ne){const J=new Uint8Array(ne.length);for(let re=0;re<ne.length;re++)switch(ne[re]){case"clock":J[re]=0;break;case"anticlock":J[re]=1}return J}}e.Direction=U,U.__name__="Direction",e.Anchor=W(p.Anchor),e.AngleUnits=W(p.AngleUnits),e.BoxOrigin=W(p.BoxOrigin),e.ButtonType=W(p.ButtonType),e.CalendarPosition=W(p.CalendarPosition),e.Dimension=W(p.Dimension),e.Dimensions=W(p.Dimensions),e.Distribution=W(p.Distribution),e.FontStyle=W(p.FontStyle),e.HatchPatternType=W(p.HatchPatternType),e.HTTPMethod=W(p.HTTPMethod),e.HexTileOrientation=W(p.HexTileOrientation),e.HoverMode=W(p.HoverMode),e.LatLon=W(p.LatLon),e.LegendClickPolicy=W(p.LegendClickPolicy),e.LegendLocation=W(p.LegendLocation),e.LineCap=W(p.LineCap),e.LineJoin=W(p.LineJoin),e.LinePolicy=W(p.LinePolicy),e.Location=W(p.Location),e.Logo=W(p.Logo),e.MarkerType=W(p.MarkerType),e.MutedPolicy=W(p.MutedPolicy),e.Orientation=W(p.Orientation),e.OutputBackend=W(p.OutputBackend),e.PaddingUnits=W(p.PaddingUnits),e.Place=W(p.Place),e.PointPolicy=W(p.PointPolicy),e.RadiusDimension=W(p.RadiusDimension),e.RenderLevel=W(p.RenderLevel),e.RenderMode=W(p.RenderMode),e.ResetPolicy=W(p.ResetPolicy),e.RoundingFunction=W(p.RoundingFunction),e.Side=W(p.Side),e.SizingMode=W(p.SizingMode),e.Sort=W(p.Sort),e.SpatialUnits=W(p.SpatialUnits),e.StartEnd=W(p.StartEnd),e.StepMode=W(p.StepMode),e.TapBehavior=W(p.TapBehavior),e.TextAlign=W(p.TextAlign),e.TextBaseline=W(p.TextBaseline),e.TextureRepetition=W(p.TextureRepetition),e.TickLabelOrientation=W(p.TickLabelOrientation),e.TooltipAttachment=W(p.TooltipAttachment),e.UpdateMode=W(p.UpdateMode),e.VerticalAlign=W(p.VerticalAlign);class q extends f{get_value(){const{value:ne,expr:J,transform:re}=this.spec;return J!=null||re!=null?this.spec:ne}_update(ne){m(ne)?this.spec=ne:this.spec={value:ne},this.spec.value!=null&&this.validate(this.spec.value)}materialize(ne){return ne}scalar(ne,J){return new l.UniformScalar(ne,J)}uniform(ne){var J;const{expr:re,value:Qe,transform:Le}=this.spec,Re=(J=ne.get_length())!==null&&J!==void 0?J:1;if(re!=null){let ct=re.compute(ne);return Le!=null&&(ct=Le.compute(ct)),ct=this.materialize(ct),this.scalar(ct,Re)}{let ct=Qe;return Le!=null&&(ct=Le.compute(ct)),ct=this.materialize(ct),this.scalar(ct,Re)}}}e.ScalarSpec=q,q.__name__="ScalarSpec";class X extends q{}e.AnyScalar=X,X.__name__="AnyScalar";class ae extends q{}e.ColorScalar=ae,ae.__name__="ColorScalar";class me extends q{}e.NumberScalar=me,me.__name__="NumberScalar";class Ve extends q{}e.StringScalar=Ve,Ve.__name__="StringScalar";class Je extends q{}e.NullStringScalar=Je,Je.__name__="NullStringScalar";class rt extends q{}e.ArrayScalar=rt,rt.__name__="ArrayScalar";class yt extends q{}e.LineJoinScalar=yt,yt.__name__="LineJoinScalar";class xt extends q{}e.LineCapScalar=xt,xt.__name__="LineCapScalar";class r1 extends q{}e.LineDashScalar=r1,r1.__name__="LineDashScalar";class t1 extends q{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.FontScalar=t1,t1.__name__="FontScalar";class Bt extends q{}e.FontSizeScalar=Bt,Bt.__name__="FontSizeScalar";class Kt extends q{}e.FontStyleScalar=Kt,Kt.__name__="FontStyleScalar";class wt extends q{}e.TextAlignScalar=wt,wt.__name__="TextAlignScalar";class Rt extends q{}e.TextBaselineScalar=Rt,Rt.__name__="TextBaselineScalar";class Ht extends f{get_value(){return this.spec.value===null?null:this.spec}_update(ne){m(ne)?this.spec=ne:this.spec={value:ne},this.spec.value!=null&&this.validate(this.spec.value)}materialize(ne){return ne}v_materialize(ne){return ne}scalar(ne,J){return new l.UniformScalar(ne,J)}vector(ne){return new l.UniformVector(ne)}uniform(ne){var J;const{field:re,expr:Qe,value:Le,transform:Re}=this.spec,ct=(J=ne.get_length())!==null&&J!==void 0?J:1;if(re!=null){let Y=ne.get_column(re);return Y!=null?(Re!=null&&(Y=Re.v_compute(Y)),Y=this.v_materialize(Y),this.vector(Y)):(g.logger.warn(`attempted to retrieve property array for nonexistent field '${re}'`),this.scalar(null,ct))}if(Qe!=null){let Y=Qe.v_compute(ne);return Re!=null&&(Y=Re.v_compute(Y)),Y=this.v_materialize(Y),this.vector(Y)}{let Y=Le;return Re!=null&&(Y=Re.compute(Y)),Y=this.materialize(Y),this.scalar(Y,ct)}}array(ne){var J;let re;const Qe=(J=ne.get_length())!==null&&J!==void 0?J:1;if(this.spec.field!=null){const Le=ne.get_column(this.spec.field);if(Le!=null)re=this.normalize(Le);else{g.logger.warn(`attempted to retrieve property array for nonexistent field '${this.spec.field}'`);const Re=new Float64Array(Qe);Re.fill(NaN),re=Re}}else if(this.spec.expr!=null)re=this.normalize(this.spec.expr.v_compute(ne));else{const Le=this._value(!1);if((0,s.isNumber)(Le)){const Re=new Float64Array(Qe);Re.fill(Le),re=Re}else re=(0,c.repeat)(Le,Qe)}return this.spec.transform!=null&&(re=this.spec.transform.v_compute(re)),re}}e.VectorSpec=Ht,Ht.__name__="VectorSpec";class dt extends Ht{}e.DataSpec=dt,dt.__name__="DataSpec";class Wt extends Ht{_update(ne){super._update(ne);const{units:J}=this.spec;if(J!=null&&!(0,c.includes)(this.valid_units,J))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${J}`)}get units(){var ne;return(ne=this.spec.units)!==null&&ne!==void 0?ne:this.default_units}set units(ne){ne!=this.default_units?this.spec.units=ne:delete this.spec.units}}e.UnitsSpec=Wt,Wt.__name__="UnitsSpec";class jt extends Wt{array(ne){return new Float64Array(super.array(ne))}}e.NumberUnitsSpec=jt,jt.__name__="NumberUnitsSpec";class a1 extends dt{}e.BaseCoordinateSpec=a1,a1.__name__="BaseCoordinateSpec";class ye extends a1{}e.CoordinateSpec=ye,ye.__name__="CoordinateSpec";class ie extends a1{}e.CoordinateSeqSpec=ie,ie.__name__="CoordinateSeqSpec";class nt extends a1{}e.CoordinateSeqSeqSeqSpec=nt,nt.__name__="CoordinateSeqSeqSeqSpec";class St extends ye{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSpec=St,St.__name__="XCoordinateSpec";class mt extends ye{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSpec=mt,mt.__name__="YCoordinateSpec";class Pt extends ie{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSeqSpec=Pt,Pt.__name__="XCoordinateSeqSpec";class Xt extends ie{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSeqSpec=Xt,Xt.__name__="YCoordinateSeqSpec";class u1 extends nt{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSeqSeqSeqSpec=u1,u1.__name__="XCoordinateSeqSeqSeqSpec";class v1 extends nt{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSeqSeqSeqSpec=v1,v1.__name__="YCoordinateSeqSeqSeqSpec";class h1 extends jt{get default_units(){return"rad"}get valid_units(){return[...p.AngleUnits]}materialize(ne){return ne*-(0,r.to_radians_coeff)(this.units)}v_materialize(ne){const J=-(0,r.to_radians_coeff)(this.units),re=new Float32Array(ne.length);return(0,o.mul)(ne,J,re),re}array(ne){throw new Error("not supported")}}e.AngleSpec=h1,h1.__name__="AngleSpec";class De extends jt{get default_units(){return"data"}get valid_units(){return[...p.SpatialUnits]}}e.DistanceSpec=De,De.__name__="DistanceSpec";class Ze extends De{materialize(ne){return ne??NaN}}e.NullDistanceSpec=Ze,Ze.__name__="NullDistanceSpec";class $e extends dt{v_materialize(ne){return new Uint8Array(ne)}array(ne){return new Uint8Array(super.array(ne))}}e.BooleanSpec=$e,$e.__name__="BooleanSpec";class Qt extends dt{v_materialize(ne){return(0,s.isTypedArray)(ne)?ne:new Int32Array(ne)}array(ne){return new Int32Array(super.array(ne))}}e.IntSpec=Qt,Qt.__name__="IntSpec";class It extends dt{v_materialize(ne){return(0,s.isTypedArray)(ne)?ne:new Float64Array(ne)}array(ne){return new Float64Array(super.array(ne))}}e.NumberSpec=It,It.__name__="NumberSpec";class Ut extends It{valid(ne){return(0,s.isNumber)(ne)&&ne>=0}}e.ScreenSizeSpec=Ut,Ut.__name__="ScreenSizeSpec";class Zt extends dt{materialize(ne){return(0,i.encode_rgba)((0,i.color2rgba)(ne))}v_materialize(ne){if(!(0,u.is_NDArray)(ne)){const J=ne.length,re=new T.RGBAArray(4*J);let Qe=0;for(const Le of ne){const[Re,ct,Y,de]=(0,i.color2rgba)(Le);re[Qe++]=Re,re[Qe++]=ct,re[Qe++]=Y,re[Qe++]=de}return new T.ColorArray(re.buffer)}if(ne.dtype=="uint32"&&ne.dimension==1)return(0,t.to_big_endian)(ne);if(ne.dtype=="uint8"&&ne.dimension==1){const[J]=ne.shape,re=new T.RGBAArray(4*J);let Qe=0;for(const Le of ne)re[Qe++]=Le,re[Qe++]=Le,re[Qe++]=Le,re[Qe++]=255;return new T.ColorArray(re.buffer)}if(ne.dtype=="uint8"&&ne.dimension==2){const[J,re]=ne.shape;if(re==4)return new T.ColorArray(ne.buffer);if(re==3){const Qe=new T.RGBAArray(4*J);for(let Le=0,Re=0;Le<re*J;)Qe[Re++]=ne[Le++],Qe[Re++]=ne[Le++],Qe[Re++]=ne[Le++],Qe[Re++]=255;return new T.ColorArray(Qe.buffer)}}else if((ne.dtype=="float32"||ne.dtype=="float64")&&ne.dimension==2){const[J,re]=ne.shape;if(re==3||re==4){const Qe=new T.RGBAArray(4*J);for(let Le=0,Re=0;Le<re*J;)Qe[Re++]=255*ne[Le++],Qe[Re++]=255*ne[Le++],Qe[Re++]=255*ne[Le++],Qe[Re++]=255*(re==3?1:ne[Le++]);return new T.ColorArray(Qe.buffer)}}throw new Error("invalid color array")}vector(ne){return new l.ColorUniformVector(ne)}}e.ColorSpec=Zt,Zt.__name__="ColorSpec";class b1 extends dt{}e.NDArraySpec=b1,b1.__name__="NDArraySpec";class k1 extends dt{}e.AnySpec=k1,k1.__name__="AnySpec";class A1 extends dt{}e.StringSpec=A1,A1.__name__="StringSpec";class W1 extends dt{}e.NullStringSpec=W1,W1.__name__="NullStringSpec";class S1 extends dt{}e.ArraySpec=S1,S1.__name__="ArraySpec";class Z1 extends dt{}e.MarkerSpec=Z1,Z1.__name__="MarkerSpec";class o2 extends dt{}e.LineJoinSpec=o2,o2.__name__="LineJoinSpec";class d2 extends dt{}e.LineCapSpec=d2,d2.__name__="LineCapSpec";class Q2 extends dt{}e.LineDashSpec=Q2,Q2.__name__="LineDashSpec";class w2 extends dt{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.FontSpec=w2,w2.__name__="FontSpec";class P2 extends dt{}e.FontSizeSpec=P2,P2.__name__="FontSizeSpec";class oe extends dt{}e.FontStyleSpec=oe,oe.__name__="FontStyleSpec";class K extends dt{}e.TextAlignSpec=K,K.__name__="TextAlignSpec";class ue extends dt{}e.TextBaselineSpec=ue,ue.__name__="TextBaselineSpec"},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13),g={};class p{constructor(i,t){this.name=i,this.level=t}}e.LogLevel=p,p.__name__="LogLevel";class T{constructor(i,t=T.INFO){this._name=i,this.set_level(t)}static get levels(){return Object.keys(T.log_levels)}static get(i,t=T.INFO){if(i.length>0){let s=g[i];return s==null&&(g[i]=s=new T(i,t)),s}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}get level(){return this.get_level()}get_level(){return this._log_level}set_level(i){if(i instanceof p)this._log_level=i;else{if(!(0,v.isString)(i)||T.log_levels[i]==null)throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=T.log_levels[i]}const t=`[${this._name}]`;for(const[s,a]of(0,w.entries)(T.log_levels))a.level<this._log_level.level||this._log_level.level===T.OFF.level?this[s]=function(){}:this[s]=c(s,t)}trace(...i){}debug(...i){}info(...i){}warn(...i){}error(...i){}}function c(r,i){return console[r]!=null?console[r].bind(console,i):console.log!=null?console.log.bind(console,i):function(){}}function o(r){const i=e.logger.level;return(0,v.isString)(r)&&T.log_levels[r]==null?(console.log(`[bokeh] unrecognized logging level '${r}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${T.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,v.isString)(r)?r:r.level}'`),e.logger.set_level(r)),i}e.Logger=T,T.__name__="Logger",T.TRACE=new p("trace",0),T.DEBUG=new p("debug",1),T.INFO=new p("info",2),T.WARN=new p("warn",6),T.ERROR=new p("error",7),T.FATAL=new p("fatal",8),T.OFF=new p("off",9),T.log_levels={trace:T.TRACE,debug:T.DEBUG,info:T.INFO,warn:T.WARN,error:T.ERROR,fatal:T.FATAL,off:T.OFF},e.logger=T.get("bokeh"),e.set_log_level=o,e.with_log_level=function(r,i){const t=o(r);try{i()}finally{o(t)}}},function(Q,O,e,C,R){C(),e.VerticalAlign=void 0;const v=Q(21);e.Align=(0,v.Enum)("start","center","end"),e.Anchor=(0,v.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),e.AngleUnits=(0,v.Enum)("deg","rad","grad","turn"),e.BoxOrigin=(0,v.Enum)("corner","center"),e.ButtonType=(0,v.Enum)("default","primary","success","warning","danger","light"),e.CalendarPosition=(0,v.Enum)("auto","above","below"),e.Dimension=(0,v.Enum)("width","height"),e.Dimensions=(0,v.Enum)("width","height","both"),e.Direction=(0,v.Enum)("clock","anticlock"),e.Distribution=(0,v.Enum)("uniform","normal"),e.FontStyle=(0,v.Enum)("normal","italic","bold","bold italic"),e.HatchPatternType=(0,v.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",">","*"),e.HTTPMethod=(0,v.Enum)("POST","GET"),e.HexTileOrientation=(0,v.Enum)("pointytop","flattop"),e.HoverMode=(0,v.Enum)("mouse","hline","vline"),e.LatLon=(0,v.Enum)("lat","lon"),e.LegendClickPolicy=(0,v.Enum)("none","hide","mute"),e.LegendLocation=e.Anchor,e.LineCap=(0,v.Enum)("butt","round","square"),e.LineJoin=(0,v.Enum)("miter","round","bevel"),e.LineDash=(0,v.Enum)("solid","dashed","dotted","dotdash","dashdot"),e.LinePolicy=(0,v.Enum)("prev","next","nearest","interp","none"),e.Location=(0,v.Enum)("above","below","left","right"),e.Logo=(0,v.Enum)("normal","grey"),e.MarkerType=(0,v.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"),e.MutedPolicy=(0,v.Enum)("show","ignore"),e.Orientation=(0,v.Enum)("vertical","horizontal"),e.OutputBackend=(0,v.Enum)("canvas","svg","webgl"),e.PaddingUnits=(0,v.Enum)("percent","absolute"),e.Place=(0,v.Enum)("above","below","left","right","center"),e.PointPolicy=(0,v.Enum)("snap_to_data","follow_mouse","none"),e.RadiusDimension=(0,v.Enum)("x","y","max","min"),e.RenderLevel=(0,v.Enum)("image","underlay","glyph","guide","annotation","overlay"),e.RenderMode=(0,v.Enum)("canvas","css"),e.ResetPolicy=(0,v.Enum)("standard","event_only"),e.RoundingFunction=(0,v.Enum)("round","nearest","floor","rounddown","ceil","roundup"),e.SelectionMode=(0,v.Enum)("replace","append","intersect","subtract"),e.Side=(0,v.Enum)("above","below","left","right"),e.SizingMode=(0,v.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),e.Sort=(0,v.Enum)("ascending","descending"),e.SpatialUnits=(0,v.Enum)("screen","data"),e.StartEnd=(0,v.Enum)("start","end"),e.StepMode=(0,v.Enum)("after","before","center"),e.TapBehavior=(0,v.Enum)("select","inspect"),e.TextAlign=(0,v.Enum)("left","right","center"),e.TextBaseline=(0,v.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),e.TextureRepetition=(0,v.Enum)("repeat","repeat_x","repeat_y","no_repeat"),e.TickLabelOrientation=(0,v.Enum)("vertical","horizontal","parallel","normal"),e.TooltipAttachment=(0,v.Enum)("horizontal","vertical","left","right","above","below"),e.UpdateMode=(0,v.Enum)("replace","append"),e.VerticalAlign=(0,v.Enum)("top","middle","bottom")},function(Q,O,e,C,R){C();const v=(0,Q(1).__importStar)(Q(8)),w=Q(22),g=Q(13),p=window.Map,{hasOwnProperty:T}=Object.prototype;class c{}e.Kind=c,c.__name__="Kind",(function(o){class r extends c{valid(j){return!0}}r.__name__="Any",o.Any=r;class i extends c{valid(j){return!0}}i.__name__="Unknown",o.Unknown=i;class t extends c{valid(j){return v.isBoolean(j)}}t.__name__="Boolean",o.Boolean=t;class s extends c{constructor(j){super(),this.obj_type=j}valid(j){return!0}}s.__name__="Ref",o.Ref=s;class a extends c{valid(j){return!0}}a.__name__="AnyRef",o.AnyRef=a;class u extends c{valid(j){return v.isNumber(j)}}u.__name__="Number",o.Number=u;class l extends u{valid(j){return super.valid(j)&&v.isInteger(j)}}l.__name__="Int",o.Int=l;class d extends u{valid(j){return super.valid(j)&&0<=j&&j<=1}}d.__name__="Percent",o.Percent=d;class m extends c{constructor(j){super(),this.types=j,this.types=j}valid(j){return this.types.some(M=>M.valid(j))}}m.__name__="Or",o.Or=m;class f extends c{constructor(j){super(),this.types=j,this.types=j}valid(j){if(!v.isArray(j))return!1;for(let M=0;M<this.types.length;M++){const F=this.types[M],W=j[M];if(!F.valid(W))return!1}return!0}}f.__name__="Tuple",o.Tuple=f;class b extends c{constructor(j){super(),this.struct_type=j}valid(j){if(!v.isPlainObject(j))return!1;const{struct_type:M}=this;if((0,g.size)(M)!=(0,g.size)(j))return!1;for(const F in M)if(T.call(M,F)){if(!T.call(j,F))return!1;const W=M[F],U=j[F];if(!W.valid(U))return!1}return!0}}b.__name__="Struct",o.Struct=b;class y extends c{valid(j){return v.isArray(j)||v.isTypedArray(j)}}y.__name__="Arrayable",o.Arrayable=y;class A extends c{constructor(j){super(),this.item_type=j}valid(j){return v.isArray(j)&&j.every(M=>this.item_type.valid(M))}}A.__name__="Array",o.Array=A;class L extends c{valid(j){return j===null}}L.__name__="Null",o.Null=L;class x extends c{constructor(j){super(),this.base_type=j}valid(j){return j===null||this.base_type.valid(j)}}x.__name__="Nullable",o.Nullable=x;class H extends c{constructor(j){super(),this.base_type=j}valid(j){return j===void 0||this.base_type.valid(j)}}H.__name__="Opt",o.Opt=H;class S extends c{valid(j){return v.isString(j)}}S.__name__="String",o.String=S;class k extends c{constructor(j){super(),this.values=new Set(j)}valid(j){return this.values.has(j)}*[Symbol.iterator](){yield*this.values}}k.__name__="Enum",o.Enum=k;class E extends c{constructor(j){super(),this.item_type=j}valid(j){if(!v.isPlainObject(j))return!1;for(const M in j)if(T.call(j,M)){const F=j[M];if(!this.item_type.valid(F))return!1}return!0}}E.__name__="Dict",o.Dict=E;class P extends c{constructor(j,M){super(),this.key_type=j,this.item_type=M}valid(j){if(!(j instanceof p))return!1;for(const[M,F]of j.entries())if(!this.key_type.valid(M)||!this.item_type.valid(F))return!1;return!0}}P.__name__="Map",o.Map=P;class N extends c{valid(j){return(0,w.is_Color)(j)}}N.__name__="Color",o.Color=N;class B extends c{valid(j){return v.isFunction(j)}}B.__name__="Function",o.Function=B})(e.Kinds||(e.Kinds={})),e.Any=new e.Kinds.Any,e.Unknown=new e.Kinds.Unknown,e.Boolean=new e.Kinds.Boolean,e.Number=new e.Kinds.Number,e.Int=new e.Kinds.Int,e.String=new e.Kinds.String,e.Null=new e.Kinds.Null,e.Nullable=o=>new e.Kinds.Nullable(o),e.Opt=o=>new e.Kinds.Opt(o),e.Or=(...o)=>new e.Kinds.Or(o),e.Tuple=(...o)=>new e.Kinds.Tuple(o),e.Struct=o=>new e.Kinds.Struct(o),e.Arrayable=new e.Kinds.Arrayable,e.Array=o=>new e.Kinds.Array(o),e.Dict=o=>new e.Kinds.Dict(o),e.Map=(o,r)=>new e.Kinds.Map(o,r),e.Enum=(...o)=>new e.Kinds.Enum(o),e.Ref=o=>new e.Kinds.Ref(o),e.AnyRef=()=>new e.Kinds.AnyRef,e.Function=()=>new e.Kinds.Function,e.Percent=new e.Kinds.Percent,e.Alpha=e.Percent,e.Color=new e.Kinds.Color,e.Auto=(0,e.Enum)("auto"),e.FontSize=e.String,e.Font=e.String,e.Angle=e.Number},function(Q,O,e,C,R){C();const v=Q(23),w=Q(10),g=Q(8),{round:p}=Math;function T(d){return(0,w.clamp)(p(d),0,255)}function c(){return[0,0,0,0]}function o(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]}function r(d,m){var f;let b,y,A,L;return d==null?[b,y,A,L]=[0,0,0,0]:(0,g.isInteger)(d)?[b,y,A,L]=o(d):(0,g.isString)(d)?[b,y,A,L]=(f=l(d))!==null&&f!==void 0?f:[0,0,0,0]:([b,y,A,L=1]=d,L=T(255*L)),L==255&&m!=null&&(L=T(255*m)),[b,y,A,L]}e.transparent=c,e.encode_rgba=function([d,m,f,b]){return d<<24|m<<16|f<<8|b},e.decode_rgba=o,e.compose_alpha=function(d,m){return(255&d)==255?4294967040&d|T(255*m):d},e.color2rgba=r;const i={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 t(d){return i[d>>4]+i[15&d]}e.color2css=function(d,m){const[f,b,y,A]=r(d,m);return`rgba(${f}, ${b}, ${y}, ${A/255})`},e.color2hex=function(d,m){const[f,b,y,A]=r(d,m),L=`#${t(f)}${t(b)}${t(y)}`;return A==255?L:`${L}${t(A)}`},e.color2hexrgb=function(d){const[m,f,b]=r(d);return`#${t(m)}${t(f)}${t(b)}`};const s=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,a=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,u=(()=>{const d=document.createElement("canvas");d.width=1,d.height=1;const m=d.getContext("2d"),f=m.createLinearGradient(0,0,1,1);return b=>{m.fillStyle=f,m.fillStyle=b;const y=m.fillStyle;return y!=f?y:null}})();function l(d){var m;if(!(d=d.trim().toLowerCase()))return null;if(d=="transparent")return[0,0,0,0];if((0,v.is_named_color)(d))return o(v.named_colors[d]);if(d[0]=="#"){const f=+`0x${d.substr(1)}`;if(isNaN(f))return null;switch(d.length-1){case 3:{const b=f>>8&15,y=f>>4&15,A=f>>0&15;return[b<<4|b,y<<4|y,A<<4|A,255]}case 4:{const b=f>>12&15,y=f>>8&15,A=f>>4&15,L=f>>0&15;return[b<<4|b,y<<4|y,A<<4|A,L<<4|L]}case 6:return[f>>16&255,f>>8&255,f>>0&255,255];case 8:return[f>>24&255,f>>16&255,f>>8&255,f>>0&255]}}else if(d.startsWith("rgb")){const f=(m=d.match(s))!==null&&m!==void 0?m:d.match(a);if(f!=null){let[,b,y,A,L="1"]=f;const x=b.endsWith("%"),H=y.endsWith("%"),S=A.endsWith("%"),k=L.endsWith("%");if(!(x&&H&&S)&&(x||H||S))return null;x&&(b=b.slice(0,-1)),H&&(y=y.slice(0,-1)),S&&(A=A.slice(0,-1)),k&&(L=L.slice(0,-1));let E=Number(b),P=Number(y),N=Number(A),B=Number(L);return isNaN(E+P+N+B)?null:(x&&(E=E/100*255),H&&(P=P/100*255),S&&(N=N/100*255),B=255*(k?B/100:B),E=T(E),P=T(P),N=T(N),B=T(B),[E,P,N,B])}}else{const f=u(d);if(f!=null)return l(f)}return null}e.css4_parse=l,e.is_Color=function(d){return!!(0,g.isInteger)(d)||!(!(0,g.isString)(d)||l(d)==null)||!(!(0,g.isArray)(d)||d.length!=3&&d.length!=4)},e.is_dark=function([d,m,f]){return 1-(.299*d+.587*m+.114*f)/255>=.6}},function(Q,O,e,C,R){C(),e.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},e.is_named_color=function(v){return v in e.named_colors}},function(Q,O,e,C,R){C(),e.GeneratorFunction=Object.getPrototypeOf(function*(){}).constructor,e.ColorArray=Uint32Array,e.RGBAArray=Uint8ClampedArray,e.infer_type=function(v,w){return v instanceof Float64Array||v instanceof Array||w instanceof Float64Array||w instanceof Array?Float64Array:Float32Array},e.ScreenArray=Float32Array,e.to_screen=function(v){return v instanceof Float32Array?v:Float32Array.from(v)},R("Indices",Q(25).BitSet)},function(Q,O,e,C,R){var v;C();const w=Q(26),g=Q(11);class p{constructor(c,o=0){this.size=c,this[v]="BitSet",this._count=null,this._nwords=Math.ceil(c/32),o==0||o==1?(this._array=new Uint32Array(this._nwords),o==1&&this._array.fill(4294967295)):((0,g.assert)(o.length==this._nwords,"Initializer size mismatch"),this._array=o)}clone(){return new p(this.size,new Uint32Array(this._array))}[(v=Symbol.toStringTag,w.equals)](c,o){if(!o.eq(this.size,c.size))return!1;const{_nwords:r}=this,i=this.size%r,t=i==0?r:r-1;for(let s=0;s<t;s++)if(this._array[s]!=c._array[s])return!1;if(i==0)return!0;{const s=1<<i-1,a=s-1^s;return(this._array[t]&a)==(c._array[t]&a)}}static all_set(c){return new p(c,1)}static all_unset(c){return new p(c,0)}static from_indices(c,o){const r=new p(c);for(const i of o)r.set(i);return r}static from_booleans(c,o){const r=new p(c),i=Math.min(c,o.length);for(let t=0;t<i;t++)o[t]&&r.set(t);return r}_check_bounds(c){(0,g.assert)(0<=c&&c<this.size,`Out of bounds: 0 <= ${c} < ${this.size}`)}get(c){this._check_bounds(c);const o=c>>>5,r=31&c;return!!(this._array[o]>>r&1)}set(c,o=!0){this._check_bounds(c),this._count=null;const r=c>>>5,i=31&c;o?this._array[r]|=1<<i:this._array[r]&=~(1<<i)}unset(c){this.set(c,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let c=this._count;return c==null&&(this._count=c=this._get_count()),c}_get_count(){const{_array:c,_nwords:o,size:r}=this;let i=0;for(let t=0,s=0;s<o;s++){const a=c[s];if(a==0)t+=32;else for(let u=0;u<32&&t<r;u++,t++)a>>>u&1&&(i+=1)}return i}*ones(){const{_array:c,_nwords:o,size:r}=this;for(let i=0,t=0;t<o;t++){const s=c[t];if(s!=0)for(let a=0;a<32&&i<r;a++,i++)s>>>a&1&&(yield i);else i+=32}}*zeros(){const{_array:c,_nwords:o,size:r}=this;for(let i=0,t=0;t<o;t++){const s=c[t];if(s!=4294967295)for(let a=0;a<32&&i<r;a++,i++)s>>>a&1||(yield i);else i+=32}}_check_size(c){(0,g.assert)(this.size==c.size,"Size mismatch")}add(c){this._check_size(c);for(let o=0;o<this._nwords;o++)this._array[o]|=c._array[o]}intersect(c){this._check_size(c);for(let o=0;o<this._nwords;o++)this._array[o]&=c._array[o]}subtract(c){this._check_size(c);for(let o=0;o<this._nwords;o++){const r=this._array[o],i=c._array[o];this._array[o]=(r^i)&r}}union(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++)o._array[r]|=c._array[r];return o}intersection(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++)o._array[r]&=c._array[r];return o}difference(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++){const i=this._array[r],t=c._array[r];o._array[r]=(i^t)&i}return o}select(c){(0,g.assert)(this.size<=c.length,"Size mismatch");const o=this.count,r=new c.constructor(o);let i=0;for(const t of this)r[i++]=c[t];return r}}e.BitSet=p,p.__name__="BitSet"},function(Q,O,e,C,R){C();const v=Q(8),{hasOwnProperty:w}=Object.prototype;function g(i){return(0,v.isObject)(i)&&i[e.equals]!==void 0}e.equals=Symbol("equals"),e.wildcard=Symbol("wildcard");const p=Object.prototype.toString;class T{constructor(){this.a_stack=[],this.b_stack=[]}eq(t,s){if(Object.is(t,s)||t===e.wildcard||s===e.wildcard)return!0;if(t==null||s==null)return t===s;const a=p.call(t);if(a!=p.call(s))return!1;switch(a){case"[object Number]":return this.numbers(t,s);case"[object RegExp]":case"[object String]":return`${t}`==`${s}`;case"[object Date]":case"[object Boolean]":return+t==+s}const{a_stack:u,b_stack:l}=this;let d=u.length;for(;d--;)if(u[d]===t)return l[d]===s;u.push(t),l.push(s);const m=(()=>{if(g(t)&&g(s))return t[e.equals](s,this);switch(a){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,s);case"[object Map]":return this.maps(t,s);case"[object Set]":return this.sets(t,s);case"[object Object]":if(t.constructor==s.constructor&&(t.constructor==null||t.constructor===Object))return this.objects(t,s);case"[object Function]":if(t.constructor==s.constructor&&t.constructor===Function)return this.eq(`${t}`,`${s}`)}if(t instanceof Node)return this.nodes(t,s);throw Error(`can't compare objects of type ${a}`)})();return u.pop(),l.pop(),m}numbers(t,s){return Object.is(t,s)}arrays(t,s){const{length:a}=t;if(a!=s.length)return!1;for(let u=0;u<a;u++)if(!this.eq(t[u],s[u]))return!1;return!0}iterables(t,s){const a=t[Symbol.iterator](),u=s[Symbol.iterator]();for(;;){const l=a.next(),d=u.next();if(l.done&&d.done)return!0;if(l.done||d.done||!this.eq(l.value,d.value))return!1}}maps(t,s){if(t.size!=s.size)return!1;for(const[a,u]of t)if(!s.has(a)||!this.eq(u,s.get(a)))return!1;return!0}sets(t,s){if(t.size!=s.size)return!1;for(const a of t)if(!s.has(a))return!1;return!0}objects(t,s){const a=Object.keys(t);if(a.length!=Object.keys(s).length)return!1;for(const u of a)if(!w.call(s,u)||!this.eq(t[u],s[u]))return!1;return!0}nodes(t,s){return t.nodeType==s.nodeType&&t.textContent==s.textContent&&!!this.iterables(t.childNodes,s.childNodes)}}e.Comparator=T,T.__name__="Comparator";const{abs:c}=Math;class o extends T{constructor(t=1e-4){super(),this.tolerance=t}numbers(t,s){return super.numbers(t,s)||c(t-s)<this.tolerance}}function r(i,t){return new T().eq(i,t)}e.SimilarComparator=o,o.__name__="SimilarComparator",e.is_equal=r,e.is_similar=function(i,t,s){return new o(s).eq(i,t)},e.isEqual=r},function(Q,O,e,C,R){C(),e.is_windows=navigator.appVersion.includes("Windows"),e.is_ie=(()=>{const v=navigator.userAgent;return v.includes("MSIE")||v.includes("Trident")||v.includes("Edge")})(),e.is_mobile=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),e.is_little_endian=(()=>{const v=new ArrayBuffer(4),w=new Uint8Array(v);new Uint32Array(v)[1]=168496141;let g=!0;return w[4]==10&&w[5]==11&&w[6]==12&&w[7]==13&&(g=!1),g})(),e.BYTE_ORDER=e.is_little_endian?"little":"big",e.to_big_endian=function(v){if(e.is_little_endian){const w=new Uint32Array(v.length),g=new DataView(w.buffer);let p=0;for(const T of v)g.setUint32(p,T),p+=4;return w}return v}},function(V,Q,O,e,C){e();class R{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(w){this._dev=w}get dev(){return this._dev}set wireframe(w){this._wireframe=w}get wireframe(){return this._wireframe}set force_webgl(w){this._force_webgl=w}get force_webgl(){return this._force_webgl}}O.Settings=R,R.__name__="Settings",O.settings=new R},function(Q,O,e,C,R){var v,w,g,p,T,c,o,r;C();const i=Q(8),t=Q(11),s=Q(26),a=Q(30),u=Q(31),l=Symbol("__ndarray__");class d extends Uint8Array{constructor(k,E){super(k),this[v]=!0,this.dtype="uint8",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>d.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>d.prototype[a.serialize].call(this,P))}[(v=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint8NDArray=d,d.__name__="Uint8NDArray";class m extends Int8Array{constructor(k,E){super(k),this[w]=!0,this.dtype="int8",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>m.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>m.prototype[a.serialize].call(this,P))}[(w=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int8NDArray=m,m.__name__="Int8NDArray";class f extends Uint16Array{constructor(k,E){super(k),this[g]=!0,this.dtype="uint16",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>f.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>f.prototype[a.serialize].call(this,P))}[(g=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint16NDArray=f,f.__name__="Uint16NDArray";class b extends Int16Array{constructor(k,E){super(k),this[p]=!0,this.dtype="int16",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>b.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>b.prototype[a.serialize].call(this,P))}[(p=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int16NDArray=b,b.__name__="Int16NDArray";class y extends Uint32Array{constructor(k,E){super(k),this[T]=!0,this.dtype="uint32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>y.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>y.prototype[a.serialize].call(this,P))}[(T=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint32NDArray=y,y.__name__="Uint32NDArray";class A extends Int32Array{constructor(k,E){super(k),this[c]=!0,this.dtype="int32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>A.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>A.prototype[a.serialize].call(this,P))}[(c=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int32NDArray=A,A.__name__="Int32NDArray";class L extends Float32Array{constructor(k,E){super(k),this[o]=!0,this.dtype="float32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>L.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>L.prototype[a.serialize].call(this,P))}[(o=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Float32NDArray=L,L.__name__="Float32NDArray";class x extends Float64Array{constructor(k,E){super(k),this[r]=!0,this.dtype="float64",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>x.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>x.prototype[a.serialize].call(this,P))}[(r=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}function H(S){return(0,i.isObject)(S)&&S[l]!==void 0}e.Float64NDArray=x,x.__name__="Float64NDArray",e.is_NDArray=H,e.ndarray=function(S,k={}){let{dtype:E}=k;E==null&&(E=S instanceof ArrayBuffer||(0,i.isArray)(S)?"float64":(()=>{switch(!0){case S instanceof Uint8Array:return"uint8";case S instanceof Int8Array:return"int8";case S instanceof Uint16Array:return"uint16";case S instanceof Int16Array:return"int16";case S instanceof Uint32Array:return"uint32";case S instanceof Int32Array:return"int32";case S instanceof Float32Array:return"float32";case S instanceof Float64Array:return"float64";default:(0,t.unreachable)()}})());const{shape:P}=k;switch(E){case"uint8":return new d(S,P);case"int8":return new m(S,P);case"uint16":return new f(S,P);case"int16":return new b(S,P);case"uint32":return new y(S,P);case"int32":return new A(S,P);case"float32":return new L(S,P);case"float64":return new x(S,P)}}},function(Q,O,e,C,R){C();const v=Q(11),w=Q(13),g=Q(8);e.serialize=Symbol("serialize");class p extends Error{}e.SerializationError=p,p.__name__="SerializationError";class T{constructor(o){var r;this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=(r=o?.include_defaults)===null||r===void 0||r}get_ref(o){return this._references.get(o)}add_ref(o,r){(0,v.assert)(!this._references.has(o)),this._references.set(o,r)}add_def(o,r){const i=this.get_ref(o);(0,v.assert)(i!=null),this._definitions.set(o,r),this._refmap.set(i,r)}get objects(){return new Set(this._references.keys())}get references(){return new Set(this._references.values())}get definitions(){return new Set(this._definitions.values())}resolve_ref(o){return this._refmap.get(o)}remove_ref(o){return this._references.delete(o)}remove_def(o){return this._definitions.delete(o)}to_serializable(o){const r=this.get_ref(o);if(r!=null)return r;if((function(i){return(0,g.isObject)(i)&&i[e.serialize]!==void 0})(o))return o[e.serialize](this);if((0,g.isArray)(o)||(0,g.isTypedArray)(o)){const i=o.length,t=new Array(i);for(let s=0;s<i;s++){const a=o[s];t[s]=this.to_serializable(a)}return t}if((0,g.isPlainObject)(o)){const i={};for(const[t,s]of(0,w.entries)(o))i[t]=this.to_serializable(s);return i}if(o===null||(0,g.isBoolean)(o)||(0,g.isNumber)(o)||(0,g.isString)(o))return o;throw new p(`${Object.prototype.toString.call(o)} is not serializable`)}}e.Serializer=T,T.__name__="Serializer"},function(V,Q,O,e,C){e();const R=V(8),v=V(27),w=V(32);O.is_NDArray_ref=function(g){return(0,R.isPlainObject)(g)&&("__buffer__"in g||"__ndarray__"in g)},O.decode_NDArray=function(g,p){const{shape:T,dtype:c,order:o}=g;let r;if("__buffer__"in g){const i=p.get(g.__buffer__);if(i==null)throw new Error(`buffer for ${g.__buffer__} not found`);r=i}else r=(0,w.base64_to_buffer)(g.__ndarray__);return o!==v.BYTE_ORDER&&(0,w.swap)(r,c),{buffer:r,dtype:c,shape:T}},O.encode_NDArray=function(g,p){const T={order:v.BYTE_ORDER,dtype:g.dtype,shape:g.shape};if(p!=null){const c=`${p.size}`;return p.set(c,g.buffer),Object.assign({__buffer__:c},T)}return Object.assign({__ndarray__:{toJSON:()=>(0,w.buffer_to_base64)(g.buffer)}},T)}},function(Q,O,e,C,R){C(),e.buffer_to_base64=function(v){const w=new Uint8Array(v),g=Array.from(w).map(p=>String.fromCharCode(p));return btoa(g.join(""))},e.base64_to_buffer=function(v){const w=atob(v),g=w.length,p=new Uint8Array(g);for(let T=0,c=g;T<c;T++)p[T]=w.charCodeAt(T);return p.buffer},e.swap=function(v,w){switch(w){case"uint16":case"int16":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=2){const o=p[T];p[T]=p[T+1],p[T+1]=o}})(v);break;case"uint32":case"int32":case"float32":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=4){let o=p[T];p[T]=p[T+3],p[T+3]=o,o=p[T+1],p[T+1]=p[T+2],p[T+2]=o}})(v);break;case"float64":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=8){let o=p[T];p[T]=p[T+7],p[T+7]=o,o=p[T+1],p[T+1]=p[T+6],p[T+6]=o,o=p[T+2],p[T+2]=p[T+5],p[T+5]=o,o=p[T+3],p[T+3]=p[T+4],p[T+4]=o}})(v)}}},function(Q,O,e,C,R){C();const v=Q(26);class w{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}e.Uniform=w,w.__name__="Uniform";class g extends w{constructor(o,r){super(),this.value=o,this.length=r,this.is_scalar=!0}get(o){return this.value}*[Symbol.iterator](){const{length:o,value:r}=this;for(let i=0;i<o;i++)yield r}select(o){return new g(this.value,o.count)}[v.equals](o,r){return r.eq(this.length,o.length)&&r.eq(this.value,o.value)}}e.UniformScalar=g,g.__name__="UniformScalar";class p extends w{constructor(o){super(),this.array=o,this.is_scalar=!1,this.length=this.array.length}get(o){return this.array[o]}*[Symbol.iterator](){yield*this.array}select(o){const r=o.select(this.array);return new this.constructor(r)}[v.equals](o,r){return r.eq(this.length,o.length)&&r.eq(this.array,o.array)}}e.UniformVector=p,p.__name__="UniformVector";class T extends p{constructor(o){super(o),this.array=o,this._view=new DataView(o.buffer)}get(o){return this._view.getUint32(4*o)}*[Symbol.iterator](){const o=this.length;for(let r=0;r<o;r++)yield this.get(r)}}e.ColorUniformVector=T,T.__name__="ColorUniformVector"},function(Q,O,e,C,R){C();const v=Q(28);function w(){const p=new Array(32),T="0123456789ABCDEF";for(let c=0;c<32;c++)p[c]=T.substr(Math.floor(16*Math.random()),1);return p[12]="4",p[16]=T.substr(3&p[16].charCodeAt(0)|8,1),p.join("")}e.startsWith=function(p,T,c=0){return p.substr(c,T.length)==T},e.uuid4=w;let g=1e3;e.uniqueId=function(p){const T=v.settings.dev?"j"+g++:w();return p!=null?`${p}-${T}`:T},e.escape=function(p){return p.replace(/(?:[&<>"'`])/g,T=>{switch(T){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return T}})},e.unescape=function(p){return p.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,(T,c)=>{switch(c){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return c}})},e.use_strict=function(p){return`'use strict';
1
+ import{r as reactExports,j as jsxRuntimeExports}from"./index-k4Zz_A0O.js";const main=(function(V,Q,O,e){O===void 0&&(O={}),e===void 0&&(e={});const C={},R=function(g){if(typeof g=="number")return g;if(g==="bokehjs")return Q;if(!e[g]){const o="@bokehjs/";g.slice(0,o.length)===o&&(g=g.slice(o.length))}const p=O[g];if(p!=null)return p;const T=g.length>0&&g[g.lenght-1]==="/",c=O[g+(T?"":"/")+"index"];return c??g},v=function(g){let p=C[g];if(!p){const T=R(g);if(p=C[T],p)C[g]=p;else{let c=function(){Object.defineProperty(p.exports,"__esModule",{value:!0})},o=function(r,i){Object.defineProperty(p.exports,r,{enumerable:!0,get:function(){return i}})};if(!V[T]){if(e[T]===!1||e[T]==!0&&parent_require)try{return p={exports:e[T]?parent_require(T):{}},C[T]=C[g]=p,p.exports}catch{}const r=new Error("Cannot find module '"+g+"'");throw r.code="MODULE_NOT_FOUND",r}p={exports:{}},C[T]=C[g]=p,V[T].call(p.exports,v,p,p.exports,c,o)}}return p.exports};v.resolve=function(g){return""};const w=v(Q);return w.require=v,typeof Proxy<"u"&&(w.loader=new Proxy({},{get:function(g,p){return v(p)}})),w.register_plugin=function(g,p,T,c){T===void 0&&(T={}),c===void 0&&(c={});for(let r in g)V[r]=g[r];for(let r in T)O[r]=T[r];for(let r in c)e[r]=c[r];const o=v(p);for(let r in o)w[r]=o[r];return o},w})([function(V,Q,O,e,C){e(),(0,V(1).__exportStar)(V(2),O)},function(Q,O,e,C,R){C();var v=function(c,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[t]=i[t])},v(c,o)};e.__extends=function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=c}v(c,o),c.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)};function w(c){var o=typeof Symbol=="function"&&Symbol.iterator,r=o&&c[o],i=0;if(r)return r.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&i>=c.length&&(c=void 0),{value:c&&c[i++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(c,o){var r=typeof Symbol=="function"&&c[Symbol.iterator];if(!r)return c;var i,t,s=r.call(c),a=[];try{for(;(o===void 0||o-- >0)&&!(i=s.next()).done;)a.push(i.value)}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function p(c){return this instanceof p?(this.v=c,this):new p(c)}e.__assign=function(){return e.__assign=Object.assign||function(c){for(var o,r=1,i=arguments.length;r<i;r++)for(var t in o=arguments[r])Object.prototype.hasOwnProperty.call(o,t)&&(c[t]=o[t]);return c},e.__assign.apply(this,arguments)},e.__rest=function(c,o){var r={};for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&o.indexOf(i)<0&&(r[i]=c[i]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var t=0;for(i=Object.getOwnPropertySymbols(c);t<i.length;t++)o.indexOf(i[t])<0&&Object.prototype.propertyIsEnumerable.call(c,i[t])&&(r[i[t]]=c[i[t]])}return r},e.__decorate=function(c,o,r,i){var t,s=arguments.length,a=s<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(c,o,r,i);else for(var u=c.length-1;u>=0;u--)(t=c[u])&&(a=(s<3?t(a):s>3?t(o,r,a):t(o,r))||a);return s>3&&a&&Object.defineProperty(o,r,a),a},e.__param=function(c,o){return function(r,i){o(r,i,c)}},e.__metadata=function(c,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(c,o)},e.__awaiter=function(c,o,r,i){return new(r||(r=Promise))(function(t,s){function a(d){try{l(i.next(d))}catch(m){s(m)}}function u(d){try{l(i.throw(d))}catch(m){s(m)}}function l(d){var m;d.done?t(d.value):(m=d.value,m instanceof r?m:new r(function(f){f(m)})).then(a,u)}l((i=i.apply(c,o||[])).next())})},e.__generator=function(c,o){var r,i,t,s,a={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(l){return function(d){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(t=2&m[0]?i.return:m[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,m[1])).done)return t;switch(i=0,t&&(m=[2&m[0],t.value]),m[0]){case 0:case 1:t=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,i=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(t=a.trys,!((t=t.length>0&&t[t.length-1])||m[0]!==6&&m[0]!==2)){a=0;continue}if(m[0]===3&&(!t||m[1]>t[0]&&m[1]<t[3])){a.label=m[1];break}if(m[0]===6&&a.label<t[1]){a.label=t[1],t=m;break}if(t&&a.label<t[2]){a.label=t[2],a.ops.push(m);break}t[2]&&a.ops.pop(),a.trys.pop();continue}m=o.call(c,a)}catch(f){m=[6,f],i=0}finally{r=t=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,d])}}},e.__createBinding=Object.create?function(c,o,r,i){i===void 0&&(i=r),Object.defineProperty(c,i,{enumerable:!0,get:function(){return o[r]}})}:function(c,o,r,i){i===void 0&&(i=r),c[i]=o[r]},e.__exportStar=function(c,o){for(var r in c)r==="default"||Object.prototype.hasOwnProperty.call(o,r)||(0,e.__createBinding)(o,c,r)},e.__values=w,e.__read=g,e.__spread=function(){for(var c=[],o=0;o<arguments.length;o++)c=c.concat(g(arguments[o]));return c},e.__spreadArrays=function(){for(var c=0,o=0,r=arguments.length;o<r;o++)c+=arguments[o].length;var i=Array(c),t=0;for(o=0;o<r;o++)for(var s=arguments[o],a=0,u=s.length;a<u;a++,t++)i[t]=s[a];return i},e.__spreadArray=function(c,o,r){if(r||arguments.length===2)for(var i,t=0,s=o.length;t<s;t++)!i&&t in o||(i||(i=Array.prototype.slice.call(o,0,t)),i[t]=o[t]);return c.concat(i||Array.prototype.slice.call(o))},e.__await=p,e.__asyncGenerator=function(c,o,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,t=r.apply(c,o||[]),s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(f){t[f]&&(i[f]=function(b){return new Promise(function(y,A){s.push([f,b,y,A])>1||u(f,b)})})}function u(f,b){try{(y=t[f](b)).value instanceof p?Promise.resolve(y.value.v).then(l,d):m(s[0][2],y)}catch(A){m(s[0][3],A)}var y}function l(f){u("next",f)}function d(f){u("throw",f)}function m(f,b){f(b),s.shift(),s.length&&u(s[0][0],s[0][1])}},e.__asyncDelegator=function(c){var o,r;return o={},i("next"),i("throw",function(t){throw t}),i("return"),o[Symbol.iterator]=function(){return this},o;function i(t,s){o[t]=c[t]?function(a){return(r=!r)?{value:p(c[t](a)),done:t==="return"}:s?s(a):a}:s}},e.__asyncValues=function(c){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=c[Symbol.asyncIterator];return r?r.call(c):(c=w(c),o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o);function i(t){o[t]=c[t]&&function(s){return new Promise(function(a,u){(function(l,d,m,f){Promise.resolve(f).then(function(b){l({value:b,done:m})},d)})(a,u,(s=c[t](s)).done,s.value)})}}},e.__makeTemplateObject=function(c,o){return Object.defineProperty?Object.defineProperty(c,"raw",{value:o}):c.raw=o,c};var T=Object.create?function(c,o){Object.defineProperty(c,"default",{enumerable:!0,value:o})}:function(c,o){c.default=o};e.__importStar=function(c){if(c&&c.__esModule)return c;var o={};if(c!=null)for(var r in c)r!=="default"&&Object.prototype.hasOwnProperty.call(c,r)&&(0,e.__createBinding)(o,c,r);return T(o,c),o},e.__importDefault=function(c){return c&&c.__esModule?c:{default:c}},e.__classPrivateFieldGet=function(c,o,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?c!==o||!i:!o.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(c):i?i.value:o.get(c)},e.__classPrivateFieldSet=function(c,o,r,i,t){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!t)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?c!==o||!t:!o.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?t.call(c,r):t?t.value=r:o.set(c,r),r}},function(Q,O,e,C,R){C();const v=Q(1);R("version",Q(3).version),R("index",Q(4).index),e.embed=(0,v.__importStar)(Q(4)),e.protocol=(0,v.__importStar)(Q(406)),e._testing=(0,v.__importStar)(Q(407));var w=Q(19);R("logger",w.logger),R("set_log_level",w.set_log_level),R("settings",Q(28).settings),R("Models",Q(7).Models),R("documents",Q(5).documents),R("safely",Q(408).safely)},function(Q,O,e,C,R){C(),e.version="2.4.3"},function(Q,O,e,C,R){C();const v=Q(5),w=Q(19),g=Q(34),p=Q(13),T=Q(8),c=Q(16),o=Q(397),r=Q(399),i=Q(398);var t=Q(397);R("add_document_standalone",t.add_document_standalone),R("index",t.index),R("add_document_from_session",Q(399).add_document_from_session);var s=Q(404);async function a(u,l,d,m){(0,T.isString)(u)&&(u=JSON.parse((0,g.unescape)(u)));const f={};for(const[y,A]of(0,p.entries)(u))f[y]=v.Document.from_json(A);const b=[];for(const y of l){const A=(0,i._resolve_element)(y),L=(0,i._resolve_root_elements)(y);if(y.docid!=null)b.push(await(0,o.add_document_standalone)(f[y.docid],A,L,y.use_for_title));else{if(y.token==null)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const x=(0,r._get_ws_url)(d,m);w.logger.debug(`embed: computed ws url: ${x}`);try{b.push(await(0,r.add_document_from_session)(x,y.token,A,L,y.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(H){console.log("Error rendering Bokeh items:",H)}}}}return b}R("embed_items_notebook",s.embed_items_notebook),R("kernels",s.kernels),R("BOKEH_ROOT",Q(398).BOKEH_ROOT),e.embed_item=async function(u,l){const d={},m=(0,g.uuid4)();d[m]=u.doc,l==null&&(l=u.target_id);const f=document.getElementById(l);f?.classList.add(i.BOKEH_ROOT);const b={roots:{[u.root_id]:l},root_ids:[u.root_id],docid:m};await(0,c.defer)();const[y]=await a(d,[b]);return y},e.embed_items=async function(u,l,d,m){return await(0,c.defer)(),a(u,l,d,m)}},function(V,Q,O,e,C){e();const R=V(1);(0,R.__exportStar)(V(6),O),(0,R.__exportStar)(V(35),O)},function(Q,O,e,C,R){C();const v=Q(1),w=Q(7),g=Q(3),p=Q(19),T=Q(251),c=Q(14),o=Q(30),r=Q(15),i=Q(17),t=Q(31),s=Q(29),a=Q(9),u=Q(13),l=(0,v.__importStar)(Q(77)),d=Q(26),m=Q(8),f=Q(309),b=Q(75),y=Q(53),A=Q(396),L=Q(35);class x{constructor(k){this.document=k,this.session=null,this.subscribed_models=new Set}send_event(k){const E=new L.MessageSentEvent(this.document,"bokeh_event",k.to_json());this.document._trigger_on_change(E)}trigger(k){for(const E of this.subscribed_models)k.origin!=null&&k.origin!=E||E._process_event(k)}}e.EventManager=x,x.__name__="EventManager",e.documents=[],e.DEFAULT_TITLE="Bokeh Application";class H{constructor(k){var E;e.documents.push(this),this._init_timestamp=Date.now(),this._resolver=(E=k?.resolver)!==null&&E!==void 0?E:new w.ModelResolver,this._title=e.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new x(this),this.idle=new r.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}get layoutables(){return this._roots.filter(k=>k instanceof f.LayoutDOM)}get is_idle(){for(const k of this.layoutables)if(!this._idle_roots.has(k))return!1;return!0}notify_idle(k){this._idle_roots.set(k,!0),this.is_idle&&(p.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new T.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(k,E=null){this._interactive_plot==null&&(this._interactive_plot=k,this._interactive_plot.trigger_event(new T.LODStart)),this._interactive_finalize=E,this._interactive_timestamp=Date.now()}interactive_stop(){this._interactive_plot!=null&&(this._interactive_plot.trigger_event(new T.LODEnd),this._interactive_finalize!=null&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return this._interactive_timestamp==null?-1:Date.now()-this._interactive_timestamp}destructively_move(k){if(k===this)throw new Error("Attempted to overwrite a document with itself");k.clear();const E=(0,a.copy)(this._roots);this.clear();for(const P of E)if(P.document!=null)throw new Error(`Somehow we didn't detach ${P}`);if(this._all_models.size!=0)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const P of E)k.add_root(P);k.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,this._all_models_freeze_count===0&&this._recompute_all_models()}_invalidate_all_models(){p.logger.debug("invalidating document models"),this._all_models_freeze_count===0&&this._recompute_all_models()}_recompute_all_models(){let k=new Set;for(const D of this._roots)k=l.union(k,D.references());const E=new Set(this._all_models.values()),P=l.difference(E,k),N=l.difference(k,E),B=new Map;for(const D of k)B.set(D.id,D);for(const D of P)D.detach_document();for(const D of N)D.attach_document(this);this._all_models=B}roots(){return this._roots}add_root(k,E){if(p.logger.debug(`Adding root: ${k}`),!(0,a.includes)(this._roots,k)){this._push_all_models_freeze();try{this._roots.push(k)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new L.RootAddedEvent(this,k,E))}}remove_root(k,E){const P=this._roots.indexOf(k);if(!(P<0)){this._push_all_models_freeze();try{this._roots.splice(P,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new L.RootRemovedEvent(this,k,E))}}title(){return this._title}set_title(k,E){k!==this._title&&(this._title=k,this._trigger_on_change(new L.TitleChangedEvent(this,k,E)))}get_model_by_id(k){var E;return(E=this._all_models.get(k))!==null&&E!==void 0?E:null}get_model_by_name(k){const E=[];for(const P of this._all_models.values())P instanceof y.Model&&P.name==k&&E.push(P);switch(E.length){case 0:return null;case 1:return E[0];default:throw new Error(`Multiple models are named '${k}'`)}}on_message(k,E){const P=this._message_callbacks.get(k);P==null?this._message_callbacks.set(k,new Set([E])):P.add(E)}remove_on_message(k,E){var P;(P=this._message_callbacks.get(k))===null||P===void 0||P.delete(E)}_trigger_on_message(k,E){const P=this._message_callbacks.get(k);if(P!=null)for(const N of P)N(E)}on_change(k,E=!1){this._callbacks.has(k)||this._callbacks.set(k,E)}remove_on_change(k){this._callbacks.delete(k)}_trigger_on_change(k){for(const[E,P]of this._callbacks)if(!P&&k instanceof L.DocumentEventBatch)for(const N of k.events)E(N);else E(k)}_notify_change(k,E,P,N,B){this._trigger_on_change(new L.ModelChangedEvent(this,k,E,P,N,B?.setter_id,B?.hint))}static _instantiate_object(k,E,P,N){const B=Object.assign(Object.assign({},P),{id:k,__deferred__:!0});return new(N.get(E))(B)}static _instantiate_references_json(k,E,P){var N;const B=new Map;for(const D of k){const j=D.id,M=D.type,F=(N=D.attributes)!==null&&N!==void 0?N:{};let W=E.get(j);W==null&&(W=H._instantiate_object(j,M,F,P),D.subtype!=null&&W.set_subtype(D.subtype)),B.set(W.id,W)}return B}static _resolve_refs(k,E,P,N){function B(D){var j;if((0,i.is_ref)(D)){const M=(j=E.get(D.id))!==null&&j!==void 0?j:P.get(D.id);if(M!=null)return M;throw new Error(`reference ${JSON.stringify(D)} isn't known (not in Document?)`)}if((0,t.is_NDArray_ref)(D)){const{buffer:M,dtype:F,shape:W}=(0,t.decode_NDArray)(D,N);return(0,s.ndarray)(M,{dtype:F,shape:W})}return(0,m.isArray)(D)?(function(M){const F=[];for(const W of M)F.push(B(W));return F})(D):(0,m.isPlainObject)(D)?(function(M){const F={};for(const[W,U]of(0,u.entries)(M))F[W]=B(U);return F})(D):D}return B(k)}static _initialize_references_json(k,E,P,N){const B=new Map;for(const{id:F,attributes:W}of k){const U=!E.has(F),q=U?P.get(F):E.get(F),X=H._resolve_refs(W,E,P,N);q.setv(X,{silent:!0}),B.set(F,{instance:q,is_new:U})}const D=[],j=new Set;function M(F){if(F instanceof c.HasProps){if(B.has(F.id)&&!j.has(F.id)){j.add(F.id);const{instance:W,is_new:U}=B.get(F.id),{attributes:q}=W;for(const X of(0,u.values)(q))M(X);U&&(W.finalize(),D.push(W))}}else if((0,m.isArray)(F))for(const W of F)M(W);else if((0,m.isPlainObject)(F))for(const W of(0,u.values)(F))M(W)}for(const F of B.values())M(F.instance);for(const F of D)F.connect_signals()}static _event_for_attribute_change(k,E,P,N,B){if(N.get_model_by_id(k.id).property(E).syncable){const D={kind:"ModelChanged",model:{id:k.id},attr:E,new:P};return c.HasProps._json_record_references(N,P,B,{recursive:!0}),D}return null}static _events_to_sync_objects(k,E,P,N){const B=Object.keys(k.attributes),D=Object.keys(E.attributes),j=(0,a.difference)(B,D),M=(0,a.difference)(D,B),F=(0,a.intersection)(B,D),W=[];for(const U of j)p.logger.warn(`Server sent key ${U} but we don't seem to have it in our JSON`);for(const U of M){const q=E.attributes[U];W.push(H._event_for_attribute_change(k,U,q,P,N))}for(const U of F){const q=k.attributes[U],X=E.attributes[U];q==null&&X==null||(q==null||X==null?W.push(H._event_for_attribute_change(k,U,X,P,N)):U=="data"||(0,d.is_equal)(q,X)||W.push(H._event_for_attribute_change(k,U,X,P,N)))}return W.filter(U=>U!=null)}static _compute_patch_since_json(k,E){const P=E.to_json(!1);function N(ae){const me=new Map;for(const Ve of ae.roots.references)me.set(Ve.id,Ve);return me}const B=N(k),D=new Map,j=[];for(const ae of k.roots.root_ids)D.set(ae,B.get(ae)),j.push(ae);const M=N(P),F=new Map,W=[];for(const ae of P.roots.root_ids)F.set(ae,M.get(ae)),W.push(ae);if(j.sort(),W.sort(),(0,a.difference)(j,W).length>0||(0,a.difference)(W,j).length>0)throw new Error("Not implemented: computing add/remove of document roots");const U=new Set;let q=[];for(const ae of E._all_models.keys())if(B.has(ae)){const me=H._events_to_sync_objects(B.get(ae),M.get(ae),E,U);q=q.concat(me)}const X=new o.Serializer({include_defaults:!1});return X.to_serializable([...U]),{references:[...X.definitions],events:q}}to_json_string(k=!0){return JSON.stringify(this.to_json(k))}to_json(k=!0){const E=new o.Serializer({include_defaults:k}),P=E.to_serializable(this._roots);return{version:g.version,title:this._title,roots:{root_ids:P.map(N=>N.id),references:[...E.definitions]}}}static from_json_string(k){const E=JSON.parse(k);return H.from_json(E)}static from_json(k){p.logger.debug("Creating Document from JSON");const E=k.version,P=E.indexOf("+")!==-1||E.indexOf("-")!==-1,N=`Library versions: JS (${g.version}) / Python (${E})`;P||g.version.replace(/-(dev|rc)\./,"$1")==E?p.logger.debug(N):(p.logger.warn("JS/Python version mismatch"),p.logger.warn(N));const B=new w.ModelResolver;k.defs!=null&&(0,A.resolve_defs)(k.defs,B);const D=k.roots,j=D.root_ids,M=D.references,F=H._instantiate_references_json(M,new Map,B);H._initialize_references_json(M,new Map,F,new Map);const W=new H({resolver:B});W._push_all_models_freeze();for(const U of j){const q=F.get(U);q!=null&&W.add_root(q)}return W._pop_all_models_freeze(),W.set_title(k.title),W}replace_with_json(k){H.from_json(k).destructively_move(this)}create_json_patch_string(k){return JSON.stringify(this.create_json_patch(k))}create_json_patch(k){for(const N of k)if(N.document!=this)throw new Error("Cannot create a patch using events from a different document");const E=new o.Serializer,P=E.to_serializable(k);for(const N of this._all_models.values())E.remove_def(N);return{events:P,references:[...E.definitions]}}apply_json_patch(k,E=new Map,P){const N=k.references,B=k.events,D=H._instantiate_references_json(N,this._all_models,this._resolver);E instanceof Map||(E=new Map(E));for(const F of B)switch(F.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":{const W=F.model.id,U=this._all_models.get(W);if(U!=null)D.set(W,U);else if(!D.has(W))throw p.logger.warn(`Got an event for unknown model ${F.model}"`),new Error("event model wasn't known");break}}const j=new Map(this._all_models),M=new Map;for(const[F,W]of D)j.has(F)||M.set(F,W);H._initialize_references_json(N,j,M,E);for(const F of B)switch(F.kind){case"MessageSent":{const{msg_type:W,msg_data:U}=F;let q;if(U===void 0){if(E.size!=1)throw new Error("expected exactly one buffer");{const[[,X]]=E;q=X}}else q=H._resolve_refs(U,j,M,E);this._trigger_on_message(W,q);break}case"ModelChanged":{const W=F.model.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot apply patch to ${W} which is not in the document`);const q=F.attr,X=H._resolve_refs(F.new,j,M,E);U.setv({[q]:X},{setter_id:P});break}case"ColumnDataChanged":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot stream to ${W} which is not in the document`);const q=H._resolve_refs(F.new,new Map,new Map,E);if(F.cols!=null)for(const X in U.data)X in q||(q[X]=U.data[X]);U.setv({data:q},{setter_id:P,check_eq:!1});break}case"ColumnsStreamed":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot stream to ${W} which is not in the document`);if(!(U instanceof b.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");const q=F.data,X=F.rollover;U.stream(q,X,P);break}case"ColumnsPatched":{const W=F.column_source.id,U=this._all_models.get(W);if(U==null)throw new Error(`Cannot patch ${W} which is not in the document`);if(!(U instanceof b.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");const q=F.patches;U.patch(q,P);break}case"RootAdded":{const W=F.model.id,U=D.get(W);this.add_root(U,P);break}case"RootRemoved":{const W=F.model.id,U=D.get(W);this.remove_root(U,P);break}case"TitleChanged":this.set_title(F.title,P);break;default:throw new Error(`Unknown patch event ${JSON.stringify(F)}`)}}}e.Document=H,H.__name__="Document"},function(Q,O,e,C,R){C();const v=Q(1),w=Q(8),g=Q(13),p=Q(14);e.overrides={};const T=new Map;e.Models=i=>{const t=e.Models.get(i);if(t!=null)return t;throw new Error(`Model '${i}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)},e.Models.get=i=>{var t;return(t=e.overrides[i])!==null&&t!==void 0?t:T.get(i)},e.Models.register=(i,t)=>{e.overrides[i]=t},e.Models.unregister=i=>{delete e.overrides[i]},e.Models.register_models=(i,t=!1,s)=>{var a;if(i!=null){for(const u of(0,w.isArray)(i)?i:(0,g.values)(i))if(a=u,(0,w.isObject)(a)&&a.prototype instanceof p.HasProps){const l=u.__qualified__;t||!T.has(l)?T.set(l,u):s!=null?s(l):console.warn(`Model '${l}' was already registered`)}}},e.register_models=e.Models.register_models,e.Models.registered_names=()=>[...T.keys()];class c{constructor(){this._known_models=new Map}get(t,s){var a;const u=(a=e.Models.get(t))!==null&&a!==void 0?a:this._known_models.get(t);if(u!=null)return u;if(s!==void 0)return s;throw new Error(`Model '${t}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)}register(t){const s=t.__qualified__;this.get(s,null)==null?this._known_models.set(s,t):console.warn(`Model '${s}' was already registered with this resolver`)}}e.ModelResolver=c,c.__name__="ModelResolver";const o=(0,v.__importStar)(Q(38));(0,e.register_models)(o);const r=(0,v.__importStar)(Q(392));(0,e.register_models)(r)},function(Q,O,e,C,R){C();const v=Q(9),w=Object.prototype.toString;function g(i){return i===!0||i===!1||w.call(i)==="[object Boolean]"}function p(i){return w.call(i)==="[object Number]"}function T(i){return w.call(i)==="[object String]"}function c(i){return typeof i=="symbol"}function o(i){const t=typeof i;return t==="function"||t==="object"&&!!i}function r(i){return o(i)&&i[Symbol.iterator]!==void 0}e.isBoolean=g,e.isNumber=p,e.isInteger=function(i){return p(i)&&Number.isInteger(i)},e.isString=T,e.isSymbol=c,e.isPrimitive=function(i){return i===null||g(i)||p(i)||T(i)||c(i)},e.isFunction=function(i){return w.call(i)==="[object Function]"},e.isArray=function(i){return Array.isArray(i)},e.isArrayOf=function(i,t){return(0,v.every)(i,t)},e.isArrayableOf=function(i,t){for(let s=0,a=i.length;s<a;s++)if(!t(i[s]))return!1;return!0},e.isTypedArray=function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},e.isObject=o,e.isPlainObject=function(i){return o(i)&&(i.constructor==null||i.constructor===Object)},e.isIterable=r,e.isArrayable=function(i){return r(i)&&"length"in i}},function(Q,O,e,C,R){C();const v=Q(10),w=Q(11),g=Q(12);R("map",g.map),R("reduce",g.reduce),R("min",g.min),R("min_by",g.min_by),R("max",g.max),R("max_by",g.max_by),R("sum",g.sum),R("cumsum",g.cumsum),R("every",g.every),R("some",g.some),R("find",g.find),R("find_last",g.find_last),R("find_index",g.find_index),R("find_last_index",g.find_last_index),R("sorted_index",g.sorted_index),R("is_empty",g.is_empty);const p=Array.prototype.slice;function T(i){return p.call(i)}function c(i){return[].concat(...i)}function o(i,t){return i.indexOf(t)!==-1}function r(i,t,s=1){(0,w.assert)(s>0,"'step' must be a positive number"),t==null&&(t=i,i=0);const{max:a,ceil:u,abs:l}=Math,d=i<=t?s:-s,m=a(u(l(t-i)/s),0),f=new Array(m);for(let b=0;b<m;b++,i+=d)f[b]=i;return f}e.head=function(i){return i[0]},e.tail=function(i){return i[i.length-1]},e.last=function(i){return i[i.length-1]},e.copy=T,e.concat=c,e.includes=o,e.contains=o,e.nth=function(i,t){return i[t>=0?t:i.length+t]},e.zip=function(...i){if(i.length==0)return[];const t=(0,g.min)(i.map(u=>u.length)),s=i.length,a=new Array(t);for(let u=0;u<t;u++){a[u]=new Array(s);for(let l=0;l<s;l++)a[u][l]=i[l][u]}return a},e.unzip=function(i){const t=i.length,s=(0,g.min)(i.map(u=>u.length)),a=Array(s);for(let u=0;u<s;u++)a[u]=new Array(t);for(let u=0;u<t;u++)for(let l=0;l<s;l++)a[l][u]=i[u][l];return a},e.range=r,e.linspace=function(i,t,s=100){const a=(t-i)/(s-1),u=new Array(s);for(let l=0;l<s;l++)u[l]=i+a*l;return u},e.transpose=function(i){const t=i.length,s=i[0].length,a=[];for(let u=0;u<s;u++){a[u]=[];for(let l=0;l<t;l++)a[u][l]=i[l][u]}return a},e.argmin=function(i){return(0,g.min_by)(r(i.length),t=>i[t])},e.argmax=function(i){return(0,g.max_by)(r(i.length),t=>i[t])},e.sort_by=function(i,t){const s=i.map((a,u)=>({value:a,index:u,key:t(a)}));return s.sort((a,u)=>{const l=a.key,d=u.key;if(l!==d){if(l>d||l===void 0)return 1;if(l<d||d===void 0)return-1}return a.index-u.index}),s.map(a=>a.value)},e.uniq=function(i){const t=new Set;for(const s of i)t.add(s);return[...t]},e.uniq_by=function(i,t){const s=[],a=[];for(const u of i){const l=t(u);o(a,l)||(a.push(l),s.push(u))}return s},e.union=function(...i){const t=new Set;for(const s of i)for(const a of s)t.add(a);return[...t]},e.intersection=function(i,...t){const s=[];e:for(const a of i)if(!o(s,a)){for(const u of t)if(!o(u,a))continue e;s.push(a)}return s},e.difference=function(i,...t){const s=c(t);return i.filter(a=>!o(s,a))},e.remove_at=function(i,t){const s=T(i);return s.splice(t,1),s},e.remove_by=function(i,t){for(let s=0;s<i.length;)t(i[s])?i.splice(s,1):s++},e.shuffle=function(i){const t=i.length,s=new Array(t);for(let a=0;a<t;a++){const u=(0,v.randomIn)(0,a);u!==a&&(s[a]=s[u]),s[u]=i[a]}return s},e.pairwise=function(i,t){const s=i.length,a=new Array(s-1);for(let u=0;u<s-1;u++)a[u]=t(i[u],i[u+1]);return a},e.reversed=function(i){const t=i.length,s=new Array(t);for(let a=0;a<t;a++)s[t-a-1]=i[a];return s},e.repeat=function(i,t){const s=new Array(t);for(let a=0;a<t;a++)s[a]=i;return s}},function(Q,O,e,C,R){C();const{PI:v}=Math;function w(c){if(c==0)return 0;for(;c<=0;)c+=2*v;for(;c>2*v;)c-=2*v;return c}function g(c,o){return w(c-o)}function p(){return Math.random()}function T(c){switch(c){case"deg":return v/180;case"rad":return 1;case"grad":return v/200;case"turn":return 2*v}}e.angle_norm=w,e.angle_dist=g,e.angle_between=function(c,o,r,i=!1){const t=g(o,r);if(t==0)return!1;if(t==2*v)return!0;const s=w(c),a=g(o,s)<=t&&g(s,r)<=t;return i?!a:a},e.random=p,e.randomIn=function(c,o){return o==null&&(o=c,c=0),c+Math.floor(Math.random()*(o-c+1))},e.atan2=function(c,o){return Math.atan2(o[1]-c[1],o[0]-c[0])},e.radians=function(c){return c*(v/180)},e.degrees=function(c){return c/(v/180)},e.resolve_angle=function(c,o){return-T(o)*c},e.to_radians_coeff=T,e.rnorm=function(c,o){let r,i;for(;r=p(),i=p(),i=(2*i-1)*Math.sqrt(1/Math.E*2),!(-4*r*r*Math.log(r)>=i*i););let t=i/r;return t=c+o*t,t},e.clamp=function(c,o,r){return c<o?o:c>r?r:c},e.log=function(c,o=Math.E){return Math.log(c)/Math.log(o)},e.float32_epsilon=11920928955078125e-23},function(Q,O,e,C,R){C();class v extends Error{}e.AssertionError=v,v.__name__="AssertionError",e.assert=function(w,g){if(!(w===!0||w!==!1&&w()))throw new v(g??"Assertion failed")},e.unreachable=function(){throw new Error("unreachable code")}},function(Q,O,e,C,R){C();const v=Q(10);function w(t,s,a,...u){const l=t.length;s<0&&(s+=l),s<0?s=0:s>l&&(s=l),a==null||a>l-s?a=l-s:a<0&&(a=0);const d=l-a+u.length,m=new t.constructor(d);let f=0;for(;f<s;f++)m[f]=t[f];for(const b of u)m[f++]=b;for(let b=s+a;b<l;b++)m[f++]=t[b];return m}function g(t,s){return w(t,s,t.length-s)}function p(t,s){const a=t.length,u=new t.constructor(a);for(let l=0;l<a;l++)u[l]=s(t[l],l,t);return u}function T(t,s,a){const u=t.length;if(a===void 0&&u==0)throw new Error("can't reduce an empty array without an initial value");let l,d;for(a===void 0?(l=t[0],d=1):(l=a,d=0);d<u;d++)l=s(l,t[d],d,t);return l}function c(t){return function(s,a){const u=s.length;let l=t>0?0:u-1;for(;l>=0&&l<u;l+=t)if(a(s[l]))return l;return-1}}function o(t,s){let a=0,u=t.length;for(;a<u;){const l=Math.floor((a+u)/2);t[l]<s?a=l+1:u=l}return a}function r(t,s,a,u,l){const d=(l-a)/(u-s);let m=d*(t-s)+a;return isFinite(m)||(m=d*(t-u)+l,isFinite(m)||a!=l||(m=a)),m}function i(t,s){if(t<s[0])return-1;if(t>s[s.length-1])return s.length;let a=0,u=s.length-1;for(;u-a!=1;){const l=a+Math.floor((u-a)/2);t>=s[l]?a=l:u=l}return a}e.is_empty=function(t){return t.length==0},e.copy=function(t){return Array.isArray(t)?t.slice():new t.constructor(t)},e.splice=w,e.head=g,e.insert=function(t,s,a){return w(t,a,0,s)},e.append=function(t,s){return w(t,t.length,0,s)},e.prepend=function(t,s){return w(t,0,0,s)},e.indexOf=function(t,s){for(let a=0,u=t.length;a<u;a++)if(t[a]===s)return a;return-1},e.subselect=function(t,s){const a=s.length,u=new t.constructor(a);for(let l=0;l<a;l++)u[l]=t[s[l]];return u},e.mul=function(t,s,a){const u=t.length,l=a??new t.constructor(u);for(let d=0;d<u;d++)l[d]=t[d]*s;return l},e.map=p,e.inplace_map=function(t,s,a){const u=t.length,l=a??t;for(let d=0;d<u;d++)l[d]=s(t[d],d)},e.filter=function(t,s){const a=t.length,u=new t.constructor(a);let l=0;for(let d=0;d<a;d++){const m=t[d];s(m,d,t)&&(u[l++]=m)}return g(u,l)},e.reduce=T,e.min=function(t){let s,a=1/0;for(let u=0,l=t.length;u<l;u++)s=t[u],!isNaN(s)&&s<a&&(a=s);return a},e.max=function(t){let s,a=-1/0;for(let u=0,l=t.length;u<l;u++)s=t[u],!isNaN(s)&&s>a&&(a=s);return a},e.minmax=function(t){let s,a=1/0,u=-1/0;for(let l=0,d=t.length;l<d;l++)s=t[l],isNaN(s)||(s<a&&(a=s),s>u&&(u=s));return[a,u]},e.minmax2=function(t,s){let a,u,l=1/0,d=-1/0,m=1/0,f=-1/0;const b=Math.min(t.length,s.length);for(let y=0;y<b;y++)a=t[y],u=s[y],isNaN(a)||isNaN(u)||(a<l&&(l=a),a>d&&(d=a),u<m&&(m=u),u>f&&(f=u));return[l,d,m,f]},e.min_by=function(t,s){if(t.length==0)throw new Error("min_by() called with an empty array");let a=t[0],u=s(a);for(let l=1,d=t.length;l<d;l++){const m=t[l],f=s(m);f<u&&(a=m,u=f)}return a},e.max_by=function(t,s){if(t.length==0)throw new Error("max_by() called with an empty array");let a=t[0],u=s(a);for(let l=1,d=t.length;l<d;l++){const m=t[l],f=s(m);f>u&&(a=m,u=f)}return a},e.sum=function(t){let s=0;for(let a=0,u=t.length;a<u;a++)s+=t[a];return s},e.cumsum=function(t){const s=new t.constructor(t.length);return T(t,(a,u,l)=>s[l]=a+u,0),s},e.every=function(t,s){for(let a=0,u=t.length;a<u;a++)if(!s(t[a]))return!1;return!0},e.some=function(t,s){for(let a=0,u=t.length;a<u;a++)if(s(t[a]))return!0;return!1},e.index_of=function(t,s){for(let a=0,u=t.length;a<u;a++)if(t[a]===s)return a;return-1},e.find_index=c(1),e.find_last_index=c(-1),e.find=function(t,s){const a=(0,e.find_index)(t,s);return a==-1?void 0:t[a]},e.find_last=function(t,s){const a=(0,e.find_last_index)(t,s);return a==-1?void 0:t[a]},e.sorted_index=o,e.bin_counts=function(t,s){const a=s.length-1,u=Array(a).fill(0);for(let l=0;l<t.length;l++){const d=o(s,t[l]);u[(0,v.clamp)(d-1,0,a-1)]+=1}return u},e.interpolate=function(t,s,a){const u=t.length,l=new Array(u);for(let d=0;d<u;d++){const m=t[d];if(isNaN(m)){l[d]=m;continue}const f=i(m,s);if(f==-1)l[d]=a[0];else if(f==s.length)l[d]=a[a.length-1];else if(f==s.length-1||s[f]==m)l[d]=a[f];else{const b=s[f],y=a[f],A=s[f+1],L=a[f+1];l[d]=r(m,b,y,A,L)}}return l},e.left_edge_index=i,e.norm=function(t,s,a){const u=a-s;return p(t,l=>(l-s)/u)}},function(Q,O,e,C,R){C();const v=Q(9),{hasOwnProperty:w}=Object.prototype;function g(T){return Object.keys(T).length}function p(T){return g(T)==0}e.keys=Object.keys,e.values=Object.values,e.entries=Object.entries,e.extend=Object.assign,e.clone=function(T){return Object.assign({},T)},e.merge=function(T,c){const o=Object.create(Object.prototype),r=(0,v.concat)([Object.keys(T),Object.keys(c)]);for(const i of r){const t=w.call(T,i)?T[i]:[],s=w.call(c,i)?c[i]:[];o[i]=(0,v.union)(t,s)}return o},e.size=g,e.is_empty=p,e.isEmpty=p,e.to_object=function(T){const c={};for(const[o,r]of T)c[o]=r;return c}},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(15),p=Q(17),T=(0,v.__importStar)(Q(18)),c=(0,v.__importStar)(Q(21)),o=Q(34),r=Q(13),i=Q(8),t=Q(26),s=Q(30),a=Q(35),u=Q(26),l=Q(36),d=Q(37),m=(0,v.__importStar)(Q(21));class f extends(0,g.Signalable)(){constructor(y={}){var A,L;super(),this._subtype=void 0,this.document=null,this.destroyed=new g.Signal0(this,"destroyed"),this.change=new g.Signal0(this,"change"),this.transformchange=new g.Signal0(this,"transformchange"),this.exprchange=new g.Signal0(this,"exprchange"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const x=y instanceof Map?y.get.bind(y):H=>y[H];this.id=(A=x("id"))!==null&&A!==void 0?A:(0,o.uniqueId)();for(const[H,{type:S,default_value:k,options:E}]of(0,r.entries)(this._props)){let P;S instanceof T.PropertyAlias?Object.defineProperty(this.properties,H,{get:()=>this.properties[S.attr],configurable:!1,enumerable:!1}):(P=S instanceof c.Kind?new T.PrimitiveProperty(this,H,S,k,x(H),E):new S(this,H,c.Any,k,x(H),E),this.properties[H]=P)}(L=x("__deferred__"))!==null&&L!==void 0&&L||(this.finalize(),this.connect_signals())}get is_syncable(){return!0}set type(y){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=y}get type(){return this.constructor.__qualified__}static get __qualified__(){const{__module__:y,__name__:A}=this;return y!=null?`${y}.${A}`:A}static get[Symbol.toStringTag](){return this.__name__}static _fix_default(y,A){if(y===void 0||(0,i.isFunction)(y))return y;if((0,i.isPrimitive)(y))return()=>y;{const L=new d.Cloner;return()=>L.clone(y)}}static define(y){for(const[A,L]of(0,r.entries)((0,i.isFunction)(y)?y(m):y)){if(this.prototype._props[A]!=null)throw new Error(`attempted to redefine property '${this.prototype.type}.${A}'`);if(this.prototype[A]!=null)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${A}'`);Object.defineProperty(this.prototype,A,{get(){return this.properties[A].get_value()},set(P){return this.setv({[A]:P}),this},configurable:!1,enumerable:!0});const[x,H,S={}]=L,k={type:x,default_value:this._fix_default(H,A),options:S},E=Object.assign({},this.prototype._props);E[A]=k,this.prototype._props=E}}static internal(y){const A={};for(const[L,x]of(0,r.entries)((0,i.isFunction)(y)?y(m):y)){const[H,S,k={}]=x;A[L]=[H,S,Object.assign(Object.assign({},k),{internal:!0})]}this.define(A)}static mixins(y){function A(H,S){const k={};for(const[E,P]of(0,r.entries)(S))k[H+E]=P;return k}const L={},x=[];for(const H of(0,i.isArray)(y)?y:[y])if((0,i.isArray)(H)){const[S,k]=H;(0,r.extend)(L,A(S,k)),x.push([S,k])}else{const S=H;(0,r.extend)(L,S),x.push(["",S])}this.define(L),this.prototype._mixins=[...this.prototype._mixins,...x]}static override(y){for(const[A,L]of(0,r.entries)(y)){const x=this._fix_default(L,A),H=this.prototype._props[A];if(H==null)throw new Error(`attempted to override nonexistent '${this.prototype.type}.${A}'`);const S=Object.assign({},this.prototype._props);S[A]=Object.assign(Object.assign({},H),{default_value:x}),this.prototype._props=S}}toString(){return`${this.type}(${this.id})`}property(y){const A=this.properties[y];if(A!=null)return A;throw new Error(`unknown property ${this.type}.${y}`)}get attributes(){const y={};for(const A of this)y[A.attr]=A.get_value();return y}[d.clone](y){const A=new Map;for(const L of this)L.dirty&&A.set(L.attr,y.clone(L.get_value()));return new this.constructor(A)}[u.equals](y,A){for(const L of this){const x=y.property(L.attr);if(!A.eq(L.get_value(),x.get_value()))return!1}return!0}[l.pretty](y){const A=y.token,L=[];for(const x of this)if(x.dirty){const H=x.get_value();L.push(`${x.attr}${A(":")} ${y.to_string(H)}`)}return`${this.constructor.__qualified__}${A("(")}${A("{")}${L.join(`${A(",")} `)}${A("}")}${A(")")}`}[s.serialize](y){const A=this.ref();y.add_ref(this,A);const L=this.struct();for(const x of this)x.syncable&&(y.include_defaults||x.dirty)&&(L.attributes[x.attr]=y.to_serializable(x.get_value()));return y.add_def(this,L),A}finalize(){for(const y of this){if(!(y instanceof T.VectorSpec||y instanceof T.ScalarSpec))continue;const A=y.get_value();if(A!=null){const{transform:L,expr:x}=A;L!=null&&this.connect(L.change,()=>this.transformchange.emit()),x!=null&&this.connect(x.change,()=>this.exprchange.emit())}}this.initialize()}initialize(){}connect_signals(){}disconnect_signals(){g.Signal.disconnectReceiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return new d.Cloner().clone(this)}changed_for(y){const A=this._watchers.get(y);return this._watchers.set(y,!1),A==null||A}_setv(y,A){const L=A.check_eq,x=[],H=this._changing;this._changing=!0;for(const[S,k]of y)L!==!1&&(0,t.is_equal)(S.get_value(),k)||(S.set_value(k),x.push(S));x.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(const S of x)S.change.emit();if(!H){if(!A.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}setv(y,A={}){const L=(0,r.entries)(y);if(L.length==0)return;if(A.silent===!0){this._watchers=new WeakMap;for(const[k,E]of L)this.properties[k].set_value(E);return}const x=new Map,H=new Map;for(const[k,E]of L){const P=this.properties[k];x.set(P,E),H.set(P,P.get_value())}this._setv(x,A);const{document:S}=this;if(S!=null){const k=[];for(const[E,P]of H)k.push([E,P,E.get_value()]);for(const[,E,P]of k)if(this._needs_invalidate(E,P)){S._invalidate_all_models();break}this._push_changes(k,A)}}getv(y){return this.property(y).get_value()}ref(){return{id:this.id}}struct(){const y={type:this.type,id:this.id,attributes:{}};return this._subtype!=null&&(y.subtype=this._subtype),y}set_subtype(y){this._subtype=y}*[Symbol.iterator](){yield*(0,r.values)(this.properties)}*syncable_properties(){for(const y of this)y.syncable&&(yield y)}serializable_attributes(){const y={};for(const A of this.syncable_properties())y[A.attr]=A.get_value();return y}static _json_record_references(y,A,L,x){const{recursive:H}=x;if((0,p.is_ref)(A)){const S=y.get_model_by_id(A.id);S==null||L.has(S)||f._value_record_references(S,L,{recursive:H})}else if((0,i.isArray)(A))for(const S of A)f._json_record_references(y,S,L,{recursive:H});else if((0,i.isPlainObject)(A))for(const S of(0,r.values)(A))f._json_record_references(y,S,L,{recursive:H})}static _value_record_references(y,A,L){const{recursive:x}=L;if(y instanceof f){if(!A.has(y)&&(A.add(y),x))for(const H of y.syncable_properties()){const S=H.get_value();f._value_record_references(S,A,{recursive:x})}}else if((0,i.isArray)(y))for(const H of y)f._value_record_references(H,A,{recursive:x});else if((0,i.isPlainObject)(y))for(const H of(0,r.values)(y))f._value_record_references(H,A,{recursive:x})}references(){const y=new Set;return f._value_record_references(this,y,{recursive:!0}),y}_doc_attached(){}_doc_detached(){}attach_document(y){if(this.document!=null&&this.document!=y)throw new Error("models must be owned by only a single document");this.document=y,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(y,A){const L=new Set;f._value_record_references(A,L,{recursive:!1});const x=new Set;f._value_record_references(y,x,{recursive:!1});for(const H of L)if(!x.has(H))return!0;for(const H of x)if(!L.has(H))return!0;return!1}_push_changes(y,A={}){if(!this.is_syncable)return;const{document:L}=this;if(L==null)return;const{setter_id:x}=A,H=[];for(const[S,k,E]of y)S.syncable&&H.push(new a.ModelChangedEvent(L,this,S.attr,k,E,x));if(H.length!=0){let S;H.length==1?[S]=H:S=new a.DocumentEventBatch(L,H,x),L._trigger_on_change(S)}}on_change(y,A){for(const L of(0,i.isArray)(y)?y:[y])this.connect(L.change,A)}}e.HasProps=f,(w=f).prototype._props={},w.prototype._mixins=[]},function(Q,O,e,C,R){C();const v=Q(16),w=Q(9);class g{constructor(s,a){this.sender=s,this.name=a}connect(s,a=null){T.has(this.sender)||T.set(this.sender,[]);const u=T.get(this.sender);if(o(u,this,s,a)!=null)return!1;const l=a??s;c.has(l)||c.set(l,[]);const d=c.get(l),m={signal:this,slot:s,context:a};return u.push(m),d.push(m),!0}disconnect(s,a=null){const u=T.get(this.sender);if(u==null||u.length===0)return!1;const l=o(u,this,s,a);if(l==null)return!1;const d=a??s,m=c.get(d);return l.signal=null,i(u),i(m),!0}emit(s){var a;const u=(a=T.get(this.sender))!==null&&a!==void 0?a:[];for(const{signal:l,slot:d,context:m}of u)l===this&&d.call(m,s,this.sender)}}e.Signal=g,g.__name__="Signal";class p extends g{emit(){super.emit(void 0)}}e.Signal0=p,p.__name__="Signal0",(function(t){function s(d,m){const f=T.get(d);if(f==null||f.length===0)return;const b=c.get(m);if(b!=null&&b.length!==0){for(const y of b){if(y.signal==null)return;y.signal.sender===d&&(y.signal=null)}i(f),i(b)}}function a(d){var m;const f=T.get(d);if(f!=null&&f.length!==0){for(const b of f){if(b.signal==null)return;const y=(m=b.context)!==null&&m!==void 0?m:b.slot;b.signal=null,i(c.get(y))}i(f)}}function u(d,m,f){const b=c.get(d);if(b!=null&&b.length!==0){for(const y of b){if(y.signal==null)return;if(m!=null&&y.slot!=m)continue;const A=y.signal.sender;f!=null&&f.has(A)||(y.signal=null,i(T.get(A)))}i(b)}}function l(d){const m=T.get(d);if(m!=null&&m.length!==0){for(const b of m)b.signal=null;i(m)}const f=c.get(d);if(f!=null&&f.length!==0){for(const b of f)b.signal=null;i(f)}}t.disconnect_between=s,t.disconnect_sender=a,t.disconnect_receiver=u,t.disconnect_all=l,t.disconnectBetween=s,t.disconnectSender=a,t.disconnectReceiver=u,t.disconnectAll=l})(g||(e.Signal=g={})),e.Signalable=function(){return class{connect(t,s){return t.connect(s,this)}disconnect(t,s){return t.disconnect(s,this)}}};const T=new WeakMap,c=new WeakMap;function o(t,s,a,u){return(0,w.find)(t,l=>l.signal===s&&l.slot===a&&l.context===u)}const r=new Set;function i(t){r.size===0&&(async()=>(await(0,v.defer)(),(function(){for(const s of r)(0,w.remove_by)(s,a=>a.signal==null);r.clear()})()))(),r.add(t)}},function(Q,O,e,C,R){C();const v=new MessageChannel,w=new Map;v.port1.onmessage=p=>{const T=p.data,c=w.get(T);if(c!=null)try{c()}finally{w.delete(T)}};let g=1;e.defer=function(){return new Promise(p=>{const T=g++;w.set(T,p),v.port2.postMessage(T)})},e.wait=function(p){return new Promise(T=>setTimeout(T,p))}},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13);e.is_ref=function(g){if((0,v.isPlainObject)(g)){const p=(0,w.keys)(g);return p.length==1&&p[0]=="id"}return!1}},function(Q,O,e,C,R){C(),e.YCoordinateSeqSeqSeqSpec=e.XCoordinateSeqSeqSeqSpec=e.YCoordinateSeqSpec=e.XCoordinateSeqSpec=e.YCoordinateSpec=e.XCoordinateSpec=e.CoordinateSeqSeqSeqSpec=e.CoordinateSeqSpec=e.CoordinateSpec=e.BaseCoordinateSpec=e.NumberUnitsSpec=e.UnitsSpec=e.DataSpec=e.VectorSpec=e.TextBaselineScalar=e.TextAlignScalar=e.FontStyleScalar=e.FontSizeScalar=e.FontScalar=e.LineDashScalar=e.LineCapScalar=e.LineJoinScalar=e.ArrayScalar=e.NullStringScalar=e.StringScalar=e.NumberScalar=e.ColorScalar=e.AnyScalar=e.ScalarSpec=e.VerticalAlign=e.UpdateMode=e.TooltipAttachment=e.TickLabelOrientation=e.TextureRepetition=e.TextBaseline=e.TextAlign=e.TapBehavior=e.StepMode=e.StartEnd=e.SpatialUnits=e.Sort=e.SizingMode=e.Side=e.RoundingFunction=e.ResetPolicy=e.RenderMode=e.RenderLevel=e.RadiusDimension=e.PointPolicy=e.Place=void 0,e.TextBaselineSpec=e.TextAlignSpec=e.FontStyleSpec=e.FontSizeSpec=e.FontSpec=e.LineDashSpec=e.LineCapSpec=e.LineJoinSpec=e.MarkerSpec=e.ArraySpec=e.NullStringSpec=e.StringSpec=e.AnySpec=e.NDArraySpec=e.ColorSpec=e.ScreenSizeSpec=e.NumberSpec=e.IntSpec=e.BooleanSpec=e.NullDistanceSpec=e.DistanceSpec=e.AngleSpec=void 0;const v=Q(1),w=Q(15),g=Q(19),p=(0,v.__importStar)(Q(20)),T=Q(24),c=Q(9),o=Q(12),r=Q(10),i=Q(22),t=Q(27),s=Q(8),a=Q(28),u=Q(29),l=Q(33);function d(se){try{return JSON.stringify(se)}catch{return se.toString()}}function m(se){return(0,s.isPlainObject)(se)&&(se.value===void 0?0:1)+(se.field===void 0?0:1)+(se.expr===void 0?0:1)==1}R("Uniform",l.Uniform),R("UniformScalar",l.UniformScalar),R("UniformVector",l.UniformVector),e.isSpec=m;class f{constructor(ne,J,re,Qe,Le,Re={}){var ct;let Y;if(this.obj=ne,this.attr=J,this.kind=re,this.default_value=Qe,this._dirty=!1,this.change=new w.Signal0(this.obj,"change"),this.internal=(ct=Re.internal)!==null&&ct!==void 0&&ct,this.convert=Re.convert,this.on_update=Re.on_update,Le!==void 0)Y=Le,this._dirty=!0;else{const de=this._default_override();if(de!==void 0)Y=de;else{if(Qe===void 0)return void(this.spec={value:null});Y=Qe(ne)}}this._update(Y)}get is_value(){return this.spec.value!==void 0}get syncable(){return!this.internal}get_value(){return this.spec.value}set_value(ne){this._update(ne),this._dirty=!0}_default_override(){}get dirty(){return this._dirty}_update(ne){var J;if(this.validate(ne),this.convert!=null){const re=this.convert(ne);re!==void 0&&(ne=re)}this.spec={value:ne},(J=this.on_update)===null||J===void 0||J.call(this,ne,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, spec: ${d(this.spec)})`}normalize(ne){return ne}validate(ne){if(!this.valid(ne))throw new Error(`${this.obj}.${this.attr} given invalid value: ${d(ne)}`)}valid(ne){return this.kind.valid(ne)}_value(ne=!0){if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");let J=this.normalize([this.spec.value])[0];return this.spec.transform!=null&&ne&&(J=this.spec.transform.compute(J)),J}}e.Property=f,f.__name__="Property";class b{constructor(ne){this.attr=ne}}e.PropertyAlias=b,b.__name__="PropertyAlias",e.Alias=function(se){return new b(se)};class y extends f{}e.PrimitiveProperty=y,y.__name__="PrimitiveProperty";class A extends f{}e.Any=A,A.__name__="Any";class L extends f{valid(ne){return(0,s.isArray)(ne)||(0,s.isTypedArray)(ne)}}e.Array=L,L.__name__="Array";class x extends f{valid(ne){return(0,s.isBoolean)(ne)}}e.Boolean=x,x.__name__="Boolean";class H extends f{valid(ne){return(0,i.is_Color)(ne)}}e.Color=H,H.__name__="Color";class S extends f{}e.Instance=S,S.__name__="Instance";class k extends f{valid(ne){return(0,s.isNumber)(ne)}}e.Number=k,k.__name__="Number";class E extends k{valid(ne){return(0,s.isNumber)(ne)&&(0|ne)==ne}}e.Int=E,E.__name__="Int";class P extends k{}e.Angle=P,P.__name__="Angle";class N extends k{valid(ne){return(0,s.isNumber)(ne)&&0<=ne&&ne<=1}}e.Percent=N,N.__name__="Percent";class B extends f{valid(ne){return(0,s.isString)(ne)}}e.String=B,B.__name__="String";class D extends f{valid(ne){return ne===null||(0,s.isString)(ne)}}e.NullString=D,D.__name__="NullString";class j extends B{}e.FontSize=j,j.__name__="FontSize";class M extends B{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.Font=M,M.__name__="Font";class F extends f{valid(ne){return(0,s.isString)(ne)&&(0,c.includes)(this.enum_values,ne)}}function W(se){return class extends F{get enum_values(){return[...se]}}}e.EnumProperty=F,F.__name__="EnumProperty",e.Enum=W;class U extends F{get enum_values(){return[...p.Direction]}normalize(ne){const J=new Uint8Array(ne.length);for(let re=0;re<ne.length;re++)switch(ne[re]){case"clock":J[re]=0;break;case"anticlock":J[re]=1}return J}}e.Direction=U,U.__name__="Direction",e.Anchor=W(p.Anchor),e.AngleUnits=W(p.AngleUnits),e.BoxOrigin=W(p.BoxOrigin),e.ButtonType=W(p.ButtonType),e.CalendarPosition=W(p.CalendarPosition),e.Dimension=W(p.Dimension),e.Dimensions=W(p.Dimensions),e.Distribution=W(p.Distribution),e.FontStyle=W(p.FontStyle),e.HatchPatternType=W(p.HatchPatternType),e.HTTPMethod=W(p.HTTPMethod),e.HexTileOrientation=W(p.HexTileOrientation),e.HoverMode=W(p.HoverMode),e.LatLon=W(p.LatLon),e.LegendClickPolicy=W(p.LegendClickPolicy),e.LegendLocation=W(p.LegendLocation),e.LineCap=W(p.LineCap),e.LineJoin=W(p.LineJoin),e.LinePolicy=W(p.LinePolicy),e.Location=W(p.Location),e.Logo=W(p.Logo),e.MarkerType=W(p.MarkerType),e.MutedPolicy=W(p.MutedPolicy),e.Orientation=W(p.Orientation),e.OutputBackend=W(p.OutputBackend),e.PaddingUnits=W(p.PaddingUnits),e.Place=W(p.Place),e.PointPolicy=W(p.PointPolicy),e.RadiusDimension=W(p.RadiusDimension),e.RenderLevel=W(p.RenderLevel),e.RenderMode=W(p.RenderMode),e.ResetPolicy=W(p.ResetPolicy),e.RoundingFunction=W(p.RoundingFunction),e.Side=W(p.Side),e.SizingMode=W(p.SizingMode),e.Sort=W(p.Sort),e.SpatialUnits=W(p.SpatialUnits),e.StartEnd=W(p.StartEnd),e.StepMode=W(p.StepMode),e.TapBehavior=W(p.TapBehavior),e.TextAlign=W(p.TextAlign),e.TextBaseline=W(p.TextBaseline),e.TextureRepetition=W(p.TextureRepetition),e.TickLabelOrientation=W(p.TickLabelOrientation),e.TooltipAttachment=W(p.TooltipAttachment),e.UpdateMode=W(p.UpdateMode),e.VerticalAlign=W(p.VerticalAlign);class q extends f{get_value(){const{value:ne,expr:J,transform:re}=this.spec;return J!=null||re!=null?this.spec:ne}_update(ne){m(ne)?this.spec=ne:this.spec={value:ne},this.spec.value!=null&&this.validate(this.spec.value)}materialize(ne){return ne}scalar(ne,J){return new l.UniformScalar(ne,J)}uniform(ne){var J;const{expr:re,value:Qe,transform:Le}=this.spec,Re=(J=ne.get_length())!==null&&J!==void 0?J:1;if(re!=null){let ct=re.compute(ne);return Le!=null&&(ct=Le.compute(ct)),ct=this.materialize(ct),this.scalar(ct,Re)}{let ct=Qe;return Le!=null&&(ct=Le.compute(ct)),ct=this.materialize(ct),this.scalar(ct,Re)}}}e.ScalarSpec=q,q.__name__="ScalarSpec";class X extends q{}e.AnyScalar=X,X.__name__="AnyScalar";class ae extends q{}e.ColorScalar=ae,ae.__name__="ColorScalar";class me extends q{}e.NumberScalar=me,me.__name__="NumberScalar";class Ve extends q{}e.StringScalar=Ve,Ve.__name__="StringScalar";class Je extends q{}e.NullStringScalar=Je,Je.__name__="NullStringScalar";class rt extends q{}e.ArrayScalar=rt,rt.__name__="ArrayScalar";class yt extends q{}e.LineJoinScalar=yt,yt.__name__="LineJoinScalar";class xt extends q{}e.LineCapScalar=xt,xt.__name__="LineCapScalar";class r1 extends q{}e.LineDashScalar=r1,r1.__name__="LineDashScalar";class t1 extends q{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.FontScalar=t1,t1.__name__="FontScalar";class Bt extends q{}e.FontSizeScalar=Bt,Bt.__name__="FontSizeScalar";class Kt extends q{}e.FontStyleScalar=Kt,Kt.__name__="FontStyleScalar";class wt extends q{}e.TextAlignScalar=wt,wt.__name__="TextAlignScalar";class Rt extends q{}e.TextBaselineScalar=Rt,Rt.__name__="TextBaselineScalar";class Ht extends f{get_value(){return this.spec.value===null?null:this.spec}_update(ne){m(ne)?this.spec=ne:this.spec={value:ne},this.spec.value!=null&&this.validate(this.spec.value)}materialize(ne){return ne}v_materialize(ne){return ne}scalar(ne,J){return new l.UniformScalar(ne,J)}vector(ne){return new l.UniformVector(ne)}uniform(ne){var J;const{field:re,expr:Qe,value:Le,transform:Re}=this.spec,ct=(J=ne.get_length())!==null&&J!==void 0?J:1;if(re!=null){let Y=ne.get_column(re);return Y!=null?(Re!=null&&(Y=Re.v_compute(Y)),Y=this.v_materialize(Y),this.vector(Y)):(g.logger.warn(`attempted to retrieve property array for nonexistent field '${re}'`),this.scalar(null,ct))}if(Qe!=null){let Y=Qe.v_compute(ne);return Re!=null&&(Y=Re.v_compute(Y)),Y=this.v_materialize(Y),this.vector(Y)}{let Y=Le;return Re!=null&&(Y=Re.compute(Y)),Y=this.materialize(Y),this.scalar(Y,ct)}}array(ne){var J;let re;const Qe=(J=ne.get_length())!==null&&J!==void 0?J:1;if(this.spec.field!=null){const Le=ne.get_column(this.spec.field);if(Le!=null)re=this.normalize(Le);else{g.logger.warn(`attempted to retrieve property array for nonexistent field '${this.spec.field}'`);const Re=new Float64Array(Qe);Re.fill(NaN),re=Re}}else if(this.spec.expr!=null)re=this.normalize(this.spec.expr.v_compute(ne));else{const Le=this._value(!1);if((0,s.isNumber)(Le)){const Re=new Float64Array(Qe);Re.fill(Le),re=Re}else re=(0,c.repeat)(Le,Qe)}return this.spec.transform!=null&&(re=this.spec.transform.v_compute(re)),re}}e.VectorSpec=Ht,Ht.__name__="VectorSpec";class dt extends Ht{}e.DataSpec=dt,dt.__name__="DataSpec";class Wt extends Ht{_update(ne){super._update(ne);const{units:J}=this.spec;if(J!=null&&!(0,c.includes)(this.valid_units,J))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${J}`)}get units(){var ne;return(ne=this.spec.units)!==null&&ne!==void 0?ne:this.default_units}set units(ne){ne!=this.default_units?this.spec.units=ne:delete this.spec.units}}e.UnitsSpec=Wt,Wt.__name__="UnitsSpec";class jt extends Wt{array(ne){return new Float64Array(super.array(ne))}}e.NumberUnitsSpec=jt,jt.__name__="NumberUnitsSpec";class a1 extends dt{}e.BaseCoordinateSpec=a1,a1.__name__="BaseCoordinateSpec";class ye extends a1{}e.CoordinateSpec=ye,ye.__name__="CoordinateSpec";class ie extends a1{}e.CoordinateSeqSpec=ie,ie.__name__="CoordinateSeqSpec";class nt extends a1{}e.CoordinateSeqSeqSeqSpec=nt,nt.__name__="CoordinateSeqSeqSeqSpec";class St extends ye{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSpec=St,St.__name__="XCoordinateSpec";class mt extends ye{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSpec=mt,mt.__name__="YCoordinateSpec";class Pt extends ie{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSeqSpec=Pt,Pt.__name__="XCoordinateSeqSpec";class Xt extends ie{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSeqSpec=Xt,Xt.__name__="YCoordinateSeqSpec";class u1 extends nt{constructor(){super(...arguments),this.dimension="x"}}e.XCoordinateSeqSeqSeqSpec=u1,u1.__name__="XCoordinateSeqSeqSeqSpec";class v1 extends nt{constructor(){super(...arguments),this.dimension="y"}}e.YCoordinateSeqSeqSeqSpec=v1,v1.__name__="YCoordinateSeqSeqSeqSpec";class h1 extends jt{get default_units(){return"rad"}get valid_units(){return[...p.AngleUnits]}materialize(ne){return ne*-(0,r.to_radians_coeff)(this.units)}v_materialize(ne){const J=-(0,r.to_radians_coeff)(this.units),re=new Float32Array(ne.length);return(0,o.mul)(ne,J,re),re}array(ne){throw new Error("not supported")}}e.AngleSpec=h1,h1.__name__="AngleSpec";class De extends jt{get default_units(){return"data"}get valid_units(){return[...p.SpatialUnits]}}e.DistanceSpec=De,De.__name__="DistanceSpec";class Ze extends De{materialize(ne){return ne??NaN}}e.NullDistanceSpec=Ze,Ze.__name__="NullDistanceSpec";class $e extends dt{v_materialize(ne){return new Uint8Array(ne)}array(ne){return new Uint8Array(super.array(ne))}}e.BooleanSpec=$e,$e.__name__="BooleanSpec";class Qt extends dt{v_materialize(ne){return(0,s.isTypedArray)(ne)?ne:new Int32Array(ne)}array(ne){return new Int32Array(super.array(ne))}}e.IntSpec=Qt,Qt.__name__="IntSpec";class It extends dt{v_materialize(ne){return(0,s.isTypedArray)(ne)?ne:new Float64Array(ne)}array(ne){return new Float64Array(super.array(ne))}}e.NumberSpec=It,It.__name__="NumberSpec";class Ut extends It{valid(ne){return(0,s.isNumber)(ne)&&ne>=0}}e.ScreenSizeSpec=Ut,Ut.__name__="ScreenSizeSpec";class Zt extends dt{materialize(ne){return(0,i.encode_rgba)((0,i.color2rgba)(ne))}v_materialize(ne){if(!(0,u.is_NDArray)(ne)){const J=ne.length,re=new T.RGBAArray(4*J);let Qe=0;for(const Le of ne){const[Re,ct,Y,de]=(0,i.color2rgba)(Le);re[Qe++]=Re,re[Qe++]=ct,re[Qe++]=Y,re[Qe++]=de}return new T.ColorArray(re.buffer)}if(ne.dtype=="uint32"&&ne.dimension==1)return(0,t.to_big_endian)(ne);if(ne.dtype=="uint8"&&ne.dimension==1){const[J]=ne.shape,re=new T.RGBAArray(4*J);let Qe=0;for(const Le of ne)re[Qe++]=Le,re[Qe++]=Le,re[Qe++]=Le,re[Qe++]=255;return new T.ColorArray(re.buffer)}if(ne.dtype=="uint8"&&ne.dimension==2){const[J,re]=ne.shape;if(re==4)return new T.ColorArray(ne.buffer);if(re==3){const Qe=new T.RGBAArray(4*J);for(let Le=0,Re=0;Le<re*J;)Qe[Re++]=ne[Le++],Qe[Re++]=ne[Le++],Qe[Re++]=ne[Le++],Qe[Re++]=255;return new T.ColorArray(Qe.buffer)}}else if((ne.dtype=="float32"||ne.dtype=="float64")&&ne.dimension==2){const[J,re]=ne.shape;if(re==3||re==4){const Qe=new T.RGBAArray(4*J);for(let Le=0,Re=0;Le<re*J;)Qe[Re++]=255*ne[Le++],Qe[Re++]=255*ne[Le++],Qe[Re++]=255*ne[Le++],Qe[Re++]=255*(re==3?1:ne[Le++]);return new T.ColorArray(Qe.buffer)}}throw new Error("invalid color array")}vector(ne){return new l.ColorUniformVector(ne)}}e.ColorSpec=Zt,Zt.__name__="ColorSpec";class b1 extends dt{}e.NDArraySpec=b1,b1.__name__="NDArraySpec";class k1 extends dt{}e.AnySpec=k1,k1.__name__="AnySpec";class A1 extends dt{}e.StringSpec=A1,A1.__name__="StringSpec";class W1 extends dt{}e.NullStringSpec=W1,W1.__name__="NullStringSpec";class S1 extends dt{}e.ArraySpec=S1,S1.__name__="ArraySpec";class Z1 extends dt{}e.MarkerSpec=Z1,Z1.__name__="MarkerSpec";class o2 extends dt{}e.LineJoinSpec=o2,o2.__name__="LineJoinSpec";class d2 extends dt{}e.LineCapSpec=d2,d2.__name__="LineCapSpec";class Q2 extends dt{}e.LineDashSpec=Q2,Q2.__name__="LineDashSpec";class w2 extends dt{_default_override(){return a.settings.dev?"Bokeh":void 0}}e.FontSpec=w2,w2.__name__="FontSpec";class P2 extends dt{}e.FontSizeSpec=P2,P2.__name__="FontSizeSpec";class oe extends dt{}e.FontStyleSpec=oe,oe.__name__="FontStyleSpec";class K extends dt{}e.TextAlignSpec=K,K.__name__="TextAlignSpec";class ue extends dt{}e.TextBaselineSpec=ue,ue.__name__="TextBaselineSpec"},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13),g={};class p{constructor(i,t){this.name=i,this.level=t}}e.LogLevel=p,p.__name__="LogLevel";class T{constructor(i,t=T.INFO){this._name=i,this.set_level(t)}static get levels(){return Object.keys(T.log_levels)}static get(i,t=T.INFO){if(i.length>0){let s=g[i];return s==null&&(g[i]=s=new T(i,t)),s}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}get level(){return this.get_level()}get_level(){return this._log_level}set_level(i){if(i instanceof p)this._log_level=i;else{if(!(0,v.isString)(i)||T.log_levels[i]==null)throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=T.log_levels[i]}const t=`[${this._name}]`;for(const[s,a]of(0,w.entries)(T.log_levels))a.level<this._log_level.level||this._log_level.level===T.OFF.level?this[s]=function(){}:this[s]=c(s,t)}trace(...i){}debug(...i){}info(...i){}warn(...i){}error(...i){}}function c(r,i){return console[r]!=null?console[r].bind(console,i):console.log!=null?console.log.bind(console,i):function(){}}function o(r){const i=e.logger.level;return(0,v.isString)(r)&&T.log_levels[r]==null?(console.log(`[bokeh] unrecognized logging level '${r}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${T.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,v.isString)(r)?r:r.level}'`),e.logger.set_level(r)),i}e.Logger=T,T.__name__="Logger",T.TRACE=new p("trace",0),T.DEBUG=new p("debug",1),T.INFO=new p("info",2),T.WARN=new p("warn",6),T.ERROR=new p("error",7),T.FATAL=new p("fatal",8),T.OFF=new p("off",9),T.log_levels={trace:T.TRACE,debug:T.DEBUG,info:T.INFO,warn:T.WARN,error:T.ERROR,fatal:T.FATAL,off:T.OFF},e.logger=T.get("bokeh"),e.set_log_level=o,e.with_log_level=function(r,i){const t=o(r);try{i()}finally{o(t)}}},function(Q,O,e,C,R){C(),e.VerticalAlign=void 0;const v=Q(21);e.Align=(0,v.Enum)("start","center","end"),e.Anchor=(0,v.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),e.AngleUnits=(0,v.Enum)("deg","rad","grad","turn"),e.BoxOrigin=(0,v.Enum)("corner","center"),e.ButtonType=(0,v.Enum)("default","primary","success","warning","danger","light"),e.CalendarPosition=(0,v.Enum)("auto","above","below"),e.Dimension=(0,v.Enum)("width","height"),e.Dimensions=(0,v.Enum)("width","height","both"),e.Direction=(0,v.Enum)("clock","anticlock"),e.Distribution=(0,v.Enum)("uniform","normal"),e.FontStyle=(0,v.Enum)("normal","italic","bold","bold italic"),e.HatchPatternType=(0,v.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",">","*"),e.HTTPMethod=(0,v.Enum)("POST","GET"),e.HexTileOrientation=(0,v.Enum)("pointytop","flattop"),e.HoverMode=(0,v.Enum)("mouse","hline","vline"),e.LatLon=(0,v.Enum)("lat","lon"),e.LegendClickPolicy=(0,v.Enum)("none","hide","mute"),e.LegendLocation=e.Anchor,e.LineCap=(0,v.Enum)("butt","round","square"),e.LineJoin=(0,v.Enum)("miter","round","bevel"),e.LineDash=(0,v.Enum)("solid","dashed","dotted","dotdash","dashdot"),e.LinePolicy=(0,v.Enum)("prev","next","nearest","interp","none"),e.Location=(0,v.Enum)("above","below","left","right"),e.Logo=(0,v.Enum)("normal","grey"),e.MarkerType=(0,v.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"),e.MutedPolicy=(0,v.Enum)("show","ignore"),e.Orientation=(0,v.Enum)("vertical","horizontal"),e.OutputBackend=(0,v.Enum)("canvas","svg","webgl"),e.PaddingUnits=(0,v.Enum)("percent","absolute"),e.Place=(0,v.Enum)("above","below","left","right","center"),e.PointPolicy=(0,v.Enum)("snap_to_data","follow_mouse","none"),e.RadiusDimension=(0,v.Enum)("x","y","max","min"),e.RenderLevel=(0,v.Enum)("image","underlay","glyph","guide","annotation","overlay"),e.RenderMode=(0,v.Enum)("canvas","css"),e.ResetPolicy=(0,v.Enum)("standard","event_only"),e.RoundingFunction=(0,v.Enum)("round","nearest","floor","rounddown","ceil","roundup"),e.SelectionMode=(0,v.Enum)("replace","append","intersect","subtract"),e.Side=(0,v.Enum)("above","below","left","right"),e.SizingMode=(0,v.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),e.Sort=(0,v.Enum)("ascending","descending"),e.SpatialUnits=(0,v.Enum)("screen","data"),e.StartEnd=(0,v.Enum)("start","end"),e.StepMode=(0,v.Enum)("after","before","center"),e.TapBehavior=(0,v.Enum)("select","inspect"),e.TextAlign=(0,v.Enum)("left","right","center"),e.TextBaseline=(0,v.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),e.TextureRepetition=(0,v.Enum)("repeat","repeat_x","repeat_y","no_repeat"),e.TickLabelOrientation=(0,v.Enum)("vertical","horizontal","parallel","normal"),e.TooltipAttachment=(0,v.Enum)("horizontal","vertical","left","right","above","below"),e.UpdateMode=(0,v.Enum)("replace","append"),e.VerticalAlign=(0,v.Enum)("top","middle","bottom")},function(Q,O,e,C,R){C();const v=(0,Q(1).__importStar)(Q(8)),w=Q(22),g=Q(13),p=window.Map,{hasOwnProperty:T}=Object.prototype;class c{}e.Kind=c,c.__name__="Kind",(function(o){class r extends c{valid(j){return!0}}r.__name__="Any",o.Any=r;class i extends c{valid(j){return!0}}i.__name__="Unknown",o.Unknown=i;class t extends c{valid(j){return v.isBoolean(j)}}t.__name__="Boolean",o.Boolean=t;class s extends c{constructor(j){super(),this.obj_type=j}valid(j){return!0}}s.__name__="Ref",o.Ref=s;class a extends c{valid(j){return!0}}a.__name__="AnyRef",o.AnyRef=a;class u extends c{valid(j){return v.isNumber(j)}}u.__name__="Number",o.Number=u;class l extends u{valid(j){return super.valid(j)&&v.isInteger(j)}}l.__name__="Int",o.Int=l;class d extends u{valid(j){return super.valid(j)&&0<=j&&j<=1}}d.__name__="Percent",o.Percent=d;class m extends c{constructor(j){super(),this.types=j,this.types=j}valid(j){return this.types.some(M=>M.valid(j))}}m.__name__="Or",o.Or=m;class f extends c{constructor(j){super(),this.types=j,this.types=j}valid(j){if(!v.isArray(j))return!1;for(let M=0;M<this.types.length;M++){const F=this.types[M],W=j[M];if(!F.valid(W))return!1}return!0}}f.__name__="Tuple",o.Tuple=f;class b extends c{constructor(j){super(),this.struct_type=j}valid(j){if(!v.isPlainObject(j))return!1;const{struct_type:M}=this;if((0,g.size)(M)!=(0,g.size)(j))return!1;for(const F in M)if(T.call(M,F)){if(!T.call(j,F))return!1;const W=M[F],U=j[F];if(!W.valid(U))return!1}return!0}}b.__name__="Struct",o.Struct=b;class y extends c{valid(j){return v.isArray(j)||v.isTypedArray(j)}}y.__name__="Arrayable",o.Arrayable=y;class A extends c{constructor(j){super(),this.item_type=j}valid(j){return v.isArray(j)&&j.every(M=>this.item_type.valid(M))}}A.__name__="Array",o.Array=A;class L extends c{valid(j){return j===null}}L.__name__="Null",o.Null=L;class x extends c{constructor(j){super(),this.base_type=j}valid(j){return j===null||this.base_type.valid(j)}}x.__name__="Nullable",o.Nullable=x;class H extends c{constructor(j){super(),this.base_type=j}valid(j){return j===void 0||this.base_type.valid(j)}}H.__name__="Opt",o.Opt=H;class S extends c{valid(j){return v.isString(j)}}S.__name__="String",o.String=S;class k extends c{constructor(j){super(),this.values=new Set(j)}valid(j){return this.values.has(j)}*[Symbol.iterator](){yield*this.values}}k.__name__="Enum",o.Enum=k;class E extends c{constructor(j){super(),this.item_type=j}valid(j){if(!v.isPlainObject(j))return!1;for(const M in j)if(T.call(j,M)){const F=j[M];if(!this.item_type.valid(F))return!1}return!0}}E.__name__="Dict",o.Dict=E;class P extends c{constructor(j,M){super(),this.key_type=j,this.item_type=M}valid(j){if(!(j instanceof p))return!1;for(const[M,F]of j.entries())if(!this.key_type.valid(M)||!this.item_type.valid(F))return!1;return!0}}P.__name__="Map",o.Map=P;class N extends c{valid(j){return(0,w.is_Color)(j)}}N.__name__="Color",o.Color=N;class B extends c{valid(j){return v.isFunction(j)}}B.__name__="Function",o.Function=B})(e.Kinds||(e.Kinds={})),e.Any=new e.Kinds.Any,e.Unknown=new e.Kinds.Unknown,e.Boolean=new e.Kinds.Boolean,e.Number=new e.Kinds.Number,e.Int=new e.Kinds.Int,e.String=new e.Kinds.String,e.Null=new e.Kinds.Null,e.Nullable=o=>new e.Kinds.Nullable(o),e.Opt=o=>new e.Kinds.Opt(o),e.Or=(...o)=>new e.Kinds.Or(o),e.Tuple=(...o)=>new e.Kinds.Tuple(o),e.Struct=o=>new e.Kinds.Struct(o),e.Arrayable=new e.Kinds.Arrayable,e.Array=o=>new e.Kinds.Array(o),e.Dict=o=>new e.Kinds.Dict(o),e.Map=(o,r)=>new e.Kinds.Map(o,r),e.Enum=(...o)=>new e.Kinds.Enum(o),e.Ref=o=>new e.Kinds.Ref(o),e.AnyRef=()=>new e.Kinds.AnyRef,e.Function=()=>new e.Kinds.Function,e.Percent=new e.Kinds.Percent,e.Alpha=e.Percent,e.Color=new e.Kinds.Color,e.Auto=(0,e.Enum)("auto"),e.FontSize=e.String,e.Font=e.String,e.Angle=e.Number},function(Q,O,e,C,R){C();const v=Q(23),w=Q(10),g=Q(8),{round:p}=Math;function T(d){return(0,w.clamp)(p(d),0,255)}function c(){return[0,0,0,0]}function o(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]}function r(d,m){var f;let b,y,A,L;return d==null?[b,y,A,L]=[0,0,0,0]:(0,g.isInteger)(d)?[b,y,A,L]=o(d):(0,g.isString)(d)?[b,y,A,L]=(f=l(d))!==null&&f!==void 0?f:[0,0,0,0]:([b,y,A,L=1]=d,L=T(255*L)),L==255&&m!=null&&(L=T(255*m)),[b,y,A,L]}e.transparent=c,e.encode_rgba=function([d,m,f,b]){return d<<24|m<<16|f<<8|b},e.decode_rgba=o,e.compose_alpha=function(d,m){return(255&d)==255?4294967040&d|T(255*m):d},e.color2rgba=r;const i={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 t(d){return i[d>>4]+i[15&d]}e.color2css=function(d,m){const[f,b,y,A]=r(d,m);return`rgba(${f}, ${b}, ${y}, ${A/255})`},e.color2hex=function(d,m){const[f,b,y,A]=r(d,m),L=`#${t(f)}${t(b)}${t(y)}`;return A==255?L:`${L}${t(A)}`},e.color2hexrgb=function(d){const[m,f,b]=r(d);return`#${t(m)}${t(f)}${t(b)}`};const s=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,a=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,u=(()=>{const d=document.createElement("canvas");d.width=1,d.height=1;const m=d.getContext("2d"),f=m.createLinearGradient(0,0,1,1);return b=>{m.fillStyle=f,m.fillStyle=b;const y=m.fillStyle;return y!=f?y:null}})();function l(d){var m;if(!(d=d.trim().toLowerCase()))return null;if(d=="transparent")return[0,0,0,0];if((0,v.is_named_color)(d))return o(v.named_colors[d]);if(d[0]=="#"){const f=+`0x${d.substr(1)}`;if(isNaN(f))return null;switch(d.length-1){case 3:{const b=f>>8&15,y=f>>4&15,A=f>>0&15;return[b<<4|b,y<<4|y,A<<4|A,255]}case 4:{const b=f>>12&15,y=f>>8&15,A=f>>4&15,L=f>>0&15;return[b<<4|b,y<<4|y,A<<4|A,L<<4|L]}case 6:return[f>>16&255,f>>8&255,f>>0&255,255];case 8:return[f>>24&255,f>>16&255,f>>8&255,f>>0&255]}}else if(d.startsWith("rgb")){const f=(m=d.match(s))!==null&&m!==void 0?m:d.match(a);if(f!=null){let[,b,y,A,L="1"]=f;const x=b.endsWith("%"),H=y.endsWith("%"),S=A.endsWith("%"),k=L.endsWith("%");if(!(x&&H&&S)&&(x||H||S))return null;x&&(b=b.slice(0,-1)),H&&(y=y.slice(0,-1)),S&&(A=A.slice(0,-1)),k&&(L=L.slice(0,-1));let E=Number(b),P=Number(y),N=Number(A),B=Number(L);return isNaN(E+P+N+B)?null:(x&&(E=E/100*255),H&&(P=P/100*255),S&&(N=N/100*255),B=255*(k?B/100:B),E=T(E),P=T(P),N=T(N),B=T(B),[E,P,N,B])}}else{const f=u(d);if(f!=null)return l(f)}return null}e.css4_parse=l,e.is_Color=function(d){return!!(0,g.isInteger)(d)||!(!(0,g.isString)(d)||l(d)==null)||!(!(0,g.isArray)(d)||d.length!=3&&d.length!=4)},e.is_dark=function([d,m,f]){return 1-(.299*d+.587*m+.114*f)/255>=.6}},function(Q,O,e,C,R){C(),e.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},e.is_named_color=function(v){return v in e.named_colors}},function(Q,O,e,C,R){C(),e.GeneratorFunction=Object.getPrototypeOf(function*(){}).constructor,e.ColorArray=Uint32Array,e.RGBAArray=Uint8ClampedArray,e.infer_type=function(v,w){return v instanceof Float64Array||v instanceof Array||w instanceof Float64Array||w instanceof Array?Float64Array:Float32Array},e.ScreenArray=Float32Array,e.to_screen=function(v){return v instanceof Float32Array?v:Float32Array.from(v)},R("Indices",Q(25).BitSet)},function(Q,O,e,C,R){var v;C();const w=Q(26),g=Q(11);class p{constructor(c,o=0){this.size=c,this[v]="BitSet",this._count=null,this._nwords=Math.ceil(c/32),o==0||o==1?(this._array=new Uint32Array(this._nwords),o==1&&this._array.fill(4294967295)):((0,g.assert)(o.length==this._nwords,"Initializer size mismatch"),this._array=o)}clone(){return new p(this.size,new Uint32Array(this._array))}[(v=Symbol.toStringTag,w.equals)](c,o){if(!o.eq(this.size,c.size))return!1;const{_nwords:r}=this,i=this.size%r,t=i==0?r:r-1;for(let s=0;s<t;s++)if(this._array[s]!=c._array[s])return!1;if(i==0)return!0;{const s=1<<i-1,a=s-1^s;return(this._array[t]&a)==(c._array[t]&a)}}static all_set(c){return new p(c,1)}static all_unset(c){return new p(c,0)}static from_indices(c,o){const r=new p(c);for(const i of o)r.set(i);return r}static from_booleans(c,o){const r=new p(c),i=Math.min(c,o.length);for(let t=0;t<i;t++)o[t]&&r.set(t);return r}_check_bounds(c){(0,g.assert)(0<=c&&c<this.size,`Out of bounds: 0 <= ${c} < ${this.size}`)}get(c){this._check_bounds(c);const o=c>>>5,r=31&c;return!!(this._array[o]>>r&1)}set(c,o=!0){this._check_bounds(c),this._count=null;const r=c>>>5,i=31&c;o?this._array[r]|=1<<i:this._array[r]&=~(1<<i)}unset(c){this.set(c,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let c=this._count;return c==null&&(this._count=c=this._get_count()),c}_get_count(){const{_array:c,_nwords:o,size:r}=this;let i=0;for(let t=0,s=0;s<o;s++){const a=c[s];if(a==0)t+=32;else for(let u=0;u<32&&t<r;u++,t++)a>>>u&1&&(i+=1)}return i}*ones(){const{_array:c,_nwords:o,size:r}=this;for(let i=0,t=0;t<o;t++){const s=c[t];if(s!=0)for(let a=0;a<32&&i<r;a++,i++)s>>>a&1&&(yield i);else i+=32}}*zeros(){const{_array:c,_nwords:o,size:r}=this;for(let i=0,t=0;t<o;t++){const s=c[t];if(s!=4294967295)for(let a=0;a<32&&i<r;a++,i++)s>>>a&1||(yield i);else i+=32}}_check_size(c){(0,g.assert)(this.size==c.size,"Size mismatch")}add(c){this._check_size(c);for(let o=0;o<this._nwords;o++)this._array[o]|=c._array[o]}intersect(c){this._check_size(c);for(let o=0;o<this._nwords;o++)this._array[o]&=c._array[o]}subtract(c){this._check_size(c);for(let o=0;o<this._nwords;o++){const r=this._array[o],i=c._array[o];this._array[o]=(r^i)&r}}union(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++)o._array[r]|=c._array[r];return o}intersection(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++)o._array[r]&=c._array[r];return o}difference(c){this._check_size(c);const o=this.clone();for(let r=0;r<this._nwords;r++){const i=this._array[r],t=c._array[r];o._array[r]=(i^t)&i}return o}select(c){(0,g.assert)(this.size<=c.length,"Size mismatch");const o=this.count,r=new c.constructor(o);let i=0;for(const t of this)r[i++]=c[t];return r}}e.BitSet=p,p.__name__="BitSet"},function(Q,O,e,C,R){C();const v=Q(8),{hasOwnProperty:w}=Object.prototype;function g(i){return(0,v.isObject)(i)&&i[e.equals]!==void 0}e.equals=Symbol("equals"),e.wildcard=Symbol("wildcard");const p=Object.prototype.toString;class T{constructor(){this.a_stack=[],this.b_stack=[]}eq(t,s){if(Object.is(t,s)||t===e.wildcard||s===e.wildcard)return!0;if(t==null||s==null)return t===s;const a=p.call(t);if(a!=p.call(s))return!1;switch(a){case"[object Number]":return this.numbers(t,s);case"[object RegExp]":case"[object String]":return`${t}`==`${s}`;case"[object Date]":case"[object Boolean]":return+t==+s}const{a_stack:u,b_stack:l}=this;let d=u.length;for(;d--;)if(u[d]===t)return l[d]===s;u.push(t),l.push(s);const m=(()=>{if(g(t)&&g(s))return t[e.equals](s,this);switch(a){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,s);case"[object Map]":return this.maps(t,s);case"[object Set]":return this.sets(t,s);case"[object Object]":if(t.constructor==s.constructor&&(t.constructor==null||t.constructor===Object))return this.objects(t,s);case"[object Function]":if(t.constructor==s.constructor&&t.constructor===Function)return this.eq(`${t}`,`${s}`)}if(t instanceof Node)return this.nodes(t,s);throw Error(`can't compare objects of type ${a}`)})();return u.pop(),l.pop(),m}numbers(t,s){return Object.is(t,s)}arrays(t,s){const{length:a}=t;if(a!=s.length)return!1;for(let u=0;u<a;u++)if(!this.eq(t[u],s[u]))return!1;return!0}iterables(t,s){const a=t[Symbol.iterator](),u=s[Symbol.iterator]();for(;;){const l=a.next(),d=u.next();if(l.done&&d.done)return!0;if(l.done||d.done||!this.eq(l.value,d.value))return!1}}maps(t,s){if(t.size!=s.size)return!1;for(const[a,u]of t)if(!s.has(a)||!this.eq(u,s.get(a)))return!1;return!0}sets(t,s){if(t.size!=s.size)return!1;for(const a of t)if(!s.has(a))return!1;return!0}objects(t,s){const a=Object.keys(t);if(a.length!=Object.keys(s).length)return!1;for(const u of a)if(!w.call(s,u)||!this.eq(t[u],s[u]))return!1;return!0}nodes(t,s){return t.nodeType==s.nodeType&&t.textContent==s.textContent&&!!this.iterables(t.childNodes,s.childNodes)}}e.Comparator=T,T.__name__="Comparator";const{abs:c}=Math;class o extends T{constructor(t=1e-4){super(),this.tolerance=t}numbers(t,s){return super.numbers(t,s)||c(t-s)<this.tolerance}}function r(i,t){return new T().eq(i,t)}e.SimilarComparator=o,o.__name__="SimilarComparator",e.is_equal=r,e.is_similar=function(i,t,s){return new o(s).eq(i,t)},e.isEqual=r},function(Q,O,e,C,R){C(),e.is_windows=navigator.appVersion.includes("Windows"),e.is_ie=(()=>{const v=navigator.userAgent;return v.includes("MSIE")||v.includes("Trident")||v.includes("Edge")})(),e.is_mobile=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),e.is_little_endian=(()=>{const v=new ArrayBuffer(4),w=new Uint8Array(v);new Uint32Array(v)[1]=168496141;let g=!0;return w[4]==10&&w[5]==11&&w[6]==12&&w[7]==13&&(g=!1),g})(),e.BYTE_ORDER=e.is_little_endian?"little":"big",e.to_big_endian=function(v){if(e.is_little_endian){const w=new Uint32Array(v.length),g=new DataView(w.buffer);let p=0;for(const T of v)g.setUint32(p,T),p+=4;return w}return v}},function(V,Q,O,e,C){e();class R{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(w){this._dev=w}get dev(){return this._dev}set wireframe(w){this._wireframe=w}get wireframe(){return this._wireframe}set force_webgl(w){this._force_webgl=w}get force_webgl(){return this._force_webgl}}O.Settings=R,R.__name__="Settings",O.settings=new R},function(Q,O,e,C,R){var v,w,g,p,T,c,o,r;C();const i=Q(8),t=Q(11),s=Q(26),a=Q(30),u=Q(31),l=Symbol("__ndarray__");class d extends Uint8Array{constructor(k,E){super(k),this[v]=!0,this.dtype="uint8",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>d.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>d.prototype[a.serialize].call(this,P))}[(v=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint8NDArray=d,d.__name__="Uint8NDArray";class m extends Int8Array{constructor(k,E){super(k),this[w]=!0,this.dtype="int8",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>m.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>m.prototype[a.serialize].call(this,P))}[(w=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int8NDArray=m,m.__name__="Int8NDArray";class f extends Uint16Array{constructor(k,E){super(k),this[g]=!0,this.dtype="uint16",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>f.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>f.prototype[a.serialize].call(this,P))}[(g=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint16NDArray=f,f.__name__="Uint16NDArray";class b extends Int16Array{constructor(k,E){super(k),this[p]=!0,this.dtype="int16",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>b.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>b.prototype[a.serialize].call(this,P))}[(p=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int16NDArray=b,b.__name__="Int16NDArray";class y extends Uint32Array{constructor(k,E){super(k),this[T]=!0,this.dtype="uint32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>y.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>y.prototype[a.serialize].call(this,P))}[(T=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Uint32NDArray=y,y.__name__="Uint32NDArray";class A extends Int32Array{constructor(k,E){super(k),this[c]=!0,this.dtype="int32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>A.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>A.prototype[a.serialize].call(this,P))}[(c=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Int32NDArray=A,A.__name__="Int32NDArray";class L extends Float32Array{constructor(k,E){super(k),this[o]=!0,this.dtype="float32",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>L.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>L.prototype[a.serialize].call(this,P))}[(o=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}e.Float32NDArray=L,L.__name__="Float32NDArray";class x extends Float64Array{constructor(k,E){super(k),this[r]=!0,this.dtype="float64",this.shape=E??(H(k)?k.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(P,N)=>x.prototype[s.equals].call(this,P,N)),this[a.serialize]==null&&(this[a.serialize]=P=>x.prototype[a.serialize].call(this,P))}[(r=l,s.equals)](k,E){return E.eq(this.shape,k.shape)&&E.arrays(this,k)}[a.serialize](k){return(0,u.encode_NDArray)(this)}}function H(S){return(0,i.isObject)(S)&&S[l]!==void 0}e.Float64NDArray=x,x.__name__="Float64NDArray",e.is_NDArray=H,e.ndarray=function(S,k={}){let{dtype:E}=k;E==null&&(E=S instanceof ArrayBuffer||(0,i.isArray)(S)?"float64":(()=>{switch(!0){case S instanceof Uint8Array:return"uint8";case S instanceof Int8Array:return"int8";case S instanceof Uint16Array:return"uint16";case S instanceof Int16Array:return"int16";case S instanceof Uint32Array:return"uint32";case S instanceof Int32Array:return"int32";case S instanceof Float32Array:return"float32";case S instanceof Float64Array:return"float64";default:(0,t.unreachable)()}})());const{shape:P}=k;switch(E){case"uint8":return new d(S,P);case"int8":return new m(S,P);case"uint16":return new f(S,P);case"int16":return new b(S,P);case"uint32":return new y(S,P);case"int32":return new A(S,P);case"float32":return new L(S,P);case"float64":return new x(S,P)}}},function(Q,O,e,C,R){C();const v=Q(11),w=Q(13),g=Q(8);e.serialize=Symbol("serialize");class p extends Error{}e.SerializationError=p,p.__name__="SerializationError";class T{constructor(o){var r;this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=(r=o?.include_defaults)===null||r===void 0||r}get_ref(o){return this._references.get(o)}add_ref(o,r){(0,v.assert)(!this._references.has(o)),this._references.set(o,r)}add_def(o,r){const i=this.get_ref(o);(0,v.assert)(i!=null),this._definitions.set(o,r),this._refmap.set(i,r)}get objects(){return new Set(this._references.keys())}get references(){return new Set(this._references.values())}get definitions(){return new Set(this._definitions.values())}resolve_ref(o){return this._refmap.get(o)}remove_ref(o){return this._references.delete(o)}remove_def(o){return this._definitions.delete(o)}to_serializable(o){const r=this.get_ref(o);if(r!=null)return r;if((function(i){return(0,g.isObject)(i)&&i[e.serialize]!==void 0})(o))return o[e.serialize](this);if((0,g.isArray)(o)||(0,g.isTypedArray)(o)){const i=o.length,t=new Array(i);for(let s=0;s<i;s++){const a=o[s];t[s]=this.to_serializable(a)}return t}if((0,g.isPlainObject)(o)){const i={};for(const[t,s]of(0,w.entries)(o))i[t]=this.to_serializable(s);return i}if(o===null||(0,g.isBoolean)(o)||(0,g.isNumber)(o)||(0,g.isString)(o))return o;throw new p(`${Object.prototype.toString.call(o)} is not serializable`)}}e.Serializer=T,T.__name__="Serializer"},function(V,Q,O,e,C){e();const R=V(8),v=V(27),w=V(32);O.is_NDArray_ref=function(g){return(0,R.isPlainObject)(g)&&("__buffer__"in g||"__ndarray__"in g)},O.decode_NDArray=function(g,p){const{shape:T,dtype:c,order:o}=g;let r;if("__buffer__"in g){const i=p.get(g.__buffer__);if(i==null)throw new Error(`buffer for ${g.__buffer__} not found`);r=i}else r=(0,w.base64_to_buffer)(g.__ndarray__);return o!==v.BYTE_ORDER&&(0,w.swap)(r,c),{buffer:r,dtype:c,shape:T}},O.encode_NDArray=function(g,p){const T={order:v.BYTE_ORDER,dtype:g.dtype,shape:g.shape};if(p!=null){const c=`${p.size}`;return p.set(c,g.buffer),Object.assign({__buffer__:c},T)}return Object.assign({__ndarray__:{toJSON:()=>(0,w.buffer_to_base64)(g.buffer)}},T)}},function(Q,O,e,C,R){C(),e.buffer_to_base64=function(v){const w=new Uint8Array(v),g=Array.from(w).map(p=>String.fromCharCode(p));return btoa(g.join(""))},e.base64_to_buffer=function(v){const w=atob(v),g=w.length,p=new Uint8Array(g);for(let T=0,c=g;T<c;T++)p[T]=w.charCodeAt(T);return p.buffer},e.swap=function(v,w){switch(w){case"uint16":case"int16":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=2){const o=p[T];p[T]=p[T+1],p[T+1]=o}})(v);break;case"uint32":case"int32":case"float32":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=4){let o=p[T];p[T]=p[T+3],p[T+3]=o,o=p[T+1],p[T+1]=p[T+2],p[T+2]=o}})(v);break;case"float64":(function(g){const p=new Uint8Array(g);for(let T=0,c=p.length;T<c;T+=8){let o=p[T];p[T]=p[T+7],p[T+7]=o,o=p[T+1],p[T+1]=p[T+6],p[T+6]=o,o=p[T+2],p[T+2]=p[T+5],p[T+5]=o,o=p[T+3],p[T+3]=p[T+4],p[T+4]=o}})(v)}}},function(Q,O,e,C,R){C();const v=Q(26);class w{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}e.Uniform=w,w.__name__="Uniform";class g extends w{constructor(o,r){super(),this.value=o,this.length=r,this.is_scalar=!0}get(o){return this.value}*[Symbol.iterator](){const{length:o,value:r}=this;for(let i=0;i<o;i++)yield r}select(o){return new g(this.value,o.count)}[v.equals](o,r){return r.eq(this.length,o.length)&&r.eq(this.value,o.value)}}e.UniformScalar=g,g.__name__="UniformScalar";class p extends w{constructor(o){super(),this.array=o,this.is_scalar=!1,this.length=this.array.length}get(o){return this.array[o]}*[Symbol.iterator](){yield*this.array}select(o){const r=o.select(this.array);return new this.constructor(r)}[v.equals](o,r){return r.eq(this.length,o.length)&&r.eq(this.array,o.array)}}e.UniformVector=p,p.__name__="UniformVector";class T extends p{constructor(o){super(o),this.array=o,this._view=new DataView(o.buffer)}get(o){return this._view.getUint32(4*o)}*[Symbol.iterator](){const o=this.length;for(let r=0;r<o;r++)yield this.get(r)}}e.ColorUniformVector=T,T.__name__="ColorUniformVector"},function(Q,O,e,C,R){C();const v=Q(28);function w(){const p=new Array(32),T="0123456789ABCDEF";for(let c=0;c<32;c++)p[c]=T.substr(Math.floor(16*Math.random()),1);return p[12]="4",p[16]=T.substr(3&p[16].charCodeAt(0)|8,1),p.join("")}e.startsWith=function(p,T,c=0){return p.substr(c,T.length)==T},e.uuid4=w;let g=1e3;e.uniqueId=function(p){const T=v.settings.dev?"j"+g++:w();return p!=null?`${p}-${T}`:T},e.escape=function(p){return p.replace(/(?:[&<>"'`])/g,T=>{switch(T){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return T}})},e.unescape=function(p){return p.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,(T,c)=>{switch(c){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return c}})},e.use_strict=function(p){return`'use strict';
2
2
  ${p}`},e.to_fixed=function(p,T){return p.toFixed(T).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")}},function(Q,O,e,C,R){C();const v=Q(30);class w{constructor(u){this.document=u}}e.DocumentEvent=w,w.__name__="DocumentEvent";class g extends w{constructor(u,l,d){super(u),this.events=l,this.setter_id=d}}e.DocumentEventBatch=g,g.__name__="DocumentEventBatch";class p extends w{}e.DocumentChangedEvent=p,p.__name__="DocumentChangedEvent";class T extends p{constructor(u,l,d){super(u),this.msg_type=l,this.msg_data=d}[v.serialize](u){const l=this.msg_data,d=u.to_serializable(l);return{kind:"MessageSent",msg_type:this.msg_type,msg_data:d}}}e.MessageSentEvent=T,T.__name__="MessageSentEvent";class c extends p{constructor(u,l,d,m,f,b,y){super(u),this.model=l,this.attr=d,this.old=m,this.new_=f,this.setter_id=b,this.hint=y}[v.serialize](u){if(this.hint!=null)return u.to_serializable(this.hint);const l=this.new_,d=u.to_serializable(l);return this.model!=l&&u.remove_def(this.model),{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:d}}}e.ModelChangedEvent=c,c.__name__="ModelChangedEvent";class o extends p{constructor(u,l,d){super(u),this.column_source=l,this.patches=d}[v.serialize](u){return{kind:"ColumnsPatched",column_source:this.column_source,patches:this.patches}}}e.ColumnsPatchedEvent=o,o.__name__="ColumnsPatchedEvent";class r extends p{constructor(u,l,d,m){super(u),this.column_source=l,this.data=d,this.rollover=m}[v.serialize](u){return{kind:"ColumnsStreamed",column_source:this.column_source,data:this.data,rollover:this.rollover}}}e.ColumnsStreamedEvent=r,r.__name__="ColumnsStreamedEvent";class i extends p{constructor(u,l,d){super(u),this.title=l,this.setter_id=d}[v.serialize](u){return{kind:"TitleChanged",title:this.title}}}e.TitleChangedEvent=i,i.__name__="TitleChangedEvent";class t extends p{constructor(u,l,d){super(u),this.model=l,this.setter_id=d}[v.serialize](u){return{kind:"RootAdded",model:u.to_serializable(this.model)}}}e.RootAddedEvent=t,t.__name__="RootAddedEvent";class s extends p{constructor(u,l,d){super(u),this.model=l,this.setter_id=d}[v.serialize](u){return{kind:"RootRemoved",model:this.model.ref()}}}e.RootRemovedEvent=s,s.__name__="RootRemovedEvent"},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13);e.pretty=Symbol("pretty");class g{constructor(T){this.visited=new Set,this.precision=T?.precision}to_string(T){if((0,v.isObject)(T)){if(this.visited.has(T))return"<circular>";this.visited.add(T)}return(function(c){return(0,v.isObject)(c)&&c[e.pretty]!==void 0})(T)?T[e.pretty](this):(0,v.isBoolean)(T)?this.boolean(T):(0,v.isNumber)(T)?this.number(T):(0,v.isString)(T)?this.string(T):(0,v.isArray)(T)?this.array(T):(0,v.isIterable)(T)?this.iterable(T):(0,v.isPlainObject)(T)?this.object(T):(0,v.isSymbol)(T)?this.symbol(T):`${T}`}token(T){return T}boolean(T){return`${T}`}number(T){return this.precision!=null?T.toFixed(this.precision):`${T}`}string(T){return`"${T.replace(/'/g,"\\'")}"`}symbol(T){return T.toString()}array(T){const c=this.token,o=[];for(const r of T)o.push(this.to_string(r));return`${c("[")}${o.join(`${c(",")} `)}${c("]")}`}iterable(T){var c;const o=this.token,r=(c=Object(T)[Symbol.toStringTag])!==null&&c!==void 0?c:"Object",i=this.array(T);return`${r}${o("(")}${i}${o(")")}`}object(T){const c=this.token,o=[];for(const[r,i]of(0,w.entries)(T))o.push(`${r}${c(":")} ${this.to_string(i)}`);return`${c("{")}${o.join(`${c(",")} `)}${c("}")}`}}e.Printer=g,g.__name__="Printer",e.to_string=function(p,T){return new g(T).to_string(p)}},function(Q,O,e,C,R){C();const v=Q(13),w=Q(8);function g(c){return(0,w.isObject)(c)&&c[e.clone]!==void 0}e.clone=Symbol("clone"),e.is_Cloneable=g;class p extends Error{}e.CloningError=p,p.__name__="CloningError";class T{constructor(){}clone(o){if(g(o))return o[e.clone](this);if((0,w.isArray)(o)){const r=o.length,i=new Array(r);for(let t=0;t<r;t++){const s=o[t];i[t]=this.clone(s)}return i}if((0,w.isPlainObject)(o)){const r={};for(const[i,t]of(0,v.entries)(o))r[i]=this.clone(t);return r}if(o===null||(0,w.isBoolean)(o)||(0,w.isNumber)(o)||(0,w.isString)(o))return o;throw new p(`${Object.prototype.toString.call(o)} is not cloneable`)}}e.Cloner=T,T.__name__="Cloner"},function(V,Q,O,e,C){e();const R=V(1);(0,R.__exportStar)(V(39),O),(0,R.__exportStar)(V(127),O),(0,R.__exportStar)(V(244),O),(0,R.__exportStar)(V(248),O),(0,R.__exportStar)(V(253),O),(0,R.__exportStar)(V(262),O),(0,R.__exportStar)(V(192),O),(0,R.__exportStar)(V(267),O),(0,R.__exportStar)(V(301),O),(0,R.__exportStar)(V(305),O),(0,R.__exportStar)(V(307),O),(0,R.__exportStar)(V(196),O),(0,R.__exportStar)(V(320),O),(0,R.__exportStar)(V(321),O),(0,R.__exportStar)(V(329),O),(0,R.__exportStar)(V(337),O),(0,R.__exportStar)(V(206),O),(0,R.__exportStar)(V(338),O),(0,R.__exportStar)(V(204),O),(0,R.__exportStar)(V(340),O),(0,R.__exportStar)(V(341),O),(0,R.__exportStar)(V(168),O),(0,R.__exportStar)(V(346),O),(0,R.__exportStar)(V(356),O),(0,R.__exportStar)(V(360),O)},function(Q,O,e,C,R){C(),R("Annotation",Q(40).Annotation),R("Arrow",Q(68).Arrow),R("ArrowHead",Q(112).ArrowHead),R("OpenHead",Q(112).OpenHead),R("NormalHead",Q(112).NormalHead),R("TeeHead",Q(112).TeeHead),R("VeeHead",Q(112).VeeHead),R("Band",Q(114).Band),R("BoxAnnotation",Q(116).BoxAnnotation),R("ColorBar",Q(117).ColorBar),R("Label",Q(212).Label),R("LabelSet",Q(213).LabelSet),R("Legend",Q(214).Legend),R("LegendItem",Q(215).LegendItem),R("PolyAnnotation",Q(217).PolyAnnotation),R("Slope",Q(218).Slope),R("Span",Q(219).Span),R("TextAnnotation",Q(119).TextAnnotation),R("Title",Q(118).Title),R("ToolbarPanel",Q(220).ToolbarPanel),R("Tooltip",Q(241).Tooltip),R("Whisker",Q(243).Whisker)},function(Q,O,e,C,R){var v;C();const w=Q(41);class g extends w.RendererView{get_size(){if(this.model.visible){const{width:c,height:o}=this._get_size();return{width:Math.round(c),height:Math.round(o)}}return{width:0,height:0}}_get_size(){throw new Error("not implemented")}connect_signals(){super.connect_signals();const c=this.model.properties;this.on_change(c.visible,()=>{this.layout!=null&&(this.layout.visible=this.model.visible,this.plot_view.request_layout())})}get needs_clip(){return this.layout==null}serializable_state(){const c=super.serializable_state();return this.layout==null?c:Object.assign(Object.assign({},c),{bbox:this.layout.bbox.box})}}e.AnnotationView=g,g.__name__="AnnotationView";class p extends w.Renderer{constructor(c){super(c)}}e.Annotation=p,v=p,p.__name__="Annotation",v.override({level:"annotation"})},function(Q,O,e,C,R){C();const v=Q(1);var w,g;const p=Q(42),T=(0,v.__importStar)(Q(45)),c=Q(20),o=Q(53),r=Q(54);class i extends o.Model{constructor(u){super(u)}}e.RendererGroup=i,w=i,i.__name__="RendererGroup",w.define(({Boolean:a})=>({visible:[a,!0]}));class t extends p.View{get coordinates(){const{_coordinates:u}=this;return u??(this._coordinates=this._initialize_coordinates())}initialize(){super.initialize(),this.visuals=new T.Visuals(this),this.needs_webgl_blit=!1}connect_signals(){super.connect_signals();const{x_range_name:u,y_range_name:l}=this.model.properties;this.on_change([u,l],()=>this._initialize_coordinates());const{group:d}=this.model;d!=null&&this.on_change(d.properties.visible,()=>{this.model.visible=d.visible})}_initialize_coordinates(){const{coordinates:u}=this.model,{frame:l}=this.plot_view;if(u!=null)return u.get_transform(l);{const{x_range_name:d,y_range_name:m}=this.model,f=l.x_scales.get(d),b=l.y_scales.get(m);return new r.CoordinateTransform(f,b)}}get plot_view(){return this.parent}get plot_model(){return this.parent.model}get layer(){const{overlays:u,primary:l}=this.canvas;return this.model.level=="overlay"?u:l}get canvas(){return this.plot_view.canvas_view}request_render(){this.request_paint()}request_paint(){this.plot_view.request_paint(this)}request_layout(){this.plot_view.request_layout()}notify_finished(){this.plot_view.notify_finished()}notify_finished_after_paint(){this.plot_view.notify_finished_after_paint()}get needs_clip(){return!1}get has_webgl(){return!1}render(){this.model.visible&&this._render(),this._has_finished=!0}renderer_view(u){}}e.RendererView=t,t.__name__="RendererView";class s extends o.Model{constructor(u){super(u)}}e.Renderer=s,g=s,s.__name__="Renderer",g.define(({Boolean:a,String:u,Ref:l,Nullable:d})=>({group:[d(l(i)),null],level:[c.RenderLevel,"image"],visible:[a,!0],x_range_name:[u,"default"],y_range_name:[u,"default"],coordinates:[d(l(r.CoordinateMapping)),null]}))},function(Q,O,e,C,R){C();const v=Q(1),w=Q(15),g=Q(43),p=Q(8),T=(0,v.__importDefault)(Q(44));class c{constructor(r){this.removed=new w.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._idle_notified=!1;const{model:i,parent:t}=r;this.model=i,this.parent=t,this.root=t==null?this:t.root,this.removed.emit()}get ready(){return this._ready}connect(r,i){let t=this._slots.get(i);return t==null&&(t=(s,a)=>{const u=Promise.resolve(i.call(this,s,a));this._ready=this._ready.then(()=>u)},this._slots.set(i,t)),r.connect(t,this)}disconnect(r,i){return r.disconnect(i,this)}initialize(){this._has_finished=!1,this.is_root&&(this._stylesheet=g.stylesheet);for(const r of this.styles())this.stylesheet.append(r)}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit()}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return this.parent==null}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){w.Signal.disconnect_receiver(this)}on_change(r,i){for(const t of(0,p.isArray)(r)?r:[r])this.connect(t.change,i)}cursor(r,i){return null}get stylesheet(){return this.is_root?this._stylesheet:this.root.stylesheet}styles(){return[T.default]}notify_finished(){this.is_root?!this._idle_notified&&this.has_finished()&&this.model.document!=null&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):this.root.notify_finished()}}e.View=c,c.__name__="View"},function(Q,O,e,C,R){C();const v=Q(8),w=Q(13),g=l=>(d={},...m)=>{const f=document.createElement(l);f.classList.add("bk"),(0,v.isPlainObject)(d)||(m=[d,...m],d={});for(let[y,A]of(0,w.entries)(d))if(A!=null&&(!(0,v.isBoolean)(A)||A))if(y==="class"&&((0,v.isString)(A)&&(A=A.split(/\s+/)),(0,v.isArray)(A)))for(const L of A)L!=null&&f.classList.add(L);else if(y==="style"&&(0,v.isPlainObject)(A))for(const[L,x]of(0,w.entries)(A))f.style[L]=x;else if(y==="data"&&(0,v.isPlainObject)(A))for(const[L,x]of(0,w.entries)(A))f.dataset[L]=x;else f.setAttribute(y,A);function b(y){if((0,v.isString)(y))f.appendChild(document.createTextNode(y));else if(y instanceof Node)f.appendChild(y);else if(y instanceof NodeList||y instanceof HTMLCollection)for(const A of y)f.appendChild(A);else if(y!=null&&y!==!1)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(y)}`)}for(const y of m)if((0,v.isArray)(y))for(const A of y)b(A);else b(y);return f};function p(l){const d=l.parentNode;d?.removeChild(l)}function T(l,...d){const m=l.firstChild;for(const f of d)l.insertBefore(f,m)}function c(l,d){var m,f,b;const y=Element.prototype;return((b=(f=(m=y.matches)!==null&&m!==void 0?m:y.webkitMatchesSelector)!==null&&f!==void 0?f:y.mozMatchesSelector)!==null&&b!==void 0?b:y.msMatchesSelector).call(l,d)}function o(l){return parseFloat(l)||0}function r(l){const d=getComputedStyle(l);return{border:{top:o(d.borderTopWidth),bottom:o(d.borderBottomWidth),left:o(d.borderLeftWidth),right:o(d.borderRightWidth)},margin:{top:o(d.marginTop),bottom:o(d.marginBottom),left:o(d.marginLeft),right:o(d.marginRight)},padding:{top:o(d.paddingTop),bottom:o(d.paddingBottom),left:o(d.paddingLeft),right:o(d.paddingRight)}}}function i(l){const d=l.getBoundingClientRect();return{width:Math.ceil(d.width),height:Math.ceil(d.height)}}e.createElement=function(l,d,...m){return g(l)(d,...m)},e.div=g("div"),e.span=g("span"),e.canvas=g("canvas"),e.link=g("link"),e.style=g("style"),e.a=g("a"),e.p=g("p"),e.i=g("i"),e.pre=g("pre"),e.button=g("button"),e.label=g("label"),e.input=g("input"),e.select=g("select"),e.option=g("option"),e.optgroup=g("optgroup"),e.textarea=g("textarea"),e.createSVGElement=function(l,d,...m){const f=document.createElementNS("http://www.w3.org/2000/svg",l);for(const[y,A]of(0,w.entries)(d??{}))A==null||(0,v.isBoolean)(A)&&!A||f.setAttribute(y,A);function b(y){if((0,v.isString)(y))f.appendChild(document.createTextNode(y));else if(y instanceof Node)f.appendChild(y);else if(y instanceof NodeList||y instanceof HTMLCollection)for(const A of y)f.appendChild(A);else if(y!=null&&y!==!1)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(y)}`)}for(const y of m)if((0,v.isArray)(y))for(const A of y)b(A);else b(y);return f},e.nbsp=function(){return document.createTextNode(" ")},e.append=function(l,...d){for(const m of d)l.appendChild(m)},e.remove=p,e.removeElement=p,e.replaceWith=function(l,d){const m=l.parentNode;m?.replaceChild(d,l)},e.prepend=T,e.empty=function(l,d=!1){let m;for(;m=l.firstChild;)l.removeChild(m);if(d&&l instanceof Element)for(const f of l.attributes)l.removeAttributeNode(f)},e.display=function(l){l.style.display=""},e.undisplay=function(l){l.style.display="none"},e.show=function(l){l.style.visibility=""},e.hide=function(l){l.style.visibility="hidden"},e.offset=function(l){const d=l.getBoundingClientRect();return{top:d.top+window.pageYOffset-document.documentElement.clientTop,left:d.left+window.pageXOffset-document.documentElement.clientLeft}},e.matches=c,e.parent=function(l,d){let m=l;for(;m=m.parentElement;)if(c(m,d))return m;return null},e.extents=r,e.size=i,e.scroll_size=function(l){return{width:Math.ceil(l.scrollWidth),height:Math.ceil(l.scrollHeight)}},e.outer_size=function(l){const{margin:{left:d,right:m,top:f,bottom:b}}=r(l),{width:y,height:A}=i(l);return{width:Math.ceil(y+d+m),height:Math.ceil(A+f+b)}},e.content_size=function(l){const{left:d,top:m}=l.getBoundingClientRect(),{padding:f}=r(l);let b=0,y=0;for(const A of l.children){const L=A.getBoundingClientRect();b=Math.max(b,Math.ceil(L.left-d-f.left+L.width)),y=Math.max(y,Math.ceil(L.top-m-f.top+L.height))}return{width:b,height:y}},e.position=function(l,d,m){const{style:f}=l;if(f.left=`${d.x}px`,f.top=`${d.y}px`,f.width=`${d.width}px`,f.height=`${d.height}px`,m==null)f.margin="";else{const{top:b,right:y,bottom:A,left:L}=m;f.margin=`${b}px ${y}px ${A}px ${L}px`}},e.children=function(l){return Array.from(l.children)};class t{constructor(d){this.el=d,this.classList=d.classList}get values(){const d=[];for(let m=0;m<this.classList.length;m++){const f=this.classList.item(m);f!=null&&d.push(f)}return d}has(d){return this.classList.contains(d)}add(...d){for(const m of d)this.classList.add(m);return this}remove(...d){for(const m of d)this.classList.remove(m);return this}clear(){for(const d of this.values)d!="bk"&&this.classList.remove(d);return this}toggle(d,m){return m??!this.has(d)?this.add(d):this.remove(d),this}}var s;function a(l,d,m){const{width:f,height:b,position:y,display:A}=l.style;l.style.position="absolute",l.style.display="",l.style.width=d.width!=null&&d.width!=1/0?`${d.width}px`:"auto",l.style.height=d.height!=null&&d.height!=1/0?`${d.height}px`:"auto";try{return m()}finally{l.style.position=y,l.style.display=A,l.style.width=f,l.style.height=b}}e.ClassList=t,t.__name__="ClassList",e.classes=function(l){return new t(l)},e.toggle_attribute=function(l,d,m){m==null&&(m=!l.hasAttribute(d)),m?l.setAttribute(d,"true"):l.removeAttribute(d)},(s=e.Keys||(e.Keys={}))[s.Backspace=8]="Backspace",s[s.Tab=9]="Tab",s[s.Enter=13]="Enter",s[s.Esc=27]="Esc",s[s.PageUp=33]="PageUp",s[s.PageDown=34]="PageDown",s[s.Left=37]="Left",s[s.Up=38]="Up",s[s.Right=39]="Right",s[s.Down=40]="Down",s[s.Delete=46]="Delete",e.undisplayed=function(l,d){const{display:m}=l.style;l.style.display="none";try{return d()}finally{l.style.display=m}},e.unsized=function(l,d){return a(l,{},d)},e.sized=a;class u{constructor(d){this.root=d,this.known=new Set,this.style=(0,e.style)({type:"text/css"}),T(d,this.style)}append(d){this.known.has(d)||(this.style.appendChild(document.createTextNode(d)),this.known.add(d))}}e.StyleSheet=u,u.__name__="StyleSheet",e.stylesheet=new u(document.head),e.dom_ready=async function(){if(document.readyState=="loading")return new Promise((l,d)=>{document.addEventListener("DOMContentLoaded",()=>l(),{once:!0})})}},function(Q,O,e,C,R){C(),e.root="bk-root",e.default=".bk-root{position:relative;width:auto;height:auto;box-sizing:border-box;font-family:Helvetica, Arial, sans-serif;font-size:13px;}.bk-root .bk,.bk-root .bk:before,.bk-root .bk:after{box-sizing:inherit;margin:0;border:0;padding:0;background-image:none;font-family:inherit;font-size:100%;line-height:1.42857143;}.bk-root pre.bk{font-family:Courier, monospace;}"},function(Q,O,e,C,R){C();const v=Q(1),w=Q(46);R("Line",w.Line),R("LineScalar",w.LineScalar),R("LineVector",w.LineVector);const g=Q(49);R("Fill",g.Fill),R("FillScalar",g.FillScalar),R("FillVector",g.FillVector);const p=Q(50);R("Text",p.Text),R("TextScalar",p.TextScalar),R("TextVector",p.TextVector);const T=Q(51);R("Hatch",T.Hatch),R("HatchScalar",T.HatchScalar),R("HatchVector",T.HatchVector);const c=(0,v.__importStar)(Q(48)),o=Q(47);R("VisualProperties",o.VisualProperties),R("VisualUniforms",o.VisualUniforms);class r{constructor(t){this._visuals=[];for(const[s,a]of t.model._mixins){const u=(()=>{switch(a){case c.Line:return new w.Line(t,s);case c.LineScalar:return new w.LineScalar(t,s);case c.LineVector:return new w.LineVector(t,s);case c.Fill:return new g.Fill(t,s);case c.FillScalar:return new g.FillScalar(t,s);case c.FillVector:return new g.FillVector(t,s);case c.Text:return new p.Text(t,s);case c.TextScalar:return new p.TextScalar(t,s);case c.TextVector:return new p.TextVector(t,s);case c.Hatch:return new T.Hatch(t,s);case c.HatchScalar:return new T.HatchScalar(t,s);case c.HatchVector:return new T.HatchVector(t,s);default:throw new Error("unknown visual")}})();u instanceof o.VisualProperties&&u.update(),this._visuals.push(u),Object.defineProperty(this,s+u.type,{get:()=>u,configurable:!1,enumerable:!0})}}*[Symbol.iterator](){yield*this._visuals}}e.Visuals=r,r.__name__="Visuals"},function(Q,O,e,C,R){C();const v=Q(1),w=Q(47),g=(0,v.__importStar)(Q(48)),p=Q(22),T=Q(8);function c(t){if((0,T.isArray)(t))return t;switch(t){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 t.split(" ").map(Number).filter(T.isInteger)}}e.resolve_line_dash=c;class o extends w.VisualProperties{get doit(){const s=this.line_color.get_value(),a=this.line_alpha.get_value(),u=this.line_width.get_value();return!(s==null||a==0||u==0)}apply(s){const{doit:a}=this;return a&&(this.set_value(s),s.stroke()),a}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(s){const a=this.line_color.get_value(),u=this.line_alpha.get_value();s.strokeStyle=(0,p.color2css)(a,u),s.lineWidth=this.line_width.get_value(),s.lineJoin=this.line_join.get_value(),s.lineCap=this.line_cap.get_value(),s.lineDash=c(this.line_dash.get_value()),s.lineDashOffset=this.line_dash_offset.get_value()}}e.Line=o,o.__name__="Line";class r extends w.VisualUniforms{get doit(){const s=this.line_color.value,a=this.line_alpha.value,u=this.line_width.value;return!(s==0||a==0||u==0)}apply(s){const{doit:a}=this;return a&&(this.set_value(s),s.stroke()),a}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(s){const a=this.line_color.value,u=this.line_alpha.value;s.strokeStyle=(0,p.color2css)(a,u),s.lineWidth=this.line_width.value,s.lineJoin=this.line_join.value,s.lineCap=this.line_cap.value,s.lineDash=c(this.line_dash.value),s.lineDashOffset=this.line_dash_offset.value}}e.LineScalar=r,r.__name__="LineScalar";class i extends w.VisualUniforms{get doit(){const{line_color:s}=this;if(s.is_Scalar()&&s.value==0)return!1;const{line_alpha:a}=this;if(a.is_Scalar()&&a.value==0)return!1;const{line_width:u}=this;return!u.is_Scalar()||u.value!=0}apply(s,a){const{doit:u}=this;return u&&(this.set_vectorize(s,a),s.stroke()),u}values(s){return{color:this.line_color.get(s),alpha:this.line_alpha.get(s),width:this.line_width.get(s),join:this.line_join.get(s),cap:this.line_cap.get(s),dash:this.line_dash.get(s),offset:this.line_dash_offset.get(s)}}set_vectorize(s,a){const u=this.line_color.get(a),l=this.line_alpha.get(a),d=this.line_width.get(a),m=this.line_join.get(a),f=this.line_cap.get(a),b=this.line_dash.get(a),y=this.line_dash_offset.get(a);s.strokeStyle=(0,p.color2css)(u,l),s.lineWidth=d,s.lineJoin=m,s.lineCap=f,s.lineDash=c(b),s.lineDashOffset=y}}e.LineVector=i,i.__name__="LineVector",o.prototype.type="line",o.prototype.attrs=Object.keys(g.Line),r.prototype.type="line",r.prototype.attrs=Object.keys(g.LineScalar),i.prototype.type="line",i.prototype.attrs=Object.keys(g.LineVector)},function(Q,O,e,C,R){C();class v{constructor(p,T=""){this.obj=p,this.prefix=T;const c=this;this._props=[];for(const o of this.attrs){const r=p.model.properties[T+o];r.change.connect(()=>this.update()),c[o]=r,this._props.push(r)}}*[Symbol.iterator](){yield*this._props}update(){}}e.VisualProperties=v,v.__name__="VisualProperties";class w{constructor(p,T=""){this.obj=p,this.prefix=T;for(const c of this.attrs)Object.defineProperty(this,c,{get:()=>p[T+c]})}*[Symbol.iterator](){for(const p of this.attrs)yield this.obj.model.properties[this.prefix+p]}update(){}}e.VisualUniforms=w,w.__name__="VisualUniforms"},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importStar)(Q(18)),g=Q(20),p=(0,v.__importStar)(Q(21)),T=Q(13);e.Line={line_color:[p.Nullable(p.Color),"black"],line_alpha:[p.Alpha,1],line_width:[p.Number,1],line_join:[g.LineJoin,"bevel"],line_cap:[g.LineCap,"butt"],line_dash:[p.Or(g.LineDash,p.Array(p.Number)),[]],line_dash_offset:[p.Number,0]},e.Fill={fill_color:[p.Nullable(p.Color),"gray"],fill_alpha:[p.Alpha,1]},e.Hatch={hatch_color:[p.Nullable(p.Color),"black"],hatch_alpha:[p.Alpha,1],hatch_scale:[p.Number,12],hatch_pattern:[p.Nullable(p.Or(g.HatchPatternType,p.String)),null],hatch_weight:[p.Number,1],hatch_extra:[p.Dict(p.AnyRef()),{}]},e.Text={text_color:[p.Nullable(p.Color),"#444444"],text_alpha:[p.Alpha,1],text_font:[w.Font,"helvetica"],text_font_size:[p.FontSize,"16px"],text_font_style:[g.FontStyle,"normal"],text_align:[g.TextAlign,"left"],text_baseline:[g.TextBaseline,"bottom"],text_line_height:[p.Number,1.2]},e.LineScalar={line_color:[w.ColorScalar,"black"],line_alpha:[w.NumberScalar,1],line_width:[w.NumberScalar,1],line_join:[w.LineJoinScalar,"bevel"],line_cap:[w.LineCapScalar,"butt"],line_dash:[w.LineDashScalar,[]],line_dash_offset:[w.NumberScalar,0]},e.FillScalar={fill_color:[w.ColorScalar,"gray"],fill_alpha:[w.NumberScalar,1]},e.HatchScalar={hatch_color:[w.ColorScalar,"black"],hatch_alpha:[w.NumberScalar,1],hatch_scale:[w.NumberScalar,12],hatch_pattern:[w.NullStringScalar,null],hatch_weight:[w.NumberScalar,1],hatch_extra:[w.AnyScalar,{}]},e.TextScalar={text_color:[w.ColorScalar,"#444444"],text_alpha:[w.NumberScalar,1],text_font:[w.FontScalar,"helvetica"],text_font_size:[w.FontSizeScalar,"16px"],text_font_style:[w.FontStyleScalar,"normal"],text_align:[w.TextAlignScalar,"left"],text_baseline:[w.TextBaselineScalar,"bottom"],text_line_height:[w.NumberScalar,1.2]},e.LineVector={line_color:[w.ColorSpec,"black"],line_alpha:[w.NumberSpec,1],line_width:[w.NumberSpec,1],line_join:[w.LineJoinSpec,"bevel"],line_cap:[w.LineCapSpec,"butt"],line_dash:[w.LineDashSpec,[]],line_dash_offset:[w.NumberSpec,0]},e.FillVector={fill_color:[w.ColorSpec,"gray"],fill_alpha:[w.NumberSpec,1]},e.HatchVector={hatch_color:[w.ColorSpec,"black"],hatch_alpha:[w.NumberSpec,1],hatch_scale:[w.NumberSpec,12],hatch_pattern:[w.NullStringSpec,null],hatch_weight:[w.NumberSpec,1],hatch_extra:[w.AnyScalar,{}]},e.TextVector={text_color:[w.ColorSpec,"#444444"],text_alpha:[w.NumberSpec,1],text_font:[w.FontSpec,"helvetica"],text_font_size:[w.FontSizeSpec,"16px"],text_font_style:[w.FontStyleSpec,"normal"],text_align:[w.TextAlignSpec,"left"],text_baseline:[w.TextBaselineSpec,"bottom"],text_line_height:[w.NumberSpec,1.2]},e.attrs_of=function(c,o,r,i=!1){const t={};for(const s of(0,T.keys)(r)){const a=`${o}${s}`,u=c[a];t[i?a:s]=u}return t}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(47),g=(0,v.__importStar)(Q(48)),p=Q(22);class T extends w.VisualProperties{get doit(){const i=this.fill_color.get_value(),t=this.fill_alpha.get_value();return!(i==null||t==0)}apply(i,t){const{doit:s}=this;return s&&(this.set_value(i),i.fill(t)),s}values(){return{color:this.fill_color.get_value(),alpha:this.fill_alpha.get_value()}}set_value(i){const t=this.fill_color.get_value(),s=this.fill_alpha.get_value();i.fillStyle=(0,p.color2css)(t,s)}}e.Fill=T,T.__name__="Fill";class c extends w.VisualUniforms{get doit(){const i=this.fill_color.value,t=this.fill_alpha.value;return!(i==0||t==0)}apply(i,t){const{doit:s}=this;return s&&(this.set_value(i),i.fill(t)),s}values(){return{color:this.fill_color.value,alpha:this.fill_alpha.value}}set_value(i){const t=this.fill_color.value,s=this.fill_alpha.value;i.fillStyle=(0,p.color2css)(t,s)}}e.FillScalar=c,c.__name__="FillScalar";class o extends w.VisualUniforms{get doit(){const{fill_color:i}=this;if(i.is_Scalar()&&i.value==0)return!1;const{fill_alpha:t}=this;return!t.is_Scalar()||t.value!=0}apply(i,t,s){const{doit:a}=this;return a&&(this.set_vectorize(i,t),i.fill(s)),a}values(i){return{color:this.fill_color.get(i),alpha:this.fill_alpha.get(i)}}set_vectorize(i,t){const s=this.fill_color.get(t),a=this.fill_alpha.get(t);i.fillStyle=(0,p.color2css)(s,a)}}e.FillVector=o,o.__name__="FillVector",T.prototype.type="fill",T.prototype.attrs=Object.keys(g.Fill),c.prototype.type="fill",c.prototype.attrs=Object.keys(g.FillScalar),o.prototype.type="fill",o.prototype.attrs=Object.keys(g.FillVector)},function(V,Q,O,e,C){e();const R=V(1),v=V(47),w=(0,R.__importStar)(V(48)),g=V(22);class p extends v.VisualProperties{get doit(){const r=this.text_color.get_value(),i=this.text_alpha.get_value();return!(r==null||i==0)}values(){return{color:this.text_color.get_value(),alpha:this.text_alpha.get_value(),font:this.text_font.get_value(),font_size:this.text_font_size.get_value(),font_style:this.text_font_style.get_value(),align:this.text_align.get_value(),baseline:this.text_baseline.get_value(),line_height:this.text_line_height.get_value()}}set_value(r){const i=this.text_color.get_value(),t=this.text_alpha.get_value();r.fillStyle=(0,g.color2css)(i,t),r.font=this.font_value(),r.textAlign=this.text_align.get_value(),r.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()}`}}O.Text=p,p.__name__="Text";class T extends v.VisualUniforms{get doit(){const r=this.text_color.value,i=this.text_alpha.value;return!(r==0||i==0)}values(){return{color:this.text_color.value,alpha:this.text_alpha.value,font:this.text_font.value,font_size:this.text_font_size.value,font_style:this.text_font_style.value,align:this.text_align.value,baseline:this.text_baseline.value,line_height:this.text_line_height.value}}set_value(r){const i=this.text_color.value,t=this.text_alpha.value,s=this.font_value(),a=this.text_align.value,u=this.text_baseline.value;r.fillStyle=(0,g.color2css)(i,t),r.font=s,r.textAlign=a,r.textBaseline=u}font_value(){return`${this.text_font_style.value} ${this.text_font_size.value} ${this.text_font.value}`}}O.TextScalar=T,T.__name__="TextScalar";class c extends v.VisualUniforms{values(r){return{color:this.text_color.get(r),alpha:this.text_alpha.get(r),font:this.text_font.get(r),font_size:this.text_font_size.get(r),font_style:this.text_font_style.get(r),align:this.text_align.get(r),baseline:this.text_baseline.get(r),line_height:this.text_line_height.get(r)}}get doit(){const{text_color:r}=this;if(r.is_Scalar()&&r.value==0)return!1;const{text_alpha:i}=this;return!i.is_Scalar()||i.value!=0}set_vectorize(r,i){const t=this.text_color.get(i),s=this.text_alpha.get(i),a=this.font_value(i),u=this.text_align.get(i),l=this.text_baseline.get(i);r.fillStyle=(0,g.color2css)(t,s),r.font=a,r.textAlign=u,r.textBaseline=l}font_value(r){return`${this.text_font_style.get(r)} ${this.text_font_size.get(r)} ${this.text_font.get(r)}`}}O.TextVector=c,c.__name__="TextVector",p.prototype.type="text",p.prototype.attrs=Object.keys(w.Text),T.prototype.type="text",T.prototype.attrs=Object.keys(w.TextScalar),c.prototype.type="text",c.prototype.attrs=Object.keys(w.TextVector)},function(Q,O,e,C,R){C();const v=Q(1),w=Q(47),g=Q(52),p=(0,v.__importStar)(Q(18)),T=(0,v.__importStar)(Q(48));class c extends w.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(),s=this.hatch_alpha.get_value(),a=this.hatch_scale.get_value(),u=this.hatch_pattern.get_value(),l=this.hatch_weight.get_value(),d=f=>{this._hatch_image=f},m=this.hatch_extra.get_value()[u];if(m!=null){const f=m.get_pattern(t,s,a,l);if(f instanceof Promise){const{_update_iteration:b}=this;f.then(y=>{this._update_iteration==b&&(d(y),this.obj.request_render())})}else d(f)}else{const f=this.obj.canvas.create_layer(),b=(0,g.get_pattern)(f,u,t,s,a,l);d(b)}}get doit(){const t=this.hatch_color.get_value(),s=this.hatch_alpha.get_value(),a=this.hatch_pattern.get_value();return!(t==null||s==0||a==" "||a=="blank"||a==null)}apply(t,s){const{doit:a}=this;return a&&(this.set_value(t),t.layer.undo_transform(()=>t.fill(s))),a}set_value(t){const s=this.pattern(t);t.fillStyle=s??"transparent"}pattern(t){const s=this._hatch_image;return s==null?null:t.createPattern(s,this.repetition())}repetition(){const t=this.hatch_pattern.get_value(),s=this.hatch_extra.get_value()[t];if(s==null)return"repeat";switch(s.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}e.Hatch=c,c.__name__="Hatch";class o extends w.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const t=this.hatch_color.value,s=this.hatch_alpha.value,a=this.hatch_pattern.value;return!(t==null||s==0||a==" "||a=="blank"||a==null)}update(){this._update_iteration++;const t=this.hatch_color.length;if(this._hatch_image=new p.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const s=this.hatch_color.value,a=this.hatch_alpha.value,u=this.hatch_scale.value,l=this.hatch_pattern.value,d=this.hatch_weight.value,m=b=>{this._hatch_image=new p.UniformScalar(b,t)},f=this.hatch_extra.value[l];if(f!=null){const b=f.get_pattern(s,a,u,d);if(b instanceof Promise){const{_update_iteration:y}=this;b.then(A=>{this._update_iteration==y&&(m(A),this.obj.request_render())})}else m(b)}else{const b=this.obj.canvas.create_layer(),y=(0,g.get_pattern)(b,l,s,a,u,d);m(y)}}get doit(){return this._static_doit}apply(t,s){const{doit:a}=this;return a&&(this.set_value(t),t.layer.undo_transform(()=>t.fill(s))),a}set_value(t){var s;t.fillStyle=(s=this.pattern(t))!==null&&s!==void 0?s:"transparent"}pattern(t){const s=this._hatch_image.value;return s==null?null:t.createPattern(s,this.repetition())}repetition(){const t=this.hatch_pattern.value,s=this.hatch_extra.value[t];if(s==null)return"repeat";switch(s.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}e.HatchScalar=o,o.__name__="HatchScalar";class r extends w.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const{hatch_color:t}=this;if(t.is_Scalar()&&t.value==0)return!1;const{hatch_alpha:s}=this;if(s.is_Scalar()&&s.value==0)return!1;const{hatch_pattern:a}=this;if(a.is_Scalar()){const u=a.value;if(u==" "||u=="blank"||u==null)return!1}return!0}update(){this._update_iteration++;const t=this.hatch_color.length;if(this._hatch_image=new p.UniformScalar(null,t),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const s=(a,u,l,d,m,f)=>{const b=this.hatch_extra.value[a];if(b!=null){const y=b.get_pattern(u,l,d,m);if(y instanceof Promise){const{_update_iteration:A}=this;y.then(L=>{this._update_iteration==A&&(f(L),this.obj.request_render())})}else f(y)}else{const y=this.obj.canvas.create_layer(),A=(0,g.get_pattern)(y,a,u,l,d,m);f(A)}};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,u=this.hatch_alpha.value,l=this.hatch_scale.value;s(this.hatch_pattern.value,a,u,l,this.hatch_weight.value,d=>{this._hatch_image=new p.UniformScalar(d,t)})}else{const a=new Array(t);a.fill(null),this._hatch_image=new p.UniformVector(a);for(let u=0;u<t;u++){const l=this.hatch_color.get(u),d=this.hatch_alpha.get(u),m=this.hatch_scale.get(u);s(this.hatch_pattern.get(u),l,d,m,this.hatch_weight.get(u),f=>{a[u]=f})}}}get doit(){return this._static_doit}apply(t,s,a){const{doit:u}=this;return u&&(this.set_vectorize(t,s),t.layer.undo_transform(()=>t.fill(a))),u}set_vectorize(t,s){var a;t.fillStyle=(a=this.pattern(t,s))!==null&&a!==void 0?a:"transparent"}pattern(t,s){const a=this._hatch_image.get(s);return a==null?null:t.createPattern(a,this.repetition(s))}repetition(t){const s=this.hatch_pattern.get(t),a=this.hatch_extra.value[s];if(a==null)return"repeat";switch(a.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}e.HatchVector=r,r.__name__="HatchVector",c.prototype.type="hatch",c.prototype.attrs=Object.keys(T.Hatch),o.prototype.type="hatch",o.prototype.attrs=Object.keys(T.HatchScalar),r.prototype.type="hatch",r.prototype.attrs=Object.keys(T.HatchVector)},function(Q,O,e,C,R){C();const v=Q(22);function w(T,c,o){T.moveTo(0,o+.5),T.lineTo(c,o+.5),T.stroke()}function g(T,c,o){T.moveTo(o+.5,0),T.lineTo(o+.5,c),T.stroke()}function p(T,c){T.moveTo(0,c),T.lineTo(c,0),T.stroke(),T.moveTo(0,0),T.lineTo(c,c),T.stroke()}e.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"},e.get_pattern=function(T,c,o,r,i,t){return T.resize(i,i),T.prepare(),(function(s,a,u,l,d,m){var f;const b=d,y=b/2,A=y/2,L=(0,v.color2css)(u,l);switch(s.strokeStyle=L,s.fillStyle=L,s.lineCap="square",s.lineWidth=m,(f=e.hatch_aliases[a])!==null&&f!==void 0?f:a){case"blank":break;case"dot":s.arc(y,y,y/2,0,2*Math.PI,!0),s.fill();break;case"ring":s.arc(y,y,y/2,0,2*Math.PI,!0),s.stroke();break;case"horizontal_line":w(s,b,y);break;case"vertical_line":g(s,b,y);break;case"cross":w(s,b,y),g(s,b,y);break;case"horizontal_dash":w(s,y,y);break;case"vertical_dash":g(s,y,y);break;case"spiral":{const x=b/30;s.moveTo(y,y);for(let H=0;H<360;H++){const S=.1*H,k=y+x*S*Math.cos(S),E=y+x*S*Math.sin(S);s.lineTo(k,E)}s.stroke();break}case"right_diagonal_line":s.moveTo(.5-A,b),s.lineTo(A+.5,0),s.stroke(),s.moveTo(A+.5,b),s.lineTo(3*A+.5,0),s.stroke(),s.moveTo(3*A+.5,b),s.lineTo(5*A+.5,0),s.stroke(),s.stroke();break;case"left_diagonal_line":s.moveTo(A+.5,b),s.lineTo(.5-A,0),s.stroke(),s.moveTo(3*A+.5,b),s.lineTo(A+.5,0),s.stroke(),s.moveTo(5*A+.5,b),s.lineTo(3*A+.5,0),s.stroke(),s.stroke();break;case"diagonal_cross":p(s,b);break;case"right_diagonal_dash":s.moveTo(A+.5,3*A+.5),s.lineTo(3*A+.5,A+.5),s.stroke();break;case"left_diagonal_dash":s.moveTo(A+.5,A+.5),s.lineTo(3*A+.5,3*A+.5),s.stroke();break;case"horizontal_wave":s.moveTo(0,A),s.lineTo(y,3*A),s.lineTo(b,A),s.stroke();break;case"vertical_wave":s.moveTo(A,0),s.lineTo(3*A,y),s.lineTo(A,b),s.stroke();break;case"criss_cross":p(s,b),w(s,b,y),g(s,b,y)}})(T.ctx,c,o,r,i,t),T.canvas}},function(Q,O,e,C,R){var v;C();const w=Q(14),g=Q(8),p=Q(13),T=Q(26),c=Q(19);class o extends w.HasProps{constructor(i){super(i)}get is_syncable(){return this.syncable}[T.equals](i,t){return t.eq(this.id,i.id)&&super[T.equals](i,t)}initialize(){super.initialize(),this._js_callbacks=new Map}connect_signals(){super.connect_signals(),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,()=>this._update_property_callbacks()),this.connect(this.properties.js_event_callbacks.change,()=>this._update_event_callbacks()),this.connect(this.properties.subscribed_events.change,()=>this._update_event_callbacks())}_process_event(i){var t;for(const s of(t=this.js_event_callbacks[i.event_name])!==null&&t!==void 0?t:[])s.execute(i);this.document!=null&&this.subscribed_events.some(s=>s==i.event_name)&&this.document.event_manager.send_event(i)}trigger_event(i){this.document!=null&&(i.origin=this,this.document.event_manager.trigger(i))}_update_event_callbacks(){this.document!=null?this.document.event_manager.subscribed_models.add(this):c.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const i=t=>{const[s,a=null]=t.split(":");return a!=null?this.properties[a][s]:this[s]};for(const[t,s]of this._js_callbacks){const a=i(t);for(const u of s)this.disconnect(a,u)}this._js_callbacks.clear();for(const[t,s]of(0,p.entries)(this.js_property_callbacks)){const a=s.map(l=>()=>l.execute(this));this._js_callbacks.set(t,a);const u=i(t);for(const l of a)this.connect(u,l)}}_doc_attached(){(0,p.isEmpty)(this.js_event_callbacks)&&this.subscribed_events.length==0||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(i){if((0,g.isString)(i))return[...this.references()].filter(t=>t instanceof o&&t.name===i);if(i.prototype instanceof w.HasProps)return[...this.references()].filter(t=>t instanceof i);throw new Error("invalid selector")}select_one(i){const t=this.select(i);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.Model=o,v=o,o.__name__="Model",v.define(({Any:r,Unknown:i,Boolean:t,String:s,Array:a,Dict:u,Nullable:l})=>({tags:[a(i),[]],name:[l(s),null],js_property_callbacks:[u(a(r)),{}],js_event_callbacks:[u(a(r)),{}],subscribed_events:[a(s),[]],syncable:[t,!0]}))},function(Q,O,e,C,R){var v,w;C();const g=Q(12),p=Q(53),T=Q(55),c=Q(59),o=Q(61),r=Q(62),i=Q(57),t=Q(63),s=Q(67);class a{constructor(m,f){this.x_scale=m,this.y_scale=f,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(m,f){return[this.x_scale.v_compute(m),this.y_scale.v_compute(f)]}map_from_screen(m,f){return[this.x_scale.v_invert(m),this.y_scale.v_invert(f)]}}e.CoordinateTransform=a,a.__name__="CoordinateTransform";class u extends p.Model{constructor(m){super(m)}get x_ranges(){return new Map([["default",this.x_source]])}get y_ranges(){return new Map([["default",this.y_source]])}_get_scale(m,f,b){if(m instanceof s.FactorRange!=f instanceof r.CategoricalScale)throw new Error(`Range ${m.type} is incompatible is Scale ${f.type}`);f instanceof o.LogScale&&m instanceof t.DataRange1d&&(m.scale_hint="log");const y=f.clone();return y.setv({source_range:m,target_range:b}),y}get_transform(m){const{x_source:f,x_scale:b,x_target:y}=this,A=this._get_scale(f,b,y),{y_source:L,y_scale:x,y_target:H}=this,S=this._get_scale(L,x,H),k=new l({source_scale:A,source_range:A.source_range,target_scale:m.x_scale,target_range:m.x_target}),E=new l({source_scale:S,source_range:S.source_range,target_scale:m.y_scale,target_range:m.y_target});return new a(k,E)}}e.CoordinateMapping=u,v=u,u.__name__="CoordinateMapping",v.define(({Ref:d})=>({x_source:[d(i.Range),()=>new t.DataRange1d],y_source:[d(i.Range),()=>new t.DataRange1d],x_scale:[d(T.Scale),()=>new c.LinearScale],y_scale:[d(T.Scale),()=>new c.LinearScale],x_target:[d(i.Range)],y_target:[d(i.Range)]}));class l extends T.Scale{constructor(m){super(m)}get s_compute(){const m=this.source_scale.s_compute,f=this.target_scale.s_compute;return b=>f(m(b))}get s_invert(){const m=this.source_scale.s_invert,f=this.target_scale.s_invert;return b=>m(f(b))}compute(m){return this.s_compute(m)}v_compute(m){const{s_compute:f}=this;return(0,g.map)(m,f)}invert(m){return this.s_invert(m)}v_invert(m){const{s_invert:f}=this;return(0,g.map)(m,f)}}e.CompositeScale=l,w=l,l.__name__="CompositeScale",w.internal(({Ref:d})=>({source_scale:[d(T.Scale)],target_scale:[d(T.Scale)]}))},function(Q,O,e,C,R){var v;C();const w=Q(56),g=Q(57),p=Q(58),T=Q(24);class c extends w.Transform{constructor(r){super(r)}compute(r){return this.s_compute(r)}v_compute(r){const i=new T.ScreenArray(r.length),{s_compute:t}=this;for(let s=0;s<r.length;s++)i[s]=t(r[s]);return i}invert(r){return this.s_invert(r)}v_invert(r){const i=new Float64Array(r.length),{s_invert:t}=this;for(let s=0;s<r.length;s++)i[s]=t(r[s]);return i}r_compute(r,i){const{s_compute:t}=this;return this.target_range.is_reversed?[t(i),t(r)]:[t(r),t(i)]}r_invert(r,i){const{s_invert:t}=this;return this.target_range.is_reversed?[t(i),t(r)]:[t(r),t(i)]}}e.Scale=c,v=c,c.__name__="Scale",v.internal(({Ref:o})=>({source_range:[o(g.Range)],target_range:[o(p.Range1d)]}))},function(Q,O,e,C,R){C();const v=Q(53);class w extends v.Model{constructor(p){super(p)}}e.Transform=w,w.__name__="Transform"},function(Q,O,e,C,R){var v;C();const w=Q(53);class g extends w.Model{constructor(T){super(T),this.have_updated_interactively=!1}get is_reversed(){return this.start>this.end}get is_valid(){return isFinite(this.min)&&isFinite(this.max)}get span(){return Math.abs(this.end-this.start)}}e.Range=g,v=g,g.__name__="Range",v.define(({Number:p,Tuple:T,Or:c,Auto:o,Nullable:r})=>({bounds:[r(c(T(r(p),r(p)),o)),null],min_interval:[r(p),null],max_interval:[r(p),null]})),v.internal(({Array:p,AnyRef:T})=>({plots:[p(T()),[]]}))},function(Q,O,e,C,R){var v;C();const w=Q(57);class g extends w.Range{constructor(T){super(T)}_set_auto_bounds(){if(this.bounds=="auto"){const T=Math.min(this._reset_start,this._reset_end),c=Math.max(this._reset_start,this._reset_end);this.setv({bounds:[T,c]},{silent:!0})}}initialize(){super.initialize(),this._set_auto_bounds()}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}reset(){this._set_auto_bounds();const{_reset_start:T,_reset_end:c}=this;this.start!=T||this.end!=c?this.setv({start:T,end:c}):this.change.emit()}map(T){return new g({start:T(this.start),end:T(this.end)})}widen(T){let{start:c,end:o}=this;return this.is_reversed?(c+=T,o-=T):(c-=T,o+=T),new g({start:c,end:o})}}e.Range1d=g,v=g,g.__name__="Range1d",v.define(({Number:p,Nullable:T})=>({start:[p,0],end:[p,1],reset_start:[T(p),null,{on_update(c,o){o._reset_start=c??o.start}}],reset_end:[T(p),null,{on_update(c,o){o._reset_end=c??o.end}}]}))},function(Q,O,e,C,R){C();const v=Q(60);class w extends v.ContinuousScale{constructor(p){super(p)}get s_compute(){const[p,T]=this._linear_compute_state();return c=>p*c+T}get s_invert(){const[p,T]=this._linear_compute_state();return c=>(c-T)/p}_linear_compute_state(){const p=this.source_range.start,T=this.source_range.end,c=this.target_range.start,o=(this.target_range.end-c)/(T-p);return[o,-o*p+c]}}e.LinearScale=w,w.__name__="LinearScale"},function(Q,O,e,C,R){C();const v=Q(55);class w extends v.Scale{constructor(p){super(p)}}e.ContinuousScale=w,w.__name__="ContinuousScale"},function(Q,O,e,C,R){C();const v=Q(60);class w extends v.ContinuousScale{constructor(p){super(p)}get s_compute(){const[p,T,c,o]=this._compute_state();return r=>{if(c==0)return 0;{const i=(Math.log(r)-o)/c;return isFinite(i)?i*p+T:NaN}}}get s_invert(){const[p,T,c,o]=this._compute_state();return r=>{const i=(r-T)/p;return Math.exp(c*i+o)}}_get_safe_factor(p,T){let c=p<0?0:p,o=T<0?0:T;if(c==o)if(c==0)[c,o]=[1,10];else{const r=Math.log(c)/Math.log(10);c=10**Math.floor(r),o=Math.ceil(r)!=Math.floor(r)?10**Math.ceil(r):10**(Math.ceil(r)+1)}return[c,o]}_compute_state(){const p=this.source_range.start,T=this.source_range.end,c=this.target_range.start,o=this.target_range.end-c,[r,i]=this._get_safe_factor(p,T);let t,s;return r==0?(t=Math.log(i),s=0):(t=Math.log(i)-Math.log(r),s=Math.log(r)),[o,c,t,s]}}e.LogScale=w,w.__name__="LogScale"},function(Q,O,e,C,R){C();const v=Q(55),w=Q(59),{_linear_compute_state:g}=w.LinearScale.prototype;class p extends v.Scale{constructor(c){super(c)}get s_compute(){const[c,o]=g.call(this),r=this.source_range;return i=>c*r.synthetic(i)+o}get s_invert(){const[c,o]=g.call(this);return r=>(r-o)/c}}e.CategoricalScale=p,p.__name__="CategoricalScale"},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(64),p=Q(20),T=Q(9),c=Q(19),o=(0,v.__importStar)(Q(65)),r=Q(66);class i extends g.DataRange{constructor(s){super(s),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span,this._plot_bounds=new Map}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:s,names:a}=this,u=(0,T.concat)(this.plots.map(l=>l.data_renderers));return(0,r.compute_renderers)(s.length==0?"auto":s,u,a)}_compute_plot_bounds(s,a){let u=o.empty();for(const l of s){const d=a.get(l);d==null||!l.visible&&this.only_visible||(u=o.union(u,d))}return u}adjust_bounds_for_aspect(s,a){const u=o.empty();let l=s.x1-s.x0;l<=0&&(l=1);let d=s.y1-s.y0;d<=0&&(d=1);const m=.5*(s.x1+s.x0),f=.5*(s.y1+s.y0);return l<a*d?l=a*d:d=l/a,u.x1=m+.5*l,u.x0=m-.5*l,u.y1=f+.5*d,u.y0=f-.5*d,u}_compute_min_max(s,a){let u,l,d=o.empty();for(const[m,f]of s)m.visible&&(d=o.union(d,f));return[u,l]=a==0?[d.x0,d.x1]:[d.y0,d.y1],[u,l]}_compute_range(s,a){const u=this.range_padding;let l,d;if(this._initial_start!=null&&(s=this._initial_start),this._initial_end!=null&&(a=this._initial_end),this.scale_hint=="log"){let b,y;if((isNaN(s)||!isFinite(s)||s<=0)&&(s=isNaN(a)||!isFinite(a)||a<=0?.1:a/100,c.logger.warn(`could not determine minimum data value for log axis, DataRange1d using value ${s}`)),(isNaN(a)||!isFinite(a)||a<=0)&&(a=isNaN(s)||!isFinite(s)||s<=0?10:100*s,c.logger.warn(`could not determine maximum data value for log axis, DataRange1d using value ${a}`)),a==s)y=this.default_span+.001,b=Math.log(s)/Math.log(10);else{let A,L;this.range_padding_units=="percent"?(A=Math.log(s)/Math.log(10),L=Math.log(a)/Math.log(10),y=(L-A)*(1+u)):(A=Math.log(s-u)/Math.log(10),L=Math.log(a+u)/Math.log(10),y=L-A),b=(A+L)/2}l=10**(b-y/2),d=10**(b+y/2)}else{let b;b=a==s?this.default_span:this.range_padding_units=="percent"?(a-s)*(1+u):a-s+2*u;const y=(a+s)/2;l=y-b/2,d=y+b/2}let m=1;this.flipped&&([l,d]=[d,l],m=-1);const f=this.follow_interval;return f!=null&&Math.abs(l-d)>f&&(this.follow=="start"?d=l+m*f:this.follow=="end"&&(l=d-m*f)),[l,d]}update(s,a,u,l){if(this.have_updated_interactively)return;const d=this.computed_renderers();let m=this._compute_plot_bounds(d,s);l!=null&&(m=this.adjust_bounds_for_aspect(m,l)),this._plot_bounds.set(u,m);const[f,b]=this._compute_min_max(this._plot_bounds.entries(),a);let[y,A]=this._compute_range(f,b);this._initial_start!=null&&(this.scale_hint=="log"?this._initial_start>0&&(y=this._initial_start):y=this._initial_start),this._initial_end!=null&&(this.scale_hint=="log"?this._initial_end>0&&(A=this._initial_end):A=this._initial_end);let L=!1;this.bounds=="auto"&&(this.setv({bounds:[y,A]},{silent:!0}),L=!0);const[x,H]=[this.start,this.end];if(y!=x||A!=H){const S={};y!=x&&(S.start=y),A!=H&&(S.end=A),this.setv(S),L=!1}L&&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()}}e.DataRange1d=i,w=i,i.__name__="DataRange1d",w.define(({Boolean:t,Number:s,Nullable:a})=>({start:[s],end:[s],range_padding:[s,.1],range_padding_units:[p.PaddingUnits,"percent"],flipped:[t,!1],follow:[a(p.StartEnd),null],follow_interval:[a(s),null],default_span:[s,2],only_visible:[t,!1]})),w.internal(({Enum:t})=>({scale_hint:[t("log","auto"),"auto"]}))},function(Q,O,e,C,R){var v;C();const w=Q(57);class g extends w.Range{constructor(T){super(T)}}e.DataRange=g,v=g,g.__name__="DataRange",v.define(({String:p,Array:T,AnyRef:c})=>({names:[T(p),[]],renderers:[T(c()),[]]}))},function(Q,O,e,C,R){C();const v=Q(24),w=Q(26),{min:g,max:p}=Math;e.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},e.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},e.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},e.union=function(c,o){return{x0:g(c.x0,o.x0),x1:p(c.x1,o.x1),y0:g(c.y0,o.y0),y1:p(c.y1,o.y1)}};class T{constructor(o){if(o==null)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in o){const{x0:r,y0:i,x1:t,y1:s}=o;if(!(r<=t&&i<=s))throw new Error(`invalid bbox {x0: ${r}, y0: ${i}, x1: ${t}, y1: ${s}}`);this.x0=r,this.y0=i,this.x1=t,this.y1=s}else if("x"in o){const{x:r,y:i,width:t,height:s}=o;if(!(t>=0&&s>=0))throw new Error(`invalid bbox {x: ${r}, y: ${i}, width: ${t}, height: ${s}}`);this.x0=r,this.y0=i,this.x1=r+t,this.y1=i+s}else{let r,i,t,s;if("width"in o)if("left"in o)r=o.left,i=r+o.width;else if("right"in o)i=o.right,r=i-o.width;else{const a=o.width/2;r=o.hcenter-a,i=o.hcenter+a}else r=o.left,i=o.right;if("height"in o)if("top"in o)t=o.top,s=t+o.height;else if("bottom"in o)s=o.bottom,t=s-o.height;else{const a=o.height/2;t=o.vcenter-a,s=o.vcenter+a}else t=o.top,s=o.bottom;if(!(r<=i&&t<=s))throw new Error(`invalid bbox {left: ${r}, top: ${t}, right: ${i}, bottom: ${s}}`);this.x0=r,this.y0=t,this.x1=i,this.y1=s}}static from_rect({left:o,right:r,top:i,bottom:t}){return new T({x0:Math.min(o,r),y0:Math.min(i,t),x1:Math.max(o,r),y1:Math.max(i,t)})}equals(o){return this.x0==o.x0&&this.y0==o.y0&&this.x1==o.x1&&this.y1==o.y1}[w.equals](o,r){return r.eq(this.x0,o.x0)&&r.eq(this.y0,o.y0)&&r.eq(this.x1,o.x1)&&r.eq(this.y1,o.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return[this.x0,this.y0]}get p1(){return[this.x1,this.y1]}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:o,y0:r,x1:i,y1:t}=this;return{p0:{x:o,y:r},p1:{x:i,y:r},p2:{x:i,y:t},p3:{x:o,y:t}}}get box(){const{x:o,y:r,width:i,height:t}=this;return{x:o,y:r,width:i,height:t}}get h_range(){return{start:this.x0,end:this.x1}}get v_range(){return{start:this.y0,end:this.y1}}get ranges(){return[this.h_range,this.v_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}relative(){const{width:o,height:r}=this;return new T({x:0,y:0,width:o,height:r})}translate(o,r){const{x:i,y:t,width:s,height:a}=this;return new T({x:o+i,y:r+t,width:s,height:a})}relativize(o,r){return[o-this.x,r-this.y]}contains(o,r){return this.x0<=o&&o<=this.x1&&this.y0<=r&&r<=this.y1}clip(o,r){return o<this.x0?o=this.x0:o>this.x1&&(o=this.x1),r<this.y0?r=this.y0:r>this.y1&&(r=this.y1),[o,r]}grow_by(o){return new T({left:this.left-o,right:this.right+o,top:this.top-o,bottom:this.bottom+o})}shrink_by(o){return new T({left:this.left+o,right:this.right-o,top:this.top+o,bottom:this.bottom-o})}union(o){return new T({x0:g(this.x0,o.x0),y0:g(this.y0,o.y0),x1:p(this.x1,o.x1),y1:p(this.y1,o.y1)})}intersection(o){return this.intersects(o)?new T({x0:p(this.x0,o.x0),y0:p(this.y0,o.y0),x1:g(this.x1,o.x1),y1:g(this.y1,o.y1)}):null}intersects(o){return!(o.x1<this.x0||o.x0>this.x1||o.y1<this.y0||o.y0>this.y1)}get xview(){return{compute:o=>this.left+o,v_compute:o=>{const r=new v.ScreenArray(o.length),i=this.left;for(let t=0;t<o.length;t++)r[t]=i+o[t];return r}}}get yview(){return{compute:o=>this.bottom-o,v_compute:o=>{const r=new v.ScreenArray(o.length),i=this.bottom;for(let t=0;t<o.length;t++)r[t]=i-o[t];return r}}}}e.BBox=T,T.__name__="BBox"},function(Q,O,e,C,R){C();const v=Q(9);e.compute_renderers=function(w,g,p){if(w==null)return[];let T=w=="auto"?g:w;return p.length>0&&(T=T.filter(c=>(0,v.includes)(p,c.name))),T}},function(Q,O,e,C,R){var v;C();const w=Q(57),g=Q(20),p=Q(21),T=Q(24),c=Q(9),o=Q(8),r=Q(11);function i(u,l,d=0){const m=new Map;for(let f=0;f<u.length;f++){const b=u[f];if(m.has(b))throw new Error(`duplicate factor or subfactor: ${b}`);m.set(b,{value:.5+f*(1+l)+d})}return[m,(u.length-1)*l]}function t(u,l,d,m=0){var f;const b=new Map,y=new Map;for(const[x,H]of u){const S=(f=y.get(x))!==null&&f!==void 0?f:[];y.set(x,[...S,H])}let A=m,L=0;for(const[x,H]of y){const S=H.length,[k,E]=i(H,d,A);L+=E;const P=(0,c.sum)(H.map(N=>k.get(N).value));b.set(x,{value:P/S,mapping:k}),A+=S+l+E}return[b,(y.size-1)*l+L]}function s(u,l,d,m,f=0){var b;const y=new Map,A=new Map;for(const[H,S,k]of u){const E=(b=A.get(H))!==null&&b!==void 0?b:[];A.set(H,[...E,[S,k]])}let L=f,x=0;for(const[H,S]of A){const k=S.length,[E,P]=t(S,d,m,L);x+=P;const N=(0,c.sum)(S.map(([B])=>E.get(B).value));y.set(H,{value:N/k,mapping:E}),L+=k+l+P}return[y,(A.size-1)*l+x]}e.Factor=(0,p.Or)(p.String,(0,p.Tuple)(p.String,p.String),(0,p.Tuple)(p.String,p.String,p.String)),e.FactorSeq=(0,p.Or)((0,p.Array)(p.String),(0,p.Array)((0,p.Tuple)(p.String,p.String)),(0,p.Array)((0,p.Tuple)(p.String,p.String,p.String))),e.map_one_level=i,e.map_two_levels=t,e.map_three_levels=s;class a extends w.Range{constructor(l){super(l)}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init(!0)}connect_signals(){super.connect_signals(),this.connect(this.properties.factors.change,()=>this.reset()),this.connect(this.properties.factor_padding.change,()=>this.reset()),this.connect(this.properties.group_padding.change,()=>this.reset()),this.connect(this.properties.subgroup_padding.change,()=>this.reset()),this.connect(this.properties.range_padding.change,()=>this.reset()),this.connect(this.properties.range_padding_units.change,()=>this.reset())}reset(){this._init(!1),this.change.emit()}_lookup(l){switch(l.length){case 1:{const[d]=l,m=this._mapping.get(d);return m!=null?m.value:NaN}case 2:{const[d,m]=l,f=this._mapping.get(d);if(f!=null){const b=f.mapping.get(m);if(b!=null)return b.value}return NaN}case 3:{const[d,m,f]=l,b=this._mapping.get(d);if(b!=null){const y=b.mapping.get(m);if(y!=null){const A=y.mapping.get(f);if(A!=null)return A.value}}return NaN}default:(0,r.unreachable)()}}synthetic(l){if((0,o.isNumber)(l))return l;if((0,o.isString)(l))return this._lookup([l]);let d=0;const m=l[l.length-1];return(0,o.isNumber)(m)&&(d=m,l=l.slice(0,-1)),this._lookup(l)+d}v_synthetic(l){const d=l.length,m=new T.ScreenArray(d);for(let f=0;f<d;f++)m[f]=this.synthetic(l[f]);return m}_init(l){const{levels:d,mapping:m,tops:f,mids:b,inside_padding:y}=(()=>{if((0,c.every)(this.factors,o.isString)){const x=this.factors,[H,S]=i(x,this.factor_padding);return{levels:1,mapping:H,tops:null,mids:null,inside_padding:S}}if((0,c.every)(this.factors,x=>(0,o.isArray)(x)&&x.length==2&&(0,o.isString)(x[0])&&(0,o.isString)(x[1]))){const x=this.factors,[H,S]=t(x,this.group_padding,this.factor_padding),k=[...H.keys()];return{levels:2,mapping:H,tops:k,mids:null,inside_padding:S}}if((0,c.every)(this.factors,x=>(0,o.isArray)(x)&&x.length==3&&(0,o.isString)(x[0])&&(0,o.isString)(x[1])&&(0,o.isString)(x[2]))){const x=this.factors,[H,S]=s(x,this.group_padding,this.subgroup_padding,this.factor_padding),k=[...H.keys()],E=[];for(const[P,N]of H)for(const B of N.mapping.keys())E.push([P,B]);return{levels:3,mapping:H,tops:k,mids:E,inside_padding:S}}(0,r.unreachable)()})();this._mapping=m,this.tops=f,this.mids=b;let A=0,L=this.factors.length+y;if(this.range_padding_units=="percent"){const x=(L-A)*this.range_padding/2;A-=x,L+=x}else A-=this.range_padding,L+=this.range_padding;this.setv({start:A,end:L,levels:d},{silent:l}),this.bounds=="auto"&&this.setv({bounds:[A,L]},{silent:!0})}}e.FactorRange=a,v=a,a.__name__="FactorRange",v.define(({Number:u})=>({factors:[e.FactorSeq,[]],factor_padding:[u,0],subgroup_padding:[u,.8],group_padding:[u,1.4],range_padding:[u,0],range_padding_units:[g.PaddingUnits,"percent"],start:[u],end:[u]})),v.internal(({Number:u,String:l,Array:d,Tuple:m,Nullable:f})=>({levels:[u],mids:[f(d(m(l,l))),null],tops:[f(d(l)),null]}))},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(69),p=Q(112),T=Q(48),c=Q(20),o=Q(24),r=Q(113),i=(0,v.__importStar)(Q(18)),t=Q(10);class s extends g.DataAnnotationView{async lazy_initialize(){await super.lazy_initialize();const{start:l,end:d}=this.model;l!=null&&(this.start=await(0,r.build_view)(l,{parent:this})),d!=null&&(this.end=await(0,r.build_view)(d,{parent:this}))}set_data(l){var d,m;super.set_data(l),(d=this.start)===null||d===void 0||d.set_data(l),(m=this.end)===null||m===void 0||m.set_data(l)}remove(){var l,d;(l=this.start)===null||l===void 0||l.remove(),(d=this.end)===null||d===void 0||d.remove(),super.remove()}map_data(){const{frame:l}=this.plot_view;this.model.start_units=="data"?(this._sx_start=this.coordinates.x_scale.v_compute(this._x_start),this._sy_start=this.coordinates.y_scale.v_compute(this._y_start)):(this._sx_start=l.bbox.xview.v_compute(this._x_start),this._sy_start=l.bbox.yview.v_compute(this._y_start)),this.model.end_units=="data"?(this._sx_end=this.coordinates.x_scale.v_compute(this._x_end),this._sy_end=this.coordinates.y_scale.v_compute(this._y_end)):(this._sx_end=l.bbox.xview.v_compute(this._x_end),this._sy_end=l.bbox.yview.v_compute(this._y_end));const{_sx_start:d,_sy_start:m,_sx_end:f,_sy_end:b}=this,y=d.length,A=this._angles=new o.ScreenArray(y);for(let L=0;L<y;L++)A[L]=Math.PI/2+(0,t.atan2)([d[L],m[L]],[f[L],b[L]])}paint(l){const{start:d,end:m}=this,{_sx_start:f,_sy_start:b,_sx_end:y,_sy_end:A,_angles:L}=this,{x,y:H,width:S,height:k}=this.plot_view.frame.bbox;for(let E=0,P=f.length;E<P;E++)m!=null&&(l.save(),l.translate(y[E],A[E]),l.rotate(L[E]),m.render(l,E),l.restore()),d!=null&&(l.save(),l.translate(f[E],b[E]),l.rotate(L[E]+Math.PI),d.render(l,E),l.restore()),this.visuals.line.doit&&(l.save(),d==null&&m==null||(l.beginPath(),l.rect(x,H,S,k),m!=null&&(l.save(),l.translate(y[E],A[E]),l.rotate(L[E]),m.clip(l,E),l.restore()),d!=null&&(l.save(),l.translate(f[E],b[E]),l.rotate(L[E]+Math.PI),d.clip(l,E),l.restore()),l.closePath(),l.clip()),this.visuals.line.set_vectorize(l,E),l.beginPath(),l.moveTo(f[E],b[E]),l.lineTo(y[E],A[E]),l.stroke(),l.restore())}}e.ArrowView=s,s.__name__="ArrowView";class a extends g.DataAnnotation{constructor(l){super(l)}}e.Arrow=a,w=a,a.__name__="Arrow",w.prototype.default_view=s,w.mixins(T.LineVector),w.define(({Ref:u,Nullable:l})=>({x_start:[i.XCoordinateSpec,{field:"x_start"}],y_start:[i.YCoordinateSpec,{field:"y_start"}],start_units:[c.SpatialUnits,"data"],start:[l(u(p.ArrowHead)),null],x_end:[i.XCoordinateSpec,{field:"x_end"}],y_end:[i.YCoordinateSpec,{field:"y_end"}],end_units:[c.SpatialUnits,"data"],end:[l(u(p.ArrowHead)),()=>new p.OpenHead]}))},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(40),p=Q(70),T=Q(75),c=Q(78),o=(0,v.__importStar)(Q(18));class r extends g.AnnotationView{constructor(){super(...arguments),this._initial_set_data=!1}connect_signals(){super.connect_signals();const s=()=>{this.set_data(this.model.source),this._rerender()};this.connect(this.model.change,s),this.connect(this.model.source.streaming,s),this.connect(this.model.source.patching,s),this.connect(this.model.source.change,s)}_rerender(){this.request_render()}set_data(s){const a=this;for(const u of this.model)if(u instanceof o.VectorSpec||u instanceof o.ScalarSpec)if(u instanceof o.BaseCoordinateSpec){const l=u.array(s);a[`_${u.attr}`]=l}else{const l=u.uniform(s);a[`${u.attr}`]=l}this.plot_model.use_map&&(a._x!=null&&c.inplace.project_xy(a._x,a._y),a._xs!=null&&c.inplace.project_xsys(a._xs,a._ys));for(const u of this.visuals)u.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)}}e.DataAnnotationView=r,r.__name__="DataAnnotationView";class i extends g.Annotation{constructor(s){super(s)}}e.DataAnnotation=i,w=i,i.__name__="DataAnnotation",w.define(({Ref:t})=>({source:[t(p.ColumnarDataSource),()=>new T.ColumnDataSource]}))},function(Q,O,e,C,R){var v;C();const w=Q(71),g=Q(15),p=Q(19),T=Q(73),c=Q(8),o=Q(9),r=Q(13),i=Q(72),t=Q(74),s=Q(29);class a extends w.DataSource{constructor(l){super(l),this.selection_manager=new T.SelectionManager(this)}get_array(l){let d=this.data[l];return d==null?this.data[l]=d=[]:(0,c.isArray)(d)||(this.data[l]=d=Array.from(d)),d}initialize(){super.initialize(),this._select=new g.Signal0(this,"select"),this.inspect=new g.Signal(this,"inspect"),this.streaming=new g.Signal0(this,"streaming"),this.patching=new g.Signal(this,"patching")}get_column(l){const d=this.data[l];return d??null}columns(){return(0,r.keys)(this.data)}get_length(l=!0){const d=(0,o.uniq)((0,r.values)(this.data).map(m=>(0,s.is_NDArray)(m)?m.shape[0]:m.length));switch(d.length){case 0:return null;case 1:return d[0];default:{const m="data source has columns of inconsistent lengths";if(l)return p.logger.warn(m),d.sort()[0];throw new Error(m)}}}get length(){var l;return(l=this.get_length())!==null&&l!==void 0?l:0}clear(){const l={};for(const d of this.columns())l[d]=new this.data[d].constructor(0);this.data=l}}e.ColumnarDataSource=a,v=a,a.__name__="ColumnarDataSource",v.define(({Ref:u})=>({selection_policy:[u(t.SelectionPolicy),()=>new t.UnionRenderers]})),v.internal(({AnyRef:u})=>({inspected:[u(),()=>new i.Selection]}))},function(Q,O,e,C,R){var v;C();const w=Q(53),g=Q(72);class p extends w.Model{constructor(c){super(c)}}e.DataSource=p,v=p,p.__name__="DataSource",v.define(({Ref:T})=>({selected:[T(g.Selection),()=>new g.Selection]}))},function(Q,O,e,C,R){var v;C();const w=Q(53),g=Q(9),p=Q(13);class T extends w.Model{constructor(o){super(o)}get_view(){return this.view}get selected_glyph(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null}add_to_selected_glyphs(o){this.selected_glyphs.push(o)}update(o,r=!0,i="replace"){switch(i){case"replace":this.indices=o.indices,this.line_indices=o.line_indices,this.multiline_indices=o.multiline_indices,this.image_indices=o.image_indices,this.view=o.view,this.selected_glyphs=o.selected_glyphs;break;case"append":this.update_through_union(o);break;case"intersect":this.update_through_intersection(o);break;case"subtract":this.update_through_subtraction(o)}}clear(){this.indices=[],this.line_indices=[],this.multiline_indices={},this.image_indices=[],this.view=null,this.selected_glyphs=[]}map(o){return new T(Object.assign(Object.assign({},this.attributes),{indices:this.indices.map(o),multiline_indices:(0,p.to_object)((0,p.entries)(this.multiline_indices).map(([r,i])=>[o(Number(r)),i])),image_indices:this.image_indices.map(r=>Object.assign(Object.assign({},r),{index:o(r.index)}))}))}is_empty(){return this.indices.length==0&&this.line_indices.length==0&&this.image_indices.length==0}update_through_union(o){this.indices=(0,g.union)(this.indices,o.indices),this.selected_glyphs=(0,g.union)(o.selected_glyphs,this.selected_glyphs),this.line_indices=(0,g.union)(o.line_indices,this.line_indices),this.view=o.view,this.multiline_indices=(0,p.merge)(o.multiline_indices,this.multiline_indices)}update_through_intersection(o){this.indices=(0,g.intersection)(this.indices,o.indices),this.selected_glyphs=(0,g.union)(o.selected_glyphs,this.selected_glyphs),this.line_indices=(0,g.union)(o.line_indices,this.line_indices),this.view=o.view,this.multiline_indices=(0,p.merge)(o.multiline_indices,this.multiline_indices)}update_through_subtraction(o){this.indices=(0,g.difference)(this.indices,o.indices),this.selected_glyphs=(0,g.union)(o.selected_glyphs,this.selected_glyphs),this.line_indices=(0,g.union)(o.line_indices,this.line_indices),this.view=o.view,this.multiline_indices=(0,p.merge)(o.multiline_indices,this.multiline_indices)}}e.Selection=T,v=T,T.__name__="Selection",v.define(({Int:c,Array:o,Dict:r})=>({indices:[o(c),[]],line_indices:[o(c),[]],multiline_indices:[r(o(c)),{}]})),v.internal(({Int:c,Array:o,AnyRef:r,Struct:i,Nullable:t})=>({selected_glyphs:[o(r()),[]],view:[t(r()),null],image_indices:[o(i({index:c,dim1:c,dim2:c,flat_index:c})),[]]}))},function(Q,O,e,C,R){C();const v=Q(72);function w(T){return T.model.type=="GlyphRenderer"}function g(T){return T.model.type=="GraphRenderer"}class p{constructor(c){this.source=c,this.inspectors=new Map}select(c,o,r,i="replace"){const t=[],s=[];for(const u of c)w(u)?t.push(u):g(u)&&s.push(u);let a=!1;for(const u of s){const l=u.model.selection_policy.hit_test(o,u);a=a||u.model.selection_policy.do_selection(l,u.model,r,i)}if(t.length>0){const u=this.source.selection_policy.hit_test(o,t);a=a||this.source.selection_policy.do_selection(u,this.source,r,i)}return a}inspect(c,o){let r=!1;if(w(c)){const i=c.hit_test(o);if(i!=null){r=!i.is_empty();const t=this.get_or_create_inspector(c.model);t.update(i,!0,"replace"),this.source.setv({inspected:t},{silent:!0}),this.source.inspect.emit([c.model,{geometry:o}])}}else if(g(c)){const i=c.model.inspection_policy.hit_test(o,c);r=r||c.model.inspection_policy.do_inspection(i,o,c,!1,"replace")}return r}clear(c){this.source.selected.clear(),c!=null&&this.get_or_create_inspector(c.model).clear()}get_or_create_inspector(c){let o=this.inspectors.get(c);return o==null&&(o=new v.Selection,this.inspectors.set(c,o)),o}}e.SelectionManager=p,p.__name__="SelectionManager"},function(Q,O,e,C,R){C();const v=Q(53);class w extends v.Model{do_selection(c,o,r,i){return c!=null&&(o.selected.update(c,r,i),o._select.emit(),!o.selected.is_empty())}}e.SelectionPolicy=w,w.__name__="SelectionPolicy";class g extends w{hit_test(c,o){const r=[];for(const i of o){const t=i.hit_test(c);t!=null&&r.push(t)}if(r.length>0){const i=r[0];for(const t of r)i.update_through_intersection(t);return i}return null}}e.IntersectRenderers=g,g.__name__="IntersectRenderers";class p extends w{hit_test(c,o){const r=[];for(const i of o){const t=i.hit_test(c);t!=null&&r.push(t)}if(r.length>0){const i=r[0];for(const t of r)i.update_through_union(t);return i}return null}}e.UnionRenderers=p,p.__name__="UnionRenderers"},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(70),p=Q(8),T=Q(13),c=(0,v.__importStar)(Q(76)),o=Q(77),r=Q(35);function i(u,l,d){if((0,p.isArray)(u)){const m=u.concat(l);return d!=null&&m.length>d?m.slice(-d):m}if((0,p.isTypedArray)(u)){const m=u.length+l.length;if(d!=null&&m>d){const f=m-d,b=u.length;let y;u.length<d?(y=new u.constructor(d),y.set(u,0)):y=u;for(let A=f,L=b;A<L;A++)y[A-f]=y[A];for(let A=0,L=l.length;A<L;A++)y[A+(b-f)]=l[A];return y}{const f=new u.constructor(l);return c.concat(u,f)}}throw new Error("unsupported array types")}function t(u,l){let d,m,f;return(0,p.isNumber)(u)?(d=u,f=u+1,m=1):(d=u.start!=null?u.start:0,f=u.stop!=null?u.stop:l,m=u.step!=null?u.step:1),[d,f,m]}function s(u,l){const d=new Set;let m=!1;for(const[f,b]of l){let y,A,L,x;if((0,p.isArray)(f)){const[D]=f;d.add(D),y=u[D].shape,A=u[D],x=b,f.length===2?(y=[1,y[0]],L=[f[0],0,f[1]]):L=f}else(0,p.isNumber)(f)?(x=[b],d.add(f)):(x=b,m=!0),L=[0,0,f],y=[1,u.length],A=u;let H=0;const[S,k,E]=t(L[1],y[0]),[P,N,B]=t(L[2],y[1]);for(let D=S;D<k;D+=E)for(let j=P;j<N;j+=B)m&&d.add(j),A[D*y[1]+j]=x[H],H++}return d}e.stream_to_column=i,e.slice=t,e.patch_to_column=s;class a extends g.ColumnarDataSource{constructor(l){super(l)}stream(l,d,m){const{data:f}=this;for(const[b,y]of(0,T.entries)(l))f[b]=i(f[b],y,d);if(this.setv({data:f},{silent:!0}),this.streaming.emit(),this.document!=null){const b=new r.ColumnsStreamedEvent(this.document,this.ref(),l,d);this.document._notify_change(this,"data",null,null,{setter_id:m,hint:b})}}patch(l,d){const{data:m}=this;let f=new Set;for(const[b,y]of(0,T.entries)(l))f=(0,o.union)(f,s(m[b],y));if(this.setv({data:m},{silent:!0}),this.patching.emit([...f]),this.document!=null){const b=new r.ColumnsPatchedEvent(this.document,this.ref(),l);this.document._notify_change(this,"data",null,null,{setter_id:d,hint:b})}}}e.ColumnDataSource=a,w=a,a.__name__="ColumnDataSource",w.define(({Dict:u,Any:l})=>({data:[u(l),{}]}))},function(Q,O,e,C,R){C(),e.concat=function(v,...w){let g=v.length;for(const c of w)g+=c.length;const p=new v.constructor(g);p.set(v,0);let T=v.length;for(const c of w)p.set(c,T),T+=c.length;return p}},function(Q,O,e,C,R){function v(...w){const g=new Set;for(const p of w)for(const T of p)g.add(T);return g}C(),e.union=v,e.intersection=function(w,...g){const p=new Set;e:for(const T of w){for(const c of g)if(!c.has(T))continue e;p.add(T)}return p},e.difference=function(w,...g){const p=new Set(w);for(const T of v(...g))p.delete(T);return p}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(79)),g=(0,v.__importDefault)(Q(80)),p=Q(24),T=new g.default("GOOGLE"),c=new g.default("WGS84"),o=(0,w.default)(c,T);e.wgs84_mercator={compute:(u,l)=>isFinite(u)&&isFinite(l)?o.forward([u,l]):[NaN,NaN],invert:(u,l)=>isFinite(u)&&isFinite(l)?o.inverse([u,l]):[NaN,NaN]};const r={lon:[-2002637639e-2,2002637639e-2],lat:[-200489661e-1,200489661e-1]},i={lon:[-180,180],lat:[-85.06,85.06]},{min:t,max:s}=Math;function a(u,l){const d=t(u.length,l.length),m=(0,p.infer_type)(u,l),f=new m(d),b=new m(d);return e.inplace.project_xy(u,l,f,b),[f,b]}e.clip_mercator=function(u,l,d){const[m,f]=r[d];return[s(u,m),t(l,f)]},e.in_bounds=function(u,l){const[d,m]=i[l];return d<u&&u<m},(function(u){function l(d,m,f,b){const y=t(d.length,m.length);f=f??d,b=b??m;for(let A=0;A<y;A++){const L=d[A],x=m[A],[H,S]=e.wgs84_mercator.compute(L,x);f[A]=H,b[A]=S}}u.project_xy=l,u.project_xsys=function(d,m,f,b){const y=t(d.length,m.length);f=f??d,b=b??m;for(let A=0;A<y;A++)l(d[A],m[A],f[A],b[A])}})(e.inplace||(e.inplace={})),e.project_xy=a,e.project_xsys=function(u,l){const d=t(u.length,l.length),m=new Array(d),f=new Array(d);for(let b=0;b<d;b++){const[y,A]=a(u[b],l[b]);m[b]=y,f[b]=A}return[m,f]}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(80)),g=(0,v.__importDefault)(Q(106));var p=(0,w.default)("WGS84");function T(o,r,i,t){var s,a,u;return Array.isArray(i)?(s=(0,g.default)(o,r,i,t)||{x:NaN,y:NaN},i.length>2?o.name!==void 0&&o.name==="geocent"||r.name!==void 0&&r.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(i.splice(3)):[s.x,s.y,i[2]].concat(i.splice(3)):[s.x,s.y].concat(i.splice(2)):[s.x,s.y]):(a=(0,g.default)(o,r,i,t),(u=Object.keys(i)).length===2||u.forEach(function(l){if(o.name!==void 0&&o.name==="geocent"||r.name!==void 0&&r.name==="geocent"){if(l==="x"||l==="y"||l==="z")return}else if(l==="x"||l==="y")return;a[l]=i[l]}),a)}function c(o){return o instanceof w.default?o:o.oProj?o.oProj:(0,w.default)(o)}e.default=function(o,r,i){o=c(o);var t,s=!1;return r===void 0?(r=o,o=p,s=!0):(r.x!==void 0||Array.isArray(r))&&(i=r,r=o,o=p,s=!0),r=c(r),i?T(o,r,i):(t={forward:function(a,u){return T(o,r,a,u)},inverse:function(a,u){return T(r,o,a,u)}},s&&(t.oProj=r),t)}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(81)),g=(0,v.__importDefault)(Q(92)),p=(0,v.__importDefault)(Q(93)),T=Q(101),c=(0,v.__importDefault)(Q(103)),o=(0,v.__importDefault)(Q(104)),r=(0,v.__importDefault)(Q(88)),i=Q(105);function t(s,a){if(!(this instanceof t))return new t(s);a=a||function(A){if(A)throw A};var u=(0,w.default)(s);if(typeof u=="object"){var l=t.projections.get(u.projName);if(l){if(u.datumCode&&u.datumCode!=="none"){var d=(0,r.default)(c.default,u.datumCode);d&&(u.datum_params=u.datum_params||(d.towgs84?d.towgs84.split(","):null),u.ellps=d.ellipse,u.datumName=d.datumName?d.datumName:u.datumCode)}u.k0=u.k0||1,u.axis=u.axis||"enu",u.ellps=u.ellps||"wgs84",u.lat1=u.lat1||u.lat0;var m=(0,T.sphere)(u.a,u.b,u.rf,u.ellps,u.sphere),f=(0,T.eccentricity)(m.a,m.b,m.rf,u.R_A),b=(0,i.getNadgrids)(u.nadgrids),y=u.datum||(0,o.default)(u.datumCode,u.datum_params,m.a,m.b,f.es,f.ep2,b);(0,g.default)(this,u),(0,g.default)(this,l),this.a=m.a,this.b=m.b,this.rf=m.rf,this.sphere=m.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=y,this.init(),a(null,this)}else a(s)}else a(s)}t.projections=p.default,t.projections.start(),e.default=t},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(82)),g=(0,v.__importDefault)(Q(89)),p=(0,v.__importDefault)(Q(84)),T=(0,v.__importDefault)(Q(88));var c=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],o=["3857","900913","3785","102113"];e.default=function(r){if(!(function(s){return typeof s=="string"})(r))return r;if((function(s){return s in w.default})(r))return w.default[r];if((function(s){return c.some(function(a){return s.indexOf(a)>-1})})(r)){var i=(0,g.default)(r);if((function(s){var a=(0,T.default)(s,"authority");if(a){var u=(0,T.default)(a,"epsg");return u&&o.indexOf(u)>-1}})(i))return w.default["EPSG:3857"];var t=(function(s){var a=(0,T.default)(s,"extension");if(a)return(0,T.default)(a,"proj4")})(i);return t?(0,p.default)(t):i}return(function(s){return s[0]==="+"})(r)?(0,p.default)(r):void 0}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(83)),g=(0,v.__importDefault)(Q(84)),p=(0,v.__importDefault)(Q(89));function T(c){var o=this;if(arguments.length===2){var r=arguments[1];typeof r=="string"?r.charAt(0)==="+"?T[c]=(0,g.default)(arguments[1]):T[c]=(0,p.default)(arguments[1]):T[c]=r}else if(arguments.length===1){if(Array.isArray(c))return c.map(function(i){Array.isArray(i)?T.apply(o,i):T(i)});if(typeof c=="string"){if(c in T)return T[c]}else"EPSG"in c?T["EPSG:"+c.EPSG]=c:"ESRI"in c?T["ESRI:"+c.ESRI]=c:"IAU2000"in c?T["IAU2000:"+c.IAU2000]=c:console.log(c);return}}(0,w.default)(T),e.default=T},function(Q,O,e,C,R){C(),e.default=function(v){v("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),v("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),v("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"),v.WGS84=v["EPSG:4326"],v["EPSG:3785"]=v["EPSG:3857"],v.GOOGLE=v["EPSG:3857"],v["EPSG:900913"]=v["EPSG:3857"],v["EPSG:102113"]=v["EPSG:3857"]}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(85),g=(0,v.__importDefault)(Q(86)),p=(0,v.__importDefault)(Q(87)),T=(0,v.__importDefault)(Q(88));e.default=function(c){var o,r,i,t={},s=c.split("+").map(function(u){return u.trim()}).filter(function(u){return u}).reduce(function(u,l){var d=l.split("=");return d.push(!0),u[d[0].toLowerCase()]=d[1],u},{}),a={proj:"projName",datum:"datumCode",rf:function(u){t.rf=parseFloat(u)},lat_0:function(u){t.lat0=u*w.D2R},lat_1:function(u){t.lat1=u*w.D2R},lat_2:function(u){t.lat2=u*w.D2R},lat_ts:function(u){t.lat_ts=u*w.D2R},lon_0:function(u){t.long0=u*w.D2R},lon_1:function(u){t.long1=u*w.D2R},lon_2:function(u){t.long2=u*w.D2R},alpha:function(u){t.alpha=parseFloat(u)*w.D2R},gamma:function(u){t.rectified_grid_angle=parseFloat(u)},lonc:function(u){t.longc=u*w.D2R},x_0:function(u){t.x0=parseFloat(u)},y_0:function(u){t.y0=parseFloat(u)},k_0:function(u){t.k0=parseFloat(u)},k:function(u){t.k0=parseFloat(u)},a:function(u){t.a=parseFloat(u)},b:function(u){t.b=parseFloat(u)},r_a:function(){t.R_A=!0},zone:function(u){t.zone=parseInt(u,10)},south:function(){t.utmSouth=!0},towgs84:function(u){t.datum_params=u.split(",").map(function(l){return parseFloat(l)})},to_meter:function(u){t.to_meter=parseFloat(u)},units:function(u){t.units=u;var l=(0,T.default)(p.default,u);l&&(t.to_meter=l.to_meter)},from_greenwich:function(u){t.from_greenwich=u*w.D2R},pm:function(u){var l=(0,T.default)(g.default,u);t.from_greenwich=(l||parseFloat(u))*w.D2R},nadgrids:function(u){u==="@null"?t.datumCode="none":t.nadgrids=u},axis:function(u){var l="ewnsud";u.length===3&&l.indexOf(u.substr(0,1))!==-1&&l.indexOf(u.substr(1,1))!==-1&&l.indexOf(u.substr(2,1))!==-1&&(t.axis=u)},approx:function(){t.approx=!0}};for(o in s)r=s[o],o in a?typeof(i=a[o])=="function"?i(r):t[i]=r:t[o]=r;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}},function(V,Q,O,e,C){e(),O.PJD_3PARAM=1,O.PJD_7PARAM=2,O.PJD_GRIDSHIFT=3,O.PJD_WGS84=4,O.PJD_NODATUM=5,O.SRS_WGS84_SEMIMAJOR=6378137,O.SRS_WGS84_SEMIMINOR=6356752314e-3,O.SRS_WGS84_ESQUARED=.0066943799901413165,O.SEC_TO_RAD=484813681109536e-20,O.HALF_PI=Math.PI/2,O.SIXTH=.16666666666666666,O.RA4=.04722222222222222,O.RA6=.022156084656084655,O.EPSLN=1e-10,O.D2R=.017453292519943295,O.R2D=57.29577951308232,O.FORTPI=Math.PI/4,O.TWO_PI=2*Math.PI,O.SPI=3.14159265359},function(Q,O,e,C,R){C();var v={};e.default=v,v.greenwich=0,v.lisbon=-9.131906111111,v.paris=2.337229166667,v.bogota=-74.080916666667,v.madrid=-3.687938888889,v.rome=12.452333333333,v.bern=7.439583333333,v.jakarta=106.807719444444,v.ferro=-17.666666666667,v.brussels=4.367975,v.stockholm=18.058277777778,v.athens=23.7163375,v.oslo=10.722916666667},function(Q,O,e,C,R){C(),e.default={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(Q,O,e,C,R){C();var v=/[\s_\-\/\(\)]/g;e.default=function(w,g){if(w[g])return w[g];for(var p,T=Object.keys(w),c=g.toLowerCase().replace(v,""),o=-1;++o<T.length;)if((p=T[o]).toLowerCase().replace(v,"")===c)return w[p]}},function(Q,O,e,C,R){C();const w=(0,Q(1).__importDefault)(Q(90)),g=Q(91);function p(T){return .017453292519943295*T}e.default=function(T){var c=(0,w.default)(T),o=c.shift(),r=c.shift();c.unshift(["name",r]),c.unshift(["type",o]);var i={};return(0,g.sExpr)(c,i),(function(t){if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var s="",a=0,u=t.AXIS.length;a<u;++a){var l=[t.AXIS[a][0].toLowerCase(),t.AXIS[a][1].toLowerCase()];l[0].indexOf("north")!==-1||(l[0]==="y"||l[0]==="lat")&&l[1]==="north"?s+="n":l[0].indexOf("south")!==-1||(l[0]==="y"||l[0]==="lat")&&l[1]==="south"?s+="s":l[0].indexOf("east")!==-1||(l[0]==="x"||l[0]==="lon")&&l[1]==="east"?s+="e":l[0].indexOf("west")===-1&&(l[0]!=="x"&&l[0]!=="lon"||l[1]!=="west")||(s+="w")}s.length===2&&(s+="u"),s.length===3&&(t.axis=s)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var d=t.GEOGCS;function m(f){return f*(t.to_meter||1)}t.type==="GEOGCS"&&(d=t),d&&(d.DATUM?t.datumCode=d.DATUM.name.toLowerCase():t.datumCode=d.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode!=="new_zealand_geodetic_datum_1949"&&t.datumCode!=="new_zealand_1949"||(t.datumCode="nzgd49"),t.datumCode!=="wgs_1984"&&t.datumCode!=="world_geodetic_system_1984"||(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode.slice(-6)==="_ferro"&&(t.datumCode=t.datumCode.slice(0,-6)),t.datumCode.slice(-8)==="_jakarta"&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),d.DATUM&&d.DATUM.SPHEROID&&(t.ellps=d.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=d.DATUM.SPHEROID.a,t.rf=parseFloat(d.DATUM.SPHEROID.rf,10)),d.DATUM&&d.DATUM.TOWGS84&&(t.datum_params=d.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.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",p],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",p],["x0","false_easting",m],["y0","false_northing",m],["long0","central_meridian",p],["lat0","latitude_of_origin",p],["lat0","standard_parallel_1",p],["lat1","standard_parallel_1",p],["lat2","standard_parallel_2",p],["azimuth","Azimuth"],["alpha","azimuth",p],["srsCode","name"]].forEach(function(f){return b=t,A=(y=f)[0],L=y[1],void(!(A in b)&&L in b&&(b[A]=b[L],y.length===3&&(b[A]=y[2](b[A]))));var b,y,A,L}),t.long0||!t.longc||t.projName!=="Albers_Conic_Equal_Area"&&t.projName!=="Lambert_Azimuthal_Equal_Area"||(t.long0=t.longc),t.lat_ts||!t.lat1||t.projName!=="Stereographic_South_Pole"&&t.projName!=="Polar Stereographic (variant B)"||(t.lat0=p(t.lat1>0?90:-90),t.lat_ts=t.lat1)})(i),i}},function(Q,O,e,C,R){C(),e.default=function(o){return new c(o).output()};var v=/\s/,w=/[A-Za-z]/,g=/[A-Za-z84]/,p=/[,\]]/,T=/[\d\.E\-\+]/;function c(o){if(typeof o!="string")throw new Error("not a string");this.text=o.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}c.prototype.readCharicter=function(){var o=this.text[this.place++];if(this.state!==4)for(;v.test(o);){if(this.place>=this.text.length)return;o=this.text[this.place++]}switch(this.state){case 1:return this.neutral(o);case 2:return this.keyword(o);case 4:return this.quoted(o);case 5:return this.afterquote(o);case 3:return this.number(o);case-1:return}},c.prototype.afterquote=function(o){if(o==='"')return this.word+='"',void(this.state=4);if(p.test(o))return this.word=this.word.trim(),void this.afterItem(o);throw new Error(`havn't handled "`+o+'" in afterquote yet, index '+this.place)},c.prototype.afterItem=function(o){return o===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):o==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},c.prototype.number=function(o){if(!T.test(o)){if(p.test(o))return this.word=parseFloat(this.word),void this.afterItem(o);throw new Error(`havn't handled "`+o+'" in number yet, index '+this.place)}this.word+=o},c.prototype.quoted=function(o){o!=='"'?this.word+=o:this.state=5},c.prototype.keyword=function(o){if(g.test(o))this.word+=o;else{if(o==="["){var r=[];return r.push(this.word),this.level++,this.root===null?this.root=r:this.currentObject.push(r),this.stack.push(this.currentObject),this.currentObject=r,void(this.state=1)}if(!p.test(o))throw new Error(`havn't handled "`+o+'" in keyword yet, index '+this.place);this.afterItem(o)}},c.prototype.neutral=function(o){if(w.test(o))return this.word=o,void(this.state=2);if(o==='"')return this.word="",void(this.state=4);if(T.test(o))return this.word=o,void(this.state=3);if(!p.test(o))throw new Error(`havn't handled "`+o+'" in neutral yet, index '+this.place);this.afterItem(o)},c.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===-1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(Q,O,e,C,R){function v(g,p,T){Array.isArray(p)&&(T.unshift(p),p=null);var c=p?{}:g,o=T.reduce(function(r,i){return w(i,r),r},c);p&&(g[p]=o)}function w(g,p){if(Array.isArray(g)){var T=g.shift();if(T==="PARAMETER"&&(T=g.shift()),g.length===1)return Array.isArray(g[0])?(p[T]={},void w(g[0],p[T])):void(p[T]=g[0]);if(g.length)if(T!=="TOWGS84"){if(T==="AXIS")return T in p||(p[T]=[]),void p[T].push(g);var c;switch(Array.isArray(T)||(p[T]={}),T){case"UNIT":case"PRIMEM":case"VERT_DATUM":return p[T]={name:g[0].toLowerCase(),convert:g[1]},void(g.length===3&&w(g[2],p[T]));case"SPHEROID":case"ELLIPSOID":return p[T]={name:g[0],a:g[1],rf:g[2]},void(g.length===4&&w(g[3],p[T]));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 g[0]=["name",g[0]],void v(p,T,g);default:for(c=-1;++c<g.length;)if(!Array.isArray(g[c]))return w(g,p[T]);return v(p,T,g)}}else p[T]=g;else p[T]=!0}else p[g]=!0}C(),e.sExpr=w},function(Q,O,e,C,R){C(),e.default=function(v,w){var g,p;if(v=v||{},!w)return v;for(p in w)(g=w[p])!==void 0&&(v[p]=g);return v}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(94)),g=(0,v.__importDefault)(Q(100));var p=[w.default,g.default],T={},c=[];function o(t,s){var a=c.length;return t.names?(c[a]=t,t.names.forEach(function(u){T[u.toLowerCase()]=a}),this):(console.log(s),!0)}function r(t){if(!t)return!1;var s=t.toLowerCase();return T[s]!==void 0&&c[T[s]]?c[T[s]]:void 0}function i(){p.forEach(o)}e.add=o,e.get=r,e.start=i,e.default={start:i,add:o,get:r}},function(Q,O,e,C,R){C();const v=Q(1),w=(0,v.__importDefault)(Q(95)),g=(0,v.__importDefault)(Q(96)),p=(0,v.__importDefault)(Q(98)),T=(0,v.__importDefault)(Q(99)),c=Q(85);function o(){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,w.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 r(t){var s,a,u=t.x,l=t.y;if(l*c.R2D>90&&l*c.R2D<-90&&u*c.R2D>180&&u*c.R2D<-180||Math.abs(Math.abs(l)-c.HALF_PI)<=c.EPSLN)return null;if(this.sphere)s=this.x0+this.a*this.k0*(0,g.default)(u-this.long0),a=this.y0+this.a*this.k0*Math.log(Math.tan(c.FORTPI+.5*l));else{var d=Math.sin(l),m=(0,p.default)(this.e,l,d);s=this.x0+this.a*this.k0*(0,g.default)(u-this.long0),a=this.y0-this.a*this.k0*Math.log(m)}return t.x=s,t.y=a,t}function i(t){var s,a,u=t.x-this.x0,l=t.y-this.y0;if(this.sphere)a=c.HALF_PI-2*Math.atan(Math.exp(-l/(this.a*this.k0)));else{var d=Math.exp(-l/(this.a*this.k0));if((a=(0,T.default)(this.e,d))===-9999)return null}return s=(0,g.default)(this.long0+u/(this.a*this.k0)),t.x=s,t.y=a,t}e.init=o,e.forward=r,e.inverse=i,e.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],e.default={init:o,forward:r,inverse:i,names:e.names}},function(Q,O,e,C,R){C(),e.default=function(v,w,g){var p=v*w;return g/Math.sqrt(1-p*p)}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(85),g=(0,v.__importDefault)(Q(97));e.default=function(p){return Math.abs(p)<=w.SPI?p:p-(0,g.default)(p)*w.TWO_PI}},function(Q,O,e,C,R){C(),e.default=function(v){return v<0?-1:1}},function(Q,O,e,C,R){C();const v=Q(85);e.default=function(w,g,p){var T=w*p,c=.5*w;return T=Math.pow((1-T)/(1+T),c),Math.tan(.5*(v.HALF_PI-g))/T}},function(Q,O,e,C,R){C();const v=Q(85);e.default=function(w,g){for(var p,T,c=.5*w,o=v.HALF_PI-2*Math.atan(g),r=0;r<=15;r++)if(p=w*Math.sin(o),o+=T=v.HALF_PI-2*Math.atan(g*Math.pow((1-p)/(1+p),c))-o,Math.abs(T)<=1e-10)return o;return-9999}},function(Q,O,e,C,R){function v(){}function w(g){return g}C(),e.init=v,e.forward=w,e.inverse=w,e.names=["longlat","identity"],e.default={init:v,forward:w,inverse:w,names:e.names}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(85),g=(0,v.__importStar)(Q(102)),p=(0,v.__importDefault)(Q(88));e.eccentricity=function(T,c,o,r){var i=T*T,t=c*c,s=(i-t)/i,a=0;return r?(i=(T*=1-s*(w.SIXTH+s*(w.RA4+s*w.RA6)))*T,s=0):a=Math.sqrt(s),{es:s,e:a,ep2:(i-t)/t}},e.sphere=function(T,c,o,r,i){if(!T){var t=(0,p.default)(g.default,r);t||(t=g.WGS84),T=t.a,c=t.b,o=t.rf}return o&&!c&&(c=(1-1/o)*T),(o===0||Math.abs(T-c)<w.EPSLN)&&(i=!0,c=T),{a:T,b:c,rf:o,sphere:i}}},function(Q,O,e,C,R){C();var v={};e.default=v,v.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},v.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},v.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},v.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},v.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},v.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},v.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},v.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},v.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},v.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},v.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},v.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},v.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},v.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},v.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},v.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},v.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},v.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},v.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},v.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},v.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},v.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},v.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},v.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},v.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},v.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},v.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},v.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},v.hough={a:6378270,rf:297,ellipseName:"Hough"},v.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},v.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},v.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},v.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},v.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},v.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},v.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},v.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},v.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},v.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},v.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},v.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},e.WGS84=v.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},v.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(Q,O,e,C,R){C();var v={};e.default=v,v.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},v.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},v.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},v.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},v.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},v.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},v.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},v.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},v.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},v.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},v.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},v.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},v.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},v.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},v.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},v.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},v.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(V,Q,O,e,C){e();const R=V(85);O.default=function(v,w,g,p,T,c,o){var r={};return r.datum_type=v===void 0||v==="none"?R.PJD_NODATUM:R.PJD_WGS84,w&&(r.datum_params=w.map(parseFloat),r.datum_params[0]===0&&r.datum_params[1]===0&&r.datum_params[2]===0||(r.datum_type=R.PJD_3PARAM),r.datum_params.length>3&&(r.datum_params[3]===0&&r.datum_params[4]===0&&r.datum_params[5]===0&&r.datum_params[6]===0||(r.datum_type=R.PJD_7PARAM,r.datum_params[3]*=R.SEC_TO_RAD,r.datum_params[4]*=R.SEC_TO_RAD,r.datum_params[5]*=R.SEC_TO_RAD,r.datum_params[6]=r.datum_params[6]/1e6+1))),o&&(r.datum_type=R.PJD_GRIDSHIFT,r.grids=o),r.a=g,r.b=p,r.es=T,r.ep2=c,r}},function(Q,O,e,C,R){C();var v={};function w(r){if(r.length===0)return null;var i=r[0]==="@";return i&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:r,mandatory:!i,grid:v[r]||null,isNull:!1}}function g(r){return r/3600*Math.PI/180}function p(r,i,t){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(i,t)))}function T(r){return r.map(function(i){return[g(i.longitudeShift),g(i.latitudeShift)]})}function c(r,i,t){return{name:p(r,i+8,i+16).trim(),parent:p(r,i+24,i+24+8).trim(),lowerLatitude:r.getFloat64(i+72,t),upperLatitude:r.getFloat64(i+88,t),lowerLongitude:r.getFloat64(i+104,t),upperLongitude:r.getFloat64(i+120,t),latitudeInterval:r.getFloat64(i+136,t),longitudeInterval:r.getFloat64(i+152,t),gridNodeCount:r.getInt32(i+168,t)}}function o(r,i,t,s){for(var a=i+176,u=[],l=0;l<t.gridNodeCount;l++){var d={latitudeShift:r.getFloat32(a+16*l,s),longitudeShift:r.getFloat32(a+16*l+4,s),latitudeAccuracy:r.getFloat32(a+16*l+8,s),longitudeAccuracy:r.getFloat32(a+16*l+12,s)};u.push(d)}return u}e.default=function(r,i){var t=new DataView(i),s=(function(d){var m=d.getInt32(8,!1);return m===11?!1:((m=d.getInt32(8,!0))!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)})(t),a=(function(d,m){return{nFields:d.getInt32(8,m),nSubgridFields:d.getInt32(24,m),nSubgrids:d.getInt32(40,m),shiftType:p(d,56,64).trim(),fromSemiMajorAxis:d.getFloat64(120,m),fromSemiMinorAxis:d.getFloat64(136,m),toSemiMajorAxis:d.getFloat64(152,m),toSemiMinorAxis:d.getFloat64(168,m)}})(t,s);a.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var u=(function(d,m,f){for(var b=176,y=[],A=0;A<m.nSubgrids;A++){var L=c(d,b,f),x=o(d,b,L,f),H=Math.round(1+(L.upperLongitude-L.lowerLongitude)/L.longitudeInterval),S=Math.round(1+(L.upperLatitude-L.lowerLatitude)/L.latitudeInterval);y.push({ll:[g(L.lowerLongitude),g(L.lowerLatitude)],del:[g(L.longitudeInterval),g(L.latitudeInterval)],lim:[H,S],count:L.gridNodeCount,cvs:T(x)})}return y})(t,a,s),l={header:a,subgrids:u};return v[r]=l,l},e.getNadgrids=function(r){return r===void 0?null:r.split(",").map(w)}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(85),g=(0,v.__importDefault)(Q(107)),p=(0,v.__importDefault)(Q(109)),T=(0,v.__importDefault)(Q(80)),c=(0,v.__importDefault)(Q(110)),o=(0,v.__importDefault)(Q(111));e.default=function r(i,t,s,a){var u;if(Array.isArray(s)&&(s=(0,c.default)(s)),(0,o.default)(s),i.datum&&t.datum&&(function(l,d){return(l.datum.datum_type===w.PJD_3PARAM||l.datum.datum_type===w.PJD_7PARAM)&&d.datumCode!=="WGS84"||(d.datum.datum_type===w.PJD_3PARAM||d.datum.datum_type===w.PJD_7PARAM)&&l.datumCode!=="WGS84"})(i,t)&&(s=r(i,u=new T.default("WGS84"),s,a),i=u),a&&i.axis!=="enu"&&(s=(0,p.default)(i,!1,s)),i.projName==="longlat")s={x:s.x*w.D2R,y:s.y*w.D2R,z:s.z||0};else if(i.to_meter&&(s={x:s.x*i.to_meter,y:s.y*i.to_meter,z:s.z||0}),!(s=i.inverse(s)))return;if(i.from_greenwich&&(s.x+=i.from_greenwich),s=(0,g.default)(i.datum,t.datum,s))return t.from_greenwich&&(s={x:s.x-t.from_greenwich,y:s.y,z:s.z||0}),t.projName==="longlat"?s={x:s.x*w.R2D,y:s.y*w.R2D,z:s.z||0}:(s=t.forward(s),t.to_meter&&(s={x:s.x/t.to_meter,y:s.y/t.to_meter,z:s.z||0})),a&&t.axis!=="enu"?(0,p.default)(t,!0,s):s}},function(Q,O,e,C,R){C();const v=Q(1),w=Q(85),g=Q(108),p=(0,v.__importDefault)(Q(96));function T(i){return i===w.PJD_3PARAM||i===w.PJD_7PARAM}function c(i,t,s){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var a={x:-s.x,y:s.y},u={x:Number.NaN,y:Number.NaN},l=[],d=0;d<i.grids.length;d++){var m=i.grids[d];if(l.push(m.name),m.isNull){u=a;break}if(m.mandatory,m.grid!==null){var f=m.grid.subgrids[0],b=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,y=f.ll[0]-b,A=f.ll[1]-b,L=f.ll[0]+(f.lim[0]-1)*f.del[0]+b,x=f.ll[1]+(f.lim[1]-1)*f.del[1]+b;if(!(A>a.y||y>a.x||x<a.y||L<a.x||(u=o(a,t,f),isNaN(u.x))))break}else if(m.mandatory)return console.log("Unable to find mandatory grid '"+m.name+"'"),-1}return isNaN(u.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*w.R2D+" "+a.y*w.R2D+" tried: '"+l+"'"),-1):(s.x=-u.x,s.y=u.y,0)}function o(i,t,s){var a={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return a;var u={x:i.x,y:i.y};u.x-=s.ll[0],u.y-=s.ll[1],u.x=(0,p.default)(u.x-Math.PI)+Math.PI;var l=r(u,s);if(t){if(isNaN(l.x))return a;l.x=u.x-l.x,l.y=u.y-l.y;var d,m,f=9;do{if(m=r(l,s),isNaN(m.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:u.x-(m.x+l.x),y:u.y-(m.y+l.y)},l.x+=d.x,l.y+=d.y}while(f--&&Math.abs(d.x)>1e-12&&Math.abs(d.y)>1e-12);if(f<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=(0,p.default)(l.x+s.ll[0]),a.y=l.y+s.ll[1]}else isNaN(l.x)||(a.x=i.x+l.x,a.y=i.y+l.y);return a}function r(i,t){var s,a={x:i.x/t.del[0],y:i.y/t.del[1]},u=Math.floor(a.x),l=Math.floor(a.y),d=a.x-1*u,m=a.y-1*l,f={x:Number.NaN,y:Number.NaN};if(u<0||u>=t.lim[0]||l<0||l>=t.lim[1])return f;s=l*t.lim[0]+u;var b=t.cvs[s][0],y=t.cvs[s][1];s++;var A=t.cvs[s][0],L=t.cvs[s][1];s+=t.lim[0];var x=t.cvs[s][0],H=t.cvs[s][1];s--;var S=t.cvs[s][0],k=t.cvs[s][1],E=d*m,P=d*(1-m),N=(1-d)*(1-m),B=(1-d)*m;return f.x=N*b+P*A+B*S+E*x,f.y=N*y+P*L+B*k+E*H,f}e.default=function(i,t,s){if((0,g.compareDatums)(i,t)||i.datum_type===w.PJD_NODATUM||t.datum_type===w.PJD_NODATUM)return s;var a=i.a,u=i.es;if(i.datum_type===w.PJD_GRIDSHIFT){if(c(i,!1,s)!==0)return;a=w.SRS_WGS84_SEMIMAJOR,u=w.SRS_WGS84_ESQUARED}var l=t.a,d=t.b,m=t.es;if(t.datum_type===w.PJD_GRIDSHIFT&&(l=w.SRS_WGS84_SEMIMAJOR,d=w.SRS_WGS84_SEMIMINOR,m=w.SRS_WGS84_ESQUARED),u===m&&a===l&&!T(i.datum_type)&&!T(t.datum_type))return s;if(s=(0,g.geodeticToGeocentric)(s,u,a),T(i.datum_type)&&(s=(0,g.geocentricToWgs84)(s,i.datum_type,i.datum_params)),T(t.datum_type)&&(s=(0,g.geocentricFromWgs84)(s,t.datum_type,t.datum_params)),s=(0,g.geocentricToGeodetic)(s,m,l,d),!(t.datum_type===w.PJD_GRIDSHIFT&&c(t,!0,s)!==0))return s},e.applyGridShift=c},function(Q,O,e,C,R){C();const v=Q(85);e.compareDatums=function(w,g){return w.datum_type===g.datum_type&&!(w.a!==g.a||Math.abs(w.es-g.es)>5e-11)&&(w.datum_type===v.PJD_3PARAM?w.datum_params[0]===g.datum_params[0]&&w.datum_params[1]===g.datum_params[1]&&w.datum_params[2]===g.datum_params[2]:w.datum_type!==v.PJD_7PARAM||w.datum_params[0]===g.datum_params[0]&&w.datum_params[1]===g.datum_params[1]&&w.datum_params[2]===g.datum_params[2]&&w.datum_params[3]===g.datum_params[3]&&w.datum_params[4]===g.datum_params[4]&&w.datum_params[5]===g.datum_params[5]&&w.datum_params[6]===g.datum_params[6])},e.geodeticToGeocentric=function(w,g,p){var T,c,o,r,i=w.x,t=w.y,s=w.z?w.z:0;if(t<-v.HALF_PI&&t>-1.001*v.HALF_PI)t=-v.HALF_PI;else if(t>v.HALF_PI&&t<1.001*v.HALF_PI)t=v.HALF_PI;else{if(t<-v.HALF_PI)return{x:-1/0,y:-1/0,z:w.z};if(t>v.HALF_PI)return{x:1/0,y:1/0,z:w.z}}return i>Math.PI&&(i-=2*Math.PI),c=Math.sin(t),r=Math.cos(t),o=c*c,{x:((T=p/Math.sqrt(1-g*o))+s)*r*Math.cos(i),y:(T+s)*r*Math.sin(i),z:(T*(1-g)+s)*c}},e.geocentricToGeodetic=function(w,g,p,T){var c,o,r,i,t,s,a,u,l,d,m,f,b,y,A,L=1e-12,x=w.x,H=w.y,S=w.z?w.z:0;if(c=Math.sqrt(x*x+H*H),o=Math.sqrt(x*x+H*H+S*S),c/p<L){if(y=0,o/p<L)return v.HALF_PI,A=-T,{x:w.x,y:w.y,z:w.z}}else y=Math.atan2(H,x);r=S/o,u=(i=c/o)*(1-g)*(t=1/Math.sqrt(1-g*(2-g)*i*i)),l=r*t,b=0;do b++,s=g*(a=p/Math.sqrt(1-g*l*l))/(a+(A=c*u+S*l-a*(1-g*l*l))),f=(m=r*(t=1/Math.sqrt(1-s*(2-s)*i*i)))*u-(d=i*(1-s)*t)*l,u=d,l=m;while(f*f>1e-24&&b<30);return{x:y,y:Math.atan(m/Math.abs(d)),z:A}},e.geocentricToWgs84=function(w,g,p){if(g===v.PJD_3PARAM)return{x:w.x+p[0],y:w.y+p[1],z:w.z+p[2]};if(g===v.PJD_7PARAM){var T=p[0],c=p[1],o=p[2],r=p[3],i=p[4],t=p[5],s=p[6];return{x:s*(w.x-t*w.y+i*w.z)+T,y:s*(t*w.x+w.y-r*w.z)+c,z:s*(-i*w.x+r*w.y+w.z)+o}}},e.geocentricFromWgs84=function(w,g,p){if(g===v.PJD_3PARAM)return{x:w.x-p[0],y:w.y-p[1],z:w.z-p[2]};if(g===v.PJD_7PARAM){var T=p[0],c=p[1],o=p[2],r=p[3],i=p[4],t=p[5],s=p[6],a=(w.x-T)/s,u=(w.y-c)/s,l=(w.z-o)/s;return{x:a+t*u-i*l,y:-t*a+u+r*l,z:i*a-r*u+l}}}},function(Q,O,e,C,R){C(),e.default=function(v,w,g){var p,T,c,o=g.x,r=g.y,i=g.z||0,t={};for(c=0;c<3;c++)if(!w||c!==2||g.z!==void 0)switch(c===0?(p=o,T="ew".indexOf(v.axis[c])!==-1?"x":"y"):c===1?(p=r,T="ns".indexOf(v.axis[c])!==-1?"y":"x"):(p=i,T="z"),v.axis[c]){case"e":t[T]=p;break;case"w":t[T]=-p;break;case"n":t[T]=p;break;case"s":t[T]=-p;break;case"u":g[T]!==void 0&&(t.z=p);break;case"d":g[T]!==void 0&&(t.z=-p);break;default:return null}return t}},function(Q,O,e,C,R){C(),e.default=function(v){var w={x:v[0],y:v[1]};return v.length>2&&(w.z=v[2]),v.length>3&&(w.m=v[3]),w}},function(Q,O,e,C,R){function v(w){if(typeof Number.isFinite=="function"){if(Number.isFinite(w))return;throw new TypeError("coordinates must be finite numbers")}if(typeof w!="number"||w!=w||!isFinite(w))throw new TypeError("coordinates must be finite numbers")}C(),e.default=function(w){v(w.x),v(w.y)}},function(Q,O,e,C,R){C();const v=Q(1);var w,g,p,T,c;const o=Q(53),r=Q(42),i=(0,v.__importStar)(Q(45)),t=Q(48),s=(0,v.__importStar)(Q(18));class a extends r.View{initialize(){super.initialize(),this.visuals=new i.Visuals(this)}request_render(){this.parent.request_render()}get canvas(){return this.parent.canvas}set_data(H){const S=this;for(const k of this.model){if(!(k instanceof s.VectorSpec||k instanceof s.ScalarSpec))continue;const E=k.uniform(H);S[`${k.attr}`]=E}}}e.ArrowHeadView=a,a.__name__="ArrowHeadView";class u extends o.Model{constructor(H){super(H)}}e.ArrowHead=u,w=u,u.__name__="ArrowHead",w.define(()=>({size:[s.NumberSpec,25]}));class l extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const k=this.size.get(S);H.moveTo(.5*k,k),H.lineTo(.5*k,-2),H.lineTo(-.5*k,-2),H.lineTo(-.5*k,k),H.lineTo(0,0),H.lineTo(.5*k,k)}render(H,S){if(this.visuals.line.doit){this.visuals.line.set_vectorize(H,S);const k=this.size.get(S);H.beginPath(),H.moveTo(.5*k,k),H.lineTo(0,0),H.lineTo(-.5*k,k),H.stroke()}}}e.OpenHeadView=l,l.__name__="OpenHeadView";class d extends u{constructor(H){super(H)}}e.OpenHead=d,g=d,d.__name__="OpenHead",g.prototype.default_view=l,g.mixins(t.LineVector);class m extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const k=this.size.get(S);H.moveTo(.5*k,k),H.lineTo(.5*k,-2),H.lineTo(-.5*k,-2),H.lineTo(-.5*k,k),H.lineTo(.5*k,k)}render(H,S){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(H,S),this._normal(H,S),H.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(H,S),this._normal(H,S),H.stroke())}_normal(H,S){const k=this.size.get(S);H.beginPath(),H.moveTo(.5*k,k),H.lineTo(0,0),H.lineTo(-.5*k,k),H.closePath()}}e.NormalHeadView=m,m.__name__="NormalHeadView";class f extends u{constructor(H){super(H)}}e.NormalHead=f,p=f,f.__name__="NormalHead",p.prototype.default_view=m,p.mixins([t.LineVector,t.FillVector]),p.override({fill_color:"black"});class b extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const k=this.size.get(S);H.moveTo(.5*k,k),H.lineTo(.5*k,-2),H.lineTo(-.5*k,-2),H.lineTo(-.5*k,k),H.lineTo(0,.5*k),H.lineTo(.5*k,k)}render(H,S){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(H,S),this._vee(H,S),H.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(H,S),this._vee(H,S),H.stroke())}_vee(H,S){const k=this.size.get(S);H.beginPath(),H.moveTo(.5*k,k),H.lineTo(0,0),H.lineTo(-.5*k,k),H.lineTo(0,.5*k),H.closePath()}}e.VeeHeadView=b,b.__name__="VeeHeadView";class y extends u{constructor(H){super(H)}}e.VeeHead=y,T=y,y.__name__="VeeHead",T.prototype.default_view=b,T.mixins([t.LineVector,t.FillVector]),T.override({fill_color:"black"});class A extends a{render(H,S){if(this.visuals.line.doit){this.visuals.line.set_vectorize(H,S);const k=this.size.get(S);H.beginPath(),H.moveTo(.5*k,0),H.lineTo(-.5*k,0),H.stroke()}}clip(H,S){}}e.TeeHeadView=A,A.__name__="TeeHeadView";class L extends u{constructor(H){super(H)}}e.TeeHead=L,c=L,L.__name__="TeeHead",c.prototype.default_view=A,c.mixins(t.LineVector)},function(Q,O,e,C,R){C();const v=Q(9);async function w(g,p,T){const c=new g(Object.assign(Object.assign({},T),{model:p}));return c.initialize(),await c.lazy_initialize(),c}e.build_view=async function(g,p={parent:null},T=c=>c.default_view){const c=await w(T(g),g,p);return c.connect_signals(),c},e.build_views=async function(g,p,T={parent:null},c=o=>o.default_view){const o=(0,v.difference)([...g.keys()],p);for(const t of o)g.get(t).remove(),g.delete(t);const r=[],i=p.filter(t=>!g.has(t));for(const t of i){const s=await w(c(t),t,T);g.set(t,s),r.push(s)}for(const t of r)t.connect_signals();return r},e.remove_views=function(g){for(const[p,T]of g)T.remove(),g.delete(p)}},function(V,Q,O,e,C){e();const R=V(1);var v;const w=V(115),g=(0,R.__importStar)(V(48));class p extends w.UpperLowerView{paint(o){o.beginPath(),o.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let r=0,i=this._lower_sx.length;r<i;r++)o.lineTo(this._lower_sx[r],this._lower_sy[r]);for(let r=this._upper_sx.length-1;r>=0;r--)o.lineTo(this._upper_sx[r],this._upper_sy[r]);o.closePath(),this.visuals.fill.apply(o),o.beginPath(),o.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let r=0,i=this._lower_sx.length;r<i;r++)o.lineTo(this._lower_sx[r],this._lower_sy[r]);this.visuals.line.apply(o),o.beginPath(),o.moveTo(this._upper_sx[0],this._upper_sy[0]);for(let r=0,i=this._upper_sx.length;r<i;r++)o.lineTo(this._upper_sx[r],this._upper_sy[r]);this.visuals.line.apply(o)}}O.BandView=p,p.__name__="BandView";class T extends w.UpperLower{constructor(o){super(o)}}O.Band=T,v=T,T.__name__="Band",v.prototype.default_view=p,v.mixins([g.Line,g.Fill]),v.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(69),p=Q(20),T=(0,v.__importStar)(Q(18));class c extends g.DataAnnotationView{map_data(){const{frame:t}=this.plot_view,s=this.model.dimension,a=this.coordinates.x_scale,u=this.coordinates.y_scale,l=s=="height"?u:a,d=s=="height"?a:u,m=s=="height"?t.bbox.yview:t.bbox.xview,f=s=="height"?t.bbox.xview:t.bbox.yview;let b,y,A;b=this.model.properties.lower.units=="data"?l.v_compute(this._lower):m.v_compute(this._lower),y=this.model.properties.upper.units=="data"?l.v_compute(this._upper):m.v_compute(this._upper),A=this.model.properties.base.units=="data"?d.v_compute(this._base):f.v_compute(this._base);const[L,x]=s=="height"?[1,0]:[0,1],H=[b,A],S=[y,A];this._lower_sx=H[L],this._lower_sy=H[x],this._upper_sx=S[L],this._upper_sy=S[x]}}e.UpperLowerView=c,c.__name__="UpperLowerView";class o extends T.CoordinateSpec{get dimension(){return this.obj.dimension=="width"?"x":"y"}get units(){var t;return(t=this.spec.units)!==null&&t!==void 0?t:"data"}}e.XOrYCoordinateSpec=o,o.__name__="XOrYCoordinateSpec";class r extends g.DataAnnotation{constructor(t){super(t)}}e.UpperLower=r,w=r,r.__name__="UpperLower",w.define(()=>({dimension:[p.Dimension,"height"],lower:[o,{field:"lower"}],upper:[o,{field:"upper"}],base:[o,{field:"base"}]}))},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(40),p=(0,v.__importStar)(Q(48)),T=Q(20),c=Q(65);e.EDGE_TOLERANCE=2.5;class o extends g.AnnotationView{constructor(){super(...arguments),this.bbox=new c.BBox}connect_signals(){super.connect_signals(),this.connect(this.model.change,()=>this.request_render())}_render(){const{left:t,right:s,top:a,bottom:u}=this.model;if(t==null&&s==null&&a==null&&u==null)return;const{frame:l}=this.plot_view,d=this.coordinates.x_scale,m=this.coordinates.y_scale,f=(b,y,A,L,x)=>{let H;return H=b!=null?this.model.screen?b:y=="data"?A.compute(b):L.compute(b):x,H};this.bbox=c.BBox.from_rect({left:f(t,this.model.left_units,d,l.bbox.xview,l.bbox.left),right:f(s,this.model.right_units,d,l.bbox.xview,l.bbox.right),top:f(a,this.model.top_units,m,l.bbox.yview,l.bbox.top),bottom:f(u,this.model.bottom_units,m,l.bbox.yview,l.bbox.bottom)}),this._paint_box()}_paint_box(){const{ctx:t}=this.layer;t.save();const{left:s,top:a,width:u,height:l}=this.bbox;t.beginPath(),t.rect(s,a,u,l),this.visuals.fill.apply(t),this.visuals.hatch.apply(t),this.visuals.line.apply(t),t.restore()}interactive_bbox(){const t=this.model.line_width+e.EDGE_TOLERANCE;return this.bbox.grow_by(t)}interactive_hit(t,s){return this.model.in_cursor==null?!1:this.interactive_bbox().contains(t,s)}cursor(t,s){const{left:a,right:u,bottom:l,top:d}=this.bbox;return Math.abs(t-a)<3||Math.abs(t-u)<3?this.model.ew_cursor:Math.abs(s-l)<3||Math.abs(s-d)<3?this.model.ns_cursor:this.bbox.contains(t,s)?this.model.in_cursor:null}}e.BoxAnnotationView=o,o.__name__="BoxAnnotationView";class r extends g.Annotation{constructor(t){super(t)}update({left:t,right:s,top:a,bottom:u}){this.setv({left:t,right:s,top:a,bottom:u,screen:!0})}}e.BoxAnnotation=r,w=r,r.__name__="BoxAnnotation",w.prototype.default_view=o,w.mixins([p.Line,p.Fill,p.Hatch]),w.define(({Number:i,Nullable:t})=>({top:[t(i),null],top_units:[T.SpatialUnits,"data"],bottom:[t(i),null],bottom_units:[T.SpatialUnits,"data"],left:[t(i),null],left_units:[T.SpatialUnits,"data"],right:[t(i),null],right_units:[T.SpatialUnits,"data"],render_mode:[T.RenderMode,"canvas"]})),w.internal(({Boolean:i,String:t,Nullable:s})=>({screen:[i,!1],ew_cursor:[s(t),null],ns_cursor:[s(t),null],in_cursor:[s(t),null]})),w.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(40),p=Q(118),T=Q(126),c=Q(127),o=Q(130),r=Q(168),i=Q(131),t=Q(192),s=Q(132),a=Q(173),u=Q(172),l=Q(196),d=Q(204),m=Q(206),f=Q(133),b=Q(20),y=(0,v.__importStar)(Q(48)),A=Q(9),L=Q(207),x=Q(208),H=Q(211),S=Q(123),k=Q(11),E=Q(113),P=Q(65),N=Q(8);class B extends g.AnnotationView{get orientation(){return this._orientation}initialize(){super.initialize();const{ticker:M,formatter:F,color_mapper:W}=this.model;this._ticker=M!="auto"?M:(()=>{switch(!0){case W instanceof l.LogColorMapper:return new r.LogTicker;case W instanceof l.ScanningColorMapper:return new r.BinnedTicker({mapper:W});case W instanceof l.CategoricalColorMapper:return new r.CategoricalTicker;default:return new r.BasicTicker}})(),this._formatter=F!="auto"?F:(()=>{switch(!0){case this._ticker instanceof r.LogTicker:return new t.LogTickFormatter;case W instanceof l.CategoricalColorMapper:return new t.CategoricalTickFormatter;default:return new t.BasicTickFormatter}})(),this._major_range=(()=>{if(W instanceof l.CategoricalColorMapper){const{factors:Je}=W;return new m.FactorRange({factors:Je})}if(W instanceof u.ContinuousColorMapper){const{min:Je,max:rt}=W.metrics;return new m.Range1d({start:Je,end:rt})}(0,k.unreachable)()})(),this._major_scale=(()=>{if(W instanceof l.LinearColorMapper)return new d.LinearScale;if(W instanceof l.LogColorMapper)return new d.LogScale;if(W instanceof l.ScanningColorMapper){const{binning:Je}=W.metrics;return new d.LinearInterpolationScale({binning:Je})}if(W instanceof l.CategoricalColorMapper)return new d.CategoricalScale;(0,k.unreachable)()})(),this._minor_range=new m.Range1d({start:0,end:1}),this._minor_scale=new d.LinearScale;const U=y.attrs_of(this.model,"major_label_",y.Text,!0),q=y.attrs_of(this.model,"major_tick_",y.Line,!0),X=y.attrs_of(this.model,"minor_tick_",y.Line,!0),ae=y.attrs_of(this.model,"title_",y.Text),me=W instanceof l.CategoricalColorMapper?c.CategoricalAxis:W instanceof l.LogColorMapper?c.LogAxis:c.LinearAxis;this._axis=new me(Object.assign(Object.assign(Object.assign({ticker:this._ticker,formatter:this._formatter,major_tick_in:this.model.major_tick_in,major_tick_out:this.model.major_tick_out,minor_tick_in:this.model.minor_tick_in,minor_tick_out:this.model.minor_tick_out,major_label_standoff:this.model.label_standoff,major_label_overrides:this.model.major_label_overrides,major_label_policy:this.model.major_label_policy,axis_line_color:null},U),q),X));const{title:Ve}=this.model;Ve&&(this._title=new p.Title(Object.assign({text:Ve,standoff:this.model.title_standoff},ae)))}async lazy_initialize(){await super.lazy_initialize();const M=this,F={get parent(){return M.parent},get root(){return M.root},get frame(){return M._frame},get canvas_view(){return M.parent.canvas_view},request_layout(){M.parent.request_layout()}};this._axis_view=await(0,E.build_view)(this._axis,{parent:F}),this._title!=null&&(this._title_view=await(0,E.build_view)(this._title,{parent:F}))}remove(){var M;(M=this._title_view)===null||M===void 0||M.remove(),this._axis_view.remove(),super.remove()}connect_signals(){super.connect_signals(),this.connect(this._ticker.change,()=>this.request_render()),this.connect(this._formatter.change,()=>this.request_render()),this.connect(this.model.color_mapper.metrics_change,()=>{const M=this._major_range,F=this._major_scale,{color_mapper:W}=this.model;if(W instanceof u.ContinuousColorMapper&&M instanceof m.Range1d){const{min:U,max:q}=W.metrics;M.setv({start:U,end:q})}if(W instanceof l.ScanningColorMapper&&F instanceof d.LinearInterpolationScale){const{binning:U}=W.metrics;F.binning=U}this._set_canvas_image(),this.plot_view.request_layout()})}_set_canvas_image(){const{orientation:M}=this,F=(()=>{const{palette:Ve}=this.model.color_mapper;return M=="vertical"?(0,A.reversed)(Ve):Ve})(),[W,U]=M=="vertical"?[1,F.length]:[F.length,1],q=this._image=document.createElement("canvas");q.width=W,q.height=U;const X=q.getContext("2d"),ae=X.getImageData(0,0,W,U),me=new l.LinearColorMapper({palette:F}).rgba_mapper.v_compute((0,A.range)(0,F.length));ae.data.set(me),X.putImageData(ae,0,0)}update_layout(){const{location:M,width:F,height:W,padding:U,margin:q}=this.model,[X,ae]=(()=>{if(!(0,N.isString)(M))return["end","start"];switch(M){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"]}})(),me=this._orientation=(()=>{const{orientation:Xt}=this.model;return Xt=="auto"?this.panel!=null?this.panel.is_horizontal?"horizontal":"vertical":ae=="start"||ae=="end"||ae=="center"&&X=="center"?"vertical":"horizontal":Xt})(),Ve=new x.NodeLayout,Je=new x.VStack,rt=new x.VStack,yt=new x.HStack,xt=new x.HStack;Ve.absolute=!0,Je.absolute=!0,rt.absolute=!0,yt.absolute=!0,xt.absolute=!0;const[r1,t1,Bt,Kt]=me=="horizontal"?[this._major_scale,this._minor_scale,this._major_range,this._minor_range]:[this._minor_scale,this._major_scale,this._minor_range,this._major_range];this._frame=new T.CartesianFrame(r1,t1,Bt,Kt),Ve.on_resize(Xt=>this._frame.set_geometry(Xt));const wt=new H.BorderLayout;this._inner_layout=wt,wt.absolute=!0,wt.center_panel=Ve,wt.top_panel=Je,wt.bottom_panel=rt,wt.left_panel=yt,wt.right_panel=xt;const Rt={left:U,right:U,top:U,bottom:U},Ht=(()=>{if(this.panel==null){if((0,N.isString)(M))return{left:q,right:q,top:q,bottom:q};{const[Xt,u1]=M;return{left:Xt,right:q,top:q,bottom:u1}}}if(!(0,N.isString)(M)){const[Xt,u1]=M;return wt.fixup_geometry=(v1,h1)=>{const De=v1,Ze=this.layout.bbox,{width:$e,height:Qt}=v1;if(v1=new P.BBox({left:Ze.left+Xt,bottom:Ze.bottom-u1,width:$e,height:Qt}),h1!=null){const It=v1.left-De.left,Ut=v1.top-De.top,{left:Zt,top:b1,width:k1,height:A1}=h1;h1=new P.BBox({left:Zt+It,top:b1+Ut,width:k1,height:A1})}return[v1,h1]},{left:Xt,right:0,top:0,bottom:u1}}wt.fixup_geometry=(Xt,u1)=>{const v1=Xt;if(me=="horizontal"){const{top:h1,width:De,height:Ze}=Xt;if(ae=="end"){const{right:$e}=this.layout.bbox;Xt=new P.BBox({right:$e,top:h1,width:De,height:Ze})}else if(ae=="center"){const{hcenter:$e}=this.layout.bbox;Xt=new P.BBox({hcenter:Math.round($e),top:h1,width:De,height:Ze})}}else{const{left:h1,width:De,height:Ze}=Xt;if(X=="end"){const{bottom:$e}=this.layout.bbox;Xt=new P.BBox({left:h1,bottom:$e,width:De,height:Ze})}else if(X=="center"){const{vcenter:$e}=this.layout.bbox;Xt=new P.BBox({left:h1,vcenter:Math.round($e),width:De,height:Ze})}}if(u1!=null){const h1=Xt.left-v1.left,De=Xt.top-v1.top,{left:Ze,top:$e,width:Qt,height:It}=u1;u1=new P.BBox({left:Ze+h1,top:$e+De,width:Qt,height:It})}return[Xt,u1]}})();let dt,Wt,jt,a1;if(wt.padding=Rt,this.panel!=null?(dt="max",Wt=void 0,jt=void 0,a1=void 0):(me=="horizontal"?F:W)=="auto"?(dt="fixed",Wt=25*this.model.color_mapper.palette.length,jt={percent:.3},a1={percent:.8}):(dt="fit",Wt=void 0),me=="horizontal"){const Xt=F=="auto"?void 0:F,u1=W=="auto"?25:W;wt.set_sizing({width_policy:dt,height_policy:"min",width:Wt,min_width:jt,max_width:a1,halign:ae,valign:X,margin:Ht}),wt.center_panel.set_sizing({width_policy:F=="auto"?"fit":"fixed",height_policy:"fixed",width:Xt,height:u1})}else{const Xt=F=="auto"?25:F,u1=W=="auto"?void 0:W;wt.set_sizing({width_policy:"min",height_policy:dt,height:Wt,min_height:jt,max_height:a1,halign:ae,valign:X,margin:Ht}),wt.center_panel.set_sizing({width_policy:"fixed",height_policy:W=="auto"?"fit":"fixed",width:Xt,height:u1})}Je.set_sizing({width_policy:"fit",height_policy:"min"}),rt.set_sizing({width_policy:"fit",height_policy:"min"}),yt.set_sizing({width_policy:"min",height_policy:"fit"}),xt.set_sizing({width_policy:"min",height_policy:"fit"});const{_title_view:ye}=this;ye!=null&&(me=="horizontal"?(ye.panel=new S.Panel("above"),ye.update_layout(),Je.children.push(ye.layout)):(ye.panel=new S.Panel("left"),ye.update_layout(),yt.children.push(ye.layout)));const{panel:ie}=this,nt=ie!=null&&me==ie.orientation?ie.side:me=="horizontal"?"below":"right",St=(()=>{switch(nt){case"above":return Je;case"below":return rt;case"left":return yt;case"right":return xt}})(),{_axis_view:mt}=this;if(mt.panel=new S.Panel(nt),mt.update_layout(),St.children.push(mt.layout),this.panel!=null){const Xt=new L.Grid([{layout:wt,row:0,col:0}]);Xt.absolute=!0,me=="horizontal"?Xt.set_sizing({width_policy:"max",height_policy:"min"}):Xt.set_sizing({width_policy:"min",height_policy:"max"}),this.layout=Xt}else this.layout=this._inner_layout;const{visible:Pt}=this.model;this.layout.sizing.visible=Pt,this._set_canvas_image()}_render(){var M;const{ctx:F}=this.layer;F.save(),this._paint_bbox(F,this._inner_layout.bbox),this._paint_image(F,this._inner_layout.center_panel.bbox),(M=this._title_view)===null||M===void 0||M.render(),this._axis_view.render(),F.restore()}_paint_bbox(M,F){const{x:W,y:U}=F;let{width:q,height:X}=F;W+q>=this.parent.canvas_view.bbox.width&&(q-=1),U+X>=this.parent.canvas_view.bbox.height&&(X-=1),M.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(M),M.fillRect(W,U,q,X)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(M),M.strokeRect(W,U,q,X)),M.restore()}_paint_image(M,F){const{x:W,y:U,width:q,height:X}=F;M.save(),M.setImageSmoothingEnabled(!1),M.globalAlpha=this.model.scale_alpha,M.drawImage(this._image,W,U,q,X),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(M),M.strokeRect(W,U,q,X)),M.restore()}serializable_state(){const M=super.serializable_state(),{children:F=[]}=M,W=(0,v.__rest)(M,["children"]);return this._title_view!=null&&F.push(this._title_view.serializable_state()),F.push(this._axis_view.serializable_state()),Object.assign(Object.assign({},W),{children:F})}}e.ColorBarView=B,B.__name__="ColorBarView";class D extends g.Annotation{constructor(M){super(M)}}e.ColorBar=D,w=D,D.__name__="ColorBar",w.prototype.default_view=B,w.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]]),w.define(({Alpha:j,Number:M,String:F,Tuple:W,Dict:U,Or:q,Ref:X,Auto:ae,Nullable:me})=>({location:[q(b.Anchor,W(M,M)),"top_right"],orientation:[q(b.Orientation,ae),"auto"],title:[me(F),null],title_standoff:[M,2],width:[q(M,ae),"auto"],height:[q(M,ae),"auto"],scale_alpha:[j,1],ticker:[q(X(o.Ticker),ae),"auto"],formatter:[q(X(i.TickFormatter),ae),"auto"],major_label_overrides:[U(q(F,X(f.BaseText))),{}],major_label_policy:[X(s.LabelingPolicy),()=>new s.NoOverlap],color_mapper:[X(a.ColorMapper)],label_standoff:[M,5],margin:[M,30],padding:[M,10],major_tick_in:[M,5],major_tick_out:[M,0],minor_tick_in:[M,0],minor_tick_out:[M,0]})),w.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(Q,O,e,C,R){C();const v=Q(1);var w;const g=Q(119),p=Q(20),T=Q(120),c=(0,v.__importStar)(Q(48));class o extends g.TextAnnotationView{_get_location(){const t=this.model.offset,s=this.model.standoff/2;let a,u;const{bbox:l}=this.layout;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":u=l.top+s;break;case"middle":u=l.vcenter;break;case"bottom":u=l.bottom-s}switch(this.model.align){case"left":a=l.left+t;break;case"center":a=l.hcenter;break;case"right":a=l.right-t}break;case"left":switch(this.model.vertical_align){case"top":a=l.left+s;break;case"middle":a=l.hcenter;break;case"bottom":a=l.right-s}switch(this.model.align){case"left":u=l.bottom-t;break;case"center":u=l.vcenter;break;case"right":u=l.top+t}break;case"right":switch(this.model.vertical_align){case"top":a=l.right-s;break;case"middle":a=l.hcenter;break;case"bottom":a=l.left+s}switch(this.model.align){case"left":u=l.top+t;break;case"center":u=l.vcenter;break;case"right":u=l.bottom-t}}return[a,u]}_render(){const{text:t}=this.model;if(t==null||t.length==0)return;this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;const[s,a]=this._get_location(),u=this.panel.get_label_angle_heuristic("parallel");(this.model.render_mode=="canvas"?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,t,s,a,u)}_get_size(){const{text:t}=this.model,s=new T.TextBox({text:t});s.visuals=this.visuals.text.values();const{width:a,height:u}=s.size();return{width:a,height:u==0?0:2+u+this.model.standoff}}}e.TitleView=o,o.__name__="TitleView";class r extends g.TextAnnotation{constructor(t){super(t)}}e.Title=r,w=r,r.__name__="Title",w.prototype.default_view=o,w.mixins([c.Text,["border_",c.Line],["background_",c.Fill]]),w.define(({Number:i,String:t})=>({text:[t,""],vertical_align:[p.VerticalAlign,"bottom"],align:[p.TextAlign,"left"],offset:[i,0],standoff:[i,10]})),w.prototype._props.text_align.options.internal=!0,w.prototype._props.text_baseline.options.internal=!0,w.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})},function(Q,O,e,C,R){var v;C();const w=Q(40),g=Q(43),p=Q(20),T=Q(120),c=Q(123),o=Q(11);class r extends w.AnnotationView{update_layout(){const{panel:s}=this;this.layout=s!=null?new c.SideLayout(s,()=>this.get_size(),!0):void 0}initialize(){super.initialize(),this.model.render_mode=="css"&&(this.el=(0,g.div)(),this.plot_view.canvas_view.add_overlay(this.el))}remove(){this.el!=null&&(0,g.remove)(this.el),super.remove()}connect_signals(){super.connect_signals(),this.model.render_mode=="css"?this.connect(this.model.change,()=>this.render()):this.connect(this.model.change,()=>this.request_render())}render(){this.model.visible||this.model.render_mode!="css"||(0,g.undisplay)(this.el),super.render()}_canvas_text(s,a,u,l,d){const m=new T.TextBox({text:a});m.angle=d,m.position={sx:u,sy:l},m.visuals=this.visuals.text.values();const{background_fill:f,border_line:b}=this.visuals;if(f.doit||b.doit){const{p0:y,p1:A,p2:L,p3:x}=m.rect();s.beginPath(),s.moveTo(y.x,y.y),s.lineTo(A.x,A.y),s.lineTo(L.x,L.y),s.lineTo(x.x,x.y),s.closePath(),this.visuals.background_fill.apply(s),this.visuals.border_line.apply(s)}this.visuals.text.doit&&m.paint(s)}_css_text(s,a,u,l,d){const{el:m}=this;(0,o.assert)(m!=null),(0,g.undisplay)(m),m.textContent=a,this.visuals.text.set_value(s),m.style.position="absolute",m.style.left=`${u}px`,m.style.top=`${l}px`,m.style.color=s.fillStyle,m.style.font=s.font,m.style.lineHeight="normal",m.style.whiteSpace="pre";const[f,b]=(()=>{switch(this.visuals.text.text_align.get_value()){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[y,A]=(()=>{switch(this.visuals.text.text_baseline.get_value()){case"top":return["top","0%"];case"middle":return["center","-50%"];case"bottom":return["bottom","-100%"];default:return["center","-50%"]}})();let L=`translate(${b}, ${A})`;d&&(L+=`rotate(${d}rad)`),m.style.transformOrigin=`${f} ${y}`,m.style.transform=L,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(s),m.style.backgroundColor=s.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(s),m.style.borderStyle=s.lineDash.length<2?"solid":"dashed",m.style.borderWidth=`${s.lineWidth}px`,m.style.borderColor=s.strokeStyle),(0,g.display)(m)}}e.TextAnnotationView=r,r.__name__="TextAnnotationView";class i extends w.Annotation{constructor(s){super(s)}}e.TextAnnotation=i,v=i,i.__name__="TextAnnotation",v.define(()=>({render_mode:[p.RenderMode,"canvas"]}))},function(Q,O,e,C,R){C();const v=Q(65),w=Q(121),g=Q(9),p=Q(8),T=Q(122),c=Q(22);e.text_width=(()=>{const s=document.createElement("canvas").getContext("2d");let a="";return(u,l)=>(l!=a&&(a=l,s.font=l),s.measureText(u).width)})();class o{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(a){a!=null&&(this._base_font_size=a)}get base_font_size(){return this._base_font_size}set position(a){this._position=a}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:a,p1:u,p2:l,p3:d}=this.rect(),m=Math.min(a.x,u.x,l.x,d.x),f=Math.min(a.y,u.y,l.y,d.y),b=Math.max(a.x,u.x,l.x,d.x),y=Math.max(a.y,u.y,l.y,d.y);return new v.BBox({left:m,right:b,top:f,bottom:y})}size(){const{width:a,height:u}=this._size(),{angle:l}=this;if(l){const d=Math.cos(Math.abs(l)),m=Math.sin(Math.abs(l));return{width:Math.abs(a*d+u*m),height:Math.abs(a*m+u*d)}}return{width:a,height:u}}rect(){const a=this._rect(),{angle:u}=this;if(u){const{sx:l,sy:d}=this.position,m=new T.AffineTransform;return m.translate(l,d),m.rotate(u),m.translate(-l,-d),m.apply_rect(a)}return a}paint_rect(a){const{p0:u,p1:l,p2:d,p3:m}=this.rect();a.save(),a.strokeStyle="red",a.lineWidth=1,a.beginPath();const{round:f}=Math;a.moveTo(f(u.x),f(u.y)),a.lineTo(f(l.x),f(l.y)),a.lineTo(f(d.x),f(d.y)),a.lineTo(f(m.x),f(m.y)),a.closePath(),a.stroke(),a.restore()}paint_bbox(a){const{x:u,y:l,width:d,height:m}=this.bbox();a.save(),a.strokeStyle="blue",a.lineWidth=1,a.beginPath();const{round:f}=Math;a.moveTo(f(u),f(l)),a.lineTo(f(u),f(l+m)),a.lineTo(f(u+d),f(l+m)),a.lineTo(f(u+d),f(l)),a.closePath(),a.stroke(),a.restore()}}e.GraphicsBox=o,o.__name__="GraphicsBox";class r extends o{constructor({text:a}){super(),this.text=a}set visuals(a){const u=a.color,l=a.alpha,d=a.font_style;let m=a.font_size;const f=a.font,{font_size_scale:b,base_font_size:y}=this,A=(0,w.parse_css_font_size)(m);if(A!=null){let{value:S,unit:k}=A;S*=b,k=="em"&&y&&(S*=y,k="px"),m=`${S}${k}`}const L=`${d} ${m} ${f}`;this.font=L,this.color=(0,c.color2css)(u,l),this.line_height=a.line_height;const x=a.align;this._x_anchor=x;const H=a.baseline;this._y_anchor=(()=>{switch(H){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}infer_text_height(){return this.text.includes(`
3
3
  `)?"ascent_descent":function(u){for(const l of new Set(u))if(!("0"<=l&&l<="9"))switch(l){case",":case".":case"+":case"-":case"−":case"e":continue;default:return!1}return!0}(this.text)?"cap":"ascent_descent"}_text_line(a){var u;const l=(u=this.text_height_metric)!==null&&u!==void 0?u:this.infer_text_height(),d=(()=>{switch(l){case"x":case"x_descent":return a.x_height;case"cap":case"cap_descent":return a.cap_height;case"ascent":case"ascent_descent":return a.ascent}})(),m=(()=>{switch(l){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return a.descent}})();return{height:d+m,ascent:d,descent:m}}get nlines(){return this.text.split(`
4
4
  `).length}_size(){var a,u;const{font:l}=this,d=(0,w.font_metrics)(l),m=(this.line_height-1)*d.height,f=this.text=="",b=this.text.split(`