diff --git a/metaflow/plugins/cards/card_modules/bundle.css b/metaflow/plugins/cards/card_modules/bundle.css index 06801798687..568b5e73944 100644 --- a/metaflow/plugins/cards/card_modules/bundle.css +++ b/metaflow/plugins/cards/card_modules/bundle.css @@ -155,7 +155,7 @@ code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shad text-shadow: none; user-select: auto; } -aside.svelte-1okdv0e{display:none;line-height:2;text-align:left}@media(min-width: 60rem){aside.svelte-1okdv0e{display:flex;flex-direction:column;height:100vh;justify-content:space-between;padding:2.5rem 0 1.5rem 1.5rem;position:fixed;width:var(--aside-width)}}.embed aside{display:none}aside ul{list-style-type:none}aside a, aside button, aside a:visited{text-decoration:none;cursor:pointer;font-weight:700;color:var(--black)}aside a:hover, aside button:hover{text-decoration:underline}.logoContainer svg{width:100%;max-width:140px;margin-bottom:3.75rem;height:auto}.mainContainer.svelte-13ho8jo{max-width:110rem}main.svelte-13ho8jo{flex:0 1 auto;max-width:100rem;padding:1.5rem}@media(min-width: 60rem){main.svelte-13ho8jo{margin-left:var(--aside-width)}}.embed main{margin:0 auto}.modal.svelte-1hhf5ym{align-items:center;background:rgba(0, 0, 0, 0.5);bottom:0;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;overflow:hidden;position:fixed;right:0;top:0;width:100%;z-index:100}.modalContainer > *{background-color:white;border-radius:5px;cursor:default;flex:0 1 auto;padding:1rem;position:relative}.modal img{max-height:80vh !important}.cancelButton.svelte-1hhf5ym{color:white;cursor:pointer;font-size:2rem;position:absolute;right:1rem;top:1rem}.cancelButton.svelte-1hhf5ym:hover{color:var(--blue)}.nav.svelte-1kdpgko.svelte-1kdpgko{border-radius:0 0 5px 0;display:none;margin:0;top:0}ul.navList.svelte-1kdpgko.svelte-1kdpgko{list-style-type:none}ul.navList.svelte-1kdpgko ul.svelte-1kdpgko{margin:0.5rem 1rem 2rem}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0}.navItem.svelte-1kdpgko li.svelte-1kdpgko:hover{color:var(--blue)}.pageId.svelte-1kdpgko.svelte-1kdpgko{display:block;border-bottom:1px solid var(--grey);padding:0 0.5rem;margin-bottom:1rem}@media(min-width: 60rem){.nav.svelte-1kdpgko.svelte-1kdpgko{display:block}ul.navList.svelte-1kdpgko.svelte-1kdpgko{text-align:left}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0.5rem 0}}.container.svelte-ubs992{width:100%;overflow:auto}table.svelte-ubs992{width:100%}header.svelte-1ugmt5d{margin-bottom:var(--component-spacer)}figure.svelte-1x96yvr{background:var(--lt-grey);padding:1rem;border-radius:5px;text-align:center;margin:0 auto var(--component-spacer)}@media(min-width: 60rem){figure.svelte-1x96yvr{margin-bottom:0}}img.svelte-1x96yvr{max-width:100%;max-height:500px}.label.svelte-1x96yvr{font-weight:bold;margin:0.5rem 0}.description.svelte-1x96yvr{font-size:0.9rem;font-style:italic;text-align:center;margin:0.5rem 0}.log.svelte-1jhmsu{background:var(--lt-grey) !important;font-size:0.9rem;padding:2rem}.page.svelte-v7ihqd:last-of-type{margin-bottom:var(--component-spacer)}.page:last-of-type section:last-of-type hr{display:none}.heading.svelte-17n0qr8{margin-bottom:1.5rem}.sectionItems.svelte-17n0qr8{display:block}.sectionItems .imageContainer{max-height:500px}.container.svelte-17n0qr8{scroll-margin:var(--component-spacer)}hr.svelte-17n0qr8{background:var(--grey);border:none;height:1px;margin:var(--component-spacer) 0;padding:0}@media(min-width: 60rem){.sectionItems.svelte-17n0qr8{display:grid;grid-gap:2rem}}.svelte-5d173i::-webkit-progress-bar,.svelte-5d173i::-moz-progress-bar{background-color:#326cde}table .container{background:transparent !important;font-size:10px !important;padding:0 !important}table progress{height:4px !important}.container.svelte-5d173i{display:flex;align-items:center;justify-content:center;font-size:12px;border-radius:3px;background:#edf5ff;padding:3rem}.inner.svelte-5d173i{max-width:410px;width:100%;text-align:center}.info.svelte-5d173i{display:flex;justify-content:space-between}table .info{text-align:left;flex-direction:column}label.svelte-5d173i{font-weight:bold}.labelValue.svelte-5d173i{border-left:1px solid rgba(0, 0, 0, 0.1);margin-left:0.25rem;padding-left:0.5rem}.details.svelte-5d173i{font-family:var(--mono-font);font-size:8px;color:#333433;line-height:18px;overflow:hidden;white-space:nowrap}progress.svelte-5d173i{width:100%;border:none;border-radius:5px;height:8px;background:white}.subtitle.svelte-lu9pnn{font-size:1rem;text-align:left}.title.svelte-117s0ws{text-align:left}.idCell.svelte-pt8vzv{font-weight:bold;text-align:right;background:var(--lt-grey);width:12%}.codeCell.svelte-pt8vzv{text-align:left;user-select:all}.tableContainer.svelte-q3hq57{overflow:auto}th.svelte-q3hq57{position:sticky;top:-1px;z-index:2;white-space:nowrap;background:var(--white)}td.svelte-gl9h79{text-align:left}td.labelColumn.svelte-gl9h79{text-align:right;background-color:var(--lt-grey);font-weight:700;width:12%;white-space:nowrap}:root { +aside.svelte-1okdv0e{display:none;line-height:2;text-align:left}@media(min-width: 60rem){aside.svelte-1okdv0e{display:flex;flex-direction:column;height:100vh;justify-content:space-between;padding:2.5rem 0 1.5rem 1.5rem;position:fixed;width:var(--aside-width)}}.embed aside{display:none}aside ul{list-style-type:none}aside a, aside button, aside a:visited{text-decoration:none;cursor:pointer;font-weight:700;color:var(--black)}aside a:hover, aside button:hover{text-decoration:underline}.logoContainer svg{width:100%;max-width:140px;margin-bottom:3.75rem;height:auto}.nav.svelte-1kdpgko.svelte-1kdpgko{border-radius:0 0 5px 0;display:none;margin:0;top:0}ul.navList.svelte-1kdpgko.svelte-1kdpgko{list-style-type:none}ul.navList.svelte-1kdpgko ul.svelte-1kdpgko{margin:0.5rem 1rem 2rem}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0}.navItem.svelte-1kdpgko li.svelte-1kdpgko:hover{color:var(--blue)}.pageId.svelte-1kdpgko.svelte-1kdpgko{display:block;border-bottom:1px solid var(--grey);padding:0 0.5rem;margin-bottom:1rem}@media(min-width: 60rem){.nav.svelte-1kdpgko.svelte-1kdpgko{display:block}ul.navList.svelte-1kdpgko.svelte-1kdpgko{text-align:left}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0.5rem 0}}.mainContainer.svelte-13ho8jo{max-width:110rem}main.svelte-13ho8jo{flex:0 1 auto;max-width:100rem;padding:1.5rem}@media(min-width: 60rem){main.svelte-13ho8jo{margin-left:var(--aside-width)}}.embed main{margin:0 auto}.modal.svelte-1hhf5ym{align-items:center;background:rgba(0, 0, 0, 0.5);bottom:0;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;overflow:hidden;position:fixed;right:0;top:0;width:100%;z-index:100}.modalContainer > *{background-color:white;border-radius:5px;cursor:default;flex:0 1 auto;padding:1rem;position:relative}.modal img{max-height:80vh !important}.cancelButton.svelte-1hhf5ym{color:white;cursor:pointer;font-size:2rem;position:absolute;right:1rem;top:1rem}.cancelButton.svelte-1hhf5ym:hover{color:var(--blue)}.container.svelte-ubs992{width:100%;overflow:auto}table.svelte-ubs992{width:100%}figure.svelte-1x96yvr{background:var(--lt-grey);padding:1rem;border-radius:5px;text-align:center;margin:0 auto var(--component-spacer)}@media(min-width: 60rem){figure.svelte-1x96yvr{margin-bottom:0}}img.svelte-1x96yvr{max-width:100%;max-height:500px}.label.svelte-1x96yvr{font-weight:bold;margin:0.5rem 0}.description.svelte-1x96yvr{font-size:0.9rem;font-style:italic;text-align:center;margin:0.5rem 0}header.svelte-1ugmt5d{margin-bottom:var(--component-spacer)}.log.svelte-1jhmsu{background:var(--lt-grey) !important;font-size:0.9rem;padding:2rem}.page.svelte-v7ihqd:last-of-type{margin-bottom:var(--component-spacer)}.page:last-of-type section:last-of-type hr{display:none}.heading.svelte-17n0qr8{margin-bottom:1.5rem}.sectionItems.svelte-17n0qr8{display:block}.sectionItems .imageContainer{max-height:500px}.container.svelte-17n0qr8{scroll-margin:var(--component-spacer)}hr.svelte-17n0qr8{background:var(--grey);border:none;height:1px;margin:var(--component-spacer) 0;padding:0}@media(min-width: 60rem){.sectionItems.svelte-17n0qr8{display:grid;grid-gap:2rem}}.svelte-5d173i::-webkit-progress-bar,.svelte-5d173i::-moz-progress-bar{background-color:#326cde}table .container{background:transparent !important;font-size:10px !important;padding:0 !important}table progress{height:4px !important}.container.svelte-5d173i{display:flex;align-items:center;justify-content:center;font-size:12px;border-radius:3px;background:#edf5ff;padding:3rem}.inner.svelte-5d173i{max-width:410px;width:100%;text-align:center}.info.svelte-5d173i{display:flex;justify-content:space-between}table .info{text-align:left;flex-direction:column}label.svelte-5d173i{font-weight:bold}.labelValue.svelte-5d173i{border-left:1px solid rgba(0, 0, 0, 0.1);margin-left:0.25rem;padding-left:0.5rem}.details.svelte-5d173i{font-family:var(--mono-font);font-size:8px;color:#333433;line-height:18px;overflow:hidden;white-space:nowrap}progress.svelte-5d173i{width:100%;border:none;border-radius:5px;height:8px;background:white}.subtitle.svelte-lu9pnn{font-size:1rem;text-align:left}.title.svelte-117s0ws{text-align:left}.idCell.svelte-pt8vzv{font-weight:bold;text-align:right;background:var(--lt-grey);width:12%}.codeCell.svelte-pt8vzv{text-align:left;user-select:all}.tableContainer.svelte-q3hq57{overflow:auto}th.svelte-q3hq57{position:sticky;top:-1px;z-index:2;white-space:nowrap;background:var(--white)}td.svelte-gl9h79{text-align:left}td.labelColumn.svelte-gl9h79{text-align:right;background-color:var(--lt-grey);font-weight:700;width:12%;white-space:nowrap}.stepwrapper.svelte-18aex7a{display:flex;align-items:center;flex-direction:column;width:100%;position:relative;min-width:var(--dag-step-width)}.childwrapper.svelte-18aex7a{display:flex;width:100%}.gap.svelte-18aex7a{height:var(--dag-gap)}:root { --dag-border: #282828; --dag-bg-static: var(--lt-grey); --dag-bg-success: #a5d46a; @@ -167,4 +167,4 @@ aside.svelte-1okdv0e{display:none;line-height:2;text-align:left}@media(min-width --dag-step-width: 11.25rem; --dag-selected: #ffd700; } -.stepwrapper.svelte-18aex7a{display:flex;align-items:center;flex-direction:column;width:100%;position:relative;min-width:var(--dag-step-width)}.childwrapper.svelte-18aex7a{display:flex;width:100%}.gap.svelte-18aex7a{height:var(--dag-gap)}.connectorwrapper.svelte-1hyaq5f{transform-origin:0 0;position:absolute;z-index:0;min-width:var(--strokeWidth)}.flip.svelte-1hyaq5f{transform:scaleX(-1)}.path.svelte-1hyaq5f{--strokeWidth:0.5rem;--strokeColor:var(--dag-connector);--borderRadius:1.25rem;box-sizing:border-box}.straightLine.svelte-1hyaq5f{position:absolute;top:0;bottom:0;left:0;right:0;border-left:var(--strokeWidth) solid var(--strokeColor)}.topLeft.svelte-1hyaq5f{position:absolute;top:0;left:0;right:50%;bottom:calc(var(--dag-gap) / 2 - var(--strokeWidth) / 2);border-radius:0 0 0 var(--borderRadius);border-left:var(--strokeWidth) solid var(--strokeColor);border-bottom:var(--strokeWidth) solid var(--strokeColor)}.bottomRight.svelte-1hyaq5f{position:absolute;top:calc(100% - (var(--dag-gap) / 2 + var(--strokeWidth) / 2));left:50%;right:0;bottom:0;border-radius:0 var(--borderRadius) 0 0;border-top:var(--strokeWidth) solid var(--strokeColor);border-right:var(--strokeWidth) solid var(--strokeColor)}.wrapper.svelte-117ceti.svelte-117ceti{position:relative;z-index:1}.step.svelte-117ceti.svelte-117ceti{font-size:0.75rem;padding:0.5rem;color:var(--dk-grey)}.rectangle.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-static);border:1px solid var(--dag-border);box-sizing:border-box;position:relative;height:var(--dag-step-height);width:var(--dag-step-width)}.rectangle.error.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-error)}.rectangle.success.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-success)}.rectangle.running.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-running)}.level.svelte-117ceti.svelte-117ceti{z-index:-1;filter:contrast(0.5);position:absolute}.inner.svelte-117ceti.svelte-117ceti{position:relative;height:100%;width:100%}.name.svelte-117ceti.svelte-117ceti{font-weight:bold;overflow:hidden;text-overflow:ellipsis;display:block}.description.svelte-117ceti.svelte-117ceti{position:absolute;max-height:4rem;bottom:0;left:0;right:0;overflow:hidden;-webkit-line-clamp:4;line-clamp:4;display:-webkit-box;-webkit-box-orient:vertical}.overflown.description.svelte-117ceti.svelte-117ceti{cursor:help}.current.svelte-117ceti .rectangle.svelte-117ceti{box-shadow:0 0 10px var(--dag-selected)}.levelstoshow.svelte-117ceti.svelte-117ceti{position:absolute;bottom:100%;right:0;font-size:0.75rem;font-weight:100;text-align:right} \ No newline at end of file +.connectorwrapper.svelte-1hyaq5f{transform-origin:0 0;position:absolute;z-index:0;min-width:var(--strokeWidth)}.flip.svelte-1hyaq5f{transform:scaleX(-1)}.path.svelte-1hyaq5f{--strokeWidth:0.5rem;--strokeColor:var(--dag-connector);--borderRadius:1.25rem;box-sizing:border-box}.straightLine.svelte-1hyaq5f{position:absolute;top:0;bottom:0;left:0;right:0;border-left:var(--strokeWidth) solid var(--strokeColor)}.topLeft.svelte-1hyaq5f{position:absolute;top:0;left:0;right:50%;bottom:calc(var(--dag-gap) / 2 - var(--strokeWidth) / 2);border-radius:0 0 0 var(--borderRadius);border-left:var(--strokeWidth) solid var(--strokeColor);border-bottom:var(--strokeWidth) solid var(--strokeColor)}.bottomRight.svelte-1hyaq5f{position:absolute;top:calc(100% - (var(--dag-gap) / 2 + var(--strokeWidth) / 2));left:50%;right:0;bottom:0;border-radius:0 var(--borderRadius) 0 0;border-top:var(--strokeWidth) solid var(--strokeColor);border-right:var(--strokeWidth) solid var(--strokeColor)}.wrapper.svelte-117ceti.svelte-117ceti{position:relative;z-index:1}.step.svelte-117ceti.svelte-117ceti{font-size:0.75rem;padding:0.5rem;color:var(--dk-grey)}.rectangle.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-static);border:1px solid var(--dag-border);box-sizing:border-box;position:relative;height:var(--dag-step-height);width:var(--dag-step-width)}.rectangle.error.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-error)}.rectangle.success.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-success)}.rectangle.running.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-running)}.level.svelte-117ceti.svelte-117ceti{z-index:-1;filter:contrast(0.5);position:absolute}.inner.svelte-117ceti.svelte-117ceti{position:relative;height:100%;width:100%}.name.svelte-117ceti.svelte-117ceti{font-weight:bold;overflow:hidden;text-overflow:ellipsis;display:block}.description.svelte-117ceti.svelte-117ceti{position:absolute;max-height:4rem;bottom:0;left:0;right:0;overflow:hidden;-webkit-line-clamp:4;line-clamp:4;display:-webkit-box;-webkit-box-orient:vertical}.overflown.description.svelte-117ceti.svelte-117ceti{cursor:help}.current.svelte-117ceti .rectangle.svelte-117ceti{box-shadow:0 0 10px var(--dag-selected)}.levelstoshow.svelte-117ceti.svelte-117ceti{position:absolute;bottom:100%;right:0;font-size:0.75rem;font-weight:100;text-align:right} \ No newline at end of file diff --git a/metaflow/plugins/cards/card_modules/main.js b/metaflow/plugins/cards/card_modules/main.js index 65659ac0405..d6f17667ec1 100644 --- a/metaflow/plugins/cards/card_modules/main.js +++ b/metaflow/plugins/cards/card_modules/main.js @@ -1,30 +1,11 @@ -var app=function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function i(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let a;function l(t,e){return a||(a=document.createElement("a")),a.href=e,t===a.href}function c(e,n,i){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function u(t,e,n,i){if(t){const r=f(t,e,n,i);return t[0](r)}}function f(t,n,i,r){return t[1]&&r?e(i.ctx.slice(),t[1](r(n))):i.ctx}function h(t,e,n,i){if(t[2]&&i){const r=t[2](i(n));if(void 0===e.dirty)return r;if("object"==typeof r){const t=[],n=Math.max(e.dirty.length,r.length);for(let i=0;i32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,i)}function M(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function D(t,e){for(const n in e)M(t,n,e[n])}function A(t,e){e=""+e,t.data!==e&&(t.data=e)}function F(t,e,n,i){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function O(t,e,n){t.classList[n?"add":"remove"](e)}class T{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=k(e.nodeName):this.e=w(11===e.nodeType?"TEMPLATE":e.nodeName),this.t="TEMPLATE"!==e.tagName?e:e.content,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from("TEMPLATE"===this.e.nodeName?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e{const r=t.$$.callbacks[e];if(r){const o=function(t,e,{bubbles:n=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,i,e),r}(e,n,{cancelable:i});return r.slice().forEach((e=>{e.call(t,o)})),!o.defaultPrevented}return!0}}function j(t,e){return R().$$.context.set(t,e),e}function U(t){return R().$$.context.get(t)}function q(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t.call(this,e)))}const W=[],H=[];let V=[];const Y=[],G=Promise.resolve();let X=!1;function Z(t){V.push(t)}function J(t){Y.push(t)}const Q=new Set;let K=0;function tt(){if(0!==K)return;const t=z;do{try{for(;K{nt.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}else i&&i()}function lt(t,e){const n={},i={},r={$$scope:1};let o=t.length;for(;o--;){const s=t[o],a=e[o];if(a){for(const t in s)t in a||(i[t]=1);for(const t in a)r[t]||(n[t]=a[t],r[t]=1);t[o]=a}else for(const t in s)r[t]=1}for(const t in i)t in n||(n[t]=void 0);return n}function ct(t){return"object"==typeof t&&null!==t?t:{}}function ut(t,e,n){const i=t.$$.props[e];void 0!==i&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function ft(t){t&&t.c()}function ht(t,e,i,s){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,i),s||Z((()=>{const e=t.$$.on_mount.map(n).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),l.forEach(Z)}function dt(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];V.forEach((i=>-1===t.indexOf(i)?e.push(i):n.push(i))),n.forEach((t=>t())),V=e}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function pt(t,e){-1===t.$$.dirty[0]&&(W.push(t),X||(X=!0,G.then(tt)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const r=i.length?i[0]:n;return h.ctx&&a(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),d&&pt(e,t)),n})):[],h.update(),d=!0,r(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(x)}else h.fragment&&h.fragment.c();n.intro&&st(e.$$.fragment),ht(e,n.target,n.anchor,n.customElement),tt()}L(f)}class mt{$destroy(){dt(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var yt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(t){var e=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(e){return e instanceof o?new o(e.type,t(e.content),e.alias):Array.isArray(e)?e.map(t):e.replace(/&/g,"&").replace(/=f.reach);k+=w.value.length,w=w.next){var $=w.value;if(n.length>e.length)return;if(!($ instanceof o)){var C,E=1;if(v){if(!(C=s(_,k,e,y))||C.index>=e.length)break;var S=C.index,M=C.index+C[0].length,D=k;for(D+=w.value.length;D<=S;)D+=(w=w.next).value.length;if(k=D-=w.value.length,w.value instanceof o)continue;for(var A=w;A!==n.tail&&(Df.reach&&(f.reach=N);var z=w.prev;if(O&&(z=l(n,z,O),k+=O.length),c(n,z,E),w=l(n,z,new o(h,m?r.tokenize(F,m):F,b,F)),T&&l(n,w,T),1f.reach&&(f.reach=L.reach)}}}}}}(t,u,e,u.head,0),function(t){for(var e=[],n=t.head.next;n!==t.tail;)e.push(n.value),n=n.next;return e}(u)},hooks:{all:{},add:function(t,e){var n=r.hooks.all;n[t]=n[t]||[],n[t].push(e)},run:function(t,e){var n=r.hooks.all[t];if(n&&n.length)for(var i,o=0;i=n[o++];)i(e)}},Token:o};function o(t,e,n,i){this.type=t,this.content=e,this.alias=n,this.length=0|(i||"").length}function s(t,e,n,i){t.lastIndex=e;var r=t.exec(n);if(r&&i&&r[1]){var o=r[1].length;r.index+=o,r[0]=r[0].slice(o)}return r}function a(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function l(t,e,n){var i=e.next,r={value:n,prev:e,next:i};return e.next=r,i.prev=r,t.length++,r}function c(t,e,n){for(var i=e.next,r=0;r"+o.content+""},!t.document)return t.addEventListener&&(r.disableWorkerMessageHandler||t.addEventListener("message",(function(e){var n=JSON.parse(e.data),i=n.language,o=n.code,s=n.immediateClose;t.postMessage(r.highlight(o,r.languages[i],i)),s&&t.close()}),!1)),r;var u=r.util.currentScript();function f(){r.manual||r.highlightAll()}if(u&&(r.filename=u.src,u.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var h=document.readyState;"loading"===h||"interactive"===h&&u&&u.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=e),void 0!==yt&&(yt.Prism=e),e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},e.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:e.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}({exports:{}});const vt=[];function bt(e,n=t){let i;const r=new Set;function o(t){if(s(e,t)&&(e=t,i)){const t=!vt.length;for(const t of r)t[1](),vt.push(t,e);if(t){for(let t=0;t{r.delete(l),0===r.size&&i&&(i(),i=null)}}}}const xt=bt(void 0);window.metaflow_card_update=t=>(xt.update((e=>{const n=Object.assign({},e);return Object.values(t).forEach((t=>(null==n?void 0:n.components)&&_t(n.components,t))),n})),!0);const _t=(t,e)=>{const n=t.findIndex((t=>e.id===(null==t?void 0:t.id)));var i,r;n>-1?"vegaChart"==t[n].type?(i=t[n],r=e,i.data&&(i.data=JSON.parse(JSON.stringify(r.data))),JSON.stringify(r.spec)===JSON.stringify(i.spec)&&(i.spec=JSON.parse(JSON.stringify(r.spec)))):Object.assign(t[n],e):t.forEach((t=>{var n;"section"!==t.type&&"page"!==t.type||!(null===(n=null==t?void 0:t.contents)||void 0===n?void 0:n.length)||_t(t.contents,e)}))},wt=bt(void 0),kt=t=>{const e={};if(!t)return e;function n(t,i=[]){var r;if("page"===t.type){const i=[];e[t.title]=i,null===(r=null==t?void 0:t.contents)||void 0===r||r.forEach((t=>n(t,i)))}"section"===t.type&&t.title&&i.push(t.title)}return null==t||t.forEach((t=>n(t))),e},$t=(t,e)=>t/(e?parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px","")):16);function Ct(t){let e,n,i,r,o,s,a,l;return{c(){e=k("svg"),n=k("title"),i=$("metaflow_logo_horizontal"),r=k("g"),o=k("g"),s=k("g"),a=k("path"),l=k("path"),M(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),M(a,"id","Fill-1"),M(a,"fill","#146EE6"),M(l,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),M(l,"id","Fill-2"),M(l,"fill","#333333"),M(s,"id","metaflow_logo_horizontal"),M(s,"transform","translate(92.930727, 93.190000)"),M(o,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),M(o,"transform","translate(-92.000000, -93.000000)"),M(r,"id","Page-1"),M(r,"stroke","none"),M(r,"stroke-width","1"),M(r,"fill","none"),M(r,"fill-rule","evenodd"),M(e,"xmlns","http://www.w3.org/2000/svg"),M(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),M(e,"width","896px"),M(e,"height","152px"),M(e,"viewBox","0 0 896 152"),M(e,"version","1.1")},m(t,c){b(t,e,c),v(e,n),v(n,i),v(e,r),v(r,o),v(o,s),v(s,a),v(s,l)},d(t){t&&x(e)}}}function Et(t){let e,n,i;return{c(){e=k("svg"),n=k("path"),i=k("path"),M(n,"fill-rule","evenodd"),M(n,"clip-rule","evenodd"),M(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),M(n,"fill","#146EE6"),M(i,"fill-rule","evenodd"),M(i,"clip-rule","evenodd"),M(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),M(i,"fill","white"),M(e,"width","895"),M(e,"height","151"),M(e,"viewBox","0 0 895 151"),M(e,"fill","none"),M(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){b(t,e,r),v(e,n),v(e,i)},d(t){t&&x(e)}}}function St(e){let n;function i(t,e){return t[0]?Et:Ct}let r=i(e),o=r(e);return{c(){o.c(),n=E()},m(t,e){o.m(t,e),b(t,n,e)},p(t,[e]){r!==(r=i(t))&&(o.d(1),o=r(t),o&&(o.c(),o.m(n.parentNode,n)))},i:t,o:t,d(t){o.d(t),t&&x(n)}}}function Mt(t,e,n){let{light:i=!1}=e;return t.$$set=t=>{"light"in t&&n(0,i=t.light)},[i]}class Dt extends mt{constructor(t){super(),gt(this,t,Mt,St,s,{light:0})}}function At(t){let e,n,i,r,o,s;r=new Dt({});const a=t[1].default,l=u(a,t,t[0],null);return{c(){e=w("aside"),n=w("div"),i=w("div"),ft(r.$$.fragment),o=C(),l&&l.c(),M(i,"class","logoContainer"),M(e,"class","svelte-1okdv0e")},m(t,a){b(t,e,a),v(e,n),v(n,i),ht(r,i,null),v(n,o),l&&l.m(n,null),s=!0},p(t,[e]){l&&l.p&&(!s||1&e)&&d(l,a,t,t[0],s?h(a,t[0],e,null):p(t[0]),null)},i(t){s||(st(r.$$.fragment,t),st(l,t),s=!0)},o(t){at(r.$$.fragment,t),at(l,t),s=!1},d(t){t&&x(e),dt(r),l&&l.d(t)}}}function Ft(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}class Ot extends mt{constructor(t){super(),gt(this,t,Ft,At,s,{})}}function Tt(t){let e,n;return{c(){e=w("td"),n=$(t[0]),M(e,"class","idCell svelte-pt8vzv"),M(e,"data-component","artifact-row")},m(t,i){b(t,e,i),v(e,n)},p(t,e){1&e&&A(n,t[0])},d(t){t&&x(e)}}}function Nt(e){let n,i,r,o,s,a,l=e[1].data+"",c=null!==e[0]&&Tt(e);return{c(){n=w("tr"),c&&c.c(),i=C(),r=w("td"),o=w("code"),s=$(l),M(o,"class","mono"),M(r,"class","codeCell svelte-pt8vzv"),M(r,"colspan",a=null===e[0]?2:1),M(r,"data-component","artifact-row")},m(t,a){b(t,n,a),c&&c.m(n,null),v(n,i),v(n,r),v(r,o),v(o,s),e[3](o)},p(t,[e]){null!==t[0]?c?c.p(t,e):(c=Tt(t),c.c(),c.m(n,i)):c&&(c.d(1),c=null),2&e&&l!==(l=t[1].data+"")&&A(s,l),1&e&&a!==(a=null===t[0]?2:1)&&M(r,"colspan",a)},i:t,o:t,d(t){t&&x(n),c&&c.d(),e[3](null)}}}function zt(t,e,n){let i,{id:r}=e,{artifact:o}=e;return t.$$set=t=>{"id"in t&&n(0,r=t.id),"artifact"in t&&n(1,o=t.artifact)},t.$$.update=()=>{4&t.$$.dirty&&i&&function(){var t;i&&!i.classList.contains("language-python")&&"undefined"!=typeof window&&(null===(t=null===window||void 0===window?void 0:window.Prism)||void 0===t||t.highlightElement(i))}()},[r,o,i,function(t){H[t?"unshift":"push"]((()=>{i=t,n(2,i)}))}]}class Lt extends mt{constructor(t){super(),gt(this,t,zt,Nt,s,{id:0,artifact:1})}}function Rt(t,e,n){const i=t.slice();return i[2]=e[n],i}function Pt(e){let n,i;return n=new Lt({props:{id:e[2].name,artifact:e[2]}}),{c(){ft(n.$$.fragment)},m(t,e){ht(n,t,e),i=!0},p:t,i(t){i||(st(n.$$.fragment,t),i=!0)},o(t){at(n.$$.fragment,t),i=!1},d(t){dt(n,t)}}}function It(t){let e,n,i,r=t[0],o=[];for(let e=0;eat(o[t],1,1,(()=>{o[t]=null}));return{c(){e=w("div"),n=w("table");for(let t=0;t{if(t.name&&e.name){if(t.name>e.name)return 1;if(t.name{"componentData"in t&&n(1,i=t.componentData)},[r,i]}class jt extends mt{constructor(t){super(),gt(this,t,Bt,It,s,{componentData:1})}} -/*! - * Chart.js v3.9.1 - * https://www.chartjs.org - * (c) 2022 Chart.js Contributors - * Released under the MIT License - */const Ut=function(){let t=0;return function(){return t++}}();function qt(t){return null==t}function Wt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Ht(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const Vt=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function Yt(t,e){return Vt(t)?t:e}function Gt(t,e){return void 0===t?e:t}const Xt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Zt(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function Jt(t,e,n,i){let r,o,s;if(Wt(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;rt,x:t=>t.x,y:t=>t.y};function se(t,e){const n=oe[e]||(oe[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const t of e)i+=t,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function ae(t){return t.charAt(0).toUpperCase()+t.slice(1)}const le=t=>void 0!==t,ce=t=>"function"==typeof t,ue=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};const fe=Math.PI,he=2*fe,de=he+fe,pe=Number.POSITIVE_INFINITY,ge=fe/180,me=fe/2,ye=fe/4,ve=2*fe/3,be=Math.log10,xe=Math.sign;function _e(t){const e=Math.round(t);t=ke(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(be(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function we(t){return!isNaN(parseFloat(t))&&isFinite(t)}function ke(t,e,n){return Math.abs(t-e)l&&c=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function ze(t,e,n){n=n||(n=>t[n]1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Le=(t,e,n,i)=>ze(t,n,i?i=>t[i][e]<=n:i=>t[i][e]ze(t,n,(i=>t[i][e]>=n));const Pe=["push","pop","shift","splice","unshift"];function Ie(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(Pe.forEach((e=>{delete t[e]})),delete t._chartjs)}function Be(t){const e=new Set;let n,i;for(n=0,i=t.length;nArray.prototype.slice.call(t));let r=!1,o=[];return function(...n){o=i(n),r||(r=!0,je.call(window,(()=>{r=!1,t.apply(e,o)})))}}const qe=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function We(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:s,_parsed:a}=t,l=s.axis,{min:c,max:u,minDefined:f,maxDefined:h}=s.getUserBounds();f&&(r=Te(Math.min(Le(a,s.axis,c).lo,n?i:Le(e,l,s.getPixelForValue(c)).lo),0,i-1)),o=h?Te(Math.max(Le(a,s.axis,u,!0).hi+1,n?0:Le(e,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:i-r}return{start:r,count:o}}function He(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}const Ve=t=>0===t||1===t,Ye=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*he/n),Ge=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*he/n)+1,Xe={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*me),easeOutSine:t=>Math.sin(t*me),easeInOutSine:t=>-.5*(Math.cos(fe*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ve(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ve(t)?t:Ye(t,.075,.3),easeOutElastic:t=>Ve(t)?t:Ge(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ve(t)?t:t<.5?.5*Ye(2*t,e,.45):.5+.5*Ge(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Xe.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*Xe.easeInBounce(2*t):.5*Xe.easeOutBounce(2*t-1)+.5}; -/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */ -function Ze(t){return t+.5|0}const Je=(t,e,n)=>Math.max(Math.min(t,n),e);function Qe(t){return Je(Ze(2.55*t),0,255)}function Ke(t){return Je(Ze(255*t),0,255)}function tn(t){return Je(Ze(t/2.55)/100,0,1)}function en(t){return Je(Ze(100*t),0,100)}const nn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},rn=[..."0123456789ABCDEF"],on=t=>rn[15&t],sn=t=>rn[(240&t)>>4]+rn[15&t],an=t=>(240&t)>>4==(15&t);function ln(t){var e=(t=>an(t.r)&&an(t.g)&&an(t.b)&&an(t.a))(t)?on:sn;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const cn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function un(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function fn(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function hn(t,e,n){const i=un(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function dn(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),s=(r+o)/2;let a,l,c;return r!==o&&(c=r-o,l=s>.5?c/(2-r-o):c/(r+o),a=function(t,e,n,i,r){return t===r?(e-n)/i+(e>16&255,o>>8&255,255&o]}return t}(),xn.transparent=[0,0,0,0]);const e=xn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const wn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const kn=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,$n=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Cn(t,e,n){if(t){let i=dn(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=gn(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function En(t,e){return t?Object.assign(e||{},t):t}function Sn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ke(t[3]))):(e=En(t,{r:0,g:0,b:0,a:1})).a=Ke(e.a),e}function Mn(t){return"r"===t.charAt(0)?function(t){const e=wn.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=e[8]?Qe(t):Je(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?Qe(n):Je(n,0,255)),i=255&(e[4]?Qe(i):Je(i,0,255)),r=255&(e[6]?Qe(r):Je(r,0,255)),{r:n,g:i,b:r,a:o}}}(t):yn(t)}class Dn{constructor(t){if(t instanceof Dn)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=Sn(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*nn[i[1]],g:255&17*nn[i[2]],b:255&17*nn[i[3]],a:5===o?17*nn[i[4]]:255}:7!==o&&9!==o||(r={r:nn[i[1]]<<4|nn[i[2]],g:nn[i[3]]<<4|nn[i[4]],b:nn[i[5]]<<4|nn[i[6]],a:9===o?nn[i[7]]<<4|nn[i[8]]:255})),n=r||_n(t)||Mn(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=En(this._rgb);return t&&(t.a=tn(t.a)),t}set rgb(t){this._rgb=Sn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${tn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?ln(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=dn(t),n=e[0],i=en(e[1]),r=en(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${tn(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const o=e===r?.5:e,s=2*o-1,a=n.a-i.a,l=((s*a==-1?s:(s+a)/(1+s*a))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=$n(tn(t.r)),r=$n(tn(t.g)),o=$n(tn(t.b));return{r:Ke(kn(i+n*($n(tn(e.r))-i))),g:Ke(kn(r+n*($n(tn(e.g))-r))),b:Ke(kn(o+n*($n(tn(e.b))-o))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Dn(this.rgb)}alpha(t){return this._rgb.a=Ke(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=Ze(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Cn(this._rgb,2,t),this}darken(t){return Cn(this._rgb,2,-t),this}saturate(t){return Cn(this._rgb,1,t),this}desaturate(t){return Cn(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=dn(t);n[0]=mn(n[0]+e),n=gn(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function An(t){return new Dn(t)}function Fn(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function On(t){return Fn(t)?t:An(t)}function Tn(t){return Fn(t)?t:An(t).saturate(.5).darken(.1).hexString()}const Nn=Object.create(null),zn=Object.create(null);function Ln(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Tn(e.backgroundColor),this.hoverBorderColor=(t,e)=>Tn(e.borderColor),this.hoverColor=(t,e)=>Tn(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Rn(this,t,e)}get(t){return Ln(this,t)}describe(t,e){return Rn(zn,t,e)}override(t,e){return Rn(Nn,t,e)}route(t,e,n,i){const r=Ln(this,t),o=Ln(this,n),s="_"+e;Object.defineProperties(r,{[s]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[s],e=o[i];return Ht(t)?Object.assign({},e,t):Gt(t,e)},set(t){this[s]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function In(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function Bn(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let s=0;const a=n.length;let l,c,u,f,h;for(l=0;ln.length){for(l=0;l0&&t.stroke()}(t,e,n,i,null)}function Wn(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);qt(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l+t||0;function ni(t,e){const n={},i=Ht(e),r=i?Object.keys(e):e,o=Ht(t)?i?n=>Gt(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=ei(o(t));return n}function ii(t){return ni(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ri(t){return ni(t,["topLeft","topRight","bottomLeft","bottomRight"])}function oi(t){const e=ii(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function si(t,e){t=t||{},e=e||Pn.font;let n=Gt(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=Gt(t.style,e.style);i&&!(""+i).match(Kn)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const r={family:Gt(t.family,e.family),lineHeight:ti(Gt(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:Gt(t.weight,e.weight),string:""};return r.string=function(t){return!t||qt(t.size)||qt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ai(t,e,n,i){let r,o,s,a=!0;for(r=0,o=t.length;rt[0])){le(i)||(i=xi("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>ci([r,...t],e,n,i)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>pi(n,i,(()=>function(t,e,n,i){let r;for(const o of e)if(r=xi(hi(o,t),n),le(r))return di(t,r)?vi(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>_i(t).includes(e),ownKeys:t=>_i(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function ui(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:fi(t,i),setContext:e=>ui(t,e,n,i),override:r=>ui(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>pi(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:s}=t;let a=i[e];ce(a)&&s.isScriptable(e)&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:s,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t),e=e(o,s||i),a.delete(t),di(t,e)&&(e=vi(r._scopes,r,t,e));return e}(e,a,t,n));Wt(a)&&a.length&&(a=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:s,_descriptors:a}=n;if(le(o.index)&&i(t))e=e[o.index%e.length];else if(Ht(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=vi(i,r,t,l);e.push(ui(n,o,s&&s[t],a))}}return e}(e,a,t,s.isIndexable));di(e,a)&&(a=ui(a,r,o&&o[e],s));return a}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function fi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:ce(n)?n:()=>n,isIndexable:ce(i)?i:()=>i}}const hi=(t,e)=>t?t+ae(e):e,di=(t,e)=>Ht(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function pi(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function gi(t,e,n){return ce(t)?t(e,n):t}const mi=(t,e)=>!0===t?e:"string"==typeof t?se(e,t):void 0;function yi(t,e,n,i,r){for(const o of e){const e=mi(n,o);if(e){t.add(e);const o=gi(e._fallback,n,r);if(le(o)&&o!==n&&o!==i)return o}else if(!1===e&&le(i)&&n!==i)return null}return!1}function vi(t,e,n,i){const r=e._rootScopes,o=gi(e._fallback,n,i),s=[...t,...r],a=new Set;a.add(i);let l=bi(a,s,n,o||n,i);return null!==l&&((!le(o)||o===n||(l=bi(a,s,o,l,i),null!==l))&&ci(Array.from(a),[""],r,o,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];if(Wt(r)&&Ht(n))return n;return r}(e,n,i))))}function bi(t,e,n,i,r){for(;n;)n=yi(t,e,n,i,r);return n}function xi(t,e){for(const n of e){if(!n)continue;const e=n[t];if(le(e))return e}}function _i(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function wi(t,e,n,i){const{iScale:r}=t,{key:o="r"}=this._parsing,s=new Array(i);let a,l,c,u;for(a=0,l=i;ae"x"===t?"y":"x";function Ei(t,e,n,i){const r=t.skip?e:t,o=e,s=n.skip?e:n,a=De(o,r),l=De(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=i*c,h=i*u;return{previous:{x:o.x-f*(s.x-r.x),y:o.y-f*(s.y-r.y)},next:{x:o.x+h*(s.x-r.x),y:o.y+h*(s.y-r.y)}}}function Si(t,e="x"){const n=Ci(e),i=t.length,r=Array(i).fill(0),o=Array(i);let s,a,l,c=$i(t,0);for(s=0;s!t.skip))),"monotone"===e.cubicInterpolationMode)Si(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,s=t.length;owindow.getComputedStyle(t,null);const Ni=["top","right","bottom","left"];function zi(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=Ni[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Li=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Ri(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=Ti(n),o="border-box"===r.boxSizing,s=zi(r,"padding"),a=zi(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:o}=i;let s,a,l=!1;if(Li(r,o,t.target))s=r,a=o;else{const t=e.getBoundingClientRect();s=i.clientX-t.left,a=i.clientY-t.top,l=!0}return{x:s,y:a,box:l}}(t,n),f=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:d,height:p}=e;return o&&(d-=s.width+a.width,p-=s.height+a.height),{x:Math.round((l-f)/d*n.width/i),y:Math.round((c-h)/p*n.height/i)}}const Pi=t=>Math.round(10*t)/10;function Ii(t,e,n,i){const r=Ti(t),o=zi(r,"margin"),s=Oi(r.maxWidth,t,"clientWidth")||pe,a=Oi(r.maxHeight,t,"clientHeight")||pe,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=Fi(t);if(o){const t=o.getBoundingClientRect(),s=Ti(o),a=zi(s,"border","width"),l=zi(s,"padding");e=t.width-l.width-a.width,n=t.height-l.height-a.height,i=Oi(s.maxWidth,o,"clientWidth"),r=Oi(s.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||pe,maxHeight:r||pe}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=zi(r,"border","width"),e=zi(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?Math.floor(c/i):u-o.height),c=Pi(Math.min(c,s,l.maxWidth)),u=Pi(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Pi(c/2)),{width:c,height:u}}function Bi(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=r/i,t.width=o/i;const s=t.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||s.height!==r||s.width!==o)&&(t.currentDevicePixelRatio=i,s.height=r,s.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const ji=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ui(t,e){const n=function(t,e){return Ti(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function qi(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Wi(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function Hi(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},s=qi(t,r,n),a=qi(r,o,n),l=qi(o,e,n),c=qi(s,a,n),u=qi(a,l,n);return qi(c,u,n)}const Vi=new Map;function Yi(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=Vi.get(n);return i||(i=new Intl.NumberFormat(t,e),Vi.set(n,i)),i}(e,n).format(t)}function Gi(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Xi(t){return"angle"===t?{between:Oe,compare:Ae,normalize:Fe}:{between:Ne,compare:(t,e)=>t-e,normalize:t=>t}}function Zi({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function Ji(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,s=e.length,{compare:a,between:l,normalize:c}=Xi(i),{start:u,end:f,loop:h,style:d}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:s,normalize:a}=Xi(i),l=e.length;let c,u,{start:f,end:h,loop:d}=t;if(d){for(f+=l,h+=l,c=0,u=l;cv||l(r,y,g)&&0!==a(r,y),_=()=>!v||0===a(o,g)||l(o,y,g);for(let t=u,n=u;t<=f;++t)m=e[t%s],m.skip||(g=c(m[i]),g!==y&&(v=l(g,r,o),null===b&&x()&&(b=0===a(g,r)?t:n),null!==b&&_()&&(p.push(Zi({start:b,end:t,loop:h,count:s,style:d})),b=null),n=t,y=g));return null!==b&&p.push(Zi({start:b,end:f,loop:h,count:s,style:d})),p}function Qi(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),o=Ki(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,l=n.length,c=[];let u=o,f=e[0].start,h=f;function d(t,e,i,r){const o=a?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=o;for(;n[e%l].skip;)e+=o;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:i,style:r}),u=r,f=e%l)}}for(const t of e){f=a?f:t.start;let e,o=n[f%l];for(h=f+1;h<=t.end;h++){const a=n[h%l];e=Ki(i.setContext(li(r,{type:"segment",p0:o,p1:a,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),tr(e,u)&&d(f,h-1,t.loop,u),o=a,u=e}fi({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=je.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o,s=r.length-1,a=!1;for(;s>=0;--s)o=r[s],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),a=!0):(r[s]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const nr="transparent",ir={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=On(t||nr),r=i.valid&&On(e||nr);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class rr{constructor(t,e,n,i){const r=e[n];i=ai([t.to,i,r,t.from]);const o=ai([t.from,r,i]);this._active=!0,this._fn=t.fn||ir[t.type||typeof o],this._easing=Xe[t.easing]||Xe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ai([t.to,e,i,t.from]),this._from=ai([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,s=this._to;let a;if(this._active=r!==s&&(o||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(r,s,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Pn.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Pn.describe("animations",{_fallback:"animation"}),Pn.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class sr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Ht(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const i=t[n];if(!Ht(i))return;const r={};for(const t of or)r[t]=i[t];(Wt(i.properties)&&i.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();let a;for(a=o.length-1;a>=0;--a){const l=o[a];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const f=n.get(l);if(u){if(f&&u.active()){u.update(f,c,s);continue}u.cancel()}f&&f.duration?(r[l]=u=new rr(f,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(er.add(this._chart,n),!0):void 0}}function ar(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function lr(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r0||!n&&e<0)return r.index}return null}function dr(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=i,l=o.axis,c=s.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,s,i),f=e.length;let h;for(let t=0;tn[t].axis===e)).shift()}function gr(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const mr=t=>"reset"===t||"none"===t,yr=(t,e)=>e?t:Object.assign({},t);class vr{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ur(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&gr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=Gt(n.xAxisID,pr(t,"x")),o=e.yAxisID=Gt(n.yAxisID,pr(t,"y")),s=e.rAxisID=Gt(n.rAxisID,pr(t,"r")),a=e.indexAxis,l=e.iAxisID=i(a,r,o,s),c=e.vAxisID=i(a,o,r,s);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ie(this._data,this),t._stacked&&gr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(Ht(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,o;for(i=0,r=e.length;i{const n="_onData"+ae(e),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const r=i.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[n]&&t[n](...e)})),r}})})))}(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=ur(e.vScale,e),e.stack!==n.stack&&(i=!0,gr(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&dr(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,s=r.axis;let a,l,c,u=0===t&&e===i.length||n._sorted,f=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=Wt(i[t])?this.parseArrayData(n,i,t,e):Ht(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===l[s]||f&&l[s]t&&!e.hidden&&e._stacked&&{keys:lr(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(s);let f,h;function d(){h=i[f];const e=h[s.axis];return!Vt(h[t.axis])||c>e||u=0;--f)if(!d()){this.updateRangeFromParsed(l,t,h,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i=0&&tthis.getContext(n,i)),u);return d.$shared&&(d.$shared=a,r[o]=Object.freeze(yr(d,a))),d}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,s=r[o];if(s)return s;let a;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),o=i.getOptionScopes(this.getDataset(),r);a=i.createResolver(o,this.getContext(t,n,e))}const l=new sr(i,a&&a.animations);return a&&a._cacheable&&(r[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||mr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,i){mr(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!mr(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,r=e.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r{for(t.length+=e,s=t.length-1;s>=o;s--)t[s]=t[s-e]};for(a(r),s=t;st-e)))}return t._cache.$bar}(e,t.type);let i,r,o,s,a=e._length;const l=()=>{32767!==o&&-32768!==o&&(le(s)&&(a=Math.min(a,Math.abs(o-s)||a)),s=o)};for(i=0,r=n.length;iMath.abs(a)&&(l=a,c=s),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:o,min:s,max:a}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function _r(t,e,n,i){const r=t.iScale,o=t.vScale,s=r.getLabels(),a=r===o,l=[];let c,u,f,h;for(c=n,u=n+i;ct.x,n="left",i="right"):(e=t.baset.controller.options.grouped)),r=n.options.stacked,o=[],s=t=>{const n=t.controller.getParsed(e),i=n&&n[t.vScale.axis];if(qt(i)||isNaN(i))return!0};for(const n of i)if((void 0===e||!s(n))&&((!1===r||-1===o.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&o.push(n.stack),n.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,o;for(r=0,o=e.data.length;r=n?1:-1)}(u,e,o)*r,f===o&&(g-=u/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),i=Math.min(t,n),s=Math.max(t,n);g=Math.max(Math.min(g,s),i),c=g+u}if(g===e.getPixelForValue(o)){const t=xe(u)*e.getLineWidthForValue(o)/2;g+=t,u-=t}return{size:u,base:g,head:c,center:c+u/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,r=i.skipNull,o=Gt(i.maxBarThickness,1/0);let s,a;if(e.grouped){const n=r?this._getStackCount(t):e.stackCount,l="flex"===i.barThickness?function(t,e,n,i){const r=e.pixels,o=r[t];let s=t>0?r[t-1]:null,a=t=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),s=i.getLabelForValue(r.y),a=r._custom;return{label:e.label,value:"("+o+", "+s+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:s}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,i),c=o.axis,u=s.axis;for(let f=e;f""}}}};class Dr extends vr{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,o,s=t=>+n[t];if(Ht(n[t])){const{key:t="value"}=this._parsing;s=e=>+se(n[e],t)}for(r=t,o=t+e;r"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e)(this.options.cutout,s),1),l=this._getRingWeight(this.index),{circumference:c,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:d,offsetY:p}=function(t,e,n){let i=1,r=1,o=0,s=0;if(eOe(t,a,l,!0)?1:Math.max(e,e*n,i,i*n),p=(t,e,i)=>Oe(t,a,l,!0)?-1:Math.min(e,e*n,i,i*n),g=d(0,c,f),m=d(me,u,h),y=p(fe,c,f),v=p(fe+me,u,h);i=(g-y)/2,r=(m-v)/2,o=-(g+y)/2,s=-(m+v)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:s}}(u,c,a),g=(n.width-o)/f,m=(n.height-o)/h,y=Math.max(Math.min(g,m)/2,0),v=Xt(this.options.radius,y),b=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=d*v,this.offsetY=p*v,i.total=this.calculateTotal(),this.outerRadius=v-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*l,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/he)}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,s=o.chartArea,a=o.options.animation,l=(s.left+s.right)/2,c=(s.top+s.bottom)/2,u=r&&a.animateScale,f=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(e,i);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?he*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Yi(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,o,s,a;if(!t)for(i=0,r=n.data.datasets.length;i"spacing"!==t,_indexable:t=>"spacing"!==t},Dr.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return Wt(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class Ar extends vr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:s,count:a}=We(e,i,o);this._drawStart=s,this._drawCount=a,He(e)&&(s=0,a=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},t),this.updateElements(i,s,a,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:s,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,i),f=o.axis,h=s.axis,{spanGaps:d,segment:p}=this.options,g=we(d)?d:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===i;let y=e>0&&this.getParsed(e-1);for(let d=e;d0&&Math.abs(n[f]-y[f])>g,p&&(v.parsed=n,v.raw=l.data[d]),u&&(v.options=c||this.resolveDataElementOptions(d,e.active?"active":i)),m||this.updateElement(e,d,v,i),y=n}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ar.id="line",Ar.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ar.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Fr extends vr{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=Yi(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,e,n,i){return wi.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(ie.max&&(e.max=i))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),o=(r-Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,s=o.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,u=a.getIndexAngle(0)-.5*fe;let f,h=u;const d=360/this.countVisibleElements();for(f=0;f{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++})),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Ce(this.resolveDataElementOptions(t,e).angle||n):0}}Fr.id="polarArea",Fr.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Fr.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Or extends Dr{}Or.id="pie",Or.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Tr extends vr{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,i){return wi.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===i.length,options:e};this.updateElement(n,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this._cachedMeta.rScale,o="reset"===i;for(let s=e;s{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),i}}Nr.defaults={},Nr.defaultRoutes=void 0;const zr={values:t=>Wt(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const s=be(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Yi(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(be(t)));return 1===i||2===i||5===i?zr.numeric.call(this,t,e,n):""}};var Lr={formatters:zr};function Rr(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;ni)return function(t,e,n,i){let r,o=0,s=n[0];for(i=Math.ceil(i),r=0;rt-e)).pop(),e}(i);for(let t=0,e=o.length-1;tr)return e}return Math.max(r,1)}(r,e,i);if(o>0){let t,n;const i=o>1?Math.round((a-s)/(o-1)):null;for(Pr(e,l,c,qt(i)?0:s-i,s),t=0,n=o-1;te.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Lr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Pn.route("scale.ticks","color","","color"),Pn.route("scale.grid","color","","borderColor"),Pn.route("scale.grid","borderColor","","borderColor"),Pn.route("scale.title","color","","color"),Pn.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Pn.describe("scales",{_fallback:"scale"}),Pn.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ir=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function Br(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;os+a)))return c}function Ur(t){return t.drawTicks?t.tickLength:0}function qr(t,e){if(!t.display)return 0;const n=si(t.font,e),i=oi(t.padding);return(Wt(t.text)?t.text.length:1)*n.lineHeight+i.height}function Wr(t,e,n){let i=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class Hr extends Nr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=Yt(t,Number.POSITIVE_INFINITY),e=Yt(e,Number.NEGATIVE_INFINITY),n=Yt(n,Number.POSITIVE_INFINITY),i=Yt(i,Number.NEGATIVE_INFINITY),{min:Yt(t,n),max:Yt(e,i),minDefined:Vt(t),maxDefined:Vt(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:o}=this.getUserBounds();if(r&&o)return{min:n,max:i};const s=this.getMatchingVisibleMetas();for(let a=0,l=s.length;ai?i:n,i=r&&n>i?n:i,{min:Yt(n,Yt(i,n)),max:Yt(i,Yt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Zt(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:r}=t,o=Xt(e,(r-i)/2),s=(t,e)=>n&&0===t?0:t+e;return{min:s(i,-Math.abs(o)),max:s(r,o)}}(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=s=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),u=c.widest.width,f=c.highest.height,h=Te(this.chart.width-u,0,this.maxWidth);o=t.offset?this.maxWidth/n:h/(n-1),u+6>o&&(o=h/(n-(t.offset?.5:1)),s=this.maxHeight-Ur(t.grid)-e.padding-qr(t.title,this.chart.options.font),a=Math.sqrt(u*u+f*f),l=Ee(Math.min(Math.asin(Te((c.highest.height+6)/o,-1,1)),Math.asin(Te(s/a,-1,1))-Math.asin(Te(f/a,-1,1)))),l=Math.max(i,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){Zt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Zt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const o=qr(i,e.options.font);if(s?(t.width=this.maxWidth,t.height=Ur(r)+o):(t.height=this.maxHeight,t.width=Ur(r)+o),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:o}=this._getLabelSizes(),a=2*n.padding,l=Ce(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(s){const e=n.mirror?0:u*r.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=n.mirror?0:c*r.width+u*o.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,i,u,c)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:o},position:s}=this.options,a=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){const s=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;a?l?(u=i*t.width,f=n*e.height):(u=n*t.height,f=i*e.width):"start"===r?f=e.width:"end"===r?u=t.width:"inner"!==r&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-s+o)*this.width/(this.width-s),0),this.paddingRight=Math.max((f-c+o)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+o,this.paddingBottom=i+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Zt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r({width:r[t]||0,height:o[t]||0});return{first:_(0),last:_(e-1),widest:_(b),highest:_(x),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return function(t){return Te(t,-32768,32767)}(this._alignToPixels?jn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ts*i?s/n:a/i:a*i0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:o}=i,s=r.offset,a=this.isHorizontal(),l=this.ticks.length+(s?1:0),c=Ur(r),u=[],f=r.setContext(this.getContext()),h=f.drawBorder?f.borderWidth:0,d=h/2,p=function(t){return jn(n,t,h)};let g,m,y,v,b,x,_,w,k,$,C,E;if("top"===o)g=p(this.bottom),x=this.bottom-c,w=g-d,$=p(t.top)+d,E=t.bottom;else if("bottom"===o)g=p(this.top),$=t.top,E=p(t.bottom)-d,x=g+d,w=this.top+c;else if("left"===o)g=p(this.right),b=this.right-c,_=g-d,k=p(t.left)+d,C=t.right;else if("right"===o)g=p(this.left),k=t.left,C=p(t.right)-d,b=g+d,_=this.left+c;else if("x"===e){if("center"===o)g=p((t.top+t.bottom)/2+.5);else if(Ht(o)){const t=Object.keys(o)[0],e=o[t];g=p(this.chart.scales[t].getPixelForValue(e))}$=t.top,E=t.bottom,x=g+d,w=x+c}else if("y"===e){if("center"===o)g=p((t.left+t.right)/2);else if(Ht(o)){const t=Object.keys(o)[0],e=o[t];g=p(this.chart.scales[t].getPixelForValue(e))}b=g-d,_=b-c,k=t.left,C=t.right}const S=Gt(i.ticks.maxTicksLimit,l),M=Math.max(1,Math.ceil(l/S));for(m=0;me.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const s=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=i.length;r{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=e.length;r{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),s=e[n].split("."),a=s.pop(),l=s.join(".");Pn.route(o,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&Pn.describe(e,t.descriptors)}(t,o,n),this.override&&Pn.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in Pn[i]&&(delete Pn[i][n],this.override&&delete Nn[n])}}var Yr=new class{constructor(){this.controllers=new Vr(vr,"datasets",!0),this.elements=new Vr(Nr,"elements"),this.plugins=new Vr(Object,"plugins"),this.scales=new Vr(Hr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach((e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):Jt(e,(e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)}))}))}_exec(t,e,n){const i=ae(t);Zt(n["before"+i],[],n),e[t](n),Zt(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(n[h]-v[h])>m,g&&(p.parsed=n,p.raw=l.data[c]),f&&(p.options=u||this.resolveDataElementOptions(c,e.active?"active":i)),y||this.updateElement(e,c,p,i),v=n}this.updateSharedOptions(u,i,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!e.length)return i;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,r,o)/2}}function Xr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Gr.id="scatter",Gr.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Gr.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Zr{constructor(t){this.options=t||{}}init(t){}formats(){return Xr()}parse(t,e){return Xr()}format(t,e){return Xr()}add(t,e,n){return Xr()}diff(t,e,n){return Xr()}startOf(t,e,n){return Xr()}endOf(t,e){return Xr()}}Zr.override=function(t){Object.assign(Zr.prototype,t)};var Jr={_date:Zr};function Qr(t,e,n,i){const{controller:r,data:o,_sorted:s}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&s&&o.length){const t=a._reversePixels?Re:Le;if(!i)return t(o,e,n);if(r._sharedOptions){const i=o[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(o,e,n-r),s=t(o,e,n+r);return{lo:i.lo,hi:s.hi}}}}return{lo:0,hi:o.length-1}}function Kr(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),s=n[e];for(let t=0,n=o.length;t{t[s](e[n],r)&&(o.push({element:t,datasetIndex:i,index:l}),a=a||t.inRange(e.x,e.y,r))})),i&&!a?[]:o}var ro={evaluateInteractionItems:Kr,modes:{index(t,e,n,i){const r=Ri(e,t),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?to(t,r,o,i,s):no(t,r,o,!1,i,s),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,n,i){const r=Ri(e,t),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?to(t,r,o,i,s):no(t,r,o,!1,i,s);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;tto(t,Ri(e,t),n.axis||"xy",i,n.includeInvisible||!1),nearest(t,e,n,i){const r=Ri(e,t),o=n.axis||"xy",s=n.includeInvisible||!1;return no(t,r,o,n.intersect,i,s)},x:(t,e,n,i)=>io(t,Ri(e,t),"x",n.intersect,i),y:(t,e,n,i)=>io(t,Ri(e,t),"y",n.intersect,i)}};const oo=["left","top","right","bottom"];function so(t,e){return t.filter((t=>t.pos===e))}function ao(t,e){return t.filter((t=>-1===oo.indexOf(t.pos)&&t.box.axis===e))}function lo(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function co(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!oo.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,s,a;for(o=0,s=t.length;o{i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function go(t,e,n,i){const r=[];let o,s,a,l,c,u;for(o=0,s=t.length,c=0;ot.box.fullSize)),!0),i=lo(so(e,"left"),!0),r=lo(so(e,"right")),o=lo(so(e,"top"),!0),s=lo(so(e,"bottom")),a=ao(e,"x"),l=ao(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(s).concat(a),chartArea:so(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(s).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;Jt(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},r);fo(h,oi(i));const d=Object.assign({maxPadding:h,w:o,h:s,x:r.left,y:r.top},r),p=co(l.concat(c),f);go(a.fullSize,d,f,p),go(l,d,f,p),go(c,d,f,p)&&go(l,d,f,p),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(d),yo(a.leftAndTop,d,f,p),d.x+=d.w,d.y+=d.h,yo(a.rightAndBottom,d,f,p),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},Jt(a.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class bo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class xo extends bo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const _o="$chartjs",wo={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ko=t=>null===t||""===t;const $o=!!ji&&{passive:!0};function Co(t,e,n){t.canvas.removeEventListener(e,n,$o)}function Eo(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function So(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Eo(n.addedNodes,i),e=e&&!Eo(n.removedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Mo(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Eo(n.removedNodes,i),e=e&&!Eo(n.addedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Do=new Map;let Ao=0;function Fo(){const t=window.devicePixelRatio;t!==Ao&&(Ao=t,Do.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function Oo(t,e,n){const i=t.canvas,r=i&&Fi(i);if(!r)return;const o=Ue(((t,e)=>{const i=r.clientWidth;n(t,e),i{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||o(n,i)}));return s.observe(r),function(t,e){Do.size||window.addEventListener("resize",Fo),Do.set(t,e)}(t,o),s}function To(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Do.delete(t),Do.size||window.removeEventListener("resize",Fo)}(t)}function No(t,e,n){const i=t.canvas,r=Ue((e=>{null!==t.ctx&&n(function(t,e){const n=wo[t.type]||t.type,{x:i,y:r}=Ri(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,$o)}(i,e,r),r}class zo extends bo{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[_o]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ko(r)){const e=Ui(t,"width");void 0!==e&&(t.width=e)}if(ko(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ui(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[_o])return!1;const n=e[_o].initial;["height","width"].forEach((t=>{const i=n[t];qt(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e[_o],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:So,detach:Mo,resize:Oo}[e]||No;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:To,detach:To,resize:To}[e]||Co)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return Ii(t,e,n,i)}isAttached(t){const e=Fi(t);return!(!e||!e.isConnected)}}class Lo{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,e,n);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===Zt(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){qt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=Gt(n.options&&n.options.plugins,{}),r=function(t){const e={},n=[],i=Object.keys(Yr.plugins.items);for(let t=0;tt.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function Ro(t,e){return e||!1!==t?!0===t?{}:t:null}function Po(t,{plugin:e,local:n},i,r){const o=t.pluginScopeKeys(e),s=t.getOptionScopes(i,o);return n&&e.defaults&&s.push(e.defaults),t.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Io(t,e){const n=Pn.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Bo(t,e){return"x"===t||"y"===t?t:e.axis||function(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}(e.position)||t.charAt(0).toLowerCase()}function jo(t){const e=t.options||(t.options={});e.plugins=Gt(e.plugins,{}),e.scales=function(t,e){const n=Nn[t.type]||{scales:{}},i=e.scales||{},r=Io(t.type,e),o=Object.create(null),s=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[t];if(!Ht(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const a=Bo(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,r),c=n.scales||{};o[a]=o[a]||t,s[t]=ie(Object.create(null),[{axis:a},e,c[a],c[l]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,a=n.indexAxis||Io(r,e),l=(Nn[r]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,a),r=n[e+"AxisID"]||o[e]||e;s[r]=s[r]||Object.create(null),ie(s[r],[{axis:e},i[r],l[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];ie(e,[Pn.scales[e.type],Pn.scale])})),s}(t,e)}function Uo(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const qo=new Map,Wo=new Set;function Ho(t,e){let n=qo.get(t);return n||(n=e(),qo.set(t,n),Wo.add(n)),n}const Vo=(t,e,n)=>{const i=se(e,n);void 0!==i&&t.add(i)};class Yo{constructor(t){this._config=function(t){return(t=t||{}).data=Uo(t.data),jo(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Uo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),jo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ho(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Ho(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Ho(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Ho(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),s=o.get(e);if(s)return s;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>Vo(a,t,e)))),e.forEach((t=>Vo(a,i,t))),e.forEach((t=>Vo(a,Nn[r]||{},t))),e.forEach((t=>Vo(a,Pn,t))),e.forEach((t=>Vo(a,zn,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Wo.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Nn[e]||{},Pn.datasets[e]||{},{type:e},Pn,zn]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:s}=Go(this._resolverCache,t,i);let a=o;if(function(t,e){const{isScriptable:n,isIndexable:i}=fi(t);for(const r of e){const e=n(r),o=i(r),s=(o||e)&&t[r];if(e&&(ce(s)||Xo(s))||o&&Wt(s))return!0}return!1}(o,e)){r.$shared=!1;a=ui(o,n=ce(n)?n():n,this.createResolver(t,n,s))}for(const t of e)r[t]=a[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=Go(this._resolverCache,t,n);return Ht(e)?ui(r,e,void 0,i):r}}function Go(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);if(!o){o={resolver:ci(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,o)}return o}const Xo=t=>Ht(t)&&Object.getOwnPropertyNames(t).reduce(((e,n)=>e||ce(t[n])),!1);const Zo=["top","bottom","left","right","chartArea"];function Jo(t,e){return"top"===t||"bottom"===t||-1===Zo.indexOf(t)&&"x"===e}function Qo(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Ko(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Zt(n&&n.onComplete,[t],e)}function ts(t){const e=t.chart,n=e.options.animation;Zt(n&&n.onProgress,[t],e)}function es(t){return Ai()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ns={},is=t=>{const e=es(t);return Object.values(ns).filter((t=>t.canvas===e)).pop()};function rs(t,e,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}class os{constructor(t,e){const n=this.config=new Yo(e),i=es(t),r=is(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!Ai()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?xo:zo}(i)),this.platform.updateConfig(n);const s=this.platform.acquireContext(i,o.aspectRatio),a=s&&s.canvas,l=a&&a.height,c=a&&a.width;this.id=Ut(),this.ctx=s,this.canvas=a,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Lo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],ns[this.id]=this,s&&a?(er.listen(this,"complete",Ko),er.listen(this,"progress",ts),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return qt(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Bi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Un(this.canvas,this.ctx),this}stop(){return er.stop(this),this}resize(t,e){er.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,e,r),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Bi(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),Zt(n.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){Jt(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const n=e[t],i=Bo(t,n),r="r"===i,o="x"===i;return{options:n,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}})))),Jt(r,(e=>{const r=e.options,o=r.id,s=Bo(o,r),a=Gt(r.type,e.dtype);void 0!==r.position&&Jo(r.position,s)===Jo(e.dposition)||(r.position=e.dposition),i[o]=!0;let l=null;if(o in n&&n[o].type===a)l=n[o];else{l=new(Yr.getScale(a))({id:o,type:a,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(r,t)})),Jt(i,((t,e)=>{t||delete n[e]})),Jt(n,(t=>{vo.configure(this,t,t.options),vo.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qo("z","_idx"));const{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Jt(this.scales,(t=>{vo.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);ue(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e){rs(t,i,"_removeElements"===n?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),i=n(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;vo.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Jt(this.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(i&&Hn(e,{left:!1===n.left?0:r.left-n.left,right:!1===n.right?this.width:r.right+n.right,top:!1===n.top?0:r.top-n.top,bottom:!1===n.bottom?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&Vn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=ro.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=li(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);le(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update((e=>e.datasetIndex===t?i:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),er.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};Jt(this.options.events,(t=>n(t,i)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",s)},e.isAttached(this.canvas)?s():o()}unbindEvents(){Jt(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},Jt(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,s,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),s=0,a=t.length;s{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!Qt(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=r(e,t),s=n?t:r(t,e);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,o=e,s=this._getActiveElements(t,i,n,o),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,a);n&&(this._lastEvent=null,Zt(r.onHover,[t,s,this],this),a&&Zt(r.onClick,[t,s,this],this));const c=!Qt(s,i);return(c||e)&&(this._active=s,this._updateHoverStyles(s,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}const ss=()=>Jt(os.instances,(t=>t._plugins.invalidate())),as=!0;function ls(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:s,outerRadius:a,innerRadius:l}=e;let c=r/a;t.beginPath(),t.arc(o,s,a,i-c,n+c),l>r?(c=r/l,t.arc(o,s,l,n+c,i-c,!0)):t.arc(o,s,r,n+me,i-me),t.closePath(),t.clip()}function cs(t,e,n,i){const r=function(t){return ni(t,["outerStart","outerEnd","innerStart","innerEnd"])}(t.options.borderRadius),o=(n-e)/2,s=Math.min(o,i*e/2),a=t=>{const e=(n-Math.min(o,t))*i/2;return Te(t,0,Math.min(o,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Te(r.innerStart,0,s),innerEnd:Te(r.innerEnd,0,s)}}function us(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function fs(t,e,n,i,r,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let d=0;const p=r-l;if(i){const t=((u>0?u-i:0)+(f>0?f-i:0))/2;d=(p-(0!==t?p*t/(t+i):p))/2}const g=(p-Math.max(.001,p*f-n/fe)/f)/2,m=l+g+d,y=r-g-d,{outerStart:v,outerEnd:b,innerStart:x,innerEnd:_}=cs(e,h,f,y-m),w=f-v,k=f-b,$=m+v/w,C=y-b/k,E=h+x,S=h+_,M=m+x/E,D=y-_/S;if(t.beginPath(),o){if(t.arc(s,a,f,$,C),b>0){const e=us(k,C,s,a);t.arc(e.x,e.y,b,C,y+me)}const e=us(S,y,s,a);if(t.lineTo(e.x,e.y),_>0){const e=us(S,D,s,a);t.arc(e.x,e.y,_,y+me,D+Math.PI)}if(t.arc(s,a,h,y-_/h,m+x/h,!0),x>0){const e=us(E,M,s,a);t.arc(e.x,e.y,x,M+Math.PI,m-me)}const n=us(w,m,s,a);if(t.lineTo(n.x,n.y),v>0){const e=us(w,$,s,a);t.arc(e.x,e.y,v,m-me,$)}}else{t.moveTo(s,a);const e=Math.cos($)*f+s,n=Math.sin($)*f+a;t.lineTo(e,n);const i=Math.cos(C)*f+s,r=Math.sin(C)*f+a;t.lineTo(i,r)}t.closePath()}function hs(t,e,n,i,r,o){const{options:s}=e,{borderWidth:a,borderJoinStyle:l}=s,c="inner"===s.borderAlign;a&&(c?(t.lineWidth=2*a,t.lineJoin=l||"round"):(t.lineWidth=a,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:r,startAngle:o,pixelMargin:s,fullCircles:a}=e,l=Math.max(e.outerRadius-s,0),c=e.innerRadius+s;let u;for(n&&ls(t,e,o+he),t.beginPath(),t.arc(i,r,c,o+he,o,!0),u=0;u{Yr.add(...t),ss()}},unregister:{enumerable:as,value:(...t)=>{Yr.remove(...t),ss()}}});class ds extends Nr{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=Me(i,{x:t,y:e}),{startAngle:s,endAngle:a,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=this.options.spacing/2,h=Gt(u,a-s)>=he||Oe(r,s,a),d=Ne(o,l+f,c+f);return h&&d}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(i+r)/2,u=(o+s+l+a)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>he?Math.floor(n/he):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(i){s=i/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=fe&&(s=i)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,n,i,r){const{fullCircles:o,startAngle:s,circumference:a}=e;let l=e.endAngle;if(o){fs(t,e,n,i,s+he,r);for(let e=0;ea&&o>a;return{count:i,start:l,loop:e.loop,ilen:c(s+(c?a-t:t))%o,b=()=>{d!==p&&(t.lineTo(m,p),t.lineTo(m,d),t.lineTo(m,g))};for(l&&(f=r[v(0)],t.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=r[v(u)],f.skip)continue;const e=f.x,n=f.y,i=0|e;i===h?(np&&(p=n),m=(y*m+e)/++y):(b(),t.lineTo(e,n),h=i,y=0,d=p=n),g=n}b()}function bs(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?vs:ys}ds.id="arc",ds.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},ds.defaultRoutes={backgroundColor:"backgroundColor"};const xs="function"==typeof Path2D;function _s(t,e,n,i){xs&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),ps(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,s=bs(e);for(const a of r)ps(t,o,a.style),t.beginPath(),s(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class ws extends Nr{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Di(this._points,n,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:s,end:a}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;rr&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return Qi(t,!0===i?[{start:s,end:a,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let s,a=e,l=t[e];for(s=e+1;s<=n;++s){const n=t[s%r];n.skip||n.stop?l.skip||(i=!1,o.push({start:e%r,end:(s-1)%r,loop:i}),e=a=n.stop?s:null):(a=s,l.skip&&(e=s)),l=n}return null!==a&&o.push({start:e%r,end:a%r,loop:i}),o}(n,s,a"borderDash"!==t&&"fill"!==t};class $s extends Nr{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)-1?t.split("\n"):t}function zs(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:s,value:a}=o.getLabelAndValue(r);return{chart:t,label:s,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:a,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Ls(t,e){const n=t.chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:s,boxHeight:a}=e,l=si(e.bodyFont),c=si(e.titleFont),u=si(e.footerFont),f=o.length,h=r.length,d=i.length,p=oi(e.padding);let g=p.height,m=0,y=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(g+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){g+=d*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(y-d)*l.lineHeight+(y-1)*e.bodySpacing}h&&(g+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let v=0;const b=function(t){m=Math.max(m,n.measureText(t).width+v)};return n.save(),n.font=c.string,Jt(t.title,b),n.font=l.string,Jt(t.beforeBody.concat(t.afterBody),b),v=e.displayColors?s+2+e.boxPadding:0,Jt(i,(t=>{Jt(t.before,b),Jt(t.lines,b),Jt(t.after,b)})),v=0,n.font=u.string,Jt(t.footer,b),n.restore(),m+=p.width,{width:m,height:g}}function Rs(t,e,n,i){const{x:r,width:o}=n,{width:s,chartArea:{left:a,right:l}}=t;let c="center";return"center"===i?c=r<=(a+l)/2?"left":"right":r<=o/2?c="left":r>=s-o/2&&(c="right"),function(t,e,n,i){const{x:r,width:o}=i,s=n.caretSize+n.caretPadding;return"left"===t&&r+o+s>e.width||"right"===t&&r-o-s<0||void 0}(c,t,e,n)&&(c="center"),c}function Ps(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return nt.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Rs(t,e,n,i),yAlign:i}}function Is(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:s}=t,{xAlign:a,yAlign:l}=n,c=r+o,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:d}=ri(s);let p=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,a);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(u,h)+r:"right"===a&&(p+=Math.max(f,d)+r),{x:Te(p,0,i.width-e.width),y:Te(g,0,i.height-e.height)}}function Bs(t,e,n){const i=oi(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function js(t){return Ts([],Ns(t))}function Us(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}(class extends Nr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new sr(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=function(t,e,n){return li(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),o=n.afterTitle.apply(this,[t]);let s=[];return s=Ts(s,Ns(i)),s=Ts(s,Ns(r)),s=Ts(s,Ns(o)),s}getBeforeBody(t,e){return js(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,i=[];return Jt(t,(t=>{const e={before:[],lines:[],after:[]},r=Us(n,t);Ts(e.before,Ns(r.beforeLabel.call(this,t))),Ts(e.lines,r.label.call(this,t)),Ts(e.after,Ns(r.afterLabel.call(this,t))),i.push(e)})),i}getAfterBody(t,e){return js(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),o=n.afterFooter.apply(this,[t]);let s=[];return s=Ts(s,Ns(i)),s=Ts(s,Ns(r)),s=Ts(s,Ns(o)),s}_createItems(t){const e=this._active,n=this.chart.data,i=[],r=[],o=[];let s,a,l=[];for(s=0,a=e.length;st.filter(e,i,r,n)))),t.itemSort&&(l=l.sort(((e,i)=>t.itemSort(e,i,n)))),Jt(l,(e=>{const n=Us(t.callbacks,e);i.push(n.labelColor.call(this,e)),r.push(n.labelPointStyle.call(this,e)),o.push(n.labelTextColor.call(this,e))})),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(i.length){const t=Os[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=Ls(this,n),s=Object.assign({},t,e),a=Ps(this.chart,n,s),l=Is(n,s,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:s}=n,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=ri(s),{x:f,y:h}=t,{width:d,height:p}=e;let g,m,y,v,b,x;return"center"===r?(b=h+p/2,"left"===i?(g=f,m=g-o,v=b+o,x=b-o):(g=f+d,m=g+o,v=b-o,x=b+o),y=g):(m="left"===i?f+Math.max(a,c)+o:"right"===i?f+d-Math.max(l,u)-o:this.caretX,"top"===r?(v=h,b=v-o,g=m-o,y=m+o):(v=h+p,b=v+o,g=m+o,y=m-o),x=v),{x1:g,x2:m,x3:y,y1:v,y2:b,y3:x}}drawTitle(t,e,n){const i=this.title,r=i.length;let o,s,a;if(r){const l=Gi(n.rtl,this.x,this.width);for(t.x=Bs(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",o=si(n.titleFont),s=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,a=0;a0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Jn(t,{x:e,y:p,w:l,h:a,radius:s}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Jn(t,{x:n,y:p+1,w:l-2,h:a-2,radius:s}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=o.backgroundColor,t.fillRect(n,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:s,boxHeight:a,boxWidth:l,boxPadding:c}=n,u=si(n.bodyFont);let f=u.lineHeight,h=0;const d=Gi(n.rtl,this.x,this.width),p=function(n){e.fillText(n,d.x(t.x+h),t.y+f/2),t.y+=f+r},g=d.textAlign(o);let m,y,v,b,x,_,w;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Bs(this,g,n),e.fillStyle=n.bodyColor,Jt(this.beforeBody,p),h=s&&"right"!==g?"center"===o?l/2+c:l+2+c:0,b=0,_=i.length;b<_;++b){for(m=i[b],y=this.labelTextColors[b],e.fillStyle=y,Jt(m.before,p),v=m.lines,s&&v.length&&(this._drawColorBox(e,t,b,d,n),f=Math.max(u.lineHeight,a)),x=0,w=v.length;x0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Os[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=Ls(this,t),s=Object.assign({},n,this._size),a=Ps(e,t,s),l=Is(t,s,a,e);i._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=oi(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),function(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map((({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),r=!Qt(n,i),o=this._positionChanged(i,e);(r||o)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),s=this._positionChanged(o,t),a=e||!Qt(o,r)||s;return a&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,n,i){const r=this.options;if("mouseout"===t.type)return[];if(!i)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Os[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}).positioners=Os;function qs(t,e,n,i){const r=t.indexOf(e);if(-1===r)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return r!==t.lastIndexOf(e)?n:r}class Ws extends Hr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(qt(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:Te(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:qs(n,t,Gt(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Hs(t,e){const n=[],{bounds:i,step:r,min:o,max:s,precision:a,count:l,maxTicks:c,maxDigits:u,includeBounds:f}=t,h=r||1,d=c-1,{min:p,max:g}=e,m=!qt(o),y=!qt(s),v=!qt(l),b=(g-p)/(u+1);let x,_,w,k,$=_e((g-p)/d/h)*h;if($<1e-14&&!m&&!y)return[{value:p},{value:g}];k=Math.ceil(g/$)-Math.floor(p/$),k>d&&($=_e(k*$/d/h)*h),qt(a)||(x=Math.pow(10,a),$=Math.ceil($*x)/x),"ticks"===i?(_=Math.floor(p/$)*$,w=Math.ceil(g/$)*$):(_=p,w=g),m&&y&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((s-o)/r,$/1e3)?(k=Math.round(Math.min((s-o)/$,c)),$=(s-o)/k,_=o,w=s):v?(_=m?o:_,w=y?s:w,k=l-1,$=(w-_)/k):(k=(w-_)/$,k=ke(k,Math.round(k),$/1e3)?Math.round(k):Math.ceil(k));const C=Math.max(Se($),Se(_));x=Math.pow(10,qt(a)?C:a),_=Math.round(_*x)/x,w=Math.round(w*x)/x;let E=0;for(m&&(f&&_!==o?(n.push({value:o}),_i=e?i:t,s=t=>r=n?r:t;if(t){const t=xe(i),e=xe(r);t<0&&e<0?s(0):t>0&&e>0&&o(0)}if(i===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),s(r+e),t||o(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=Hs({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&$e(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Yi(t,this.chart.options.locale,this.options.ticks.format)}}class Gs extends Ys{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Vt(t)?t:0,this.max=Vt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Ce(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Xs(t){return 1===t/Math.pow(10,Math.floor(be(t)))}Gs.id="linear",Gs.defaults={ticks:{callback:Lr.formatters.numeric}};class Zs extends Hr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Ys.prototype.parse.apply(this,[t,e]);if(0!==n)return Vt(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Vt(t)?Math.max(0,t):null,this.max=Vt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const r=e=>n=t?n:e,o=t=>i=e?i:t,s=(t,e)=>Math.pow(10,Math.floor(be(t))+e);n===i&&(n<=0?(r(1),o(10)):(r(s(n,-1)),o(s(i,1)))),n<=0&&r(s(i,-1)),i<=0&&o(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&r(s(n,-1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,e){const n=Math.floor(be(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),r=[];let o=Yt(t.min,Math.pow(10,Math.floor(be(e.min)))),s=Math.floor(be(o)),a=Math.floor(o/Math.pow(10,s)),l=s<0?Math.pow(10,Math.abs(s)):1;do{r.push({value:o,major:Xs(o)}),++a,10===a&&(a=1,++s,l=s>=0?1:l),o=Math.round(a*Math.pow(10,s)*l)/l}while(sr?{start:e-n,end:e}:{start:e,end:e+n}}function ta(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],r=[],o=t._pointLabels.length,s=t.options.pointLabels,a=s.centerPointLabels?fe/o:0;for(let l=0;le.r&&(a=(i.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),r.starte.b&&(l=(r.end-e.b)/s,t.b=Math.max(t.b,e.b+l))}function na(t){return 0===t||180===t?"center":t<180?"left":"right"}function ia(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function ra(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function oa(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,he);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let o=1;o{const n=Zt(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?ta(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){return Fe(t*(he/(this._pointLabels.length||1))+Ce(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(qt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(qt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;r--){const e=i.setContext(t.getPointLabelContext(r)),o=si(e.font),{x:s,y:a,textAlign:l,left:c,top:u,right:f,bottom:h}=t._pointLabelItems[r],{backdropColor:d}=e;if(!qt(d)){const t=ri(e.borderRadius),i=oi(e.backdropPadding);n.fillStyle=d;const r=c-i.left,o=u-i.top,s=f-c+i.width,a=h-u+i.height;Object.values(t).some((t=>0!==t))?(n.beginPath(),Jn(n,{x:r,y:o,w:s,h:a,radius:t}),n.fill()):n.fillRect(r,o,s,a)}Xn(n,t._pointLabels[r],s,a+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,r),i.display&&this.ticks.forEach(((t,e)=>{if(0!==e){s=this.getDistanceFromCenterForValue(t.value);!function(t,e,n,i){const r=t.ctx,o=e.circular,{color:s,lineWidth:a}=e;!o&&!i||!s||!a||n<0||(r.save(),r.strokeStyle=s,r.lineWidth=a,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),oa(t,n,o,i),r.closePath(),r.stroke(),r.restore())}(this,i.setContext(this.getContext(e-1)),s,r)}})),n.display){for(t.save(),o=r-1;o>=0;o--){const i=n.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:l}=i;l&&r&&(t.lineWidth=l,t.strokeStyle=r,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,s=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((i,s)=>{if(0===s&&!e.reverse)return;const a=n.setContext(this.getContext(s)),l=si(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[s].value),a.showLabelBackdrop){t.font=l.string,o=t.measureText(i.label).width,t.fillStyle=a.backdropColor;const e=oi(a.backdropPadding);t.fillRect(-o/2-e.left,-r-l.size/2-e.top,o+e.width,l.size+e.height)}Xn(t,i.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}sa.id="radialLinear",sa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Lr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},sa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},sa.descriptors={angleLines:{_fallback:"grid"}};const aa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},la=Object.keys(aa);function ca(t,e){return t-e}function ua(t,e){if(qt(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:o}=t._parseOpts;let s=e;return"function"==typeof i&&(s=i(s)),Vt(s)||(s="string"==typeof i?n.parse(s,i):n.parse(s)),null===s?null:(r&&(s="week"!==r||!we(o)&&!0!==o?n.startOf(s,r):n.startOf(s,"isoWeek",o)),+s)}function fa(t,e,n,i){const r=la.length;for(let o=la.indexOf(t);o=e?n[i]:n[r]]=!0}}else t[e]=!0}function da(t,e,n){const i=[],r={},o=e.length;let s,a;for(s=0;s=0&&(e[l].major=!0);return e}(t,i,r,n):i}class pa extends Hr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new Jr._date(t.adapters.date);i.init(e),ie(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ua(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:o,maxDefined:s}=this.getUserBounds();function a(t){o||isNaN(t.min)||(i=Math.min(i,t.min)),s||isNaN(t.max)||(r=Math.max(r,t.max))}o&&s||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),i=Vt(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=Vt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,o=function(t,e,n){let i=0,r=t.length;for(;ii&&t[r-1]>n;)r--;return i>0||r=la.indexOf(n);o--){const n=la[o];if(aa[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return la[n?la.indexOf(n):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=la.indexOf(t)+1,n=la.length;e+t.value)))}initOffsets(t){let e,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=Te(i,0,o),r=Te(r,0,o),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,o=r.unit||fa(r.minUnit,e,n,this._getLabelCapacity(e)),s=Gt(r.stepSize,1),a="week"===o&&r.isoWeekday,l=we(a)||!0===a,c={};let u,f,h=e;if(l&&(h=+t.startOf(h,"isoWeek",a)),h=+t.startOf(h,l?"day":o),t.diff(n,e,o)>1e5*s)throw new Error(e+" and "+n+" are too far apart with stepSize of "+s+" "+o);const d="data"===i.ticks.source&&this.getDataTimestamps();for(u=h,f=0;ut-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this.options,o=r.time.displayFormats,s=this._unit,a=this._majorUnit,l=s&&o[s],c=a&&o[a],u=n[e],f=a&&c&&u&&u.major,h=this._adapter.format(t,i||(f?c:l)),d=r.ticks.callback;return d?Zt(d,[h,e,n],this):h}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e0?s:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=Le(t,"pos",e)),({pos:i,time:o}=t[a]),({pos:r,time:s}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=Le(t,"time",e)),({time:i,pos:o}=t[a]),({time:r,pos:s}=t[l]));const c=r-i;return c?o+(s-o)*(e-i)/c:o}pa.id="time",pa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ma extends pa{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ga(e,this.min),this._tableRange=ga(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,s,a,l,c;for(o=0,s=t.length;o=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,s=i.length;o{"componentData"in t&&n(1,a=t.componentData)},t.$$.update=()=>{2&t.$$.dirty&&({config:i,data:r,labels:o}=a),1&t.$$.dirty&&s&&new os(s,l)},[s,a,function(t){H[t?"unshift":"push"]((()=>{s=t,n(0,s)}))}]}class xa extends mt{constructor(t){super(),gt(this,t,ba,va,s,{componentData:1})}}function _a(t){let e,n,i;return{c(){e=w("div"),n=C(),i=w("div"),M(e,"class","path topLeft svelte-1hyaq5f"),M(i,"class","path bottomRight svelte-1hyaq5f")},m(t,r){b(t,e,r),b(t,n,r),b(t,i,r)},d(t){t&&x(e),t&&x(n),t&&x(i)}}}function wa(t){let e;return{c(){e=w("div"),M(e,"class","path straightLine svelte-1hyaq5f")},m(t,n){b(t,e,n)},d(t){t&&x(e)}}}function ka(e){let n;function i(t,e){return t[5]?wa:_a}let r=i(e),o=r(e);return{c(){n=w("div"),o.c(),M(n,"class","connectorwrapper svelte-1hyaq5f"),F(n,"top",e[1]+"rem"),F(n,"left",e[0]+"rem"),F(n,"width",e[3]+"rem"),F(n,"height",e[4]+"rem"),O(n,"flip",e[2])},m(t,e){b(t,n,e),o.m(n,null)},p(t,[e]){r!==(r=i(t))&&(o.d(1),o=r(t),o&&(o.c(),o.m(n,null))),2&e&&F(n,"top",t[1]+"rem"),1&e&&F(n,"left",t[0]+"rem"),8&e&&F(n,"width",t[3]+"rem"),16&e&&F(n,"height",t[4]+"rem"),4&e&&O(n,"flip",t[2])},i:t,o:t,d(t){t&&x(n),o.d()}}}const $a=.5;function Ca(t,e,n){let i,r,o,{top:s=0}=e,{left:a=0}=e,{bottom:l=0}=e,{right:c=0}=e,u=!1;return t.$$set=t=>{"top"in t&&n(1,s=t.top),"left"in t&&n(0,a=t.left),"bottom"in t&&n(7,l=t.bottom),"right"in t&&n(6,c=t.right)},t.$$.update=()=>{207&t.$$.dirty&&(n(2,i=c-a<0),n(3,r=Math.abs(c-a)),r<=$a?(n(3,r=$a),n(5,u=!0),n(0,a-=.25)):(i?(n(0,a+=.25),n(6,c-=.25)):(n(0,a-=.25),n(6,c+=.25)),n(3,r=Math.abs(c-a))),n(4,o=l-s))},[a,s,i,r,o,u,c,l]}class Ea extends mt{constructor(t){super(),gt(this,t,Ca,ka,s,{top:1,left:0,bottom:7,right:6})}}function Sa(t,e,n){const i=t.slice();return i[4]=e[n],i}function Ma(t){let e,n;return e=new Ea({props:{top:$t(t[4].top),left:$t(t[4].left),bottom:$t(t[4].bottom),right:$t(t[4].right)}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.top=$t(t[4].top)),1&n&&(i.left=$t(t[4].left)),1&n&&(i.bottom=$t(t[4].bottom)),1&n&&(i.right=$t(t[4].right)),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Da(t){let e,n,i=t[0],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{"steps"in t&&n(1,i=t.steps),"boxes"in t&&n(2,r=t.boxes),"container"in t&&n(3,o=t.container)},t.$$.update=()=>{if(15&t.$$.dirty){n(0,s=[]);const t=o.getBoundingClientRect(),e=t.top,a=t.left;r&&Object.keys(i).forEach((t=>{var o;const l=i[t],c=r[t].getBoundingClientRect();null===(o=l.next)||void 0===o||o.forEach((t=>{const i=r[t].getBoundingClientRect(),o={top:c.bottom-e,left:c.left-a+c.width/2,bottom:i.top-e,right:i.left-a+i.width/2};n(0,s=[...s,o])}))}))}},[s,i,r,o]}class Fa extends mt{constructor(t){super(),gt(this,t,Aa,Da,s,{steps:1,boxes:2,container:3})}}const Oa="currentStep";function Ta(t,e,n){const i=t.slice();return i[18]=e[n],i[20]=n,i}function Na(t){let e,n,i;return{c(){e=w("div"),n=$("x"),i=$(t[6]),M(e,"class","levelstoshow svelte-117ceti")},m(t,r){b(t,e,r),v(e,n),v(e,i)},p(t,e){64&e&&A(i,t[6])},d(t){t&&x(e)}}}function za(t){let e,n;return{c(){e=w("div"),M(e,"class",n="level rectangle "+t[18]+" svelte-117ceti"),F(e,"z-index",-1*(t[20]+1)),F(e,"top",(t[20]+1)*Ra+"px"),F(e,"left",(t[20]+1)*Ra+"px")},m(t,n){b(t,e,n)},p(t,i){128&i&&n!==(n="level rectangle "+t[18]+" svelte-117ceti")&&M(e,"class",n)},d(t){t&&x(e)}}}function La(e){let n,i,r,o,s,a,l,c,u,f,h,d=e[2].doc+"",p=e[6]&&Na(e),g=e[7],m=[];for(let t=0;t1&&(o=(new Intl.NumberFormat).format(a.num_possible_tasks)),l=a.num_possible_tasks-1,Object.keys(d).forEach((t=>{const e=Number.parseInt(t);a.num_possible_tasks&&a.num_possible_tasks>e&&n(11,l=d[e])}))):l*=3,l>0&&(p=new Array(l).fill("")),p=p.map(((t,e)=>{var n,i;if(a.num_possible_tasks){const t=null!==(n=a.num_failed)&&void 0!==n?n:0,r=null!==(i=a.successful_tasks)&&void 0!==i?i:0;return(t-1)/a.num_possible_tasks>=(e+1)/p.length?"error":(t+r)/a.num_possible_tasks>=(e+1)/p.length?"success":"running"}return""}));const g=U(Oa),m=s===g;let y;a.failed||a.num_failed?f=!0:(null!==(i=a.num_possible_tasks)&&void 0!==i?i:0)>(null!==(r=a.successful_tasks)&&void 0!==r?r:0)?h=!0:a.num_possible_tasks&&a.num_possible_tasks===a.successful_tasks&&(u=!0);let v=!1;return P((()=>{n(9,v=(t=>t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)(y))})),t.$$set=t=>{"name"in t&&n(1,s=t.name),"step"in t&&n(2,a=t.step),"numLevels"in t&&n(11,l=t.numLevels),"el"in t&&n(0,c=t.el)},[c,s,a,u,f,h,o,p,y,v,m,l,function(t){H[t?"unshift":"push"]((()=>{y=t,n(8,y)}))},function(t){H[t?"unshift":"push"]((()=>{c=t,n(0,c)}))}]}class Ia extends mt{constructor(t){super(),gt(this,t,Pa,La,s,{name:1,step:2,numLevels:11,el:0})}}function Ba(t,e,n){const i=t.slice();return i[11]=e[n],i}function ja(t){let e,n,i,r,o,s;function a(e){t[8](e)}let l={name:t[2],numLevels:t[3],step:t[5]};void 0!==t[4]&&(l.el=t[4]),n=new Ia({props:l}),H.push((()=>ut(n,"el",a)));let c=t[7]&&function(t){let e,n,i,r,o=t[5].next,s=[];for(let e=0;eat(s[t],1,1,(()=>{s[t]=null}));return{c(){e=w("div"),n=C(),i=w("div");for(let t=0;ti=!1))),n.$set(r),t[7]&&c.p(t,e),t[5].box_ends&&u.p(t,e)},i(t){s||(st(n.$$.fragment,t),st(c),st(u),s=!0)},o(t){at(n.$$.fragment,t),at(c),at(u),s=!1},d(t){t&&x(e),dt(n),c&&c.d(),u&&u.d()}}}function Ua(t){let e,n;return e=new Ha({props:{steps:t[1],stepName:t[11],levels:t[6],boxes:t[0]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.steps=t[1]),1&n&&(i.boxes=t[0]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function qa(t){let e,n,i=t[5]&&ja(t);return{c(){i&&i.c(),e=E()},m(t,r){i&&i.m(t,r),b(t,e,r),n=!0},p(t,[e]){t[5]&&i.p(t,e)},i(t){n||(st(i),n=!0)},o(t){at(i),n=!1},d(t){i&&i.d(t),t&&x(e)}}}function Wa(t,e,n){var i;let{steps:r}=e,{stepName:o}=e,{levels:s=0}=e,{boxes:a={}}=e,l=null;P((()=>{l&&n(0,a[o]=l,a)}));let c=r[o];c||console.warn("step ",o," not found");const u="foreach"===(null==c?void 0:c.type)?s+1:"join"===(null==c?void 0:c.type)?s-1:s;let f=null===(i=null==c?void 0:c.next)||void 0===i?void 0:i.find((t=>{var e;return"join"!==(null===(e=r[t])||void 0===e?void 0:e.type)}));return t.$$set=t=>{"steps"in t&&n(1,r=t.steps),"stepName"in t&&n(2,o=t.stepName),"levels"in t&&n(3,s=t.levels),"boxes"in t&&n(0,a=t.boxes)},[a,r,o,s,l,c,u,f,function(t){l=t,n(4,l)}]}class Ha extends mt{constructor(t){super(),gt(this,t,Wa,qa,s,{steps:1,stepName:2,levels:3,boxes:0})}}function Va(e){let n;return{c(){n=w("p"),n.textContent="No start step"},m(t,e){b(t,n,e)},p:t,i:t,o:t,d(t){t&&x(n)}}}function Ya(t){let e,n,i;function r(e){t[6](e)}let o={steps:t[3],stepName:"start"};return void 0!==t[0]&&(o.boxes=t[0]),e=new Ha({props:o}),H.push((()=>ut(e,"boxes",r))),{c(){ft(e.$$.fragment)},m(t,n){ht(e,t,n),i=!0},p(t,i){const r={};!n&&1&i&&(n=!0,r.boxes=t[0],J((()=>n=!1))),e.$set(r)},i(t){i||(st(e.$$.fragment,t),i=!0)},o(t){at(e.$$.fragment,t),i=!1},d(t){dt(e,t)}}}function Ga(t){let e,n;return e=new Fa({props:{boxes:t[0],steps:t[3],container:t[1]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.boxes=t[0]),2&n&&(i.container=t[1]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Xa(t){let e,n,i,r,o,s,a,l=!t[2]&&Object.keys(t[0]).length;const c=[Ya,Va],u=[];n=function(t,e){return t[3]?.start?0:1}(t),i=u[n]=c[n](t);let f=l&&Ga(t);return{c(){e=w("div"),i.c(),r=C(),f&&f.c(),F(e,"position","relative"),F(e,"line-height","1"),M(e,"data-component","dag")},m(i,l){b(i,e,l),u[n].m(e,null),v(e,r),f&&f.m(e,null),t[7](e),o=!0,s||(a=S(window,"resize",t[4]),s=!0)},p(t,[n]){i.p(t,n),5&n&&(l=!t[2]&&Object.keys(t[0]).length),l?f?(f.p(t,n),5&n&&st(f,1)):(f=Ga(t),f.c(),st(f,1),f.m(e,null)):f&&(rt(),at(f,1,1,(()=>{f=null})),ot())},i(t){o||(st(i),st(f),o=!0)},o(t){at(i),at(f),o=!1},d(i){i&&x(e),u[n].d(),f&&f.d(),t[7](null),s=!1,a()}}}function Za(t,e,n){let i;var r;c(t,xt,(t=>n(10,i=t)));let{componentData:o}=e;const{data:s}=o;let a,l,u={};j(Oa,((t,e)=>{var n;if(t&&e)return null===(n=(t=>{const e=t.split("/");return{flowname:e[0],runid:e[1],stepname:null==e?void 0:e[2],taskid:null==e?void 0:e[3]}})(t))||void 0===n?void 0:n[e]})(null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.pathspec,"stepname"));let f=!1;return t.$$set=t=>{"componentData"in t&&n(5,o=t.componentData)},[u,a,f,s,()=>{n(2,f=!0),clearTimeout(l),l=setTimeout((()=>{n(2,f=!1)}),100)},o,function(t){u=t,n(0,u)},function(t){H[t?"unshift":"push"]((()=>{a=t,n(1,a)}))}]}class Ja extends mt{constructor(t){super(),gt(this,t,Za,Xa,s,{componentData:5})}}function Qa(e){let n,i,r=(e[0]?.text||"")+"";return{c(){n=w("h2"),i=$(r),M(n,"class","title svelte-117s0ws"),M(n,"data-component","title")},m(t,e){b(t,n,e),v(n,i)},p(t,[e]){1&e&&r!==(r=(t[0]?.text||"")+"")&&A(i,r)},i:t,o:t,d(t){t&&x(n)}}}function Ka(t,e,n){let{componentData:i}=e;return t.$$set=t=>{"componentData"in t&&n(0,i=t.componentData)},[i]}class tl extends mt{constructor(t){super(),gt(this,t,Ka,Qa,s,{componentData:0})}}function el(e){let n,i,r=(e[0]?.text||"")+"";return{c(){n=w("p"),i=$(r),M(n,"class","subtitle svelte-lu9pnn"),M(n,"data-component","subtitle")},m(t,e){b(t,n,e),v(n,i)},p(t,[e]){1&e&&r!==(r=(t[0]?.text||"")+"")&&A(i,r)},i:t,o:t,d(t){t&&x(n)}}}function nl(t,e,n){let{componentData:i}=e;return t.$$set=t=>{"componentData"in t&&n(0,i=t.componentData)},[i]}class il extends mt{constructor(t){super(),gt(this,t,nl,el,s,{componentData:0})}}function rl(t){let e,n;return e=new tl({props:{componentData:{type:"title",text:t[1]}}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.componentData={type:"title",text:t[1]}),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function ol(t){let e,n;return e=new il({props:{componentData:{type:"subtitle",text:t[0]}}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.componentData={type:"subtitle",text:t[0]}),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function sl(t){let e,n,i,r=t[1]&&rl(t),o=t[0]&&ol(t);return{c(){e=w("header"),r&&r.c(),n=C(),o&&o.c(),M(e,"class","container svelte-1ugmt5d"),M(e,"data-component","heading")},m(t,s){b(t,e,s),r&&r.m(e,null),v(e,n),o&&o.m(e,null),i=!0},p(t,[i]){t[1]?r?(r.p(t,i),2&i&&st(r,1)):(r=rl(t),r.c(),st(r,1),r.m(e,n)):r&&(rt(),at(r,1,1,(()=>{r=null})),ot()),t[0]?o?(o.p(t,i),1&i&&st(o,1)):(o=ol(t),o.c(),st(o,1),o.m(e,null)):o&&(rt(),at(o,1,1,(()=>{o=null})),ot())},i(t){i||(st(r),st(o),i=!0)},o(t){at(r),at(o),i=!1},d(t){t&&x(e),r&&r.d(),o&&o.d()}}}function al(t,e,n){let i,r,{componentData:o}=e;return t.$$set=t=>{"componentData"in t&&n(2,o=t.componentData)},t.$$.update=()=>{4&t.$$.dirty&&n(1,({title:i,subtitle:r}=o),i,(n(0,r),n(2,o)))},[r,i,o]}class ll extends mt{constructor(t){super(),gt(this,t,al,sl,s,{componentData:2})}}function cl(t){let e,n;return{c(){e=w("div"),n=$(t[2]),M(e,"class","label svelte-1x96yvr")},m(t,i){b(t,e,i),v(e,n)},p(t,e){4&e&&A(n,t[2])},d(t){t&&x(e)}}}function ul(t){let e,n;return{c(){e=w("figcaption"),n=$(t[1]),M(e,"class","description svelte-1x96yvr")},m(t,i){b(t,e,i),v(e,n)},p(t,e){2&e&&A(n,t[1])},d(t){t&&x(e)}}}function fl(e){let n,i,r,o,s,a,c,u,f,h=e[2]&&cl(e),d=e[1]&&ul(e);return{c(){n=w("figure"),i=w("div"),r=w("img"),a=C(),h&&h.c(),c=C(),d&&d.c(),l(r.src,o=e[3])||M(r,"src",o),M(r,"alt",s=e[2]||"image"),M(r,"class","svelte-1x96yvr"),M(i,"class","imageContainer"),M(n,"data-component","image"),M(n,"class","svelte-1x96yvr")},m(t,o){b(t,n,o),v(n,i),v(i,r),v(n,a),h&&h.m(n,null),v(n,c),d&&d.m(n,null),u||(f=S(n,"click",e[4]),u=!0)},p(t,[e]){8&e&&!l(r.src,o=t[3])&&M(r,"src",o),4&e&&s!==(s=t[2]||"image")&&M(r,"alt",s),t[2]?h?h.p(t,e):(h=cl(t),h.c(),h.m(n,c)):h&&(h.d(1),h=null),t[1]?d?d.p(t,e):(d=ul(t),d.c(),d.m(n,null)):d&&(d.d(1),d=null)},i:t,o:t,d(t){t&&x(n),h&&h.d(),d&&d.d(),u=!1,f()}}}function hl(t,e,n){let i,r,o,{componentData:s}=e;return t.$$set=t=>{"componentData"in t&&n(0,s=t.componentData)},t.$$.update=()=>{1&t.$$.dirty&&n(3,({src:i,label:r,description:o}=s),i,(n(2,r),n(0,s)),(n(1,o),n(0,s)))},[s,o,r,i,()=>wt.set(s)]}class dl extends mt{constructor(t){super(),gt(this,t,hl,fl,s,{componentData:0})}}function pl(e){let n,i;return{c(){n=w("div"),i=w("canvas"),M(n,"data-component","line-chart")},m(t,r){b(t,n,r),v(n,i),e[2](i)},p:t,i:t,o:t,d(t){t&&x(n),e[2](null)}}}function gl(t,e,n){let i,r,o;os.register(ws,Gs,Ar,Ws,$s);let s,{componentData:a}=e;const l=i||{type:"line",data:{labels:o,datasets:[{backgroundColor:ya[2],borderColor:ya[2],data:r||[]}]},options:{plugins:{legend:{display:!1}}}};return t.$$set=t=>{"componentData"in t&&n(1,a=t.componentData)},t.$$.update=()=>{2&t.$$.dirty&&({config:i,data:r,labels:o}=a),1&t.$$.dirty&&s&&new os(s,l)},[s,a,function(t){H[t?"unshift":"push"]((()=>{s=t,n(0,s)}))}]}class ml extends mt{constructor(t){super(),gt(this,t,gl,pl,s,{componentData:1})}}function yl(e){let n,i,r,o,s,a,l,c=e[0].data+"";return{c(){n=w("pre"),i=$(" \n "),r=w("code"),o=$("\n "),s=$(c),a=$("\n "),l=$("\n"),M(r,"class","mono language-log"),M(n,"class","log svelte-1jhmsu"),M(n,"data-component","log")},m(t,c){b(t,n,c),v(n,i),v(n,r),v(r,o),v(r,s),v(r,a),e[2](r),v(n,l)},p(t,[e]){1&e&&c!==(c=t[0].data+"")&&A(s,c)},i:t,o:t,d(t){t&&x(n),e[2](null)}}}function vl(t,e,n){let i,{componentData:r}=e;return t.$$set=t=>{"componentData"in t&&n(0,r=t.componentData)},t.$$.update=()=>{2&t.$$.dirty&&i&&function(){var t;i&&(null===(t=null===window||void 0===window?void 0:window.Prism)||void 0===t||t.highlightElement(i))}()},[r,i,function(t){H[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class bl extends mt{constructor(t){super(),gt(this,t,vl,yl,s,{componentData:0})}}function xl(t,e,n){const i=t.slice();return i[18]=e[n],i}function _l(t,e,n){const i=t.slice();return i[18]=e[n],i}function wl(t,e,n){const i=t.slice();return i[10]=e[n],i}function kl(t,e,n){const i=t.slice();return i[13]=e[n],i[15]=n,i}function $l(t,e,n){const i=t.slice();return i[16]=e[n],i[15]=n,i}function Cl(t,e,n){const i=t.slice();return i[7]=e[n],i}function El(t){let e,n,i,r;const o=[Al,Dl,Ml],s=[];function a(t,e){return"table"===t[0]?0:"list"===t[0]?1:2}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,r){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Sl(t){let e,n,i=t[1],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}s?(n=N(s,a(t)),ft(n.$$.fragment),st(n.$$.fragment,1),ht(n,i.parentNode,i)):n=null}else s&&n.$set(r)},i(t){r||(n&&st(n.$$.fragment,t),r=!0)},o(t){n&&at(n.$$.fragment,t),r=!1},d(t){t&&x(i),n&&dt(n,t)}}}function Dl(t){let e,n,i,r;const o=[zl,Nl],s=[];function a(t,e){return t[4]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,r){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Al(t){let e,n,i;var r=t[5].table;function o(t){return{props:{$$slots:{default:[Jl]},$$scope:{ctx:t}}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(8388716&i&&(s.$$scope={dirty:i,ctx:t}),32&i&&r!==(r=t[5].table)){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Fl(e){let n,i=e[6].raw+"";return{c(){n=$(i)},m(t,e){b(t,n,e)},p(t,e){64&e&&i!==(i=t[6].raw+"")&&A(n,i)},i:t,o:t,d(t){t&&x(n)}}}function Ol(t){let e,n;return e=new ec({props:{tokens:t[1],renderers:t[5]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.tokens=t[1]),32&n&&(i.renderers=t[5]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Tl(t){let e,n,i,r;const o=[Ol,Fl],s=[];function a(t,e){return t[1]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,r){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Nl(t){let n,i,r;const o=[{ordered:t[4]},t[6]];var s=t[5].list;function a(t){let n={$$slots:{default:[Pl]},$$scope:{ctx:t}};for(let t=0;t{dt(t,1)})),ot()}s?(n=N(s,a(t)),ft(n.$$.fragment),st(n.$$.fragment,1),ht(n,i.parentNode,i)):n=null}else s&&n.$set(r)},i(t){r||(n&&st(n.$$.fragment,t),r=!0)},o(t){n&&at(n.$$.fragment,t),r=!1},d(t){t&&x(i),n&&dt(n,t)}}}function zl(t){let n,i,r;const o=[{ordered:t[4]},t[6]];var s=t[5].list;function a(t){let n={$$slots:{default:[jl]},$$scope:{ctx:t}};for(let t=0;t{dt(t,1)})),ot()}s?(n=N(s,a(t)),ft(n.$$.fragment),st(n.$$.fragment,1),ht(n,i.parentNode,i)):n=null}else s&&n.$set(r)},i(t){r||(n&&st(n.$$.fragment,t),r=!0)},o(t){n&&at(n.$$.fragment,t),r=!1},d(t){t&&x(i),n&&dt(n,t)}}}function Ll(t){let e,n,i;return e=new ec({props:{tokens:t[18].tokens,renderers:t[5]}}),{c(){ft(e.$$.fragment),n=C()},m(t,r){ht(e,t,r),b(t,n,r),i=!0},p(t,n){const i={};64&n&&(i.tokens=t[18].tokens),32&n&&(i.renderers=t[5]),e.$set(i)},i(t){i||(st(e.$$.fragment,t),i=!0)},o(t){at(e.$$.fragment,t),i=!1},d(t){dt(e,t),t&&x(n)}}}function Rl(t){let n,i,r;const o=[t[18]];var s=t[5].unorderedlistitem||t[5].listitem;function a(t){let n={$$slots:{default:[Ll]},$$scope:{ctx:t}};for(let t=0;t{dt(t,1)})),ot()}s?(n=N(s,a(t)),ft(n.$$.fragment),st(n.$$.fragment,1),ht(n,i.parentNode,i)):n=null}else s&&n.$set(r)},i(t){r||(n&&st(n.$$.fragment,t),r=!0)},o(t){n&&at(n.$$.fragment,t),r=!1},d(t){t&&x(i),n&&dt(n,t)}}}function Pl(t){let e,n,i=t[6].items,r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}s?(n=N(s,a(t)),ft(n.$$.fragment),st(n.$$.fragment,1),ht(n,i.parentNode,i)):n=null}else s&&n.$set(r)},i(t){r||(n&&st(n.$$.fragment,t),r=!0)},o(t){n&&at(n.$$.fragment,t),r=!1},d(t){t&&x(i),n&&dt(n,t)}}}function jl(t){let e,n,i=t[6].items,r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Wl(t){let e,n,i=t[2],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Vl(t){let e,n;return e=new ec({props:{tokens:t[13].tokens,renderers:t[5]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.tokens=t[13].tokens),32&n&&(i.renderers=t[5]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Yl(t){let e,n,i;var r=t[5].tablecell;function o(t){return{props:{header:!1,align:t[6].align[t[15]]||"center",$$slots:{default:[Vl]},$$scope:{ctx:t}}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(64&i&&(s.align=t[6].align[t[15]]||"center"),8388648&i&&(s.$$scope={dirty:i,ctx:t}),32&i&&r!==(r=t[5].tablecell)){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Gl(t){let e,n,i=t[10],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Zl(t){let e,n,i=t[3],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{dt(t,1)})),ot()}s?(e=N(s,a(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else s&&e.$set(u);const f={};if(8388712&o&&(f.$$scope={dirty:o,ctx:t}),32&o&&l!==(l=t[5].tablebody)){if(i){rt();const t=i;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}l?(i=N(l,c(t)),ft(i.$$.fragment),st(i.$$.fragment,1),ht(i,r.parentNode,r)):i=null}else l&&i.$set(f)},i(t){o||(e&&st(e.$$.fragment,t),i&&st(i.$$.fragment,t),o=!0)},o(t){e&&at(e.$$.fragment,t),i&&at(i.$$.fragment,t),o=!1},d(t){e&&dt(e,t),t&&x(n),t&&x(r),i&&dt(i,t)}}}function Ql(t){let n,i;const r=[t[7],{renderers:t[5]}];let o={};for(let t=0;t{s[l]=null})),ot()),~e?(n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i)):n=null)},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){~e&&s[e].d(t),t&&x(i)}}}function tc(t,n,i){const r=["type","tokens","header","rows","ordered","renderers"];let o=m(n,r),{type:s}=n,{tokens:a}=n,{header:l}=n,{rows:c}=n,{ordered:u=!1}=n,{renderers:f}=n;return function(){const t=console.warn;console.warn=e=>{e.includes("unknown prop")||e.includes("unexpected slot")||t(e)},P((()=>{console.warn=t}))}(),t.$$set=t=>{n=e(e({},n),g(t)),i(6,o=m(n,r)),"type"in t&&i(0,s=t.type),"tokens"in t&&i(1,a=t.tokens),"header"in t&&i(2,l=t.header),"rows"in t&&i(3,c=t.rows),"ordered"in t&&i(4,u=t.ordered),"renderers"in t&&i(5,f=t.renderers)},[s,a,l,c,u,f,o]}class ec extends mt{constructor(t){super(),gt(this,t,tc,Kl,s,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}}function nc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ic={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const rc=/[&<>"']/,oc=new RegExp(rc.source,"g"),sc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ac=new RegExp(sc.source,"g"),lc={"&":"&","<":"<",">":">",'"':""","'":"'"},cc=t=>lc[t];function uc(t,e){if(e){if(rc.test(t))return t.replace(oc,cc)}else if(sc.test(t))return t.replace(ac,cc);return t}const fc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function hc(t){return t.replace(fc,((t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const dc=/(^|[^\[])\^/g;function pc(t,e){t="string"==typeof t?t:t.source,e=e||"";const n={replace:(e,i)=>(i=(i=i.source||i).replace(dc,"$1"),t=t.replace(e,i),n),getRegex:()=>new RegExp(t,e)};return n}const gc=/[^\w:]/g,mc=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function yc(t,e,n){if(t){let t;try{t=decodeURIComponent(hc(n)).replace(gc,"").toLowerCase()}catch(t){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}e&&!mc.test(n)&&(n=function(t,e){vc[" "+t]||(bc.test(t)?vc[" "+t]=t+"/":vc[" "+t]=$c(t,"/",!0));t=vc[" "+t];const n=-1===t.indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(xc,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(_c,"$1")+e:t+e}(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}const vc={},bc=/^[^:]+:\/*[^/]*$/,xc=/^([^:]+:)[\s\S]*$/,_c=/^([^:]+:\/*[^/]*)[\s\S]*$/;const wc={exec:function(){}};function kc(t,e){const n=t.replace(/\|/g,((t,e,n)=>{let i=!1,r=e;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>e)i.splice(e);else for(;i.length1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}function Ec(t,e,n,i){const r=e.href,o=e.title?uc(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");if("!"!==t[0].charAt(0)){i.state.inLink=!0;const t={type:"link",raw:n,href:r,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,t}return{type:"image",raw:n,href:r,title:o,text:uc(s)}}class Sc{constructor(t){this.options=t||ic}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:$c(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],n=function(t,e){const n=t.match(/^(\s+)(?:```)/);if(null===n)return e;const i=n[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(null===e)return t;const[n]=e;return n.length>=i.length?t.slice(i.length):t})).join("\n")}(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline._escapes,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=$c(t,"#");this.options.pedantic?t=e.trim():e&&!/ $/.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){const t=e[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(t);return this.lexer.state.top=n,{type:"blockquote",raw:e[0],tokens:i,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n,i,r,o,s,a,l,c,u,f,h,d,p=e[1].trim();const g=p.length>1,m={type:"list",raw:"",ordered:g,start:g?+p.slice(0,-1):"",loose:!1,items:[]};p=g?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=g?p:"[*+-]");const y=new RegExp(`^( {0,3}${p})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;t&&(d=!1,e=y.exec(t))&&!this.rules.block.hr.test(t);){if(n=e[0],t=t.substring(n.length),c=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length))),u=t.split("\n",1)[0],this.options.pedantic?(o=2,h=c.trimLeft()):(o=e[2].search(/[^ ]/),o=o>4?1:o,h=c.slice(o),o+=e[1].length),a=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",t=t.substring(u.length+1),d=!0),!d){const e=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),i=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;t&&(f=t.split("\n",1)[0],u=f,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!r.test(u))&&!s.test(u)&&!e.test(u)&&!i.test(t);){if(u.search(/[^ ]/)>=o||!u.trim())h+="\n"+u.slice(o);else{if(a)break;if(c.search(/[^ ]/)>=4)break;if(r.test(c))break;if(s.test(c))break;if(i.test(c))break;h+="\n"+u}a||u.trim()||(a=!0),n+=f+"\n",t=t.substring(f.length+1),c=u.slice(o)}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(r="[ ] "!==i[0],h=h.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:n,task:!!i,checked:r,loose:!1,text:h}),m.raw+=n}m.items[m.items.length-1].raw=n.trimRight(),m.items[m.items.length-1].text=h.trimRight(),m.raw=m.raw.trimRight();const v=m.items.length;for(s=0;s"space"===t.type)),e=t.length>0&&t.some((t=>/\n.*\n/.test(t.raw)));m.loose=e}if(m.loose)for(s=0;s$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(e){const t={type:"table",header:kc(e[1]).map((t=>({text:t}))),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){t.raw=e[0];let n,i,r,o,s=t.align.length;for(n=0;n({text:t})));for(s=t.header.length,i=0;i/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):uc(e[0]):e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^$/.test(t))return;const e=$c(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;const n=t.length;let i=0,r=0;for(;r-1){const n=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,n).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);t&&(n=t[1],i=t[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),/^$/.test(t)?n.slice(1):n.slice(1,-1)),Ec(e,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:i?i.replace(this.rules.inline._escapes,"$1"):i},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let t=(n[2]||n[1]).replace(/\s+/g," ");if(t=e[t.toLowerCase()],!t){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return Ec(n,t,n[0],this.lexer)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i)return;if(i[3]&&n.match(/[\p{L}\p{N}]/u))return;const r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){const n=i[0].length-1;let r,o,s=n,a=0;const l="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);null!=(i=l.exec(e));){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(o=r.length,i[3]||i[4]){s+=o;continue}if((i[5]||i[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const e=t.slice(0,n+i.index+(i[0].length-r.length)+o);if(Math.min(n,o)%2){const t=e.slice(1,-1);return{type:"em",raw:e,text:t,tokens:this.lexer.inlineTokens(t)}}const l=e.slice(2,-2);return{type:"strong",raw:e,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const n=/[^ ]/.test(t),i=/^ /.test(t)&&/ $/.test(t);return n&&i&&(t=t.substring(1,t.length-1)),t=uc(t,!0),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t,e){const n=this.rules.inline.autolink.exec(t);if(n){let t,i;return"@"===n[2]?(t=uc(this.options.mangle?e(n[1]):n[1]),i="mailto:"+t):(t=uc(n[1]),i=t),{type:"link",raw:n[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(t,e){let n;if(n=this.rules.inline.url.exec(t)){let t,i;if("@"===n[2])t=uc(this.options.mangle?e(n[0]):n[0]),i="mailto:"+t;else{let e;do{e=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(e!==n[0]);t=uc(n[0]),i="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t,e){const n=this.rules.inline.text.exec(t);if(n){let t;return t=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):uc(n[0]):n[0]:uc(this.options.smartypants?e(n[0]):n[0]),{type:"text",raw:n[0],text:t}}}}const Mc={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:wc,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Mc.def=pc(Mc.def).replace("label",Mc._label).replace("title",Mc._title).getRegex(),Mc.bullet=/(?:[*+-]|\d{1,9}[.)])/,Mc.listItemStart=pc(/^( *)(bull) */).replace("bull",Mc.bullet).getRegex(),Mc.list=pc(Mc.list).replace(/bull/g,Mc.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Mc.def.source+")").getRegex(),Mc._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Mc._comment=/|$)/,Mc.html=pc(Mc.html,"i").replace("comment",Mc._comment).replace("tag",Mc._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mc.paragraph=pc(Mc._paragraph).replace("hr",Mc.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mc._tag).getRegex(),Mc.blockquote=pc(Mc.blockquote).replace("paragraph",Mc.paragraph).getRegex(),Mc.normal={...Mc},Mc.gfm={...Mc.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Mc.gfm.table=pc(Mc.gfm.table).replace("hr",Mc.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mc._tag).getRegex(),Mc.gfm.paragraph=pc(Mc._paragraph).replace("hr",Mc.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Mc.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mc._tag).getRegex(),Mc.pedantic={...Mc.normal,html:pc("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Mc._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pc(Mc.normal._paragraph).replace("hr",Mc.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Mc.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Dc={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:wc,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:wc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}Dc._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Dc.punctuation=pc(Dc.punctuation).replace(/punctuation/g,Dc._punctuation).getRegex(),Dc.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Dc.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Dc._comment=pc(Mc._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Dc.emStrong.lDelim=pc(Dc.emStrong.lDelim).replace(/punct/g,Dc._punctuation).getRegex(),Dc.emStrong.rDelimAst=pc(Dc.emStrong.rDelimAst,"g").replace(/punct/g,Dc._punctuation).getRegex(),Dc.emStrong.rDelimUnd=pc(Dc.emStrong.rDelimUnd,"g").replace(/punct/g,Dc._punctuation).getRegex(),Dc._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Dc._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Dc._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Dc.autolink=pc(Dc.autolink).replace("scheme",Dc._scheme).replace("email",Dc._email).getRegex(),Dc._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Dc.tag=pc(Dc.tag).replace("comment",Dc._comment).replace("attribute",Dc._attribute).getRegex(),Dc._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Dc._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Dc._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Dc.link=pc(Dc.link).replace("label",Dc._label).replace("href",Dc._href).replace("title",Dc._title).getRegex(),Dc.reflink=pc(Dc.reflink).replace("label",Dc._label).replace("ref",Mc._label).getRegex(),Dc.nolink=pc(Dc.nolink).replace("ref",Mc._label).getRegex(),Dc.reflinkSearch=pc(Dc.reflinkSearch,"g").replace("reflink",Dc.reflink).replace("nolink",Dc.nolink).getRegex(),Dc.normal={...Dc},Dc.pedantic={...Dc.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:pc(/^!?\[(label)\]\((.*?)\)/).replace("label",Dc._label).getRegex(),reflink:pc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dc._label).getRegex()},Dc.gfm={...Dc.normal,escape:pc(Dc.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\e+" ".repeat(n.length)));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>!!(n=i.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0)))))if(n=this.tokenizer.space(t))t=t.substring(n.raw.length),1===n.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(n);else if(n=this.tokenizer.code(t))t=t.substring(n.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?e.push(n):(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.fences(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.heading(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.hr(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.blockquote(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.list(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.html(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.def(t))t=t.substring(n.raw.length),i=e[e.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(n=this.tokenizer.table(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.lheading(t))t=t.substring(n.raw.length),e.push(n);else{if(r=t,this.options.extensions&&this.options.extensions.startBlock){let e=1/0;const n=t.slice(1);let i;this.options.extensions.startBlock.forEach((function(t){i=t.call({lexer:this},n),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(r=t.substring(0,e+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))i=e[e.length-1],o&&"paragraph"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n),o=r.length!==t.length,t=t.substring(n.raw.length);else if(n=this.tokenizer.text(t))t=t.substring(n.raw.length),i=e[e.length-1],i&&"text"===i.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):e.push(n);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n,i,r,o,s,a,l=t;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)t.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+Cc("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+Cc("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index+o[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>!!(n=i.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0)))))if(n=this.tokenizer.escape(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.tag(t))t=t.substring(n.raw.length),i=e[e.length-1],i&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):e.push(n);else if(n=this.tokenizer.link(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(n.raw.length),i=e[e.length-1],i&&"text"===n.type&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):e.push(n);else if(n=this.tokenizer.emStrong(t,l,a))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.codespan(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.br(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.del(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.autolink(t,Fc))t=t.substring(n.raw.length),e.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(t,Fc))){if(r=t,this.options.extensions&&this.options.extensions.startInline){let e=1/0;const n=t.slice(1);let i;this.options.extensions.startInline.forEach((function(t){i=t.call({lexer:this},n),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(r=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(r,Ac))t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,i=e[e.length-1],i&&"text"===i.type?(i.raw+=n.raw,i.text+=n.text):e.push(n);else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}else t=t.substring(n.raw.length),e.push(n);return e}}class Tc{constructor(t){this.options=t||ic}code(t,e,n){const i=(e||"").match(/\S*/)[0];if(this.options.highlight){const e=this.options.highlight(t,i);null!=e&&e!==t&&(n=!0,t=e)}return t=t.replace(/\n$/,"")+"\n",i?'
'+(n?t:uc(t,!0))+"
\n":"
"+(n?t:uc(t,!0))+"
\n"}blockquote(t){return`
\n${t}
\n`}html(t){return t}heading(t,e,n,i){if(this.options.headerIds){return`${t}\n`}return`${t}\n`}hr(){return this.options.xhtml?"
\n":"
\n"}list(t,e,n){const i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"}listitem(t){return`
  • ${t}
  • \n`}checkbox(t){return" "}paragraph(t){return`

    ${t}

    \n`}table(t,e){return e&&(e=`${e}`),"\n\n"+t+"\n"+e+"
    \n"}tablerow(t){return`\n${t}\n`}tablecell(t,e){const n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,e,n){if(null===(t=yc(this.options.sanitize,this.options.baseUrl,t)))return n;let i='",i}image(t,e,n){if(null===(t=yc(this.options.sanitize,this.options.baseUrl,t)))return n;let i=`${n}":">",i}text(t){return t}}class Nc{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,n){return""+n}image(t,e,n){return""+n}br(){return""}}class zc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,e){let n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{i++,n=t+"-"+i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n}slug(t,e={}){const n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)}}class Lc{constructor(t){this.options=t||ic,this.options.renderer=this.options.renderer||new Tc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Nc,this.slugger=new zc}static parse(t,e){return new Lc(e).parse(t)}static parseInline(t,e){return new Lc(e).parseInline(t)}parse(t,e=!0){let n,i,r,o,s,a,l,c,u,f,h,d,p,g,m,y,v,b,x,_="";const w=t.length;for(n=0;n0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=b+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=b+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:b}):g+=b),g+=this.parse(m.tokens,p),u+=this.renderer.listitem(g,v,y);_+=this.renderer.list(u,h,d);continue;case"html":_+=this.renderer.html(f.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1{"function"==typeof i&&(r=i,i=null);const o={...i},s=function(t,e,n){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="

    An error occurred:

    "+uc(i.message+"",!0)+"
    ";return e?Promise.resolve(t):n?void n(null,t):t}if(e)return Promise.reject(i);if(!n)throw i;n(i)}}((i={...Ic.defaults,...o}).silent,i.async,r);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(i),i.hooks&&(i.hooks.options=i),r){const o=i.highlight;let a;try{i.hooks&&(n=i.hooks.preprocess(n)),a=t(n,i)}catch(t){return s(t)}const l=function(t){let n;if(!t)try{i.walkTokens&&Ic.walkTokens(a,i.walkTokens),n=e(a,i),i.hooks&&(n=i.hooks.postprocess(n))}catch(e){t=e}return i.highlight=o,t?s(t):r(null,n)};if(!o||o.length<3)return l();if(delete i.highlight,!a.length)return l();let c=0;return Ic.walkTokens(a,(function(t){"code"===t.type&&(c++,setTimeout((()=>{o(t.text,t.lang,(function(e,n){if(e)return l(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((e=>t(e,i))).then((t=>i.walkTokens?Promise.all(Ic.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>e(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(s);try{i.hooks&&(n=i.hooks.preprocess(n));const r=t(n,i);i.walkTokens&&Ic.walkTokens(r,i.walkTokens);let o=e(r,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(t){return s(t)}}}function Ic(t,e,n){return Pc(Oc.lex,Lc.parse)(t,e,n)}Ic.options=Ic.setOptions=function(t){var e;return Ic.defaults={...Ic.defaults,...t},e=Ic.defaults,ic=e,Ic},Ic.getDefaults=nc,Ic.defaults=ic,Ic.use=function(...t){const e=Ic.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const n={...t};if(n.async=Ic.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if(t.renderer){const n=e.renderers[t.name];e.renderers[t.name]=n?function(...e){let i=t.renderer.apply(this,e);return!1===i&&(i=n.apply(this,e)),i}:t.renderer}if(t.tokenizer){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");e[t.level]?e[t.level].unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=Ic.defaults.renderer||new Tc;for(const n in t.renderer){const i=e[n];e[n]=(...r)=>{let o=t.renderer[n].apply(e,r);return!1===o&&(o=i.apply(e,r)),o}}n.renderer=e}if(t.tokenizer){const e=Ic.defaults.tokenizer||new Sc;for(const n in t.tokenizer){const i=e[n];e[n]=(...r)=>{let o=t.tokenizer[n].apply(e,r);return!1===o&&(o=i.apply(e,r)),o}}n.tokenizer=e}if(t.hooks){const e=Ic.defaults.hooks||new Rc;for(const n in t.hooks){const i=e[n];Rc.passThroughHooks.has(n)?e[n]=r=>{if(Ic.defaults.async)return Promise.resolve(t.hooks[n].call(e,r)).then((t=>i.call(e,t)));const o=t.hooks[n].call(e,r);return i.call(e,o)}:e[n]=(...r)=>{let o=t.hooks[n].apply(e,r);return!1===o&&(o=i.apply(e,r)),o}}n.hooks=e}if(t.walkTokens){const e=Ic.defaults.walkTokens;n.walkTokens=function(n){let i=[];return i.push(t.walkTokens.call(this,n)),e&&(i=i.concat(e.call(this,n))),i}}Ic.setOptions(n)}))},Ic.walkTokens=function(t,e){let n=[];for(const i of t)switch(n=n.concat(e.call(Ic,i)),i.type){case"table":for(const t of i.header)n=n.concat(Ic.walkTokens(t.tokens,e));for(const t of i.rows)for(const i of t)n=n.concat(Ic.walkTokens(i.tokens,e));break;case"list":n=n.concat(Ic.walkTokens(i.items,e));break;default:Ic.defaults.extensions&&Ic.defaults.extensions.childTokens&&Ic.defaults.extensions.childTokens[i.type]?Ic.defaults.extensions.childTokens[i.type].forEach((function(t){n=n.concat(Ic.walkTokens(i[t],e))})):i.tokens&&(n=n.concat(Ic.walkTokens(i.tokens,e)))}return n},Ic.parseInline=Pc(Oc.lexInline,Lc.parseInline),Ic.Parser=Lc,Ic.parser=Lc.parse,Ic.Renderer=Tc,Ic.TextRenderer=Nc,Ic.Lexer=Oc,Ic.lexer=Oc.lex,Ic.Tokenizer=Sc,Ic.Slugger=zc,Ic.Hooks=Rc,Ic.parse=Ic,Ic.options,Ic.setOptions,Ic.use,Ic.walkTokens,Ic.parseInline,Lc.parse,Oc.lex;const Bc={};function jc(e){let n;return{c(){n=$(e[1])},m(t,e){b(t,n,e)},p(t,e){2&e&&A(n,t[1])},i:t,o:t,d(t){t&&x(n)}}}function Uc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h6"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function qc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h5"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Wc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h4"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Hc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h3"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Vc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h2"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Yc(t){let e,n;const i=t[5].default,r=u(i,t,t[4],null);return{c(){e=w("h1"),r&&r.c(),M(e,"id",t[2])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||16&o)&&d(r,i,t,t[4],n?h(i,t[4],o,null):p(t[4]),null),(!n||4&o)&&M(e,"id",t[2])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Gc(t){let e,n,i,r;const o=[Yc,Vc,Hc,Wc,qc,Uc,jc],s=[];function a(t,e){return 1===t[0]?0:2===t[0]?1:3===t[0]?2:4===t[0]?3:5===t[0]?4:6===t[0]?5:6}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,[r]){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Xc(t,e,n){let i,{$$slots:r={},$$scope:o}=e,{depth:s}=e,{raw:a}=e,{text:l}=e;const{slug:c,getOptions:u}=U(Bc),f=u();return t.$$set=t=>{"depth"in t&&n(0,s=t.depth),"raw"in t&&n(1,a=t.raw),"text"in t&&n(3,l=t.text),"$$scope"in t&&n(4,o=t.$$scope)},t.$$.update=()=>{8&t.$$.dirty&&n(2,i=f.headerIds?f.headerPrefix+c(l):void 0)},[s,a,i,l,o,r]}function Zc(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("p"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Jc(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function Qc(t){let e;const n=t[3].default,i=u(n,t,t[2],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,[r]){i&&i.p&&(!e||4&r)&&d(i,n,t,t[2],e?h(n,t[2],r,null):p(t[2]),null)},i(t){e||(st(i,t),e=!0)},o(t){at(i,t),e=!1},d(t){i&&i.d(t)}}}function Kc(t,e,n){let{$$slots:i={},$$scope:r}=e,{text:o}=e,{raw:s}=e;return t.$$set=t=>{"text"in t&&n(0,o=t.text),"raw"in t&&n(1,s=t.raw),"$$scope"in t&&n(2,r=t.$$scope)},[o,s,r,i]}function tu(e){let n,i;return{c(){n=w("img"),l(n.src,i=e[0])||M(n,"src",i),M(n,"title",e[1]),M(n,"alt",e[2])},m(t,e){b(t,n,e)},p(t,[e]){1&e&&!l(n.src,i=t[0])&&M(n,"src",i),2&e&&M(n,"title",t[1]),4&e&&M(n,"alt",t[2])},i:t,o:t,d(t){t&&x(n)}}}function eu(t,e,n){let{href:i=""}=e,{title:r}=e,{text:o=""}=e;return t.$$set=t=>{"href"in t&&n(0,i=t.href),"title"in t&&n(1,r=t.title),"text"in t&&n(2,o=t.text)},[i,r,o]}function nu(t){let e,n;const i=t[3].default,r=u(i,t,t[2],null);return{c(){e=w("a"),r&&r.c(),M(e,"href",t[0]),M(e,"title",t[1])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[o]){r&&r.p&&(!n||4&o)&&d(r,i,t,t[2],n?h(i,t[2],o,null):p(t[2]),null),(!n||1&o)&&M(e,"href",t[0]),(!n||2&o)&&M(e,"title",t[1])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function iu(t,e,n){let{$$slots:i={},$$scope:r}=e,{href:o=""}=e,{title:s}=e;return t.$$set=t=>{"href"in t&&n(0,o=t.href),"title"in t&&n(1,s=t.title),"$$scope"in t&&n(2,r=t.$$scope)},[o,s,r,i]}function ru(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("em"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function ou(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function su(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("del"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function au(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function lu(e){let n,i,r=e[0].replace(/`/g,"")+"";return{c(){n=w("code"),i=$(r)},m(t,e){b(t,n,e),v(n,i)},p(t,[e]){1&e&&r!==(r=t[0].replace(/`/g,"")+"")&&A(i,r)},i:t,o:t,d(t){t&&x(n)}}}function cu(t,e,n){let{raw:i}=e;return t.$$set=t=>{"raw"in t&&n(0,i=t.raw)},[i]}function uu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("strong"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function fu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function hu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("table"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function du(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function pu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("thead"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function gu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function mu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("tbody"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function yu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function vu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("tr"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function bu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function xu(t){let e,n;const i=t[3].default,r=u(i,t,t[2],null);return{c(){e=w("td"),r&&r.c(),M(e,"align",t[1])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||4&o)&&d(r,i,t,t[2],n?h(i,t[2],o,null):p(t[2]),null),(!n||2&o)&&M(e,"align",t[1])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function _u(t){let e,n;const i=t[3].default,r=u(i,t,t[2],null);return{c(){e=w("th"),r&&r.c(),M(e,"align",t[1])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||4&o)&&d(r,i,t,t[2],n?h(i,t[2],o,null):p(t[2]),null),(!n||2&o)&&M(e,"align",t[1])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function wu(t){let e,n,i,r;const o=[_u,xu],s=[];function a(t,e){return t[0]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,[r]){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function ku(t,e,n){let{$$slots:i={},$$scope:r}=e,{header:o}=e,{align:s}=e;return t.$$set=t=>{"header"in t&&n(0,o=t.header),"align"in t&&n(1,s=t.align),"$$scope"in t&&n(2,r=t.$$scope)},[o,s,r,i]}function $u(t){let e,n;const i=t[3].default,r=u(i,t,t[2],null);return{c(){e=w("ul"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,e){r&&r.p&&(!n||4&e)&&d(r,i,t,t[2],n?h(i,t[2],e,null):p(t[2]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Cu(t){let e,n;const i=t[3].default,r=u(i,t,t[2],null);return{c(){e=w("ol"),r&&r.c(),M(e,"start",t[1])},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,o){r&&r.p&&(!n||4&o)&&d(r,i,t,t[2],n?h(i,t[2],o,null):p(t[2]),null),(!n||2&o)&&M(e,"start",t[1])},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Eu(t){let e,n,i,r;const o=[Cu,$u],s=[];function a(t,e){return t[0]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,[r]){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Su(t,e,n){let{$$slots:i={},$$scope:r}=e,{ordered:o}=e,{start:s}=e;return t.$$set=t=>{"ordered"in t&&n(0,o=t.ordered),"start"in t&&n(1,s=t.start),"$$scope"in t&&n(2,r=t.$$scope)},[o,s,r,i]}function Mu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("li"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Du(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function Au(e){let n;return{c(){n=w("hr")},m(t,e){b(t,n,e)},p:t,i:t,o:t,d(t){t&&x(n)}}}function Fu(e){let n,i;return{c(){n=new T(!1),i=E(),n.a=i},m(t,r){n.m(e[0],t,r),b(t,i,r)},p(t,[e]){1&e&&n.p(t[0])},i:t,o:t,d(t){t&&x(i),t&&n.d()}}}function Ou(t,e,n){let{text:i}=e;return t.$$set=t=>{"text"in t&&n(0,i=t.text)},[i]}function Tu(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("blockquote"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(e,null),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Nu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}function zu(e){let n,i,r;return{c(){n=w("pre"),i=w("code"),r=$(e[1]),M(n,"class",e[0])},m(t,e){b(t,n,e),v(n,i),v(i,r)},p(t,[e]){2&e&&A(r,t[1]),1&e&&M(n,"class",t[0])},i:t,o:t,d(t){t&&x(n)}}}function Lu(t,e,n){let{lang:i}=e,{text:r}=e;return t.$$set=t=>{"lang"in t&&n(0,i=t.lang),"text"in t&&n(1,r=t.text)},[i,r]}function Ru(t){let e,n;const i=t[1].default,r=u(i,t,t[0],null);return{c(){e=w("br"),r&&r.c()},m(t,i){b(t,e,i),r&&r.m(t,i),n=!0},p(t,[e]){r&&r.p&&(!n||1&e)&&d(r,i,t,t[0],n?h(i,t[0],e,null):p(t[0]),null)},i(t){n||(st(r,t),n=!0)},o(t){at(r,t),n=!1},d(t){t&&x(e),r&&r.d(t)}}}function Pu(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}const Iu={heading:class extends mt{constructor(t){super(),gt(this,t,Xc,Gc,s,{depth:0,raw:1,text:3})}},paragraph:class extends mt{constructor(t){super(),gt(this,t,Jc,Zc,s,{})}},text:class extends mt{constructor(t){super(),gt(this,t,Kc,Qc,s,{text:0,raw:1})}},image:class extends mt{constructor(t){super(),gt(this,t,eu,tu,s,{href:0,title:1,text:2})}},link:class extends mt{constructor(t){super(),gt(this,t,iu,nu,s,{href:0,title:1})}},em:class extends mt{constructor(t){super(),gt(this,t,ou,ru,s,{})}},strong:class extends mt{constructor(t){super(),gt(this,t,fu,uu,s,{})}},codespan:class extends mt{constructor(t){super(),gt(this,t,cu,lu,s,{raw:0})}},del:class extends mt{constructor(t){super(),gt(this,t,au,su,s,{})}},table:class extends mt{constructor(t){super(),gt(this,t,du,hu,s,{})}},tablehead:class extends mt{constructor(t){super(),gt(this,t,gu,pu,s,{})}},tablebody:class extends mt{constructor(t){super(),gt(this,t,yu,mu,s,{})}},tablerow:class extends mt{constructor(t){super(),gt(this,t,bu,vu,s,{})}},tablecell:class extends mt{constructor(t){super(),gt(this,t,ku,wu,s,{header:0,align:1})}},list:class extends mt{constructor(t){super(),gt(this,t,Su,Eu,s,{ordered:0,start:1})}},orderedlistitem:null,unorderedlistitem:null,listitem:class extends mt{constructor(t){super(),gt(this,t,Du,Mu,s,{})}},hr:class extends mt{constructor(t){super(),gt(this,t,null,Au,s,{})}},html:class extends mt{constructor(t){super(),gt(this,t,Ou,Fu,s,{text:0})}},blockquote:class extends mt{constructor(t){super(),gt(this,t,Nu,Tu,s,{})}},code:class extends mt{constructor(t){super(),gt(this,t,Lu,zu,s,{lang:0,text:1})}},br:class extends mt{constructor(t){super(),gt(this,t,Pu,Ru,s,{})}}},Bu={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function ju(t){let e,n;return e=new ec({props:{tokens:t[0],renderers:t[1]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,[n]){const i={};1&n&&(i.tokens=t[0]),2&n&&(i.renderers=t[1]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Uu(t,e,n){let i,r,o,s,{source:a=[]}=e,{renderers:l={}}=e,{options:c={}}=e,{isInline:u=!1}=e;const f=B();let h,d,p;return j(Bc,{slug:t=>r?r.slug(t):"",getOptions:()=>o}),P((()=>{n(7,p=!0)})),t.$$set=t=>{"source"in t&&n(2,a=t.source),"renderers"in t&&n(3,l=t.renderers),"options"in t&&n(4,c=t.options),"isInline"in t&&n(5,u=t.isInline)},t.$$.update=()=>{4&t.$$.dirty&&n(8,i=Array.isArray(a)),4&t.$$.dirty&&(r=a?new zc:void 0),16&t.$$.dirty&&n(9,o={...Bu,...c}),869&t.$$.dirty&&(i?n(0,h=a):(n(6,d=new Oc(o)),n(0,h=u?d.inlineTokens(a):d.lex(a)),f("parsed",{tokens:h}))),8&t.$$.dirty&&n(1,s={...Iu,...l}),385&t.$$.dirty&&p&&!i&&f("parsed",{tokens:h})},[h,s,a,l,c,u,d,p,i,o]}class qu extends mt{constructor(t){super(),gt(this,t,Uu,ju,s,{source:2,renderers:3,options:4,isInline:5})}}function Wu(t){let e,n;return e=new qu({props:{source:t[0].source}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,[n]){const i={};1&n&&(i.source=t[0].source),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Hu(t,e,n){let{componentData:i}=e;return t.$$set=t=>{"componentData"in t&&n(0,i=t.componentData)},[i]}class Vu extends mt{constructor(t){super(),gt(this,t,Hu,Wu,s,{componentData:0})}}function Yu(t){let e,n,i;const r=t[2].default,o=u(r,t,t[1],null);return{c(){e=w("div"),o&&o.c(),M(e,"id",n=`page-${t[0]?.title||"No Title"}`),M(e,"class","page svelte-v7ihqd"),M(e,"data-component","page")},m(t,n){b(t,e,n),o&&o.m(e,null),i=!0},p(t,[s]){o&&o.p&&(!i||2&s)&&d(o,r,t,t[1],i?h(r,t[1],s,null):p(t[1]),null),(!i||1&s&&n!==(n=`page-${t[0]?.title||"No Title"}`))&&M(e,"id",n)},i(t){i||(st(o,t),i=!0)},o(t){at(o,t),i=!1},d(t){t&&x(e),o&&o.d(t)}}}function Gu(t,e,n){let{$$slots:i={},$$scope:r}=e,{componentData:o}=e;return t.$$set=t=>{"componentData"in t&&n(0,o=t.componentData),"$$scope"in t&&n(1,r=t.$$scope)},[o,r,i]}class Xu extends mt{constructor(t){super(),gt(this,t,Gu,Yu,s,{componentData:0})}}function Zu(t){let e,n,i=t[5]&&Ju(t),r=t[4]&&Qu(t);return{c(){e=w("div"),i&&i.c(),n=C(),r&&r.c(),M(e,"class","info svelte-5d173i")},m(t,o){b(t,e,o),i&&i.m(e,null),v(e,n),r&&r.m(e,null)},p(t,o){t[5]?i?i.p(t,o):(i=Ju(t),i.c(),i.m(e,n)):i&&(i.d(1),i=null),t[4]?r?r.p(t,o):(r=Qu(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},d(t){t&&x(e),i&&i.d(),r&&r.d()}}}function Ju(t){let e,n,i,r,o;return{c(){e=w("label"),n=$(t[5]),i=C(),r=w("span"),o=$(t[3]),M(r,"class","labelValue svelte-5d173i"),M(e,"for",t[6]),M(e,"class","svelte-5d173i")},m(t,s){b(t,e,s),v(e,n),v(e,i),v(e,r),v(r,o)},p(t,i){32&i&&A(n,t[5]),8&i&&A(o,t[3]),64&i&&M(e,"for",t[6])},d(t){t&&x(e)}}}function Qu(t){let e,n;return{c(){e=w("span"),n=$(t[4]),M(e,"title",t[4]),M(e,"class","details svelte-5d173i")},m(t,i){b(t,e,i),v(e,n)},p(t,i){16&i&&A(n,t[4]),16&i&&M(e,"title",t[4])},d(t){t&&x(e)}}}function Ku(e){let n,i,r,o,s,a,l=(e[0]||"")+"",c=(e[5]||e[4])&&Zu(e);return{c(){n=w("div"),i=w("div"),c&&c.c(),r=C(),o=w("progress"),s=$(e[1]),a=$(l),M(o,"id",e[6]),M(o,"max",e[2]),o.value=e[1],M(o,"style","color: red !important"),M(o,"class","svelte-5d173i"),M(i,"class","inner svelte-5d173i"),M(n,"class","container svelte-5d173i")},m(t,e){b(t,n,e),v(n,i),c&&c.m(i,null),v(i,r),v(i,o),v(o,s),v(o,a)},p(t,[e]){t[5]||t[4]?c?c.p(t,e):(c=Zu(t),c.c(),c.m(i,r)):c&&(c.d(1),c=null),2&e&&A(s,t[1]),1&e&&l!==(l=(t[0]||"")+"")&&A(a,l),64&e&&M(o,"id",t[6]),4&e&&M(o,"max",t[2]),2&e&&(o.value=t[1])},i:t,o:t,d(t){t&&x(n),c&&c.d()}}}function tf(t,e,n){let i,r,o,s,a,l,{componentData:c}=e;null==o&&(o=0);let u=o.toString();return t.$$set=t=>{"componentData"in t&&n(7,c=t.componentData)},t.$$.update=()=>{128&t.$$.dirty&&n(2,({max:i,id:r,value:o,label:s,unit:a,details:l}=c),i,(n(6,r),n(7,c)),(n(1,o),n(7,c)),(n(5,s),n(7,c)),(n(0,a),n(7,c)),(n(4,l),n(7,c))),7&t.$$.dirty&&(i?n(3,u=`${o}/${i}`):a&&n(3,u=`${o} ${a}`))},[a,o,i,u,l,s,r,c]}class ef extends mt{constructor(t){super(),gt(this,t,tf,Ku,s,{componentData:7})}}function nf(t){let e,n;return{c(){e=w("h3"),n=$(t[3])},m(t,i){b(t,e,i),v(e,n)},p(t,e){8&e&&A(n,t[3])},d(t){t&&x(e)}}}function rf(t){let e,n;return{c(){e=w("p"),n=$(t[2]),M(e,"class","description")},m(t,i){b(t,e,i),v(e,n)},p(t,e){4&e&&A(n,t[2])},d(t){t&&x(e)}}}function of(t){let e,n,i,r,o,s,a,l,c=t[3]&&nf(t),f=t[2]&&rf(t);const g=t[6].default,m=u(g,t,t[5],null);return{c(){e=w("section"),n=w("div"),c&&c.c(),i=C(),f&&f.c(),r=C(),o=w("div"),m&&m.c(),s=C(),a=w("hr"),M(n,"class","heading svelte-17n0qr8"),M(o,"class","sectionItems svelte-17n0qr8"),M(o,"style",t[0]),M(a,"class","svelte-17n0qr8"),M(e,"class","container svelte-17n0qr8"),M(e,"data-component","section"),M(e,"data-section-id",t[3]),O(e,"columns",t[1])},m(t,u){b(t,e,u),v(e,n),c&&c.m(n,null),v(n,i),f&&f.m(n,null),v(e,r),v(e,o),m&&m.m(o,null),v(e,s),v(e,a),l=!0},p(t,[r]){t[3]?c?c.p(t,r):(c=nf(t),c.c(),c.m(n,i)):c&&(c.d(1),c=null),t[2]?f?f.p(t,r):(f=rf(t),f.c(),f.m(n,null)):f&&(f.d(1),f=null),m&&m.p&&(!l||32&r)&&d(m,g,t,t[5],l?h(g,t[5],r,null):p(t[5]),null),(!l||1&r)&&M(o,"style",t[0]),(!l||8&r)&&M(e,"data-section-id",t[3]),(!l||2&r)&&O(e,"columns",t[1])},i(t){l||(st(m,t),l=!0)},o(t){at(m,t),l=!1},d(t){t&&x(e),c&&c.d(),f&&f.d(),m&&m.d(t)}}}function sf(t,e,n){let i,r,o,s,{$$slots:a={},$$scope:l}=e,{componentData:c}=e;return o&&(s=`grid-template-columns: repeat(${o||1}, 1fr);`),t.$$set=t=>{"componentData"in t&&n(4,c=t.componentData),"$$scope"in t&&n(5,l=t.$$scope)},t.$$.update=()=>{16&t.$$.dirty&&n(3,({title:i,subtitle:r,columns:o}=c),i,(n(2,r),n(4,c)),(n(1,o),n(4,c)))},[s,o,r,i,c,l,a]}class af extends mt{constructor(t){super(),gt(this,t,sf,of,s,{componentData:4})}} +var app=function(){"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function r(){return Object.create(null)}function i(e){e.forEach(n)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let s;function l(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function u(t,n,r){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function c(e,t,n,r){if(e){const i=f(e,t,n,r);return e[0](i)}}function f(e,n,r,i){return e[1]&&i?t(r.ctx.slice(),e[1](i(n))):r.ctx}function d(e,t,n,r){if(e[2]&&r){const i=e[2](r(n));if(void 0===t.dirty)return i;if("object"==typeof i){const e=[],n=Math.max(t.dirty.length,i.length);for(let r=0;r32){const t=[],n=e.ctx.length/32;for(let e=0;ee.removeEventListener(t,n,r)}function D(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function S(e,t){for(const n in t)D(e,n,t[n])}function M(e,t){t=""+t,e.data!==t&&(e.data=t)}function F(e,t,n,r){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function O(e,t,n){e.classList[n?"add":"remove"](t)}class N{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=$(t.nodeName):this.e=_(11===t.nodeType?"TEMPLATE":t.nodeName),this.t="TEMPLATE"!==t.tagName?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from("TEMPLATE"===this.e.nodeName?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t{const i=e.$$.callbacks[t];if(i){const o=function(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}(t,n,{cancelable:r});return i.slice().forEach((t=>{t.call(e,o)})),!o.defaultPrevented}return!0}}function I(e,t){return L().$$.context.set(e,t),t}function U(e){return L().$$.context.get(e)}function q(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const W=[],H=[];let G=[];const V=[],Y=Promise.resolve();let X=!1;function J(e){G.push(e)}function Z(e){V.push(e)}const Q=new Set;let K=0;function ee(){if(0!==K)return;const e=z;do{try{for(;K{ne.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}else r&&r()}function le(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const a=e[o],s=t[o];if(s){for(const e in a)e in s||(r[e]=1);for(const e in s)i[e]||(n[e]=s[e],i[e]=1);e[o]=s}else for(const e in a)i[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}function ue(e){return"object"==typeof e&&null!==e?e:{}}function ce(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function fe(e){e&&e.c()}function de(e,t,r,a){const{fragment:s,after_update:l}=e.$$;s&&s.m(t,r),a||J((()=>{const t=e.$$.on_mount.map(n).filter(o);e.$$.on_destroy?e.$$.on_destroy.push(...t):i(t),e.$$.on_mount=[]})),l.forEach(J)}function he(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];G.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),G=t}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function pe(e,t){-1===e.$$.dirty[0]&&(W.push(e),X||(X=!0,Y.then(ee)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const i=r.length?r[0]:n;return d.ctx&&s(d.ctx[e],d.ctx[e]=i)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](i),h&&pe(t,e)),n})):[],d.update(),h=!0,i(d.before_update),d.fragment=!!a&&a(d.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);d.fragment&&d.fragment.l(e),e.forEach(x)}else d.fragment&&d.fragment.c();n.intro&&ae(t.$$.fragment),de(t,n.target,n.anchor,n.customElement),ee()}R(f)}class ge{$destroy(){he(this,1),this.$destroy=e}$on(t,n){if(!o(n))return e;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const e=r.indexOf(n);-1!==e&&r.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=f.reach);$+=_.value.length,_=_.next){var k=_.value;if(n.length>t.length)return;if(!(k instanceof o)){var C,E=1;if(v){if(!(C=a(w,$,t,y))||C.index>=t.length)break;var A=C.index,D=C.index+C[0].length,S=$;for(S+=_.value.length;S<=A;)S+=(_=_.next).value.length;if($=S-=_.value.length,_.value instanceof o)continue;for(var M=_;M!==n.tail&&(Sf.reach&&(f.reach=T);var z=_.prev;if(O&&(z=l(n,z,O),$+=O.length),u(n,z,E),_=l(n,z,new o(d,g?i.tokenize(F,g):F,b,F)),N&&l(n,_,N),1f.reach&&(f.reach=R.reach)}}}}}}(e,c,t,c.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(c)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:o};function o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i"+o.content+""},!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.code,a=n.immediateClose;e.postMessage(i.highlight(o,i.languages[r],r)),a&&e.close()}),!1)),i;var c=i.util.currentScript();function f(){i.manual||i.highlightAll()}if(c&&(i.filename=c.src,c.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var d=document.readyState;"loading"===d||"interactive"===d&&c&&c.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=t),void 0!==ye&&(ye.Prism=t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:t.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},t.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},t.languages.python["string-interpolation"].inside.interpolation.inside.rest=t.languages.python,t.languages.py=t.languages.python}({exports:{}});const ve=[];function be(t,n=e){let r;const i=new Set;function o(e){if(a(t,e)&&(t=e,r)){const e=!ve.length;for(const e of i)e[1](),ve.push(e,t);if(e){for(let e=0;e{i.delete(l),0===i.size&&r&&(r(),r=null)}}}}const xe=be(void 0);window.metaflow_card_update=e=>(xe.update((t=>{const n=Object.assign({},t);return Object.values(e).forEach((e=>(null==n?void 0:n.components)&&we(n.components,e))),n})),!0);const we=(e,t)=>{const n=e.findIndex((e=>t.id===(null==e?void 0:e.id)));var r,i;n>-1?"vegaChart"==e[n].type?(r=e[n],i=t,r.data&&(r.data=JSON.parse(JSON.stringify(i.data))),JSON.stringify(i.spec)===JSON.stringify(r.spec)&&(r.spec=JSON.parse(JSON.stringify(i.spec)))):Object.assign(e[n],t):e.forEach((e=>{var n;"section"!==e.type&&"page"!==e.type||!(null===(n=null==e?void 0:e.contents)||void 0===n?void 0:n.length)||we(e.contents,t)}))},_e=be(void 0),$e=e=>{const t={};if(!e)return t;function n(e,r=[]){var i;if("page"===e.type){const r=[];t[e.title]=r,null===(i=null==e?void 0:e.contents)||void 0===i||i.forEach((e=>n(e,r)))}"section"===e.type&&e.title&&r.push(e.title)}return null==e||e.forEach((e=>n(e))),t},ke=(e,t)=>e/(t?parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px","")):16);function Ce(e){let t,n,r,i,o,a,s,l;return{c(){t=$("svg"),n=$("title"),r=k("metaflow_logo_horizontal"),i=$("g"),o=$("g"),a=$("g"),s=$("path"),l=$("path"),D(s,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),D(s,"id","Fill-1"),D(s,"fill","#146EE6"),D(l,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),D(l,"id","Fill-2"),D(l,"fill","#333333"),D(a,"id","metaflow_logo_horizontal"),D(a,"transform","translate(92.930727, 93.190000)"),D(o,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),D(o,"transform","translate(-92.000000, -93.000000)"),D(i,"id","Page-1"),D(i,"stroke","none"),D(i,"stroke-width","1"),D(i,"fill","none"),D(i,"fill-rule","evenodd"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),D(t,"width","896px"),D(t,"height","152px"),D(t,"viewBox","0 0 896 152"),D(t,"version","1.1")},m(e,u){b(e,t,u),v(t,n),v(n,r),v(t,i),v(i,o),v(o,a),v(a,s),v(a,l)},d(e){e&&x(t)}}}function Ee(e){let t,n,r;return{c(){t=$("svg"),n=$("path"),r=$("path"),D(n,"fill-rule","evenodd"),D(n,"clip-rule","evenodd"),D(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),D(n,"fill","#146EE6"),D(r,"fill-rule","evenodd"),D(r,"clip-rule","evenodd"),D(r,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),D(r,"fill","white"),D(t,"width","895"),D(t,"height","151"),D(t,"viewBox","0 0 895 151"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg")},m(e,i){b(e,t,i),v(t,n),v(t,r)},d(e){e&&x(t)}}}function Ae(t){let n;function r(e,t){return e[0]?Ee:Ce}let i=r(t),o=i(t);return{c(){o.c(),n=E()},m(e,t){o.m(e,t),b(e,n,t)},p(e,[t]){i!==(i=r(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(n.parentNode,n)))},i:e,o:e,d(e){o.d(e),e&&x(n)}}}function De(e,t,n){let{light:r=!1}=t;return e.$$set=e=>{"light"in e&&n(0,r=e.light)},[r]}class Se extends ge{constructor(e){super(),me(this,e,De,Ae,a,{light:0})}}function Me(e){let t,n,r,i,o,a;i=new Se({});const s=e[1].default,l=c(s,e,e[0],null);return{c(){t=_("aside"),n=_("div"),r=_("div"),fe(i.$$.fragment),o=C(),l&&l.c(),D(r,"class","logoContainer"),D(t,"class","svelte-1okdv0e")},m(e,s){b(e,t,s),v(t,n),v(n,r),de(i,r,null),v(n,o),l&&l.m(n,null),a=!0},p(e,[t]){l&&l.p&&(!a||1&t)&&h(l,s,e,e[0],a?d(s,e[0],t,null):p(e[0]),null)},i(e){a||(ae(i.$$.fragment,e),ae(l,e),a=!0)},o(e){se(i.$$.fragment,e),se(l,e),a=!1},d(e){e&&x(t),he(i),l&&l.d(e)}}}function Fe(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}class Oe extends ge{constructor(e){super(),me(this,e,Fe,Me,a,{})}}function Ne(e){let t,n;return{c(){t=_("td"),n=k(e[0]),D(t,"class","idCell svelte-pt8vzv"),D(t,"data-component","artifact-row")},m(e,r){b(e,t,r),v(t,n)},p(e,t){1&t&&M(n,e[0])},d(e){e&&x(t)}}}function Te(t){let n,r,i,o,a,s,l=t[1].data+"",u=null!==t[0]&&Ne(t);return{c(){n=_("tr"),u&&u.c(),r=C(),i=_("td"),o=_("code"),a=k(l),D(o,"class","mono"),D(i,"class","codeCell svelte-pt8vzv"),D(i,"colspan",s=null===t[0]?2:1),D(i,"data-component","artifact-row")},m(e,s){b(e,n,s),u&&u.m(n,null),v(n,r),v(n,i),v(i,o),v(o,a),t[3](o)},p(e,[t]){null!==e[0]?u?u.p(e,t):(u=Ne(e),u.c(),u.m(n,r)):u&&(u.d(1),u=null),2&t&&l!==(l=e[1].data+"")&&M(a,l),1&t&&s!==(s=null===e[0]?2:1)&&D(i,"colspan",s)},i:e,o:e,d(e){e&&x(n),u&&u.d(),t[3](null)}}}function ze(e,t,n){let r,{id:i}=t,{artifact:o}=t;return e.$$set=e=>{"id"in e&&n(0,i=e.id),"artifact"in e&&n(1,o=e.artifact)},e.$$.update=()=>{4&e.$$.dirty&&r&&function(){var e;r&&!r.classList.contains("language-python")&&"undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.Prism)||void 0===e||e.highlightElement(r))}()},[i,o,r,function(e){H[e?"unshift":"push"]((()=>{r=e,n(2,r)}))}]}class Re extends ge{constructor(e){super(),me(this,e,ze,Te,a,{id:0,artifact:1})}}function Le(e,t,n){const r=e.slice();return r[2]=t[n],r}function Pe(t){let n,r;return n=new Re({props:{id:t[2].name,artifact:t[2]}}),{c(){fe(n.$$.fragment)},m(e,t){de(n,e,t),r=!0},p:e,i(e){r||(ae(n.$$.fragment,e),r=!0)},o(e){se(n.$$.fragment,e),r=!1},d(e){he(n,e)}}}function je(e){let t,n,r,i=e[0],o=[];for(let t=0;tse(o[e],1,1,(()=>{o[e]=null}));return{c(){t=_("div"),n=_("table");for(let e=0;e{if(e.name&&t.name){if(e.name>t.name)return 1;if(e.name{"componentData"in e&&n(1,r=e.componentData)},[i,r]}class Ie extends ge{constructor(e){super(),me(this,e,Be,je,a,{componentData:1})}}function Ue(e){let t,n,r;return{c(){t=_("div"),n=C(),r=_("div"),D(t,"class","path topLeft svelte-1hyaq5f"),D(r,"class","path bottomRight svelte-1hyaq5f")},m(e,i){b(e,t,i),b(e,n,i),b(e,r,i)},d(e){e&&x(t),e&&x(n),e&&x(r)}}}function qe(e){let t;return{c(){t=_("div"),D(t,"class","path straightLine svelte-1hyaq5f")},m(e,n){b(e,t,n)},d(e){e&&x(t)}}}function We(t){let n;function r(e,t){return e[5]?qe:Ue}let i=r(t),o=i(t);return{c(){n=_("div"),o.c(),D(n,"class","connectorwrapper svelte-1hyaq5f"),F(n,"top",t[1]+"rem"),F(n,"left",t[0]+"rem"),F(n,"width",t[3]+"rem"),F(n,"height",t[4]+"rem"),O(n,"flip",t[2])},m(e,t){b(e,n,t),o.m(n,null)},p(e,[t]){i!==(i=r(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(n,null))),2&t&&F(n,"top",e[1]+"rem"),1&t&&F(n,"left",e[0]+"rem"),8&t&&F(n,"width",e[3]+"rem"),16&t&&F(n,"height",e[4]+"rem"),4&t&&O(n,"flip",e[2])},i:e,o:e,d(e){e&&x(n),o.d()}}}const He=.5;function Ge(e,t,n){let r,i,o,{top:a=0}=t,{left:s=0}=t,{bottom:l=0}=t,{right:u=0}=t,c=!1;return e.$$set=e=>{"top"in e&&n(1,a=e.top),"left"in e&&n(0,s=e.left),"bottom"in e&&n(7,l=e.bottom),"right"in e&&n(6,u=e.right)},e.$$.update=()=>{207&e.$$.dirty&&(n(2,r=u-s<0),n(3,i=Math.abs(u-s)),i<=He?(n(3,i=He),n(5,c=!0),n(0,s-=.25)):(r?(n(0,s+=.25),n(6,u-=.25)):(n(0,s-=.25),n(6,u+=.25)),n(3,i=Math.abs(u-s))),n(4,o=l-a))},[s,a,r,i,o,c,u,l]}class Ve extends ge{constructor(e){super(),me(this,e,Ge,We,a,{top:1,left:0,bottom:7,right:6})}}function Ye(e,t,n){const r=e.slice();return r[4]=t[n],r}function Xe(e){let t,n;return t=new Ve({props:{top:ke(e[4].top),left:ke(e[4].left),bottom:ke(e[4].bottom),right:ke(e[4].right)}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.top=ke(e[4].top)),1&n&&(r.left=ke(e[4].left)),1&n&&(r.bottom=ke(e[4].bottom)),1&n&&(r.right=ke(e[4].right)),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Je(e){let t,n,r=e[0],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{"steps"in e&&n(1,r=e.steps),"boxes"in e&&n(2,i=e.boxes),"container"in e&&n(3,o=e.container)},e.$$.update=()=>{if(15&e.$$.dirty){n(0,a=[]);const e=o.getBoundingClientRect(),t=e.top,s=e.left;i&&Object.keys(r).forEach((e=>{var o;const l=r[e],u=i[e].getBoundingClientRect();null===(o=l.next)||void 0===o||o.forEach((e=>{const r=i[e].getBoundingClientRect(),o={top:u.bottom-t,left:u.left-s+u.width/2,bottom:r.top-t,right:r.left-s+r.width/2};n(0,a=[...a,o])}))}))}},[a,r,i,o]}class Qe extends ge{constructor(e){super(),me(this,e,Ze,Je,a,{steps:1,boxes:2,container:3})}}const Ke="currentStep";function et(e,t,n){const r=e.slice();return r[18]=t[n],r[20]=n,r}function tt(e){let t,n,r;return{c(){t=_("div"),n=k("x"),r=k(e[6]),D(t,"class","levelstoshow svelte-117ceti")},m(e,i){b(e,t,i),v(t,n),v(t,r)},p(e,t){64&t&&M(r,e[6])},d(e){e&&x(t)}}}function nt(e){let t,n;return{c(){t=_("div"),D(t,"class",n="level rectangle "+e[18]+" svelte-117ceti"),F(t,"z-index",-1*(e[20]+1)),F(t,"top",(e[20]+1)*it+"px"),F(t,"left",(e[20]+1)*it+"px")},m(e,n){b(e,t,n)},p(e,r){128&r&&n!==(n="level rectangle "+e[18]+" svelte-117ceti")&&D(t,"class",n)},d(e){e&&x(t)}}}function rt(t){let n,r,i,o,a,s,l,u,c,f,d,h=t[2].doc+"",p=t[6]&&tt(t),m=t[7],g=[];for(let e=0;e1&&(o=(new Intl.NumberFormat).format(s.num_possible_tasks)),l=s.num_possible_tasks-1,Object.keys(h).forEach((e=>{const t=Number.parseInt(e);s.num_possible_tasks&&s.num_possible_tasks>t&&n(11,l=h[t])}))):l*=3,l>0&&(p=new Array(l).fill("")),p=p.map(((e,t)=>{var n,r;if(s.num_possible_tasks){const e=null!==(n=s.num_failed)&&void 0!==n?n:0,i=null!==(r=s.successful_tasks)&&void 0!==r?r:0;return(e-1)/s.num_possible_tasks>=(t+1)/p.length?"error":(e+i)/s.num_possible_tasks>=(t+1)/p.length?"success":"running"}return""}));const m=U(Ke),g=a===m;let y;s.failed||s.num_failed?f=!0:(null!==(r=s.num_possible_tasks)&&void 0!==r?r:0)>(null!==(i=s.successful_tasks)&&void 0!==i?i:0)?d=!0:s.num_possible_tasks&&s.num_possible_tasks===s.successful_tasks&&(c=!0);let v=!1;return P((()=>{n(9,v=(e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)(y))})),e.$$set=e=>{"name"in e&&n(1,a=e.name),"step"in e&&n(2,s=e.step),"numLevels"in e&&n(11,l=e.numLevels),"el"in e&&n(0,u=e.el)},[u,a,s,c,f,d,o,p,y,v,g,l,function(e){H[e?"unshift":"push"]((()=>{y=e,n(8,y)}))},function(e){H[e?"unshift":"push"]((()=>{u=e,n(0,u)}))}]}class at extends ge{constructor(e){super(),me(this,e,ot,rt,a,{name:1,step:2,numLevels:11,el:0})}}function st(e,t,n){const r=e.slice();return r[11]=t[n],r}function lt(e){let t,n,r,i,o,a;function s(t){e[8](t)}let l={name:e[2],numLevels:e[3],step:e[5]};void 0!==e[4]&&(l.el=e[4]),n=new at({props:l}),H.push((()=>ce(n,"el",s)));let u=e[7]&&function(e){let t,n,r,i,o=e[5].next,a=[];for(let t=0;tse(a[e],1,1,(()=>{a[e]=null}));return{c(){t=_("div"),n=C(),r=_("div");for(let e=0;er=!1))),n.$set(i),e[7]&&u.p(e,t),e[5].box_ends&&c.p(e,t)},i(e){a||(ae(n.$$.fragment,e),ae(u),ae(c),a=!0)},o(e){se(n.$$.fragment,e),se(u),se(c),a=!1},d(e){e&&x(t),he(n),u&&u.d(),c&&c.d()}}}function ut(e){let t,n;return t=new dt({props:{steps:e[1],stepName:e[11],levels:e[6],boxes:e[0]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.steps=e[1]),1&n&&(r.boxes=e[0]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function ct(e){let t,n,r=e[5]&<(e);return{c(){r&&r.c(),t=E()},m(e,i){r&&r.m(e,i),b(e,t,i),n=!0},p(e,[t]){e[5]&&r.p(e,t)},i(e){n||(ae(r),n=!0)},o(e){se(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function ft(e,t,n){var r;let{steps:i}=t,{stepName:o}=t,{levels:a=0}=t,{boxes:s={}}=t,l=null;P((()=>{l&&n(0,s[o]=l,s)}));let u=i[o];u||console.warn("step ",o," not found");const c="foreach"===(null==u?void 0:u.type)?a+1:"join"===(null==u?void 0:u.type)?a-1:a;let f=null===(r=null==u?void 0:u.next)||void 0===r?void 0:r.find((e=>{var t;return"join"!==(null===(t=i[e])||void 0===t?void 0:t.type)}));return e.$$set=e=>{"steps"in e&&n(1,i=e.steps),"stepName"in e&&n(2,o=e.stepName),"levels"in e&&n(3,a=e.levels),"boxes"in e&&n(0,s=e.boxes)},[s,i,o,a,l,u,c,f,function(e){l=e,n(4,l)}]}class dt extends ge{constructor(e){super(),me(this,e,ft,ct,a,{steps:1,stepName:2,levels:3,boxes:0})}}function ht(t){let n;return{c(){n=_("p"),n.textContent="No start step"},m(e,t){b(e,n,t)},p:e,i:e,o:e,d(e){e&&x(n)}}}function pt(e){let t,n,r;function i(t){e[6](t)}let o={steps:e[3],stepName:"start"};return void 0!==e[0]&&(o.boxes=e[0]),t=new dt({props:o}),H.push((()=>ce(t,"boxes",i))),{c(){fe(t.$$.fragment)},m(e,n){de(t,e,n),r=!0},p(e,r){const i={};!n&&1&r&&(n=!0,i.boxes=e[0],Z((()=>n=!1))),t.$set(i)},i(e){r||(ae(t.$$.fragment,e),r=!0)},o(e){se(t.$$.fragment,e),r=!1},d(e){he(t,e)}}}function mt(e){let t,n;return t=new Qe({props:{boxes:e[0],steps:e[3],container:e[1]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.boxes=e[0]),2&n&&(r.container=e[1]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function gt(e){let t,n,r,i,o,a,s,l=!e[2]&&Object.keys(e[0]).length;const u=[pt,ht],c=[];n=function(e,t){return e[3]?.start?0:1}(e),r=c[n]=u[n](e);let f=l&&mt(e);return{c(){t=_("div"),r.c(),i=C(),f&&f.c(),F(t,"position","relative"),F(t,"line-height","1"),D(t,"data-component","dag")},m(r,l){b(r,t,l),c[n].m(t,null),v(t,i),f&&f.m(t,null),e[7](t),o=!0,a||(s=A(window,"resize",e[4]),a=!0)},p(e,[n]){r.p(e,n),5&n&&(l=!e[2]&&Object.keys(e[0]).length),l?f?(f.p(e,n),5&n&&ae(f,1)):(f=mt(e),f.c(),ae(f,1),f.m(t,null)):f&&(ie(),se(f,1,1,(()=>{f=null})),oe())},i(e){o||(ae(r),ae(f),o=!0)},o(e){se(r),se(f),o=!1},d(r){r&&x(t),c[n].d(),f&&f.d(),e[7](null),a=!1,s()}}}function yt(e,t,n){let r;var i;u(e,xe,(e=>n(10,r=e)));let{componentData:o}=t;const{data:a}=o;let s,l,c={};I(Ke,((e,t)=>{var n;if(e&&t)return null===(n=(e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:null==t?void 0:t[2],taskid:null==t?void 0:t[3]}})(e))||void 0===n?void 0:n[t]})(null===(i=null==r?void 0:r.metadata)||void 0===i?void 0:i.pathspec,"stepname"));let f=!1;return e.$$set=e=>{"componentData"in e&&n(5,o=e.componentData)},[c,s,f,a,()=>{n(2,f=!0),clearTimeout(l),l=setTimeout((()=>{n(2,f=!1)}),100)},o,function(e){c=e,n(0,c)},function(e){H[e?"unshift":"push"]((()=>{s=e,n(1,s)}))}]}class vt extends ge{constructor(e){super(),me(this,e,yt,gt,a,{componentData:5})}}function bt(t){let n,r,i=(t[0]?.text||"")+"";return{c(){n=_("h2"),r=k(i),D(n,"class","title svelte-117s0ws"),D(n,"data-component","title")},m(e,t){b(e,n,t),v(n,r)},p(e,[t]){1&t&&i!==(i=(e[0]?.text||"")+"")&&M(r,i)},i:e,o:e,d(e){e&&x(n)}}}function xt(e,t,n){let{componentData:r}=t;return e.$$set=e=>{"componentData"in e&&n(0,r=e.componentData)},[r]}class wt extends ge{constructor(e){super(),me(this,e,xt,bt,a,{componentData:0})}}function _t(t){let n,r,i=(t[0]?.text||"")+"";return{c(){n=_("p"),r=k(i),D(n,"class","subtitle svelte-lu9pnn"),D(n,"data-component","subtitle")},m(e,t){b(e,n,t),v(n,r)},p(e,[t]){1&t&&i!==(i=(e[0]?.text||"")+"")&&M(r,i)},i:e,o:e,d(e){e&&x(n)}}}function $t(e,t,n){let{componentData:r}=t;return e.$$set=e=>{"componentData"in e&&n(0,r=e.componentData)},[r]}class kt extends ge{constructor(e){super(),me(this,e,$t,_t,a,{componentData:0})}}function Ct(e){let t,n;return t=new wt({props:{componentData:{type:"title",text:e[1]}}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.componentData={type:"title",text:e[1]}),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Et(e){let t,n;return t=new kt({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.componentData={type:"subtitle",text:e[0]}),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function At(e){let t,n,r,i=e[1]&&Ct(e),o=e[0]&&Et(e);return{c(){t=_("header"),i&&i.c(),n=C(),o&&o.c(),D(t,"class","container svelte-1ugmt5d"),D(t,"data-component","heading")},m(e,a){b(e,t,a),i&&i.m(t,null),v(t,n),o&&o.m(t,null),r=!0},p(e,[r]){e[1]?i?(i.p(e,r),2&r&&ae(i,1)):(i=Ct(e),i.c(),ae(i,1),i.m(t,n)):i&&(ie(),se(i,1,1,(()=>{i=null})),oe()),e[0]?o?(o.p(e,r),1&r&&ae(o,1)):(o=Et(e),o.c(),ae(o,1),o.m(t,null)):o&&(ie(),se(o,1,1,(()=>{o=null})),oe())},i(e){r||(ae(i),ae(o),r=!0)},o(e){se(i),se(o),r=!1},d(e){e&&x(t),i&&i.d(),o&&o.d()}}}function Dt(e,t,n){let r,i,{componentData:o}=t;return e.$$set=e=>{"componentData"in e&&n(2,o=e.componentData)},e.$$.update=()=>{4&e.$$.dirty&&n(1,({title:r,subtitle:i}=o),r,(n(0,i),n(2,o)))},[i,r,o]}class St extends ge{constructor(e){super(),me(this,e,Dt,At,a,{componentData:2})}}function Mt(e){let t,n;return{c(){t=_("div"),n=k(e[2]),D(t,"class","label svelte-1x96yvr")},m(e,r){b(e,t,r),v(t,n)},p(e,t){4&t&&M(n,e[2])},d(e){e&&x(t)}}}function Ft(e){let t,n;return{c(){t=_("figcaption"),n=k(e[1]),D(t,"class","description svelte-1x96yvr")},m(e,r){b(e,t,r),v(t,n)},p(e,t){2&t&&M(n,e[1])},d(e){e&&x(t)}}}function Ot(t){let n,r,i,o,a,s,u,c,f,d=t[2]&&Mt(t),h=t[1]&&Ft(t);return{c(){n=_("figure"),r=_("div"),i=_("img"),s=C(),d&&d.c(),u=C(),h&&h.c(),l(i.src,o=t[3])||D(i,"src",o),D(i,"alt",a=t[2]||"image"),D(i,"class","svelte-1x96yvr"),D(r,"class","imageContainer"),D(n,"data-component","image"),D(n,"class","svelte-1x96yvr")},m(e,o){b(e,n,o),v(n,r),v(r,i),v(n,s),d&&d.m(n,null),v(n,u),h&&h.m(n,null),c||(f=A(n,"click",t[4]),c=!0)},p(e,[t]){8&t&&!l(i.src,o=e[3])&&D(i,"src",o),4&t&&a!==(a=e[2]||"image")&&D(i,"alt",a),e[2]?d?d.p(e,t):(d=Mt(e),d.c(),d.m(n,u)):d&&(d.d(1),d=null),e[1]?h?h.p(e,t):(h=Ft(e),h.c(),h.m(n,null)):h&&(h.d(1),h=null)},i:e,o:e,d(e){e&&x(n),d&&d.d(),h&&h.d(),c=!1,f()}}}function Nt(e,t,n){let r,i,o,{componentData:a}=t;return e.$$set=e=>{"componentData"in e&&n(0,a=e.componentData)},e.$$.update=()=>{1&e.$$.dirty&&n(3,({src:r,label:i,description:o}=a),r,(n(2,i),n(0,a)),(n(1,o),n(0,a)))},[a,o,i,r,()=>_e.set(a)]}class Tt extends ge{constructor(e){super(),me(this,e,Nt,Ot,a,{componentData:0})}}function zt(t){let n,r,i,o,a,s,l,u=t[0].data+"";return{c(){n=_("pre"),r=k(" \n "),i=_("code"),o=k("\n "),a=k(u),s=k("\n "),l=k("\n"),D(i,"class","mono language-log"),D(n,"class","log svelte-1jhmsu"),D(n,"data-component","log")},m(e,u){b(e,n,u),v(n,r),v(n,i),v(i,o),v(i,a),v(i,s),t[2](i),v(n,l)},p(e,[t]){1&t&&u!==(u=e[0].data+"")&&M(a,u)},i:e,o:e,d(e){e&&x(n),t[2](null)}}}function Rt(e,t,n){let r,{componentData:i}=t;return e.$$set=e=>{"componentData"in e&&n(0,i=e.componentData)},e.$$.update=()=>{2&e.$$.dirty&&r&&function(){var e;r&&(null===(e=null===window||void 0===window?void 0:window.Prism)||void 0===e||e.highlightElement(r))}()},[i,r,function(e){H[e?"unshift":"push"]((()=>{r=e,n(1,r)}))}]}class Lt extends ge{constructor(e){super(),me(this,e,Rt,zt,a,{componentData:0})}}function Pt(e,t,n){const r=e.slice();return r[18]=t[n],r}function jt(e,t,n){const r=e.slice();return r[18]=t[n],r}function Bt(e,t,n){const r=e.slice();return r[10]=t[n],r}function It(e,t,n){const r=e.slice();return r[13]=t[n],r[15]=n,r}function Ut(e,t,n){const r=e.slice();return r[16]=t[n],r[15]=n,r}function qt(e,t,n){const r=e.slice();return r[7]=t[n],r}function Wt(e){let t,n,r,i;const o=[Yt,Vt,Gt],a=[];function s(e,t){return"table"===e[0]?0:"list"===e[0]?1:2}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,i){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function Ht(e){let t,n,r=e[1],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}a?(n=T(a,s(e)),fe(n.$$.fragment),ae(n.$$.fragment,1),de(n,r.parentNode,r)):n=null}else a&&n.$set(i)},i(e){i||(n&&ae(n.$$.fragment,e),i=!0)},o(e){n&&se(n.$$.fragment,e),i=!1},d(e){e&&x(r),n&&he(n,e)}}}function Vt(e){let t,n,r,i;const o=[Kt,Qt],a=[];function s(e,t){return e[4]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,i){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function Yt(e){let t,n,r;var i=e[5].table;function o(e){return{props:{$$slots:{default:[gn]},$$scope:{ctx:e}}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(8388716&r&&(a.$$scope={dirty:r,ctx:e}),32&r&&i!==(i=e[5].table)){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function Xt(t){let n,r=t[6].raw+"";return{c(){n=k(r)},m(e,t){b(e,n,t)},p(e,t){64&t&&r!==(r=e[6].raw+"")&&M(n,r)},i:e,o:e,d(e){e&&x(n)}}}function Jt(e){let t,n;return t=new xn({props:{tokens:e[1],renderers:e[5]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.tokens=e[1]),32&n&&(r.renderers=e[5]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Zt(e){let t,n,r,i;const o=[Jt,Xt],a=[];function s(e,t){return e[1]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,i){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function Qt(e){let n,r,i;const o=[{ordered:e[4]},e[6]];var a=e[5].list;function s(e){let n={$$slots:{default:[nn]},$$scope:{ctx:e}};for(let e=0;e{he(e,1)})),oe()}a?(n=T(a,s(e)),fe(n.$$.fragment),ae(n.$$.fragment,1),de(n,r.parentNode,r)):n=null}else a&&n.$set(i)},i(e){i||(n&&ae(n.$$.fragment,e),i=!0)},o(e){n&&se(n.$$.fragment,e),i=!1},d(e){e&&x(r),n&&he(n,e)}}}function Kt(e){let n,r,i;const o=[{ordered:e[4]},e[6]];var a=e[5].list;function s(e){let n={$$slots:{default:[an]},$$scope:{ctx:e}};for(let e=0;e{he(e,1)})),oe()}a?(n=T(a,s(e)),fe(n.$$.fragment),ae(n.$$.fragment,1),de(n,r.parentNode,r)):n=null}else a&&n.$set(i)},i(e){i||(n&&ae(n.$$.fragment,e),i=!0)},o(e){n&&se(n.$$.fragment,e),i=!1},d(e){e&&x(r),n&&he(n,e)}}}function en(e){let t,n,r;return t=new xn({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){fe(t.$$.fragment),n=C()},m(e,i){de(t,e,i),b(e,n,i),r=!0},p(e,n){const r={};64&n&&(r.tokens=e[18].tokens),32&n&&(r.renderers=e[5]),t.$set(r)},i(e){r||(ae(t.$$.fragment,e),r=!0)},o(e){se(t.$$.fragment,e),r=!1},d(e){he(t,e),e&&x(n)}}}function tn(e){let n,r,i;const o=[e[18]];var a=e[5].unorderedlistitem||e[5].listitem;function s(e){let n={$$slots:{default:[en]},$$scope:{ctx:e}};for(let e=0;e{he(e,1)})),oe()}a?(n=T(a,s(e)),fe(n.$$.fragment),ae(n.$$.fragment,1),de(n,r.parentNode,r)):n=null}else a&&n.$set(i)},i(e){i||(n&&ae(n.$$.fragment,e),i=!0)},o(e){n&&se(n.$$.fragment,e),i=!1},d(e){e&&x(r),n&&he(n,e)}}}function nn(e){let t,n,r=e[6].items,i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}a?(n=T(a,s(e)),fe(n.$$.fragment),ae(n.$$.fragment,1),de(n,r.parentNode,r)):n=null}else a&&n.$set(i)},i(e){i||(n&&ae(n.$$.fragment,e),i=!0)},o(e){n&&se(n.$$.fragment,e),i=!1},d(e){e&&x(r),n&&he(n,e)}}}function an(e){let t,n,r=e[6].items,i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function un(e){let t,n,r=e[2],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function fn(e){let t,n;return t=new xn({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.tokens=e[13].tokens),32&n&&(r.renderers=e[5]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function dn(e){let t,n,r;var i=e[5].tablecell;function o(e){return{props:{header:!1,align:e[6].align[e[15]]||"center",$$slots:{default:[fn]},$$scope:{ctx:e}}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(64&r&&(a.align=e[6].align[e[15]]||"center"),8388648&r&&(a.$$scope={dirty:r,ctx:e}),32&r&&i!==(i=e[5].tablecell)){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function hn(e){let t,n,r=e[10],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function mn(e){let t,n,r=e[3],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{he(e,1)})),oe()}a?(t=T(a,s(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else a&&t.$set(c);const f={};if(8388712&o&&(f.$$scope={dirty:o,ctx:e}),32&o&&l!==(l=e[5].tablebody)){if(r){ie();const e=r;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}l?(r=T(l,u(e)),fe(r.$$.fragment),ae(r.$$.fragment,1),de(r,i.parentNode,i)):r=null}else l&&r.$set(f)},i(e){o||(t&&ae(t.$$.fragment,e),r&&ae(r.$$.fragment,e),o=!0)},o(e){t&&se(t.$$.fragment,e),r&&se(r.$$.fragment,e),o=!1},d(e){t&&he(t,e),e&&x(n),e&&x(i),r&&he(r,e)}}}function yn(e){let n,r;const i=[e[7],{renderers:e[5]}];let o={};for(let e=0;e{a[l]=null})),oe()),~t?(n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){~t&&a[t].d(e),e&&x(r)}}}function bn(e,n,r){const i=["type","tokens","header","rows","ordered","renderers"];let o=g(n,i),{type:a}=n,{tokens:s}=n,{header:l}=n,{rows:u}=n,{ordered:c=!1}=n,{renderers:f}=n;return function(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},P((()=>{console.warn=e}))}(),e.$$set=e=>{n=t(t({},n),m(e)),r(6,o=g(n,i)),"type"in e&&r(0,a=e.type),"tokens"in e&&r(1,s=e.tokens),"header"in e&&r(2,l=e.header),"rows"in e&&r(3,u=e.rows),"ordered"in e&&r(4,c=e.ordered),"renderers"in e&&r(5,f=e.renderers)},[a,s,l,u,c,f,o]}class xn extends ge{constructor(e){super(),me(this,e,bn,vn,a,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}}function wn(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let _n={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const $n=/[&<>"']/,kn=new RegExp($n.source,"g"),Cn=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,En=new RegExp(Cn.source,"g"),An={"&":"&","<":"<",">":">",'"':""","'":"'"},Dn=e=>An[e];function Sn(e,t){if(t){if($n.test(e))return e.replace(kn,Dn)}else if(Cn.test(e))return e.replace(En,Dn);return e}const Mn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Fn(e){return e.replace(Mn,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const On=/(^|[^\[])\^/g;function Nn(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(On,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const Tn=/[^\w:]/g,zn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Rn(e,t,n){if(e){let e;try{e=decodeURIComponent(Fn(n)).replace(Tn,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!zn.test(n)&&(n=function(e,t){Ln[" "+e]||(Pn.test(e)?Ln[" "+e]=e+"/":Ln[" "+e]=qn(e,"/",!0));e=Ln[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(jn,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Bn,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const Ln={},Pn=/^[^:]+:\/*[^/]*$/,jn=/^([^:]+:)[\s\S]*$/,Bn=/^([^:]+:\/*[^/]*)[\s\S]*$/;const In={exec:function(){}};function Un(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Hn(e,t,n,r){const i=t.href,o=t.title?Sn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:Sn(a)}}class Gn{constructor(e){this.options=e||_n}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:qn(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=qn(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,i,o,a,s,l,u,c,f,d,h,p=t[1].trim();const m=p.length>1,g={type:"list",raw:"",ordered:m,start:m?+p.slice(0,-1):"",loose:!1,items:[]};p=m?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=m?p:"[*+-]");const y=new RegExp(`^( {0,3}${p})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(h=!1,t=y.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),u=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],this.options.pedantic?(o=2,d=u.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,d=u.slice(o),o+=t[1].length),s=!1,!u&&/^ *$/.test(c)&&(n+=c+"\n",e=e.substring(c.length+1),h=!0),!h){const t=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),r=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),a=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;e&&(f=e.split("\n",1)[0],c=f,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!i.test(c))&&!a.test(c)&&!t.test(c)&&!r.test(e);){if(c.search(/[^ ]/)>=o||!c.trim())d+="\n"+c.slice(o);else{if(s)break;if(u.search(/[^ ]/)>=4)break;if(i.test(u))break;if(a.test(u))break;if(r.test(u))break;d+="\n"+c}s||c.trim()||(s=!0),n+=f+"\n",e=e.substring(f.length+1),u=c.slice(o)}}g.loose||(l?g.loose=!0:/\n *\n *$/.test(n)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(d),r&&(i="[ ] "!==r[0],d=d.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!r,checked:i,loose:!1,text:d}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=d.trimRight(),g.raw=g.raw.trimRight();const v=g.items.length;for(a=0;a"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));g.loose=t}if(g.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Un(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,i,o,a=e.align.length;for(n=0;n({text:e})));for(a=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Sn(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=qn(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Hn(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Hn(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=r[0].length-1;let i,o,a=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=i.length,r[3]||r[4]){a+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){s+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+s);const t=e.slice(0,n+r.index+(r[0].length-i.length)+o);if(Math.min(n,o)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Sn(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=Sn(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=Sn(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=Sn(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Sn(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Sn(n[0]):n[0]:Sn(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Vn={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:In,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Vn.def=Nn(Vn.def).replace("label",Vn._label).replace("title",Vn._title).getRegex(),Vn.bullet=/(?:[*+-]|\d{1,9}[.)])/,Vn.listItemStart=Nn(/^( *)(bull) */).replace("bull",Vn.bullet).getRegex(),Vn.list=Nn(Vn.list).replace(/bull/g,Vn.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Vn.def.source+")").getRegex(),Vn._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Vn._comment=/|$)/,Vn.html=Nn(Vn.html,"i").replace("comment",Vn._comment).replace("tag",Vn._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vn.paragraph=Nn(Vn._paragraph).replace("hr",Vn.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vn._tag).getRegex(),Vn.blockquote=Nn(Vn.blockquote).replace("paragraph",Vn.paragraph).getRegex(),Vn.normal={...Vn},Vn.gfm={...Vn.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Vn.gfm.table=Nn(Vn.gfm.table).replace("hr",Vn.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vn._tag).getRegex(),Vn.gfm.paragraph=Nn(Vn._paragraph).replace("hr",Vn.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Vn.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Vn._tag).getRegex(),Vn.pedantic={...Vn.normal,html:Nn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Vn._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:In,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nn(Vn.normal._paragraph).replace("hr",Vn.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Vn.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Yn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:In,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:In,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Yn._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Yn.punctuation=Nn(Yn.punctuation).replace(/punctuation/g,Yn._punctuation).getRegex(),Yn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Yn.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Yn._comment=Nn(Vn._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Yn.emStrong.lDelim=Nn(Yn.emStrong.lDelim).replace(/punct/g,Yn._punctuation).getRegex(),Yn.emStrong.rDelimAst=Nn(Yn.emStrong.rDelimAst,"g").replace(/punct/g,Yn._punctuation).getRegex(),Yn.emStrong.rDelimUnd=Nn(Yn.emStrong.rDelimUnd,"g").replace(/punct/g,Yn._punctuation).getRegex(),Yn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Yn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Yn._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Yn.autolink=Nn(Yn.autolink).replace("scheme",Yn._scheme).replace("email",Yn._email).getRegex(),Yn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Yn.tag=Nn(Yn.tag).replace("comment",Yn._comment).replace("attribute",Yn._attribute).getRegex(),Yn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Yn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Yn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Yn.link=Nn(Yn.link).replace("label",Yn._label).replace("href",Yn._href).replace("title",Yn._title).getRegex(),Yn.reflink=Nn(Yn.reflink).replace("label",Yn._label).replace("ref",Vn._label).getRegex(),Yn.nolink=Nn(Yn.nolink).replace("ref",Vn._label).getRegex(),Yn.reflinkSearch=Nn(Yn.reflinkSearch,"g").replace("reflink",Yn.reflink).replace("nolink",Yn.nolink).getRegex(),Yn.normal={...Yn},Yn.pedantic={...Yn.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Nn(/^!?\[(label)\]\((.*?)\)/).replace("label",Yn._label).getRegex(),reflink:Nn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yn._label).getRegex()},Yn.gfm={...Yn.normal,escape:Nn(Yn.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,a,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+Wn("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+Wn("a",o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,o.index+o[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,s))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,Jn))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,Jn))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((function(e){r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,Xn))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Qn{constructor(e){this.options=e||_n}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:Sn(e,!0))+"
    \n":"
    "+(n?e:Sn(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e){return e}heading(e,t,n,r){if(this.options.headerIds){return`${e}\n`}return`${e}\n`}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return`
  • ${e}
  • \n`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,n){if(null===(e=Rn(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=Rn(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`${n}":">",r}text(e){return e}}class Kn{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class er{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class tr{constructor(e){this.options=e||_n,this.options.renderer=this.options.renderer||new Qn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Kn,this.slugger=new er}static parse(e,t){return new tr(t).parse(e)}static parseInline(e,t){return new tr(t).parseInline(e)}parse(e,t=!0){let n,r,i,o,a,s,l,u,c,f,d,h,p,m,g,y,v,b,x,w="";const _=e.length;for(n=0;n<_;n++)if(f=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(x=this.options.extensions.renderers[f.type].call({parser:this},f),!1!==x||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type)))w+=x||"";else switch(f.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(f.tokens),f.depth,Fn(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(f.text,f.lang,f.escaped);continue;case"table":for(u="",l="",o=f.header.length,r=0;r0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,p),c+=this.renderer.listitem(m,v,y);w+=this.renderer.list(c,d,h);continue;case"html":w+=this.renderer.html(f.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(f.tokens));continue;case"text":for(c=f.tokens?this.parseInline(f.tokens):f.text;n+1<_&&"text"===e[n+1].type;)f=e[++n],c+="\n"+(f.tokens?this.parseInline(f.tokens):f.text);w+=t?this.renderer.paragraph(c):c;continue;default:{const e='Token with "'+f.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return w}parseInline(e,t){t=t||this.renderer;let n,r,i,o="";const a=e.length;for(n=0;n{"function"==typeof r&&(i=r,r=null);const o={...r},a=function(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+Sn(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}((r={...ir.defaults,...o}).silent,r.async,i);if(null==n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(r),r.hooks&&(r.hooks.options=r),i){const o=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(e){return a(e)}const l=function(e){let n;if(!e)try{r.walkTokens&&ir.walkTokens(s,r.walkTokens),n=t(s,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(t){e=t}return r.highlight=o,e?a(e):i(null,n)};if(!o||o.length<3)return l();if(delete r.highlight,!s.length)return l();let u=0;return ir.walkTokens(s,(function(e){"code"===e.type&&(u++,setTimeout((()=>{o(e.text,e.lang,(function(t,n){if(t)return l(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),u--,0===u&&l()}))}),0))})),void(0===u&&l())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(ir.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));const i=e(n,r);r.walkTokens&&ir.walkTokens(i,r.walkTokens);let o=t(i,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(e){return a(e)}}}function ir(e,t,n){return rr(Zn.lex,tr.parse)(e,t,n)}ir.options=ir.setOptions=function(e){var t;return ir.defaults={...ir.defaults,...e},t=ir.defaults,_n=t,ir},ir.getDefaults=wn,ir.defaults=_n,ir.use=function(...e){const t=ir.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const n={...e};if(n.async=ir.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=ir.defaults.renderer||new Qn;for(const n in e.renderer){const r=t[n];t[n]=(...i)=>{let o=e.renderer[n].apply(t,i);return!1===o&&(o=r.apply(t,i)),o}}n.renderer=t}if(e.tokenizer){const t=ir.defaults.tokenizer||new Gn;for(const n in e.tokenizer){const r=t[n];t[n]=(...i)=>{let o=e.tokenizer[n].apply(t,i);return!1===o&&(o=r.apply(t,i)),o}}n.tokenizer=t}if(e.hooks){const t=ir.defaults.hooks||new nr;for(const n in e.hooks){const r=t[n];nr.passThroughHooks.has(n)?t[n]=i=>{if(ir.defaults.async)return Promise.resolve(e.hooks[n].call(t,i)).then((e=>r.call(t,e)));const o=e.hooks[n].call(t,i);return r.call(t,o)}:t[n]=(...i)=>{let o=e.hooks[n].apply(t,i);return!1===o&&(o=r.apply(t,i)),o}}n.hooks=t}if(e.walkTokens){const t=ir.defaults.walkTokens;n.walkTokens=function(n){let r=[];return r.push(e.walkTokens.call(this,n)),t&&(r=r.concat(t.call(this,n))),r}}ir.setOptions(n)}))},ir.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(ir,r)),r.type){case"table":for(const e of r.header)n=n.concat(ir.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(ir.walkTokens(r.tokens,t));break;case"list":n=n.concat(ir.walkTokens(r.items,t));break;default:ir.defaults.extensions&&ir.defaults.extensions.childTokens&&ir.defaults.extensions.childTokens[r.type]?ir.defaults.extensions.childTokens[r.type].forEach((function(e){n=n.concat(ir.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(ir.walkTokens(r.tokens,t)))}return n},ir.parseInline=rr(Zn.lexInline,tr.parseInline),ir.Parser=tr,ir.parser=tr.parse,ir.Renderer=Qn,ir.TextRenderer=Kn,ir.Lexer=Zn,ir.lexer=Zn.lex,ir.Tokenizer=Gn,ir.Slugger=er,ir.Hooks=nr,ir.parse=ir,ir.options,ir.setOptions,ir.use,ir.walkTokens,ir.parseInline,tr.parse,Zn.lex;const or={};function ar(t){let n;return{c(){n=k(t[1])},m(e,t){b(e,n,t)},p(e,t){2&t&&M(n,e[1])},i:e,o:e,d(e){e&&x(n)}}}function sr(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h6"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function lr(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h5"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function ur(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h4"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function cr(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h3"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function fr(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h2"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function dr(e){let t,n;const r=e[5].default,i=c(r,e,e[4],null);return{c(){t=_("h1"),i&&i.c(),D(t,"id",e[2])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||16&o)&&h(i,r,e,e[4],n?d(r,e[4],o,null):p(e[4]),null),(!n||4&o)&&D(t,"id",e[2])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function hr(e){let t,n,r,i;const o=[dr,fr,cr,ur,lr,sr,ar],a=[];function s(e,t){return 1===e[0]?0:2===e[0]?1:3===e[0]?2:4===e[0]?3:5===e[0]?4:6===e[0]?5:6}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,[i]){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function pr(e,t,n){let r,{$$slots:i={},$$scope:o}=t,{depth:a}=t,{raw:s}=t,{text:l}=t;const{slug:u,getOptions:c}=U(or),f=c();return e.$$set=e=>{"depth"in e&&n(0,a=e.depth),"raw"in e&&n(1,s=e.raw),"text"in e&&n(3,l=e.text),"$$scope"in e&&n(4,o=e.$$scope)},e.$$.update=()=>{8&e.$$.dirty&&n(2,r=f.headerIds?f.headerPrefix+u(l):void 0)},[a,s,r,l,o,i]}function mr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("p"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function gr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function yr(e){let t;const n=e[3].default,r=c(n,e,e[2],null);return{c(){r&&r.c()},m(e,n){r&&r.m(e,n),t=!0},p(e,[i]){r&&r.p&&(!t||4&i)&&h(r,n,e,e[2],t?d(n,e[2],i,null):p(e[2]),null)},i(e){t||(ae(r,e),t=!0)},o(e){se(r,e),t=!1},d(e){r&&r.d(e)}}}function vr(e,t,n){let{$$slots:r={},$$scope:i}=t,{text:o}=t,{raw:a}=t;return e.$$set=e=>{"text"in e&&n(0,o=e.text),"raw"in e&&n(1,a=e.raw),"$$scope"in e&&n(2,i=e.$$scope)},[o,a,i,r]}function br(t){let n,r;return{c(){n=_("img"),l(n.src,r=t[0])||D(n,"src",r),D(n,"title",t[1]),D(n,"alt",t[2])},m(e,t){b(e,n,t)},p(e,[t]){1&t&&!l(n.src,r=e[0])&&D(n,"src",r),2&t&&D(n,"title",e[1]),4&t&&D(n,"alt",e[2])},i:e,o:e,d(e){e&&x(n)}}}function xr(e,t,n){let{href:r=""}=t,{title:i}=t,{text:o=""}=t;return e.$$set=e=>{"href"in e&&n(0,r=e.href),"title"in e&&n(1,i=e.title),"text"in e&&n(2,o=e.text)},[r,i,o]}function wr(e){let t,n;const r=e[3].default,i=c(r,e,e[2],null);return{c(){t=_("a"),i&&i.c(),D(t,"href",e[0]),D(t,"title",e[1])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[o]){i&&i.p&&(!n||4&o)&&h(i,r,e,e[2],n?d(r,e[2],o,null):p(e[2]),null),(!n||1&o)&&D(t,"href",e[0]),(!n||2&o)&&D(t,"title",e[1])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function _r(e,t,n){let{$$slots:r={},$$scope:i}=t,{href:o=""}=t,{title:a}=t;return e.$$set=e=>{"href"in e&&n(0,o=e.href),"title"in e&&n(1,a=e.title),"$$scope"in e&&n(2,i=e.$$scope)},[o,a,i,r]}function $r(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("em"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function kr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Cr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("del"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Er(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Ar(t){let n,r,i=t[0].replace(/`/g,"")+"";return{c(){n=_("code"),r=k(i)},m(e,t){b(e,n,t),v(n,r)},p(e,[t]){1&t&&i!==(i=e[0].replace(/`/g,"")+"")&&M(r,i)},i:e,o:e,d(e){e&&x(n)}}}function Dr(e,t,n){let{raw:r}=t;return e.$$set=e=>{"raw"in e&&n(0,r=e.raw)},[r]}function Sr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("strong"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Mr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Fr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("table"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Or(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Nr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("thead"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Tr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function zr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("tbody"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Rr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Lr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("tr"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Pr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function jr(e){let t,n;const r=e[3].default,i=c(r,e,e[2],null);return{c(){t=_("td"),i&&i.c(),D(t,"align",e[1])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||4&o)&&h(i,r,e,e[2],n?d(r,e[2],o,null):p(e[2]),null),(!n||2&o)&&D(t,"align",e[1])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Br(e){let t,n;const r=e[3].default,i=c(r,e,e[2],null);return{c(){t=_("th"),i&&i.c(),D(t,"align",e[1])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||4&o)&&h(i,r,e,e[2],n?d(r,e[2],o,null):p(e[2]),null),(!n||2&o)&&D(t,"align",e[1])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Ir(e){let t,n,r,i;const o=[Br,jr],a=[];function s(e,t){return e[0]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,[i]){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function Ur(e,t,n){let{$$slots:r={},$$scope:i}=t,{header:o}=t,{align:a}=t;return e.$$set=e=>{"header"in e&&n(0,o=e.header),"align"in e&&n(1,a=e.align),"$$scope"in e&&n(2,i=e.$$scope)},[o,a,i,r]}function qr(e){let t,n;const r=e[3].default,i=c(r,e,e[2],null);return{c(){t=_("ul"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,t){i&&i.p&&(!n||4&t)&&h(i,r,e,e[2],n?d(r,e[2],t,null):p(e[2]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Wr(e){let t,n;const r=e[3].default,i=c(r,e,e[2],null);return{c(){t=_("ol"),i&&i.c(),D(t,"start",e[1])},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,o){i&&i.p&&(!n||4&o)&&h(i,r,e,e[2],n?d(r,e[2],o,null):p(e[2]),null),(!n||2&o)&&D(t,"start",e[1])},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Hr(e){let t,n,r,i;const o=[Wr,qr],a=[];function s(e,t){return e[0]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,[i]){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function Gr(e,t,n){let{$$slots:r={},$$scope:i}=t,{ordered:o}=t,{start:a}=t;return e.$$set=e=>{"ordered"in e&&n(0,o=e.ordered),"start"in e&&n(1,a=e.start),"$$scope"in e&&n(2,i=e.$$scope)},[o,a,i,r]}function Vr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("li"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Yr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function Xr(t){let n;return{c(){n=_("hr")},m(e,t){b(e,n,t)},p:e,i:e,o:e,d(e){e&&x(n)}}}function Jr(t){let n,r;return{c(){n=new N(!1),r=E(),n.a=r},m(e,i){n.m(t[0],e,i),b(e,r,i)},p(e,[t]){1&t&&n.p(e[0])},i:e,o:e,d(e){e&&x(r),e&&n.d()}}}function Zr(e,t,n){let{text:r}=t;return e.$$set=e=>{"text"in e&&n(0,r=e.text)},[r]}function Qr(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("blockquote"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(t,null),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function Kr(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}function ei(t){let n,r,i;return{c(){n=_("pre"),r=_("code"),i=k(t[1]),D(n,"class",t[0])},m(e,t){b(e,n,t),v(n,r),v(r,i)},p(e,[t]){2&t&&M(i,e[1]),1&t&&D(n,"class",e[0])},i:e,o:e,d(e){e&&x(n)}}}function ti(e,t,n){let{lang:r}=t,{text:i}=t;return e.$$set=e=>{"lang"in e&&n(0,r=e.lang),"text"in e&&n(1,i=e.text)},[r,i]}function ni(e){let t,n;const r=e[1].default,i=c(r,e,e[0],null);return{c(){t=_("br"),i&&i.c()},m(e,r){b(e,t,r),i&&i.m(e,r),n=!0},p(e,[t]){i&&i.p&&(!n||1&t)&&h(i,r,e,e[0],n?d(r,e[0],t,null):p(e[0]),null)},i(e){n||(ae(i,e),n=!0)},o(e){se(i,e),n=!1},d(e){e&&x(t),i&&i.d(e)}}}function ri(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}const ii={heading:class extends ge{constructor(e){super(),me(this,e,pr,hr,a,{depth:0,raw:1,text:3})}},paragraph:class extends ge{constructor(e){super(),me(this,e,gr,mr,a,{})}},text:class extends ge{constructor(e){super(),me(this,e,vr,yr,a,{text:0,raw:1})}},image:class extends ge{constructor(e){super(),me(this,e,xr,br,a,{href:0,title:1,text:2})}},link:class extends ge{constructor(e){super(),me(this,e,_r,wr,a,{href:0,title:1})}},em:class extends ge{constructor(e){super(),me(this,e,kr,$r,a,{})}},strong:class extends ge{constructor(e){super(),me(this,e,Mr,Sr,a,{})}},codespan:class extends ge{constructor(e){super(),me(this,e,Dr,Ar,a,{raw:0})}},del:class extends ge{constructor(e){super(),me(this,e,Er,Cr,a,{})}},table:class extends ge{constructor(e){super(),me(this,e,Or,Fr,a,{})}},tablehead:class extends ge{constructor(e){super(),me(this,e,Tr,Nr,a,{})}},tablebody:class extends ge{constructor(e){super(),me(this,e,Rr,zr,a,{})}},tablerow:class extends ge{constructor(e){super(),me(this,e,Pr,Lr,a,{})}},tablecell:class extends ge{constructor(e){super(),me(this,e,Ur,Ir,a,{header:0,align:1})}},list:class extends ge{constructor(e){super(),me(this,e,Gr,Hr,a,{ordered:0,start:1})}},orderedlistitem:null,unorderedlistitem:null,listitem:class extends ge{constructor(e){super(),me(this,e,Yr,Vr,a,{})}},hr:class extends ge{constructor(e){super(),me(this,e,null,Xr,a,{})}},html:class extends ge{constructor(e){super(),me(this,e,Zr,Jr,a,{text:0})}},blockquote:class extends ge{constructor(e){super(),me(this,e,Kr,Qr,a,{})}},code:class extends ge{constructor(e){super(),me(this,e,ti,ei,a,{lang:0,text:1})}},br:class extends ge{constructor(e){super(),me(this,e,ri,ni,a,{})}}},oi={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function ai(e){let t,n;return t=new xn({props:{tokens:e[0],renderers:e[1]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,[n]){const r={};1&n&&(r.tokens=e[0]),2&n&&(r.renderers=e[1]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function si(e,t,n){let r,i,o,a,{source:s=[]}=t,{renderers:l={}}=t,{options:u={}}=t,{isInline:c=!1}=t;const f=B();let d,h,p;return I(or,{slug:e=>i?i.slug(e):"",getOptions:()=>o}),P((()=>{n(7,p=!0)})),e.$$set=e=>{"source"in e&&n(2,s=e.source),"renderers"in e&&n(3,l=e.renderers),"options"in e&&n(4,u=e.options),"isInline"in e&&n(5,c=e.isInline)},e.$$.update=()=>{4&e.$$.dirty&&n(8,r=Array.isArray(s)),4&e.$$.dirty&&(i=s?new er:void 0),16&e.$$.dirty&&n(9,o={...oi,...u}),869&e.$$.dirty&&(r?n(0,d=s):(n(6,h=new Zn(o)),n(0,d=c?h.inlineTokens(s):h.lex(s)),f("parsed",{tokens:d}))),8&e.$$.dirty&&n(1,a={...ii,...l}),385&e.$$.dirty&&p&&!r&&f("parsed",{tokens:d})},[d,a,s,l,u,c,h,p,r,o]}class li extends ge{constructor(e){super(),me(this,e,si,ai,a,{source:2,renderers:3,options:4,isInline:5})}}function ui(e){let t,n;return t=new li({props:{source:e[0].source}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,[n]){const r={};1&n&&(r.source=e[0].source),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function ci(e,t,n){let{componentData:r}=t;return e.$$set=e=>{"componentData"in e&&n(0,r=e.componentData)},[r]}class fi extends ge{constructor(e){super(),me(this,e,ci,ui,a,{componentData:0})}}function di(e){let t,n,r;const i=e[2].default,o=c(i,e,e[1],null);return{c(){t=_("div"),o&&o.c(),D(t,"id",n=`page-${e[0]?.title||"No Title"}`),D(t,"class","page svelte-v7ihqd"),D(t,"data-component","page")},m(e,n){b(e,t,n),o&&o.m(t,null),r=!0},p(e,[a]){o&&o.p&&(!r||2&a)&&h(o,i,e,e[1],r?d(i,e[1],a,null):p(e[1]),null),(!r||1&a&&n!==(n=`page-${e[0]?.title||"No Title"}`))&&D(t,"id",n)},i(e){r||(ae(o,e),r=!0)},o(e){se(o,e),r=!1},d(e){e&&x(t),o&&o.d(e)}}}function hi(e,t,n){let{$$slots:r={},$$scope:i}=t,{componentData:o}=t;return e.$$set=e=>{"componentData"in e&&n(0,o=e.componentData),"$$scope"in e&&n(1,i=e.$$scope)},[o,i,r]}class pi extends ge{constructor(e){super(),me(this,e,hi,di,a,{componentData:0})}}function mi(e){let t,n,r=e[5]&&gi(e),i=e[4]&&yi(e);return{c(){t=_("div"),r&&r.c(),n=C(),i&&i.c(),D(t,"class","info svelte-5d173i")},m(e,o){b(e,t,o),r&&r.m(t,null),v(t,n),i&&i.m(t,null)},p(e,o){e[5]?r?r.p(e,o):(r=gi(e),r.c(),r.m(t,n)):r&&(r.d(1),r=null),e[4]?i?i.p(e,o):(i=yi(e),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},d(e){e&&x(t),r&&r.d(),i&&i.d()}}}function gi(e){let t,n,r,i,o;return{c(){t=_("label"),n=k(e[5]),r=C(),i=_("span"),o=k(e[3]),D(i,"class","labelValue svelte-5d173i"),D(t,"for",e[6]),D(t,"class","svelte-5d173i")},m(e,a){b(e,t,a),v(t,n),v(t,r),v(t,i),v(i,o)},p(e,r){32&r&&M(n,e[5]),8&r&&M(o,e[3]),64&r&&D(t,"for",e[6])},d(e){e&&x(t)}}}function yi(e){let t,n;return{c(){t=_("span"),n=k(e[4]),D(t,"title",e[4]),D(t,"class","details svelte-5d173i")},m(e,r){b(e,t,r),v(t,n)},p(e,r){16&r&&M(n,e[4]),16&r&&D(t,"title",e[4])},d(e){e&&x(t)}}}function vi(t){let n,r,i,o,a,s,l=(t[0]||"")+"",u=(t[5]||t[4])&&mi(t);return{c(){n=_("div"),r=_("div"),u&&u.c(),i=C(),o=_("progress"),a=k(t[1]),s=k(l),D(o,"id",t[6]),D(o,"max",t[2]),o.value=t[1],D(o,"style","color: red !important"),D(o,"class","svelte-5d173i"),D(r,"class","inner svelte-5d173i"),D(n,"class","container svelte-5d173i")},m(e,t){b(e,n,t),v(n,r),u&&u.m(r,null),v(r,i),v(r,o),v(o,a),v(o,s)},p(e,[t]){e[5]||e[4]?u?u.p(e,t):(u=mi(e),u.c(),u.m(r,i)):u&&(u.d(1),u=null),2&t&&M(a,e[1]),1&t&&l!==(l=(e[0]||"")+"")&&M(s,l),64&t&&D(o,"id",e[6]),4&t&&D(o,"max",e[2]),2&t&&(o.value=e[1])},i:e,o:e,d(e){e&&x(n),u&&u.d()}}}function bi(e,t,n){let r,i,o,a,s,l,{componentData:u}=t;null==o&&(o=0);let c=o.toString();return e.$$set=e=>{"componentData"in e&&n(7,u=e.componentData)},e.$$.update=()=>{128&e.$$.dirty&&n(2,({max:r,id:i,value:o,label:a,unit:s,details:l}=u),r,(n(6,i),n(7,u)),(n(1,o),n(7,u)),(n(5,a),n(7,u)),(n(0,s),n(7,u)),(n(4,l),n(7,u))),7&e.$$.dirty&&(r?n(3,c=`${o}/${r}`):s&&n(3,c=`${o} ${s}`))},[s,o,r,c,l,a,i,u]}class xi extends ge{constructor(e){super(),me(this,e,bi,vi,a,{componentData:7})}}function wi(e){let t,n;return{c(){t=_("h3"),n=k(e[3])},m(e,r){b(e,t,r),v(t,n)},p(e,t){8&t&&M(n,e[3])},d(e){e&&x(t)}}}function _i(e){let t,n;return{c(){t=_("p"),n=k(e[2]),D(t,"class","description")},m(e,r){b(e,t,r),v(t,n)},p(e,t){4&t&&M(n,e[2])},d(e){e&&x(t)}}}function $i(e){let t,n,r,i,o,a,s,l,u=e[3]&&wi(e),f=e[2]&&_i(e);const m=e[6].default,g=c(m,e,e[5],null);return{c(){t=_("section"),n=_("div"),u&&u.c(),r=C(),f&&f.c(),i=C(),o=_("div"),g&&g.c(),a=C(),s=_("hr"),D(n,"class","heading svelte-17n0qr8"),D(o,"class","sectionItems svelte-17n0qr8"),D(o,"style",e[0]),D(s,"class","svelte-17n0qr8"),D(t,"class","container svelte-17n0qr8"),D(t,"data-component","section"),D(t,"data-section-id",e[3]),O(t,"columns",e[1])},m(e,c){b(e,t,c),v(t,n),u&&u.m(n,null),v(n,r),f&&f.m(n,null),v(t,i),v(t,o),g&&g.m(o,null),v(t,a),v(t,s),l=!0},p(e,[i]){e[3]?u?u.p(e,i):(u=wi(e),u.c(),u.m(n,r)):u&&(u.d(1),u=null),e[2]?f?f.p(e,i):(f=_i(e),f.c(),f.m(n,null)):f&&(f.d(1),f=null),g&&g.p&&(!l||32&i)&&h(g,m,e,e[5],l?d(m,e[5],i,null):p(e[5]),null),(!l||1&i)&&D(o,"style",e[0]),(!l||8&i)&&D(t,"data-section-id",e[3]),(!l||2&i)&&O(t,"columns",e[1])},i(e){l||(ae(g,e),l=!0)},o(e){se(g,e),l=!1},d(e){e&&x(t),u&&u.d(),f&&f.d(),g&&g.d(e)}}}function ki(e,t,n){let r,i,o,a,{$$slots:s={},$$scope:l}=t,{componentData:u}=t;return o&&(a=`grid-template-columns: repeat(${o||1}, 1fr);`),e.$$set=e=>{"componentData"in e&&n(4,u=e.componentData),"$$scope"in e&&n(5,l=e.$$scope)},e.$$.update=()=>{16&e.$$.dirty&&n(3,({title:r,subtitle:i,columns:o}=u),r,(n(2,i),n(4,u)),(n(1,o),n(4,u)))},[a,o,i,r,u,l,s]}class Ci extends ge{constructor(e){super(),me(this,e,ki,$i,a,{componentData:4})}} /*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed - */var lf,cf=(lf=function(t,e){return lf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},lf(t,e)},function(t,e){function n(){this.constructor=t}lf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),uf=Object.prototype.hasOwnProperty;function ff(t,e){return uf.call(t,e)}function hf(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n=48&&e<=57))return!1;n++}return!0}function gf(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function mf(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function yf(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var e=0,n=t.length;e0&&"constructor"==a[c-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===l[h]?f=a.slice(0,c).join("/"):c==u-1&&(f=e.path),void 0!==f&&d(e,0,t,f)),c++,Array.isArray(l)){if("-"===h)h=l.length;else{if(n&&!pf(h))throw new xf("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);pf(h)&&(h=~~h)}if(c>=u){if(n&&"add"===e.op&&h>l.length)throw new xf("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);if(!1===(s=kf[e.op].call(e,l,h,t)).test)throw new xf("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}}else if(c>=u){if(!1===(s=wf[e.op].call(e,l,h,t)).test)throw new xf("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}if(l=l[h],n&&c0)throw new xf('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!=typeof t.from)throw new xf("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new xf("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&yf(t.value))throw new xf("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var r=t.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new xf("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==i)throw new xf("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var s=Mf([{op:"_get",path:t.from,value:void 0}],n);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new xf("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}function Mf(t,e,n){try{if(!Array.isArray(t))throw new xf("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)Ef(df(e),df(t),n||!0);else{n=n||Sf;for(var i=0;i=48&&t<=57))return!1;n++}return!0}function Ni(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ti(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function zi(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t0&&"constructor"==s[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===f&&(void 0===l[d]?f=s.slice(0,u).join("/"):u==c-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),u++,Array.isArray(l)){if("-"===d)d=l.length;else{if(n&&!Oi(d))throw new Pi("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);Oi(d)&&(d=~~d)}if(u>=c){if(n&&"add"===t.op&&d>l.length)throw new Pi("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=Ii[t.op].call(t,l,d,e)).test)throw new Pi("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(u>=c){if(!1===(a=Bi[t.op].call(t,l,d,e)).test)throw new Pi("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[d],n&&u0)throw new Pi('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new Pi("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new Pi("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&zi(e.value))throw new Pi("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Pi("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new Pi("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=Gi([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new Pi("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function Gi(e,t,n){try{if(!Array.isArray(e))throw new Pi("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Wi(Fi(t),Fi(e),n||!0);else{n=n||Hi;for(var r=0;r0&&(t.patches=[],t.callback&&t.callback(i)),i}function zf(t,e,n,i,r){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var o=hf(e),s=hf(t),a=!1,l=s.length-1;l>=0;l--){var c=t[f=s[l]];if(!ff(e,f)||void 0===e[f]&&void 0!==c&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(r&&n.push({op:"test",path:i+"/"+gf(f),value:df(c)}),n.push({op:"remove",path:i+"/"+gf(f)}),a=!0):(r&&n.push({op:"test",path:i,value:t}),n.push({op:"replace",path:i,value:e}));else{var u=e[f];"object"==typeof c&&null!=c&&"object"==typeof u&&null!=u&&Array.isArray(c)===Array.isArray(u)?zf(c,u,n,i+"/"+gf(f),r):c!==u&&(r&&n.push({op:"test",path:i+"/"+gf(f),value:df(c)}),n.push({op:"replace",path:i+"/"+gf(f),value:df(u)}))}}if(a||o.length!=s.length)for(l=0;l0)return[m,n+c.join(",\n"+p),a].join("\n"+o)}return y}(t,"",0)};function If(t,e,n){return t.fields=e||[],t.fname=n,t}function Bf(t){return null==t?null:t.fname}function jf(t){return null==t?null:t.fields}function Uf(t){return 1===t.length?qf(t[0]):Wf(t)}const qf=t=>function(e){return e[t]},Wf=t=>{const e=t.length;return function(n){for(let i=0;ii&&c(),a=i=r+1):"]"===o&&(a||Hf("Access path missing open bracket: "+t),a>0&&c(),a=0,i=r+1):r>i?c():i=r+1}return a&&Hf("Access path missing closing bracket: "+t),s&&Hf("Access path missing closing quote: "+t),r>i&&(r++,c()),e}function Yf(t,e,n){const i=Vf(t);return t=1===i.length?i[0]:t,If((n&&n.get||Uf)(i),[t],e||t)}const Gf=Yf("id"),Xf=If((t=>t),[],"identity"),Zf=If((()=>0),[],"zero"),Jf=If((()=>1),[],"one"),Qf=If((()=>!0),[],"true"),Kf=If((()=>!1),[],"false");function th(t,e,n){const i=[e].concat([].slice.call(n));console[t].apply(console,i)}const eh=0,nh=1,ih=2,rh=3,oh=4;function sh(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:th,i=t||eh;return{level(t){return arguments.length?(i=+t,this):i},error(){return i>=nh&&n(e||"error","ERROR",arguments),this},warn(){return i>=ih&&n(e||"warn","WARN",arguments),this},info(){return i>=rh&&n(e||"log","INFO",arguments),this},debug(){return i>=oh&&n(e||"log","DEBUG",arguments),this}}}var ah=Array.isArray;function lh(t){return t===Object(t)}const ch=t=>"__proto__"!==t;function uh(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const n in e)if("signals"===n)t.signals=hh(t.signals,e.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;fh(t,n,e[n],i)}return t}),{})}function fh(t,e,n,i){if(!ch(e))return;let r,o;if(lh(n)&&!ah(n))for(r in o=lh(t[e])?t[e]:t[e]={},n)i&&(!0===i||i[r])?fh(o,r,n[r]):ch(r)&&(o[r]=n[r]);else t[e]=n}function hh(t,e){if(null==t)return e;const n={},i=[];function r(t){n[t.name]||(n[t.name]=1,i.push(t))}return e.forEach(r),t.forEach(r),i}function dh(t){return t[t.length-1]}function ph(t){return null==t||""===t?null:+t}const gh=t=>e=>t*Math.exp(e),mh=t=>e=>Math.log(t*e),yh=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),vh=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,bh=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function xh(t,e,n,i){const r=n(t[0]),o=n(dh(t)),s=(o-r)*e;return[i(r-s),i(o-s)]}function _h(t,e){return xh(t,e,ph,Xf)}function wh(t,e){var n=Math.sign(t[0]);return xh(t,e,mh(n),gh(n))}function kh(t,e,n){return xh(t,e,bh(n),bh(1/n))}function $h(t,e,n){return xh(t,e,yh(n),vh(n))}function Ch(t,e,n,i,r){const o=i(t[0]),s=i(dh(t)),a=null!=e?i(e):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function Eh(t,e,n){return Ch(t,e,n,ph,Xf)}function Sh(t,e,n){const i=Math.sign(t[0]);return Ch(t,e,n,mh(i),gh(i))}function Mh(t,e,n,i){return Ch(t,e,n,bh(i),bh(1/i))}function Dh(t,e,n,i){return Ch(t,e,n,yh(i),vh(i))}function Ah(t){return 1+~~(new Date(t).getMonth()/3)}function Fh(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Oh(t){return null!=t?ah(t)?t:[t]:[]}function Th(t,e,n){let i,r=t[0],o=t[1];return o=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-i),r+i]}function Nh(t){return"function"==typeof t}const zh="descending";function Lh(t,e,n){n=n||{},e=Oh(e)||[];const i=[],r=[],o={},s=n.comparator||Ph;return Oh(t).forEach(((t,s)=>{null!=t&&(i.push(e[s]===zh?-1:1),r.push(t=Nh(t)?t:Yf(t,null,n)),(jf(t)||[]).forEach((t=>o[t]=1)))})),0===r.length?null:If(s(r,i),Object.keys(o))}const Rh=(t,e)=>(te||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0),Ph=(t,e)=>1===t.length?Ih(t[0],e[0]):Bh(t,e,t.length),Ih=(t,e)=>function(n,i){return Rh(t(n),t(i))*e},Bh=(t,e,n)=>(e.push(0),function(i,r){let o,s=0,a=-1;for(;0===s&&++at}function Uh(t,e){let n;return i=>{n&&clearTimeout(n),n=setTimeout((()=>(e(i),n=null)),t)}}function qh(t){for(let e,n,i=1,r=arguments.length;io&&(o=i))}else{for(i=e(t[s]);so&&(o=i))}return[r,o]}function Hh(t,e){const n=t.length;let i,r,o,s,a,l=-1;if(null==e){for(;++l=r){i=o=r;break}if(l===n)return[-1,-1];for(s=a=l;++lr&&(i=r,s=l),o=r){i=o=r;break}if(l===n)return[-1,-1];for(s=a=l;++lr&&(i=r,s=l),oi(t)?n[t]:void 0,set(t,e){return i(t)||(++r.size,n[t]===Gh&&--r.empty),n[t]=e,this},delete(t){return i(t)&&(--r.size,++r.empty,n[t]=Gh),this},clear(){r.size=r.empty=0,r.object=n={}},test(t){return arguments.length?(e=t,r):e},clean(){const t={};let i=0;for(const r in n){const o=n[r];o===Gh||e&&e(o)||(t[r]=o,++i)}r.size=i,r.empty=0,r.object=n=t}};return t&&Object.keys(t).forEach((e=>{r.set(e,t[e])})),r}function Zh(t,e,n,i,r,o){if(!n&&0!==n)return o;const s=+n;let a,l=t[0],c=dh(t);cs&&(r=o,o=s,s=r),i=void 0===i||i,((n=void 0===n||n)?o<=t:ot.replace(/\\(.)/g,"$1"))):Oh(t));const i=t&&t.length,r=n&&n.get||Uf,o=t=>r(e?[t]:Vf(t));let s;if(i)if(1===i){const e=o(t[0]);s=function(t){return""+e(t)}}else{const e=t.map(o);s=function(t){let n=""+e[0](t),r=0;for(;++r{e={},n={},i=0},o=(r,o)=>(++i>t&&(n=e,e={},i=1),e[r]=o);return r(),{clear:r,has:t=>Yh(e,t)||Yh(n,t),get:t=>Yh(e,t)?e[t]:Yh(n,t)?o(t,n[t]):void 0,set:(t,n)=>Yh(e,t)?e[t]=n:o(t,n)}}function ld(t,e,n,i){const r=e.length,o=n.length;if(!o)return e;if(!r)return n;const s=i||new e.constructor(r+o);let a=0,l=0,c=0;for(;a0?n[l++]:e[a++];for(;a=0;)n+=t;return n}function ud(t,e,n,i){const r=n||" ",o=t+"",s=e-o.length;return s<=0?o:"left"===i?cd(r,s)+o:"center"===i?cd(r,~~(s/2))+o+cd(r,Math.ceil(s/2)):o+cd(r,s)}function fd(t){return t&&dh(t)-t[0]||0}function hd(t){return ah(t)?"["+t.map(hd)+"]":lh(t)||rd(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function dd(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const pd=t=>nd(t)||td(t)?t:Date.parse(t);function gd(t,e){return e=e||pd,null==t||""===t?null:e(t)}function md(t){return null==t||""===t?null:t+""}function yd(t){const e={},n=t.length;for(let i=0;i9999?"+"+Sd(e,6):Sd(e,4))+"-"+Sd(t.getUTCMonth()+1,2)+"-"+Sd(t.getUTCDate(),2)+(o?"T"+Sd(n,2)+":"+Sd(i,2)+":"+Sd(r,2)+"."+Sd(o,3)+"Z":r?"T"+Sd(n,2)+":"+Sd(i,2)+":"+Sd(r,2)+"Z":i||n?"T"+Sd(n,2)+":"+Sd(i,2)+"Z":"")}function Dd(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],o=t.length,s=0,a=0,l=o<=0,c=!1;function u(){if(l)return _d;if(c)return c=!1,xd;var e,i,r=s;if(t.charCodeAt(r)===wd){for(;s++=o?l=!0:(i=t.charCodeAt(s++))===kd?c=!0:i===$d&&(c=!0,t.charCodeAt(s)===kd&&++s),t.slice(r+1,e-1).replace(/""/g,'"')}for(;s1)i=function(t,e,n){var i,r=[],o=[];function s(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:i})}function a(t){t.forEach(s)}function l(t){t.forEach(a)}function c(t){t.forEach(l)}function u(t){switch(i=t,t.type){case"GeometryCollection":t.geometries.forEach(u);break;case"LineString":a(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":c(t.arcs)}}return u(e),o.forEach(null==n?function(t){r.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&r.push(t[0].i)}),r}(0,e,n);else for(r=0,i=new Array(o=t.arcs.length);re?1:t>=e?0:NaN}function Pd(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Id(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r>>1;n(t[e],i)<0?r=e+1:o=e}while(rRd(t(e),n),i=(e,n)=>t(e)-n):(e=t===Rd||t===Pd?t:Bd,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const s=r(t,e,n,o-1);return s>n&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,r=0,o=t.length){if(r>>1;n(t[e],i)<=0?r=e+1:o=e}while(r0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}class Yd extends Map{constructor(t,e=Qd){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Xd(this,t))}has(t){return super.has(Xd(this,t))}set(t,e){return super.set(Zd(this,t),e)}delete(t){return super.delete(Jd(this,t))}}class Gd extends Set{constructor(t,e=Qd){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(Xd(this,t))}add(t){return super.add(Zd(this,t))}delete(t){return super.delete(Jd(this,t))}}function Xd({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Zd({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function Jd({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function Qd(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Kd(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}const tp=Math.sqrt(50),ep=Math.sqrt(10),np=Math.sqrt(2);function ip(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=tp?10:o>=ep?5:o>=np?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if((t=+t)===(e=+e))return[t];const i=e=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let t=0;t=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n=r)&&(n=r)}return n}function lp(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function cp(t,e,n=0,i=1/0,r){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(t.length-1,i)),!(n<=e&&e<=i))return t;for(r=void 0===r?Kd:function(t=Rd){if(t===Rd)return Kd;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||0===i?i:(0===t(n,n))-(0===t(e,e))}}(r);i>n;){if(i-n>600){const o=i-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);cp(t,e,Math.max(n,Math.floor(e-s*l/o+c)),Math.min(i,Math.floor(e+(o-s)*l/o+c)),r)}const o=t[e];let s=n,a=i;for(up(t,n,e),r(t[i],o)>0&&up(t,n,i);s0;)--a}0===r(t[n],o)?up(t,n,a):(++a,up(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function up(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function fp(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&(yield i)}}(t,n)),(i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return lp(t);if(e>=1)return ap(t);var i,r=(i-1)*e,o=Math.floor(r),s=ap(cp(t,o).subarray(0,o+1));return s+(lp(t.subarray(o+1))-s)*(r-o)}}function hp(t,e,n=jd){if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t);return s+(+n(t[o+1],o+1,t)-s)*(r-o)}}function dp(t,e){return fp(t,.5,e)}function pp(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function gp(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i1?i[0]+i.slice(2):i,+t.slice(n+1)]}function bp(t){return(t=vp(Math.abs(t)))?t[1]:NaN}var xp,_p=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wp(t){if(!(e=_p.exec(t)))throw new Error("invalid format: "+t);var e;return new kp({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function kp(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function $p(t,e){var n=vp(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}wp.prototype=kp.prototype,kp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Cp={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>$p(100*t,e),r:$p,s:function(t,e){var n=vp(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(xp=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+vp(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ep(t){return t}var Sp,Mp,Dp,Ap=Array.prototype.map,Fp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Op(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Ep:(e=Ap.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],s=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Ep:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ap.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=wp(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Cp[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?r:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?l:"",_=Cp[v],w=/[defgprs%]/.test(v);function k(t){var r,o,l,h=b,k=x;if("c"===v)k=_(t)+k,t="";else{var $=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),$&&0==+t&&"+"!==f&&($=!1),h=($?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===v?Fp[8+xp/3]:"")+k+($&&"("===f?")":""),w)for(r=-1,o=t.length;++r(l=t.charCodeAt(r))||l>57){k=(46===l?s+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}g&&!d&&(t=i(t,1/0));var C=h.length+t.length+k.length,E=C>1)+h+t+k+E.slice(C);break;default:t=E+h+t+k}return a(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=wp(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(bp(e)/3))),r=Math.pow(10,-i),o=Fp[8+i/3];return function(t){return n(r*t)+o}}}}function Tp(t){return Math.max(0,-bp(Math.abs(t)))}function Np(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(bp(e)/3)))-bp(Math.abs(t)))}function zp(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,bp(e)-bp(t))+1}!function(t){Sp=Op(t),Mp=Sp.format,Dp=Sp.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Lp=new Date,Rp=new Date;function Pp(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(aPp((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(Lp.setTime(+e),Rp.setTime(+i),t(Lp),t(Rp),Math.floor(n(Lp,Rp))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const Ip=Pp((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Ip.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Pp((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Ip:null),Ip.range;const Bp=1e3,jp=6e4,Up=36e5,qp=864e5,Wp=6048e5,Hp=2592e6,Vp=31536e6,Yp=Pp((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Bp)}),((t,e)=>(e-t)/Bp),(t=>t.getUTCSeconds()));Yp.range;const Gp=Pp((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Bp)}),((t,e)=>{t.setTime(+t+e*jp)}),((t,e)=>(e-t)/jp),(t=>t.getMinutes()));Gp.range;const Xp=Pp((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*jp)}),((t,e)=>(e-t)/jp),(t=>t.getUTCMinutes()));Xp.range;const Zp=Pp((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Bp-t.getMinutes()*jp)}),((t,e)=>{t.setTime(+t+e*Up)}),((t,e)=>(e-t)/Up),(t=>t.getHours()));Zp.range;const Jp=Pp((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Up)}),((t,e)=>(e-t)/Up),(t=>t.getUTCHours()));Jp.range;const Qp=Pp((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*jp)/qp),(t=>t.getDate()-1));Qp.range;const Kp=Pp((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/qp),(t=>t.getUTCDate()-1));Kp.range;const tg=Pp((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/qp),(t=>Math.floor(t/qp)));function eg(t){return Pp((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*jp)/Wp))}tg.range;const ng=eg(0),ig=eg(1),rg=eg(2),og=eg(3),sg=eg(4),ag=eg(5),lg=eg(6);function cg(t){return Pp((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Wp))}ng.range,ig.range,rg.range,og.range,sg.range,ag.range,lg.range;const ug=cg(0),fg=cg(1),hg=cg(2),dg=cg(3),pg=cg(4),gg=cg(5),mg=cg(6);ug.range,fg.range,hg.range,dg.range,pg.range,gg.range,mg.range;const yg=Pp((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));yg.range;const vg=Pp((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));vg.range;const bg=Pp((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));bg.every=t=>isFinite(t=Math.floor(t))&&t>0?Pp((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,bg.range;const xg=Pp((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function _g(t,e,n,i,r,o){const s=[[Yp,1,Bp],[Yp,5,5e3],[Yp,15,15e3],[Yp,30,3e4],[o,1,jp],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,Up],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,qp],[i,2,1728e5],[n,1,Wp],[e,1,Hp],[e,3,7776e6],[t,1,Vp]];function a(e,n,i){const r=Math.abs(n-e)/i,o=Id((([,,t])=>t)).right(s,r);if(o===s.length)return t.every(sp(e/Vp,n/Vp,i));if(0===o)return Ip.every(Math.max(sp(e,n,i),1));const[a,l]=s[r/s[o-1][2]isFinite(t=Math.floor(t))&&t>0?Pp((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,xg.range;const[wg,kg]=_g(xg,vg,ug,tg,Jp,Xp),[$g,Cg]=_g(bg,yg,ng,Qp,Zp,Gp),Eg="year",Sg="quarter",Mg="month",Dg="week",Ag="date",Fg="day",Og="dayofyear",Tg="hours",Ng="minutes",zg="seconds",Lg="milliseconds",Rg=[Eg,Sg,Mg,Dg,Ag,Fg,Og,Tg,Ng,zg,Lg],Pg=Rg.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function Ig(t){const e=Oh(t).slice(),n={};e.length||Hf("Missing time unit."),e.forEach((t=>{Yh(Pg,t)?n[t]=1:Hf(`Invalid time unit: ${t}.`)}));return(n[Dg]||n[Fg]?1:0)+(n[Sg]||n[Mg]||n[Ag]?1:0)+(n[Og]?1:0)>1&&Hf(`Incompatible time units: ${t}`),e.sort(((t,e)=>Pg[t]-Pg[e])),e}const Bg={[Eg]:"%Y ",[Sg]:"Q%q ",[Mg]:"%b ",[Ag]:"%d ",[Dg]:"W%U ",[Fg]:"%a ",[Og]:"%j ",[Tg]:"%H:00",[Ng]:"00:%M",[zg]:":%S",[Lg]:".%L",[`${Eg}-${Mg}`]:"%Y-%m ",[`${Eg}-${Mg}-${Ag}`]:"%Y-%m-%d ",[`${Tg}-${Ng}`]:"%H:%M"};function jg(t,e){const n=qh({},Bg,e),i=Ig(t),r=i.length;let o,s,a="",l=0;for(l=0;ll;--o)if(s=i.slice(l,o).join("-"),null!=n[s]){a+=n[s],l=o;break}return a.trim()}const Ug=new Date;function qg(t){return Ug.setFullYear(t),Ug.setMonth(0),Ug.setDate(1),Ug.setHours(0,0,0,0),Ug}function Wg(t){return Vg(new Date(t))}function Hg(t){return Yg(new Date(t))}function Vg(t){return Qp.count(qg(t.getFullYear())-1,t)}function Yg(t){return ng.count(qg(t.getFullYear())-1,t)}function Gg(t){return qg(t).getDay()}function Xg(t,e,n,i,r,o,s){if(0<=t&&t<100){const a=new Date(-1,e,n,i,r,o,s);return a.setFullYear(t),a}return new Date(t,e,n,i,r,o,s)}function Zg(t){return Qg(new Date(t))}function Jg(t){return Kg(new Date(t))}function Qg(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Kp.count(e-1,t)}function Kg(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return ug.count(e-1,t)}function tm(t){return Ug.setTime(Date.UTC(t,0,1)),Ug.getUTCDay()}function em(t,e,n,i,r,o,s){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,i,r,o,s));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,i,r,o,s))}function nm(t,e,n,i,r){const o=e||1,s=dh(t),a=(t,e,r)=>function(t,e,n,i){const r=n<=1?t:i?(e,r)=>i+n*Math.floor((t(e,r)-i)/n):(e,i)=>n*Math.floor(t(e,i)/n);return e?(t,n)=>e(r(t,n),n):r}(n[r=r||t],i[r],t===s&&o,e),l=new Date,c=yd(t),u=c[Eg]?a(Eg):jh(2012),f=c[Mg]?a(Mg):c[Sg]?a(Sg):Zf,h=c[Dg]&&c[Fg]?a(Fg,1,Dg+Fg):c[Dg]?a(Dg,1):c[Fg]?a(Fg,1):c[Ag]?a(Ag,1):c[Og]?a(Og,1):Jf,d=c[Tg]?a(Tg):Zf,p=c[Ng]?a(Ng):Zf,g=c[zg]?a(zg):Zf,m=c[Lg]?a(Lg):Zf;return function(t){l.setTime(+t);const e=u(l);return r(e,f(l),h(l,e),d(l),p(l),g(l),m(l))}}function im(t,e,n){return e+7*t-(n+6)%7}const rm={[Eg]:t=>t.getFullYear(),[Sg]:t=>Math.floor(t.getMonth()/3),[Mg]:t=>t.getMonth(),[Ag]:t=>t.getDate(),[Tg]:t=>t.getHours(),[Ng]:t=>t.getMinutes(),[zg]:t=>t.getSeconds(),[Lg]:t=>t.getMilliseconds(),[Og]:t=>Vg(t),[Dg]:t=>Yg(t),[Dg+Fg]:(t,e)=>im(Yg(t),t.getDay(),Gg(e)),[Fg]:(t,e)=>im(1,t.getDay(),Gg(e))},om={[Sg]:t=>3*t,[Dg]:(t,e)=>im(t,0,Gg(e))};function sm(t,e){return nm(t,e||1,rm,om,Xg)}const am={[Eg]:t=>t.getUTCFullYear(),[Sg]:t=>Math.floor(t.getUTCMonth()/3),[Mg]:t=>t.getUTCMonth(),[Ag]:t=>t.getUTCDate(),[Tg]:t=>t.getUTCHours(),[Ng]:t=>t.getUTCMinutes(),[zg]:t=>t.getUTCSeconds(),[Lg]:t=>t.getUTCMilliseconds(),[Og]:t=>Qg(t),[Dg]:t=>Kg(t),[Fg]:(t,e)=>im(1,t.getUTCDay(),tm(e)),[Dg+Fg]:(t,e)=>im(Kg(t),t.getUTCDay(),tm(e))},lm={[Sg]:t=>3*t,[Dg]:(t,e)=>im(t,0,tm(e))};function cm(t,e){return nm(t,e||1,am,lm,em)}const um={[Eg]:bg,[Sg]:yg.every(3),[Mg]:yg,[Dg]:ng,[Ag]:Qp,[Fg]:Qp,[Og]:Qp,[Tg]:Zp,[Ng]:Gp,[zg]:Yp,[Lg]:Ip},fm={[Eg]:xg,[Sg]:vg.every(3),[Mg]:vg,[Dg]:ug,[Ag]:Kp,[Fg]:Kp,[Og]:Kp,[Tg]:Jp,[Ng]:Xp,[zg]:Yp,[Lg]:Ip};function hm(t){return um[t]}function dm(t){return fm[t]}function pm(t,e,n){return t?t.offset(e,n):void 0}function gm(t,e,n){return pm(hm(t),e,n)}function mm(t,e,n){return pm(dm(t),e,n)}function ym(t,e,n,i){return t?t.range(e,n,i):void 0}function vm(t,e,n,i){return ym(hm(t),e,n,i)}function bm(t,e,n,i){return ym(dm(t),e,n,i)}const xm=1e3,_m=6e4,wm=36e5,km=864e5,$m=2592e6,Cm=31536e6,Em=[Eg,Mg,Ag,Tg,Ng,zg,Lg],Sm=Em.slice(0,-1),Mm=Sm.slice(0,-1),Dm=Mm.slice(0,-1),Am=Dm.slice(0,-1),Fm=[Eg,Mg],Om=[Eg],Tm=[[Sm,1,xm],[Sm,5,5e3],[Sm,15,15e3],[Sm,30,3e4],[Mm,1,_m],[Mm,5,3e5],[Mm,15,9e5],[Mm,30,18e5],[Dm,1,wm],[Dm,3,108e5],[Dm,6,216e5],[Dm,12,432e5],[Am,1,km],[[Eg,Dg],1,6048e5],[Fm,1,$m],[Fm,3,7776e6],[Om,1,Cm]];function Nm(t){const e=t.extent,n=t.maxbins||40,i=Math.abs(fd(e))/n;let r,o,s=Id((t=>t[2])).right(Tm,i);return s===Tm.length?(r=Om,o=sp(e[0]/Cm,e[1]/Cm,n)):s?(s=Tm[i/Tm[s-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ov,s:sv,S:Ey,u:Sy,U:My,V:Ay,w:Fy,W:Oy,x:null,X:null,y:Ty,Y:zy,Z:Ry,"%":rv},x={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Py,e:Py,f:qy,g:tv,G:nv,H:Iy,I:By,j:jy,L:Uy,m:Wy,M:Hy,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ov,s:sv,S:Vy,u:Yy,U:Gy,V:Zy,w:Jy,W:Qy,x:null,X:null,y:Ky,Y:ev,Z:iv,"%":rv},_={a:function(t,e,n){var i=d.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=h.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return $(t,e,n,i)},d:ly,e:ly,f:py,g:ry,G:iy,H:uy,I:uy,j:cy,L:dy,m:ay,M:fy,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:sy,Q:my,s:yy,S:hy,u:Km,U:ty,V:ey,w:Qm,W:ny,x:function(t,e,i){return $(t,n,e,i)},X:function(t,e,n){return $(t,i,e,n)},y:ry,Y:iy,Z:oy,"%":gy};function w(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Lm(Rm(o.y,0,1))).getUTCDay(),i=r>4||0===r?fg.ceil(i):fg(i),i=Kp.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=zm(Rm(o.y,0,1))).getDay(),i=r>4||0===r?ig.ceil(i):ig(i),i=Qp.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Lm(Rm(o.y,0,1)).getUTCDay():zm(Rm(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Lm(o)):zm(o)}}function $(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=_[r in Wm?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),x.x=w(n,x),x.X=w(i,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Im,Bm,jm,Um,qm,Wm={"-":"",_:" ",0:"0"},Hm=/^\s*\d+/,Vm=/^%/,Ym=/[\\^$*+?|[\]().{}]/g;function Gm(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o[t.toLowerCase(),e])))}function Qm(t,e,n){var i=Hm.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Km(t,e,n){var i=Hm.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function ty(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function ey(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function ny(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function iy(t,e,n){var i=Hm.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ry(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function oy(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function sy(t,e,n){var i=Hm.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function ay(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function ly(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function cy(t,e,n){var i=Hm.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function uy(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function fy(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function hy(t,e,n){var i=Hm.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function dy(t,e,n){var i=Hm.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function py(t,e,n){var i=Hm.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function gy(t,e,n){var i=Vm.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function my(t,e,n){var i=Hm.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yy(t,e,n){var i=Hm.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function vy(t,e){return Gm(t.getDate(),e,2)}function by(t,e){return Gm(t.getHours(),e,2)}function xy(t,e){return Gm(t.getHours()%12||12,e,2)}function _y(t,e){return Gm(1+Qp.count(bg(t),t),e,3)}function wy(t,e){return Gm(t.getMilliseconds(),e,3)}function ky(t,e){return wy(t,e)+"000"}function $y(t,e){return Gm(t.getMonth()+1,e,2)}function Cy(t,e){return Gm(t.getMinutes(),e,2)}function Ey(t,e){return Gm(t.getSeconds(),e,2)}function Sy(t){var e=t.getDay();return 0===e?7:e}function My(t,e){return Gm(ng.count(bg(t)-1,t),e,2)}function Dy(t){var e=t.getDay();return e>=4||0===e?sg(t):sg.ceil(t)}function Ay(t,e){return t=Dy(t),Gm(sg.count(bg(t),t)+(4===bg(t).getDay()),e,2)}function Fy(t){return t.getDay()}function Oy(t,e){return Gm(ig.count(bg(t)-1,t),e,2)}function Ty(t,e){return Gm(t.getFullYear()%100,e,2)}function Ny(t,e){return Gm((t=Dy(t)).getFullYear()%100,e,2)}function zy(t,e){return Gm(t.getFullYear()%1e4,e,4)}function Ly(t,e){var n=t.getDay();return Gm((t=n>=4||0===n?sg(t):sg.ceil(t)).getFullYear()%1e4,e,4)}function Ry(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Gm(e/60|0,"0",2)+Gm(e%60,"0",2)}function Py(t,e){return Gm(t.getUTCDate(),e,2)}function Iy(t,e){return Gm(t.getUTCHours(),e,2)}function By(t,e){return Gm(t.getUTCHours()%12||12,e,2)}function jy(t,e){return Gm(1+Kp.count(xg(t),t),e,3)}function Uy(t,e){return Gm(t.getUTCMilliseconds(),e,3)}function qy(t,e){return Uy(t,e)+"000"}function Wy(t,e){return Gm(t.getUTCMonth()+1,e,2)}function Hy(t,e){return Gm(t.getUTCMinutes(),e,2)}function Vy(t,e){return Gm(t.getUTCSeconds(),e,2)}function Yy(t){var e=t.getUTCDay();return 0===e?7:e}function Gy(t,e){return Gm(ug.count(xg(t)-1,t),e,2)}function Xy(t){var e=t.getUTCDay();return e>=4||0===e?pg(t):pg.ceil(t)}function Zy(t,e){return t=Xy(t),Gm(pg.count(xg(t),t)+(4===xg(t).getUTCDay()),e,2)}function Jy(t){return t.getUTCDay()}function Qy(t,e){return Gm(fg.count(xg(t)-1,t),e,2)}function Ky(t,e){return Gm(t.getUTCFullYear()%100,e,2)}function tv(t,e){return Gm((t=Xy(t)).getUTCFullYear()%100,e,2)}function ev(t,e){return Gm(t.getUTCFullYear()%1e4,e,4)}function nv(t,e){var n=t.getUTCDay();return Gm((t=n>=4||0===n?pg(t):pg.ceil(t)).getUTCFullYear()%1e4,e,4)}function iv(){return"+0000"}function rv(){return"%"}function ov(t){return+t}function sv(t){return Math.floor(+t/1e3)}function av(t){const e={};return n=>e[n]||(e[n]=t(n))}function lv(t){const e=av(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=wp(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(t,e){return n=>{const i=t(n),r=i.indexOf(e);if(r<0)return i;let o=function(t,e){let n,i=t.lastIndexOf("e");if(i>0)return i;for(i=t.length;--i>e;)if(n=t.charCodeAt(i),n>=48&&n<=57)return i+1}(i,r);const s=or;)if("0"!==i[o]){++o;break}return i.slice(0,o)+s}}(e(n),e(".1f")(1)[1])}return e(n)},formatSpan(t,i,r,o){o=wp(null==o?",f":o);const s=sp(t,i,r),a=Math.max(Math.abs(t),Math.abs(i));let l;if(null==o.precision)switch(o.type){case"s":return isNaN(l=Np(s,a))||(o.precision=l),n(o,a);case"":case"e":case"g":case"p":case"r":isNaN(l=zp(s,a))||(o.precision=l-("e"===o.type));break;case"f":case"%":isNaN(l=Tp(s))||(o.precision=l-2*("%"===o.type))}return e(o)}}}let cv,uv;function fv(){return cv=lv({format:Mp,formatPrefix:Dp})}function hv(t){return lv(Op(t))}function dv(t){return arguments.length?cv=hv(t):cv}function pv(t,e,n){lh(n=n||{})||Hf(`Invalid time multi-format specifier: ${n}`);const i=e(zg),r=e(Ng),o=e(Tg),s=e(Ag),a=e(Dg),l=e(Mg),c=e(Sg),u=e(Eg),f=t(n[Lg]||".%L"),h=t(n[zg]||":%S"),d=t(n[Ng]||"%I:%M"),p=t(n[Tg]||"%I %p"),g=t(n[Ag]||n[Fg]||"%a %d"),m=t(n[Dg]||"%b %d"),y=t(n[Mg]||"%B"),v=t(n[Sg]||"%B"),b=t(n[Eg]||"%Y");return t=>(i(t)rd(t)?e(t):pv(e,hm,t),utcFormat:t=>rd(t)?n(t):pv(n,dm,t),timeParse:av(t.parse),utcParse:av(t.utcParse)}}function mv(){return uv=gv({format:Bm,parse:jm,utcFormat:Um,utcParse:qm})}function yv(t){return gv(Pm(t))}function vv(t){return arguments.length?uv=yv(t):uv}!function(t){Im=Pm(t),Bm=Im.format,jm=Im.parse,Um=Im.utcFormat,qm=Im.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),fv(),mv();const bv=(t,e)=>qh({},t,e);function xv(t,e){const n=t?hv(t):dv(),i=e?yv(e):vv();return bv(n,i)}function _v(t,e){const n=arguments.length;return n&&2!==n&&Hf("defaultLocale expects either zero or two arguments."),n?bv(dv(t),vv(e)):bv(dv(),vv())}const wv=/^(data:|([A-Za-z]+:)?\/\/)/,kv=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,$v=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Cv="file://";async function Ev(t,e){const n=await this.sanitize(t,e),i=n.href;return n.localFile?this.file(i):this.http(i,e)}async function Sv(t,e){e=qh({},this.options,e);const n=this.fileAccess,i={href:null};let r,o,s;const a=kv.test(t.replace($v,""));null!=t&&"string"==typeof t&&a||Hf("Sanitize failure, invalid URI: "+hd(t));const l=wv.test(t);return(s=e.baseURL)&&!l&&(t.startsWith("/")||s.endsWith("/")||(t="/"+t),t=s+t),o=(r=t.startsWith(Cv))||"file"===e.mode||"http"!==e.mode&&!l&&n,r?t=t.slice(Cv.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(i,"localFile",{value:!!o}),i.href=t,e.target&&(i.target=e.target+""),e.rel&&(i.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(i.crossOrigin=e.crossOrigin+""),i}function Mv(t){return t?e=>new Promise(((n,i)=>{t.readFile(e,((t,e)=>{t?i(t):n(e)}))})):Dv}async function Dv(){Hf("No file system access.")}function Av(t){return t?async function(e,n){const i=qh({},this.options.http,n),r=n&&n.response,o=await t(e,i);return o.ok?Nh(o[r])?o[r]():o.text():Hf(o.status+""+o.statusText)}:Fv}async function Fv(){Hf("No HTTP fetch method available.")}const Ov=t=>null!=t&&t==t,Tv=t=>!(Number.isNaN(+t)||t instanceof Date),Nv={boolean:dd,integer:ph,number:ph,date:gd,string:md,unknown:Xf},zv=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>Tv(t)&&Number.isInteger(+t),Tv,t=>!Number.isNaN(Date.parse(t))],Lv=["boolean","integer","number","date"];function Rv(t,e){if(!t||!t.length)return"unknown";const n=t.length,i=zv.length,r=zv.map(((t,e)=>e+1));for(let o,s,a=0,l=0;a0===t?e:t),0)-1]}function Pv(t,e){return e.reduce(((e,n)=>(e[n]=Rv(t,n),e)),{})}function Iv(t){const e=function(e,n){const i={delimiter:t};return Bv(e,n?qh(n,i):i)};return e.responseType="text",e}function Bv(t,e){return e.header&&(t=e.header.map(hd).join(e.delimiter)+"\n"+t),Dd(e.delimiter).parse(t+"")}function jv(t,e){const n=e&&e.property?Yf(e.property):Xf;return!lh(t)||(i=t,"function"==typeof Buffer&&Nh(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(t)):function(t,e){!ah(t)&&ed(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var i}Bv.responseType="text",jv.responseType="json";const Uv={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function qv(t,e){let n,i,r,o;return t=jv(t,e),e&&e.feature?(n=Fd,r=e.feature):e&&e.mesh?(n=zd,r=e.mesh,o=Uv[e.filter]):Hf("Missing TopoJSON feature or mesh parameter."),i=(i=t.objects[r])?n(t,i,o):Hf("Invalid TopoJSON object: "+r),i&&i.features||[i]}qv.responseType="json";const Wv={dsv:Bv,csv:Iv(","),tsv:Iv("\t"),json:jv,topojson:qv};function Hv(t,e){return arguments.length>1?(Wv[t]=e,this):Yh(Wv,t)?Wv[t]:null}function Vv(t){const e=Hv(t);return e&&e.responseType||"text"}function Yv(t,e,n,i){const r=Hv((e=e||{}).type||"json");return r||Hf("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n,i){if(!t.length)return;const r=vv();n=n||r.timeParse,i=i||r.utcParse;let o,s,a,l,c,u,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=Pv(t,f));f=Object.keys(e);const h=f.map((t=>{const r=e[t];let o,s;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){o=r.split(/:(.+)?/,2),s=o[1],("'"===s[0]&&"'"===s[s.length-1]||'"'===s[0]&&'"'===s[s.length-1])&&(s=s.slice(1,-1));return("utc"===o[0]?i:n)(s)}if(!Nv[r])throw Error("Illegal format pattern: "+t+":"+r);return Nv[r]}));for(a=0,c=t.length,u=f.length;a({options:n||{},sanitize:Sv,load:Ev,fileAccess:!!e,file:Mv(e),http:Av(t)})}("undefined"!=typeof fetch&&fetch,null);function Xv(t){const e=t||Xf,n=[],i={};return n.add=t=>{const r=e(t);return i[r]||(i[r]=1,n.push(t)),n},n.remove=t=>{const r=e(t);if(i[r]){i[r]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function Zv(t,e){try{await e(t)}catch(e){t.error(e)}}const Jv=Symbol("vega_id");let Qv=1;function Kv(t){return!(!t||!tb(t))}function tb(t){return t[Jv]}function eb(t,e){return t[Jv]=e,t}function nb(t){const e=t===Object(t)?t:{data:t};return tb(e)?e:eb(e,Qv++)}function ib(t){return rb(t,nb({}))}function rb(t,e){for(const n in t)e[n]=t[n];return e}function ob(t,e){return eb(e,tb(t))}function sb(t,e){return t?e?(n,i)=>t(n,i)||tb(e(n))-tb(e(i)):(e,n)=>t(e,n)||tb(e)-tb(n):null}function ab(t){return t&&t.constructor===lb}function lb(){const t=[],e=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:lb,insert(e){const n=Oh(e),i=n.length;for(let e=0;e{p(t)&&(c[tb(t)]=-1)}));for(f=0,h=t.length;f0&&(y(g,p,d.value),a.modifies(p));for(f=0,h=r.length;f{p(t)&&c[tb(t)]>0&&y(t,d.field,d.value)})),a.modifies(d.field);if(s)a.mod=e.length||i.length?l.filter((t=>c[tb(t)]>0)):l.slice();else for(m in u)a.mod.push(u[m]);return(o||null==o&&(e.length||i.length))&&a.clean(!0),a}}}const cb="_:mod:_";function ub(){Object.defineProperty(this,cb,{writable:!0,value:{}})}ub.prototype={set(t,e,n,i){const r=this,o=r[t],s=r[cb];return null!=e&&e>=0?(o[e]!==n||i)&&(o[e]=n,s[e+":"+t]=-1,s[t]=-1):(o!==n||i)&&(r[t]=n,s[t]=ah(n)?1+n.length:-1),r},modified(t,e){const n=this[cb];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(ah(t)){for(let e=0;e=0?e+1{s instanceof db?(s!==this&&(e&&s.targets().add(this),o.push(s)),r.push({op:s,name:t,index:n})):i.set(t,n,s)};for(s in t)if(a=t[s],"pulse"===s)Oh(a).forEach((t=>{t instanceof db?t!==this&&(t.targets().add(this),o.push(t)):Hf("Pulse parameters must be operator instances.")})),this.source=a;else if(ah(a))for(i.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=yb();return this.targets().add(yb(null,null,Uh(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(yb(null,null,(()=>n=!0))),e.targets().add(yb(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=Qf,this._targets=null}};const vb={skip:!0};function bb(t,e,n,i,r,o){const s=qh({},o,vb);let a,l;Nh(n)||(n=jh(n)),void 0===i?a=e=>t.touch(n(e)):Nh(i)?(l=new db(null,i,r,!1),a=e=>{l.evaluate(e);const i=n(e),r=l.value;ab(r)?t.pulse(i,r,o):t.update(i,r,s)}):a=e=>t.update(n(e),i,s),e.apply(a)}function xb(t,e,n,i,r,o){if(void 0===i)e.targets().add(n);else{const s=o||{},a=new db(null,function(t,e){return e=Nh(e)?e:jh(e),t?function(n,i){const r=e(n,i);return t.skip()||(t.skip(r!==this.value).value=r),r}:e}(n,i),r,!1);a.modified(s.force),a.rank=e.rank,e.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),t.connect(n,[a]))}}const _b={};function wb(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function kb(t,e){const n=[];return bd(t,e,(t=>n.push(t))),n}function $b(t,e){const n={};return t.visit(e,(t=>{n[tb(t)]=1})),t=>n[tb(t)]?null:t}function Cb(t,e){return t?(n,i)=>t(n,i)&&e(n,i):e}function Eb(t,e,n,i){const r=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=i||null,this.pulses=n;for(const t of n)if(t.stamp===e){if(t.fields){const e=r.fields||(r.fields={});for(const n in t.fields)e[n]=1}t.changed(r.ADD)&&(o|=r.ADD),t.changed(r.REM)&&(o|=r.REM),t.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}function Sb(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}wb.prototype={StopPropagation:_b,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new wb(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new wb(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,$b(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return ah(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?ah(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=Cb(n.addF,e)),2&t&&(n.remF=Cb(n.remF,e)),4&t&&(n.modF=Cb(n.modF,e)),16&t&&(n.srcF=Cb(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=kb(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=kb(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=kb(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,i=e;if(16&t)return bd(n.source,n.srcF,i),n;1&t&&bd(n.add,n.addF,i),2&t&&bd(n.rem,n.remF,i),4&t&&bd(n.mod,n.modF,i);const r=n.source;if(8&t&&r){const t=n.add.length+n.mod.length;t===r.length||bd(r,t?$b(n,5):n.srcF,i)}return n}},Jh(Eb,wb,{fork(t){const e=new wb(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?ah(t)?t.some((t=>n[t])):n[t]:0},filter(){Hf("MultiPulse does not support filtering.")},materialize(){Hf("MultiPulse does not support materialization.")},visit(t,e){const n=this,i=n.pulses,r=i.length;let o=0;if(t&n.SOURCE)for(;oe=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Ab(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let i;return e.length?(i=e[0],e[0]=n,function(t,e,n){const i=e,r=t.length,o=t[e];let s,a=1+(e<<1);for(;a=0&&(a=s),t[e]=t[a],a=1+((e=a)<<1);t[e]=o,Ab(t,i,e,n)}(e,0,t)):i=n,i}}}function Ab(t,e,n,i){let r,o;const s=t[n];for(;n>e&&(o=n-1>>1,r=t[o],i(s,r)<0);)t[n]=r,n=o;return t[n]=s}function Fb(){this.logger(sh()),this.logLevel(nh),this._clock=0,this._rank=0,this._locale=_v();try{this._loader=Gv()}catch(t){}this._touched=Xv(Gf),this._input={},this._pulse=null,this._heap=Db(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function Ob(t){return function(){return this._log[t].apply(this,arguments)}}function Tb(t,e){db.call(this,t,null,e)}Fb.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:Ob("error"),warn:Ob("warn"),info:Ob("info"),debug:Ob("debug"),logLevel:Ob("level"),cleanThreshold:1e4,add:function(t,e,n,i){let r,o=1;return t instanceof db?r=t:t&&t.prototype instanceof db?r=new t:Nh(t)?r=new db(null,t):(o=0,r=new db(t,e)),this.rank(r),o&&(i=n,n=e),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(t,e){const n=t.rank,i=e.length;for(let r=0;r=0;)e.push(n=i[r]),n===t&&Hf("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||Mb);const i=new wb(this,this._clock+(this._pulse?0:1)),r=t.pulse&&t.pulse.source||[];return i.target=t,this._input[t.id]=e.pulse(i,r),this},touch:function(t,e){const n=e||Mb;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const i=n||Mb;return(t.set(e)||i.force)&&this.touch(t,i),this},changeset:lb,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Yv(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const i=this,r=i._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(i);r.requests+=1;const o=await i.request(e,n);return i.pulse(t,i.changeset().remove(Qf).insert(o.data||[])),r.done(),o},request:async function(t,e){const n=this;let i,r=0;try{i=await n.loader().load(t,{context:"dataflow",response:Vv(e&&e.type)});try{i=n.parse(i,e)}catch(e){r=-2,n.warn("Data ingestion failed",t,e)}}catch(e){r=-1,n.warn("Loading failed",t,e)}return{data:i,status:r}},events:function(t,e,n,i){const r=this,o=yb(n,i),s=function(t){t.dataflow=r;try{o.receive(t)}catch(t){r.error(t)}finally{r.run()}};let a;a="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):Oh(t);const l=a.length;for(let t=0;ti._enqueue(t,!0))),i._touched=Xv(Gf);let s,a,l,c=0;try{for(;i._heap.size()>0;)s=i._heap.pop(),s.rank===s.qrank?(a=s.run(i._getPulse(s,t)),a.then?a=await a:a.async&&(r.push(a.async),a=_b),a!==_b&&s._targets&&s._targets.forEach((t=>i._enqueue(t))),++c):i._enqueue(s,!0)}catch(t){i._heap.clear(),l=t}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${c} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const t=i._postrun.sort(((t,e)=>e.priority-t.priority));i._postrun=[];for(let e=0;ei.runAsync(null,(()=>{t.forEach((t=>{try{t(i)}catch(t){i.error(t)}}))})))),i},run:function(t,e,n){return this._pulse?Sb(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(i,i),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stampt.pulse)),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==_b&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},Jh(Tb,db,{run(t){if(t.stampthis.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const Nb={};function zb(t){const e=Lb(t);return e&&e.Definition||null}function Lb(t){return t=t&&t.toLowerCase(),Yh(Nb,t)?Nb[t]:null}function*Rb(t,e){if(null==e)for(let e of t)null!=e&&""!==e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let i of t)i=e(i,++n,t),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function Pb(t,e,n){const i=Float64Array.from(Rb(t,n));return i.sort(Rd),e.map((t=>hp(i,t)))}function Ib(t,e){return Pb(t,[.25,.5,.75],e)}function Bb(t,e){const n=t.length,i=function(t,e){const n=function(t,e){let n,i=0,r=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-r,r+=n/++i,o+=n*(e-r));else{let s=-1;for(let a of t)null!=(a=e(a,++s,t))&&(a=+a)>=a&&(n=a-r,r+=n/++i,o+=n*(a-r))}if(i>1)return o/(i-1)}(t,e);return n?Math.sqrt(n):n}(t,e),r=Ib(t,e),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function jb(t){const e=t.maxbins||20,n=t.base||10,i=Math.log(n),r=t.divide||[5,2];let o,s,a,l,c,u,f=t.extent[0],h=t.extent[1];const d=t.span||h-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(l=d/e,c=0,u=t.steps.length;ce;)o*=n;for(c=0,u=r.length;c=a&&d/l<=e&&(o=l)}l=Math.log(o);const p=l>=0?0:1+~~(-l/i),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(l=Math.floor(f/o+g)*o,f=ft);const r=t.length,o=new Float64Array(r);let s,a=0,l=1,c=i(t[0]),u=c,f=c+e;for(;l=f){for(u=(c+u)/2;a>1);rs;)t[r--]=t[o]}o=s,s=i}return t}(o,e+e/4):o}const Hb=Math.sqrt(2*Math.PI),Vb=Math.SQRT2;let Yb=NaN;function Gb(t,e){t=t||0,e=null==e?1:e;let n,i,r=0,o=0;if(Yb==Yb)r=Yb,Yb=NaN;else{do{r=2*Ub()-1,o=2*Ub()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,Yb=o*i}return t+r*e}function Xb(t,e,n){const i=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*Hb)}function Zb(t,e,n){const i=(t-(e=e||0))/(n=null==n?1:n),r=Math.abs(i);let o;if(r>37)o=0;else{const t=Math.exp(-r*r/2);let e;r<7.07106781186547?(e=.0352624965998911*r+.700383064443688,e=e*r+6.37396220353165,e=e*r+33.912866078383,e=e*r+112.079291497871,e=e*r+221.213596169931,e=e*r+220.206867912376,o=t*e,e=.0883883476483184*r+1.75566716318264,e=e*r+16.064177579207,e=e*r+86.7807322029461,e=e*r+296.564248779674,e=e*r+637.333633378831,e=e*r+793.826512519948,e=e*r+440.413735824752,o/=e):(e=r+.65,e=r+4/e,e=r+3/e,e=r+2/e,e=r+1/e,o=t/e/2.506628274631)}return i>0?1-o:o}function Jb(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*Vb*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function Qb(t,e){let n,i;const r={mean(t){return arguments.length?(n=t||0,r):n},stdev(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>Gb(n,i),pdf:t=>Xb(t,n,i),cdf:t=>Zb(t,n,i),icdf:t=>Jb(t,n,i)};return r.mean(t).stdev(e)}function Kb(t,e){const n=Qb();let i=0;const r={data(n){return arguments.length?(t=n,i=n?n.length:0,r.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=Bb(t)),r):e},sample:()=>t[~~(Ub()*i)]+e*n.sample(),pdf(r){let o=0,s=0;for(;stx(n,i),pdf:t=>ex(t,n,i),cdf:t=>nx(t,n,i),icdf:t=>ix(t,n,i)};return r.mean(t).stdev(e)}function ox(t,e){let n,i=0;const r={weights(t){return arguments.length?(n=function(t){const e=[];let n,r=0;for(n=0;n=e&&t<=n?1/(n-e):0}function lx(t,e,n){return null==n&&(n=null==e?1:e,e=0),tn?1:(t-e)/(n-e)}function cx(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function ux(t,e){let n,i;const r={min(t){return arguments.length?(n=t||0,r):n},max(t){return arguments.length?(i=null==t?1:t,r):i},sample:()=>sx(n,i),pdf:t=>ax(t,n,i),cdf:t=>lx(t,n,i),icdf:t=>cx(t,n,i)};return null==e&&(e=null==t?1:t,t=0),r.min(t).max(e)}function fx(t,e,n){let i=0,r=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(i+=(t-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function hx(t,e,n,i){const r=i-t*t,o=Math.abs(r)<1e-24?0:(n-t*e)/r;return[e-o*t,o]}function dx(t,e,n,i){t=t.filter((t=>{let i=e(t),r=n(t);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r})),i&&t.sort(((t,n)=>e(t)-e(n)));const r=t.length,o=new Float64Array(r),s=new Float64Array(r);let a,l,c,u=0,f=0,h=0;for(c of t)o[u]=a=+e(c),s[u]=l=+n(c),++u,f+=(a-f)/u,h+=(l-h)/u;for(u=0;u=r&&null!=o&&(o=+o)>=o&&i(r,o,++s)}function gx(t,e,n,i,r){let o=0,s=0;return px(t,e,n,((t,e)=>{const n=e-r(t),a=e-i;o+=n*n,s+=a*a})),1-o/s}function mx(t,e,n){let i=0,r=0,o=0,s=0,a=0;px(t,e,n,((t,e)=>{++a,i+=(t-i)/a,r+=(e-r)/a,o+=(t*e-o)/a,s+=(t*t-s)/a}));const l=hx(i,r,o,s),c=t=>l[0]+l[1]*t;return{coef:l,predict:c,rSquared:gx(t,e,n,r,c)}}function yx(t,e,n){let i=0,r=0,o=0,s=0,a=0;px(t,e,n,((t,e)=>{++a,t=Math.log(t),i+=(t-i)/a,r+=(e-r)/a,o+=(t*e-o)/a,s+=(t*t-s)/a}));const l=hx(i,r,o,s),c=t=>l[0]+l[1]*Math.log(t);return{coef:l,predict:c,rSquared:gx(t,e,n,r,c)}}function vx(t,e,n){const[i,r,o,s]=dx(t,e,n);let a,l,c,u=0,f=0,h=0,d=0,p=0;px(t,e,n,((t,e)=>{a=i[p++],l=Math.log(e),c=a*e,u+=(e*l-u)/p,f+=(c-f)/p,h+=(c*l-h)/p,d+=(a*c-d)/p}));const[g,m]=hx(f/s,u/s,h/s,d/s),y=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:gx(t,e,n,s,y)}}function bx(t,e,n){let i=0,r=0,o=0,s=0,a=0,l=0;px(t,e,n,((t,e)=>{const n=Math.log(t),c=Math.log(e);++l,i+=(n-i)/l,r+=(c-r)/l,o+=(n*c-o)/l,s+=(n*n-s)/l,a+=(e-a)/l}));const c=hx(i,r,o,s),u=t=>c[0]*Math.pow(t,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:gx(t,e,n,a,u)}}function xx(t,e,n){const[i,r,o,s]=dx(t,e,n),a=i.length;let l,c,u,f,h=0,d=0,p=0,g=0,m=0;for(l=0;lb*(t-=o)*t+x*t+_+s;return{coef:[_-x*o+b*o*o+s,x-2*b*o,b],predict:w,rSquared:gx(t,e,n,s,w)}}function _x(t,e,n,i){if(0===i)return fx(t,e,n);if(1===i)return mx(t,e,n);if(2===i)return xx(t,e,n);const[r,o,s,a]=dx(t,e,n),l=r.length,c=[],u=[],f=i+1;let h,d,p,g,m;for(h=0;hMath.abs(t[i][s])&&(s=r);for(o=i;o=i;o--)t[o][r]-=t[o][i]*t[i][r]/t[i][i]}for(r=e-1;r>=0;--r){for(a=0,o=r+1;o{t-=s;let e=a+y[0]+y[1]*t+y[2]*t*t;for(h=3;h=0;--o)for(a=e[o],l=1,r[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*l;return r[0]+=i,r}function kx(t,e,n,i){const[r,o,s,a]=dx(t,e,n,!0),l=r.length,c=Math.max(2,~~(i*l)),u=new Float64Array(l),f=new Float64Array(l),h=new Float64Array(l).fill(1);for(let t=-1;++t<=2;){const e=[0,c-1];for(let t=0;tr[s]-n?i:s;let l=0,c=0,d=0,p=0,g=0;const m=1/Math.abs(r[a]-n||1);for(let t=i;t<=s;++t){const e=r[t],i=o[t],s=$x(Math.abs(n-e)*m)*h[t],a=e*s;l+=s,c+=a,d+=i*s,p+=i*a,g+=e*a}const[y,v]=hx(c/l,d/l,p/l,g/l);u[t]=y+v*n,f[t]=Math.abs(o[t]-u[t]),Cx(r,t+1,e)}if(2===t)break;const n=dp(f);if(Math.abs(n)<1e-12)break;for(let t,e,i=0;i=1?1e-12:(e=1-t*t)*e}return function(t,e,n,i){const r=t.length,o=[];let s,a=0,l=0,c=[];for(;a=t.length))for(;e>r&&t[o]-i<=i-t[r];)n[0]=++r,n[1]=o,++o}const Ex=.5*Math.PI/180;function Sx(t,e,n,i){n=n||25,i=Math.max(n,i||200);const r=e=>[e,t(e)],o=e[0],s=e[1],a=s-o,l=a/i,c=[r(o)],u=[];if(n===i){for(let t=1;t0;)u.push(r(o+t/n*a));let f=c[0],h=u[u.length-1];const d=1/a,p=function(t,e){let n=t,i=t;const r=e.length;for(let t=0;ti&&(i=r)}return 1/(i-n)}(f[1],u);for(;h;){const t=r((f[0]+h[0])/2);t[0]-f[0]>=l&&Mx(f,t,h,d,p)>Ex?u.push(t):(f=h,c.push(h),u.pop()),h=u[u.length-1]}return c}function Mx(t,e,n,i,r){const o=Math.atan2(r*(n[1]-t[1]),i*(n[0]-t[0])),s=Math.atan2(r*(e[1]-t[1]),i*(e[0]-t[0]));return Math.abs(o-s)}function Dx(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},Ox={init:Fx,add:Fx,rem:Fx,idx:0},Tx={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0,t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):void 0,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):void 0,req:["exponential"],idx:1}},Nx=Object.keys(Tx).filter((t=>"__count__"!==t));function zx(t,e,n){return Tx[t](n,e)}function Lx(t,e){return t.idx-e.idx}function Rx(){this.valid=0,this.missing=0,this._ops.forEach((t=>null==t.aggregate_param?t.init(this):t.init(this,t.aggregate_param)))}function Px(t,e){null!=t&&""!==t?t==t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function Ix(t,e){null!=t&&""!==t?t==t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function Bx(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function jx(t,e){const n=e||Xf,i=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=Tx[t]())}))};return t.forEach(n),Object.values(e).sort(Lx)}(t),r=t.slice().sort(Lx);function o(t){this._ops=i,this._out=r,this.cell=t,this.init()}return o.prototype.init=Rx,o.prototype.add=Px,o.prototype.rem=Ix,o.prototype.set=Bx,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function Ux(t){this._key=t?Yf(t):tb,this.reset()}[...Nx,"__count__"].forEach((t=>{Tx[t]=function(t,e){return(n,i)=>qh({name:t,aggregate_param:i,out:n||t},Ox,e)}(t,Tx[t])}));const qx=Ux.prototype;function Wx(t){Tb.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}qx.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},qx.add=function(t){this._add.push(t)},qx.rem=function(t){this._rem.push(t)},qx.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,i=t.length,r=e.length,o=Array(i-r),s={};let a,l,c;for(a=0;a=0;)i=t(e[r])+"",Yh(n,i)||(n[i]=1,++o);return o},qx.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=Hh(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},qx.argmin=function(t){return this.extent(t)[0]||{}},qx.argmax=function(t){return this.extent(t)[1]||{}},qx.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},qx.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},qx.quartile=function(t){return this._get===t&&this._q||(this._q=Ib(this.values(),t),this._get=t),this._q},qx.q1=function(t){return this.quartile(t)[0]},qx.q2=function(t){return this.quartile(t)[1]},qx.q3=function(t){return this.quartile(t)[2]},qx.ci=function(t){return this._get===t&&this._ci||(this._ci=qb(this.values(),1e3,.05,t),this._get=t),this._ci},qx.ci0=function(t){return this.ci(t)[0]},qx.ci1=function(t){return this.ci(t)[1]},Wx.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Nx},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},Jh(Wx,Tb,{transform(t,e){const n=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.modified();return n.stamp=i.stamp,n.value&&(r||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(t):Object.create(null),e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),i.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&i.clean(!0).runAfter((()=>this.clean())),n.changes(i)},cross(){const t=this,e=t.value,n=t._dnames,i=n.map((()=>({}))),r=n.length;function o(t){let e,o,s,a;for(e in t)for(s=t[e].tuple,o=0;o{const e=Bf(t);return r(t),n.push(e),e})),this.cellkey=t.key?t.key:Dx(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],s=t.ops||["count"],a=t.aggregate_params||[null],l=t.as||[],c=o.length,u={};let f,h,d,p,g,m,y;for(c!==s.length&&Hf("Unmatched number of fields and aggregate ops."),y=0;yjx(t,t.field))),Object.create(null)},cellkey:Dx(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stampo.push(t),remove:t=>s[i(t)]=++a,size:()=>r.length,data:(t,e)=>(a&&(r=r.filter((t=>!s[i(t)])),s={},a=0),e&&t&&r.sort(t),o.length&&(r=t?ld(t,r,o.sort(t)):r.concat(o),o=[]),r)}}function Yx(t){Tb.call(this,[],t)}function Gx(t){db.call(this,null,Xx,t)}function Xx(t){return this.value&&!t.modified()?this.value:Lh(t.fields,t.orders)}function Zx(t){Tb.call(this,null,t)}function Jx(t){Tb.call(this,null,t)}Hx.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Jh(Hx,Tb,{transform(t,e){const n=!1!==t.interval,i=this._bins(t),r=i.start,o=i.step,s=t.as||["bin0","bin1"],a=s[0],l=s[1];let c;return c=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(jf(t.field))?e.ADD_MOD:e.ADD,e.visit(c,n?t=>{const e=i(t);t[a]=e,t[l]=null==e?null:r+o*(1+(e-r)/o)}:t=>t[a]=i(t)),e.modifies(n?s:a)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=jb(t),i=n.step;let r,o,s=n.start,a=s+Math.ceil((n.stop-s)/i)*i;null!=(r=t.anchor)&&(o=r-(s+i*Math.floor((r-s)/i)),s+=o,a+=o);const l=function(t){let n=ph(e(t));return null==n?null:na?1/0:(n=Math.max(s,Math.min(n,a-i)),s+i*Math.floor(1e-14+(n-s)/i))};return l.start=s,l.stop=n.stop,l.step=i,this.value=If(l,jf(e),t.name||"bin_"+Bf(e))}}),Yx.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Jh(Yx,Tb,{transform(t,e){const n=e.fork(e.ALL),i=Vx(tb,this.value,n.materialize(n.ADD).add),r=t.sort,o=e.changed()||r&&(t.modified("sort")||e.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(sb(r),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),Jh(Gx,db),Zx.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},Jh(Zx,Tb,{transform(t,e){const n=e=>n=>{for(var i,r=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(a(n),t.case,o)||[],l=0,c=r.length;lr[t]=1+(r[t]||0))),u=n((t=>r[t]-=1));return i?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,l)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,i=this._tuples||(this._tuples={}),r=e[0],o=e[1],s=t.fork(t.NO_SOURCE|t.NO_FIELDS);let a,l,c;for(a in n)l=i[a],c=n[a]||0,!l&&c?(i[a]=l=nb({}),l[r]=a,l[o]=c,s.add.push(l)):0===c?(l&&s.rem.push(l),n[a]=null,i[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(e)}}),Jx.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Jh(Jx,Tb,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.as||["a","b"],r=i[0],o=i[1],s=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,i){for(var r,o,s=[],a={},l=t.length,c=0;ct_(t,e)))):typeof i[n]===Kx&&i[n](t[n]);return i}function e_(t){Tb.call(this,null,t)}const n_=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],i_={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:n_},{name:"weights",type:"number",array:!0}]};function r_(t,e){return t?t.map(((t,n)=>e[n]||Bf(t))):null}function o_(t,e,n){const i=[],r=t=>t(l);let o,s,a,l,c,u;if(null==e)i.push(t.map(n));else for(o={},s=0,a=t.length;st.materialize(t.SOURCE).source}(e)),r=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let s=t.method||"pdf";"pdf"!==s&&"cdf"!==s&&Hf("Invalid density method: "+s),t.extent||i.data||Hf("Missing density extent parameter."),s=i[s];const a=t.as||["value","density"],l=Sx(s,t.extent||Wh(i.data()),r,o).map((t=>{const e={};return e[a[0]]=t[0],e[a[1]]=t[1],nb(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function s_(t){Tb.call(this,null,t)}s_.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function a_(t){db.call(this,null,l_,t),this.modified(!0)}function l_(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:If((n=>e(n,t)),jf(e),Bf(e))}function c_(t){Tb.call(this,[void 0,void 0],t)}function u_(t,e){db.call(this,t),this.parent=e,this.count=0}function f_(t){Tb.call(this,{},t),this._keys=Xh();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,i=e.active;nYf(t))):Yf(t.name,t.as)}function p_(t){Tb.call(this,Xh(),t)}function g_(t){Tb.call(this,[],t)}function m_(t){Tb.call(this,[],t)}function y_(t){Tb.call(this,null,t)}function v_(t){Tb.call(this,[],t)}Jh(s_,Tb,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,i=o_(e.source,t.groupby,Xf),r=t.smooth||!1,o=t.field,s=t.step||((t,e)=>fd(Wh(t,e))/30)(n,o),a=sb(((t,e)=>o(t)-o(e))),l=t.as||"bin",c=i.length;let u,f=1/0,h=-1/0,d=0;for(;dh&&(h=e),t[++u][l]=e}return this.value={start:f,stop:h,step:s},e.reflow(!0).modifies(l)}}),Jh(a_,db),c_.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Jh(c_,Tb,{transform(t,e){const n=this.value,i=t.field,r=e.changed()||e.modified(i.fields)||t.modified("field");let o=n[0],s=n[1];if((r||null==o)&&(o=1/0,s=-1/0),e.visit(r?e.SOURCE:e.ADD,(t=>{const e=ph(i(t));null!=e&&(es&&(s=e))})),!Number.isFinite(o)||!Number.isFinite(s)){let t=Bf(i);t&&(t=` for field "${t}"`),e.dataflow.warn(`Infinite extent${t}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}}),Jh(u_,db,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),Jh(f_,Tb,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,i){const r=this.value;let o,s,a=Yh(r,t)&&r[t];return a?a.value.stampt&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,i=t?t.length:0;let r=0;for(;rthis.subflow(t,r,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=tb(t),n=o.get(e);void 0!==n&&(o.delete(e),a(n).rem(t))})),e.visit(e.ADD,(t=>{const e=i(t);o.set(tb(t),e),a(e).add(t)})),s||e.modified(i.fields)?e.visit(e.MOD,(t=>{const e=tb(t),n=o.get(e),r=i(t);n===r?a(r).mod(t):(o.set(e,r),a(n).rem(t),a(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{a(o.get(tb(t))).mod(t)})),s&&e.visit(e.REFLOW,(t=>{const e=tb(t),n=o.get(e),r=i(t);n!==r&&(o.set(e,r),a(n).rem(t),a(r).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),Jh(h_,db),p_.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Jh(p_,Tb,{transform(t,e){const n=e.dataflow,i=this.value,r=e.fork(),o=r.add,s=r.rem,a=r.mod,l=t.expr;let c=!0;function u(e){const n=tb(e),r=l(e,t),u=i.get(n);r&&u?(i.delete(n),o.push(e)):r||u?c&&r&&!u&&a.push(e):(i.set(n,1),s.push(e))}return e.visit(e.REM,(t=>{const e=tb(t);i.has(e)?i.delete(e):s.push(t)})),e.visit(e.ADD,(e=>{l(e,t)?o.push(e):i.set(tb(e),1)})),e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),g_.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Jh(g_,Tb,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=r_(i,t.as||[]),o=t.index||null,s=r.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=i.map((e=>e(t))),a=e.reduce(((t,e)=>Math.max(t,e.length)),0);let l,c,u,f=0;for(;f{for(let e,o=0;oe[i]=n(e,t)))}}),Jh(v_,Tb,{transform(t,e){const n=e.fork(e.ALL),i=t.generator;let r,o,s,a=this.value,l=t.size-a.length;if(l>0){for(r=[];--l>=0;)r.push(s=nb(i(t))),a.push(s);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else o=a.slice(0,-l),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,a=a.slice(-l);return n.source=this.value=a,n}});const b_={value:"value",median:dp,mean:function(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n},min:lp,max:ap},x_=[];function __(t){Tb.call(this,[],t)}function w_(t){Wx.call(this,t)}function k_(t){Tb.call(this,null,t)}function $_(t){db.call(this,null,C_,t)}function C_(t){return this.value&&!t.modified()?this.value:od(t.fields,t.flat)}function E_(t){Tb.call(this,[],t),this._pending=null}function S_(t,e,n){n.forEach(nb);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);return i.rem=t.value,t.value=i.source=i.add=n,t._pending=null,i.rem.length&&i.clean(!0),i}function M_(t){Tb.call(this,{},t)}function D_(t){db.call(this,null,A_,t)}function A_(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let i,r,o=1/0,s=-1/0;for(i=0;is&&(s=r[1]);return[o,s]}function F_(t){db.call(this,null,O_,t)}function O_(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function T_(t){Tb.call(this,null,t)}function N_(t){Wx.call(this,t)}function z_(t){f_.call(this,t)}function L_(t){Tb.call(this,null,t)}function R_(t){Tb.call(this,null,t)}function P_(t){Tb.call(this,null,t)}__.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Jh(__,Tb,{transform(t,e){var n,i,r,o,s,a,l,c,u,f,h=e.fork(e.ALL),d=function(t){var e,n=t.method||b_.value;if(null!=b_[n])return n===b_.value?(e=void 0!==t.value?t.value:0,()=>e):b_[n];Hf("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=Bf(t.field),m=Bf(t.key),y=(t.groupby||[]).map(Bf),v=function(t,e,n,i){var r,o,s,a,l,c,u,f,h=t=>t(f),d=[],p=i?i.slice():[],g={},m={};for(p.forEach(((t,e)=>g[t]=e+1)),a=0,u=t.length;an.add(t)))):(r=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{qh(t,r[n.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,i;for(n=0,i=this._alen;n{const n=Kb(e,s)[a],i=t.counts?e.length:1;Sx(n,u||Wh(e),f,h).forEach((t=>{const n={};for(let t=0;t(this._pending=Oh(t.data),t=>t.touch(this))));return{async:e}}return n.request(t.url,t.format).then((t=>S_(this,e,Oh(t.data))))}}),M_.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Jh(M_,Tb,{transform(t,e){const n=t.fields,i=t.index,r=t.values,o=null==t.default?null:t.default,s=t.modified(),a=n.length;let l,c,u,f=s?e.SOURCE:e.ADD,h=e,d=t.as;return r?(c=r.length,a>1&&!d&&Hf('Multi-field lookup requires explicit "as" parameter.'),d&&d.length!==a*c&&Hf('The "as" parameter has too few output field names.'),d=d||r.map(Bf),l=function(t){for(var e,s,l=0,u=0;le.modified(t.fields))),f|=u?e.MOD:0),e.visit(f,l),h.modifies(d)}}),Jh(D_,db),Jh(F_,db),Jh(T_,Tb,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),N_.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Nx,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Jh(N_,Wx,{_transform:Wx.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,i=t.value,r=("count"===t.op?"__count__":t.op)||"sum",o=jf(n).concat(jf(i)),s=function(t,e,n){const i={},r=[];return n.visit(n.SOURCE,(e=>{const n=t(e);i[n]||(i[n]=1,r.push(n))})),r.sort(Rh),e?r.slice(0,e):r}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:s.map((()=>r)),fields:s.map((t=>function(t,e,n,i){return If((i=>e(i)===t?n(i):NaN),i,t+"")}(t,n,i,o))),as:s.map((t=>t+"")),modified:t.modified.bind(t)}}(t,e),e)}}),Jh(z_,f_,{transform(t,e){const n=t.subflow,i=t.field,r=t=>this.subflow(tb(t),n,e,t);return(t.modified("field")||i&&e.modified(jf(i)))&&Hf("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(t=>{const e=r(t);i(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=r(t);i(t).forEach((t=>e.add(nb(t))))})),e.visit(e.REM,(t=>{const e=r(t);i(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>r(t).mod(t))),e.visit(e.ADD,(t=>r(t).add(t))),e.visit(e.REM,(t=>r(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),L_.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Jh(L_,Tb,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=r_(t.fields,t.as||[]),o=i?(t,e)=>function(t,e,n,i){for(let r=0,o=n.length;r{const e=tb(t);n.rem.push(s[e]),s[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,nb({}));s[tb(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,s[tb(t)]))})),n}}),Jh(R_,Tb,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),P_.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function I_(t){Tb.call(this,null,t)}function B_(t){Tb.call(this,[],t),this.count=0}function j_(t){Tb.call(this,null,t)}function U_(t){Tb.call(this,null,t),this.modified(!0)}function q_(t){Tb.call(this,null,t)}Jh(P_,Tb,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const r=o_(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(Bf),s=[],a=t.step||.01,l=t.probs||gp(a/2,1-1e-14,a),c=l.length;return r.forEach((t=>{const e=Pb(t,l);for(let n=0;n{const e=tb(t);n.rem.push(i[e]),i[e]=null})),e.visit(e.ADD,(t=>{const e=ib(t);i[tb(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=i[tb(t)];for(const i in t)e[i]=t[i],n.modifies(i);n.mod.push(e)}))),n}}),B_.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Jh(B_,Tb,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.modified("size"),r=t.size,o=this.value.reduce(((t,e)=>(t[tb(e)]=1,t)),{});let s=this.value,a=this.count,l=0;function c(t){let e,i;s.length=l&&(e=s[i],o[tb(e)]&&n.rem.push(e),s[i]=t)),++a}if(e.rem.length&&(e.visit(e.REM,(t=>{const e=tb(t);o[e]&&(o[e]=-1,n.rem.push(t)),--a})),s=s.filter((t=>-1!==o[tb(t)]))),(e.rem.length||i)&&s.length{o[tb(t)]||c(t)})),l=-1),i&&s.length>r){const t=s.length-r;for(let e=0;e{o[tb(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,c),(e.add.length||l<0)&&(n.add=s.filter((t=>!o[tb(t)]))),this.count=a,this.value=n.source=s,n}}),j_.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Jh(j_,Tb,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),i=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=gp(t.start,t.stop,t.step||1).map((t=>{const e={};return e[i]=t,nb(e)})),n.add=e.add.concat(this.value),n}}),Jh(U_,Tb,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const W_=["unit0","unit1"];function H_(t){Tb.call(this,Xh(),t)}function V_(t){Tb.call(this,null,t)}q_.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Rg,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:W_}]},Jh(q_,Tb,{transform(t,e){const n=t.field,i=!1!==t.interval,r="utc"===t.timezone,o=this._floor(t,e),s=(r?dm:hm)(o.unit).offset,a=t.as||W_,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,h=o.stop||-1/0,d=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(jf(n)))&&(d=(e=e.reflow(!0)).SOURCE,f=1/0,h=-1/0),e.visit(d,(t=>{const e=n(t);let r,a;null==e?(t[l]=null,i&&(t[c]=null)):(t[l]=r=a=o(e),i&&(t[c]=a=s(r,u)),rh&&(h=a))})),o.start=f,o.stop=h,e.modifies(i?a:l)},_floor(t,e){const n="utc"===t.timezone,{units:i,step:r}=t.units?{units:t.units,step:t.step||1}:Nm({extent:t.extent||Wh(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Ig(i),s=this.value||{},a=(n?cm:sm)(o,r);return a.unit=dh(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}}),Jh(H_,Tb,{transform(t,e){const n=e.dataflow,i=t.field,r=this.value,o=t=>r.set(i(t),t);let s=!0;return t.modified("field")||e.modified(i.fields)?(r.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>r.delete(i(t)))),e.visit(e.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),e.fork()}}),Jh(V_,Tb,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(sb(t.sort)):e.source).map(t.field))}});const Y_={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?++t:t}}},percent_rank:function(){const t=Y_.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,i=e.compare;let r=e.index;if(t0||Hf("ntile num must be greater than zero.");const n=Y_.cume_dist(),i=n.next;return{init:n.init,next:t=>Math.ceil(e*i(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const i=n.index-e;return i>=0?t(n.data[i]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const i=n.index+e,r=n.data;return it(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||Hf("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(e-1);return ie=null,next:n=>{const i=t(n.data[n.index]);return null!=i?e=i:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:i=>{const r=i.data;return i.index<=n?e:(n=function(t,e,n){for(let i=e.length;nl[t]=1))}d(t.sort),e.forEach(((t,e)=>{const l=n[e],p=i[e],g=r[e]||null,m=Bf(l),y=Ax(t,m,o[e]);if(d(l),s.push(y),Yh(Y_,t))a.push(function(t,e,n,i){const r=Y_[t](e,n);return{init:r.init||Zf,update:function(t,e){e[i]=r.next(t)}}}(t,l,p,y));else{if(null==l&&"count"!==t&&Hf("Null aggregate field specified."),"count"===t)return void u.push(y);h=!1;let e=c[m];e||(e=c[m]=[],e.field=l,f.push(e)),e.push(zx(t,g,y))}})),(u.length||f.length)&&(this.cell=function(t,e,n){t=t.map((t=>jx(t,t.field)));const i={num:0,agg:null,store:!1,count:e};if(!n)for(var r=t.length,o=i.agg=Array(r),s=0;s0&&!r(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),it.init())),this.cell&&this.cell.init()},Z_.update=function(t,e){const n=this.cell,i=this.windows,r=t.data,o=i&&i.length;let s;if(n){for(s=t.p0;sthis.group(r(t));let s=this.state;s&&!n||(s=this.state=new X_(t)),n||e.modified(s.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let e=0,n=this._mlen;e=1?hw:t<=-1?-hw:Math.asin(t)}const gw=Math.PI,mw=2*gw,yw=1e-6,vw=mw-yw;function bw(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return bw;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;eyw)if(Math.abs(u*a-l*c)>yw&&r){let h=n-o,d=i-s,p=a*a+l*l,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=r*Math.tan((gw-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>yw&&this._append`L${t+b*c},${e+b*u}`,this._append`A${r},${r},0,0,${+(u*h>c*d)},${this._x1=t+x*a},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,f=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>yw||Math.abs(this._y1-c)>yw)&&this._append`L${l},${c}`,n&&(f<0&&(f=f%mw+mw),f>vw?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:f>yw&&this._append`A${n},${n},0,${+(f>=gw)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function _w(){return new xw}function ww(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new xw(e)}function kw(t){return t.innerRadius}function $w(t){return t.outerRadius}function Cw(t){return t.startAngle}function Ew(t){return t.endAngle}function Sw(t){return t&&t.padAngle}function Mw(t,e,n,i,r,o,s){var a=t-n,l=e-i,c=(s?o:-o)/cw(a*a+l*l),u=c*l,f=-c*a,h=t+u,d=e+f,p=n+u,g=i+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,_=r-o,w=h*g-p*d,k=(b<0?-1:1)*cw(sw(0,_*_*x-w*w)),$=(w*b-v*k)/x,C=(-w*v-b*k)/x,E=(w*b+v*k)/x,S=(-w*v+b*k)/x,M=$-m,D=C-y,A=E-m,F=S-y;return M*M+D*D>A*A+F*F&&($=E,C=S),{cx:$,cy:C,x01:-u,y01:-f,x11:$*(r/_-1),y11:C*(r/_-1)}}function Dw(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Aw(t){this._context=t}function Fw(t){return new Aw(t)}function Ow(t){return t[0]}function Tw(t){return t[1]}function Nw(t,e){var n=nw(!0),i=null,r=Fw,o=null,s=ww(a);function a(a){var l,c,u,f=(a=Dw(a)).length,h=!1;for(null==i&&(o=r(u=s())),l=0;l<=f;++l)!(l=f;--h)a.point(y[h],v[h]);a.lineEnd(),a.areaEnd()}m&&(y[u]=+t(d,u,c),v[u]=+e(d,u,c),a.point(i?+i(d,u,c):y[u],n?+n(d,u,c):v[u]))}if(p)return a=null,p+""||null}function u(){return Nw().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?Ow:nw(+t),e="function"==typeof e?e:nw(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Tw:nw(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:nw(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:nw(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:nw(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:nw(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:nw(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:nw(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:nw(!!t),c):r},c.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),c):s},c.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),c):o},c}_w.prototype=xw.prototype,Aw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Lw={draw(t,e){const n=cw(e/fw);t.moveTo(n,0),t.arc(0,0,n,0,dw)}};function Rw(){}function Pw(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Iw(t){this._context=t}function Bw(t){this._context=t}function jw(t){this._context=t}function Uw(t,e){this._basis=new Iw(t),this._beta=e}Iw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pw(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pw(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Bw.prototype={areaStart:Rw,areaEnd:Rw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Pw(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},jw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Pw(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Uw.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],s=t[n]-r,a=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*s),this._beta*e[l]+(1-this._beta)*(o+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var qw=function t(e){function n(t){return 1===e?new Iw(t):new Uw(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Ww(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Hw(t,e){this._context=t,this._k=(1-e)/6}Hw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ww(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ww(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vw=function t(e){function n(t){return new Hw(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Yw(t,e){this._context=t,this._k=(1-e)/6}Yw.prototype={areaStart:Rw,areaEnd:Rw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ww(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Gw=function t(e){function n(t){return new Yw(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Xw(t,e){this._context=t,this._k=(1-e)/6}Xw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ww(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Zw=function t(e){function n(t){return new Xw(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Jw(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>uw){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>uw){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function Qw(t,e){this._context=t,this._alpha=e}Qw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Jw(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Kw=function t(e){function n(t){return e?new Qw(t,e):new Hw(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function tk(t,e){this._context=t,this._alpha=e}tk.prototype={areaStart:Rw,areaEnd:Rw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Jw(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ek=function t(e){function n(t){return e?new tk(t,e):new Yw(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function nk(t,e){this._context=t,this._alpha=e}nk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Jw(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ik=function t(e){function n(t){return e?new nk(t,e):new Xw(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function rk(t){this._context=t}function ok(t){return t<0?-1:1}function sk(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(ok(o)+ok(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function ak(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function lk(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function ck(t){this._context=t}function uk(t){this._context=new fk(t)}function fk(t){this._context=t}function hk(t){this._context=t}function dk(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const mk=()=>"undefined"!=typeof Image?Image:null;function yk(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function vk(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const bk=Symbol("implicit");function xk(){var t=new Yd,e=[],n=[],i=bk;function r(r){let o=t.get(r);if(void 0===o){if(i!==bk)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Yd;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return xk(e,n).unknown(i)},yk.apply(r,arguments),r}function _k(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function wk(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function kk(){}var $k=.7,Ck=1/$k,Ek="\\s*([+-]?\\d+)\\s*",Sk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dk=/^#([0-9a-f]{3,8})$/,Ak=new RegExp(`^rgb\\(${Ek},${Ek},${Ek}\\)$`),Fk=new RegExp(`^rgb\\(${Mk},${Mk},${Mk}\\)$`),Ok=new RegExp(`^rgba\\(${Ek},${Ek},${Ek},${Sk}\\)$`),Tk=new RegExp(`^rgba\\(${Mk},${Mk},${Mk},${Sk}\\)$`),Nk=new RegExp(`^hsl\\(${Sk},${Mk},${Mk}\\)$`),zk=new RegExp(`^hsla\\(${Sk},${Mk},${Mk},${Sk}\\)$`),Lk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rk(){return this.rgb().formatHex()}function Pk(){return this.rgb().formatRgb()}function Ik(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Dk.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Bk(e):3===n?new Wk(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?jk(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?jk(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ak.exec(t))?new Wk(e[1],e[2],e[3],1):(e=Fk.exec(t))?new Wk(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ok.exec(t))?jk(e[1],e[2],e[3],e[4]):(e=Tk.exec(t))?jk(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Nk.exec(t))?Zk(e[1],e[2]/100,e[3]/100,1):(e=zk.exec(t))?Zk(e[1],e[2]/100,e[3]/100,e[4]):Lk.hasOwnProperty(t)?Bk(Lk[t]):"transparent"===t?new Wk(NaN,NaN,NaN,0):null}function Bk(t){return new Wk(t>>16&255,t>>8&255,255&t,1)}function jk(t,e,n,i){return i<=0&&(t=e=n=NaN),new Wk(t,e,n,i)}function Uk(t){return t instanceof kk||(t=Ik(t)),t?new Wk((t=t.rgb()).r,t.g,t.b,t.opacity):new Wk}function qk(t,e,n,i){return 1===arguments.length?Uk(t):new Wk(t,e,n,null==i?1:i)}function Wk(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Hk(){return`#${Xk(this.r)}${Xk(this.g)}${Xk(this.b)}`}function Vk(){const t=Yk(this.opacity);return`${1===t?"rgb(":"rgba("}${Gk(this.r)}, ${Gk(this.g)}, ${Gk(this.b)}${1===t?")":`, ${t})`}`}function Yk(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Gk(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Xk(t){return((t=Gk(t))<16?"0":"")+t.toString(16)}function Zk(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Kk(t,e,n,i)}function Jk(t){if(t instanceof Kk)return new Kk(t.h,t.s,t.l,t.opacity);if(t instanceof kk||(t=Ik(t)),!t)return new Kk;if(t instanceof Kk)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n0&&l<1?0:s,new Kk(s,a,l,t.opacity)}function Qk(t,e,n,i){return 1===arguments.length?Jk(t):new Kk(t,e,n,null==i?1:i)}function Kk(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function t$(t){return(t=(t||0)%360)<0?t+360:t}function e$(t){return Math.max(0,Math.min(1,t||0))}function n$(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}_k(kk,Ik,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Rk,formatHex:Rk,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Jk(this).formatHsl()},formatRgb:Pk,toString:Pk}),_k(Wk,qk,wk(kk,{brighter(t){return t=null==t?Ck:Math.pow(Ck,t),new Wk(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?$k:Math.pow($k,t),new Wk(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Wk(Gk(this.r),Gk(this.g),Gk(this.b),Yk(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hk,formatHex:Hk,formatHex8:function(){return`#${Xk(this.r)}${Xk(this.g)}${Xk(this.b)}${Xk(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Vk,toString:Vk})),_k(Kk,Qk,wk(kk,{brighter(t){return t=null==t?Ck:Math.pow(Ck,t),new Kk(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?$k:Math.pow($k,t),new Kk(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Wk(n$(t>=240?t-240:t+120,r,i),n$(t,r,i),n$(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Kk(t$(this.h),e$(this.s),e$(this.l),Yk(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yk(this.opacity);return`${1===t?"hsl(":"hsla("}${t$(this.h)}, ${100*e$(this.s)}%, ${100*e$(this.l)}%${1===t?")":`, ${t})`}`}}));const i$=Math.PI/180,r$=180/Math.PI,o$=.96422,s$=1,a$=.82521,l$=4/29,c$=6/29,u$=3*c$*c$,f$=c$*c$*c$;function h$(t){if(t instanceof p$)return new p$(t.l,t.a,t.b,t.opacity);if(t instanceof x$)return _$(t);t instanceof Wk||(t=Uk(t));var e,n,i=v$(t.r),r=v$(t.g),o=v$(t.b),s=g$((.2225045*i+.7168786*r+.0606169*o)/s$);return i===r&&r===o?e=n=s:(e=g$((.4360747*i+.3850649*r+.1430804*o)/o$),n=g$((.0139322*i+.0971045*r+.7141733*o)/a$)),new p$(116*s-16,500*(e-s),200*(s-n),t.opacity)}function d$(t,e,n,i){return 1===arguments.length?h$(t):new p$(t,e,n,null==i?1:i)}function p$(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function g$(t){return t>f$?Math.pow(t,1/3):t/u$+l$}function m$(t){return t>c$?t*t*t:u$*(t-l$)}function y$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function v$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b$(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof x$)return new x$(t.h,t.c,t.l,t.opacity);if(t instanceof p$||(t=h$(t)),0===t.a&&0===t.b)return new x$(NaN,0=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i()=>t;function L$(t,e){return function(n){return t+n*e}}function R$(t,e){var n=e-t;return n?L$(t,n>180||n<-180?n-360*Math.round(n/360):n):z$(isNaN(t)?e:t)}function P$(t){return 1==(t=+t)?I$:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):z$(isNaN(e)?n:e)}}function I$(t,e){var n=e-t;return n?L$(t,n):z$(isNaN(t)?e:t)}var B$=function t(e){var n=P$(e);function i(t,e){var i=n((t=qk(t)).r,(e=qk(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=I$(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function j$(t){return function(e){var n,i,r=e.length,o=new Array(r),s=new Array(r),a=new Array(r);for(n=0;no&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:G$(n,i)})),o=J$.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:G$(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:G$(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:G$(t,n)},{i:a-2,x:G$(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++ne&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(s[0],s[t-1])),i=t>2?EC:CC,r=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=i(a,s.map(t),G$)))(n)))},f.domain=function(t){return arguments.length?(s=Array.from(t,_C),u()):s.slice()},f.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},f.rangeRound=function(t){return a=Array.from(t),l=tC,u()},f.clamp=function(t){return arguments.length?(c=!!t||kC,u()):c!==kC},f.interpolate=function(t){return arguments.length?(l=t,u()):l},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,i){return t=n,e=i,u()}}function DC(){return MC()(kC,kC)}function AC(t,e,n,i){var r,o=sp(t,e,n);switch((i=wp(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=Np(o,s))||(i.precision=r),Dp(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=zp(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=Tp(o))||(i.precision=r-2*("%"===i.type))}return Mp(i)}function FC(t){var e=t.domain;return t.ticks=function(t){var n=e();return rp(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return AC(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c0;){if((r=op(l,c,n))===i)return o[s]=l,o[a]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function OC(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s-t(-e,n)}function IC(t){const e=t(TC,NC),n=e.domain;let i,r,o=10;function s(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),r=function(t){return 10===t?RC:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(i=PC(i),r=PC(r),t(zC,LC)):t(TC,NC),e}return e.base=function(t){return arguments.length?(o=+t,s()):o},e.domain=function(t){return arguments.length?(n(t),s()):n()},e.ticks=t=>{const e=n();let s=e[0],a=e[e.length-1];const l=a0){for(;f<=h;++f)for(c=1;ca)break;p.push(u)}}else for(;f<=h;++f)for(c=o-1;c>=1;--c)if(u=f>0?c/r(-f):c*r(f),!(ua)break;p.push(u)}2*p.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=wp(n)).precision||(n.trim=!0),n=Mp(n)),t===1/0)return n;const s=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/r(Math.round(i(t)));return e*on(OC(n(),{floor:t=>r(Math.floor(i(t))),ceil:t=>r(Math.ceil(i(t)))})),e}function BC(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function jC(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function UC(t){var e=1,n=t(BC(e),jC(e));return n.constant=function(n){return arguments.length?t(BC(e=+n),jC(e)):e},FC(n)}function qC(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function WC(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function HC(t){return t<0?-t*t:t*t}function VC(t){var e=t(kC,kC),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(kC,kC):.5===n?t(WC,HC):t(qC(n),qC(1/n)):n},FC(e)}function YC(){var t=VC(MC());return t.copy=function(){return SC(t,YC()).exponent(t.exponent())},yk.apply(t,arguments),t}function GC(t){return new Date(t)}function XC(t){return t instanceof Date?+t:+new Date(+t)}function ZC(t,e,n,i,r,o,s,a,l,c){var u=DC(),f=u.invert,h=u.domain,d=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),y=c("%a %d"),v=c("%b %d"),b=c("%B"),x=c("%Y");function _(t){return(l(t)0?i:1:0}const rE="linear",oE="log",sE="pow",aE="sqrt",lE="symlog",cE="time",uE="utc",fE="sequential",hE="diverging",dE="quantile",pE="quantize",gE="threshold",mE="ordinal",yE="point",vE="band",bE="bin-ordinal",xE="continuous",_E="discrete",wE="discretizing",kE="interpolating",$E="temporal";function CE(){const t=xk().unknown(void 0),e=t.domain,n=t.range;let i,r,o=[0,1],s=!1,a=0,l=0,c=.5;function u(){const t=e().length,u=o[1]d+i*t));return n(u?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),u()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],u()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],s=!0,u()},t.bandwidth=function(){return r},t.step=function(){return i},t.round=function(t){return arguments.length?(s=!!t,u()):s},t.padding=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),a=l,u()):a},t.paddingInner=function(t){return arguments.length?(a=Math.max(0,Math.min(1,t)),u()):a},t.paddingOuter=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},t.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),u()):c},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const i=o[1]o[1-i])?void 0:(l=Math.max(0,qd(s,f)-1),c=f===h?l:qd(s,h)-1,f-s[l]>r+1e-10&&++l,i&&(u=l,l=a-c,c=a-u),l>c?void 0:e().slice(l,c+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return CE().domain(e()).range(o).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function EE(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return EE(e())},t}var SE=Array.prototype.map;const ME=Array.prototype.slice;const DE=new Map,AE=Symbol("vega_scale");function FE(t){return t[AE]=!0,t}function OE(t,e,n){return arguments.length>1?(DE.set(t,function(t,e,n){const i=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,i=e[0],r=e[1];return r=a&&n[o]<=l&&(c<0&&(c=o),i=o);if(!(c<0))return a=t.invertExtent(n[c]),l=t.invertExtent(n[i]),[void 0===a[0]?a[1]:a[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=t,FE(n)};return i.metadata=yd(Oh(n)),i}(t,e,n)),this):TE(t)?DE.get(t):void 0}function TE(t){return DE.has(t)}function NE(t,e){const n=DE.get(t);return n&&n.metadata[e]}function zE(t){return NE(t,xE)}function LE(t){return NE(t,_E)}function RE(t){return NE(t,wE)}function PE(t){return NE(t,oE)}function IE(t){return NE(t,kE)}function BE(t){return NE(t,dE)}OE("identity",(function t(e){var n;function i(t){return null==t||isNaN(t=+t)?n:t}return i.invert=i,i.domain=i.range=function(t){return arguments.length?(e=Array.from(t,_C),i):e.slice()},i.unknown=function(t){return arguments.length?(n=t,i):n},i.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,_C):[0,1],FC(i)})),OE(rE,(function t(){var e=DC();return e.copy=function(){return SC(e,t())},yk.apply(e,arguments),FC(e)}),xE),OE(oE,(function t(){const e=IC(MC()).domain([1,10]);return e.copy=()=>SC(e,t()).base(e.base()),yk.apply(e,arguments),e}),[xE,oE]),OE(sE,YC,xE),OE(aE,(function(){return YC.apply(null,arguments).exponent(.5)}),xE),OE(lE,(function t(){var e=UC(MC());return e.copy=function(){return SC(e,t()).constant(e.constant())},yk.apply(e,arguments)}),xE),OE(cE,(function(){return yk.apply(ZC($g,Cg,bg,yg,ng,Qp,Zp,Gp,Yp,Bm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[xE,$E]),OE(uE,(function(){return yk.apply(ZC(wg,kg,xg,vg,ug,Kp,Jp,Xp,Yp,Um).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[xE,$E]),OE(fE,KC,[xE,kE]),OE(`${fE}-${rE}`,KC,[xE,kE]),OE(`${fE}-${oE}`,(function t(){var e=IC(JC()).domain([1,10]);return e.copy=function(){return QC(e,t()).base(e.base())},vk.apply(e,arguments)}),[xE,kE,oE]),OE(`${fE}-${sE}`,tE,[xE,kE]),OE(`${fE}-${aE}`,(function(){return tE.apply(null,arguments).exponent(.5)}),[xE,kE]),OE(`${fE}-${lE}`,(function t(){var e=UC(JC());return e.copy=function(){return QC(e,t()).constant(e.constant())},vk.apply(e,arguments)}),[xE,kE]),OE(`${hE}-${rE}`,(function t(){var e=FC(eE()(kC));return e.copy=function(){return QC(e,t())},vk.apply(e,arguments)}),[xE,kE]),OE(`${hE}-${oE}`,(function t(){var e=IC(eE()).domain([.1,1,10]);return e.copy=function(){return QC(e,t()).base(e.base())},vk.apply(e,arguments)}),[xE,kE,oE]),OE(`${hE}-${sE}`,nE,[xE,kE]),OE(`${hE}-${aE}`,(function(){return nE.apply(null,arguments).exponent(.5)}),[xE,kE]),OE(`${hE}-${lE}`,(function t(){var e=UC(eE());return e.copy=function(){return QC(e,t()).constant(e.constant())},vk.apply(e,arguments)}),[xE,kE]),OE(dE,(function t(){var e,n=[],i=[],r=[];function o(){var t=0,e=Math.max(1,i.length);for(r=new Array(e-1);++t0?r[e-1]:n[0],e=r?[o[r-1],i]:[o[e-1],o[e]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return o.slice()},a.copy=function(){return t().domain([n,i]).range(s).unknown(e)},yk.apply(FC(a),arguments)}),wE),OE(gE,(function t(){var e,n=[.5],i=[0,1],r=1;function o(t){return null!=t&&t<=t?i[Hd(n,t,0,r)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),r=Math.min(n.length,i.length-1),o):n.slice()},o.range=function(t){return arguments.length?(i=Array.from(t),r=Math.min(n.length,i.length-1),o):i.slice()},o.invertExtent=function(t){var e=i.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(i).unknown(e)},yk.apply(o,arguments)}),wE),OE(bE,(function t(){let e=[],n=[];function i(t){return null==t||t!=t?void 0:n[(Hd(e,t)-1)%n.length]}return i.domain=function(t){return arguments.length?(e=function(t){return SE.call(t,ph)}(t),i):e.slice()},i.range=function(t){return arguments.length?(n=ME.call(t),i):n.slice()},i.tickFormat=function(t,n){return AC(e[0],dh(e),null==t?10:t,n)},i.copy=function(){return t().domain(i.domain()).range(i.range())},i}),[_E,wE]),OE(mE,xk,_E),OE(vE,CE,_E),OE(yE,(function(){return EE(CE().paddingInner(1))}),_E);const jE=["clamp","base","constant","exponent"];function UE(t,e){const n=e[0],i=dh(e)-n;return function(e){return t(n+e*i)}}function qE(t,e,n){return bC(VE(e||"rgb",n),t)}function WE(t,e){const n=new Array(e),i=e+1;for(let r=0;rt[e]?s[e](t[e]()):0)),s):jh(.5)}function VE(t,e){const n=xC[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function YE(t){const e=t.length/6|0,n=new Array(e);for(let i=0;i1?(XE[t]=e,this):XE[t]}GE({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},YE),GE({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(t=>qE(YE(t))));const JE="symbol",QE="discrete",KE=t=>ah(t)?t.map((t=>String(t))):String(t),tS=(t,e)=>t[1]-e[1],eS=(t,e)=>e[1]-t[1];function nS(t,e,n){let i;return nd(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(fd(t.domain())/n||1)+1))),lh(e)&&(i=e.step,e=e.interval),rd(e)&&(e=t.type===cE?hm(e):t.type==uE?dm(e):Hf("Only time and utc scales accept interval strings."),i&&(e=e.every(i))),e}function iS(t,e,n){let i=t.range(),r=i[0],o=dh(i),s=tS;if(r>o&&(i=o,o=r,r=i,s=eS),r=Math.floor(r),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>r<=t[1]&&t[1]<=o)).sort(s).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],dh(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function rS(t,e){return t.bins?iS(t,t.bins):t.ticks?t.ticks(e):t.domain()}function oS(t,e,n,i,r,o){const s=e.type;let a=KE;if(s===cE||r===cE)a=t.timeFormat(i);else if(s===uE||r===uE)a=t.utcFormat(i);else if(PE(s)){const r=t.formatFloat(i);if(o||e.bins)a=r;else{const t=sS(e,n,!1);a=e=>t(e)?r(e):""}}else if(e.tickFormat){const r=e.domain();a=t.formatSpan(r[0],r[r.length-1],n,i)}else i&&(a=t.format(i));return a}function sS(t,e,n){const i=rS(t,e),r=t.base(),o=Math.log(r),s=Math.max(1,r*e/i.length),a=t=>{let e=t/Math.pow(r,Math.round(Math.log(t)/o));return e*raS[t.type]||t.bins;function fS(t,e,n,i,r,o,s){const a=lS[e.type]&&o!==cE&&o!==uE?function(t,e,n){const i=e[lS[e.type]](),r=i.length;let o,s=r>1?i[1]-i[0]:i[0];for(o=1;o(e,n,i)=>{const r=dS(i[n+1],dS(i.max,1/0)),o=mS(e,t),s=mS(r,t);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},dS=(t,e)=>null!=t?t:e,pS=t=>(e,n)=>n?t(e):null,gS=t=>e=>t(e),mS=(t,e)=>Number.isFinite(t)?e(t):null;function yS(t,e,n,i){const r=i||e.type;return rd(n)&&function(t){return NE(t,$E)}(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==cE?n||r!==uE?fS(t,e,5,null,n,i,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function vS(t,e,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=yS(t,e,n.format,n.formatType);if(RE(e.type)){const t=cS(e).slice(1).map(r),n=t.length;return`${n} boundar${1===n?"y":"ies"}: ${t.join(", ")}`}if(LE(e.type)){const t=e.domain(),n=t.length;return`${n} value${1===n?"":"s"}: ${n>i?t.slice(0,i-2).map(r).join(", ")+", ending with "+t.slice(-1).map(r):t.map(r).join(", ")}`}{const t=e.domain();return`values from ${r(t[0])} to ${r(dh(t))}`}}let bS=0;const xS="p_";function _S(t){return t&&t.gradient}function wS(t,e,n){const i=t.gradient;let r=t.id,o="radial"===i?xS:"";return r||(r=t.id="gradient_"+bS++,"radial"===i?(t.x1=kS(t.x1,.5),t.y1=kS(t.y1,.5),t.r1=kS(t.r1,0),t.x2=kS(t.x2,.5),t.y2=kS(t.y2,.5),t.r2=kS(t.r2,.5),o=xS):(t.x1=kS(t.x1,0),t.y1=kS(t.y1,0),t.x2=kS(t.x2,1),t.y2=kS(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+o+r+")"}function kS(t,e){return null!=t?t:e}function $S(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}}const CS={basis:{curve:function(t){return new Iw(t)}},"basis-closed":{curve:function(t){return new Bw(t)}},"basis-open":{curve:function(t){return new jw(t)}},bundle:{curve:qw,tension:"beta",value:.85},cardinal:{curve:Vw,tension:"tension",value:0},"cardinal-open":{curve:Zw,tension:"tension",value:0},"cardinal-closed":{curve:Gw,tension:"tension",value:0},"catmull-rom":{curve:Kw,tension:"alpha",value:.5},"catmull-rom-closed":{curve:ek,tension:"alpha",value:.5},"catmull-rom-open":{curve:ik,tension:"alpha",value:.5},linear:{curve:Fw},"linear-closed":{curve:function(t){return new rk(t)}},monotone:{horizontal:function(t){return new uk(t)},vertical:function(t){return new ck(t)}},natural:{curve:function(t){return new hk(t)}},step:{curve:function(t){return new pk(t,.5)}},"step-after":{curve:function(t){return new pk(t,1)}},"step-before":{curve:function(t){return new pk(t,0)}}};function ES(t,e,n){var i=Yh(CS,t)&&CS[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const SS={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},MS=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,DS=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,AS=/^((\s+,?\s*)|(,\s*))/,FS=/^[01]/;function OS(t){const e=[];return(t.match(MS)||[]).forEach((t=>{let n=t[0];const i=n.toLowerCase(),r=SS[i],o=function(t,e,n){const i=[];for(let r=0;e&&r1&&(g=Math.sqrt(g),n*=g,i*=g);const m=h/n,y=f/n,v=-f/i,b=h/i,x=m*a+y*l,_=v*a+b*l,w=m*t+y*e,k=v*t+b*e;let $=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;$<0&&($=0);let C=Math.sqrt($);o==r&&(C=-C);const E=.5*(x+w)-C*(k-_),S=.5*(_+k)+C*(w-x),M=Math.atan2(_-S,x-E);let D=Math.atan2(k-S,w-E)-M;D<0&&1===o?D+=zS:D>0&&0===o&&(D-=zS);const A=Math.ceil(Math.abs(D/(NS+.001))),F=[];for(let t=0;t+t}function eM(t,e,n){return Math.max(e,Math.min(t,n))}function nM(){var t=ZS,e=JS,n=QS,i=KS,r=tM(0),o=r,s=r,a=r,l=null;function c(c,u,f){var h,d=null!=u?u:+t.call(this,c),p=null!=f?f:+e.call(this,c),g=+n.call(this,c),m=+i.call(this,c),y=Math.min(g,m)/2,v=eM(+r.call(this,c),0,y),b=eM(+o.call(this,c),0,y),x=eM(+s.call(this,c),0,y),_=eM(+a.call(this,c),0,y);if(l||(l=h=_w()),v<=0&&b<=0&&x<=0&&_<=0)l.rect(d,p,g,m);else{var w=d+g,k=p+m;l.moveTo(d+v,p),l.lineTo(w-b,p),l.bezierCurveTo(w-XS*b,p,w,p+XS*b,w,p+b),l.lineTo(w,k-_),l.bezierCurveTo(w,k-XS*_,w-XS*_,k,w-_,k),l.lineTo(d+x,k),l.bezierCurveTo(d+XS*x,k,d,k-XS*x,d,k-x),l.lineTo(d,p+v),l.bezierCurveTo(d,p+XS*v,d+XS*v,p,d+v,p),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(e){return arguments.length?(t=tM(e),c):t},c.y=function(t){return arguments.length?(e=tM(t),c):e},c.width=function(t){return arguments.length?(n=tM(t),c):n},c.height=function(t){return arguments.length?(i=tM(t),c):i},c.cornerRadius=function(t,e,n,i){return arguments.length?(r=tM(t),o=null!=e?tM(e):r,a=null!=n?tM(n):r,s=null!=i?tM(i):o,c):r},c.context=function(t){return arguments.length?(l=null==t?null:t,c):l},c}function iM(){var t,e,n,i,r,o,s,a,l=null;function c(t,e,n){const i=n/2;if(r){var c=s-e,u=t-o;if(c||u){var f=Math.hypot(c,u),h=(c/=f)*a,d=(u/=f)*a,p=Math.atan2(u,c);l.moveTo(o-h,s-d),l.lineTo(t-c*i,e-u*i),l.arc(t,e,i,p-Math.PI,p),l.lineTo(o+h,s+d),l.arc(o,s,a,p,p+Math.PI)}else l.arc(t,e,i,0,zS);l.closePath()}else r=1;o=t,s=e,a=i}function u(o){var s,a,u,f=o.length,h=!1;for(null==l&&(l=u=_w()),s=0;s<=f;++s)!(st.x||0,sM=t=>t.y||0,aM=t=>!(!1===t.defined),lM=function(){var t=kw,e=$w,n=nw(0),i=null,r=Cw,o=Ew,s=Sw,a=null,l=ww(c);function c(){var c,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-hw,p=o.apply(this,arguments)-hw,g=iw(p-d),m=p>d;if(a||(a=c=l()),huw)if(g>dw-uw)a.moveTo(h*ow(d),h*lw(d)),a.arc(0,0,h,d,p,!m),f>uw&&(a.moveTo(f*ow(p),f*lw(p)),a.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,_=d,w=p,k=g,$=g,C=s.apply(this,arguments)/2,E=C>uw&&(i?+i.apply(this,arguments):cw(f*f+h*h)),S=aw(iw(h-f)/2,+n.apply(this,arguments)),M=S,D=S;if(E>uw){var A=pw(E/f*lw(C)),F=pw(E/h*lw(C));(k-=2*A)>uw?(_+=A*=m?1:-1,w-=A):(k=0,_=w=(d+p)/2),($-=2*F)>uw?(b+=F*=m?1:-1,x-=F):($=0,b=x=(d+p)/2)}var O=h*ow(b),T=h*lw(b),N=f*ow(w),z=f*lw(w);if(S>uw){var L,R=h*ow(x),P=h*lw(x),I=f*ow(_),B=f*lw(_);if(g1?0:t<-1?fw:Math.acos(t)}((j*q+U*W)/(cw(j*j+U*U)*cw(q*q+W*W)))/2),V=cw(L[0]*L[0]+L[1]*L[1]);M=aw(S,(f-V)/(H-1)),D=aw(S,(h-V)/(H+1))}else M=D=0}$>uw?D>uw?(y=Mw(I,B,O,T,h,D,m),v=Mw(R,P,N,z,h,D,m),a.moveTo(y.cx+y.x01,y.cy+y.y01),Duw&&k>uw?M>uw?(y=Mw(N,z,R,P,f,-M,m),v=Mw(O,T,I,B,f,-M,m),a.lineTo(y.cx+y.x01,y.cy+y.y01),Mt.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),cM=zw().x(oM).y1(sM).y0((t=>(t.y||0)+(t.height||0))).defined(aM),uM=zw().y(sM).x1(oM).x0((t=>(t.x||0)+(t.width||0))).defined(aM),fM=Nw().x(oM).y(sM).defined(aM),hM=nM().x(oM).y(sM).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>rM(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>rM(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>rM(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>rM(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),dM=function(t,e){let n=null,i=ww(r);function r(){let r;if(n||(n=r=i()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:nw(t||Lw),e="function"==typeof e?e:nw(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:nw(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:nw(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>YS(t.shape||"circle"))).size((t=>rM(t.size,64))),pM=iM().x(oM).y(sM).defined(aM).size((t=>t.size||1));function gM(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function mM(t,e,n,i){return hM.context(t)(e,n,i)}var yM=1;function vM(){yM=1}function bM(t,e,n){var i=e.clip,r=t._defs,o=e.clip_id||(e.clip_id="clip"+yM++),s=r.clipping[o]||(r.clipping[o]={id:o});return Nh(i)?s.path=i(null):gM(n)?s.path=mM(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function xM(t){this.clear(),t&&this.union(t)}function _M(t){this.mark=t,this.bounds=this.bounds||new xM}function wM(t){_M.call(this,t),this.items=this.items||[]}function kM(t){this._pending=0,this._loader=t||Gv()}function $M(t){t._pending+=1}function CM(t){t._pending-=1}function EM(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}xM.prototype={clone(){return new xM(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,u=n-e*l-n*a;return[a*i-l*r+c,l*i+a*r+u,a*i-l*s+c,l*i+a*s+u,a*o-l*r+c,l*o+a*r+u,a*o-l*s+c,l*o+a*s+u]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Jh(wM,_M),kM.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return $M(e),e._loader.sanitize(t,{context:"href"}).then((t=>(CM(e),t))).catch((()=>(CM(e),null)))},loadImage(t){const e=this,n=mk();return $M(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const i=t.href;if(!i||!n)throw{url:i};const r=new n,o=Yh(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>CM(e),r.onerror=()=>CM(e),r.src=i,r})).catch((t=>(CM(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(i){t.pending()?setTimeout((()=>{n(!0)}),10):e(i)}(!1)}))}};const SM=zS-1e-8;let MM,DM,AM,FM,OM,TM,NM,zM;const LM=(t,e)=>MM.add(t,e),RM=(t,e)=>LM(DM=t,AM=e),PM=t=>LM(t,MM.y1),IM=t=>LM(MM.x1,t),BM=(t,e)=>OM*t+NM*e,jM=(t,e)=>TM*t+zM*e,UM=(t,e)=>LM(BM(t,e),jM(t,e)),qM=(t,e)=>RM(BM(t,e),jM(t,e));function WM(t,e){return MM=t,e?(FM=e*TS,OM=zM=Math.cos(FM),TM=Math.sin(FM),NM=-TM):(OM=zM=1,FM=TM=NM=0),HM}const HM={beginPath(){},closePath(){},moveTo:qM,lineTo:qM,rect(t,e,n,i){FM?(UM(t+n,e),UM(t+n,e+i),UM(t,e+i),qM(t,e)):(LM(t+n,e+i),RM(t,e))},quadraticCurveTo(t,e,n,i){const r=BM(t,e),o=jM(t,e),s=BM(n,i),a=jM(n,i);VM(DM,r,s,PM),VM(AM,o,a,IM),RM(s,a)},bezierCurveTo(t,e,n,i,r,o){const s=BM(t,e),a=jM(t,e),l=BM(n,i),c=jM(n,i),u=BM(r,o),f=jM(r,o);YM(DM,s,l,u,PM),YM(AM,a,c,f,IM),RM(u,f)},arc(t,e,n,i,r,o){if(i+=FM,r+=FM,DM=n*Math.cos(r)+t,AM=n*Math.sin(r)+e,Math.abs(r-i)>SM)LM(t-n,e-n),LM(t+n,e+n);else{const s=i=>LM(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(s(i),s(r),r!==i)if((i%=zS)<0&&(i+=zS),(r%=zS)<0&&(r+=zS),rr;++l,a-=NS)s(a);else for(a=i-i%NS+NS,l=0;l<4&&a1e-14?(l=s*s+a*o,l>=0&&(l=Math.sqrt(l),c=(-s+l)/o,u=(-s-l)/o)):c=.5*a/s,0m)return!1;d>g&&(g=d)}else if(f>0){if(d0&&(t.globalAlpha=n,t.fillStyle=oD(t,e,e.fill),!0)}var aD=[];function lD(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=oD(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||aD),t.lineDashOffset=e.strokeDashOffset||0),!0))}function cD(t,e){return t.zindex-e.zindex||t.index-e.index}function uD(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function dD(t){return function(e,n,i){fD(n,(n=>{i&&!i.intersects(n.bounds)||gD(t,e,n,n)}))}}function pD(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||gD(t,e,n.items[0],n.items)}}function gD(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(nD(e,n),n.fill&&sD(e,n,r)&&e.fill(),n.stroke&&lD(e,n,r)&&e.stroke()))}function mD(t){return t=t||Qf,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,hD(n,(n=>{const a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function yD(t,e){return function(n,i,r,o){var s,a,l=Array.isArray(i)?i[0]:i,c=null==e?l.fill:e,u=l.stroke&&n.isPointInStroke;return u&&(s=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(c&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o))}}function vD(t){return mD(yD(t))}function bD(t,e){return"translate("+t+","+e+")"}function xD(t){return"rotate("+t+")"}function _D(t){return bD(t.x||0,t.y||0)}function wD(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=TS),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return bD(t.x||0,t.y||0)+(t.angle?" "+xD(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(WM(t,n.angle),n),EM(t,n).translate(n.x||0,n.y||0)},draw:dD(i),pick:vD(i),isect:n||JM(i)}}var kD=wD("arc",(function(t,e){return lM.context(t)(e)}));function $D(t,e,n){function i(t,n){t.beginPath(),e(t,n)}const r=yD(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(WM(t),i),EM(t,i[0]))},draw:pD(i),pick:function(t,e,n,i,o,s){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:QM,tip:n}}var CD=$D("area",(function(t,e){const n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?uM:cM).curve(ES(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r)).5&&e<1.5?.5-Math.abs(e-1):0}function MD(t,e){const n=SD(e);t("d",mM(null,e,n,n))}function DD(t,e,n,i){const r=SD(e);t.beginPath(),mM(t,e,(n||0)+r,(i||0)+r)}const AD=yD(DD),FD=yD(DD,!1),OD=yD(DD,!0);var TD={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",_D(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e{const r=e.x||0,o=e.y||0,s=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(DD(t,e,r,o),nD(t,e),e.fill&&sD(t,e,a)&&t.fill(),e.stroke&&!s&&lD(t,e,a)&&t.stroke()),t.save(),t.translate(r,o),e.clip&&ED(t,e),n&&n.translate(-r,-o),fD(e,(e=>{("group"===e.marktype||null==i||i.includes(e.marktype))&&this.draw(t,e,n,i)})),n&&n.translate(r,o),t.restore(),s&&e.stroke&&a&&(DD(t,e,r,o),nD(t,e),lD(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;const s=n*t.pixelRatio,a=i*t.pixelRatio;return hD(e,(l=>{let c,u,f;const h=l.bounds;if(h&&!h.contains(r,o))return;u=l.x||0,f=l.y||0;const d=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(rd||op))return;if(t.save(),t.translate(u,f),u=r-u,f=o-f,g&&gM(l)&&!OD(t,l,s,a))return t.restore(),null;const m=l.strokeForeground,y=!1!==e.interactive;return y&&m&&l.stroke&&FD(t,l,s,a)?(t.restore(),l):(c=hD(l,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,u,f)?this.pick(t,n,i,u,f):null)),!c&&y&&(l.fill||!m&&l.stroke)&&AD(t,l,s,a)&&(c=l),t.restore(),c||null)}))},isect:KM,content:function(t,e,n){t("clip-path",e.clip?bM(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),MD(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?MD(t,e):t("d","")}},ND={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function zD(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function LD(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function RD(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function PD(t,e){return"center"===t?e/2:"right"===t?e:0}function ID(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var BD={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const i=zD(e,n),r=LD(e,i),o=RD(e,i),s=(e.x||0)-PD(e.align,r),a=(e.y||0)-ID(e.baseline,o);t("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",ND["xmlns:xlink"],"xlink:href"),t("transform",bD(s,a)),t("width",r),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,i=LD(e,n),r=RD(e,n),o=(e.x||0)-PD(e.align,i),s=(e.y||0)-ID(e.baseline,r);return t.set(o,s,o+i,s+r)},draw:function(t,e,n){fD(e,(e=>{if(n&&!n.intersects(e.bounds))return;const i=zD(e,this);let r=LD(e,i),o=RD(e,i);if(0===r||0===o)return;let s,a,l,c,u=(e.x||0)-PD(e.align,r),f=(e.y||0)-ID(e.baseline,o);!1!==e.aspect&&(a=i.width/i.height,l=e.width/e.height,a==a&&l==l&&a!==l&&(l=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i{if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&VD(t,e,i)&&(nD(t,e),t.stroke())}}))},pick:mD((function(t,e,n,i){return!!t.isPointInStroke&&(VD(t,e,1)&&t.isPointInStroke(n,i))})),isect:tD},GD=wD("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),XD=wD("symbol",(function(t,e){return dM.context(t)(e)}),QM);const ZD=ad();var JD={height:iA,measureWidth:eA,estimateWidth:KD,width:KD,canvas:QD};function QD(t){JD.width=t&&XM?eA:KD}function KD(t,e){return tA(aA(t,e),iA(t))}function tA(t,e){return~~(.8*t.length*e)}function eA(t,e){return iA(t)<=0||!(e=aA(t,e))?0:nA(e,cA(t))}function nA(t,e){const n=`(${e}) ${t}`;let i=ZD.get(n);return void 0===i&&(XM.font=e,i=XM.measureText(t).width,ZD.set(n,i)),i}function iA(t){return null!=t.fontSize?+t.fontSize||0:11}function rA(t){return null!=t.lineHeight?t.lineHeight:iA(t)+2}function oA(t){return e=t.lineBreak&&t.text&&!ah(t.text)?t.text.split(t.lineBreak):t.text,ah(e)?e.length>1?e:e[0]:e;var e}function sA(t){const e=oA(t);return(ah(e)?e.length-1:0)*rA(t)}function aA(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(JD.width===eA){const e=cA(t);return t=>nA(t,e)}if(JD.width===KD){const e=iA(t);return t=>tA(t,e)}return e=>JD.width(t,e)}(t);if(i(e)>>1,i(e.slice(r))>n?a=r+1:l=r;return o+e.slice(a)}for(;a>>1),i(e.slice(0,r))Math.max(t,JD.width(e,n))),0)):i=JD.width(e,f),"center"===o?c-=i/2:"right"===o&&(c-=i),t.set(c+=a,u+=l,c+i,u+r),e.angle&&!n)t.rotate(e.angle*TS,a,l);else if(2===n)return t.rotatedPoints(e.angle*TS,a,l);return t}var gA={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+uA(e),o=dA(e),s=o.x1,a=o.y1,l=e.angle||0;t("text-anchor",fA[e.align]||"start"),l?(n=bD(s,a)+" "+xD(l),(i||r)&&(n+=" "+bD(i,r))):n=bD(s+i,a+r),t("transform",n)},bound:pA,draw:function(t,e,n){fD(e,(e=>{var i,r,o,s,a,l,c,u=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===u||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=cA(e),t.textAlign=e.align||"left",r=(i=dA(e)).x1,o=i.y1,e.angle&&(t.save(),t.translate(r,o),t.rotate(e.angle*TS),r=o=0),r+=e.dx||0,o+=(e.dy||0)+uA(e),l=oA(e),nD(t,e),ah(l))for(a=rA(e),s=0;s=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null})),yA={arc:kD,area:CD,group:TD,image:BD,line:jD,path:qD,rect:HD,rule:YD,shape:GD,symbol:XD,text:gA,trail:mA};function vA(t,e,n){var i=yA[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new xM),t,n)}var bA={mark:null};function xA(t,e,n){var i,r,o,s,a=yA[t.marktype],l=a.bound,c=t.items,u=c&&c.length;if(a.nested)return u?o=c[0]:(bA.mark=t,o=bA),s=vA(o,l,n),e=e&&e.union(s)||s;if(e=e||t.bounds&&t.bounds.clear()||new xM,u)for(i=0,r=c.length;ie;)t.removeChild(n[--i]);return t}function FA(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function OA(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function TA(t,e){this._active=null,this._handlers={},this._loader=t||Gv(),this._tooltip=e||NA}function NA(t,e,n,i){t.element().setAttribute("title",i||"")}function zA(t){this._el=null,this._bgcolor=null,this._loader=new kM(t)}CA.prototype={toJSON(t){return wA(this.root,t||0)},mark(t,e,n){const i=EA(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},TA.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const t in e)n.push(...e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),i=SA(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=yA[s.marktype]).tip){for((o=OA(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.width(),s=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;t.mark&&(t=t.mark.group);)a+=t.x||0,l+=t.y||0;return{x:a,y:l,width:o,height:s,left:a,top:l,right:a+o,bottom:l+s}}},zA.prototype={initialize(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(t,e){const n=this;return n._call=function(){n._render(t,e)},n._call(),n._call=null,n},_render(){},renderAsync(t,e){const n=this.render(t,e);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)},_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return i},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const LA="dragenter",RA="dragleave",PA="dragover",IA="pointerdown",BA="pointermove",jA="pointerout",UA="pointerover",qA="mousedown",WA="mousemove",HA="mouseout",VA="mouseover",YA="click",GA="mousewheel",XA="touchstart",ZA="touchmove",JA="touchend",QA=BA,KA=jA,tF=YA;function eF(t,e){TA.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function nF(t,e){(t=>t===XA||t===ZA||t===JA?[XA,ZA,JA]:[t])(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function iF(t,e,n){e.forEach((e=>t.fire(e,n)))}function rF(t,e,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||iF(this,n,i),this._active=o,iF(this,e,i)),iF(this,t,i)}}function oF(t){return function(e){iF(this,t,e),this._active=null}}Jh(eF,TA,{initialize(t,e,n){return this._canvas=t&&MA(t,"canvas"),[YA,qA,IA,BA,jA,RA].forEach((t=>nF(this,t))),TA.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",LA,RA,PA,IA,"pointerup",BA,jA,UA,qA,"mouseup",WA,HA,VA,YA,"dblclick","wheel",GA,XA,ZA,JA],DOMMouseScroll(t){this.fire(GA,t)},pointermove:rF([BA,WA],[UA,VA],[jA,HA]),dragover:rF([PA],[LA],[RA]),pointerout:oF([jA,HA]),dragleave:oF([RA]),pointerdown(t){this._down=this._active,this.fire(IA,t)},mousedown(t){this._down=this._active,this.fire(qA,t)},click(t){this._down===this._active&&(this.fire(YA,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(XA,t,!0)},touchmove(t){this.fire(ZA,t,!0)},touchend(t){this.fire(JA,t,!0),this._touch=null},fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];if(e.vegaType=t,t===tF&&i&&i.href?this.handleHref(e,i,i.href):t!==QA&&t!==KA||this.handleTooltip(e,i,t!==KA),r)for(let t=0,n=r.length;t=0&&i.splice(r,1),this},pickEvent(t){const e=OA(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,i,r){const o=this.context();return yA[t.marktype].pick.call(this,o,t,e,n,i,r)}});var sF="undefined"!=typeof window&&window.devicePixelRatio||1;function aF(t){zA.call(this,t),this._options={},this._redraw=!1,this._dirty=new xM,this._tempb=new xM}const lF=zA.prototype;function cF(t,e){TA.call(this,t,e);const n=this;n._hrefHandler=uF(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=uF(n,((t,e)=>{n.handleTooltip(t,e,t.type!==KA)}))}Jh(aF,zA,{initialize(t,e,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:gk(1,1,this._options.type),t&&this._canvas&&(AA(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),lF.initialize.call(this,t,e,n,i,r)},resize(t,e,n,i){if(lF.resize.call(this,t,e,n,i),this._canvas)!function(t,e,n,i,r,o){const s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=s?sF:r;t.width=e*l,t.height=n*l;for(const t in o)a[t]=o[t];s&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||Hf("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t,e){const n=this.context(),i=this._origin,r=this._width,o=this._height,s=this._dirty,a=((t,e,n)=>(new xM).set(0,0,e,n).translate(-t[0],-t[1]))(i,r,o);n.save();const l=this._redraw||s.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(n,a.intersect(s),i);return this.clear(-i[0],-i[1],r,o),this.draw(n,t,l,e),n.restore(),s.clear(),this},draw(t,e,n,i){if("group"!==e.marktype&&null!=i&&!i.includes(e.marktype))return;const r=yA[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),Nh(n)?(t.beginPath(),n(t),t.clip()):ED(t,e.group)}(t,e),r.draw.call(this,t,e,n,i),e.clip&&t.restore()},clear(t,e,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(t,e,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,i))}});const uF=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,e.call(t._obj,n,i)};Jh(cF,TA,{initialize(t,e,n){let i=this._svg;return i&&(i.removeEventListener(tF,this._hrefHandler),i.removeEventListener(QA,this._tooltipHandler),i.removeEventListener(KA,this._tooltipHandler)),this._svg=i=t&&MA(t,"svg"),i&&(i.addEventListener(tF,this._hrefHandler),i.addEventListener(QA,this._tooltipHandler),i.addEventListener(KA,this._tooltipHandler)),TA.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){const r={type:t,handler:e,listener:uF(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const fF="aria-hidden",hF="aria-label",dF="role",pF="aria-roledescription",gF="graphics-object",mF="graphics-symbol",yF=(t,e,n)=>({[dF]:t,[pF]:e,[hF]:n||void 0}),vF=yd(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),bF={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,i=e.title?$F(t):null,r=t.context,o=r.scales[e.scale].value,s=r.dataflow.locale(),a=o.type,l="left"===n||"right"===n?"Y":"X";return`${l}-axis`+(i?` titled '${i}'`:"")+` for a ${LE(a)?"discrete":a} scale`+` with ${vS(s,o,t)}`}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?$F(t):null,i=`${e.type||""} legend`.trim(),r=e.scales,o=Object.keys(r),s=t.context,a=s.scales[r[o[0]]].value,l=s.dataflow.locale();return c=i,(c.length?c[0].toUpperCase()+c.slice(1):c)+(n?` titled '${n}'`:"")+` for ${function(t){return t=t.map((t=>t+("fill"===t||"stroke"===t?" color":""))),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+dh(t)}(o)}`+` with ${vS(l,a,t)}`;var c}},"title-text":{desc:"title",caption:t=>`Title text '${kF(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${kF(t)}'`}},xF={ariaRole:dF,ariaRoleDescription:pF,description:hF};function _F(t,e){const n=!1===e.aria;if(t(fF,n||void 0),n||null==e.description)for(const e in xF)t(xF[e],void 0);else{const n=e.mark.marktype;t(hF,e.description),t(dF,e.ariaRole||("group"===n?gF:mF)),t(pF,e.ariaRoleDescription||`${n} mark`)}}function wF(t){return!1===t.aria?{[fF]:!0}:vF[t.role]?null:bF[t.role]?function(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return yF(e.role||mF,e.desc,n.description||i(n))}catch(t){return null}}(t,bF[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return yF(n?gF:mF,`${e} mark container`,t.description)}(t)}function kF(t){return Oh(t.text).join(" ")}function $F(t){try{return Oh(dh(t.items).items[0].text).join(" ")}catch(t){return null}}const CF=t=>(t+"").replace(/&/g,"&").replace(//g,">");function EF(){let t="",e="",n="";const i=[],r=()=>e=n="",o=(t,n)=>{var i;return null!=n&&(e+=` ${t}="${i=n,CF(i).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ")}"`),s},s={open(a){(o=>{e&&(t+=`${e}>${n}`,r()),i.push(o)})(a),e="<"+a;for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u${n}`:"/>"):``,r(),s},attr:o,text:t=>(n+=CF(t),s),toString:()=>t};return s}const SF=t=>MF(EF(),t)+"";function MF(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,i=n.length;for(let e=0;e1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}Jh(NF,zA,{initialize(t,e,n,i,r){return this._defs={},this._clearDefs(),t&&(this._svg=DA(t,0,"svg",TF),this._svg.setAttributeNS(OF,"xmlns",TF),this._svg.setAttributeNS(OF,"xmlns:xlink",ND["xmlns:xlink"]),this._svg.setAttribute("version",ND.version),this._svg.setAttribute("class","marks"),AA(t,1),this._root=DA(this._svg,0,"g",TF),HF(this._root,FF),AA(this._svg,1)),this.background(this._bgcolor),zF.initialize.call(this,t,e,n,i,r)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),zF.background.apply(this,arguments)},resize(t,e,n,i){return zF.resize.call(this,t,e,n,i),this._svg&&(HF(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=DA(t,0,"rect",TF),HF(n,{width:this._width,height:this._height,fill:e}));const i=SF(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),i},_render(t,e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,e),AA(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,i,r,o,s,a,l;for(s=0,a=t.length;s{t.dirty=e}))),i.zdirty||(n.exit?(o.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=o.nested?i.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,LF(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n,i){if(!this.isDirty(e))return e._svg;const r=this._svg,o=e.marktype,s=yA[o],a=!1===e.interactive?"none":null,l="g"===s.tag,c=IF(e,t,n,"g",r);if("group"!==o&&null!=i&&!i.includes(o))return AA(c,0),e._svg;c.setAttribute("class",FA(e));const u=wF(e);for(const t in u)VF(c,t,u[t]);l||VF(c,"pointer-events",a),VF(c,"clip-path",e.clip?bM(this,e,e.group):null);let f=null,h=0;const d=t=>{const e=this.isDirty(t),n=IF(t,c,f,s.tag,r);e&&(this._update(s,n,t),l&&function(t,e,n,i){e=e.lastChild.previousSibling;let r,o=0;fD(n,(n=>{r=t.mark(e,n,r,i),++o})),AA(e,1+o)}(this,n,t,i)),f=n,++h};return s.nested?e.items.length&&d(e.items[0]):fD(e,d),AA(c,h),c},_update(t,e,n){BF=e,jF=e.__values__,_F(qF,n),t.attr(qF,n,this);const i=UF[t.type];i&&i.call(this,t,e,n),BF&&this.style(BF,n)},style(t,e){if(null!=e){for(const n in DF){let i="font"===n?lA(e):e[n];if(i===jF[n])continue;const r=DF[n];null==i?t.removeAttribute(r):(_S(i)&&(i=wS(i,this._defs.gradient,YF())),t.setAttribute(r,i+"")),jF[n]=i}for(const n in AF)WF(t,AF[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient)n||(e.el=n=DA(t,1,"defs",TF)),i=RF(n,e.gradient[r],i);for(const r in e.clipping)n||(e.el=n=DA(t,1,"defs",TF)),i=PF(n,e.clipping[r],i);n&&(0===i?(t.removeChild(n),e.el=null):AA(n,i))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let BF=null,jF=null;const UF={group(t,e,n){const i=BF=e.childNodes[2];jF=i.__values__,t.foreground(qF,n,this),jF=e.__values__,BF=e.childNodes[1],t.content(qF,n,this);const r=BF=e.childNodes[0];t.background(qF,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==jF.events&&(VF(i,"pointer-events",o),VF(r,"pointer-events",o),jF.events=o),n.strokeForeground&&n.stroke){const t=n.fill;VF(i,"display",null),this.style(r,n),VF(r,"stroke",null),t&&(n.fill=null),jF=i.__values__,this.style(i,n),t&&(n.fill=t),BF=null}else VF(i,"display","none")},image(t,e,n){!1===n.smooth?(WF(e,"image-rendering","optimizeSpeed"),WF(e,"image-rendering","pixelated")):WF(e,"image-rendering",null)},text(t,e,n){const i=oA(n);let r,o,s,a;ah(i)?(o=i.map((t=>aA(n,t))),r=o.join("\n"),r!==jF.text&&(AA(e,0),s=e.ownerDocument,a=rA(n),o.forEach(((t,i)=>{const r=SA(s,"tspan",TF);r.__data__=n,r.textContent=t,i&&(r.setAttribute("x",0),r.setAttribute("dy",a)),e.appendChild(r)})),jF.text=r)):(o=aA(n,i),o!==jF.text&&(e.textContent=o,jF.text=o)),VF(e,"font-family",lA(n)),VF(e,"font-size",iA(n)+"px"),VF(e,"font-style",n.fontStyle),VF(e,"font-variant",n.fontVariant),VF(e,"font-weight",n.fontWeight)}};function qF(t,e,n){e!==jF[t]&&(n?function(t,e,n,i){null!=n?t.setAttributeNS(i,e,n):t.removeAttributeNS(i,e)}(BF,t,e,n):VF(BF,t,e),jF[t]=e)}function WF(t,e,n){n!==jF[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),jF[e]=n)}function HF(t,e){for(const n in e)VF(t,n,e[n])}function VF(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function YF(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function GF(t){zA.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}Jh(GF,zA,{svg(){return this._text},_render(t){const e=EF();e.open("svg",qh({},ND,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",FF,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=yA[e.marktype],i=n.tag,r=[_F,n.attr];t.open("g",{class:FA(e),"clip-path":e.clip?bM(this,e,e.group):null},wF(e),{"pointer-events":"g"!==i&&!1===e.interactive?"none":null});const o=o=>{const s=this.href(o);if(s&&t.open("a",s),t.open(i,this.attr(e,o,r,"g"!==i?i:null)),"text"===i){const e=oA(o);if(ah(e)){const n={x:0,dy:rA(o)};for(let i=0;ithis.mark(t,e))),t.close(),i&&s?(r&&(o.fill=null),o.stroke=s,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),r&&(o.fill=r)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),s&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):fD(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,i){const r={},o=(t,e,n,i)=>{r[i||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),i&&function(t,e,n,i,r){let o;if(null==e)return t;"bgrect"===i&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===i&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(t["font-family"]=lA(e),t["font-size"]=iA(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in DF){let i=e[n];const o=DF[n];("transparent"!==i||"fill"!==o&&"stroke"!==o)&&null!=i&&(_S(i)&&(i=wS(i,r.gradient,"")),t[o]=i)}for(const t in AF){const n=e[t];null!=n&&(o=o||[],o.push(`${AF[t]}: ${n};`))}o&&(t.style=o.join(" "))}(r,e,t,i,this._defs),r},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const i=e[n],r=i.stops;"radial"===i.gradient?(t.open("pattern",{id:xS+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e!XF.svgMarkTypes.includes(t)));this._svgRenderer.render(t,XF.svgMarkTypes),this._canvasRenderer.render(t,n)},resize(t,e,n,i){return JF.resize.call(this,t,e,n,i),this._svgRenderer.resize(t,e,n,i),this._canvasRenderer.resize(t,e,n,i),this},background(t){return XF.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}),Jh(QF,eF,{initialize(t,e,n){const i=DA(DA(t,0,"div"),XF.svgOnTop?0:1,"div");return eF.prototype.initialize.call(this,i,e,n)}});const KF="canvas",tO="hybrid",eO="none",nO={Canvas:KF,PNG:"png",SVG:"svg",Hybrid:tO,None:eO},iO={};function rO(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(iO[t]=e,this):iO[t]}function oO(t,e,n){const i=[],r=(new xM).union(e),o=t.marktype;return o?sO(t,r,n,i):"group"===o?aO(t,r,n,i):Hf("Intersect scene must be mark node or group item.")}function sO(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(!hO(t[n=r[i]],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function dO(t,e){return hO(OS(t),OS(e))}const pO="top",gO="left",mO="right",yO="bottom",vO="top-left",bO="top-right",xO="bottom-left",_O="bottom-right",wO="start",kO="middle",$O="end",CO="x",EO="y",SO="group",MO="axis",DO="title",AO="frame",FO="scope",OO="legend",TO="row-header",NO="row-footer",zO="row-title",LO="column-header",RO="column-footer",PO="column-title",IO="padding",BO="symbol",jO="fit",UO="fit-x",qO="fit-y",WO="pad",HO="none",VO="all",YO="each",GO="flush",XO="column",ZO="row";function JO(t){Tb.call(this,null,t)}function QO(t,e,n){return e(t.bounds.clear(),t,n)}Jh(JO,Tb,{transform(t,e){const n=e.dataflow,i=t.mark,r=i.marktype,o=yA[r],s=o.bound;let a,l=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),l=QO(i,s),i.items.forEach((t=>{t.bounds.clear().union(l)}));else if(r===SO||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),l.clear(),i.items.forEach((t=>l.union(QO(t,s)))),i.role){case MO:case OO:case DO:e.reflow()}else a=e.changed(e.REM),e.visit(e.ADD,(t=>{l.union(QO(t,s))})),e.visit(e.MOD,(t=>{a=a||l.alignsWith(t.bounds),n.dirty(t),l.union(QO(t,s))})),a&&(l.clear(),i.items.forEach((t=>l.union(t.bounds))));return uO(i),e.modifies("bounds")}});const KO=":vega_identifier:";function tT(t){Tb.call(this,0,t)}function eT(t){Tb.call(this,null,t)}function nT(t){Tb.call(this,null,t)}tT.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Jh(tT,Tb,{transform(t,e){const n=(r=e.dataflow)._signals[KO]||(r._signals[KO]=r.add(0)),i=t.as;var r;let o=n.value;return e.visit(e.ADD,(t=>t[i]=t[i]||++o)),n.set(this.value=o),e}}),Jh(eT,Tb,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const i=n.marktype===SO?wM:_M;return e.visit(e.ADD,(t=>i.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const iT={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,i)=>i&&rT(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},rT=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),oT=(t,e)=>{for(var n,i=1,r=t.length,o=t[0].bounds;i{const e=t.bounds;return e.width()>1&&e.height()>1},aT=t=>(t.forEach((t=>t.opacity=1)),t),lT=(t,e)=>t.reflow(e.modified()).modifies("opacity");function cT(t){Tb.call(this,null,t)}Jh(nT,Tb,{transform(t,e){const n=iT[t.method]||iT.parity,i=t.separation||0;let r,o,s=e.materialize(e.SOURCE).source;if(!s||!s.length)return;if(!t.method)return t.modified("method")&&(aT(s),e=lT(e,t)),e;if(s=s.filter(sT),!s.length)return;if(t.sort&&(s=s.slice().sort(t.sort)),r=aT(s),e=lT(e,t),r.length>=3&&oT(r,i)){do{r=n(r,i)}while(r.length>=3&&oT(r,i));r.length<3&&!dh(s).opacity&&(r.length>1&&(dh(r).opacity=0),dh(s).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var i=t.range(),r=new xM;return e===pO||e===yO?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),t=>r.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),s.forEach((t=>{o(t)||(t.opacity=0)})));const a=r[0].mark.bounds.clear();return s.forEach((t=>{t.opacity&&a.union(t.bounds)})),e}}),Jh(cT,Tb,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const uT=new xM;function fT(t,e,n){return t[e]===n?0:(t[e]=n,1)}function hT(t){var e=t.items[0].orient;return e===gO||e===mO}function dT(t,e,n,i){var r,o,s=e.items[0],a=s.datum,l=null!=s.translate?s.translate:.5,c=s.orient,u=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(a),f=s.range,h=s.offset,d=s.position,p=s.minExtent,g=s.maxExtent,m=a.title&&s.items[u[2]].items[0],y=s.titlePadding,v=s.bounds,b=m&&sA(m),x=0,_=0;switch(uT.clear().union(v),v.clear(),(r=u[0])>-1&&v.union(s.items[r].bounds),(r=u[1])>-1&&v.union(s.items[r].bounds),c){case pO:x=d||0,_=-h,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&pT(t,m,o,y,b,0,-1,v);break;case gO:x=-h,_=d||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&pT(t,m,o,y,b,1,-1,v);break;case mO:x=n+h,_=d||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&pT(t,m,o,y,b,1,1,v);break;case yO:x=d||0,_=i+h,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&pT(t,m,o,y,0,0,1,v);break;default:x=s.x,_=s.y}return EM(v.translate(x,_),s),fT(s,"x",x+l)|fT(s,"y",_+l)&&(s.bounds=uT,t.dirty(s),s.bounds=v,t.dirty(s)),s.mark.bounds.clear().union(v)}function pT(t,e,n,i,r,o,s,a){const l=e.bounds;if(e.auto){const a=s*(n+r+i);let c=0,u=0;t.dirty(e),o?c=(e.x||0)-(e.x=a):u=(e.y||0)-(e.y=a),e.mark.bounds.clear().union(l.translate(-c,-u)),t.dirty(e)}a.union(l)}const gT=(t,e)=>Math.floor(Math.min(t,e)),mT=(t,e)=>Math.ceil(Math.max(t,e));function yT(t){return(new xM).set(0,0,t.width||0,t.height||0)}function vT(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function bT(t,e,n){const i=lh(t)?t[e]:t;return null!=i?i:void 0!==n?n:0}function xT(t){return t<0?Math.ceil(-t):0}function _T(t,e,n){var i,r,o,s,a,l,c,u,f,h,d,p=!n.nodirty,g=n.bounds===GO?yT:vT,m=uT.set(0,0,0,0),y=bT(n.align,XO),v=bT(n.align,ZO),b=bT(n.padding,XO),x=bT(n.padding,ZO),_=n.columns||e.length,w=_<=0?1:Math.ceil(e.length/_),k=e.length,$=Array(k),C=Array(_),E=0,S=Array(k),M=Array(w),D=0,A=Array(k),F=Array(k),O=Array(k);for(r=0;r<_;++r)C[r]=0;for(r=0;r1)for(r=0;r0&&(A[r]+=f/2);if(v&&bT(n.center,ZO)&&1!==_)for(r=0;r0&&(F[r]+=h/2);for(r=0;rr&&(t.warn("Grid headers exceed limit: "+r),e=e.slice(0,r)),$+=o,g=0,y=e.length;g=0&&null==(x=n[m]);m-=h);a?(_=null==d?x.x:Math.round(x.bounds.x1+d*x.bounds.width()),w=$):(_=$,w=null==d?x.y:Math.round(x.bounds.y1+d*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,t.dirty(b),C=s(C,v[c])}return C}function ET(t,e,n,i,r,o){if(e){t.dirty(e);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),e.bounds.translate(s-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=s,e.y=a,t.dirty(e)}}function ST(t,e,n,i,r,o,s){const a=function(t,e){const n=t[e]||{};return(e,i)=>null!=n[e]?n[e]:null!=t[e]?t[e]:i}(n,e),l=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,a("offset",0)),c=a("anchor",wO),u=c===$O?1:c===kO?.5:0,f={align:YO,bounds:a("bounds",GO),columns:"vertical"===a("direction")?1:t.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case gO:f.anchor={x:Math.floor(i.x1)-l,column:$O,y:u*(s||i.height()+2*i.y1),row:c};break;case mO:f.anchor={x:Math.ceil(i.x2)+l,y:u*(s||i.height()+2*i.y1),row:c};break;case pO:f.anchor={y:Math.floor(r.y1)-l,row:$O,x:u*(o||r.width()+2*r.x1),column:c};break;case yO:f.anchor={y:Math.ceil(r.y2)+l,x:u*(o||r.width()+2*r.x1),column:c};break;case vO:f.anchor={x:l,y:l};break;case bO:f.anchor={x:o-l,y:l,column:$O};break;case xO:f.anchor={x:l,y:s-l,row:$O};break;case _O:f.anchor={x:o-l,y:s-l,column:$O,row:$O}}return f}function MT(t,e){var n,i,r=e.items[0],o=r.datum,s=r.orient,a=r.bounds,l=r.x,c=r.y;return r._bounds?r._bounds.clear().union(a):r._bounds=a.clone(),a.clear(),function(t,e,n){var i=e.padding,r=i-n.x,o=i-n.y;if(e.datum.title){var s=e.items[1].items[0],a=s.anchor,l=e.titlePadding||0,c=i-s.x,u=i-s.y;switch(s.orient){case gO:r+=Math.ceil(s.bounds.width())+l;break;case mO:case yO:break;default:o+=s.bounds.height()+l}switch((r||o)&&AT(t,n,r,o),s.orient){case gO:u+=DT(e,n,s,a,1,1);break;case mO:c+=DT(e,n,s,$O,0,0)+l,u+=DT(e,n,s,a,1,1);break;case yO:c+=DT(e,n,s,a,0,0),u+=DT(e,n,s,$O,-1,0,1)+l;break;default:c+=DT(e,n,s,a,0,0)}(c||u)&&AT(t,s,c,u),(c=Math.round(s.bounds.x1-i))<0&&(AT(t,n,-c,0),AT(t,s,-c,0))}else(r||o)&&AT(t,n,r,o)}(t,r,r.items[0].items[0]),a=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(r,a),n=2*r.padding,i=2*r.padding,a.empty()||(n=Math.ceil(a.width()+n),i=Math.ceil(a.height()+i)),o.type===BO&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(r.items[0].items[0].items[0].items),s!==HO&&(r.x=l=0,r.y=c=0),r.width=n,r.height=i,EM(a.set(l,c,l+n,c+i),r),r.mark.bounds.clear().union(a),r}function DT(t,e,n,i,r,o,s){const a="symbol"!==t.datum.type,l=n.datum.vgrad,c=(!a||!o&&l||s?e:e.items[0]).bounds[r?"y2":"x2"]-t.padding,u=l&&o?c:0,f=l&&o?0:c,h=r<=0?0:sA(n);return Math.round(i===wO?u:i===$O?f-h:.5*(c-h))}function AT(t,e,n,i){e.x+=n,e.y+=i,e.bounds.translate(n,i),e.mark.bounds.translate(n,i),t.dirty(e)}function FT(t){Tb.call(this,null,t)}Jh(FT,Tb,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&wT(n,e,t.layout),function(t,e,n){var i,r,o,s,a,l=e.items,c=Math.max(0,e.width||0),u=Math.max(0,e.height||0),f=(new xM).set(0,0,c,u),h=f.clone(),d=f.clone(),p=[];for(s=0,a=l.length;s{(o=t.orient||mO)!==HO&&(e[o]||(e[o]=[])).push(t)}));for(const i in e){const r=e[i];_T(t,r,ST(r,i,n.legends,h,d,c,u))}p.forEach((e=>{const i=e.bounds;if(i.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=i,t.dirty(e)),!n.autosize||n.autosize.type!==jO&&n.autosize.type!==UO&&n.autosize.type!==qO)f.union(i);else switch(e.orient){case gO:case mO:f.add(i.x1,0).add(i.x2,0);break;case pO:case yO:f.add(0,i.y1).add(0,i.y2)}}))}f.union(h).union(d),i&&f.union(function(t,e,n,i,r){var o,s=e.items[0],a=s.frame,l=s.orient,c=s.anchor,u=s.offset,f=s.padding,h=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],p=l===gO||l===mO?i:n,g=0,m=0,y=0,v=0,b=0;if(a!==SO?l===gO?(g=r.y2,p=r.y1):l===mO?(g=r.y1,p=r.y2):(g=r.x1,p=r.x2):l===gO&&(g=i,p=0),o=c===wO?g:c===$O?p:(g+p)/2,d&&d.text){switch(l){case pO:case yO:b=h.bounds.height()+f;break;case gO:v=h.bounds.width()+f;break;case mO:v=-h.bounds.width()-f}uT.clear().union(d.bounds),uT.translate(v-(d.x||0),b-(d.y||0)),fT(d,"x",v)|fT(d,"y",b)&&(t.dirty(d),d.bounds.clear().union(uT),d.mark.bounds.clear().union(uT),t.dirty(d)),uT.clear().union(d.bounds)}else uT.clear();switch(uT.union(h.bounds),l){case pO:m=o,y=r.y1-uT.height()-u;break;case gO:m=r.x1-uT.width()-u,y=o;break;case mO:m=r.x2+uT.width()+u,y=o;break;case yO:m=o,y=r.y2+u;break;default:m=s.x,y=s.y}return fT(s,"x",m)|fT(s,"y",y)&&(uT.translate(m,y),t.dirty(s),s.bounds.clear().union(uT),e.bounds.clear().union(uT),t.dirty(s)),s.bounds}(t,i,c,u,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,i){const r=i.autosize||{},o=r.type;if(t._autosize<1||!o)return;let s=t._width,a=t._height,l=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-l)),d=Math.max(0,Math.ceil(n.y2-u));if(r.contains===IO){const e=t.padding();s-=e.left+e.right,a-=e.top+e.bottom}o===HO?(c=0,f=0,l=s,u=a):o===jO?(l=Math.max(0,s-c-h),u=Math.max(0,a-f-d)):o===UO?(l=Math.max(0,s-c-h),a=u+f+d):o===qO?(s=l+c+h,u=Math.max(0,a-f-d)):o===WO&&(s=l+c+h,a=u+f+d);t._resizeView(s,a,l,u,[c,f],r.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}});var OT=Object.freeze({__proto__:null,bound:JO,identifier:tT,mark:eT,overlap:nT,render:cT,viewlayout:FT});function TT(t){Tb.call(this,null,t)}function NT(t){Tb.call(this,null,t)}function zT(){return nb({})}function LT(t){Tb.call(this,null,t)}function RT(t){Tb.call(this,[],t)}Jh(TT,Tb,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,o=t.scale,s=nS(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),a=t.format||oS(n,o,s,t.formatSpecifier,t.formatType,!!t.values),l=t.values?iS(o,t.values,s):rS(o,s);return r&&(i.rem=r),r=l.map(((t,e)=>nb({index:e/(l.length-1||1),value:t,label:a(t)}))),t.extra&&r.length&&r.push(nb({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}}),Jh(NT,Tb,{transform(t,e){var n=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.item||zT,o=t.key||tb,s=this.value;return ah(i.encode)&&(i.encode=null),s&&(t.modified("key")||e.modified(o))&&Hf("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=function(t){const e=Xh().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=s.get(e);n?n.exit?(s.empty--,i.add.push(n)):i.mod.push(n):(n=r(t),s.set(e,n),i.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=s.get(e);n&&(n.datum=t,i.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=s.get(e);t!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++s.empty)})),e.changed(e.ADD_MOD)&&i.modifies("datum"),(e.clean()||t.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}}),Jh(LT,Tb,{transform(t,e){var n=e.fork(e.ADD_REM),i=t.mod||!1,r=t.encoders,o=e.encode;if(ah(o)){if(!n.changed()&&!o.every((t=>r[t])))return e.StopPropagation;o=o[0],n.encode=null}var s="enter"===o,a=r.update||Kf,l=r.enter||Kf,c=r.exit||Kf,u=(o&&!s?r[o]:a)||Kf;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{l(e,t),a(e,t)})),n.modifies(l.output),n.modifies(a.output),u!==Kf&&u!==a&&(e.visit(e.ADD,(e=>{u(e,t)})),n.modifies(u.output))),e.changed(e.REM)&&c!==Kf&&(e.visit(e.REM,(e=>{c(e,t)})),n.modifies(c.output)),s||u!==Kf){const r=e.MOD|(t.modified()?e.REFLOW:0);s?(e.visit(r,(e=>{const r=l(e,t)||i;(u(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(l.output)):e.visit(r,(e=>{(u(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}}),Jh(RT,Tb,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,i,r,o,s,a=e.dataflow.locale(),l=e.fork(e.NO_SOURCE|e.NO_FIELDS),c=this.value,u=t.type||JE,f=t.scale,h=+t.limit,d=nS(f,null==t.count?5:t.count,t.minstep),p=!!t.values||u===JE,g=t.format||fS(a,f,d,u,t.formatSpecifier,t.formatType,p),m=t.values||cS(f,d);return c&&(l.rem=c),u===JE?(h&&m.length>h?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),c=m.slice(0,h-1),s=!0):c=m,Nh(r=t.size)?(t.values||0!==f(c[0])||(c=c.slice(1)),o=c.reduce(((e,n)=>Math.max(e,r(n,t))),0)):r=jh(o=r||8),c=c.map(((e,n)=>nb({index:n,label:g(e,n,c),value:e,offset:o,size:r(e,t)}))),s&&(s=m[c.length],c.push(nb({index:c.length,label:`…${m.length-c.length} entries`,value:s,offset:o,size:r(s,t)})))):"gradient"===u?(n=f.domain(),i=HE(f,n[0],dh(n)),m.length<3&&!t.values&&n[0]!==dh(n)&&(m=[n[0],dh(n)]),c=m.map(((t,e)=>nb({index:e,label:g(t,e,m),value:t,perc:i(t)})))):(r=m.length-1,i=function(t){const e=t.domain(),n=e.length-1;let i=+e[0],r=+dh(e),o=r-i;if(t.type===gE){const t=n?o/n:.1;i-=t,r+=t,o=r-i}return t=>(t-i)/o}(f),c=m.map(((t,e)=>nb({index:e,label:g(t,e,m),value:t,perc:e?i(t):0,perc2:e===r?1:i(m[e+1])})))),l.source=c,l.add=c,this.value=c,l}});const PT=t=>t.source.x,IT=t=>t.source.y,BT=t=>t.target.x,jT=t=>t.target.y;function UT(t){Tb.call(this,{},t)}UT.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Jh(UT,Tb,{transform(t,e){var n=t.sourceX||PT,i=t.sourceY||IT,r=t.targetX||BT,o=t.targetY||jT,s=t.as||"path",a=t.orient||"vertical",l=t.shape||"line",c=VT.get(l+"-"+a)||VT.get(l);return c||Hf("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[s]=c(n(t),i(t),r(t),o(t))})),e.reflow(t.modified()).modifies(s)}});const qT=(t,e,n,i)=>"M"+t+","+e+"L"+n+","+i,WT=(t,e,n,i)=>{var r=n-t,o=i-e,s=Math.hypot(r,o)/2;return"M"+t+","+e+"A"+s+","+s+" "+180*Math.atan2(o,r)/Math.PI+" 0 1 "+n+","+i},HT=(t,e,n,i)=>{const r=n-t,o=i-e,s=.2*(r+o),a=.2*(o-r);return"M"+t+","+e+"C"+(t+s)+","+(e+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},VT=Xh({line:qT,"line-radial":(t,e,n,i)=>qT(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),arc:WT,"arc-radial":(t,e,n,i)=>WT(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),curve:HT,"curve-radial":(t,e,n,i)=>HT(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(t,e,n,i)=>"M"+t+","+e+"V"+i+"H"+n,"orthogonal-vertical":(t,e,n,i)=>"M"+t+","+e+"H"+n+"V"+i,"orthogonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n);return"M"+e*r+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*s+","+e*a+"L"+i*s+","+i*a},"diagonal-horizontal":(t,e,n,i)=>{const r=(t+n)/2;return"M"+t+","+e+"C"+r+","+e+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(t,e,n,i)=>{const r=(e+i)/2;return"M"+t+","+e+"C"+t+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(t,e,n,i)=>{const r=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=(e+i)/2;return"M"+e*r+","+e*o+"C"+l*r+","+l*o+" "+l*s+","+l*a+" "+i*s+","+i*a}});function YT(t){Tb.call(this,null,t)}YT.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Jh(YT,Tb,{transform(t,e){var n,i,r,o=t.as||["startAngle","endAngle"],s=o[0],a=o[1],l=t.field||Jf,c=t.startAngle||0,u=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,h=f.map(l),d=h.length,p=c,g=(u-c)/mp(h),m=gp(d);for(t.sort&&m.sort(((t,e)=>h[t]-h[e])),n=0;nt+(e<0?-1:e>0?1:0)),0))!==e.length&&n.warn("Log scale domain includes zero: "+hd(e)));return e}function KT(t,e,n){return Nh(t)&&(e||n)?UE(t,tN(e||[0,1],n)):t}function tN(t,e){return e?t.slice().reverse():t}function eN(t){Tb.call(this,null,t)}Jh(JT,Tb,{transform(t,e){var n=e.dataflow,i=this.value,r=function(t){var e,n=t.type,i="";if(n===fE)return fE+"-"+rE;(function(t){const e=t.type;return zE(e)&&e!==cE&&e!==uE&&(t.scheme||t.range&&t.range.length&&t.range.every(rd))})(t)&&(i=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?fE+"-":3===e?hE+"-":"");return(i+n||rE).toLowerCase()}(t);for(r in i&&r===i.type||(this.value=i=OE(r)()),t)if(!ZT[r]){if("padding"===r&&XT(i.type))continue;Nh(i[r])?i[r](t[r]):n.warn("Unsupported scale property: "+r)}return function(t,e,n){var i=t.type,r=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==vE&&t!==yE&&Hf("Only band and point scales support rangeStep.");var i=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,r=t===yE?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*iE(n,r,i)]}(i,e,n);else if(e.scheme&&(o=function(t,e,n){var i,r=e.schemeExtent;ah(e.scheme)?i=qE(e.scheme,e.interpolate,e.interpolateGamma):(i=ZE(e.scheme.toLowerCase()))||Hf(`Unrecognized scheme name: ${e.scheme}`);return n=t===gE?n+1:t===bE?n-1:t===dE||t===pE?+e.schemeCount||GT:n,IE(t)?KT(i,r,e.reverse):Nh(i)?WE(KT(i,r),n):t===mE?i:i.slice(0,n)}(i,e,n),Nh(o))){if(t.interpolator)return t.interpolator(o);Hf(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&IE(i))return t.interpolator(qE(tN(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(VE(e.interpolate,e.interpolateGamma)):Nh(t.round)?t.round(r):Nh(t.rangeRound)&&t.interpolate(r?tC:K$);o&&t.range(tN(o,e.reverse))}(i,t,function(t,e,n){let i=e.bins;if(i&&!ah(i)){const e=t.domain(),n=e[0],r=dh(e),o=i.step;let s=null==i.start?n:i.start,a=null==i.stop?r:i.stop;o||Hf("Scale bins parameter missing step property."),sr&&(a=o*Math.floor(r/o)),i=gp(s,a+o/2,o)}i?t.bins=i:t.bins&&delete t.bins;t.type===bE&&(i?e.domain||e.domainRaw||(t.domain(i),n=i.length):t.bins=t.domain());return n}(i,t,function(t,e,n){const i=function(t,e,n){return e?(t.domain(QT(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(i>-1)return i;var r,o,s=e.domain,a=t.type,l=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===rE||e===sE||e===aE)}(t);if(!s)return 0;XT(a)&&e.padding&&s[0]!==dh(s)&&(s=function(t,e,n,i,r,o){var s=Math.abs(dh(n)-n[0]),a=s/(s-2*i),l=t===oE?Sh(e,null,a):t===aE?Mh(e,null,a,.5):t===sE?Mh(e,null,a,r||1):t===lE?Dh(e,null,a,o||1):Eh(e,null,a);return e=e.slice(),e[0]=l[0],e[e.length-1]=l[1],e}(a,s,e.range,e.padding,e.exponent,e.constant));if((l||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(r=(s=s.slice()).length-1||1,l&&(s[0]>0&&(s[0]=0),s[r]<0&&(s[r]=0)),null!=e.domainMin&&(s[0]=e.domainMin),null!=e.domainMax&&(s[r]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>s[r]?r+1:ot(l);if(null==e)d.push(t.slice());else for(r={},o=0,s=t.length;oh&&(h=f),n&&u.sort(n)}return d.max=h,d}(e.source,t.groupby,c,u),i=0,r=n.length,o=n.max;i0?1:t<0?-1:0},AN=Math.sqrt,FN=Math.tan;function ON(t){return t>1?0:t<-1?dN:Math.acos(t)}function TN(t){return t>1?pN:t<-1?-pN:Math.asin(t)}function NN(){}function zN(t,e){t&&RN.hasOwnProperty(t.type)&&RN[t.type](t,e)}var LN={Feature:function(t,e){zN(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,o=wN(e=(e*=vN)/2+gN),s=MN(e),a=HN*s,l=WN*o+a*wN(r),c=a*i*MN(r);iz.add(_N(c,l)),qN=t,WN=o,HN=s}function uz(t){return[_N(t[1],t[0]),TN(t[2])]}function fz(t){var e=t[0],n=t[1],i=wN(n);return[i*wN(e),i*MN(e),MN(n)]}function hz(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dz(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function pz(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function gz(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function mz(t){var e=AN(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var yz,vz,bz,xz,_z,wz,kz,$z,Cz,Ez,Sz,Mz,Dz,Az,Fz,Oz,Tz={point:Nz,lineStart:Lz,lineEnd:Rz,polygonStart:function(){Tz.point=Pz,Tz.lineStart=Iz,Tz.lineEnd=Bz,tz=new Vd,oz.polygonStart()},polygonEnd:function(){oz.polygonEnd(),Tz.point=Nz,Tz.lineStart=Lz,Tz.lineEnd=Rz,iz<0?(VN=-(GN=180),YN=-(XN=90)):tz>fN?XN=90:tz<-fN&&(YN=-90),nz[0]=VN,nz[1]=GN},sphere:function(){VN=-(GN=180),YN=-(XN=90)}};function Nz(t,e){ez.push(nz=[VN=t,GN=t]),eXN&&(XN=e)}function zz(t,e){var n=fz([t*vN,e*vN]);if(KN){var i=dz(KN,n),r=dz([i[1],-i[0],0],i);mz(r),r=uz(r);var o,s=t-ZN,a=s>0?1:-1,l=r[0]*yN*a,c=bN(s)>180;c^(a*ZNXN&&(XN=o):c^(a*ZN<(l=(l+360)%360-180)&&lXN&&(XN=e)),c?tjz(VN,GN)&&(GN=t):jz(t,GN)>jz(VN,GN)&&(VN=t):GN>=VN?(tGN&&(GN=t)):t>ZN?jz(VN,t)>jz(VN,GN)&&(GN=t):jz(t,GN)>jz(VN,GN)&&(VN=t)}else ez.push(nz=[VN=t,GN=t]);eXN&&(XN=e),KN=n,ZN=t}function Lz(){Tz.point=zz}function Rz(){nz[0]=VN,nz[1]=GN,Tz.point=Nz,KN=null}function Pz(t,e){if(KN){var n=t-ZN;tz.add(bN(n)>180?n+(n>0?360:-360):n)}else JN=t,QN=e;oz.point(t,e),zz(t,e)}function Iz(){oz.lineStart()}function Bz(){Pz(JN,QN),oz.lineEnd(),bN(tz)>fN&&(VN=-(GN=180)),nz[0]=VN,nz[1]=GN,KN=null}function jz(t,e){return(e-=t)<0?e+360:e}function Uz(t,e){return t[0]-e[0]}function qz(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:edN&&(t-=Math.round(t/mN)*mN),[t,e]}function iL(t,e,n){return(t%=mN)?e||n?eL(oL(t),sL(e,n)):oL(t):e||n?sL(e,n):nL}function rL(t){return function(e,n){return bN(e+=t)>dN&&(e-=Math.round(e/mN)*mN),[e,n]}}function oL(t){var e=rL(t);return e.invert=rL(-t),e}function sL(t,e){var n=wN(t),i=MN(t),r=wN(e),o=MN(e);function s(t,e){var s=wN(e),a=wN(t)*s,l=MN(t)*s,c=MN(e),u=c*n+a*i;return[_N(l*r-u*o,a*n-c*i),TN(u*r+l*o)]}return s.invert=function(t,e){var s=wN(e),a=wN(t)*s,l=MN(t)*s,c=MN(e),u=c*r-l*o;return[_N(l*r+c*o,a*n+u*i),TN(u*n-a*i)]},s}function aL(t,e){(e=fz(e))[0]-=t,mz(e);var n=ON(-e[1]);return((-e[2]<0?-n:n)+mN-fN)%mN}function lL(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:NN,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function cL(t,e){return bN(t[0]-e[0])=0;--o)r.point((u=c[o])[0],u[1]);else i(h.x,h.p.x,-1,r);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);r.lineEnd()}}}function hL(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i=0?1:-1,E=C*$,S=E>dN,M=m*w;if(l.add(_N(M*C*MN(E),y*k+M*wN(E))),s+=S?$+C*mN:$,S^p>=n^x>=n){var D=dz(fz(d),fz(b));mz(D);var A=dz(o,D);mz(A);var F=(S^$>=0?-1:1)*TN(A[2]);(i>F||i===F&&(D[0]||D[1]))&&(a+=S^$>=0?1:-1)}}return(s<-fN||s0){for(f||(r.polygonStart(),f=!0),r.lineStart(),t=0;t1&&2&l&&h.push(h.pop().concat(h.shift())),s.push(h.filter(gL))}return h}}function gL(t){return t.length>1}function mL(t,e){return((t=t.x)[0]<0?t[1]-pN-fN:pN-t[1])-((e=e.x)[0]<0?e[1]-pN-fN:pN-e[1])}nL.invert=nL;var yL=pL((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?dN:-dN,l=bN(o-n);bN(l-dN)0?pN:-pN),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&l>=dN&&(bN(n-r)fN?xN((MN(e)*(o=wN(i))*MN(n)-MN(i)*(r=wN(e))*MN(t))/(r*o*s)):(e+i)/2}(n,i,o,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=o,i=s),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*pN,i.point(-dN,r),i.point(0,r),i.point(dN,r),i.point(dN,0),i.point(dN,-r),i.point(0,-r),i.point(-dN,-r),i.point(-dN,0),i.point(-dN,r);else if(bN(t[0]-e[0])>fN){var o=t[0]0,r=bN(e)>fN;function o(t,n){return wN(t)*wN(n)>e}function s(t,n,i){var r=[1,0,0],o=dz(fz(t),fz(n)),s=hz(o,o),a=o[0],l=s-a*a;if(!l)return!i&&t;var c=e*s/l,u=-e*a/l,f=dz(r,o),h=gz(r,c);pz(h,gz(o,u));var d=f,p=hz(h,d),g=hz(d,d),m=p*p-g*(hz(h,h)-1);if(!(m<0)){var y=AN(m),v=gz(d,(-p-y)/g);if(pz(v,h),v=uz(v),!i)return v;var b,x=t[0],_=n[0],w=t[1],k=n[1];_0^v[1]<(bN(v[0]-x)dN^(x<=v[0]&&v[0]<=_)){var E=gz(d,(-p+y)/g);return pz(E,h),[v,uz(E)]}}}function a(e,n){var r=i?t:dN-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return pL(o,(function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],g=o(f,h),m=i?g?0:a(f,h):g?a(f+(f<0?dN:-dN),h):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(d=s(e,p))||cL(e,d)||cL(p,d))&&(p[2]=1),g!==l)u=0,g?(t.lineStart(),d=s(p,e),t.point(d[0],d[1])):(d=s(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(r&&e&&i^g){var y;m&n||!(y=s(p,e,!0))||(u=0,i?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&cL(e,p)||t.point(p[0],p[1]),e=p,l=g,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(e,i,r,o){!function(t,e,n,i,r,o){if(n){var s=wN(e),a=MN(e),l=i*n;null==r?(r=e+i*mN,o=e-l/2):(r=aL(s,r),o=aL(s,o),(i>0?ro)&&(r+=i*mN));for(var c,u=r;i>0?u>o:u0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+a+4)%4)!==f);else c.point(o[0],o[1])}function s(i,r){return bN(i[0]-t)0?0:3:bN(i[0]-n)0?2:1:bN(i[1]-e)0?1:0:r>0?3:2}function a(t,e){return l(t.x,e.x)}function l(t,e){var n=s(t,1),i=s(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var l,c,u,f,h,d,p,g,m,y,v,b=s,x=lL(),_={point:w,lineStart:function(){_.point=k,c&&c.push(u=[]);y=!0,m=!1,p=g=NaN},lineEnd:function(){l&&(k(f,h),d&&m&&x.rejoin(),l.push(x.result()));_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;ni&&(h-o)*(i-s)>(d-s)*(t-o)&&++e:d<=i&&(h-o)*(i-s)<(d-s)*(t-o)&&--e;return e}(),n=v&&e,r=(l=pp(l)).length;(n||r)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),r&&fL(l,a,e,o,s),s.polygonEnd());b=s,l=c=u=null}};function w(t,e){r(t,e)&&b.point(t,e)}function k(o,s){var a=r(o,s);if(c&&u.push([o,s]),y)f=o,h=s,d=a,y=!1,a&&(b.lineStart(),b.point(o,s));else if(a&&m)b.point(o,s);else{var l=[p=Math.max(xL,Math.min(bL,p)),g=Math.max(xL,Math.min(bL,g))],x=[o=Math.max(xL,Math.min(bL,o)),s=Math.max(xL,Math.min(bL,s))];!function(t,e,n,i,r,o){var s,a=t[0],l=t[1],c=0,u=1,f=e[0]-a,h=e[1]-l;if(s=n-a,f||!(s>0)){if(s/=f,f<0){if(s0){if(s>u)return;s>c&&(c=s)}if(s=r-a,f||!(s<0)){if(s/=f,f<0){if(s>u)return;s>c&&(c=s)}else if(f>0){if(s0)){if(s/=h,h<0){if(s0){if(s>u)return;s>c&&(c=s)}if(s=o-l,h||!(s<0)){if(s/=h,h<0){if(s>u)return;s>c&&(c=s)}else if(h>0){if(s0&&(t[0]=a+c*f,t[1]=l+c*h),u<1&&(e[0]=a+u*f,e[1]=l+u*h),!0}}}}}(l,x,t,e,n,i)?a&&(b.lineStart(),b.point(o,s),v=!1):(m||(b.lineStart(),b.point(l[0],l[1])),b.point(x[0],x[1]),a||b.lineEnd(),v=!1)}p=o,g=s,m=a}return _}}function wL(t,e,n){var i=gp(t,e-fN,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function kL(t,e,n){var i=gp(t,e-fN,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}var $L,CL,EL,SL,ML=t=>t,DL=new Vd,AL=new Vd,FL={point:NN,lineStart:NN,lineEnd:NN,polygonStart:function(){FL.lineStart=OL,FL.lineEnd=zL},polygonEnd:function(){FL.lineStart=FL.lineEnd=FL.point=NN,DL.add(bN(AL)),AL=new Vd},result:function(){var t=DL/2;return DL=new Vd,t}};function OL(){FL.point=TL}function TL(t,e){FL.point=NL,$L=EL=t,CL=SL=e}function NL(t,e){AL.add(SL*t-EL*e),EL=t,SL=e}function zL(){NL($L,CL)}var LL=FL,RL=1/0,PL=RL,IL=-RL,BL=IL,jL={point:function(t,e){tIL&&(IL=t);eBL&&(BL=e)},lineStart:NN,lineEnd:NN,polygonStart:NN,polygonEnd:NN,result:function(){var t=[[RL,PL],[IL,BL]];return IL=BL=-(PL=RL=1/0),t}};var UL,qL,WL,HL,VL=jL,YL=0,GL=0,XL=0,ZL=0,JL=0,QL=0,KL=0,tR=0,eR=0,nR={point:iR,lineStart:rR,lineEnd:aR,polygonStart:function(){nR.lineStart=lR,nR.lineEnd=cR},polygonEnd:function(){nR.point=iR,nR.lineStart=rR,nR.lineEnd=aR},result:function(){var t=eR?[KL/eR,tR/eR]:QL?[ZL/QL,JL/QL]:XL?[YL/XL,GL/XL]:[NaN,NaN];return YL=GL=XL=ZL=JL=QL=KL=tR=eR=0,t}};function iR(t,e){YL+=t,GL+=e,++XL}function rR(){nR.point=oR}function oR(t,e){nR.point=sR,iR(WL=t,HL=e)}function sR(t,e){var n=t-WL,i=e-HL,r=AN(n*n+i*i);ZL+=r*(WL+t)/2,JL+=r*(HL+e)/2,QL+=r,iR(WL=t,HL=e)}function aR(){nR.point=iR}function lR(){nR.point=uR}function cR(){fR(UL,qL)}function uR(t,e){nR.point=fR,iR(UL=WL=t,qL=HL=e)}function fR(t,e){var n=t-WL,i=e-HL,r=AN(n*n+i*i);ZL+=r*(WL+t)/2,JL+=r*(HL+e)/2,QL+=r,KL+=(r=HL*t-WL*e)*(WL+t),tR+=r*(HL+e),eR+=3*r,iR(WL=t,HL=e)}var hR=nR;function dR(t){this._context=t}dR.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,mN)}},result:NN};var pR,gR,mR,yR,vR,bR=new Vd,xR={point:NN,lineStart:function(){xR.point=_R},lineEnd:function(){pR&&wR(gR,mR),xR.point=NN},polygonStart:function(){pR=!0},polygonEnd:function(){pR=null},result:function(){var t=+bR;return bR=new Vd,t}};function _R(t,e){xR.point=wR,gR=yR=t,mR=vR=e}function wR(t,e){yR-=t,vR-=e,bR.add(AN(yR*yR+vR*vR)),yR=t,vR=e}var kR=xR;let $R,CR,ER,SR;class MR{constructor(t){this._append=null==t?DR:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return DR;if(e!==$R){const t=10**e;$R=e,CR=function(e){let n=1;this._+=e[0];for(const i=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);r=e}return null===e&&(i=new MR(r)),s},s.projection(t).digits(r).context(e)}function FR(t){return function(e){var n=new OR;for(var i in t)n[i]=t[i];return n.stream=e,n}}function OR(){}function TR(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),BN(n,t.stream(VL)),e(VL.result()),null!=i&&t.clipExtent(i),t}function NR(t,e,n){return TR(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),s=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([s,a])}),n)}function zR(t,e,n){return NR(t,[[0,0],e],n)}function LR(t,e,n){return TR(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,s=-r*n[0][1];t.scale(150*r).translate([o,s])}),n)}function RR(t,e,n){return TR(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],s=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,s])}),n)}OR.prototype={constructor:OR,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var PR=16,IR=wN(30*vN);function BR(t,e){return+e?function(t,e){function n(i,r,o,s,a,l,c,u,f,h,d,p,g,m){var y=c-i,v=u-r,b=y*y+v*v;if(b>4*e&&g--){var x=s+h,_=a+d,w=l+p,k=AN(x*x+_*_+w*w),$=TN(w/=k),C=bN(bN(w)-1)e||bN((y*D+v*A)/b-.5)>.3||s*h+a*d+l*p2?t[2]%360*vN:0,D()):[m*yN,y*yN,v*yN]},S.angle=function(t){return arguments.length?(b=t%360*vN,D()):b*yN},S.reflectX=function(t){return arguments.length?(x=t?-1:1,D()):x<0},S.reflectY=function(t){return arguments.length?(_=t?-1:1,D()):_<0},S.precision=function(t){return arguments.length?(s=BR(a,E=t*t),A()):AN(E)},S.fitExtent=function(t,e){return NR(S,t,e)},S.fitSize=function(t,e){return zR(S,t,e)},S.fitWidth=function(t,e){return LR(S,t,e)},S.fitHeight=function(t,e){return RR(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,D()}}function HR(t){var e=0,n=dN/3,i=WR(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*vN,n=t[1]*vN):[e*yN,n*yN]},r}function VR(t,e){var n=MN(t),i=(n+MN(e))/2;if(bN(i)2?t[2]*vN:0),e.invert=function(e){return(e=t.invert(e[0]*vN,e[1]*vN))[0]*=yN,e[1]*=yN,e},e}(r.rotate()).invert([0,0]));return l(null==c?[[a[0]-o,a[1]-o],[a[0]+o,a[1]+o]]:t===KR?[[Math.max(a[0]-o,c),e],[Math.min(a[0]+o,n),i]]:[[c,Math.max(a[1]-o,e)],[n,Math.min(a[1]+o,i)]])}return r.scale=function(t){return arguments.length?(s(t),u()):s()},r.translate=function(t){return arguments.length?(a(t),u()):a()},r.center=function(t){return arguments.length?(o(t),u()):o()},r.clipExtent=function(t){return arguments.length?(null==t?c=e=n=i=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==c?null:[[c,e],[n,i]]},u()}function eP(t){return FN((pN+t)/2)}function nP(t,e){var n=wN(t),i=t===e?MN(t):EN(n/wN(e))/EN(eP(e)/eP(t)),r=n*SN(eP(t),i)/i;if(!i)return KR;function o(t,e){r>0?e<-pN+fN&&(e=-pN+fN):e>pN-fN&&(e=pN-fN);var n=r/SN(eP(e),i);return[n*MN(i*t),r-n*wN(i*t)]}return o.invert=function(t,e){var n=r-e,o=DN(i)*AN(t*t+n*n),s=_N(t,bN(n))*DN(n);return n*i<0&&(s-=dN*DN(t)*DN(n)),[s/i,2*xN(SN(r/o,1/i))-pN]},o}function iP(t,e){return[t,e]}function rP(t,e){var n=wN(t),i=t===e?MN(t):(n-wN(e))/(e-t),r=n/i+t;if(bN(i)fN&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},dP.invert=ZR(TN),pP.invert=ZR((function(t){return 2*xN(t)})),gP.invert=function(t,e){return[-e,2*xN($N(t))-pN]};var mP=Math.abs,yP=Math.cos,vP=Math.sin,bP=1e-6,xP=Math.PI,_P=xP/2,wP=function(t){return t>0?Math.sqrt(t):0}(2);function kP(t){return t>1?_P:t<-1?-_P:Math.asin(t)}function $P(t,e){var n,i=t*vP(e),r=30;do{e-=n=(e+vP(e)-i)/(1+yP(e))}while(mP(n)>bP&&--r>0);return e/2}var CP=function(t,e,n){function i(i,r){return[t*i*yP(r=$P(n,r)),e*vP(r)]}return i.invert=function(i,r){return r=kP(r/e),[i/(t*yP(r)),kP((2*r+vP(2*r))/n)]},i}(wP/_P,wP,xP);const EP=AR(),SP=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function MP(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(AP[t]=function(t,e){return function n(){const i=e();return i.type=t,i.path=AR().projection(i),i.copy=i.copy||function(){const t=n();return SP.forEach((e=>{i[e]&&t[e](i[e]())})),t.path.pointRadius(i.path.pointRadius()),t},FE(i)}}(t,e),this):AP[t]||null}function DP(t){return t&&t.path||EP}const AP={albers:GR,albersusa:function(){var t,e,n,i,r,o,s=GR(),a=YR().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=YR().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],s=t[1];return o=null,n.point(e,s),o||(i.point(e,s),o)||(r.point(e,s),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=s.scale(),n=s.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:s).invert(t)},u.stream=function(n){return t&&e===n?t:(i=[s.stream(e=n),a.stream(n),l.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const t in AP)MP(t,AP[t]);function FP(){}const OP=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function TP(){var t=1,e=1,n=s;function i(t,e){return e.map((e=>r(t,e)))}function r(i,r){var s=[],a=[];return function(n,i,r){var s,a,l,c,u,f,h=new Array,d=new Array;s=a=-1,c=n[0]>=i,OP[c<<1].forEach(p);for(;++s=i,OP[l|c<<1].forEach(p);OP[c<<0].forEach(p);for(;++a=i,u=n[a*t]>=i,OP[c<<1|u<<2].forEach(p);++s=i,f=u,u=n[a*t+s+1]>=i,OP[l|c<<1|u<<2|f<<3].forEach(p);OP[c|u<<3].forEach(p)}s=-1,u=n[a*t]>=i,OP[u<<2].forEach(p);for(;++s=i,OP[u<<2|f<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+s,t[0][1]+a],l=[t[1][0]+s,t[1][1]+a],c=o(i),u=o(l);(e=d[c])?(n=h[u])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(l),r(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(l),d[e.end=u]=e):(e=h[u])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(l),r(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(i),h[e.start=c]=e):h[c]=d[u]={start:c,end:u,ring:[i,l]}}OP[u<<3].forEach(p)}(i,r,(t=>{n(t,i,r),function(t){var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e0?s.push([t]):a.push(t)})),a.forEach((t=>{for(var e,n=0,i=s.length;n{var o,s=n[0],a=n[1],l=0|s,c=0|a,u=i[c*t+l];s>0&&s0&&a=0&&o>=0||Hf("invalid size"),t=r,e=o,i},i.smooth=function(t){return arguments.length?(n=t?s:FP,i):n===s},i}function NP(t,e){for(var n,i=-1,r=e.length;++ii!=d>i&&n<(h-c)*(i-u)/(d-u)+c&&(r=-r)}return r}function LP(t,e,n){var i,r,o,s;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],o=n[i],s=e[i],r<=o&&o<=s||s<=o&&o<=r)}function RP(t,e,n){return function(i){var r=Wh(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,l=e?sp(o,s,t):a/(t+1);return gp(o+l,s,l)}}function PP(t){Tb.call(this,null,t)}function IP(t,e,n,i,r){const o=t.x1||0,s=t.y1||0,a=e*n<0;function l(t){t.forEach(c)}function c(t){a&&t.reverse(),t.forEach(u)}function u(t){t[0]=(t[0]-o)*e+i,t[1]=(t[1]-s)*n+r}return function(t){return t.coordinates.forEach(l),t}}function BP(t,e,n){const i=t>=0?t:Bb(e,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function jP(t){return Nh(t)?t:jh(+t)}function UP(){var t=t=>t[0],e=t=>t[1],n=Jf,i=[-1,-1],r=960,o=500,s=2;function a(a,l){const c=BP(i[0],a,t)>>s,u=BP(i[1],a,e)>>s,f=c?c+2:0,h=u?u+2:0,d=2*f+(r>>s),p=2*h+(o>>s),g=new Float32Array(d*p),m=new Float32Array(d*p);let y=g;a.forEach((i=>{const r=f+(+t(i)>>s),o=h+(+e(i)>>s);r>=0&&r=0&&o0&&u>0?(qP(d,p,g,m,c),WP(d,p,m,g,u),qP(d,p,g,m,c),WP(d,p,m,g,u),qP(d,p,g,m,c),WP(d,p,m,g,u)):c>0?(qP(d,p,g,m,c),qP(d,p,m,g,c),qP(d,p,g,m,c),y=m):u>0&&(WP(d,p,g,m,u),WP(d,p,m,g,u),WP(d,p,g,m,u),y=m);const v=l?Math.pow(2,-2*s):1/mp(y);for(let t=0,e=d*p;t>s),y2:h+(o>>s)}}return a.x=function(e){return arguments.length?(t=jP(e),a):t},a.y=function(t){return arguments.length?(e=jP(t),a):e},a.weight=function(t){return arguments.length?(n=jP(t),a):n},a.size=function(t){if(!arguments.length)return[r,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||Hf("invalid size"),r=e,o=n,a},a.cellSize=function(t){return arguments.length?((t=+t)>=1||Hf("invalid cell size"),s=Math.floor(Math.log(t)/Math.LN2),a):1<=r&&(e>=o&&(a-=n[e-o+s*t]),i[e-r+s*t]=a/Math.min(e+1,t-1+o-e,o))}function WP(t,e,n,i,r){const o=1+(r<<1);for(let s=0;s=r&&(a>=o&&(l-=n[s+(a-o)*t]),i[s+(a-r)*t]=l/Math.min(a+1,e-1+o-a,o))}function HP(t){Tb.call(this,null,t)}PP.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Jh(PP,Tb,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=t.field||Xf,o=TP().smooth(!1!==t.smooth),s=t.thresholds||function(t,e,n){const i=RP(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(t.map((t=>ap(e(t).values))))}(i,r,t),a=null===t.as?null:t.as||"contour",l=[];return i.forEach((e=>{const n=r(e),i=o.size([n.width,n.height])(n.values,ah(s)?s:s(n.values));!function(t,e,n,i){let r=i.scale||e.scale,o=i.translate||e.translate;Nh(r)&&(r=r(n,i));Nh(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const s=(nd(r)?r:r[0])||1,a=(nd(r)?r:r[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;t.forEach(IP(e,s,a,l,c))}(i,n,e,t),i.forEach((t=>{l.push(rb(e,nb(null!=a?{[a]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),HP.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const VP=["x","y","weight","size","cellSize","bandwidth"];function YP(t,e){return VP.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function GP(t){Tb.call(this,null,t)}Jh(HP,Tb,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=function(t,e){var n,i,r,o,s,a,l=[],c=t=>t(o);if(null==e)l.push(t);else for(n={},i=0,r=t.length;inb(function(t,e){for(let n=0;nfN})).map(l)).concat(gp(kN(o/d)*d,r,d).filter((function(t){return bN(t%g)>fN})).map(c))}return y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(f(s).slice(1),u(n).reverse().slice(1),f(a).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],a=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),a>s&&(t=a,a=s,s=t),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),y.precision(m)):[[e,o],[t,r]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(m=+h,l=wL(o,r,90),c=kL(e,t,m),u=wL(a,s,90),f=kL(i,n,m),y):m},y.extentMajor([[-180,-90+fN],[180,90-fN]]).extentMinor([[-180,-80-fN],[180,80+fN]])}()}function nI(t){Tb.call(this,null,t)}function iI(t){if(!Nh(t))return!1;const e=yd(jf(t));return e.$x||e.$y||e.$value||e.$max}function rI(t){Tb.call(this,null,t),this.modified(!0)}function oI(t,e,n){Nh(t[e])&&t[e](n)}JP.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},Jh(JP,Tb,{transform(t,e){var n,i=this._features,r=this._points,o=t.fields,s=o&&o[0],a=o&&o[1],l=t.geojson||!o&&Xf,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(jf(l))||s&&e.modified(jf(s))||a&&e.modified(jf(a)),this.value&&!n||(c=e.SOURCE,this._features=i=[],this._points=r=[]),l&&e.visit(c,(t=>i.push(l(t)))),s&&a&&(e.visit(c,(t=>{var e=s(t),n=a(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&r.push([e,n])})),i=i.concat({type:XP,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:ZP,features:i}}}),QP.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Jh(QP,Tb,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.field||Xf,o=t.as||"path",s=n.SOURCE;!i||t.modified()?(this.value=i=DP(t.projection),n.materialize().reflow()):s=r===Xf||e.modified(r.fields)?n.ADD_MOD:n.ADD;const a=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(i,t.pointRadius);return n.visit(s,(t=>t[o]=i(r(t)))),i.pointRadius(a),n.modifies(o)}}),KP.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Jh(KP,Tb,{transform(t,e){var n,i=t.projection,r=t.fields[0],o=t.fields[1],s=t.as||["x","y"],a=s[0],l=s[1];function c(t){const e=i([r(t),o(t)]);e?(t[a]=e[0],t[l]=e[1]):(t[a]=void 0,t[l]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(n=e.modified(r.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,c)),e.modifies(s)}}),tI.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Jh(tI,Tb,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.as||"shape",o=n.ADD;return i&&!t.modified()||(this.value=i=function(t,e,n){const i=null==n?n=>t(e(n)):i=>{var r=t.pointRadius(),o=t.pointRadius(n)(e(i));return t.pointRadius(r),o};return i.context=e=>(t.context(e),i),i}(DP(t.projection),t.field||Yf("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[r]=i)),n.modifies(r)}}),eI.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Jh(eI,Tb,{transform(t,e){var n,i=this.value,r=this.generator;if(!i.length||t.modified())for(const e in t)Nh(r[e])&&r[e](t[e]);return n=r(),i.length?e.mod.push(ob(i[0],n)):e.add.push(nb(n)),i[0]=n,e}}),nI.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Jh(nI,Tb,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,i="shared"===t.resolve,r=t.field||Xf,o=function(t,e){let n;Nh(t)?(n=n=>t(n,e),n.dep=iI(t)):t?n=jh(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),s=function(t,e){let n;Nh(t)?(n=n=>qk(t(n,e)),n.dep=iI(t)):n=jh(qk(t||"#888"));return n}(t.color,t),a=t.as||"image",l={$x:0,$y:0,$value:0,$max:i?ap(n.map((t=>ap(r(t).values)))):0};return n.forEach((t=>{const e=r(t),n=qh({},t,l);i||(n.$max=ap(e.values||[])),t[a]=function(t,e,n,i){const r=t.width,o=t.height,s=t.x1||0,a=t.y1||0,l=t.x2||r,c=t.y2||o,u=t.values,f=u?t=>u[t]:Zf,h=gk(l-s,c-a),d=h.getContext("2d"),p=d.getImageData(0,0,l-s,c-a),g=p.data;for(let t=a,o=0;t{null!=t[e]&&oI(n,e,t[e])}))):SP.forEach((e=>{t.modified(e)&&oI(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return t=Oh(t),1===t.length?t[0]:{type:ZP,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===ZP?t.features:Oh(t).filter((t=>null!=t)).map((t=>t.type===XP?t:{type:XP,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var sI=Object.freeze({__proto__:null,contour:GP,geojson:JP,geopath:QP,geopoint:KP,geoshape:tI,graticule:eI,heatmap:nI,isocontour:PP,kde2d:HP,projection:rI});function aI(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o,s,a,l,c,u,f,h,d=t._root,p={data:i},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(g+y)/2))?g=o:y=o,(u=n>=(s=(m+v)/2))?m=s:v=s,r=d,!(d=d[f=u<<1|c]))return r[f]=p,t;if(a=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===a&&n===l)return p.next=d,r?r[f]=p:t._root=p,t;do{r=r?r[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+y)/2))?g=o:y=o,(u=n>=(s=(m+v)/2))?m=s:v=s}while((f=u<<1|c)==(h=(l>=s)<<1|a>=o));return r[h]=d,r[f]=p,t}function lI(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function cI(t){return t[0]}function uI(t){return t[1]}function fI(t,e,n){var i=new hI(null==e?cI:e,null==n?uI:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function hI(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function dI(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var pI=fI.prototype=hI.prototype;function gI(t){return function(){return t}}function mI(t){return 1e-6*(t()-.5)}function yI(t){return t.x+t.vx}function vI(t){return t.y+t.vy}function bI(t){return t.index}function xI(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}pI.copy=function(){var t,e,n=new hI(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=dI(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=dI(e));return n},pI.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return aI(this.cover(e,n),e,n,t)},pI.addAll=function(t){var e,n,i,r,o=t.length,s=new Array(o),a=new Array(o),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),rf&&(f=r));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;nt||t>=r||i>e||e>=o;)switch(a=(eh||(o=l.y0)>d||(s=l.x1)=y)<<1|t>=m)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var v=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=v*v+b*b;if(x=(a=(p+m)/2))?p=a:m=a,(u=s>=(l=(g+y)/2))?g=l:y=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(i=d,!(d=d.next))return this;return(r=d.next)&&delete d.next,i?(r?i.next=r:delete i.next,this):e?(r?e[f]=r:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=r,this)},pI.removeAll=function(t){for(var e=0,n=t.length;e{}};function wI(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),o=-1,s=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var n,i,r=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--MI}()}finally{MI=0,function(){var t,e,n=EI,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:EI=e);SI=t,qI(i)}(),TI=0}}function UI(){var t=zI.now(),e=t-OI;e>FI&&(NI-=e,OI=t)}function qI(t){MI||(DI&&(DI=clearTimeout(DI)),t-TI>24?(t<1/0&&(DI=setTimeout(jI,t-zI.now()-NI)),AI&&(AI=clearInterval(AI))):(AI||(OI=zI.now(),AI=setInterval(UI,FI)),MI=1,LI(jI)))}II.prototype=BI.prototype={constructor:II,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?RI():+n)+(null==e?0:+e),this._next||SI===this||(SI?SI._next=this:EI=this,SI=this),this._call=t,this._time=n,qI()},stop:function(){this._call&&(this._call=null,this._time=1/0,qI())}};const WI=1664525,HI=1013904223,VI=4294967296;function YI(t){return t.x}function GI(t){return t.y}var XI=10,ZI=Math.PI*(3-Math.sqrt(5));function JI(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,l=BI(f),c=wI("tick","end"),u=function(){let t=1;return()=>(t=(WI*t+HI)%VI)/VI}();function f(){h(),c.call("tick",e),n1?(null==n?a.delete(t):a.set(t,p(n)),e):a.get(t)},find:function(e,n,i){var r,o,s,a,l,c=0,u=t.length;for(null==i?i=1/0:i*=i,c=0;c1?(c.on(t,n),e):c.on(t)}}}const QI={center:function(t,e){var n,i=1;function r(){var r,o,s=n.length,a=0,l=0;for(r=0;rc+p||ou+p||sl.index){var g=c-a.x-a.vx,m=u-a.y-a.vy,y=g*g+m*m;yt.r&&(t.r=t[e].r)}function l(){if(e){var i,r,o=e.length;for(n=new Array(o),i=0;i=a)){(t.data!==e||t.next)&&(0===f&&(p+=(f=mI(n))*f),0===h&&(p+=(h=mI(n))*h),p[a(t,e,i),t])));for(s=0,r=new Array(c);se(t,n):e)}iB.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:nB}]},Jh(iB,Tb,{transform(t,e){var n,i,r=this.value,o=e.changed(e.ADD_REM),s=t.modified(tB),a=t.iterations||300;if(r?(o&&(e.modifies("index"),r.nodes(e.source)),(s||e.changed(e.MOD))&&rB(r,t,0,e)):(this.value=r=function(t,e){const n=JI(t),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),rB(n,e,!0).on("end",(()=>o=!0))}(e.source,t),r.on("tick",(n=e.dataflow,i=this,()=>n.touch(i).run())),t.static||(o=!0,r.tick()),e.modifies("index")),s||o||t.modified(eB)||e.changed()&&t.restart)if(r.alpha(Math.max(r.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/a)),t.static)for(r.stop();--a>=0;)r.tick();else if(r.stopped()&&r.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let t,e=this._argops,a=0,l=e.length;a=0;)e+=n[i].value;else e=1;t.value=e}function dB(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=gB)):void 0===e&&(e=pB);for(var n,i,r,o,s,a=new vB(t),l=[a];n=l.pop();)if((r=e(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new vB(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(yB)}function pB(t){return t.children}function gB(t){return Array.isArray(t)?t[1]:null}function mB(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function yB(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function vB(t){this.data=t,this.depth=this.height=0,this.parent=null}function bB(t){return null==t?null:xB(t)}function xB(t){if("function"!=typeof t)throw new Error;return t}function _B(){return 0}function wB(t){return function(){return t}}vB.prototype=dB.prototype={constructor:vB,count:function(){return this.eachAfter(hB)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return dB(this).eachBefore(mB)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n0&&n*n>i*i+r*r}function DB(t,e){for(var n=0;n1e-6?(S+Math.sqrt(S*S-4*E*M))/(2*E):M/S);return{x:i+w+k*D,y:r+$+C*D,r:D}}function TB(t,e,n){var i,r,o,s,a=t.x-e.x,l=t.y-e.y,c=a*a+l*l;c?(r=e.r+n.r,r*=r,s=t.r+n.r,r>(s*=s)?(i=(c+s-r)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x-i*a-o*l,n.y=t.y-i*l+o*a):(i=(c+r-s)/(2*c),o=Math.sqrt(Math.max(0,r/c-i*i)),n.x=e.x+i*a-o*l,n.y=e.y+i*l+o*a)):(n.x=e.x+n.r,n.y=e.y)}function NB(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function zB(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function LB(t){this._=t,this.next=null,this.previous=null}function RB(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,i,r,o,s,a,l,c,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;TB(i,n,r=t[2]),n=new LB(n),i=new LB(i),r=new LB(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;lfunction(t){t=`${t}`;let e=t.length;JB(t,e-1)&&!JB(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,i)))),n=e.map(ZB),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(ZB(t)),h.push(VB));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(s=0,r=h.length;s=0&&(c=h[t]).data===VB;--t)c.data=null}if(a.parent=WB,a.eachBefore((function(t){t.depth=t.parent.depth+1,--r})).eachBefore(yB),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(t){return arguments.length?(e=bB(t),i):e},i.parentId=function(t){return arguments.length?(n=bB(t),i):n},i.path=function(e){return arguments.length?(t=bB(e),i):t},i}function ZB(t){let e=t.length;if(e<2)return"";for(;--e>1&&!JB(t,e););return t.slice(0,e)}function JB(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function QB(t,e){return t.parent===e.parent?1:2}function KB(t){var e=t.children;return e?e[0]:t.t}function tj(t){var e=t.children;return e?e[e.length-1]:t.t}function ej(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function nj(t,e,n){return t.a.parent===e.parent?t.a:n}function ij(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function rj(t,e,n,i,r){for(var o,s=t.children,a=-1,l=s.length,c=t.value&&(r-n)/t.value;++ah&&(h=a),m=u*u*g,(d=Math.max(h/m,m/f))>p){u-=a;break}p=d}y.push(s={value:u,dice:l1?e:1)},n}(oj);var lj=function t(e){function n(t,n,i,r,o){if((s=t._squarify)&&s.ratio===e)for(var s,a,l,c,u,f=-1,h=s.length,d=t.value;++f1?e:1)},n}(oj);function cj(t,e,n){const i={};return t.each((t=>{const r=t.data;n(r)&&(i[e(r)]=t)})),t.lookup=i,t}function uj(t){Tb.call(this,null,t)}uj.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const fj=t=>t.values;function hj(){const t=[],e={entries:t=>i(n(t,0),0),key:n=>(t.push(n),e)};function n(e,i){if(i>=t.length)return e;const r=e.length,o=t[i++],s={},a={};let l,c,u,f=-1;for(;++ft.length)return e;const r=[];for(const t in e)r.push({key:t,values:i(e[t],n)});return r}return e}function dj(t){Tb.call(this,null,t)}Jh(uj,Tb,{transform(t,e){e.source||Hf("Nest transform requires an upstream data source.");var n=t.generate,i=t.modified(),r=e.clone(),o=this.value;return(!o||i||e.changed())&&(o&&o.each((t=>{t.children&&Kv(t.data)&&r.rem.push(t.data)})),this.value=o=dB({values:Oh(t.keys).reduce(((t,e)=>(t.key(e),t)),hj()).entries(r.source)},fj),n&&o.each((t=>{t.children&&(t=nb(t.data),r.add.push(t),r.source.push(t))})),cj(o,tb,tb)),r.source.root=o,r}});const pj=(t,e)=>t.parent===e.parent?1:2;Jh(dj,Tb,{transform(t,e){e.source&&e.source.root||Hf(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),i=this.fields,r=e.source.root,o=t.as||i;t.field?r.sum(t.field):r.count(),t.sort&&r.sort(sb(t.sort,(t=>t.data))),function(t,e,n){for(let i,r=0,o=e.length;rfunction(t,e,n){const i=t.data,r=e.length-1;for(let o=0;o(t=(kB*t+$B)%CB)/CB}();return r.x=e/2,r.y=n/2,t?r.eachBefore(IB(t)).eachAfter(BB(i,.5,o)).eachBefore(jB(1)):r.eachBefore(IB(PB)).eachAfter(BB(_B,1,o)).eachAfter(BB(i,r.r/Math.min(e,n),o)).eachBefore(jB(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=bB(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"==typeof t?t:wB(+t),r):i},r},params:["radius","size","padding"],fields:gj});const yj=["x0","y0","x1","y1","depth","children"];function vj(t){dj.call(this,t)}function bj(t){Tb.call(this,null,t)}vj.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:yj.length,default:yj}]},Jh(vj,dj,{layout:function(){var t=1,e=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/o,r.eachBefore(function(t,e){return function(i){i.children&&qB(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,o=i.y0,s=i.x1-n,a=i.y1-n;s=0;--r)a.push(n=e.children[r]=new ij(i[r],r)),n.parent=e;return(s.parent=new ij(null,0)).children=[s],s}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(s),i)r.eachBefore(a);else{var c=r,u=r,f=r;r.eachBefore((function(t){t.xu.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=c===u?1:t(c,u)/2,d=h-c.x,p=e/(u.x+h+d),g=n/(f.depth||1);r.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,s=e,a=n,l=o.parent.children[0],c=o.m,u=s.m,f=a.m,h=l.m;a=tj(a),o=KB(o),a&&o;)l=KB(l),(s=tj(s)).a=e,(r=a.z+f-o.z-c+t(a._,o._))>0&&(ej(nj(a,e,i),e,r),c+=r,u+=r),f+=a.m,c+=o.m,h+=l.m,u+=s.m;a&&!tj(s)&&(s.t=a,s.m+=f-u),o&&!KB(l)&&(l.t=o,l.m+=c-h,i=e)}return i}(e,r,e.parent.A||i[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},cluster:function(){var t=cB,e=1,n=1,i=!1;function r(r){var o,s=0;r.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(uB,0)/t.length}(n),e.y=function(t){return 1+t.reduce(fB,0)}(n)):(e.x=o?s+=t(e,o):0,e.y=0,o=e)}));var a=function(t){for(var e;e=t.children;)t=e[0];return t}(r),l=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),c=a.x-t(a,l)/2,u=l.x+t(l,a)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-c)/(u-c)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}},_j=["x","y","depth","children"];function wj(t){dj.call(this,t)}function kj(t){Tb.call(this,[],t)}wj.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:_j.length,default:_j}]},Jh(wj,dj,{layout(t){const e=t||"tidy";if(Yh(xj,e))return xj[e]();Hf("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:_j}),kj.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Jh(kj,Tb,{transform(t,e){const n=this.value,i=e.source&&e.source.root,r=e.fork(e.NO_SOURCE),o={};return i||Hf("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(r.rem=n,e.visit(e.SOURCE,(t=>o[tb(t)]=1)),i.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[tb(e)]&&o[tb(n)]&&r.add.push(nb({source:n,target:e}))})),this.value=r.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[tb(t)]=1)),n.forEach((t=>{(o[tb(t.source)]||o[tb(t.target)])&&r.mod.push(t)}))),r}});const $j={binary:function(t,e,n,i,r){var o,s,a=t.children,l=a.length,c=new Array(l+1);for(c[0]=s=o=0;o=n-1){var u=a[e];return u.x0=r,u.y0=o,u.x1=s,void(u.y1=l)}var f=c[e],h=i/2+f,d=e+1,p=n-1;for(;d>>1;c[g]l-o){var v=i?(r*y+s*m)/i:s;t(e,d,m,r,o,v,l),t(d,n,y,v,o,s,l)}else{var b=i?(o*y+l*m)/i:l;t(e,d,m,r,o,s,b),t(d,n,y,r,b,s,l)}}(0,l,t.value,e,n,i,r)},dice:qB,slice:rj,slicedice:function(t,e,n,i,r){(1&t.depth?rj:qB)(t,e,n,i,r)},squarify:aj,resquarify:lj},Cj=["x0","y0","x1","y1","depth","children"];function Ej(t){dj.call(this,t)}Ej.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Cj.length,default:Cj}]},Jh(Ej,dj,{layout(){const t=function(){var t=aj,e=!1,n=1,i=1,r=[0],o=_B,s=_B,a=_B,l=_B,c=_B;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(f),r=[0],e&&t.eachBefore(UB),t}function f(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{Yh($j,e)?t.tile($j[e]):Hf("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Cj});var Sj=Object.freeze({__proto__:null,nest:uj,pack:mj,partition:vj,stratify:bj,tree:wj,treelinks:kj,treemap:Ej});const Mj=4278190080;function Dj(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function Aj(t,e,n){if(!e.length)return;const i=e[0].mark.marktype;"group"===i?e.forEach((e=>{e.items.forEach((e=>Aj(t,e.items,n)))})):yA[i].draw(t,{items:n?e.map(Fj):e})}function Fj(t){const e=rb(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const Oj=5,Tj=31,Nj=32,zj=new Uint32Array(Nj+1),Lj=new Uint32Array(Nj+1);Lj[0]=0,zj[0]=~Lj[0];for(let t=1;t<=Nj;++t)Lj[t]=Lj[t-1]<<1|1,zj[t]=~Lj[t];function Rj(t,e,n){const i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),o=~~((e+2*n+i)/i),s=t=>~~((t+n)/i);return s.invert=t=>t*i-n,s.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+Nj)/Nj));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:(e,i)=>{const r=i*t+e;return n[r>>>Oj]&1<<(r&Tj)},set:(e,n)=>{const r=n*t+e;i(r>>>Oj,1<<(r&Tj))},clear:(e,n)=>{const i=n*t+e;r(i>>>Oj,~(1<<(i&Tj)))},getRange:(e,i,r,o)=>{let s,a,l,c,u=o;for(;u>=i;--u)if(s=u*t+e,a=u*t+r,l=s>>>Oj,c=a>>>Oj,l===c){if(n[l]&zj[s&Tj]&Lj[1+(a&Tj)])return!0}else{if(n[l]&zj[s&Tj])return!0;if(n[c]&Lj[1+(a&Tj)])return!0;for(let t=l+1;t{let s,a,l,c,u;for(;n<=o;++n)if(s=n*t+e,a=n*t+r,l=s>>>Oj,c=a>>>Oj,l===c)i(l,zj[s&Tj]&Lj[1+(a&Tj)]);else for(i(l,zj[s&Tj]),i(c,Lj[1+(a&Tj)]),u=l+1;u{let s,a,l,c,u;for(;n<=o;++n)if(s=n*t+e,a=n*t+i,l=s>>>Oj,c=a>>>Oj,l===c)r(l,Lj[s&Tj]|zj[1+(a&Tj)]);else for(r(l,Lj[s&Tj]),r(c,zj[1+(a&Tj)]),u=l+1;un<0||i<0||o>=e||r>=t}}(r,o),s.ratio=i,s.padding=n,s.width=t,s.height=e,s}function Pj(t,e,n,i,r,o){let s=n/2;return t-s<0||t+s>r||e-(s=i/2)<0||e+s>o}function Ij(t,e,n,i,r,o,s,a){const l=r*o/(2*i),c=t(e-l),u=t(e+l),f=t(n-(o/=2)),h=t(n+o);return s.outOfBounds(c,f,u,h)||s.getRange(c,f,u,h)||a&&a.getRange(c,f,u,h)}const Bj=[-1,-1,1,1],jj=[-1,1,-1,1];const Uj=["right","center","left"],qj=["bottom","middle","top"];function Wj(t,e,n,i,r,o,s,a,l,c,u,f){return!(r.outOfBounds(t,n,e,i)||(f&&o||r).getRange(t,n,e,i))}const Hj={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},Vj={naive:function(t,e,n,i){const r=t.width,o=t.height;return function(t){const e=t.datum.datum.items[i].items,n=e.length,s=t.datum.fontSize,a=JD.width(t.datum,t.datum.text);let l,c,u,f,h,d,p,g=0;for(let i=0;i=g&&(g=p,t.x=h,t.y=d);return h=a/2,d=s/2,l=t.x-h,c=t.x+h,u=t.y-d,f=t.y+d,t.align="center",l<0&&c<=r?t.align="left":0<=l&&r=1;)h=(d+p)/2,Ij(t,u,f,c,l,h,s,a)?p=h:d=h;if(d>i)return[u,f,d,!0]}}return function(e){const a=e.datum.datum.items[i].items,c=a.length,u=e.datum.fontSize,f=JD.width(e.datum,e.datum.text);let h,d,p,g,m,y,v,b,x,_,w,k,$,C,E,S,M,D=n?u:0,A=!1,F=!1,O=0;for(let i=0;id&&(M=h,h=d,d=M),p>g&&(M=p,p=g,g=M),x=t(h),w=t(d),_=~~((x+w)/2),k=t(p),C=t(g),$=~~((k+C)/2),v=_;v>=x;--v)for(b=$;b>=k;--b)S=l(v,b,D,f,u),S&&([e.x,e.y,D,A]=S);for(v=_;v<=w;++v)for(b=$;b<=C;++b)S=l(v,b,D,f,u),S&&([e.x,e.y,D,A]=S);A||n||(E=Math.abs(d-h+g-p),m=(h+d)/2,y=(p+g)/2,E>=O&&!Pj(m,y,f,u,r,o)&&!Ij(t,m,y,u,f,u,s,null)&&(O=E,e.x=m,e.y=y,F=!0))}return!(!A&&!F)&&(m=f/2,y=u/2,s.setRange(t(e.x-m),t(e.y-y),t(e.x+m),t(e.y+y)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,i){const r=t.width,o=t.height,s=e[0],a=e[1],l=t.bitmap();return function(e){const c=e.datum.datum.items[i].items,u=c.length,f=e.datum.fontSize,h=JD.width(e.datum,e.datum.text),d=[];let p,g,m,y,v,b,x,_,w,k,$,C,E=n?f:0,S=!1,M=!1,D=0;for(let i=0;i=1;)$=(w+k)/2,Ij(t,v,b,f,h,$,s,a)?k=$:w=$;w>E&&(e.x=v,e.y=b,E=w,S=!0)}}S||n||(C=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,C>=D&&!Pj(v,b,h,f,r,o)&&!Ij(t,v,b,f,h,f,s,null)&&(D=C,e.x=v,e.y=b,M=!0))}return!(!S&&!M)&&(v=h/2,b=f/2,s.setRange(t(e.x-v),t(e.y-b),t(e.x+v),t(e.y+b)),e.align="center",e.baseline="middle",!0)}}};function Yj(t,e,n,i,r,o,s,a,l,c,u){if(!t.length)return t;const f=Math.max(i.length,r.length),h=function(t,e){const n=new Float64Array(e),i=t.length;for(let e=0;e[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>r(t.datum):"line"===e?t=>{const e=t.datum.items[i].items;return r(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:r}(p,g,a,l),v=null===c||c===1/0,b=m&&"naive"===u;var x;let _=-1,w=-1;const k=t.map((t=>{const e=v?JD.width(t,t.text):void 0;return _=Math.max(_,e),w=Math.max(w,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(t),textWidth:e}}));c=null===c||c===1/0?Math.max(_,w)+Math.max(...i):c;const $=Rj(e[0],e[1],c);let C;if(!b){n&&k.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;tt.datum));C=o.length||i?function(t,e,n,i,r){const o=t.width,s=t.height,a=i||r,l=gk(o,s).getContext("2d"),c=gk(o,s).getContext("2d"),u=a&&gk(o,s).getContext("2d");n.forEach((t=>Aj(l,t,!1))),Aj(c,e,!1),a&&Aj(u,e,!0);const f=Dj(l,o,s),h=Dj(c,o,s),d=a&&Dj(u,o,s),p=t.bitmap(),g=a&&t.bitmap();let m,y,v,b,x,_,w,k;for(y=0;yn.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}($,s&&k)}const E=m?Vj[u]($,C,s,l):function(t,e,n,i){const r=t.width,o=t.height,s=e[0],a=e[1],l=i.length;return function(e){const c=e.boundary,u=e.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let f,h,d,p,g,m,y,v,b,x,_,w,k,$,C,E=e.textWidth??0;for(let r=0;r>>2&3)-1,d=0===f&&0===h||i[r]<0,p=f&&h?Math.SQRT1_2:1,g=i[r]<0?-1:1,m=c[1+f]+i[r]*f*p,_=c[4+h]+g*u*h/2+i[r]*h*p,v=_-u/2,b=_+u/2,w=t(m),$=t(v),C=t(b),!E){if(!Wj(w,w,$,C,s,a,0,0,0,0,0,d))continue;E=JD.width(e.datum,e.datum.text)}if(x=m+g*E*f/2,m=x-E/2,y=x+E/2,w=t(m),k=t(y),Wj(w,k,$,C,s,a,0,0,0,0,0,d))return e.x=f?f*g<0?y:m:x,e.y=h?h*g<0?b:v:_,e.align=Uj[f*g+1],e.baseline=qj[h*g+1],s.setRange(w,$,k,C),!0}return!1}}($,C,d,h);return k.forEach((t=>t.opacity=+E(t))),k}const Gj=["x","y","opacity","align","baseline"],Xj=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Zj(t){Tb.call(this,null,t)}Zj.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:Xj},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:Gj.length,default:Gj}]},Jh(Zj,Tb,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const i=t[n];return Nh(i)&&e.modified(i.fields)}("sort")))return;t.size&&2===t.size.length||Hf("Size parameter should be specified as a [width, height] array.");const i=t.as||Gj;return Yj(e.materialize(e.SOURCE).source||[],t.size,t.sort,Oh(null==t.offset?1:t.offset),Oh(t.anchor||Xj),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,void 0===t.padding?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[i[0]]=t.x,e[i[1]]=t.y,e[i[2]]=t.opacity,e[i[3]]=t.align,e[i[4]]=t.baseline})),e.reflow(n).modifies(i)}});var Jj=Object.freeze({__proto__:null,label:Zj});function Qj(t,e){var n,i,r,o,s,a,l=[],c=function(t){return t(o)};if(null==e)l.push(t);else for(n={},i=0,r=t.length;i{kx(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let t=0;t"poly"===t?e:"quad"===t?2:1)(o,s),l=t.as||[Bf(t.x),Bf(t.y)],c=tU[o],u=[];let f=t.extent;Yh(tU,o)||Hf("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),i.forEach((n=>{if(n.length<=a)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const i=c(n,t.x,t.y,s);if(t.params)return void u.push(nb({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const h=f||Wh(n,t.x),d=t=>{const e={};for(let t=0;td([t,i.predict(t)]))):Sx(i.predict,h,25,200).forEach(d)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});var nU=Object.freeze({__proto__:null,loess:Kj,regression:eU});const iU=134217729,rU=33306690738754706e-32;function oU(t,e,n,i,r){let o,s,a,l,c=e[0],u=i[0],f=0,h=0;u>c==u>-c?(o=c,c=e[++f]):(o=u,u=i[++h]);let d=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=e[++f]):(s=u+o,a=o-(s-u),u=i[++h]),o=s,0!==a&&(r[d++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=i[++h]),o=s,0!==a&&(r[d++]=a);for(;f=33306690738754716e-32*c?l:-function(t,e,n,i,r,o,s){let a,l,c,u,f,h,d,p,g,m,y,v,b,x,_,w,k,$;const C=t-r,E=n-r,S=e-o,M=i-o;x=C*M,h=iU*C,d=h-(h-C),p=C-d,h=iU*M,g=h-(h-M),m=M-g,_=p*m-(x-d*g-p*g-d*m),w=S*E,h=iU*S,d=h-(h-S),p=S-d,h=iU*E,g=h-(h-E),m=E-g,k=p*m-(w-d*g-p*g-d*m),y=_-k,f=_-y,cU[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,cU[1]=b-(y+f)+(f-w),$=v+y,f=$-v,cU[2]=v-($-f)+(y-f),cU[3]=$;let D=function(t,e){let n=e[0];for(let i=1;i=A||-D>=A)return D;if(f=t-C,a=t-(C+f)+(f-r),f=n-E,c=n-(E+f)+(f-r),f=e-S,l=e-(S+f)+(f-o),f=i-M,u=i-(M+f)+(f-o),0===a&&0===l&&0===c&&0===u)return D;if(A=lU*s+rU*Math.abs(D),D+=C*u+M*a-(S*c+E*l),D>=A||-D>=A)return D;x=a*M,h=iU*a,d=h-(h-a),p=a-d,h=iU*M,g=h-(h-M),m=M-g,_=p*m-(x-d*g-p*g-d*m),w=l*E,h=iU*l,d=h-(h-l),p=l-d,h=iU*E,g=h-(h-E),m=E-g,k=p*m-(w-d*g-p*g-d*m),y=_-k,f=_-y,dU[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,dU[1]=b-(y+f)+(f-w),$=v+y,f=$-v,dU[2]=v-($-f)+(y-f),dU[3]=$;const F=oU(4,cU,4,dU,uU);x=C*u,h=iU*C,d=h-(h-C),p=C-d,h=iU*u,g=h-(h-u),m=u-g,_=p*m-(x-d*g-p*g-d*m),w=S*c,h=iU*S,d=h-(h-S),p=S-d,h=iU*c,g=h-(h-c),m=c-g,k=p*m-(w-d*g-p*g-d*m),y=_-k,f=_-y,dU[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,dU[1]=b-(y+f)+(f-w),$=v+y,f=$-v,dU[2]=v-($-f)+(y-f),dU[3]=$;const O=oU(F,uU,4,dU,fU);x=a*u,h=iU*a,d=h-(h-a),p=a-d,h=iU*u,g=h-(h-u),m=u-g,_=p*m-(x-d*g-p*g-d*m),w=l*c,h=iU*l,d=h-(h-l),p=l-d,h=iU*c,g=h-(h-c),m=c-g,k=p*m-(w-d*g-p*g-d*m),y=_-k,f=_-y,dU[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,dU[1]=b-(y+f)+(f-w),$=v+y,f=$-v,dU[2]=v-($-f)+(y-f),dU[3]=$;const T=oU(O,fU,4,dU,hU);return hU[T-1]}(t,e,n,i,r,o,c)}const gU=Math.pow(2,-52),mU=new Uint32Array(512);class yU{static from(t,e=kU,n=$U){const i=t.length,r=new Float64Array(2*i);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let e=0;el&&(l=n),i>c&&(c=i),this._ids[e]=e}const u=(s+l)/2,f=(a+c)/2;let h,d,p,g=1/0;for(let e=0;e0&&(d=e,g=n)}let v=t[2*d],b=t[2*d+1],x=1/0;for(let e=0;ei&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(pU(m,y,v,b,_,w)<0){const t=d,e=v,n=b;d=p,v=_,b=w,p=t,_=e,w=n}const k=function(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,c=o-e,u=s*s+a*a,f=l*l+c*c,h=.5/(s*c-a*l),d=t+(c*u-a*f)*h,p=e+(s*f-l*u)*h;return{x:d,y:p}}(m,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let e=0;e0&&Math.abs(c-o)<=gU&&Math.abs(u-s)<=gU)continue;if(o=c,s=u,l===h||l===d||l===p)continue;let f=0;for(let t=0,e=this._hashKey(c,u);t=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,l,n[m],-1,-1,i[m]);i[l]=this._legalize(y+2),i[m]=y,$++;let v=n[m];for(;g=n[v],pU(c,u,t[2*v],t[2*v+1],t[2*g],t[2*g+1])<0;)y=this._addTriangle(v,l,g,i[l],-1,i[v]),i[l]=this._legalize(y+2),n[v]=v,$--,v=g;if(m===f)for(;g=e[m],pU(c,u,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)y=this._addTriangle(g,l,m,-1,i[m],i[g]),this._legalize(y+2),i[g]=y,n[m]=m,$--,m=g;this._hullStart=e[l]=m,n[m]=e[v]=l,n[l]=v,r[this._hashKey(c,u)]=l,r[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array($);for(let t=0,e=this._hullStart;t<$;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===r)break;t=mU[--r];continue}const l=s-s%3,c=a+(t+1)%3,u=l+(s+2)%3,f=e[o],h=e[t],d=e[c],p=e[u];if(bU(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1])){e[t]=p,e[s]=f;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(s,n[o]),this._link(o,u);const a=l+(s+1)%3;r=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=i}else{let r=n+1,o=i;wU(t,n+i>>1,r),e[t[n]]>e[t[i]]&&wU(t,n,i),e[t[r]]>e[t[i]]&&wU(t,r,i),e[t[n]]>e[t[r]]&&wU(t,n,r);const s=t[r],a=e[s];for(;;){do{r++}while(e[t[r]]a);if(o=o-n?(_U(t,e,r,i),_U(t,e,n,o-1)):(_U(t,e,n,o-1),_U(t,e,r,i))}}function wU(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function kU(t){return t[0]}function $U(t){return t[1]}const CU=1e-6;class EU{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>CU||Math.abs(this._y1-r)>CU)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class SU{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class MU{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let r,o;const s=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let i,a,l=0,c=0,u=n.length;l1;)r-=2;for(let t=2;t0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,2===i.length&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new MU(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:s}=this;if(s){const e=s.indexOf(t);return e>0&&(yield s[e-1]),void(e=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:s,triangles:a,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let c=t,u=AU(e-l[2*t],2)+AU(n-l[2*t+1],2);const f=i[t];let h=f;do{let i=a[h];const f=AU(e-l[2*i],2)+AU(n-l[2*i+1],2);if(f=f));)if(e.x=s+r,e.y=c+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>a[0]||e.y+e.y1>a[1])&&(!n||!WU(e,t,a[0]))&&(!n||VU(e,n))){for(var g,m=e.sprite,y=e.width>>5,v=a[0]>>5,b=e.x-(y<<4),x=127&b,_=32-x,w=e.y1-e.y0,k=(e.y+e.y0)*v+(b>>5),$=0;$>>x:0);k+=v}return e.sprite=null,!0}return!1}return f.layout=function(){for(var l=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(BU<<5)/e,t.height=jU/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(gk()),f=function(t){var e=[],n=-1;for(;++n>5)*a[1]),d=null,p=c.length,g=-1,m=[],y=c.map((a=>({text:t(a),font:e(a),style:i(a),weight:r(a),rotate:o(a),size:~~(n(a)+1e-14),padding:s(a),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:a}))).sort(((t,e)=>e.size-t.size));++g>1,v.y=a[1]*(u()+.5)>>1,qU(l,v,y,g),v.hasText&&h(f,v,d)&&(m.push(v),d?HU(d,v):d=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=a[0]>>1,v.y-=a[1]>>1)}return m},f.words=function(t){return arguments.length?(c=t,f):c},f.size=function(t){return arguments.length?(a=[+t[0],+t[1]],f):a},f.font=function(t){return arguments.length?(e=GU(t),f):e},f.fontStyle=function(t){return arguments.length?(i=GU(t),f):i},f.fontWeight=function(t){return arguments.length?(r=GU(t),f):r},f.rotate=function(t){return arguments.length?(o=GU(t),f):o},f.text=function(e){return arguments.length?(t=GU(e),f):t},f.spiral=function(t){return arguments.length?(l=XU[t]||t,f):l},f.fontSize=function(t){return arguments.length?(n=GU(t),f):n},f.padding=function(t){return arguments.length?(s=GU(t),f):s},f.random=function(t){return arguments.length?(u=t,f):u},f}function qU(t,e,n,i){if(!e.sprite){var r=t.context,o=t.ratio;r.clearRect(0,0,(BU<<5)/o,jU/o);var s,a,l,c,u,f=0,h=0,d=0,p=n.length;for(--i;++i>5<<5,l=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else s=s+31>>5<<5;if(l>d&&(d=l),f+s>=BU<<5&&(f=0,h+=d,d=0),h+l>=jU)break;r.translate((f+(s>>1))/o,(h+(l>>1))/o),e.rotate&&r.rotate(e.rotate*IU),r.fillText(e.text,0,0),e.padding&&(r.lineWidth=2*e.padding,r.strokeText(e.text,0,0)),r.restore(),e.width=s,e.height=l,e.xoff=f,e.yoff=h,e.x1=s>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=s}for(var _=r.getImageData(0,0,(BU<<5)/o,jU/o).data,w=[];--i>=0;)if((e=n[i]).hasText){for(a=(s=e.width)>>5,l=e.y1-e.y0,c=0;c>5),E=_[(h+u)*(BU<<5)+(f+c)<<2]?1<<31-c%32:0;w[C]|=E,k|=E}k?$=u:(e.y0++,l--,u--,h++)}e.y1=e.y0+$,e.sprite=w.slice(0,(e.y1-e.y0)*a)}}}function WU(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,l=32-a,c=t.y1-t.y0,u=(t.y+t.y0)*n+(s>>5),f=0;f>>a:0))&e[u+h])return!0;u+=n}return!1}function HU(t,e){var n=t[0],i=t[1];e.x+e.x0i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function VU(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0e(t(n))}i.forEach((t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0}));const l=r.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(a).random(Ub).layout(),c=r.size(),u=c[0]>>1,f=c[1]>>1,h=l.length;for(let t,e,n=0;nnew Uint8Array(t),eq=t=>new Uint16Array(t),nq=t=>new Uint32Array(t);function iq(t,e,n){const i=(e<257?tq:e<65537?eq:nq)(t);return n&&i.set(n),i}function rq(t,e,n){const i=1<{const i=t[e],r=t[n];return ir?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(h,l),s)c=e,u=t,e=Array(s+a),t=nq(s+a),function(t,e,n,i,r,o,s,a,l){let c,u=0,f=0;for(c=0;u0)for(f=0;ft,size:()=>n}}function sq(t){Tb.call(this,function(){let t=8,e=[],n=nq(0),i=iq(0,t),r=iq(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,i=0,r=e.length,o=t.length;ie.length,curr:()=>i,prev:()=>r,reset:t=>r[t]=i[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){i[t]|=e},clear(t,e){i[t]&=~e},resize(e,n){(e>i.length||n>t)&&(t=Math.max(n,t),i=iq(e,t,i),r=iq(e,t))}}}(),t),this._indices=null,this._dims=null}function aq(t){Tb.call(this,null,t)}sq.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},Jh(sq,Tb,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,i=t.query,r=this._indices={},o=this._dims=[],s=i.length;let a,l,c=0;for(;c{const t=r.remove(e,n);for(const e in i)i[e].reindex(t)}))},update(t,e,n){const i=this._dims,r=t.query,o=e.stamp,s=i.length;let a,l,c=0;for(n.filters=0,l=0;ld)for(m=d,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=h;mu)for(d=u,p=Math.min(l,f);df)for(d=Math.max(l,f),p=c;da[t]&n?null:s[t];return o.filter(o.MOD,c),r&r-1?(o.filter(o.ADD,(t=>{const e=a[t]&n;return!e&&e^l[t]&n?s[t]:null})),o.filter(o.REM,(t=>{const e=a[t]&n;return e&&!(e^e^l[t]&n)?s[t]:null}))):(o.filter(o.ADD,c),o.filter(o.REM,(t=>(a[t]&n)===r?s[t]:null))),o.filter(o.SOURCE,(t=>c(t._index)))}});var lq=Object.freeze({__proto__:null,crossfilter:sq,resolvefilter:aq});const cq="Literal",uq="Property",fq="ArrayExpression",hq="BinaryExpression",dq="CallExpression",pq="ConditionalExpression",gq="LogicalExpression",mq="MemberExpression",yq="ObjectExpression",vq="UnaryExpression";function bq(t){this.type=t}var xq,_q,wq,kq,$q;bq.prototype.visit=function(t){let e,n,i;if(t(this))return 1;for(e=function(t){switch(t.type){case fq:return t.elements;case hq:case gq:return[t.left,t.right];case dq:return[t.callee].concat(t.arguments);case pq:return[t.test,t.consequent,t.alternate];case mq:return[t.object,t.property];case yq:return t.properties;case uq:return[t.key,t.value];case vq:return[t.argument];default:return[]}}(this),n=0,i=e.length;n",xq[Sq]="Identifier",xq[Mq]="Keyword",xq[Dq]="Null",xq[Aq]="Numeric",xq[Fq]="Punctuator",xq[Oq]="String",xq[9]="RegularExpression";var Tq="ArrayExpression",Nq="BinaryExpression",zq="CallExpression",Lq="ConditionalExpression",Rq="Identifier",Pq="Literal",Iq="LogicalExpression",Bq="MemberExpression",jq="ObjectExpression",Uq="Property",qq="UnaryExpression",Wq="Unexpected token %0",Hq="Unexpected number",Vq="Unexpected string",Yq="Unexpected identifier",Gq="Unexpected reserved word",Xq="Unexpected end of input",Zq="Invalid regular expression",Jq="Invalid regular expression: missing /",Qq="Octal literals are not allowed in strict mode.",Kq="Duplicate data property in object literal not allowed in strict mode",tW="ILLEGAL",eW="Disabled.",nW=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),iW=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function rW(t,e){if(!t)throw new Error("ASSERT: "+e)}function oW(t){return t>=48&&t<=57}function sW(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function aW(t){return"01234567".indexOf(t)>=0}function lW(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function cW(t){return 10===t||13===t||8232===t||8233===t}function uW(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&nW.test(String.fromCharCode(t))}function fW(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&iW.test(String.fromCharCode(t))}const hW={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function dW(){for(;wq1114111||"}"!==t)&&AW({},Wq,tW),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),i=56320+(e-65536&1023),String.fromCharCode(n,i))}function mW(){var t,e;for(t=_q.charCodeAt(wq++),e=String.fromCharCode(t),92===t&&(117!==_q.charCodeAt(wq)&&AW({},Wq,tW),++wq,(t=pW("u"))&&"\\"!==t&&uW(t.charCodeAt(0))||AW({},Wq,tW),e=t);wq>>="===(i=_q.substr(wq,4))?{type:Fq,value:i,start:r,end:wq+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:Fq,value:n,start:r,end:wq+=3}:s===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(s)>=0||"=>"===e?{type:Fq,value:e,start:r,end:wq+=2}:("//"===e&&AW({},Wq,tW),"<>=!+-*%&|^/".indexOf(s)>=0?(++wq,{type:Fq,value:s,start:r,end:wq}):void AW({},Wq,tW))}function bW(){var t,e,n;if(rW(oW((n=_q[wq]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=wq,t="","."!==n){if(t=_q[wq++],n=_q[wq],"0"===t){if("x"===n||"X"===n)return++wq,function(t){let e="";for(;wq=0&&AW({},Zq,n),{value:n,literal:e}}(),i=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";AW({},Zq)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){AW({},Zq)}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:i,regex:{pattern:e.value,flags:n.value},start:t,end:wq}}function _W(){if(dW(),wq>=kq)return{type:Eq,start:wq,end:wq};const t=_q.charCodeAt(wq);return uW(t)?yW():40===t||41===t||59===t?vW():39===t||34===t?function(){var t,e,n,i,r="",o=!1;for(rW("'"===(t=_q[wq])||'"'===t,"String literal must starts with a quote"),e=wq,++wq;wq=0&&wq(rW(e":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function YW(){var t,e;return t=function(){var t,e,n,i,r,o,s,a,l,c;if(t=$q,l=HW(),0===(r=VW(i=$q)))return l;for(i.prec=r,wW(),e=[t,$q],o=[l,i,s=HW()];(r=VW($q))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),n=$W(a,l,s),o.push(n);(i=wW()).prec=r,o.push(i),e.push($q),n=HW(),o.push(n)}for(n=o[c=o.length-1],e.pop();c>1;)e.pop(),n=$W(o[c-1].value,o[c-2],n),c-=2;return n}(),TW("?")&&(wW(),e=YW(),OW(":"),t=function(t,e,n){const i=new bq(Lq);return i.test=t,i.consequent=e,i.alternate=n,i}(t,e,YW())),t}function GW(){const t=YW();if(TW(","))throw new Error(eW);return t}function XW(t){wq=0,kq=(_q=t).length,$q=null,kW();const e=GW();if($q.type!==Eq)throw new Error("Unexpect token after expression.");return e}var ZW={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function JW(t){function e(e,n,i){return r=>function(e,n,i,r){let o=t(n[0]);return i&&(o=i+"("+o+")",0===i.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(r<0?"":0===r?"()":"("+n.slice(1).map(t).join(",")+")")}(e,r,n,i)}const n="new Date",i="String",r="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&Hf("Missing arguments to clamp function."),e.length>3&&Hf("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",i,0),lower:e("toLowerCase",i,0),substring:e("substring",i),split:e("split",i),trim:e("trim",i,0),regexp:r,test:e("test",r),if:function(e){e.length<3&&Hf("Missing arguments to if function."),e.length>3&&Hf("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function QW(t){const e=(t=t||{}).allowed?yd(t.allowed):{},n=t.forbidden?yd(t.forbidden):{},i=t.constants||ZW,r=(t.functions||JW)(f),o=t.globalvar,s=t.fieldvar,a=Nh(o)?o:t=>`${o}["${t}"]`;let l={},c={},u=0;function f(t){if(rd(t))return t;const e=h[t.type];return null==e&&Hf("Unsupported type: "+t.type),e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const r=t.name;return u>0?r:Yh(n,r)?Hf("Illegal identifier: "+r):Yh(i,r)?i[r]:Yh(e,r)?r:(l[r]=1,a(r))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(u+=1);const i=f(t.property);return n===s&&(c[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(i)]=1),e&&(u-=1),n+(e?"."+i:"["+i+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&Hf("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,i=Yh(r,e)&&r[e];return i||Hf("Unrecognized function: "+e),Nh(i)?i(n):i+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{u+=1;const e=f(t.key);return u-=1,e+":"+f(t.value)}};function d(t){const e={code:f(t),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},e}return d.functions=r,d.constants=i,d}const KW=Symbol("vega_selection_getter");function tH(t){return t.getter&&t.getter[KW]||(t.getter=Yf(t.field),t.getter[KW]=!0),t.getter}const eH="intersect",nH="union",iH="_vgsid_",rH=Yf(iH),oH="E",sH="R",aH="R-E",lH="R-LE",cH="R-RE",uH="index:unit";function fH(t,e){for(var n,i,r=e.fields,o=e.values,s=r.length,a=0;ae.indexOf(t)>=0)):e},R_union:function(t,e){var n=ph(e[0]),i=ph(e[1]);return n>i&&(n=e[1],i=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]i&&(n=e[1],i=e[0]),t.length?ii&&(t[1]=i),t):[n,i]}};function mH(t,e,n,i){e[0].type!==cq&&Hf("First argument to selection functions must be a string literal.");const r=e[0].value,o="unit",s="@"+o,a=":"+r;(e.length>=2&&dh(e).value)!==eH||Yh(i,s)||(i[s]=n.getData(r).indataRef(n,o)),Yh(i,a)||(i[a]=n.getData(r).tuplesRef())}function yH(t){const e=this.context.data[t];return e?e.values.value:[]}const vH=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},bH=vH("format"),xH=vH("timeFormat"),_H=vH("utcFormat"),wH=vH("timeParse"),kH=vH("utcParse"),$H=new Date(2e3,0,1);function CH(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?($H.setYear(2e3),$H.setMonth(t),$H.setDate(e),xH.call(this,$H,n)):""}const EH="%",SH="$";function MH(t,e,n,i){e[0].type!==cq&&Hf("First argument to data functions must be a string literal.");const r=e[0].value,o=":"+r;if(!Yh(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(t){}}function DH(t,e,n,i){if(e[0].type===cq)AH(n,i,e[0].value);else for(t in n.scales)AH(n,i,t)}function AH(t,e,n){const i=EH+n;if(!Yh(e,i))try{e[i]=t.scaleRef(n)}catch(t){}}function FH(t,e){if(Nh(t))return t;if(rd(t)){const n=e.scales[t];return n&&function(t){return t&&!0===t[AE]}(n.value)?n.value:void 0}}function OH(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=DH,n._range=DH,n._scale=DH;const i=e=>"_["+(e.type===cq?hd(EH+e.value):hd(EH)+"+"+t(e))+"]";return{_bandwidth:t=>`this.__bandwidth(${i(t[0])})`,_range:t=>`${i(t[0])}.range()`,_scale:e=>`${i(e[0])}(${t(e[1])})`}}function TH(t,e){return function(n,i,r){if(n){const e=FH(n,(r||this).context);return e&&e.path[t](i)}return e(i)}}const NH=TH("area",(function(t){return rz=new Vd,BN(t,oz),2*rz})),zH=TH("bounds",(function(t){var e,n,i,r,o,s,a;if(XN=GN=-(VN=YN=1/0),ez=[],BN(t,Tz),n=ez.length){for(ez.sort(Uz),e=1,o=[i=ez[0]];ejz(i[0],i[1])&&(i[1]=r[1]),jz(r[0],i[1])>jz(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(a=jz(i[1],r[0]))>s&&(s=a,VN=r[0],GN=i[1])}return ez=nz=null,VN===1/0||YN===1/0?[[NaN,NaN],[NaN,NaN]]:[[VN,YN],[GN,XN]]})),LH=TH("centroid",(function(t){yz=vz=bz=xz=_z=wz=kz=$z=0,Cz=new Vd,Ez=new Vd,Sz=new Vd,BN(t,Wz);var e=+Cz,n=+Ez,i=+Sz,r=CN(e,n,i);return rjH(t,e)}const qH={};function WH(t){return ah(t)||ArrayBuffer.isView(t)?t:null}function HH(t){return WH(t)||(rd(t)?t:null)}const VH=t=>t.data;function YH(t,e){const n=yH.call(e,t);return n.root&&n.root.lookup||{}}const GH=()=>"undefined"!=typeof window&&window||null;function XH(t,e,n){if(!t)return[];const[i,r]=t,o=(new xM).set(i[0],i[1],r[0],r[1]);return oO(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=Oh(t.marktype),i=Oh(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!i.length||i.some((e=>t.name===e)))}return e}(e))}const ZH={random:()=>Ub(),cumulativeNormal:Zb,cumulativeLogNormal:nx,cumulativeUniform:lx,densityNormal:Xb,densityLogNormal:ex,densityUniform:ax,quantileNormal:Jb,quantileLogNormal:ix,quantileUniform:cx,sampleNormal:Gb,sampleLogNormal:tx,sampleUniform:sx,isArray:ah,isBoolean:Kh,isDate:td,isDefined:t=>void 0!==t,isNumber:nd,isObject:lh,isRegExp:id,isString:rd,isTuple:Kv,isValid:t=>null!=t&&t==t,toBoolean:dd,toDate:t=>gd(t),toNumber:ph,toString:md,indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;iWh(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:XH,clampRange:Th,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.hypot(n,i)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=GH();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=GH();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return iE(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,i=this.context.data[t].input;return n.pulse(i,n.changeset().remove(Qf).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?qS(n,e=e||OS(t)):t}},panLinear:_h,panLog:wh,panPow:kh,panSymlog:$h,zoomLinear:Eh,zoomLog:Sh,zoomPow:Mh,zoomSymlog:Dh,encode:function(t,e,n){if(t){const n=this.context.dataflow,i=t.mark.source;n.pulse(i,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,i,r,o){const s=this.context.dataflow,a=this.context.data[t],l=a.input,c=s.stamp();let u,f,h=a.changes;if(!1===s._trigger||!(l.value.length||e||i))return 0;if((!h||h.stamp{a.modified=!0,s.pulse(l,h).run()}),!0,1)),n&&(u=!0===n?Qf:ah(n)||Kv(n)?n:UH(n),h.remove(u)),e&&h.insert(e),i&&(u=UH(i),l.value.some(u)?h.remove(u):h.insert(i)),r)for(f in o)h.modify(r,f,o[f]);return 1},lassoAppend:function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const r=(t=Oh(t))[t.length-1];return void 0===r||Math.hypot(r[0]-e,r[1]-n)>i?[...t,[e,n]]:t},lassoPath:function(t){return Oh(t).reduce(((e,n,i)=>{let[r,o]=n;return e+(0==i?`M ${r},${o} `:i===t.length-1?" Z":`L ${r},${o} `)}),"")},intersectLasso:function(t,e,n){const{x:i,y:r,mark:o}=n,s=(new xM).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[t,n]of e)ts.x2&&(s.x2=t),ns.y2&&(s.y2=n);return s.translate(i,r),XH([[s.x1,s.y1],[s.x2,s.y2]],t,o).filter((t=>function(t,e,n){let i=0;for(let r=0,o=n.length-1;re!=a>e&&t<(s-l)*(e-c)/(a-c)+l&&i++}return 1&i}(t.x,t.y,e)))}},JH=["view","item","group","xy","x","y"],QH="this.",KH={},tV={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${hd(SH+t)}]`,functions:function(t){const e=JW(t);JH.forEach((t=>e[t]="event.vega."+t));for(const t in ZH)e[t]=QH+t;return qh(e,OH(t,ZH,KH)),e},constants:ZW,visitors:KH},eV=QW(tV);function nV(t,e,n){return 1===arguments.length?ZH[t]:(ZH[t]=e,n&&(KH[t]=n),eV&&(eV.functions[t]=QH+t),this)}function iV(t,e){const n={};let i;try{i=XW(t=rd(t)?t:hd(t)+"")}catch(e){Hf("Expression parse error: "+t)}i.visit((t=>{if(t.type!==dq)return;const i=t.callee.name,r=tV.visitors[i];r&&r(i,t.arguments,e,n)}));const r=eV(i);return r.globals.forEach((t=>{const i=SH+t;!Yh(n,i)&&e.getSignal(t)&&(n[i]=e.signalRef(t))})),{$expr:qh({code:r.code},e.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}nV("bandwidth",(function(t,e){const n=FH(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),DH),nV("copy",(function(t,e){const n=FH(t,(e||this).context);return n?n.copy():void 0}),DH),nV("domain",(function(t,e){const n=FH(t,(e||this).context);return n?n.domain():[]}),DH),nV("range",(function(t,e){const n=FH(t,(e||this).context);return n&&n.range?n.range():[]}),DH),nV("invert",(function(t,e,n){const i=FH(t,(n||this).context);return i?ah(e)?(i.invertRange||i.invert)(e):(i.invert||i.invertExtent)(e):void 0}),DH),nV("scale",(function(t,e,n){const i=FH(t,(n||this).context);return i?i(e):void 0}),DH),nV("gradient",(function(t,e,n,i,r){t=FH(t,(r||this).context);const o=$S(e,n);let s=t.domain(),a=s[0],l=dh(s),c=Xf;return l-a?c=HE(t,a,l):t=(t.interpolator?OE("sequential")().interpolator(t.interpolator()):OE("linear")().interpolate(t.interpolate()).range(t.range())).domain([a=0,l=1]),t.ticks&&(s=t.ticks(+i||15),a!==s[0]&&s.unshift(a),l!==dh(s)&&s.push(l)),s.forEach((e=>o.stop(c(e),t(e)))),o}),DH),nV("geoArea",NH,DH),nV("geoBounds",zH,DH),nV("geoCentroid",LH,DH),nV("geoShape",(function(t,e,n){const i=FH(t,(n||this).context);return function(t){return i?i.path.context(t)(e):""}}),DH),nV("geoScale",(function(t,e){const n=FH(t,(e||this).context);return n&&n.scale()}),DH),nV("indata",(function(t,e,n){const i=this.context.data[t]["index:"+e],r=i?i.value.get(n):void 0;return r?r.count:r}),(function(t,e,n,i){e[0].type!==cq&&Hf("First argument to indata must be a string literal."),e[1].type!==cq&&Hf("Second argument to indata must be a string literal.");const r=e[0].value,o=e[1].value,s="@"+o;Yh(s,i)||(i[s]=n.getData(r).indataRef(n,o))})),nV("data",yH,MH),nV("treePath",(function(t,e,n){const i=YH(t,this),r=i[e],o=i[n];return r&&o?r.path(o).map(VH):void 0}),MH),nV("treeAncestors",(function(t,e){const n=YH(t,this)[e];return n?n.ancestors().map(VH):void 0}),MH),nV("vlSelectionTest",(function(t,e,n){for(var i,r,o,s,a,l=this.context.data[t],c=l?l.values.value:[],u=l?l[uH]&&l[uH].value:void 0,f=n===eH,h=c.length,d=0;d(t[o[n].field]=e,t)),{}))}else l=iH,c=rH(r),(f=(u=v[l]||(v[l]={}))[a]||(u[a]=[])).push(c),n&&(f=b[a]||(b[a]=[])).push({[iH]:c});if(e=e||nH,v[iH]?v[iH]=gH[`${iH}_${e}`](...Object.values(v[iH])):Object.keys(v).forEach((t=>{v[t]=Object.keys(v[t]).map((e=>v[t][e])).reduce(((n,i)=>void 0===n?i:gH[`${x[t]}_${e}`](n,i)))})),y=Object.keys(b),n&&y.length){v[i?"vlPoint":"vlMulti"]=e===nH?{or:y.reduce(((t,e)=>(t.push(...b[e]),t)),[])}:{and:y.map((t=>({or:b[t]})))}}return v}),mH),nV("vlSelectionTuples",(function(t,e){return t.map((t=>qh(e.fields?{values:e.fields.map((e=>tH(e)(t.datum)))}:{[iH]:rH(t.datum)},e)))}));const rV=yd(["rule"]),oV=yd(["group","image","rect"]);function sV(t){return(t+"").toLowerCase()}function aV(t,e,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...e.concat(n));return t&&t.functions?i.bind(t.functions):i}var lV={operator:(t,e)=>aV(t,["_"],e.code),parameter:(t,e)=>aV(t,["datum","_"],e.code),event:(t,e)=>aV(t,["event"],e.code),handler:(t,e)=>aV(t,["_","event"],`var datum=event.item&&event.item.datum;return ${e.code};`),encode:(t,e)=>{const{marktype:n,channels:i}=e;let r="var o=item,datum=o.datum,m=0,$;";for(const t in i){const e="o["+hd(t)+"]";r+=`$=${i[t].code};if(${e}!==$)${e}=$,m=1;`}return r+=function(t,e){let n="";return rV[e]||(t.x2&&(t.x?(oV[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(oV[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",aV(t,["item","_"],r)},codegen:{get(t){const e=`[${t.map(hd).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const i=Function("a","b","var u, v; return "+t.map(((t,i)=>{const r=e[i];let o,s;return t.path?(o=`a${t.path}`,s=`b${t.path}`):((n=n||{})["f"+i]=t,o=`this.f${i}(a)`,s=`this.f${i}(b)`),function(t,e,n,i){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}(o,s,-r,r)})).join("")+"0;");return n?i.bind(n):i}}};function cV(t,e,n){if(!t||!lh(t))return t;for(let i,r=0,o=uV.length;rt&&t.$tupleid?tb:t));return e.fn[n]||(e.fn[n]=Lh(i,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,i,r){const o=e.fork().parse(n),s=o.get(n.operators[0].id),a=o.signals.parent;return a&&a.set(r),s.detachSubflow=()=>e.detach(o),s}}},{key:"$tupleid",parse:function(){return tb}}];const fV={skip:!0};function hV(t,e,n,i){return new dV(t,e,n,i)}function dV(t,e,n,i){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=i||lV,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function pV(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function gV(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}dV.prototype=pV.prototype={fork(){const t=new pV(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,i=n.dataflow,r=t.value;if(n.set(t.id,e),function(t){return"collect"===sV(t)}(t.type)&&r&&(r.$ingest?i.ingest(e,r.$ingest,r.$format):r.$request?i.preload(e,r.$request,r.$format):i.pulse(e,i.changeset().insert(r))),t.root&&(n.root=e),t.parent){let r=n.get(t.parent.$ref);r?(i.connect(r,[e]),e.targets().add(r)):(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(t.parent.$ref),i.connect(r,[e]),e.targets().add(r)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const i in t.data){const r=n.data[i]||(n.data[i]={});t.data[i].forEach((t=>r[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[sV(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,i,r){this.dataflow.on(e,n,i,r,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===sV(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||Hf("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const i in t){const r=t[i];e[i]=ah(r)?r.map((t=>cV(t,n,e))):cV(r,n,e)}return e},parseStream:function(t){var e,n=this,i=null!=t.filter?n.eventExpression(t.filter):void 0,r=null!=t.stream?n.get(t.stream):void 0;t.source?r=n.events(t.source,t.type,i):t.merge&&(r=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),r=r.between(e[0],e[1])),t.filter&&(r=r.filter(i)),null!=t.throttle&&(r=r.throttle(+t.throttle)),null!=t.debounce&&(r=r.debounce(+t.debounce)),null==r&&Hf("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),n.stream(t,r)},parseUpdate:function(t){var e,n=this,i=lh(i=t.source)?i.$ref:i,r=n.get(i),o=t.update,s=void 0;r||Hf("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(s=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,r,e,o,s)},getState:function(t){var e=this,n={};if(t.signals){var i=n.signals={};Object.keys(e.signals).forEach((n=>{const r=e.signals[n];t.signals(n,r)&&(i[n]=r.value)}))}if(t.data){var r=n.data={};Object.keys(e.data).forEach((n=>{const i=e.data[n];t.data(n,i)&&(r[n]=i.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,i=t.data,r=t.signals;Object.keys(r||{}).forEach((t=>{n.update(e.signals[t],r[t],fV)})),Object.keys(i||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(Qf).insert(i[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const i=e.subcontext[n];i&&i.setState(t)}))}};const mV="default";function yV(t,e){const n=t.globalCursor()?"undefined"!=typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function vV(t,e){var n=t._runtime.data;return Yh(n,e)||Hf("Unrecognized data set: "+e),n[e]}function bV(t,e){ab(e)||Hf("Second argument to changes must be a changeset.");const n=vV(this,t);return n.modified=!0,this.pulse(n.input,e)}function xV(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function _V(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function wV(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function kV(t,e,n){var i,r,o=t._renderer,s=o&&o.canvas();return s&&(r=wV(t),(i=OA(e.changedTouches?e.changedTouches[0]:e,s))[0]-=r[0],i[1]-=r[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const i=e?"group"===e.mark.marktype?e:e.mark.group:null;function r(t){var n,r=i;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function o(t){if(!t)return n;rd(t)&&(t=r(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:jh(t),item:jh(e||{}),group:r,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,i),e}const $V="view",CV={trap:!1};function EV(t,e,n,i){t._eventListeners.push({type:n,sources:Oh(e),handler:i})}function SV(t,e,n){const i=t._eventConfig&&t._eventConfig[e];return!(!1===i||lh(i)&&!i[n])||(t.warn(`Blocked ${e} ${n} event listener.`),!1)}function MV(t){return t.item}function DV(t){return t.item.mark.source}function AV(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function FV(t,e,n){const i=document.createElement(t);for(const t in e)i.setAttribute(t,e[t]);return null!=n&&(i.textContent=n),i}const OV="vega-bind",TV="vega-bind-name",NV="vega-bind-radio";function zV(t,e,n,i){const r=n.event||"input",o=()=>t.update(e.value);i.signal(n.signal,e.value),e.addEventListener(r,o),EV(i,e,r,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!=typeof Event?new Event(t):{type:t}}(r))}}function LV(t,e,n,i){const r=i.signal(n.signal),o=FV("div",{class:OV}),s="radio"===n.input?o:o.appendChild(FV("label"));s.appendChild(FV("span",{class:TV},n.name||n.signal)),e.appendChild(o);let a=RV;switch(n.input){case"checkbox":a=PV;break;case"select":a=IV;break;case"radio":a=BV;break;case"range":a=jV}a(t,s,n,r)}function RV(t,e,n,i){const r=FV("input");for(const t in n)"signal"!==t&&"element"!==t&&r.setAttribute("input"===t?"type":t,n[t]);r.setAttribute("name",n.signal),r.value=i,e.appendChild(r),r.addEventListener("input",(()=>t.update(r.value))),t.elements=[r],t.set=t=>r.value=t}function PV(t,e,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=FV("input",r);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function IV(t,e,n,i){const r=FV("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};UV(t,i)&&(n.selected=!0),r.appendChild(FV("option",n,(o[e]||t)+""))})),e.appendChild(r),r.addEventListener("change",(()=>{t.update(n.options[r.selectedIndex])})),t.elements=[r],t.set=t=>{for(let e=0,i=n.options.length;e{const a={type:"radio",name:n.signal,value:e};UV(e,i)&&(a.checked=!0);const l=FV("input",a);l.addEventListener("change",(()=>t.update(e)));const c=FV("label",{},(o[s]||e)+"");return c.prepend(l),r.appendChild(c),l})),t.set=e=>{const n=t.elements,i=n.length;for(let t=0;t{l.textContent=a.value,t.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),t.elements=[a],t.set=t=>{a.value=t,l.textContent=t}}function UV(t,e){return t===e||t+""==e+""}function qV(t,e,n,i,r,o){return(e=e||new i(t.loader())).initialize(n,xV(t),_V(t),wV(t),r,o).background(t.background())}function WV(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function HV(t,e,n){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e&&n)try{e.textContent=""}catch(n){e=null,t.error(n)}return e}const VV=t=>+t||0;function YV(t){return lh(t)?{top:VV(t.top),bottom:VV(t.bottom),left:VV(t.left),right:VV(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(VV(t))}async function GV(t,e,n,i){const r=rO(e),o=r&&r.headless;return o||Hf("Unrecognized renderer type: "+e),await t.runAsync(),qV(t,null,null,o,n,i).renderAsync(t._scenegraph.root)}var XV="width",ZV="height",JV="padding",QV={skip:!0};function KV(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===JV?i.left+i.right:0)}function tY(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===JV?i.top+i.bottom:0)}function eY(t,e){return e.modified&&ah(e.input.value)&&t.indexOf("_:vega:_")}function nY(t,e){return!("parent"===t||e instanceof Nb.proxy)}function iY(t,e,n,i){const r=t.element();r&&r.setAttribute("title",function(t){return null==t?"":ah(t)?rY(t):lh(t)&&!td(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+(ah(n)?rY(n):oY(n))})).join("\n")):t+"";var e}(i))}function rY(t){return"["+t.map(oY).join(", ")+"]"}function oY(t){return ah(t)?"[…]":lh(t)&&!td(t)?"{…}":t}function sY(t,e){const n=this;if(e=e||{},Fb.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const i=qh({},t.locale,e.locale);n.locale(xv(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||nO.Canvas,n._scenegraph=new CA;const i=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||iY,n._redraw=!0,n._handler=(new eF).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=qh({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{ah(t[e])&&(t[e]=yd(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(t,e,n){return hV(t,Nb,ZH,n).parse(e)}(n,t,e.expr);n._runtime=r,n._signals=r.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:qh({},t)}))),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=KV(n,n._width),n._viewHeight=tY(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e[XV],i=e[ZV],r=e[JV];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=KV(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=tY(t,e.size),o()}),{size:i});const s=t.add(null,o,{pad:r});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=i.rank+1,s.rank=r.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:mV,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const i=e.value,r=i?rd(i)?i:i.user:mV,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}})),t.add(null,(function(e){let n=e.cursor,i=this.value;return rd(n)||(i=n.item,n=n.user),yV(t,n&&n!==mV?n:i||n),i}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function aY(t,e){return Yh(t._signals,e)?t._signals[e]:Hf("Unrecognized signal name: "+hd(e))}function lY(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function cY(t,e,n,i){let r=lY(n,i);return r||(r=WV(t,(()=>i(e,n.value))),r.handler=i,t.on(n,null,r)),t}function uY(t,e,n){const i=lY(e,n);return i&&e._targets.remove(i),t}Jh(sY,Fb,{async evaluate(t,e,n){if(await Fb.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=wV(t),n=xV(t),i=_V(t);t._renderer.background(t.background()),t._renderer.resize(n,i,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,i)}catch(e){t.error(e)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}return n&&Zv(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&gV(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const i=aY(this,t);return 1===arguments.length?i.value:this.update(i,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",YV(t)):YV(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(rO(t)||Hf("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Fb.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(aY(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,i,r,o){this.runAfter((s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(XV,n,QV),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(ZV,i,QV),s._resizeHeight.skip(!0)),s._viewWidth!==t&&(s._resize=1,s._viewWidth=t),s._viewHeight!==e&&(s._resize=1,s._viewHeight=e),s._origin[0]===r[0]&&s._origin[1]===r[1]||(s._resize=1,s._origin=r),a&&s.run("enter"),o&&s.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let i=e;return n&&!1===n.trap||(i=WV(this,e),i.raw=e),this._handler.on(t,i),this},removeEventListener(t,e){for(var n,i,r=this._handler.handlers(t),o=r.length;--o>=0;)if(i=r[o].type,n=r[o].handler,t===i&&(e===n||e===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return cY(this,t,aY(this,t),e)},removeSignalListener(t,e){return uY(this,aY(this,t),e)},addDataListener(t,e){return cY(this,t,vV(this,t).values,e)},removeDataListener(t,e){return uY(this,vV(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=yV(this,null);this._globalCursor=!!t,e&&yV(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var i=new II,r=e;return null==e?(i.restart(t,e,n),i):(i._restart=i.restart,i.restart=function(t,e,n){e=+e,n=null==n?RI():+n,i._restart((function o(s){s+=r,i._restart(o,r+=e,n),t(s)}),e,n)},i.restart(t,e,n),i)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var i,r=this,o=new mb(n),s=function(n,i){r.runAsync(null,(()=>{t===$V&&function(t,e){var n=t._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[e]:r?!r[e]:t.preventDefault()))}(r,e)&&n.preventDefault(),o.receive(kV(r,n,i))}))};if("timer"===t)SV(r,"timer",e)&&r.timer(s,e);else if(t===$V)SV(r,"view",e)&&r.addEventListener(e,s,CV);else if("window"===t?SV(r,"window",e)&&"undefined"!=typeof window&&(i=[window]):"undefined"!=typeof document&&SV(r,"selector",e)&&(i=Array.from(document.querySelectorAll(t))),i){for(var a=0,l=i.length;a=0;)r[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",MV),DV,AV(t)),this.on(this.events("view","mouseout",MV),DV,AV(e)),this},data:function(t,e){return arguments.length<2?vV(this,t).values.value:bV.call(this,t,lb().remove(Qf).insert(e))},change:bV,insert:function(t,e){return bV.call(this,t,lb().insert(e))},remove:function(t,e){return bV.call(this,t,lb().remove(e))},scale:function(t){var e=this._runtime.scales;return Yh(e,t)||Hf("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,i=n._renderType,r=n._eventConfig.bind,o=rO(i);t=n._el=t?HV(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),gV(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||eF,a=t?o.renderer:o.headless;return n._renderer=a?qV(n,n._renderer,t,a):null,n._handler=function(t,e,n,i){const r=new i(t.loader(),WV(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,wV(t),t);return e&&e.handlers().forEach((t=>{r.on(t.type,t.handler)})),r}(n,n._handler,t,s),n._redraw=!0,t&&"none"!==r&&(e=e?n._elBind=HV(n,e,!0):t.appendChild(FV("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==r&&(t.element=HV(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(i.signal)&&t.runAsync(null,(()=>{r.source=!0,t.signal(i.signal,e)}))}},i.debounce&&(r.update=Uh(i.debounce,r.update))),(null==i.input&&i.element?zV:LV)(r,e,i,t),r.active||(t.on(t._signals[i.signal],null,(()=>{r.source?r.source=!1:r.set(t.signal(i.signal))})),r.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==nO.Canvas&&t!==nO.SVG&&t!==nO.PNG&&Hf("Unrecognized image type: "+t);const n=await GV(this,t,e);return t===nO.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await GV(this,nO.Canvas,t,e)).canvas()},toSVG:async function(t){return(await GV(this,nO.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:eY,signals:nY,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});const fY="view",hY="[",dY="]",pY="{",gY="}",mY=":",yY=",",vY="@",bY=">",xY=/[[\]{}]/,_Y={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let wY,kY;function $Y(t,e,n){return wY=e||fY,kY=n||_Y,EY(t.trim()).map(SY)}function CY(t,e,n,i,r){const o=t.length;let s,a=0;for(;e=0?--a:i&&i.indexOf(s)>=0&&++a}return e}function EY(t){const e=[],n=t.length;let i=0,r=0;for(;r' after between selector: "+t;n=n.map(SY);const r=SY(t.slice(1).trim());if(r.between)return{between:n,stream:r};r.between=n;return r}(t):function(t){const e={source:wY},n=[];let i,r,o=[0,0],s=0,a=0,l=t.length,c=0;if(t[l-1]===gY){if(c=t.lastIndexOf(pY),!(c>=0))throw"Unmatched right brace: "+t;try{o=function(t){const e=t.split(yY);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!=n)throw t;return n}))}(t.substring(c+1,l-1))}catch(e){throw"Invalid throttle specification: "+t}l=(t=t.slice(0,c).trim()).length,c=0}if(!l)throw t;t[0]===vY&&(s=++c);i=CY(t,c,mY),i1?(e.type=n[1],s?e.markname=n[0].slice(1):!function(t){return kY[t]}(n[0])?e.source=n[0]:e.marktype=n[0]):e.type=n[0];"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=r&&(e.filter=r);o[0]&&(e.throttle=o[0]);o[1]&&(e.debounce=o[1]);return e}(t)}function MY(t){return lh(t)?t:{type:t||"pad"}}const DY=t=>+t||0,AY=t=>({top:t,bottom:t,left:t,right:t});function FY(t){return lh(t)?t.signal?t:{top:DY(t.top),bottom:DY(t.bottom),left:DY(t.left),right:DY(t.right)}:AY(DY(t))}const OY=t=>lh(t)&&!ah(t)?qh({},t):{value:t};function TY(t,e,n,i){if(null!=n){return lh(n)&&!ah(n)||ah(n)&&n.length&&lh(n[0])?t.update[e]=n:t[i||"enter"][e]={value:n},1}return 0}function NY(t,e,n){for(const n in e)TY(t,n,e[n]);for(const e in n)TY(t,e,n[e],"update")}function zY(t,e,n){for(const i in e)n&&Yh(n,i)||(t[i]=qh(t[i]||{},e[i]));return t}function LY(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const RY="mark",PY="frame",IY="scope",BY="axis",jY="axis-domain",UY="axis-grid",qY="axis-label",WY="axis-tick",HY="axis-title",VY="legend",YY="legend-band",GY="legend-entry",XY="legend-gradient",ZY="legend-label",JY="legend-symbol",QY="legend-title",KY="title",tG="title-text",eG="title-subtitle";function nG(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const iG=t=>rd(t)?hd(t):t.signal?`(${t.signal})`:aG(t);function rG(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:hd(t)));for(;e.length&&null==dh(e);)e.pop();return e.unshift(iG(t.gradient)),`gradient(${e.join(",")})`}(t);let e=t.signal?`(${t.signal})`:t.color?function(t){return t.c?oG("hcl",t.h,t.c,t.l):t.h||t.s?oG("hsl",t.h,t.s,t.l):t.l||t.a?oG("lab",t.l,t.a,t.b):t.r||t.g||t.b?oG("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?aG(t.field):void 0!==t.value?hd(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=iG(t.scale);null!=t.range?e=`lerp(_range(${n}), ${+t.range})`:(void 0!==e&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(1==+t.band?"":"*"+sG(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e=`pow(${e},${sG(t.exponent)})`),null!=t.mult&&(e+=`*${sG(t.mult)}`),null!=t.offset&&(e+=`+${sG(t.offset)}`),t.round&&(e=`round(${e})`),e}const oG=(t,e,n,i)=>`(${t}(${[e,n,i].map(rG).join(",")})+'')`;function sG(t){return lh(t)?"("+rG(t)+")":t}function aG(t){return lG(lh(t)?t:{datum:t})}function lG(t){let e,n,i;if(t.signal)e="datum",i=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(i=t.parent,e+=".datum"):i=t.group}else t.datum?(e="datum",i=t.datum):Hf("Invalid field reference: "+hd(t));return t.signal||(i=rd(i)?Vf(i).map(hd).join("]["):lG(i)),e+"["+i+"]"}function cG(t,e,n,i,r,o){const s={};(o=o||{}).encoders={$encode:s},t=function(t,e,n,i,r){const o={},s={};let a,l,c,u;for(l in l="lineBreak","text"!==e||null==r[l]||LY(l,t)||nG(o,l,r[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),u=n===PY?r.group:n===RY?qh({},r.mark,r[e]):null,u)c=LY(l,t)||("fill"===l||"stroke"===l)&&(LY("fill",t)||LY("stroke",t)),c||nG(o,l,u[l]);for(l in Oh(i).forEach((e=>{const n=r.style&&r.style[e];for(const e in n)LY(e,t)||nG(o,e,n[e])})),t=qh({},t),o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return t.enter=qh(s,t.enter),a&&(t.update=qh(a,t.update)),t}(t,e,n,i,r.config);for(const n in t)s[n]=uG(t[n],e,o,r);return o}function uG(t,e,n,i){const r={},o={};for(const e in t)null!=t[e]&&(r[e]=fG((s=t[e],ah(s)?function(t){let e="";return t.forEach((t=>{const n=rG(t);e+=t.test?`(${t.test})?${n}:`:n})),":"===dh(e)&&(e+="null"),e}(s):rG(s)),i,n,o));var s;return{$expr:{marktype:e,channels:r},$fields:Object.keys(o),$output:Object.keys(t)}}function fG(t,e,n,i){const r=iV(t,e);return r.$fields.forEach((t=>i[t]=1)),qh(n,r.$params),r.$expr}const hG="outer",dG=["value","update","init","react","bind"];function pG(t,e){Hf(t+' for "outer" push: '+hd(e))}function gG(t,e){const n=t.name;if(t.push===hG)e.signals[n]||pG("No prior signal definition",n),dG.forEach((e=>{void 0!==t[e]&&pG("Invalid property ",e)}));else{const i=e.addSignal(n,t.value);!1===t.react&&(i.react=!1),t.bind&&e.addBinding(n,t.bind)}}function mG(t,e,n,i){this.id=-1,this.type=t,this.value=e,this.params=n,i&&(this.parent=i)}function yG(t,e,n,i){return new mG(t,e,n,i)}function vG(t,e){return yG("operator",t,e)}function bG(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function xG(t,e){return e?{$field:t,$name:e}:{$field:t}}const _G=xG("key");function wG(t,e){return{$compare:t,$order:e}}const kG="descending";function $G(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const CG="scope",EG="view";function SG(t){return t&&t.signal}function MG(t){if(SG(t))return!0;if(lh(t))for(const e in t)if(MG(t[e]))return!0;return!1}function DG(t,e){return null!=t?t:e}function AG(t){return t&&t.signal||t}const FG="timer";function OG(t,e){return(t.merge?TG:t.stream?NG:t.type?zG:Hf("Invalid stream specification: "+hd(t)))(t,e)}function TG(t,e){const n=LG({merge:t.merge.map((t=>OG(t,e)))},t,e);return e.addStream(n).id}function NG(t,e){const n=LG({stream:OG(t.stream,e)},t,e);return e.addStream(n).id}function zG(t,e){let n;t.type===FG?(n=e.event(FG,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===CG?EG:t||EG}(t.source),t.type);const i=LG({stream:n},t,e);return 1===Object.keys(i).length?n:e.addStream(i).id}function LG(t,e,n){let i=e.between;return i&&(2!==i.length&&Hf('Stream "between" parameter must have 2 entries: '+hd(e)),t.between=[OG(i[0],n),OG(i[1],n)]),i=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&i.push(function(t,e,n){const i="event.item";return i+(t&&"*"!==t?"&&"+i+".mark.marktype==='"+t+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===CG&&i.push("inScope(event.item)"),i.length&&(t.filter=iV("("+i.join(")&&(")+")",n).$expr),null!=(i=e.throttle)&&(t.throttle=+i),null!=(i=e.debounce)&&(t.debounce=+i),e.consume&&(t.consume=!0),t}const RG={code:"_.$value",ast:{type:"Identifier",value:"value"}};function PG(t,e,n){const i=t.encode,r={target:n};let o=t.events,s=t.update,a=[];o||Hf("Signal update missing events specification."),rd(o)&&(o=$Y(o,e.isSubscope()?CG:EG)),o=Oh(o).filter((t=>t.signal||t.scale?(a.push(t),0):1)),a.length>1&&(a=[IG(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),null!=i&&(s&&Hf("Signal encode and update are mutually exclusive."),s="encode(item(),"+hd(i)+")"),r.update=rd(s)?iV(s,e):null!=s.expr?iV(s.expr,e):null!=s.value?s.value:null!=s.signal?{$expr:RG,$params:{$value:e.signalRef(s.signal)}}:Hf("Invalid signal update specification."),t.force&&(r.options={force:!0}),a.forEach((t=>e.addUpdate(qh(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):OG(t,e)}}(t,e),r))))}function IG(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const BG=t=>(e,n,i)=>yG(t,n,e||void 0,i),jG=BG("aggregate"),UG=BG("axisticks"),qG=BG("bound"),WG=BG("collect"),HG=BG("compare"),VG=BG("datajoin"),YG=BG("encode"),GG=BG("expression"),XG=BG("facet"),ZG=BG("field"),JG=BG("key"),QG=BG("legendentries"),KG=BG("load"),tX=BG("mark"),eX=BG("multiextent"),nX=BG("multivalues"),iX=BG("overlap"),rX=BG("params"),oX=BG("prefacet"),sX=BG("projection"),aX=BG("proxy"),lX=BG("relay"),cX=BG("render"),uX=BG("scale"),fX=BG("sieve"),hX=BG("sortitems"),dX=BG("viewlayout"),pX=BG("values");let gX=0;const mX={min:"min",max:"max",count:"sum"};function yX(t,e){const n=e.getScale(t.name).params;let i;for(i in n.domain=_X(t.domain,t,e),null!=t.range&&(n.range=DX(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=vX(t.type||t),null!=t.gamma&&(e.interpolateGamma=vX(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return lh(t)?{interval:vX(t.interval),step:vX(t.step)}:vX(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||ah(t)?bX(t,e):e.objectProperty(t)}(t.bins,e)),t)Yh(n,i)||"name"===i||(n[i]=vX(t[i],e))}function vX(t,e){return lh(t)?t.signal?e.signalRef(t.signal):Hf("Unsupported object: "+hd(t)):t}function bX(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>vX(t,e)))}function xX(t){Hf("Can not find data set: "+hd(t))}function _X(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(ah(t)?wX:t.fields?$X:kX)(t,e,n);null==e.domainMin&&null==e.domainMax||Hf("No scale domain defined for domainMin/domainMax to override.")}function wX(t,e,n){return t.map((t=>vX(t,n)))}function kX(t,e,n){const i=n.getData(t.data);return i||xX(t.data),LE(e.type)?i.valuesRef(n,t.field,EX(t.sort,!1)):BE(e.type)?i.domainRef(n,t.field):i.extentRef(n,t.field)}function $X(t,e,n){const i=t.data,r=t.fields.reduce(((t,e)=>(e=rd(e)?{data:i,field:e}:ah(e)||e.signal?function(t,e){const n="_:vega:_"+gX++,i=WG({});if(ah(t))i.value={$ingest:t};else if(t.signal){const r="setdata("+hd(n)+","+t.signal+")";i.params.input=e.signalRef(r)}return e.addDataPipeline(n,[i,fX({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(LE(e.type)?CX:BE(e.type)?SX:MX)(t,n,r)}function CX(t,e,n){const i=EX(t.sort,!0);let r,o;const s=n.map((t=>{const n=e.getData(t.data);return n||xX(t.data),n.countsRef(e,t.field,i)})),a={groupby:_G,pulse:s};i&&(r=i.op||"count",o=i.field?$G(r,i.field):"count",a.ops=[mX[r]],a.fields=[e.fieldRef(o)],a.as=[o]),r=e.add(jG(a));const l=e.add(WG({pulse:bG(r)}));return o=e.add(pX({field:_G,sort:e.sortRef(i),pulse:bG(l)})),bG(o)}function EX(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!mX[t.op]&&Hf("Multiple domain scales can not be sorted using "+t.op):Hf("No field provided for sort aggregate op: "+t.op):lh(t)?t.field="key":t={field:"key"}),t}function SX(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||xX(t.data),n.domainRef(e,t.field)}));return bG(e.add(nX({values:i})))}function MX(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);return n||xX(t.data),n.extentRef(e,t.field)}));return bG(e.add(eX({extents:i})))}function DX(t,e,n){const i=e.config.range;let r=t.range;if(r.signal)return e.signalRef(r.signal);if(rd(r)){if(i&&Yh(i,r))return DX(t=qh({},t,{range:i[r]}),e,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=LE(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Hf("Unrecognized scale range value: "+hd(r))}else{if(r.scheme)return n.scheme=ah(r.scheme)?bX(r.scheme,e):vX(r.scheme,e),r.extent&&(n.schemeExtent=bX(r.extent,e)),void(r.count&&(n.schemeCount=vX(r.count,e)));if(r.step)return void(n.rangeStep=vX(r.step,e));if(LE(t.type)&&!ah(r))return _X(r,t,e);ah(r)||Hf("Unsupported range type: "+hd(r))}return r.map((t=>(ah(t)?bX:vX)(t,e)))}function AX(t,e,n){return ah(t)?t.map((t=>AX(t,e,n))):lh(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:Hf("Unsupported parameter object: "+hd(t)):t}const FX="top",OX="left",TX="right",NX="bottom",zX="center",LX="vertical",RX="start",PX="end",IX="index",BX="label",jX="offset",UX="perc",qX="perc2",WX="value",HX="guide-label",VX="guide-title",YX="group-title",GX="group-subtitle",XX="symbol",ZX="gradient",JX="discrete",QX="size",KX=[QX,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],tZ={name:1,style:1,interactive:1},eZ={value:0},nZ={value:1},iZ="group",rZ="rect",oZ="rule",sZ="symbol",aZ="text";function lZ(t){return t.type=iZ,t.interactive=t.interactive||!1,t}function cZ(t,e){const n=(n,i)=>DG(t[n],DG(e[n],i));return n.isVertical=n=>LX===DG(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>DG(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>DG(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>DG(t.columns,DG(e.columns,+n.isVertical(!0))),n}function uZ(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function fZ(t,e,n){return`item.anchor === '${RX}' ? ${t} : item.anchor === '${PX}' ? ${e} : ${n}`}const hZ=fZ(hd(OX),hd(TX),hd(zX));function dZ(t,e){return e?t?lh(t)?Object.assign({},t,{offset:dZ(t.offset,e)}):{value:t,offset:e}:e:t}function pZ(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=zY(t.encode,e,tZ)):t.interactive=!1,t}function gZ(t,e,n,i){const r=cZ(t,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let l,c,u,f,h;o?(c=[0,1],u=[0,0],f=s,h=a):(c=[0,0],u=[1,0],f=a,h=s);const d={enter:l={opacity:eZ,x:eZ,y:eZ,width:OY(f),height:OY(h)},update:qh({},l,{opacity:nZ,fill:{gradient:e,start:c,stop:u}}),exit:{opacity:eZ}};return NY(d,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),pZ({type:rZ,role:XY,encode:d},i)}function mZ(t,e,n,i,r){const o=cZ(t,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,h,d="";s?(c="y",f="y2",u="x",h="width",d="1-"):(c="x",f="x2",u="y",h="height");const p={opacity:eZ,fill:{scale:e,field:WX}};p[c]={signal:d+"datum."+UX,mult:l},p[u]=eZ,p[f]={signal:d+"datum."+qX,mult:l},p[h]=OY(a);const g={enter:p,update:qh({},p,{opacity:nZ}),exit:{opacity:eZ}};return NY(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),pZ({type:rZ,role:YY,key:WX,from:r,encode:g},i)}const yZ=`datum.${UX}<=0?"${OX}":datum.${UX}>=1?"${TX}":"${zX}"`,vZ=`datum.${UX}<=0?"${NX}":datum.${UX}>=1?"${FX}":"middle"`;function bZ(t,e,n,i){const r=cZ(t,e),o=r.isVertical(),s=OY(r.gradientThickness()),a=r.gradientLength();let l,c,u,f,h=r("labelOverlap"),d="";const p={enter:l={opacity:eZ},update:c={opacity:nZ,text:{field:BX}},exit:{opacity:eZ}};return NY(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:DG(t.labelLimit,e.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:vZ},u="y",f="x",d="1-"):(l.align=c.align={signal:yZ},l.baseline={value:"top"},u="x",f="y"),l[u]=c[u]={signal:d+"datum."+UX,mult:a},l[f]=c[f]=s,s.offset=DG(t.labelOffset,e.gradientLabelOffset)||0,h=h?{separation:r("labelSeparation"),method:h,order:"datum."+IX}:void 0,pZ({type:aZ,role:ZY,style:HX,key:WX,from:i,encode:p,overlap:h},n)}function xZ(t,e,n,i,r){const o=cZ(t,e),s=n.entries,a=!(!s||!s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},h=`(${r}) ? datum.${jX} : datum.${QX}`,d=c?OY(c):{field:QX},p=`datum.${IX}`,g=`max(1, ${r})`;let m,y,v,b,x;d.mult=.5,m={enter:y={opacity:eZ,x:{signal:h,mult:.5,offset:u},y:d},update:v={opacity:nZ,x:y.x,y:y.y},exit:{opacity:eZ}};let _=null,w=null;t.fill||(_=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),NY(m,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),KX.forEach((e=>{t[e]&&(v[e]=y[e]={scale:t[e],field:WX})}));const k=pZ({type:sZ,role:JY,key:WX,from:f,clip:!!c||void 0,encode:m},n.symbols),$=OY(u);$.offset=o("labelOffset"),m={enter:y={opacity:eZ,x:{signal:h,offset:$},y:d},update:v={opacity:nZ,text:{field:BX},x:y.x,y:y.y},exit:{opacity:eZ}},NY(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const C=pZ({type:aZ,role:ZY,style:HX,key:WX,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:eZ,height:c?OY(c):eZ,opacity:eZ},exit:{opacity:eZ},update:v={opacity:nZ,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${r})?${v.column.signal}:${p}`,lZ({role:IY,from:i={facet:{data:i,name:"value",groupby:IX}},encode:zY(m,s,tZ),marks:[k,C],name:l,interactive:a,sort:x})}const _Z='item.orient === "left"',wZ='item.orient === "right"',kZ=`(${_Z} || ${wZ})`,$Z=`datum.vgrad && ${kZ}`,CZ=fZ('"top"','"bottom"','"middle"'),EZ=`datum.vgrad && ${wZ} ? (${fZ('"right"','"left"','"center"')}) : (${kZ} && !(datum.vgrad && ${_Z})) ? "left" : ${hZ}`,SZ=`item._anchor || (${kZ} ? "middle" : "start")`,MZ=`${$Z} ? (${_Z} ? -90 : 90) : 0`,DZ=`${kZ} ? (datum.vgrad ? (${wZ} ? "bottom" : "top") : ${CZ}) : "top"`;function AZ(t,e){let n;return lh(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+FZ(t.path)+")":t.sphere&&(n="geoShape("+FZ(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function FZ(t){return lh(t)&&t.signal?t.signal:hd(t)}function OZ(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===iZ?IY:e||RY:e}function TZ(t){return{marktype:t.type,name:t.name||void 0,role:t.role||OZ(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function NZ(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function zZ(t,e){const n=zb(t.type);n||Hf("Unrecognized transform type: "+hd(t.type));const i=yG(n.type.toLowerCase(),null,LZ(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(i)),i.metadata=n.metadata||{},i}function LZ(t,e,n){const i={},r=t.params.length;for(let o=0;oIZ(t,e,n)))):IZ(t,i,n)}(t,e,n):"projection"===i?n.projectionRef(e[t.name]):t.array&&!SG(r)?r.map((e=>PZ(t,e,n))):PZ(t,r,n):void(t.required&&Hf("Missing required "+hd(e.type)+" parameter: "+hd(t.name)))}function PZ(t,e,n){const i=t.type;if(SG(e))return qZ(i)?Hf("Expression references can not be signals."):WZ(i)?n.fieldRef(e):HZ(i)?n.compareRef(e):n.signalRef(e.signal);{const r=t.expr||WZ(i);return r&&BZ(e)?n.exprRef(e.expr,e.as):r&&jZ(e)?xG(e.field,e.as):qZ(i)?iV(e,n):UZ(i)?bG(n.getData(e).values):WZ(i)?xG(e):HZ(i)?n.compareRef(e):e}}function IZ(t,e,n){const i=t.params.length;let r;for(let n=0;nt&&t.expr,jZ=t=>t&&t.field,UZ=t=>"data"===t,qZ=t=>"expr"===t,WZ=t=>"field"===t,HZ=t=>"compare"===t;function VZ(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:bG(e.getData(t.data).output)}function YZ(t,e,n,i,r){this.scope=t,this.input=e,this.output=n,this.values=i,this.aggregate=r,this.index={}}function GZ(t){return rd(t)?t:null}function XZ(t,e,n){const i=$G(n.op,n.field);let r;if(e.ops){for(let t=0,n=e.as.length;tnull==t?"null":t)).join(",")+"),0)",e);l.update=c.$expr,l.params=c.$params}function QZ(t,e){const n=OZ(t),i=t.type===iZ,r=t.from&&t.from.facet,o=t.overlap;let s,a,l,c,u,f,h,d=t.layout||n===IY||n===PY;const p=n===RY||d||r,g=function(t,e,n){let i,r,o,s,a;return t?(i=t.facet)&&(e||Hf("Only group marks can be faceted."),null!=i.field?s=a=VZ(i,n):(t.data?a=bG(n.getData(t.data).aggregate):(o=zZ(qh({type:"aggregate",groupby:Oh(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=VZ(i,n),s=a=bG(n.add(o))),r=n.keyRef(i.groupby,!0))):s=bG(n.add(WG(null,[{}]))),s||(s=VZ(t,n)),{key:r,pulse:s,parent:a}}(t.from,i,e);a=e.add(VG({key:g.key||(t.key?xG(t.key):void 0),pulse:g.pulse,clean:!i}));const m=bG(a);a=l=e.add(WG({pulse:m})),a=e.add(tX({markdef:TZ(t),interactive:NZ(t.interactive,e),clip:AZ(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:bG(a)}));const y=bG(a);a=c=e.add(YG(cG(t.encode,t.type,n,t.style,e,{mod:!1,pulse:y}))),a.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=zZ(t,e),i=n.metadata;(i.generates||i.changes)&&Hf("Mark transforms should not generate new data."),i.nomod||(c.params.mod=!0),n.params.pulse=bG(a),e.add(a=n)})),t.sort&&(a=e.add(hX({sort:e.compareRef(t.sort),pulse:bG(a)})));const v=bG(a);(r||d)&&(d=e.add(dX({layout:e.objectProperty(t.layout),legends:e.legends,mark:y,pulse:v})),f=bG(d));const b=e.add(qG({mark:y,pulse:f||v}));h=bG(b),i&&(p&&(s=e.operators,s.pop(),d&&s.pop()),e.pushState(v,f||h,m),r?function(t,e,n){const i=t.from.facet,r=i.name,o=VZ(i,e);let s;i.name||Hf("Facet must have a name: "+hd(i)),i.data||Hf("Facet must reference a data set: "+hd(i)),i.field?s=e.add(oX({field:e.fieldRef(i.field),pulse:o})):i.groupby?s=e.add(XG({key:e.keyRef(i.groupby),group:bG(e.proxy(n.parent)),pulse:o})):Hf("Facet must specify groupby or field: "+hd(i));const a=e.fork(),l=a.add(WG()),c=a.add(fX({pulse:bG(l)}));a.addData(r,new YZ(a,l,l,c)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const i=e.add(oX({pulse:n.pulse})),r=e.fork();r.add(fX()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(d&&s.push(d),s.push(b))),o&&(h=function(t,e,n){const i=t.method,r=t.bound,o=t.separation,s={separation:SG(o)?n.signalRef(o.signal):o,method:SG(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(s.sort=n.compareRef({field:t.order}));if(r){const t=r.tolerance;s.boundTolerance=SG(t)?n.signalRef(t.signal):+t,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return bG(n.add(iX(s)))}(o,h,e));const x=e.add(cX({pulse:h})),_=e.add(fX({pulse:bG(x)},void 0,e.parent()));null!=t.name&&(u=t.name,e.addData(u,new YZ(e,l,x,_)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&Hf("Marks only support modify triggers."),JZ(t,e,u)})))}function KZ(t,e){const n=e.config.legend,i=t.encode||{},r=cZ(t,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u,f,h,d=0;KX.forEach((e=>t[e]?(c[e]=t[e],d=d||t[e]):0)),d||Hf("Missing valid scale for legend.");const p=function(t,e){let n=t.type||XX;t.type||1!==function(t){return KX.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=zE(e)?ZX:RE(e)?JX:XX);return n!==ZX?n:RE(e)?JX:ZX}(t,e.scaleType(d)),g={title:null!=t.title,scales:c,type:p,vgrad:"symbol"!==p&&r.isVertical()},m=bG(e.add(WG(null,[g]))),y=bG(e.add(QG(f={type:p,scale:e.scaleRef(d),count:e.objectProperty(r("tickCount")),limit:e.property(r("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===ZX?(h=[gZ(t,d,n,i.gradient),bZ(t,n,i.labels,y)],f.count=f.count||e.signalRef(`max(2,2*floor((${AG(r.gradientLength())})/100))`)):p===JX?h=[mZ(t,d,n,i.gradient,y),bZ(t,n,i.labels,y)]:(u=function(t,e){const n=cZ(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),h=[xZ(t,n,i,y,AG(u.columns))],f.size=function(t,e,n){const i=AG(eJ("size",t,n)),r=AG(eJ("strokeWidth",t,n)),o=AG(function(t,e,n){return uZ("fontSize",t)||function(t,e,n){const i=e.config.style[n];return i&&i[t]}("fontSize",e,n)}(n[1].encode,e,HX));return iV(`max(ceil(sqrt(${i})+${r}),${o})`,e)}(t,e,h[0].marks)),h=[lZ({role:GY,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:h,layout:u,interactive:a})],g.title&&h.push(function(t,e,n,i){const r=cZ(t,e),o={enter:{opacity:eZ},update:{opacity:nZ,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:eZ}};return NY(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:SZ},angle:{signal:MZ},align:{signal:EZ},baseline:{signal:DZ},text:t.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),pZ({type:aZ,role:QY,style:VX,from:i,encode:o},n)}(t,n,i.title,m)),QZ(lZ({role:VY,from:m,encode:zY(tJ(r,t,n),o,tZ),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:l}),e)}function tJ(t,e,n){const i={enter:{},update:{}};return NY(i,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),i}function eJ(t,e,n){return e[t]?`scale("${e[t]}",datum)`:uZ(t,n[0].encode)}YZ.fromEntries=function(t,e){const n=e.length,i=e[n-1],r=e[n-2];let o=e[0],s=null,a=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);a{n.push(zZ(t,e))})),t.on&&t.on.forEach((n=>{JZ(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const i=[];let r,o,s,a,l,c=null,u=!1,f=!1;t.values?SG(t.values)||MG(t.format)?(i.push(aJ(e,t)),i.push(c=sJ())):i.push(c=sJ({$ingest:t.values,$format:t.format})):t.url?MG(t.url)||MG(t.format)?(i.push(aJ(e,t)),i.push(c=sJ())):i.push(c=sJ({$request:t.url,$format:t.format})):t.source&&(c=r=Oh(t.source).map((t=>bG(e.getData(t).output))),i.push(null));for(o=0,s=n.length;ot===NX||t===FX,cJ=(t,e,n)=>SG(t)?mJ(t.signal,e,n):t===OX||t===FX?e:n,uJ=(t,e,n)=>SG(t)?pJ(t.signal,e,n):lJ(t)?e:n,fJ=(t,e,n)=>SG(t)?gJ(t.signal,e,n):lJ(t)?n:e,hJ=(t,e,n)=>SG(t)?yJ(t.signal,e,n):t===FX?{value:e}:{value:n},dJ=(t,e,n)=>SG(t)?vJ(t.signal,e,n):t===TX?{value:e}:{value:n},pJ=(t,e,n)=>bJ(`${t} === '${FX}' || ${t} === '${NX}'`,e,n),gJ=(t,e,n)=>bJ(`${t} !== '${FX}' && ${t} !== '${NX}'`,e,n),mJ=(t,e,n)=>_J(`${t} === '${OX}' || ${t} === '${FX}'`,e,n),yJ=(t,e,n)=>_J(`${t} === '${FX}'`,e,n),vJ=(t,e,n)=>_J(`${t} === '${TX}'`,e,n),bJ=(t,e,n)=>(e=null!=e?OY(e):e,n=null!=n?OY(n):n,xJ(e)&&xJ(n)?{signal:`${t} ? (${e=e?e.signal||hd(e.value):null}) : (${n=n?n.signal||hd(n.value):null})`}:[qh({test:t},e)].concat(n||[])),xJ=t=>null==t||1===Object.keys(t).length,_J=(t,e,n)=>({signal:`${t} ? (${kJ(e)}) : (${kJ(n)})`}),wJ=(t,e,n,i,r)=>({signal:(null!=i?`${t} === '${OX}' ? (${kJ(i)}) : `:"")+(null!=n?`${t} === '${NX}' ? (${kJ(n)}) : `:"")+(null!=r?`${t} === '${TX}' ? (${kJ(r)}) : `:"")+(null!=e?`${t} === '${FX}' ? (${kJ(e)}) : `:"")+"(null)"}),kJ=t=>SG(t)?t.signal:null==t?null:hd(t),$J=(t,e)=>0===e?0:SG(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},CJ=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function EJ(t,e,n,i){let r;if(e&&Yh(e,t))return e[t];if(Yh(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=t[5].toLowerCase()+t.slice(6)}return i[VX][r]}if(t.startsWith("label")){switch(t){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=t[5].toLowerCase()+t.slice(6)}return i[HX][r]}return null}function SJ(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function MJ(t,e){return{scale:t.scale,range:e}}function DJ(t,e,n,i,r){const o=cZ(t,e),s=t.orient,a=t.gridScale,l=cJ(s,1,-1),c=function(t,e){if(1===e);else if(lh(t)){let n=t=qh({},t);for(;null!=n.mult;){if(!lh(n.mult))return n.mult=SG(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n=n.mult=qh({},n.mult)}n.mult=e}else t=SG(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);return t}(t.offset,l);let u,f,h;const d={enter:u={opacity:eZ},update:h={opacity:nZ},exit:f={opacity:eZ}};NY(d,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:WX,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=uJ(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},y=a?{scale:a,range:1,mult:l,offset:c}:qh(g,{mult:l,offset:c});return u.x=h.x=uJ(s,p,m),u.y=h.y=fJ(s,p,m),u.x2=h.x2=fJ(s,y),u.y2=h.y2=uJ(s,y),f.x=uJ(s,p),f.y=fJ(s,p),pZ({type:oZ,role:UY,key:WX,from:i,encode:d},n)}function AJ(t,e,n,i,r){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+i+","+r+")"}}function FJ(t,e,n,i){const r=cZ(t,e),o=t.orient,s=cJ(o,-1,1);let a,l;const c={enter:a={opacity:eZ,anchor:OY(r("titleAnchor",null)),align:{signal:hZ}},update:l=qh({},a,{opacity:nZ,text:OY(t.title)}),exit:{opacity:eZ}},u={signal:`lerp(range("${t.scale}"), ${fZ(0,1,.5)})`};return l.x=uJ(o,u),l.y=fJ(o,u),a.angle=uJ(o,eZ,$J(s,90)),a.baseline=uJ(o,hJ(o,NX,FX),{value:NX}),l.angle=a.angle,l.baseline=a.baseline,NY(c,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),function(t,e,n,i){const r=(t,e)=>null!=t?(n.update[e]=CJ(OY(t),n.update[e]),!1):!LY(e,i),o=r(t("titleX"),"x"),s=r(t("titleY"),"y");n.enter.auto=s===o?OY(s):uJ(e,OY(s),OY(o))}(r,o,c,n),c.update.align=CJ(c.update.align,a.align),c.update.angle=CJ(c.update.angle,a.angle),c.update.baseline=CJ(c.update.baseline,a.baseline),pZ({type:aZ,role:HY,style:VX,from:i,encode:c},n)}function OJ(t,e){const n=function(t,e){var n,i,r,o=e.config,s=o.style,a=o.axis,l="band"===e.scaleType(t.scale)&&o.axisBand,c=t.orient;if(SG(c)){const t=SJ([o.axisX,o.axisY]),e=SJ([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},t))n[r]=uJ(c,EJ(r,o.axisX,a,s),EJ(r,o.axisY,a,s));for(r of(i={},e))i[r]=wJ(c.signal,EJ(r,o.axisTop,a,s),EJ(r,o.axisBottom,a,s),EJ(r,o.axisLeft,a,s),EJ(r,o.axisRight,a,s))}else n=c===FX||c===NX?o.axisX:o.axisY,i=o["axis"+c[0].toUpperCase()+c.slice(1)];return n||i||l?qh({},a,n,i,l):a}(t,e),i=t.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,l=cZ(t,n),c=function(t){const e=t("tickBand");let n,i,r=t("tickOffset");return e?e.signal?(n={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${e.signal}) === 'extent'`},lh(r)||(r={signal:`(${e.signal}) === 'extent' ? 0 : ${r}`})):"extent"===e?(n=1,i=!0,r=0):(n=.5,i=!1):(n=t("bandPosition"),i=t("tickExtra")),{extra:i,band:n,offset:r}}(l),u={scale:t.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=t.title},f=bG(e.add(WG({},[u]))),h=bG(e.add(UG({scale:e.scaleRef(t.scale),extra:e.property(c.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),d=[];let p;return u.grid&&d.push(DJ(t,n,i.grid,h,c)),u.ticks&&(p=l("tickSize"),d.push(function(t,e,n,i,r,o){const s=cZ(t,e),a=t.orient,l=cJ(a,-1,1);let c,u,f;const h={enter:c={opacity:eZ},update:f={opacity:nZ},exit:u={opacity:eZ}};NY(h,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const d=OY(r);d.mult=l;const p={scale:t.scale,field:WX,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=uJ(a,eZ,p),f.y2=c.y2=uJ(a,d),u.x=uJ(a,p),f.x=c.x=fJ(a,eZ,p),f.x2=c.x2=fJ(a,d),u.y=fJ(a,p),pZ({type:oZ,role:WY,key:WX,from:i,encode:h},n)}(t,n,i.ticks,h,p,c))),u.labels&&(p=u.ticks?p:0,d.push(function(t,e,n,i,r,o){const s=cZ(t,e),a=t.orient,l=t.scale,c=cJ(a,-1,1),u=AG(s("labelFlush")),f=AG(s("labelFlushOffset")),h=s("labelAlign"),d=s("labelBaseline");let p,g=0===u||!!u;const m=OY(r);m.mult=c,m.offset=OY(s("labelPadding")||0),m.offset.mult=c;const y={scale:l,field:WX,band:.5,offset:dZ(o.offset,s("labelOffset"))},v=uJ(a,g?AJ(l,u,'"left"','"right"','"center"'):{value:"center"},dJ(a,"left","right")),b=uJ(a,hJ(a,"bottom","top"),g?AJ(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),x=AJ(l,u,`-(${f})`,f,0);g=g&&f;const _={opacity:eZ,x:uJ(a,y,m),y:fJ(a,y,m)},w={enter:_,update:p={opacity:nZ,text:{field:BX},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:eZ,x:_.x,y:_.y}};NY(w,{dx:!h&&g?uJ(a,x):null,dy:!d&&g?fJ(a,x):null}),NY(w,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:h,baseline:d});const k=s("labelBound");let $=s("labelOverlap");return $=$||k?{separation:s("labelSeparation"),method:$,order:"datum.index",bound:k?{scale:l,orient:a,tolerance:k}:null}:void 0,p.align!==v&&(p.align=CJ(p.align,v)),p.baseline!==b&&(p.baseline=CJ(p.baseline,b)),pZ({type:aZ,role:qY,style:HX,key:WX,from:i,encode:w,overlap:$},n)}(t,n,i.labels,h,p,c))),u.domain&&d.push(function(t,e,n,i){const r=cZ(t,e),o=t.orient;let s,a;const l={enter:s={opacity:eZ},update:a={opacity:nZ},exit:{opacity:eZ}};NY(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const c=MJ(t,0),u=MJ(t,1);return s.x=a.x=uJ(o,c,eZ),s.x2=a.x2=uJ(o,u),s.y=a.y=fJ(o,c,eZ),s.y2=a.y2=fJ(o,u),pZ({type:oZ,role:jY,from:i,encode:l},n)}(t,n,i.domain,f)),u.title&&d.push(FJ(t,n,i.title,f)),QZ(lZ({role:BY,from:f,encode:zY(TJ(l,t),r,tZ),marks:d,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),e)}function TJ(t,e){const n={enter:{},update:{}};return NY(n,{orient:t("orient"),offset:t("offset")||0,position:DG(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function NJ(t,e,n){const i=Oh(t.signals),r=Oh(t.scales);return n||i.forEach((t=>gG(t,e))),Oh(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},i={};for(const n in t)"name"!==n&&(i[n]=AX(t[n],n,e));for(const t in n)null==i[t]&&(i[t]=AX(n[t],t,e));e.addProjection(t.name,i)}(t,e))),r.forEach((t=>function(t,e){const n=t.type||"linear";TE(n)||Hf("Unrecognized scale type: "+hd(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),Oh(t.data).forEach((t=>oJ(t,e))),r.forEach((t=>yX(t,e))),(n||i).forEach((t=>function(t,e){const n=e.getSignal(t.name);let i=t.update;t.init&&(i?Hf("Signals can not include both init and update expressions."):(i=t.init,n.initonly=!0)),i&&(i=iV(i,e),n.update=i.$expr,n.params=i.$params),t.on&&t.on.forEach((t=>PG(t,e,n.id)))}(t,e))),Oh(t.axes).forEach((t=>OJ(t,e))),Oh(t.marks).forEach((t=>QZ(t,e))),Oh(t.legends).forEach((t=>KZ(t,e))),t.title&&iJ(t.title,e),e.parseLambdas(),e}const zJ=t=>zY({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function LJ(t,e){const n=e.config,i=bG(e.root=e.add(vG())),r=function(t,e){const n=n=>DG(t[n],e[n]),i=[RJ("background",n("background")),RJ("autosize",MY(n("autosize"))),RJ("padding",FY(n("padding"))),RJ("width",n("width")||0),RJ("height",n("height")||0)],r=i.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return Oh(t.signals).forEach((t=>{Yh(r,t.name)?t=qh(r[t.name],t):i.push(t),o[t.name]=t})),Oh(e.signals).forEach((t=>{Yh(o,t.name)||Yh(r,t.name)||i.push(t)})),i}(t,n);r.forEach((t=>gG(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(WG()),s=e.add(YG(cG(zJ(t.encode),iZ,PY,t.style,e,{pulse:bG(o)}))),a=e.add(dX({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:bG(s)}));e.operators.pop(),e.pushState(bG(s),bG(a),null),NJ(t,e,r),e.operators.push(a);let l=e.add(qG({mark:i,pulse:bG(a)}));return l=e.add(cX({pulse:bG(l)})),l=e.add(fX({pulse:bG(l)})),e.addData("root",new YZ(e,o,o,l)),e}function RJ(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function PJ(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function IJ(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function BJ(t){return(ah(t)?jJ:UJ)(t)}function jJ(t){const e=t.length;let n="[";for(let i=0;i0?",":"")+(lh(e)?e.signal||BJ(e):hd(e))}return n+"]"}function UJ(t){let e,n,i="{",r=0;for(e in t)n=t[e],i+=(++r>1?",":"")+hd(e)+":"+(lh(n)?n.signal||BJ(n):hd(n));return i+"}"}PJ.prototype=IJ.prototype={parse(t){return NJ(t,this)},fork(){return new IJ(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof mG?bG(t):t;return this.add(aX({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let i,r;t&&(i=t.data||(t.data={}),r=i[e]||(i[e]=[]),r.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const i in e.index)n(e.index[i],t,"index:"+i)}return this},pushState(t,e,n){this._encode.push(bG(this.add(fX({pulse:t})))),this._parent.push(e),this._lookup.push(n?bG(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return dh(this._parent)},encode(){return dh(this._encode)},lookup(){return dh(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(rd(t))return xG(t,e);t.signal||Hf("Unsupported field reference: "+hd(t));const n=t.signal;let i=this.field[n];if(!i){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=i=bG(this.add(ZG(t)))}return i},compareRef(t){let e=!1;const n=t=>SG(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,i=Oh(t.field).map(n),r=Oh(t.order).map(n);return e?bG(this.add(HG({fields:i,orders:r}))):wG(i,r)},keyRef(t,e){let n=!1;const i=this.signals;return t=Oh(t).map((t=>SG(t)?(n=!0,bG(i[t.signal])):t)),n?bG(this.add(JG({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=$G(t.op,t.field),n=t.order||"ascending";return n.signal?bG(this.add(HG({fields:e,orders:this.signalRef(n.signal)}))):wG(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:t,type:e}),this.events[n]=i}return this.events[n]},hasOwnSignal(t){return Yh(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&Hf("Duplicate signal name: "+hd(t));const n=e instanceof mG?e:this.add(vG(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||Hf("Unrecognized signal name: "+hd(t)),this.signals[t]},signalRef(t){return this.signals[t]?bG(this.signals[t]):(Yh(this.lambdas,t)||(this.lambdas[t]=this.add(vG(null))),bG(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;en+Math.floor(r*Ub()),pdf:t=>t===Math.floor(t)&&t>=n&&t=i?1:(e-n+1)/r},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*r):NaN};return o.min(t).max(e)},randomKDE:Kb,randomLCG:function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},randomLogNormal:rx,randomMixture:ox,randomNormal:Qb,randomUniform:ux,regressionConstant:fx,regressionExp:vx,regressionLinear:mx,regressionLoess:kx,regressionLog:yx,regressionPoly:_x,regressionPow:bx,regressionQuad:xx,sampleCurve:Sx,sampleLogNormal:tx,sampleNormal:Gb,sampleUniform:sx,setRandom:function(t){Ub=t},DATE:Ag,DAY:Fg,DAYOFYEAR:Og,HOURS:Tg,MILLISECONDS:Lg,MINUTES:Ng,MONTH:Mg,QUARTER:Sg,SECONDS:zg,TIME_UNITS:Rg,WEEK:Dg,YEAR:Eg,dayofyear:Wg,timeBin:Nm,timeFloor:sm,timeInterval:hm,timeOffset:gm,timeSequence:vm,timeUnitSpecifier:jg,timeUnits:Ig,utcFloor:cm,utcInterval:dm,utcOffset:mm,utcSequence:bm,utcdayofyear:Zg,utcweek:Jg,week:Hg,format:Wv,formats:Hv,inferType:Rv,inferTypes:Pv,loader:Gv,read:Yv,responseType:Vv,typeParsers:Nv,path:_w,Bounds:xM,CanvasHandler:eF,CanvasRenderer:aF,Gradient:$S,GroupItem:wM,Handler:TA,HybridHandler:QF,HybridRenderer:ZF,Item:_M,Marks:yA,RenderType:nO,Renderer:zA,ResourceLoader:kM,SVGHandler:cF,SVGRenderer:NF,SVGStringRenderer:GF,Scenegraph:CA,boundClip:uO,boundContext:WM,boundItem:vA,boundMark:xA,boundStroke:EM,domChild:DA,domClear:AA,domCreate:SA,domFind:MA,font:cA,fontFamily:lA,fontSize:iA,intersect:oO,intersectBoxLine:eD,intersectPath:JM,intersectPoint:QM,intersectRule:tD,lineHeight:rA,markup:EF,multiLineOffset:sA,pathCurves:ES,pathEqual:dO,pathParse:OS,pathRectangle:nM,pathRender:qS,pathSymbols:YS,pathTrail:iM,point:OA,renderModule:rO,resetSVGClipId:vM,resetSVGDefIds:function(){vM(),bS=0},sceneEqual:hO,sceneFromJSON:kA,scenePickVisit:hD,sceneToJSON:wA,sceneVisit:fD,sceneZOrder:uD,serializeXML:SF,setHybridRendererOptions:function(t){XF.svgMarkTypes=t.svgMarkTypes??["text"],XF.svgOnTop=t.svgOnTop??!0,XF.debug=t.debug??!1},textMetrics:JD});var WJ={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},HJ={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>tt<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},VJ={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const YJ=Array.prototype.slice,GJ=(t,e,n)=>{const i=n?n(e[0]):e[0];return i[t].apply(i,YJ.call(e,1))};var XJ={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:(t,e,n,i,r,o,s)=>new Date(t,e||0,null!=n?n:1,i||0,r||0,o||0,s||0),date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return GJ("join",arguments)},indexof:function(){return GJ("indexOf",arguments)},lastindexof:function(){return GJ("lastIndexOf",arguments)},slice:function(){return GJ("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return GJ("substring",arguments,String)},split:function(){return GJ("split",arguments,String)},replace:function(){return GJ("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const ZJ=["view","item","group","xy","x","y"],JJ=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&JJ.add(setImmediate);const QJ={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:"datum"===n?t.datum:"event"===n?t.event:"item"===n?t.item:WJ[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,i=t(e.object);n&&(t.memberDepth+=1);const r=t(e.property);if(n&&(t.memberDepth-=1),!JJ.has(i[r]))return i[r];console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`)},CallExpression:(t,e)=>{const n=e.arguments;let i=e.callee.name;return i.startsWith("_")&&(i=i.slice(1)),"if"===i?t(n[0])?t(n[1]):t(n[2]):(t.fn[i]||XJ[i]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>HJ[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>VJ[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>"&&"===e.operator?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce(((e,n)=>{t.memberDepth+=1;const i=t(n.key);return t.memberDepth-=1,JJ.has(t(n.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):e[i]=t(n.value),e}),{})};function KJ(t,e,n,i,r,o){const s=t=>QJ[t.type](s,t);return s.memberDepth=0,s.fn=Object.create(e),s.params=n,s.datum=i,s.event=r,s.item=o,ZJ.forEach((t=>s.fn[t]=function(){return r.vega[t](...arguments)})),s(t)}var tQ={operator(t,e){const n=e.ast,i=t.functions;return t=>KJ(n,i,t)},parameter(t,e){const n=e.ast,i=t.functions;return(t,e)=>KJ(n,i,e,t)},event(t,e){const n=e.ast,i=t.functions;return t=>KJ(n,i,void 0,void 0,t)},handler(t,e){const n=e.ast,i=t.functions;return(t,e)=>{const r=e.item&&e.item.datum;return KJ(n,i,t,r,e)}},encode(t,e){const{marktype:n,channels:i}=e,r=t.functions,o="group"===n||"image"===n||"rect"===n;return(t,e)=>{const s=t.datum;let a,l=0;for(const n in i)a=KJ(i[n].ast,r,e,s,void 0,t),t[n]!==a&&(t[n]=a,l=1);return"rule"!==n&&function(t,e,n){let i;e.x2&&(e.x?(n&&t.x>t.x2&&(i=t.x,t.x=t.x2,t.x2=i),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(i=t.y,t.y=t.y2,t.y2=i),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}(t,i,o),l}}},eQ="5.16.1";function nQ(t){return!!t.or}function iQ(t){return!!t.and}function rQ(t){return!!t.not}function oQ(t,e){if(rQ(t))oQ(t.not,e);else if(iQ(t))for(const n of t.and)oQ(n,e);else if(nQ(t))for(const n of t.or)oQ(n,e);else e(t)}function sQ(t,e){return rQ(t)?{not:sQ(t.not,e)}:iQ(t)?{and:t.and.map((t=>sQ(t,e)))}:nQ(t)?{or:t.or.map((t=>sQ(t,e)))}:e(t)}const aQ=structuredClone;function lQ(t){throw new Error(t)}function cQ(t,e){const n={};for(const i of e)Yh(t,i)&&(n[i]=t[i]);return n}function uQ(t,e){const n={...t};for(const t of e)delete n[t];return n}function fQ(t){if(nd(t))return t;const e=rd(t)?t:GQ(t);if(e.length<250)return e;let n=0;for(let t=0;t0===e?t:`[${t}]`)),i=t.map(((e,n)=>t.slice(0,n+1).join("")));for(const t of i)e.add(t)}return e}function wQ(t,e){return void 0===t||void 0===e||xQ(_Q(t),_Q(e))}function kQ(t){return 0===$Q(t).length}Set.prototype.toJSON=function(){return`Set(${[...this].map((t=>GQ(t))).join(",")})`};const $Q=Object.keys,CQ=Object.values,EQ=Object.entries;function SQ(t){return!0===t||!1===t}function MQ(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function DQ(t,e){return rQ(t)?`!(${DQ(t.not,e)})`:iQ(t)?`(${t.and.map((t=>DQ(t,e))).join(") && (")})`:nQ(t)?`(${t.or.map((t=>DQ(t,e))).join(") || (")})`:e(t)}function AQ(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&AQ(t[n],e)&&delete t[n],kQ(t)}function FQ(t){return t.charAt(0).toUpperCase()+t.substr(1)}function OQ(t,e="datum"){const n=Vf(t),i=[];for(let t=1;t<=n.length;t++){const r=`[${n.slice(0,t).map(hd).join("][")}]`;i.push(`${e}${r}`)}return i.join(" && ")}function TQ(t,e="datum"){return`${e}[${hd(Vf(t).join("."))}]`}function NQ(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function zQ(t){return`${Vf(t).map(NQ).join("\\.")}`}function LQ(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function RQ(t){return`${Vf(t).join(".")}`}function PQ(t){return t?Vf(t).length:0}function IQ(...t){for(const e of t)if(void 0!==e)return e}let BQ=42;function jQ(t){const e=++BQ;return t?String(t)+e:e}function UQ(t){return qQ(t)?t:`__${t}`}function qQ(t){return t.startsWith("__")}function WQ(t){if(void 0!==t)return(t%360+360)%360}function HQ(t){return!!nd(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const VQ=Object.getPrototypeOf(structuredClone({}));function YQ(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor.name!==e.constructor.name)return!1;let n,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(i=n;0!=i--;)if(!YQ(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!YQ(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(i=n;0!=i--;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&t.valueOf!==VQ.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&t.toString!==VQ.toString)return t.toString()===e.toString();const r=Object.keys(t);if(n=r.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!=i--;){const n=r[i];if(!YQ(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function GQ(t){const e=[];return function t(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let i,r;if(Array.isArray(n)){for(r="[",i=0;ic1(t[e])?MQ(`_${e}_${EQ(t[e])}`):MQ(`_${e}_${t[e]}`))).join("")}function s1(t){return!0===t||l1(t)&&!t.binned}function a1(t){return"binned"===t||l1(t)&&!0===t.binned}function l1(t){return lh(t)}function c1(t){return t?.param}function u1(t){switch(t){case XQ:case ZQ:case mK:case hK:case dK:case pK:case _K:case vK:case bK:case xK:case gK:return 6;case wK:return 4;default:return 10}}function f1(t){return!!t?.expr}function h1(t){const e=$Q(t||{}),n={};for(const i of e)n[i]=w1(t[i]);return n}function d1(t){const{anchor:e,frame:n,offset:i,orient:r,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:h,subtitleLineHeight:d,subtitlePadding:p,...g}=t,m={...e?{anchor:e}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...void 0!==o?{angle:o}:{},...void 0!==s?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...h?{subtitleFontWeight:h}:{},...d?{subtitleLineHeight:d}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...g,...a?{fill:a}:{}},subtitleMarkConfig:cQ(t,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:m,subtitle:y}}function p1(t){return rd(t)||ah(t)&&rd(t[0])}function g1(t){return!!t?.signal}function m1(t){return!!t.step}function y1(t){return!ah(t)&&("field"in t&&"data"in t)}const v1=$Q({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),b1={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},x1=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function _1(t){const e=ah(t.condition)?t.condition.map(k1):k1(t.condition);return{...w1(t),condition:e}}function w1(t){if(f1(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function k1(t){if(f1(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function $1(t){if(f1(t)){const{expr:e,...n}=t;return{signal:e,...n}}return g1(t)?t:void 0!==t?{value:t}:void 0}function C1(t){return g1(t)?t.signal:hd(t)}function E1(t){return g1(t)?t.signal:hd(t.value)}function S1(t){return g1(t)?t.signal:null==t?null:hd(t)}function M1(t,e,n){for(const i of n){const n=F1(i,e.markDef,e.config);void 0!==n&&(t[i]=$1(n))}return t}function D1(t){return[].concat(t.type,t.style??[])}function A1(t,e,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&void 0!==e[r]?e[r]:void 0!==e[t]?e[t]:!o||r&&r!==t?F1(t,e,n,i):void 0}function F1(t,e,n,{vgChannel:i}={}){return IQ(i?O1(t,e,n.style):void 0,O1(t,e,n.style),i?n[e.type][i]:void 0,n[e.type][t],i?n.mark[i]:n.mark[t])}function O1(t,e,n){return T1(t,D1(e),n)}function T1(t,e,n){let i;e=Oh(e);for(const r of e){const e=n[r];e&&void 0!==e[t]&&(i=e[t])}return i}function N1(t,e){return Oh(t).reduce(((t,n)=>(t.field.push(t5(n,e)),t.order.push(n.sort??"ascending"),t)),{field:[],order:[]})}function z1(t,e){const n=[...t];return e.forEach((t=>{for(const e of n)if(YQ(e,t))return;n.push(t)})),n}function L1(t,e){return YQ(t,e)||!e?t:t?[...Oh(t),...Oh(e)].join(", "):e}function R1(t,e){const n=t.value,i=e.value;if(null==n||null===i)return{explicit:t.explicit,value:null};if((p1(n)||g1(n))&&(p1(i)||g1(i)))return{explicit:t.explicit,value:L1(n,i)};if(p1(n)||g1(n))return{explicit:t.explicit,value:n};if(p1(i)||g1(i))return{explicit:t.explicit,value:i};if(!(p1(n)||g1(n)||p1(i)||g1(i)))return{explicit:t.explicit,value:z1(n,i)};throw new Error("It should never reach here")}function P1(t){return`Invalid specification ${GQ(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const I1='Autosize "fit" only works for single views and layered views.';function B1(t){return`${"width"==t?"Width":"Height"} "container" only works for single views and layered views.`}function j1(t){return`${"width"==t?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==t?"x":"y"}".`}function U1(t){return t?`Dropping "fit-${t}" because spec has discrete ${i0(t)}.`:'Dropping "fit" because spec has discrete size.'}function q1(t){return`Unknown field for ${t}. Cannot calculate view size.`}function W1(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function H1(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function V1(t){return`Selection not supported for ${t} yet.`}const Y1="The same selection must be used to override scale domains in a layered view.";function G1(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}function X1(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}function Z1(t){return`Ignoring an invalid transform: ${GQ(t)}.`}function J1(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function Q1(t){return`${t}Offset dropped because ${t} is continuous`}function K1(t){return`Invalid field type "${t}".`}function t2(t,e){const{fill:n,stroke:i}=e;return`Dropping color ${t} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function e2(t,e){return`Dropping ${GQ(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}function n2(t,e,n){return`${t} dropped as it is incompatible with "${e}"${n?` when ${n}`:""}.`}function i2(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function r2(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function o2(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${"ordinal"===e?"order":"magnitude"}.`}function s2(t){return`Using unaggregated domain with raw field has no effect (${GQ(t)}).`}function a2(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function l2(t){return`Unaggregated domain is currently unsupported for log scale (${GQ(t)}).`}function c2(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function u2(t){return`The step for "${t}" is dropped because the ${"width"===t?"x":"y"} is continuous.`}const f2="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function h2(t,e){return`Invalid ${t}: ${GQ(e)}.`}function d2(t){return`1D error band does not support ${t}.`}function p2(t){return`Channel ${t} is required for "binned" bin.`}const g2=sh(ih);let m2=g2;function y2(...t){m2.warn(...t)}function v2(t){if(t&&lh(t))for(const e of E2)if(e in t)return!0;return!1}const b2=["january","february","march","april","may","june","july","august","september","october","november","december"],x2=b2.map((t=>t.substr(0,3))),_2=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],w2=_2.map((t=>t.substr(0,3)));function k2(t,e){const n=[];if(e&&void 0!==t.day&&$Q(t).length>1&&(y2(function(t){return`Dropping day from datetime ${GQ(t)} as day cannot be combined with other units.`}(t)),delete(t=aQ(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const i=e?function(t){if(HQ(t)&&(t=+t),nd(t))return t-1;{const e=t.toLowerCase(),n=b2.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=x2.indexOf(i);if(-1!==r)return r;throw new Error(h2("month",t))}}(t.month):t.month;n.push(i)}else if(void 0!==t.quarter){const i=e?function(t){if(HQ(t)&&(t=+t),nd(t))return t>4&&y2(h2("quarter",t)),t-1;throw new Error(h2("quarter",t))}(t.quarter):t.quarter;n.push(nd(i)?3*i:`${i}*3`)}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const i=e?function(t){if(HQ(t)&&(t=+t),nd(t))return t%7;{const e=t.toLowerCase(),n=_2.indexOf(e);if(-1!==n)return n;const i=e.substr(0,3),r=w2.indexOf(i);if(-1!==r)return r;throw new Error(h2("day",t))}}(t.day):t.day;n.push(nd(i)?i+1:`${i}+1`)}else n.push(1);for(const e of["hours","minutes","seconds","milliseconds"]){const i=t[e];n.push(void 0===i?0:i)}return n}function $2(t){const e=k2(t,!0).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}const C2={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},E2=$Q(C2);function S2(t){return lh(t)?t.binned:M2(t)}function M2(t){return t&&t.startsWith("binned")}function D2(t){return t.startsWith("utc")}const A2={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function F2(t){return E2.filter((e=>T2(t,e)))}function O2(t){const e=F2(t);return e[e.length-1]}function T2(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function N2(t,e,{end:n}={end:!1}){const i=OQ(e),r=D2(t)?"utc":"";let o;const s={};for(const e of E2)T2(t,e)&&(s[e]="quarter"===(a=e)?`(${r}quarter(${i})-1)`:`${r}${a}(${i})`,o=e);var a;return n&&(s[o]+="+1"),function(t){const e=k2(t,!1).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}(s)}function z2(t){if(!t)return;return`timeUnitSpecifier(${GQ(F2(t))}, ${GQ(A2)})`}function L2(t){if(!t)return;let e;return rd(t)?e=M2(t)?{unit:t.substring(6),binned:!0}:{unit:t}:lh(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),D2(e.unit)&&(e.utc=!0,e.unit=function(t){return t.substring(3)}(e.unit)),e}function R2(t,e=(t=>t)){const n=L2(t),i=O2(n.unit);if(i&&"day"!==i){const t={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:r,part:o}=I2(i,n.step);return`${e($2({...t,[o]:+t[o]+r}))} - ${e($2(t))}`}}const P2={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function I2(t,e=1){if(function(t){return!!P2[t]}(t))return{part:t,step:e};switch(t){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:3*e};case"week":return{part:"date",step:7*e}}}function B2(t){return!!t?.field&&void 0!==t.equal}function j2(t){return!!t?.field&&void 0!==t.lt}function U2(t){return!!t?.field&&void 0!==t.lte}function q2(t){return!!t?.field&&void 0!==t.gt}function W2(t){return!!t?.field&&void 0!==t.gte}function H2(t){if(t?.field){if(ah(t.range)&&2===t.range.length)return!0;if(g1(t.range))return!0}return!1}function V2(t){return!!t?.field&&(ah(t.oneOf)||ah(t.in))}function Y2(t){return V2(t)||B2(t)||H2(t)||j2(t)||q2(t)||U2(t)||W2(t)}function G2(t,e){return y5(t,{timeUnit:e,wrapTime:!0})}function X2(t,e=!0){const{field:n}=t,i=L2(t.timeUnit),{unit:r,binned:o}=i||{},s=t5(t,{expr:"datum"}),a=r?`time(${o?s:N2(r,n)})`:s;if(B2(t))return`${a}===${G2(t.equal,r)}`;if(j2(t)){return`${a}<${G2(t.lt,r)}`}if(q2(t)){return`${a}>${G2(t.gt,r)}`}if(U2(t)){return`${a}<=${G2(t.lte,r)}`}if(W2(t)){return`${a}>=${G2(t.gte,r)}`}if(V2(t))return`indexof([${function(t,e){return t.map((t=>G2(t,e)))}(t.oneOf,r).join(",")}], ${a}) !== -1`;if(function(t){return!!t?.field&&void 0!==t.valid}(t))return Z2(a,t.valid);if(H2(t)){const{range:n}=t,i=g1(n)?{signal:`${n.signal}[0]`}:n[0],o=g1(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==o&&e)return"inrange("+a+", ["+G2(i,r)+", "+G2(o,r)+"])";const s=[];return null!==i&&s.push(`${a} >= ${G2(i,r)}`),null!==o&&s.push(`${a} <= ${G2(o,r)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${GQ(t)}`)}function Z2(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function J2(t){return Y2(t)&&t.timeUnit?{...t,timeUnit:L2(t.timeUnit)}:t}function Q2(t){return"quantitative"===t||"temporal"===t}function K2(t){return"ordinal"===t||"nominal"===t}const t3="quantitative",e3="ordinal",n3="temporal",i3="nominal",r3="geojson";const o3={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},s3={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function a3(t,e){const n=s3[t],i=s3[e];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const l3={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function c3(t){return l3[t]}const u3=new Set(["linear","log","pow","sqrt","symlog"]),f3=new Set([...u3,"time","utc"]);function h3(t){return u3.has(t)}const d3=new Set(["quantile","quantize","threshold"]),p3=new Set([...f3,...d3,"sequential","identity"]),g3=new Set(["ordinal","bin-ordinal","point","band"]);function m3(t){return g3.has(t)}function y3(t){return p3.has(t)}function v3(t){return f3.has(t)}function b3(t){return d3.has(t)}function x3(t){return t?.param}const{type:_3,domain:w3,range:k3,rangeMax:$3,rangeMin:C3,scheme:E3,...S3}={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},M3=$Q(S3);function D3(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return v3(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return v3(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return v3(t);case"nice":return v3(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return y3(t)&&!dQ(["log","time","utc","threshold","quantile"],t)}}function A3(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return PK(t)?void 0:`Cannot use the scale property "${e}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const F3={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},O3=F3.arc,T3=F3.area,N3=F3.bar,z3=F3.image,L3=F3.line,R3=F3.point,P3=F3.rect,I3=F3.rule,B3=F3.text,j3=F3.tick,U3=F3.trail,q3=F3.circle,W3=F3.square,H3=F3.geoshape;function V3(t){return["line","area","trail"].includes(t)}function Y3(t){return["rect","bar","image","arc"].includes(t)}const G3=new Set($Q(F3));function X3(t){return t.type}const Z3=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],J3=$Q({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Q3=$Q({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function K3(t){return t&&null!=t.band}const t7={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},e7={binSpacing:1,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},n7={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5};function i7(t){const{channel:e,channelDef:n,markDef:i,scale:r,config:o}=t,s=l7(t);return B7(n)&&!n1(n.aggregate)&&r&&v3(r.get("type"))?function({fieldDef:t,channel:e,markDef:n,ref:i,config:r}){if(V3(n.type))return i;const o=A1("invalid",n,r);if(null===o)return[r7(t,e),i];return i}({fieldDef:n,channel:e,markDef:i,ref:s,config:o}):s}function r7(t,e){return{test:o7(t,!0),..."y"===t0(e)?{field:{group:"height"}}:{value:0}}}function o7(t,e=!0){return Z2(rd(t)?t:t5(t,{expr:"datum"}),!e)}function s7(t,e,n,i){const r={};if(e&&(r.scale=e),U7(t)){const{datum:e}=t;v2(e)?r.signal=$2(e):g1(e)?r.signal=e.signal:f1(e)?r.signal=e.expr:r.value=e}else r.field=t5(t,n);if(i){const{offset:t,band:e}=i;t&&(r.offset=t),e&&(r.band=e)}return r}function a7({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!g1(s)&&0MQ(`${"unit"===t?"":`_${t}_`}${n[t]}`))).join(""):(e?"utc":"")+"timeunit"+$Q(n).map((t=>MQ(`_${t}_${n[t]}`))).join("")}(l),r=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(e.suffix??""))}i&&(n=n?`${i}_${n}`:i)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),e.forAs?RQ(n):e.expr?TQ(n,e.expr)+o:zQ(n)+o}function e5(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return B7(t)&&!!t.bin;case"temporal":return!1}throw new Error(K1(t.type))}const n5=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:i,field:r}=t;if(K0(e))return`${r} for argmax(${e.argmax})`;if(Q0(e))return`${r} for argmin(${e.argmin})`;const o=i&&!S2(i)?L2(i):void 0,s=e||o?.unit||o?.maxbins&&"timeunit"||s1(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}(t);default:return function(t,e){const{field:n,bin:i,timeUnit:r,aggregate:o}=t;if("count"===o)return e.countTitle;if(s1(i))return`${n} (binned)`;if(r&&!S2(r)){const t=L2(r)?.unit;if(t)return`${n} (${F2(t).join("-")})`}else if(o)return K0(o)?`${n} for max ${o.argmax}`:Q0(o)?`${n} for min ${o.argmin}`:`${FQ(o)} of ${n}`;return n}(t,e)}};let i5=n5;function r5(t){i5=t}function o5(t,e,{allowDisabling:n,includeDefault:i=!0}){const r=s5(t)?.title;if(!B7(t))return r??t.title;const o=t,s=i?a5(o,e):void 0;return n?IQ(r,o.title,s):r??o.title??s}function s5(t){return Z7(t)&&t.axis?t.axis:J7(t)&&t.legend?t.legend:D7(t)&&t.header?t.header:void 0}function a5(t,e){return i5(t,e)}function l5(t){if(Q7(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{const e=s5(t)??{},{format:n,formatType:i}=e;return{format:n,formatType:i}}}function c5(t){return B7(t)?t:P7(t)?t.condition:void 0}function u5(t){return V7(t)?t:I7(t)?t.condition:void 0}function f5(t,e,n,i={}){if(rd(t)||nd(t)||Kh(t)){return y2(function(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${GQ(n)}}.`}(e,rd(t)?"string":nd(t)?"number":"boolean",t)),{value:t}}return V7(t)?h5(t,e,n,i):I7(t)?{...t,condition:h5(t.condition,e,n,i)}:t}function h5(t,e,n,i){if(Q7(t)){const{format:r,formatType:o,...s}=t;if(u7(o)&&!n.customFormatTypes)return y2(J1(e)),h5(s,e,n,i)}else{const r=Z7(t)?"axis":J7(t)?"legend":D7(t)?"header":null;if(r&&t[r]){const{format:o,formatType:s,...a}=t[r];if(u7(s)&&!n.customFormatTypes)return y2(J1(e)),h5({...t,[r]:a},e,n,i)}}return B7(t)?d5(t,e,i):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=nd(n)?"quantitative":rd(n)?"nominal":v2(n)?"temporal":void 0,{...t,type:e}}(t)}function d5(t,e,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=t,a={...t};if(n||!i||t1(i)||K0(i)||Q0(i)||(y2(function(t){return`Invalid aggregation operator "${t}".`}(i)),delete a.aggregate),r&&(a.timeUnit=L2(r)),s&&(a.field=`${s}`),s1(o)&&(a.bin=p5(o,e)),a1(o)&&!E0(e)&&y2(function(t){return`Channel ${t} should not be used with "binned" bin.`}(e)),Y7(a)){const{type:t}=a,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case t3:return"quantitative";case"t":case n3:return"temporal";case"o":case e3:return"ordinal";case"n":case i3:return"nominal";case r3:return"geojson"}}(t);t!==e&&(a.type=e),"quantitative"!==t&&n1(i)&&(y2(function(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}(t,i)),a.type="quantitative")}else if(!KK(e)){const t=function(t,e){switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(O7(t)&&ah(t.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=t;if(r)return"temporal";if(i||n&&!K0(n)&&!Q0(n))return"quantitative";if(X7(t)&&t.scale?.type)switch(s3[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(a,e);a.type=t}if(Y7(a)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case XQ:case ZQ:case JQ:return e5(t)?g5:{compatible:!1,warning:i2(e)};case QQ:case KQ:case nK:case iK:case hK:case dK:case pK:case kK:case CK:case EK:case SK:case MK:case DK:case yK:case sK:case rK:case AK:return g5;case cK:case fK:case lK:case uK:return n!==t3?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:g5;case vK:case bK:case xK:case _K:case mK:case aK:case oK:case tK:case eK:return"nominal"!==n||t.sort?g5:{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`};case gK:case wK:return e5(t)||function(t){return X7(t)&&b3(t.scale?.type)}(t)?g5:{compatible:!1,warning:r2(e)};case $K:return"nominal"!==t.type||"sort"in t?g5:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(a,e)||{};!1===t&&y2(n)}if(O7(a)&&rd(a.sort)){const{sort:t}=a;if($7(t))return{...a,sort:{encoding:t}};const e=t.substr(1);if("-"===t.charAt(0)&&$7(e))return{...a,sort:{encoding:e,order:"descending"}}}if(D7(a)){const{header:t}=a;if(t){const{orient:e,...n}=t;if(e)return{...a,header:{...n,labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e}}}}return a}function p5(t,e){return Kh(t)?{maxbins:u1(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:{...t,maxbins:u1(e)}}const g5={compatible:!0};function m5(t){const{formatType:e}=l5(t);return"time"===e||!e&&function(t){return t&&("temporal"===t.type||B7(t)&&!!t.timeUnit)}(t)}function y5(t,{timeUnit:e,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const o=e&&L2(e)?.unit;let s,a=o||"temporal"===n;return f1(t)?s=t.expr:g1(t)?s=t.signal:v2(t)?(a=!0,s=$2(t)):(rd(t)||nd(t))&&a&&(s=`datetime(${GQ(t)})`,function(t){return!!C2[t]}(o)&&(nd(t)&&t<1e4||rd(t)&&isNaN(Date.parse(t)))&&(s=$2({[o]:t}))),s?i&&a?`time(${s})`:s:r?void 0:GQ(t)}function v5(t,e){const{type:n}=t;return e.map((e=>{const i=y5(e,{timeUnit:B7(t)&&!S2(t.timeUnit)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:e}))}function b5(t,e){return s1(t.bin)?W0(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const x5={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function _5(t){return t?.condition}const w5=["domain","grid","labels","ticks","title"],k5={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},$5={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},C5={...$5,style:1,labelExpr:1,encoding:1};function E5(t){return!!C5[t]}const S5=$Q({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function M5(t){return"mark"in t}class D5{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!M5(t)&&function(t){return X3(t)?t.type:t}(t.mark)===this.name}}function A5(t,e){const n=t&&t[e];return!!n&&(ah(n)?pQ(n,(t=>!!t.field)):B7(n)||P7(n))}function F5(t,e){const n=t&&t[e];return!!n&&(ah(n)?pQ(n,(t=>!!t.field)):B7(n)||U7(n)||I7(n))}function O5(t,e){if(E0(e)){const n=t[e];if((B7(n)||U7(n))&&(K2(n.type)||B7(n)&&n.timeUnit)){return F5(t,o0(e))}}return!1}function T5(t){return pQ(UK,(e=>{if(A5(t,e)){const n=t[e];if(ah(n))return pQ(n,(t=>!!t.aggregate));{const t=c5(n);return t&&!!t.aggregate}}return!1}))}function N5(t,e){const n=[],i=[],r=[],o=[],s={};return R5(t,((a,l)=>{if(B7(a)){const{field:c,aggregate:u,bin:f,timeUnit:h,...d}=a;if(u||h||f){const t=s5(a),p=t?.title;let g=t5(a,{forAs:!0});const m={...p?[]:{title:o5(a,e,{allowDisabling:!0})},...d,field:g};if(u){let t;if(K0(u)?(t="argmax",g=t5({op:"argmax",field:u.argmax},{forAs:!0}),m.field=`${g}.${c}`):Q0(u)?(t="argmin",g=t5({op:"argmin",field:u.argmin},{forAs:!0}),m.field=`${g}.${c}`):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(t=u),t){const e={op:t,as:g};c&&(e.field=c),o.push(e)}}else if(n.push(g),Y7(a)&&s1(f)){if(i.push({bin:f,field:c,as:g}),n.push(t5(a,{binSuffix:"end"})),b5(a,l)&&n.push(t5(a,{binSuffix:"range"})),E0(l)){const t={field:`${g}_end`};s[`${l}2`]=t}m.bin="binned",KK(l)||(m.type=t3)}else if(h&&!S2(h)){r.push({timeUnit:h,field:c,as:g});const t=Y7(a)&&a.type!==n3&&"time";t&&(l===kK||l===SK?m.formatType=t:!function(t){return!!w0[t]}(l)?E0(l)&&(m.axis={formatType:t,...m.axis}):m.legend={formatType:t,...m.legend})}s[l]=m}else n.push(c),s[l]=t[l]}else s[l]=t[l]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function z5(t,e,n){const i=H0(e,n);if(!i)return!1;if("binned"===i){const n=t[e===tK?QQ:KQ];return!!(B7(n)&&B7(t[e])&&a1(n.bin))}return!0}function L5(t,e){const n={};for(const i of $Q(t)){const r=f5(t[i],i,e,{compositeMark:!0});n[i]=r}return n}function R5(t,e,n){if(t)for(const i of $Q(t)){const r=t[i];if(ah(r))for(const t of r)e.call(n,t,i);else e.call(n,r,i)}}function P5(t,e){return $Q(e).reduce(((n,i)=>{switch(i){case QQ:case KQ:case MK:case AK:case DK:case tK:case eK:case nK:case iK:case sK:case aK:case rK:case oK:case lK:case cK:case uK:case fK:case kK:case gK:case yK:case SK:return n;case $K:if("line"===t||"trail"===t)return n;case CK:case EK:{const t=e[i];if(ah(t)||B7(t))for(const e of Oh(t))e.aggregate||n.push(t5(e,{}));return n}case mK:if("trail"===t)return n;case hK:case dK:case pK:case vK:case bK:case xK:case wK:case _K:{const t=c5(e[i]);return t&&!t.aggregate&&n.push(t5(t,{})),n}}}),[])}function I5(t,e,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=t.map((({fieldPrefix:t,titlePrefix:n})=>{const r=i?` of ${B5(e)}`:"";return{field:t+e.field,type:e.type,title:g1(n)?{signal:`${n}"${escape(r)}"`}:n+r}})),o=function(t){const e=[];for(const n of $Q(t))if(A5(t,n)){const i=Oh(t[n]);for(const t of i)B7(t)?e.push(t):P7(t)&&e.push(t.condition)}return e}(n).map(K7);return{tooltip:[...r,...vQ(o,fQ)]}}function B5(t){const{title:e,field:n}=t;return IQ(e,n)}function j5(t,e,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u,extraEncoding:f={}})=>{const h=B5(n);return U5(t,a,r,{mark:l,encoding:{[e]:{field:`${c}_${n.field}`,type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==s?{axis:s}:{}},...rd(u)?{[`${e}2`]:{field:`${u}_${n.field}`}}:{},...i,...f}})}}function U5(t,e,n,i){const{clip:r,color:o,opacity:s}=t,a=t.type;return t[e]||void 0===t[e]&&n[e]?[{...i,mark:{...n[e],...r?{clip:r}:{},...o?{color:o}:{},...s?{opacity:s}:{},...X3(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(e)}`,...Kh(t[e])?{}:t[e]}}]:[]}function q5(t,e,n){const{encoding:i}=t,r="vertical"===e?"y":"x",o=i[r],s=i[`${r}2`],a=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:W5(o,n),continuousAxisChannelDef2:W5(s,n),continuousAxisChannelDefError:W5(a,n),continuousAxisChannelDefError2:W5(l,n),continuousAxis:r}}function W5(t,e){if(t?.aggregate){const{aggregate:n,...i}=t;return n!==e&&y2(function(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}(n,e)),i}return t}function H5(t,e){const{mark:n,encoding:i}=t,{x:r,y:o}=i;if(X3(n)&&n.orient)return n.orient;if(q7(r)){if(q7(o)){const t=B7(r)&&r.aggregate,n=B7(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return m5(o)&&!m5(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(q7(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}const V5="boxplot",Y5=new D5(V5,X5);function G5(t){return nd(t)?"tukey":t}function X5(t,{config:e}){t={...t,encoding:L5(t.encoding,e)};const{mark:n,encoding:i,params:r,projection:o,...s}=t,a=X3(n)?n:{type:n};r&&y2(V1("boxplot"));const l=a.extent??e.boxplot.extent,c=A1("size",a,e),u=a.invalid,f=G5(l),{bins:h,timeUnits:d,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:w}=function(t,e,n){const i=H5(t,V5),{continuousAxisChannelDef:r,continuousAxis:o}=q5(t,i,V5),s=r.field,a=G5(e),l=[...Z5(s),{op:"median",field:s,as:`mid_box_${s}`},{op:"min",field:s,as:("min-max"===a?"lower_whisker_":"min_")+s},{op:"max",field:s,as:("min-max"===a?"upper_whisker_":"max_")+s}],c="min-max"===a||"tukey"===a?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:`iqr_${s}`},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${e}, datum["max_${s}"])`,as:`upper_whisker_${s}`},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${e}, datum["min_${s}"])`,as:`lower_whisker_${s}`}],{[o]:u,...f}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:d}=function(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let i,r;if(ah(e)){for(const t of e)t.aggregate?(i||(i=[]),i.push(t)):(r||(r=[]),r.push(t));i&&(n.tooltip=i)}else e.aggregate?n.tooltip=e:r=e;return ah(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:v}=N5(d,n),b="vertical"===i?"horizontal":"vertical",x=i,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...c];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:h}}(t,l,e),{color:k,size:$,...C}=b,E=t=>j5(a,m,g,t,e.boxplot),S=E(C),M=E(b),D=E({...C,...$?{size:$}:{}}),A=I5([{fieldPrefix:"min-max"===f?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===f?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),F={type:"tick",color:"black",opacity:1,orient:x,invalid:u,aria:!1},O="min-max"===f?A:I5([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),T=[...S({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O}),...S({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O}),...S({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:O}),...S({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:O})],N=[..."tukey"!==f?T:[],...M({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:_,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:A}),...D({partName:"median",mark:{type:"tick",invalid:u,...lh(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...c?{size:c}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:A})];if("min-max"===f)return{...s,transform:(s.transform??[]).concat(p),layer:N};const z=`datum["lower_box_${g.field}"]`,L=`datum["upper_box_${g.field}"]`,R=`(${L} - ${z})`,P=`${z} - ${l} * ${R}`,I=`${L} + ${l} * ${R}`,B=`datum["${g.field}"]`,j={joinaggregate:Z5(g.field),groupby:y},U={transform:[{filter:`(${P} <= ${B}) && (${B} <= ${I})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...v],groupby:y}],layer:T},{tooltip:q,...W}=C,{scale:H,axis:V}=g,Y=B5(g),G=uQ(V,["title"]),X=U5(a,"outliers",e.boxplot,{transform:[{filter:`(${B} < ${P}) || (${B} > ${I})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...void 0!==Y?{title:Y}:{},...void 0!==H?{scale:H}:{},...kQ(G)?{}:{axis:G}},...W,...k?{color:k}:{},...w?{tooltip:w}:{}}})[0];let Z;const J=[...h,...d,j];return X?Z={transform:J,layer:[X,U]}:(Z=U,Z.transform.unshift(...J)),{...s,layer:[Z,{transform:p,layer:N}]}}function Z5(t){return[{op:"q1",field:t,as:`lower_box_${t}`},{op:"q3",field:t,as:`upper_box_${t}`}]}const J5="errorbar",Q5=new D5(J5,K5);function K5(t,{config:e}){t={...t,encoding:L5(t.encoding,e)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=e6(t,J5,e);delete o.size;const u=j5(a,r,i,o,e.errorbar),f=a.thickness,h=a.size,d={type:"tick",orient:s,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==h?{size:h}:{}},p=[...u({partName:"ticks",mark:d,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:d,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function t6(t,e){const{encoding:n}=t;if(function(t){return(V7(t.x)||V7(t.y))&&!V7(t.x2)&&!V7(t.y2)&&!V7(t.xError)&&!V7(t.xError2)&&!V7(t.yError)&&!V7(t.yError2)}(n))return{orient:H5(t,e),inputType:"raw"};const i=function(t){return V7(t.x2)||V7(t.y2)}(n),r=function(t){return V7(t.xError)||V7(t.xError2)||V7(t.yError)||V7(t.yError2)}(n),o=n.x,s=n.y;if(i){if(r)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const t=n.x2,i=n.y2;if(V7(t)&&V7(i))throw new Error(`${e} cannot have both x2 and y2`);if(V7(t)){if(q7(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}if(V7(i)){if(q7(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}{const t=n.xError,i=n.xError2,r=n.yError,a=n.yError2;if(V7(i)&&!V7(t))throw new Error(`${e} cannot have xError2 without xError`);if(V7(a)&&!V7(r))throw new Error(`${e} cannot have yError2 without yError`);if(V7(t)&&V7(r))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(V7(t)){if(q7(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(V7(r)){if(q7(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function e6(t,e,n){const{mark:i,encoding:r,params:o,projection:s,...a}=t,l=X3(i)?i:{type:i};o&&y2(V1(e));const{orient:c,inputType:u}=t6(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:h,continuousAxisChannelDefError:d,continuousAxisChannelDefError2:p,continuousAxis:g}=q5(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(t,e,n,i,r,o,s,a){let l=[],c=[];const u=e.field;let f,h=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":a.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!=("iqr"===n)&&y2(function(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}(e,n,s)),"stderr"===n||"stdev"===n)l=[{op:n,field:u,as:`extent_${u}`},{op:e,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:FQ(e)},{fieldPrefix:"upper_",titlePrefix:n6(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:n6(e,n,"-")}],h=!0;else{let t,e,i;"ci"===n?(t="mean",e="ci0",i="ci1"):(t="median",e="q1",i="q3"),l=[{op:e,field:u,as:`lower_${u}`},{op:i,field:u,as:`upper_${u}`},{op:t,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:o5({field:u,aggregate:i,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:o5({field:u,aggregate:e,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:o5({field:u,aggregate:t,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&y2(function(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}(t.center,t.extent)),"aggregated-upper-lower"===o?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${i.field}"]`,as:`upper_${u}`}],r?c.push({calculate:`datum["${u}"] + datum["${r.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${i.field}"]`,as:`lower_${u}`}));for(const t of c)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:LQ(LQ(t.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:h}}(l,f,h,d,p,u,e,n),{[g]:x,["x"===g?"x2":"y2"]:_,["x"===g?"xError":"yError"]:w,["x"===g?"xError2":"yError2"]:k,...$}=r,{bins:C,timeUnits:E,aggregate:S,groupby:M,encoding:D}=N5($,n),A=[...S,...m],F="raw"!==u?[]:M,O=I5(v,f,D,b);return{transform:[...a.transform??[],...C,...E,...0===A.length?[]:[{aggregate:A,groupby:F}],...y],groupby:F,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:D,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:O}}function n6(t,e,n){return`${FQ(t)} ${n} ${e}`}const i6="errorband",r6=new D5(i6,o6);function o6(t,{config:e}){t={...t,encoding:L5(t.encoding,e)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=e6(t,i6,e),c=s,u=j5(c,r,i,o,e.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y;let h={type:f?"area":"rect"},d={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(h={...h,...p,ariaRoleDescription:"errorband"},d={...d,...p,aria:!1}):c.interpolate?y2(d2("interpolate")):c.tension&&y2(d2("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:d,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:d,positionPrefix:"upper",extraEncoding:l})]}}const s6={};function a6(t,e,n){const i=new D5(t,e);s6[t]={normalizer:i,parts:n}}a6(V5,X5,["box","median","outliers","rule","ticks"]),a6(J5,K5,["ticks","rule"]),a6(i6,o6,["band","borders"]);const l6=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],c6={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},u6={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},f6=$Q(c6),h6=$Q(u6),d6=$Q({header:1,headerRow:1,headerColumn:1,headerFacet:1}),p6=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],g6="_vgsid_",m6={point:{on:"click",fields:[g6],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function y6(t){return"legend"===t||!!t?.legend}function v6(t){return y6(t)&&lh(t)}function b6(t){return!!t?.select}function x6(t){const e=[];for(const n of t||[]){if(b6(n))continue;const{expr:t,bind:i,...r}=n;if(i&&t){const n={...r,bind:i,init:t};e.push(n)}else{const n={...r,...t?{update:t}:{},...i?{bind:i}:{}};e.push(n)}}return e}function _6(t){return"concat"in t}function w6(t){return"vconcat"in t}function k6(t){return"hconcat"in t}function $6({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function C6(t){return lh(t)&&void 0!==t.step}function E6(t){return t.view||t.width||t.height}const S6=$Q({align:1,bounds:1,center:1,columns:1,spacing:1});function M6(t,e){return t[e]??t["width"===e?"continuousWidth":"continuousHeight"]}function D6(t,e){const n=A6(t,e);return C6(n)?n.step:F6}function A6(t,e){return IQ(t[e]??t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const F6=20,O6={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:F6},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:e7,circle:{},geoshape:{},image:{},line:{},point:{},rect:n7,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:m6,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},T6=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],N6={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},z6={blue:T6[0],orange:T6[1],red:T6[2],teal:T6[3],green:T6[4],yellow:T6[5],purple:T6[6],pink:T6[7],brown:T6[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function L6(t){const e=$Q(t||{}),n={};for(const i of e){const e=t[i];n[i]=_5(e)?_1(e):w1(e)}return n}const R6=[...Q3,...S5,...d6,"background","padding","legend","lineBreak","scale","style","title","view"];function P6(t={}){const{color:e,font:n,fontSize:i,selection:r,...o}=t,s=uh({},aQ(O6),n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(t={}){return{signals:[{name:"color",value:lh(t)?{...z6,...t}:z6}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(e):{},i?function(t){return{signals:[{name:"fontSize",value:lh(t)?{...N6,...t}:N6}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},o||{});r&&fh(s,"selection",r,!0);const a=uQ(s,R6);for(const t of["background","lineBreak","padding"])s[t]&&(a[t]=w1(s[t]));for(const t of Q3)s[t]&&(a[t]=h1(s[t]));for(const t of S5)s[t]&&(a[t]=L6(s[t]));for(const t of d6)s[t]&&(a[t]=h1(s[t]));return s.legend&&(a.legend=h1(s.legend)),s.scale&&(a.scale=h1(s.scale)),s.style&&(a.style=function(t){const e=$Q(t),n={};for(const i of e)n[i]=L6(t[i]);return n}(s.style)),s.title&&(a.title=h1(s.title)),s.view&&(a.view=h1(s.view)),a}const I6=new Set(["view",...G3]),B6=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],j6={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]};function U6(t){t=aQ(t);for(const e of B6)delete t[e];if(t.axis)for(const e in t.axis)_5(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of l6)delete t.legend[e];if(t.mark){for(const e of J3)delete t.mark[e];t.mark.tooltip&&lh(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(x6(t.params)),delete t.params);for(const e of I6){for(const n of J3)delete t[e][n];const n=j6[e];if(n)for(const i of n)delete t[e][i];q6(t,e)}for(const e of $Q(s6))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:i}=d1(t.title);kQ(e)||(t.style["group-title"]={...t.style["group-title"],...e});kQ(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n});kQ(i)?delete t.title:t.title=i}(t);for(const e in t)lh(t[e])&&kQ(t[e])&&delete t[e];return kQ(t)?void 0:t}function q6(t,e,n,i){"view"===e&&(n="cell");const r={...i?t[e][i]:t[e],...t.style[n??e]};kQ(r)||(t.style[n??e]=r),i||delete t[e]}function W6(t){return"layer"in t}class H6{map(t,e){return A7(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):k6(t)?this.mapHConcat(t,e):w6(t)?this.mapVConcat(t,e):_6(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(W6(t))return this.mapLayer(t,e);if(M5(t))return this.mapUnit(t,e);throw new Error(P1(t))}mapLayer(t,e){return{...t,layer:t.layer.map((t=>this.mapLayerOrUnit(t,e)))}}mapHConcat(t,e){return{...t,hconcat:t.hconcat.map((t=>this.map(t,e)))}}mapVConcat(t,e){return{...t,vconcat:t.vconcat.map((t=>this.map(t,e)))}}mapConcat(t,e){const{concat:n,...i}=t;return{...i,concat:n.map((t=>this.map(t,e)))}}mapFacet(t,e){return{...t,spec:this.map(t.spec,e)}}mapRepeat(t,e){return{...t,spec:this.map(t.spec,e)}}}const V6={zero:1,center:1,normalize:1};const Y6=new Set([O3,N3,T3,I3,R3,q3,W3,L3,B3,j3]),G6=new Set([N3,T3,O3]);function X6(t){return B7(t)&&"quantitative"===j7(t)&&!t.bin}function Z6(t,e,{orient:n,type:i}){const r="x"===e?"y":"radius",o="x"===e,s=t[e],a=t[r];if(B7(s)&&B7(a))if(X6(s)&&X6(a)){if(s.stack)return e;if(a.stack)return r;const t=B7(s)&&!!s.aggregate;if(t!==(B7(a)&&!!a.aggregate))return t?e:r;if(o&&["bar","area"].includes(i)){if("vertical"===n)return r;if("horizontal"===n)return e}}else{if(X6(s))return e;if(X6(a))return r}else{if(X6(s))return e;if(X6(a))return r}}function J6(t,e){const n=X3(t)?t:{type:t},i=n.type;if(!Y6.has(i))return null;const r=Z6(e,"x",n)||Z6(e,"theta",n);if(!r)return null;const o=e[r],s=B7(o)?t5(o,{}):void 0,a=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(r),l=[],c=new Set;if(e[a]){const t=e[a],n=B7(t)?t5(t,{}):void 0;n&&n!==s&&(l.push(a),c.add(n))}const u="x"===a?"xOffset":"yOffset",f=e[u],h=B7(f)?t5(f,{}):void 0;h&&h!==s&&(l.push(u),c.add(h));const d=k0.reduce(((t,n)=>{if("tooltip"!==n&&A5(e,n)){const i=e[n];for(const e of Oh(i)){const i=c5(e);if(i.aggregate)continue;const r=t5(i,{});r&&c.has(r)||t.push({channel:n,fieldDef:i})}}return t}),[]);let p;return void 0!==o.stack?p=Kh(o.stack)?o.stack?"zero":null:o.stack:G6.has(i)&&(p="zero"),p&&p in V6?T5(e)&&0===d.length?null:o?.scale?.type&&o?.scale?.type!==o3.LINEAR?(o?.stack&&y2(function(t){return`Cannot stack non-linear scale (${t}).`}(o.scale.type)),null):V7(e[n0(r)])?(void 0!==o.stack&&y2(`Cannot stack "${g=r}" if there is already "${g}2".`),null):(B7(o)&&o.aggregate&&!i1.has(o.aggregate)&&y2(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:l,groupbyFields:c,fieldChannel:r,impute:null!==o.impute&&V3(i),stackBy:d,offset:p}):null;var g}function Q6(t,e,n){const i=h1(t),r=A1("orient",i,n);if(i.orient=function(t,e,n){switch(t){case R3:case q3:case W3:case B3:case P3:case z3:return}const{x:i,y:r,x2:o,y2:s}=e;switch(t){case N3:if(B7(i)&&(a1(i.bin)||B7(r)&&r.aggregate&&!i.aggregate))return"vertical";if(B7(r)&&(a1(r.bin)||B7(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(B7(i)&&i.type===t3&&!s1(i.bin)||H7(i))&&B7(r)&&a1(r.bin)?"horizontal":"vertical";if(!s)return(B7(r)&&r.type===t3&&!s1(r.bin)||H7(r))&&B7(i)&&a1(i.bin)?"vertical":"horizontal"}case I3:if(o&&(!B7(i)||!a1(i.bin))&&s&&(!B7(r)||!a1(r.bin)))return;case T3:if(s)return B7(r)&&a1(r.bin)?"horizontal":"vertical";if(o)return B7(i)&&a1(i.bin)?"vertical":"horizontal";if(t===I3){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case L3:case j3:{const e=W7(i),o=W7(r);if(n)return n;if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o)return"vertical";{const t=Y7(i)&&i.type===n3,e=Y7(r)&&r.type===n3;if(t&&!e)return"vertical";if(!t&&e)return"horizontal"}return}}return"vertical"}(i.type,e,r),void 0!==r&&r!==i.orient&&y2(`Specified orient "${i.orient}" overridden with "${r}".`),"bar"===i.type&&i.orient){const t=A1("cornerRadiusEnd",i,n);if(void 0!==t){const n="horizontal"===i.orient&&e.x2||"vertical"===i.orient&&e.y2?["cornerRadius"]:t7[i.orient];for(const e of n)i[e]=t;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===A1("opacity",i,n)&&(i.opacity=function(t,e){if(dQ([R3,j3,q3,W3],t)&&!T5(e))return.7;return}(i.type,e));return void 0===A1("cursor",i,n)&&(i.cursor=function(t,e,n){if(e.href||t.href||A1("href",t,n))return"pointer";return t.cursor}(i,e,n)),i}function K6(t){const{point:e,line:n,...i}=t;return $Q(i).length>1?i:i.type}function t4(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:uQ(t[e],["point","line"])});return t}function e4(t,e={},n){return"transparent"===t.point?{opacity:0}:t.point?lh(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?lh(e.point)?e.point:{}:void 0}function n4(t,e={}){return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class i4{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(M5(t)){const{mark:n,encoding:i}=t,r=X3(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!e4(r,e[r.type],i);case"area":return!!e4(r,e[r.type],i)||!!n4(r,e[r.type])}}return!1}run(t,e,n){const{config:i}=e,{params:r,projection:o,mark:s,name:a,encoding:l,...c}=t,u=L5(l,i),f=X3(s)?s:{type:s},h=e4(f,i[f.type],u),d="area"===f.type&&n4(f,i[f.type]),p=[{name:a,...r?{params:r}:{},mark:K6({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:uQ(u,["shape"])}],g=J6(Q6(f,u,i),u);let m=u;if(g){const{fieldChannel:t,offset:e}=g;m={...u,[t]:{...u[t],...e?{stack:e}:{}}}}return m=uQ(m,["y2","x2"]),d&&p.push({...o?{projection:o}:{},mark:{type:"line",...cQ(f,["clip","interpolate","tension","tooltip"]),...d},encoding:m}),h&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...cQ(f,["clip","tooltip"]),...h},encoding:m}),n({...c,layer:p},{...e,config:t4(i)})}}function r4(t,e){return e?M7(t)?u4(t,e):a4(t,e):t}function o4(t,e){return e?u4(t,e):t}function s4(t,e,n){const i=e[t];return function(t){return t&&!rd(t)&&"repeat"in t}(i)?i.repeat in n?{...e,[t]:n[i.repeat]}:void y2(function(t){return`Unknown repeated value "${t}".`}(i.repeat)):e}function a4(t,e){if(void 0!==(t=s4("field",t,e))){if(null===t)return null;if(O7(t)&&E7(t.sort)){const n=s4("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function l4(t,e){if(B7(t))return a4(t,e);{const n=s4("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function c4(t,e){if(!V7(t)){if(I7(t)){const n=l4(t.condition,e);if(n)return{...t,condition:n};{const{condition:e,...n}=t;return n}}return t}{const n=l4(t,e);if(n)return n;if(R7(t))return{condition:t.condition}}}function u4(t,e){const n={};for(const i in t)if(Yh(t,i)){const r=t[i];if(ah(r))n[i]=r.map((t=>c4(t,e))).filter((t=>t));else{const t=c4(r,e);void 0!==t&&(n[i]=t)}}return n}class f4{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(M5(t)){const{encoding:e,mark:n}=t;if("line"===n||X3(n)&&"line"===n.type)for(const t of QK){const n=e[t0(t)];if(e[t]&&(B7(n)&&!a1(n.bin)||U7(n)))return!0}}return!1}run(t,e,n){const{encoding:i,mark:r}=t;var o,s;return y2((o=!!i.x2,s=!!i.y2,`Line mark is for continuous lines and thus cannot be used with ${o&&s?"x2 and y2":o?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n({...t,mark:lh(r)?{...r,type:"rule"}:"rule"},e)}}function h4({parentEncoding:t,encoding:e={},layer:n}){let i={};if(t){const r=new Set([...$Q(t),...$Q(e)]);for(const o of r){const r=e[o],s=t[o];if(V7(r)){const t={...s,...r};i[o]=t}else I7(r)?i[o]={...r,condition:{...s,...r.condition}}:r||null===r?i[o]=r:(n||G7(s)||g1(s)||V7(s)||ah(s))&&(i[o]=s)}}else i=e;return!i||kQ(i)?void 0:i}function d4(t){const{parentProjection:e,projection:n}=t;return e&&n&&y2(function(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${GQ(e)} is overridden by a child projection ${GQ(n)}.`}({parentProjection:e,projection:n})),n??e}function p4(t){return"filter"in t}function g4(t){return void 0!==t?.stop}function m4(t){return"lookup"in t}function y4(t){return"pivot"in t}function v4(t){return"density"in t}function b4(t){return"quantile"in t}function x4(t){return"regression"in t}function _4(t){return"loess"in t}function w4(t){return"sample"in t}function k4(t){return"window"in t}function $4(t){return"joinaggregate"in t}function C4(t){return"flatten"in t}function E4(t){return"calculate"in t}function S4(t){return"bin"in t}function M4(t){return"impute"in t}function D4(t){return"timeUnit"in t}function A4(t){return"aggregate"in t}function F4(t){return"stack"in t}function O4(t){return"fold"in t}function T4(t){return"extent"in t&&!("density"in t)}function N4(t,e){const{transform:n,...i}=t;if(n){const t=n.map((t=>{if(p4(t))return{filter:R4(t,e)};if(S4(t)&&l1(t.bin))return{...t,bin:L4(t.bin)};if(m4(t)){const{selection:e,...n}=t.from;return e?{...t,from:{param:e,...n}}:t}return t}));return{...i,transform:t}}return t}function z4(t,e){const n=aQ(t);if(B7(n)&&l1(n.bin)&&(n.bin=L4(n.bin)),X7(n)&&n.scale?.domain?.selection){const{selection:t,...e}=n.scale.domain;n.scale.domain={...e,...t?{param:t}:{}}}if(R7(n))if(ah(n.condition))n.condition=n.condition.map((t=>{const{selection:n,param:i,test:r,...o}=t;return i?t:{...o,test:R4(t,e)}}));else{const{selection:t,param:i,test:r,...o}=z4(n.condition,e);n.condition=i?n.condition:{...o,test:R4(n.condition,e)}}return n}function L4(t){const e=t.extent;if(e?.selection){const{selection:n,...i}=e;return{...t,extent:{...i,param:n}}}return t}function R4(t,e){const n=t=>sQ(t,(t=>{var n;const i={param:t,empty:e.emptySelections[t]??!0};return(n=e.selectionPredicates)[t]??(n[t]=[]),e.selectionPredicates[t].push(i),i}));return t.selection?n(t.selection):sQ(t.test||t.filter,(t=>t.selection?n(t.selection):t))}class P4 extends H6{map(t,e){const n=e.selections??[];if(t.params&&!M5(t)){const e=[];for(const i of t.params)b6(i)?n.push(i):e.push(i);t.params=e}return e.selections=n,super.map(t,e)}mapUnit(t,e){const n=e.selections;if(!n||!n.length)return t;const i=(e.path??[]).concat(t.name),r=[];for(const e of n)if(e.views&&e.views.length)for(const n of e.views)(rd(n)&&(n===t.name||i.includes(n))||ah(n)&&n.map((t=>i.indexOf(t))).every(((t,e,n)=>-1!==t&&(0===e||t>n[e-1]))))&&r.push(e);else r.push(e);return r.length&&(t.params=r),t}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=P4.prototype[t];P4.prototype[t]=function(t,n){return e.call(this,t,I4(t,n))}}function I4(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function B4(t,e){void 0===e&&(e=P6(t.config));const n=function(t,e={}){const n={config:e};return q4.map(j4.map(U4.map(t,n),n),n)}(t,e),{width:i,height:r}=t,o=function(t,e,n){let{width:i,height:r}=e;const o=M5(t)||W6(t),s={};o?"container"==i&&"container"==r?(s.type="fit",s.contains="padding"):"container"==i?(s.type="fit-x",s.contains="padding"):"container"==r&&(s.type="fit-y",s.contains="padding"):("container"==i&&(y2(B1("width")),i=void 0),"container"==r&&(y2(B1("height")),r=void 0));const a={type:"pad",...s,...n?W4(n.autosize):{},...W4(t.autosize)};"fit"!==a.type||o||(y2(I1),a.type="pad");"container"==i&&"fit"!=a.type&&"fit-x"!=a.type&&y2(j1("width"));"container"==r&&"fit"!=a.type&&"fit-y"!=a.type&&y2(j1("height"));if(YQ(a,{type:"pad"}))return;return a}(n,{width:i,height:r,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const j4=new class extends H6{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Y5,Q5,r6,new i4,new f4]}map(t,e){if(M5(t)){const n=A5(t.encoding,XQ),i=A5(t.encoding,ZQ),r=A5(t.encoding,JQ);if(n||i||r)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:i}=e,r=o4(t.encoding,e.repeater),o={...t,...t.name?{name:[e.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{},...r?{encoding:r}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(o,e);const s=this.mapLayerOrUnit.bind(this);for(const t of this.nonFacetUnitNormalizers)if(t.hasMatchingType(o,e.config))return t.run(o,e,s);return o}mapRepeat(t,e){return function(t){return!ah(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:i,...r}=t,{row:o,column:s,layer:a}=n,{repeater:l={},repeaterPrefix:c=""}=e;return o||s?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...s?{column:s}:{}},spec:{repeat:{layer:a},spec:i}},e):{...r,layer:a.map((t=>{const n={...l,layer:t},r=`${(i.name?`${i.name}_`:"")+c}child__layer_${MQ(t)}`,o=this.mapLayerOrUnit(i,{...e,repeater:n,repeaterPrefix:r});return o.name=r,o}))}}mapNonLayerRepeat(t,e){const{repeat:n,spec:i,data:r,...o}=t;!ah(n)&&t.columns&&(t=uQ(t,["columns"]),y2(G1("repeat")));const s=[],{repeater:a={},repeaterPrefix:l=""}=e,c=!ah(n)&&n.row||[a?a.row:null],u=!ah(n)&&n.column||[a?a.column:null],f=ah(n)&&n||[a?a.repeat:null];for(const t of f)for(const r of c)for(const o of u){const c={repeat:t,row:r,column:o,layer:a.layer},u=(i.name?`${i.name}_`:"")+l+"child__"+(ah(n)?`${MQ(t)}`:(n.row?`row_${MQ(r)}`:"")+(n.column?`column_${MQ(o)}`:"")),f=this.map(i,{...e,repeater:c,repeaterPrefix:u});f.name=u,s.push(uQ(f,["data"]))}const h=ah(n)?t.columns:n.column?n.column.length:1;return{data:i.data??r,align:"all",...o,columns:h,concat:s}}mapFacet(t,e){const{facet:n}=t;return M7(n)&&t.columns&&(t=uQ(t,["columns"]),y2(G1("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:i}=t,{parentEncoding:r,parentProjection:o,config:s}=e,a=d4({parentProjection:o,projection:i}),l=h4({parentEncoding:r,encoding:o4(n,e.repeater)});return this.mapUnit({...t,...a?{projection:a}:{},...l?{encoding:l}:{}},{config:s})}mapFacetedUnit(t,e){const{row:n,column:i,facet:r,...o}=t.encoding,{mark:s,width:a,projection:l,height:c,view:u,params:f,encoding:h,...d}=t,{facetMapping:p,layout:g}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},e),m=o4(o,e.repeater);return this.mapFacet({...d,...g,facet:p,spec:{...a?{width:a}:{},...c?{height:c}:{},...u?{view:u}:{},...l?{projection:l}:{},mark:s,encoding:m,...f?{params:f}:{}}},e)}getFacetMappingAndLayout(t,e){const{row:n,column:i,facet:r}=t;if(n||i){r&&y2(`Facet encoding dropped as ${(o=[...n?[XQ]:[],...i?[ZQ]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const e={},s={};for(const n of[XQ,ZQ]){const i=t[n];if(i){const{align:t,center:r,spacing:o,columns:a,...l}=i;e[n]=l;for(const t of["align","center","spacing"])void 0!==i[t]&&(s[t]??(s[t]={}),s[t][n]=i[t])}}return{facetMapping:e,layout:s}}{const{align:t,center:n,spacing:i,columns:o,...s}=r;return{facetMapping:r4(s,e.repeater),layout:{...t?{align:t}:{},...n?{center:n}:{},...i?{spacing:i}:{},...o?{columns:o}:{}}}}var o}mapLayer(t,{parentEncoding:e,parentProjection:n,...i}){const{encoding:r,projection:o,...s}=t,a={...i,parentEncoding:h4({parentEncoding:e,encoding:r,layer:!0}),parentProjection:d4({parentProjection:n,projection:o})};return super.mapLayer({...s,...t.name?{name:[a.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{}},a)}},U4=new class extends H6{map(t,e){return e.emptySelections??(e.emptySelections={}),e.selectionPredicates??(e.selectionPredicates={}),t=N4(t,e),super.map(t,e)}mapLayerOrUnit(t,e){if((t=N4(t,e)).encoding){const n={};for(const[i,r]of EQ(t.encoding))n[i]=z4(r,e);t={...t,encoding:n}}return super.mapLayerOrUnit(t,e)}mapUnit(t,e){const{selection:n,...i}=t;return n?{...i,params:EQ(n).map((([t,n])=>{const{init:i,bind:r,empty:o,...s}=n;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),e.emptySelections[t]="none"!==o;for(const n of CQ(e.selectionPredicates[t]??{}))n.empty="none"!==o;return{name:t,value:i,select:s,bind:r}}))}:t}},q4=new P4;function W4(t){return rd(t)?{type:t}:t??{}}const H4=["background","padding"];function V4(t,e){const n={};for(const e of H4)t&&void 0!==t[e]&&(n[e]=w1(t[e]));return e&&(n.params=t.params),n}class Y4{constructor(t={},e={}){this.explicit=t,this.implicit=e}clone(){return new Y4(aQ(this.explicit),aQ(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return IQ(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:e,explicit:n}){void 0!==e&&this.set(t,e,n)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,{explicit:e,implicit:n}){void 0!==e[t]?this.set(t,e[t],!0):void 0!==n[t]&&this.set(t,n[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of $Q(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function G4(t){return{explicit:!0,value:t}}function X4(t){return{explicit:!1,value:t}}function Z4(t){return(e,n,i,r)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:J4(e,n,i,r)}}function J4(t,e,n,i){return t.explicit&&e.explicit&&y2(function(t,e,n,i){return`Conflicting ${e.toString()} property "${t.toString()}" (${GQ(n)} and ${GQ(i)}). Using ${GQ(n)}.`}(n,i,t.value,e.value)),t}function Q4(t,e,n,i,r=J4){return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:YQ(t.value,e.value)?t:r(t,e,n,i)}class K4 extends Y4{constructor(t={},e={},n=!1){super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function t8(t){return"url"in t}function e8(t){return"values"in t}function n8(t){return"name"in t&&!t8(t)&&!e8(t)&&!i8(t)}function i8(t){return t&&(r8(t)||o8(t)||s8(t))}function r8(t){return"sequence"in t}function o8(t){return"sphere"in t}function s8(t){return"graticule"in t}var a8;function l8(t){const{signals:e,hasLegend:n,index:i,...r}=t;return r.field=zQ(r.field),r}function c8(t,e=!0,n=Xf){if(ah(t)){const i=t.map((t=>c8(t,e,n)));return e?`[${i.join(", ")}]`:i}return v2(t)?n(e?$2(t):function(t){const e=k2(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n(GQ(t)):t}function u8(t,e){for(const n of CQ(t.component.selection??{})){const i=n.name;let r=`${i}${D9}, ${"global"===n.resolve?"true":`{unit: ${T9(t)}}`}`;for(const i of O9)i.defined(n)&&(i.signals&&(e=i.signals(t,n,e)),i.modifyExpr&&(r=i.modifyExpr(t,n,r)));e.push({name:i+A9,on:[{events:{signal:n.name+D9},update:`modify(${hd(n.name+M9)}, ${r})`}]})}return d8(e)}function f8(t,e){if(t.component.selection&&$Q(t.component.selection).length){const n=hd(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:$Y("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return d8(e)}function h8(t,e){for(const n of CQ(t.component.selection??{}))for(const i of O9)i.defined(n)&&i.marks&&(e=i.marks(t,n,e));return e}function d8(t){return t.map((t=>(t.on&&!t.on.length&&delete t.on,t)))}!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(a8||(a8={}));class p8{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.includes(t)?y2("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const e of this._children)e.parent=t;this._children=[],t.removeChild(this);const n=t.parent.removeChild(t);this._parent=e,e.addChild(this,n),t.parent=this}}class g8 extends p8{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,e,n,i){super(t,e),this.type=n,this.refCounts=i,this._source=this._name=e,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${jQ()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function m8(t){return void 0!==t.as}function y8(t){return`${t}_end`}class v8 extends p8{clone(){return new v8(null,aQ(this.timeUnits))}constructor(t,e){super(t),this.timeUnits=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,i)=>{const{field:r,timeUnit:o}=n;if(o){let s;if(S2(o)){if(bnt(e)){const{mark:t,markDef:i,config:a}=e,l=T7({fieldDef:n,markDef:i,config:a});(Y3(t)||l)&&(s={timeUnit:L2(o),field:r})}}else s={as:t5(n,{forAs:!0}),field:r,timeUnit:o};if(bnt(e)){const{mark:t,markDef:r,config:o}=e,a=T7({fieldDef:n,markDef:r,config:o});Y3(t)&&E0(i)&&.5!==a&&(s.rectBandPosition=a)}s&&(t[fQ(s)]=s)}return t}),{});return kQ(n)?null:new v8(t,n)}static makeFromTransform(t,e){const{timeUnit:n,...i}={...e},r={...i,timeUnit:L2(n)};return new v8(t,{[fQ(r)]:r})}merge(t){this.timeUnits={...this.timeUnits};for(const e in t.timeUnits)this.timeUnits[e]||(this.timeUnits[e]=t.timeUnits[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,i]of EQ(this.timeUnits)){const r=m8(i)?i.as:`${i.field}_end`;t.has(r)||(e[n]=i)}this.timeUnits=e}producedFields(){return new Set(CQ(this.timeUnits).map((t=>m8(t)?t.as:y8(t.field))))}dependentFields(){return new Set(CQ(this.timeUnits).map((t=>t.field)))}hash(){return`TimeUnit ${fQ(this.timeUnits)}`}assemble(){const t=[];for(const e of CQ(this.timeUnits)){const{rectBandPosition:n}=e,i=L2(e.timeUnit);if(m8(e)){const{field:r,as:o}=e,{unit:s,utc:a,...l}=i,c=[o,`${o}_end`];t.push({field:zQ(r),type:"timeunit",...s?{units:F2(s)}:{},...a?{timezone:"utc"}:{},...l,as:c}),t.push(...w8(c,n,i))}else if(e){const{field:r}=e,o=r.replaceAll("\\.","."),s=_8({timeUnit:i,field:o}),a=y8(o);t.push({type:"formula",expr:s,as:a}),t.push(...w8([o,a],n,i))}}return t}}const b8="offsetted_rect_start",x8="offsetted_rect_end";function _8({timeUnit:t,field:e,reverse:n}){const{unit:i,utc:r}=t,o=O2(i),{part:s,step:a}=I2(o,t.step);return`${r?"utcOffset":"timeOffset"}('${s}', datum['${e}'], ${n?-a:a})`}function w8([t,e],n,i){if(void 0!==n&&.5!==n){const r=`datum['${t}']`,o=`datum['${e}']`;return[{type:"formula",expr:k8([_8({timeUnit:i,field:t,reverse:!0}),r],n+.5),as:`${t}_${b8}`},{type:"formula",expr:k8([r,o],n+.5),as:`${t}_${x8}`}]}return[]}function k8([t,e],n){return`${1-n} * ${t} + ${n} * ${e}`}const $8="_tuple_fields";class C8{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const E8={defined:()=>!0,parse:(t,e,n)=>{const i=e.name,r=e.project??(e.project=new C8),o={},s={},a=new Set,l=(t,e)=>{const n="visual"===e?t.channel:t.field;let r=MQ(`${i}_${n}`);for(let t=1;a.has(r);t++)r=MQ(`${i}_${n}_${t}`);return a.add(r),{[e]:r}},c=e.type,u=t.config.selection[c],f=void 0!==n.value?Oh(n.value):null;let{fields:h,encodings:d}=lh(n.select)?n.select:{};if(!h&&!d&&f)for(const t of f)if(lh(t))for(const e of $Q(t))ZK[e]?(d||(d=[])).push(e):"interval"===c?(y2('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),d=u.encodings):(h??(h=[])).push(e);h||d||(d=u.encodings,"fields"in u&&(h=u.fields));for(const e of d??[]){const n=t.fieldDef(e);if(n){let i=n.field;if(n.aggregate){y2(H1(e,n.aggregate));continue}if(!i){y2(W1(e));continue}if(n.timeUnit&&!S2(n.timeUnit)){i=t.vgField(e);const r={timeUnit:n.timeUnit,as:i,field:n.field};s[fQ(r)]=r}if(!o[i]){const s={field:i,channel:e,type:"interval"===c&&W0(e)&&y3(t.getScaleComponent(e).get("type"))?"R":n.bin?"R-RE":"E",index:r.items.length};s.signals={...l(s,"data"),...l(s,"visual")},r.items.push(o[i]=s),r.hasField[i]=o[i],r.hasSelectionId=r.hasSelectionId||i===g6,zK(e)?(s.geoChannel=e,s.channel=NK(e),r.hasChannel[s.channel]=o[i]):r.hasChannel[e]=o[i]}}else y2(W1(e))}for(const t of h??[]){if(r.hasField[t])continue;const e={type:"E",field:t,index:r.items.length};e.signals={...l(e,"data")},r.items.push(e),r.hasField[t]=e,r.hasSelectionId=r.hasSelectionId||t===g6}f&&(e.init=f.map((t=>r.items.map((e=>lh(t)?void 0!==t[e.geoChannel||e.channel]?t[e.geoChannel||e.channel]:t[e.field]:t))))),kQ(s)||(r.timeUnit=new v8(null,s))},signals:(t,e,n)=>{const i=e.name+$8;return n.filter((t=>t.name===i)).length>0||e.project.hasSelectionId?n:n.concat({name:i,value:e.project.items.map(l8)})}},S8={defined:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const i of e.project.items){const r=i.channel;if(!W0(r))continue;const o=t.getScaleComponent(r),s=o?o.get("type"):void 0;o&&y3(s)?(o.set("selectionExtent",{param:e.name,field:i.field},!0),n.push(i)):y2("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(t,e,n)=>{const i=e.scales.filter((t=>0===n.filter((e=>e.name===t.signals.data)).length));if(!t.parent||D8(t)||0===i.length)return n;const r=n.filter((t=>t.name===e.name))[0];let o=r.update;if(o.indexOf(F9)>=0)r.update=`{${i.map((t=>`${hd(zQ(t.field))}: ${t.signals.data}`)).join(", ")}}`;else{for(const t of i){const e=`${hd(zQ(t.field))}: ${t.signals.data}`;o.includes(e)||(o=`${o.substring(0,o.length-1)}, ${e}}`)}r.update=o}return n.concat(i.map((t=>({name:t.signals.data}))))},signals:(t,e,n)=>{if(t.parent&&!D8(t))for(const t of e.scales){const e=n.filter((e=>e.name===t.signals.data))[0];e.push="outer",delete e.value,delete e.update}return n}};function M8(t,e){return`domain(${hd(t.scaleName(e))})`}function D8(t){return t.parent&&wnt(t.parent)&&(!t.parent.parent??D8(t.parent.parent))}const A8="_brush",F8="_scale_trigger",O8="geo_interval_init_tick",T8="_init",N8={defined:t=>"interval"===t.type,parse:(t,e,n)=>{var i;if(t.hasProjection){const t={...lh(n.select)?n.select:{}};t.fields=[g6],t.encodings||(t.encodings=n.value?$Q(n.value):[cK,lK]),n.select={type:"interval",...t}}if(e.translate&&!S8.defined(e)){const t=`!event.item || event.item.mark.name !== ${hd(e.name+A8)}`;for(const n of e.events){if(!n.between){y2(`${n} is not an ordered event stream for interval selections.`);continue}const e=Oh((i=n.between[0]).filter??(i.filter=[]));e.indexOf(t)<0&&e.push(t)}}},signals:(t,e,n)=>{const i=e.name,r=i+D9,o=CQ(e.project.hasChannel).filter((t=>t.channel===QQ||t.channel===KQ)),s=e.init?e.init[0]:null;if(n.push(...o.reduce(((n,i)=>n.concat(function(t,e,n,i){const r=!t.hasProjection,o=n.channel,s=n.signals.visual,a=hd(r?t.scaleName(o):t.projectionName()),l=t=>`scale(${a}, ${t})`,c=t.getSizeSignalRef(o===QQ?"width":"height").signal,u=`${o}(unit)`,f=e.events.reduce(((t,e)=>[...t,{events:e.between[0],update:`[${u}, ${u}]`},{events:e,update:`[${s}[0], clamp(${u}, 0, ${c})]`}]),[]);if(r){const r=n.signals.data,c=S8.defined(e),u=t.getScaleComponent(o),h=u?u.get("type"):void 0,d=i?{init:c8(i,!0,l)}:{value:[]};return f.push({events:{signal:e.name+F8},update:y3(h)?`[${l(`${r}[0]`)}, ${l(`${r}[1]`)}]`:"[0, 0]"}),c?[{name:r,on:[]}]:[{name:s,...d,on:f},{name:r,...i?{init:c8(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}{const t=o===QQ?0:1,n=e.name+T8;return[{name:s,...i?{init:`[${n}[0][${t}], ${n}[1][${t}]]`}:{value:[]},on:f}]}}(t,e,i,s&&s[i.index]))),[])),t.hasProjection){const a=hd(t.projectionName()),l=t.projectionName()+"_center",{x:c,y:u}=e.project.hasChannel,f=c&&c.signals.visual,h=u&&u.signals.visual,d=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=e=>t.getSizeSignalRef(e).signal,m=`[[${f?f+"[0]":"0"}, ${h?h+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${h?h+"[1]":g("height")}]]`;if(s&&(n.unshift({name:i+T8,init:`[scale(${a}, [${c?d[0]:d}, ${u?p[0]:p}]), scale(${a}, [${c?d[1]:d}, ${u?p[1]:p}])]`}),!c||!u)){n.find((t=>t.name===l))||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${m}, {markname: ${hd(t.getName("marks"))}}, unit.mark)`}, ${`{unit: ${T9(t)}}`})`,v=o.map((t=>t.signals.visual));return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...s?[{signal:O8}]:[]],update:y}]})}{if(!S8.defined(e)){const e=i+F8,r=o.map((e=>{const n=e.channel,{data:i,visual:r}=e.signals,o=hd(t.scaleName(n)),s=y3(t.getScaleComponent(n).get("type"))?"+":"";return`(!isArray(${i}) || (${s}invert(${o}, ${r})[0] === ${s}${i}[0] && ${s}invert(${o}, ${r})[1] === ${s}${i}[1]))`}));r.length&&n.push({name:e,value:{},on:[{events:o.map((e=>({scale:t.scaleName(e.channel)}))),update:r.join(" && ")+` ? ${e} : {}`}]})}const a=o.map((t=>t.signals.data)),l=`unit: ${T9(t)}, fields: ${i+$8}, values`;return n.concat({name:r,...s?{init:`{${l}: ${c8(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>{if(bnt(t)&&t.hasProjection&&e.init){n.filter((t=>t.name===O8)).length||n.unshift({name:O8,value:null,on:[{events:"timer{1}",update:`${O8} === null ? {} : ${O8}`}]})}return n},marks:(t,e,n)=>{const i=e.name,{x:r,y:o}=e.project.hasChannel,s=r?.signals.visual,a=o?.signals.visual,l=`data(${hd(e.name+M9)})`;if(S8.defined(e)||!r&&!o)return n;const c={x:void 0!==r?{signal:`${s}[0]`}:{value:0},y:void 0!==o?{signal:`${a}[0]`}:{value:0},x2:void 0!==r?{signal:`${s}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${a}[1]`}:{field:{group:"height"}}};if("global"===e.resolve)for(const e of $Q(c))c[e]=[{test:`${l}.length && ${l}[0].unit === ${T9(t)}`,...c[e]},{value:0}];const{fill:u,fillOpacity:f,cursor:h,...d}=e.mark,p=$Q(d).reduce(((t,e)=>(t[e]=[{test:[void 0!==r&&`${s}[0] !== ${s}[1]`,void 0!==o&&`${a}[0] !== ${a}[1]`].filter((t=>t)).join(" && "),value:d[e]},{value:null}],t)),{});return[{name:`${i+A8}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:i+A8,type:"rect",clip:!0,encode:{enter:{...h?{cursor:{value:h}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};const z8={defined:t=>"point"===t.type,signals:(t,e,n)=>{const i=e.name,r=i+$8,o=e.project,s="(item().isVoronoi ? datum.datum : datum)",a=CQ(t.component.selection??{}).reduce(((t,e)=>"interval"===e.type?t.concat(e.name+A8):t),[]).map((t=>`indexof(item().mark.name, '${t}') < 0`)).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(a?` && ${a}`:"");let c=`unit: ${T9(t)}, `;if(e.project.hasSelectionId)c+=`${g6}: ${s}[${hd(g6)}]`;else{c+=`fields: ${r}, values: [${o.items.map((e=>{const n=t.fieldDef(e.channel);return n?.bin?`[${s}[${hd(t.vgField(e.channel,{}))}], ${s}[${hd(t.vgField(e.channel,{binSuffix:"end"}))}]]`:`${s}[${hd(e.field)}]`})).join(", ")}]`}const u=e.events;return n.concat([{name:i+D9,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function L8(t,e,n,i){const r=R7(e)&&e.condition,o=i(e);if(r){const e=Oh(r).map((e=>{const n=i(e);if(function(t){return t.param}(e)){const{param:i,empty:r}=e;return{test:B9(t,{param:i,empty:r}),...n}}return{test:U9(t,e.test),...n}}));return{[n]:[...e,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function R8(t,e="text"){const n=t.encoding[e];return L8(t,n,e,(e=>P8(e,t.config)))}function P8(t,e,n="datum"){if(t){if(G7(t))return $1(t.value);if(V7(t)){const{format:i,formatType:r}=l5(t);return d7({fieldOrDatumDef:t,format:i,formatType:r,expr:n,config:e})}}}function I8(t,e={}){const{encoding:n,markDef:i,config:r,stack:o}=t,s=n.tooltip;if(ah(s))return{tooltip:j8({tooltip:s},o,r,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return L8(t,s,"tooltip",(t=>{const s=P8(t,r,a);if(s)return s;if(null===t)return;let l=A1("tooltip",i,r);return!0===l&&(l={content:"encoding"}),rd(l)?{value:l}:lh(l)?g1(l)?l:"encoding"===l.content?j8(n,o,r,e):{signal:a}:void 0}))}}function B8(t,e,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o={},s=i?"datum.datum":"datum",a=[];function l(n,i){const l=t0(i),c=Y7(n)?n:{...n,type:t[l].type},u=Oh(c.title||a5(c,r)).join(", ").replaceAll(/"/g,'\\"');let f;if(E0(i)){const e="x"===i?"x2":"y2",n=c5(t[e]);if(a1(c.bin)&&n){const t=t5(c,{expr:s}),i=t5(n,{expr:s}),{format:a,formatType:l}=l5(c);f=_7(t,i,a,l,r),o[e]=!0}}if((E0(i)||i===sK||i===rK)&&e&&e.fieldChannel===i&&"normalize"===e.offset){const{format:t,formatType:e}=l5(c);f=d7({fieldOrDatumDef:c,format:t,formatType:e,expr:s,config:r,normalizeStack:!0}).signal}f??(f=P8(c,r,s).signal),a.push({channel:i,key:u,value:f})}R5(t,((t,e)=>{B7(t)?l(t,e):P7(t)&&l(t.condition,e)}));const c={};for(const{channel:t,key:e,value:n}of a)o[t]||c[e]||(c[e]=n);return c}function j8(t,e,n,{reactiveGeom:i}={}){const r=B8(t,e,n,{reactiveGeom:i}),o=EQ(r).map((([t,e])=>`"${t}": ${e}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function U8(t){const{markDef:e,config:n}=t,i=A1("aria",e,n);return!1===i?{}:{...i?{aria:i}:{},...q8(t),...W8(t)}}function q8(t){const{mark:e,markDef:n,config:i}=t;if(!1===i.aria)return{};const r=A1("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:e in b1?{}:{ariaRoleDescription:{value:e}}}function W8(t){const{encoding:e,markDef:n,config:i,stack:r}=t,o=e.description;if(o)return L8(t,o,"description",(e=>P8(e,t.config)));const s=A1("description",n,i);if(null!=s)return{description:$1(s)};if(!1===i.aria)return{};const a=B8(e,r,i);return kQ(a)?void 0:{description:{signal:EQ(a).map((([t,e],n)=>`"${n>0?"; ":""}${t}: " + (${e})`)).join(" + ")}}}function H8(t,e,n={}){const{markDef:i,encoding:r,config:o}=e,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;void 0===a&&(l??(l=A1(t,i,o,{vgChannel:s,ignoreVgConfig:!0})),void 0!==l&&(a=$1(l)));const c=r[t];return L8(e,c,s??t,(n=>l7({channel:t,channelDef:n,markDef:i,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:a})))}function V8(t,e={filled:void 0}){const{markDef:n,encoding:i,config:r}=t,{type:o}=n,s=e.filled??A1("filled",n,r),a=dQ(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=A1(!0===s?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[!0===s&&"color"]??a,c=A1(!1===s?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[!1===s&&"color"],u=s?"fill":"stroke",f={...l?{fill:$1(l)}:{},...c?{stroke:$1(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&y2(t2("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...H8("color",t,{vgChannel:u,defaultValue:s?l:c}),...H8("fill",t,{defaultValue:i.fill?l:void 0}),...H8("stroke",t,{defaultValue:i.stroke?c:void 0})}}function Y8(t){const{encoding:e,mark:n}=t,i=e.order;return!V3(n)&&G7(i)?L8(t,i,"zindex",(t=>$1(t.value))):{}}function G8({channel:t,markDef:e,encoding:n={},model:i,bandPosition:r}){const o=`${t}Offset`,s=e[o],a=n[o];if(("xOffset"===o||"yOffset"===o)&&a){return{offsetType:"encoding",offset:l7({channel:o,channelDef:a,markDef:e,config:i?.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:$1(s),bandPosition:r})}}const l=e[o];return l?{offsetType:"visual",offset:l}:{}}function X8(t,e,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=e,l=r[t],c=r[n0(t)],u=e.scaleName(t),f=e.getScaleComponent(t),{offset:h,offsetType:d}=G8({channel:t,markDef:o,encoding:r,model:e,bandPosition:.5}),p=Z8({model:e,defaultPos:n,channel:t,scaleName:u,scale:f}),g=!l&&E0(t)&&(r.latitude||r.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=t;if(V7(n)&&r&&e===r.fieldChannel){if(B7(n)){let t=n.bandPosition;if(void 0!==t||"text"!==s.type||"radius"!==e&&"theta"!==e||(t=.5),void 0!==t)return a7({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:t,offset:o})}return s7(n,i,{suffix:"end"},{offset:o})}return i7(t)}({channel:t,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:h,defaultRef:p,bandPosition:"encoding"===d?0:void 0});return g?{[i||t]:g}:void 0}function Z8({model:t,defaultPos:e,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=t;return()=>{const a=t0(n),l=e0(n),c=A1(n,o,s,{vgChannel:l});if(void 0!==c)return c7(n,c);switch(e){case"zeroOrMin":case"zeroOrMax":if(i){const t=r.get("type");if(dQ([o3.LOG,o3.TIME,o3.UTC],t));else if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}if("zeroOrMin"===e)return"y"===a?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...t[i0(n)],mult:.5}}}}const J8={left:"x",center:"xc",right:"x2"},Q8={top:"y",middle:"yc",bottom:"y2"};function K8(t,e,n,i="middle"){if("radius"===t||"theta"===t)return e0(t);const r="x"===t?"align":"baseline",o=A1(r,e,n);let s;return g1(o)?(y2(function(t){return`The ${t} for range marks cannot be an expression`}(r)),s=void 0):s=o,"x"===t?J8[s||("top"===i?"left":"center")]:Q8[s||i]}function t9(t,e,{defaultPos:n,defaultPos2:i,range:r}){return r?e9(t,e,{defaultPos:n,defaultPos2:i}):X8(t,e,{defaultPos:n})}function e9(t,e,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=e,s=n0(t),a=i0(t),l=function(t,e,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=t,l=t0(n),c=i0(n),u=e0(n),f=i[l],h=t.scaleName(l),d=t.getScaleComponent(l),{offset:p}=G8(n in i||n in o?{channel:n,markDef:o,encoding:i,model:t}:{channel:l,markDef:o,encoding:i,model:t});if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const e=i0(n),i=t.markDef[e];return null!=i?{[e]:{value:i}}:{[u]:{field:t.getName(n)}}}const g=function({channel:t,channelDef:e,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){if(V7(e)&&a&&t.charAt(0)===a.fieldChannel.charAt(0))return s7(e,o,{suffix:"start"},{offset:l});return i7({channel:t,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:l,defaultRef:c})}({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:h,scale:d,stack:s,offset:p,defaultRef:void 0});if(void 0!==g)return{[u]:g};return n9(n,o)||n9(n,{[n]:O1(n,o,a.style),[c]:O1(c,o,a.style)})||n9(n,a[r])||n9(n,a.mark)||{[u]:Z8({model:t,defaultPos:e,channel:n,scaleName:h,scale:d})()}}(e,i,s);return{...X8(t,e,{defaultPos:n,vgChannel:l[a]?K8(t,r,o):e0(t)}),...l}}function n9(t,e){const n=i0(t),i=e0(t);if(void 0!==e[i])return{[i]:c7(t,e[i])};if(void 0!==e[t])return{[i]:c7(t,e[t])};if(e[n]){const i=e[n];if(!K3(i))return{[n]:c7(t,i)};y2(function(t){return`Position range does not support relative band size for ${t}.`}(n))}}function i9(t,e){const{config:n,encoding:i,markDef:r}=t,o=r.type,s=n0(e),a=i0(e),l=i[e],c=i[s],u=t.getScaleComponent(e),f=u?u.get("type"):void 0,h=r.orient,d=i[a]??i.size??A1("size",r,n,{vgChannel:a}),p=r0(e),g="bar"===o&&("x"===e?"vertical"===h:"horizontal"===h);return!B7(l)||!(s1(l.bin)||a1(l.bin)||l.timeUnit&&!c)||d&&!K3(d)||i[p]||m3(f)?(V7(l)&&m3(f)||g)&&!c?function(t,e,n){const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,l=n.scaleName(e),c=n.getScaleComponent(e),u=i0(e),f=n0(e),h=r0(e),d=n.scaleName(h),p=n.getScaleComponent(o0(e)),g="horizontal"===a&&"y"===e||"vertical"===a&&"x"===e;let m;(r.size||i.size)&&(g?m=H8("size",n,{vgChannel:u,defaultRef:$1(i.size)}):y2(function(t){return`Cannot apply size to non-oriented mark "${t}".`}(i.type)));const y=!!m,v=N7({channel:e,fieldDef:t,markDef:i,config:o,scaleType:(c||p)?.get("type"),useVlSizeChannel:g});m=m||{[u]:r9(u,d||l,p||c,o,v,!!t,i.type)};const b="band"===(c||p)?.get("type")&&K3(v)&&!y?"top":"middle",x=K8(e,i,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:k}=G8({channel:e,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),$=i7({channel:e,channelDef:t,markDef:i,config:o,scaleName:l,scale:c,stack:s,offset:w,defaultRef:Z8({model:n,defaultPos:"mid",channel:e,scaleName:l,scale:c}),bandPosition:_?"encoding"===k?0:.5:g1(v)?{signal:`(1-${v})/2`}:K3(v)?(1-v.band)/2:0});if(u)return{[x]:$,...m};{const t=e0(f),e=m[u],n=w?{...e,offset:w}:e;return{[x]:$,[t]:ah($)?[$[0],{...$[1],offset:n}]:{...$,offset:n}}}}(l,e,t):e9(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function({fieldDef:t,fieldDef2:e,channel:n,model:i}){const{config:r,markDef:o,encoding:s}=i,a=i.getScaleComponent(n),l=i.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=N7({channel:n,fieldDef:t,markDef:o,config:r,scaleType:c}),h=i.component.axes[n]?.[0],d=h?.get("translate")??.5,p=E0(n)?A1("binSpacing",o,r)??0:0,g=n0(n),m=e0(n),y=e0(g),v=F1("minBandSize",o,r),{offset:b}=G8({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:x}=G8({channel:g,markDef:o,encoding:s,model:i,bandPosition:0}),_=function({scaleName:t,fieldDef:e}){const n=t5(e,{expr:"datum"});return`abs(scale("${t}", ${t5(e,{expr:"datum",suffix:"end"})}) - scale("${t}", ${n}))`}({fieldDef:t,scaleName:l}),w=o9(n,p,u,d,b,v,_),k=o9(g,p,u,d,x??b,v,_),$=g1(f)?{signal:`(1-${f.signal})/2`}:K3(f)?(1-f.band)/2:.5,C=T7({fieldDef:t,fieldDef2:e,markDef:o,config:r});if(s1(t.bin)||t.timeUnit){const e=t.timeUnit&&.5!==C;return{[y]:s9({fieldDef:t,scaleName:l,bandPosition:$,offset:k,useRectOffsetField:e}),[m]:s9({fieldDef:t,scaleName:l,bandPosition:g1($)?{signal:`1-${$.signal}`}:1-$,offset:w,useRectOffsetField:e})}}if(a1(t.bin)){const n=s7(t,l,{},{offset:k});if(B7(e))return{[y]:n,[m]:s7(e,l,{},{offset:w})};if(l1(t.bin)&&t.bin.step)return{[y]:n,[m]:{signal:`scale("${l}", ${t5(t,{expr:"datum"})} + ${t.bin.step})`,offset:w}}}return void y2(p2(g))}({fieldDef:l,fieldDef2:c,channel:e,model:t})}function r9(t,e,n,i,r,o,s){if(K3(r)){if(!n)return{mult:r.band,field:{group:t}};{const t=n.get("type");if("band"===t){let t=`bandwidth('${e}')`;1!==r.band&&(t=`${r.band} * ${t}`);const n=F1("minBandSize",{type:s},i);return{signal:n?`max(${S1(n)}, ${t})`:t}}1!==r.band&&(y2(function(t){return`Cannot use the relative band size with ${t} scale.`}(t)),r=void 0)}}else{if(g1(r))return r;if(r)return{value:r}}if(n){const t=n.get("range");if(m1(t)&&nd(t.step))return{value:t.step-2}}if(!o){const{bandPaddingInner:e,barBandPaddingInner:n,rectBandPaddingInner:r}=i.scale,o=IQ(e,"bar"===s?n:r);if(g1(o))return{signal:`(1 - (${o.signal})) * ${t}`};if(nd(o))return{signal:`${1-o} * ${t}`}}return{value:D6(i.view,t)-2}}function o9(t,e,n,i,r,o,s){if(OK(t))return 0;const a="x"===t||"y2"===t,l=a?-e/2:e/2;if(g1(n)||g1(r)||g1(i)||o){const t=S1(n),e=S1(r),c=S1(i),u=S1(o),f=o?`(${s} < ${u} ? ${a?"":"-"}0.5 * (${u} - (${s})) : ${l})`:l;return{signal:(c?`${c} + `:"")+(t?`(${t} ? -1 : 1) * `:"")+(e?`(${e} + ${f})`:f)}}return r=r||0,i+(n?-r-l:+r+l)}function s9({fieldDef:t,scaleName:e,bandPosition:n,offset:i,useRectOffsetField:r}){return a7({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:i,...r?{startSuffix:b8,endSuffix:x8}:{}})}const a9=new Set(["aria","width","height"]);function l9(t,e){const{fill:n,stroke:i}="include"===e.color?V8(t):{};return{...u9(t.markDef,e),...c9(t,"fill",n),...c9(t,"stroke",i),...H8("opacity",t),...H8("fillOpacity",t),...H8("strokeOpacity",t),...H8("strokeWidth",t),...H8("strokeDash",t),...Y8(t),...I8(t),...R8(t,"href"),...U8(t)}}function c9(t,e,n){const{config:i,mark:r,markDef:o}=t;if("hide"===A1("invalid",o,i)&&n&&!V3(r)){const i=function(t,{invalid:e=!1,channels:n}){const i=n.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){const r=i.get("type"),o=t.vgField(n,{expr:"datum"});o&&y3(r)&&(e[o]=!0)}return e}),{}),r=$Q(i);if(r.length>0){const t=e?"||":"&&";return r.map((t=>o7(t,e))).join(` ${t} `)}return}(t,{invalid:!0,channels:q0});if(i)return{[e]:[{test:i,value:null},...Oh(n)]}}return n?{[e]:n}:{}}function u9(t,e){return v1.reduce(((n,i)=>(a9.has(i)||void 0===t[i]||"ignore"===e[i]||(n[i]=$1(t[i])),n)),{})}function f9(t){const{config:e,markDef:n}=t;if(A1("invalid",n,e)){const e=function(t,{invalid:e=!1,channels:n}){const i=n.reduce(((e,n)=>{const i=t.getScaleComponent(n);if(i){const r=i.get("type"),o=t.vgField(n,{expr:"datum",binSuffix:t.stack?.impute?"mid":void 0});o&&y3(r)&&(e[o]=!0)}return e}),{}),r=$Q(i);if(r.length>0){const t=e?"||":"&&";return r.map((t=>o7(t,e))).join(` ${t} `)}return}(t,{channels:C0});if(e)return{defined:{signal:e}}}return{}}function h9(t,e){if(void 0!==e)return{[t]:$1(e)}}const d9="voronoi",p9={defined:t=>"point"===t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(d9)},marks:(t,e,n)=>{const{x:i,y:r}=e.project.hasChannel,o=t.mark;if(V3(o))return y2(`The "nearest" transform is not supported for ${o} marks.`),n;const s={name:t.getName(d9),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...I8(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach(((e,n)=>{const i=e.name??"";i===t.component.mark[0].name?a=n:i.indexOf(d9)>=0&&(l=!0)})),l||n.splice(a+1,0,s),n}},g9={defined:t=>"point"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!y6(t.bind),parse:(t,e,n)=>z9(e,n),topLevelSignals:(t,e,n)=>{const i=e.name,r=e.project,o=e.bind,s=e.init&&e.init[0],a=p9.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((t,r)=>{const l=MQ(`${i}_${t.field}`);n.filter((t=>t.name===l)).length||n.unshift({name:l,...s?{init:c8(s[r])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${hd(t.field)}] : null`}]:[],bind:o[t.field]??o[t.channel]??o})})),n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.filter((t=>t.name===i+D9))[0],s=i+$8,a=r.items.map((t=>MQ(`${i}_${t.field}`))),l=a.map((t=>`${t} !== null`)).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},m9="_toggle",y9={defined:t=>"point"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+m9,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+D9,i=e.name+m9;return`${i} ? null : ${n}, `+("global"===e.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${T9(t)}}, `)+`${i} ? ${n} : null`}},v9={defined:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e)=>{e.clear&&(e.clear=rd(e.clear)?$Y(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(g9.defined(e))for(const t of e.project.items){const i=n.findIndex((n=>n.name===MQ(`${e.name}_${t.field}`)));-1!==i&&n[i].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function i(t,i){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:i})}if("interval"===e.type)for(const t of e.project.items){const e=n.findIndex((e=>e.name===t.signals.visual));if(i(e,"[0, 0]"),-1===e){i(n.findIndex((e=>e.name===t.signals.data)),"null")}}else{let t=n.findIndex((t=>t.name===e.name+D9));i(t,"null"),y9.defined(e)&&(t=n.findIndex((t=>t.name===e.name+m9)),i(t,"false"))}return n}},b9={defined:t=>{const e="global"===t.resolve&&t.bind&&y6(t.bind),n=1===t.project.items.length&&t.project.items[0].field!==g6;return e&&!n&&y2("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n)=>{const i=aQ(n);if(i.select=rd(i.select)?{type:i.select,toggle:e.toggle}:{...i.select,toggle:e.toggle},z9(e,i),lh(n.select)&&(n.select.on||n.select.clear)){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events)n.filter=Oh(n.filter??[]),n.filter.includes(t)||n.filter.push(t)}const r=v6(e.bind)?e.bind.legend:"click",o=rd(r)?$Y(r,"view"):Oh(r);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const i=e.name,r=v6(e.bind)&&e.bind.legend,o=t=>e=>{const n=aQ(e);return n.markname=t,n};for(const t of e.project.items){if(!t.hasLegend)continue;const s=`${MQ(t.field)}_legend`,a=`${i}_${s}`;if(0===n.filter((t=>t.name===a)).length){const t=r.merge.map(o(`${s}_symbols`)).concat(r.merge.map(o(`${s}_labels`))).concat(r.merge.map(o(`${s}_entries`)));n.unshift({name:a,...e.init?{}:{value:null},on:[{events:t,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${a}`,force:!0}]})}}return n},signals:(t,e,n)=>{const i=e.name,r=e.project,o=n.find((t=>t.name===i+D9)),s=i+$8,a=r.items.filter((t=>t.hasLegend)).map((t=>MQ(`${i}_${MQ(t.field)}_legend`))),l=`${a.map((t=>`${t} !== null`)).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map((t=>({signal:t}))),update:l}):a.length>0&&(o.update=l,delete o.value,delete o.on);const c=n.find((t=>t.name===i+m9)),u=v6(e.bind)&&e.bind.legend;return c&&(e.events?c.on.push({...c.on[0],events:u}):c.on[0].events=u),n}};const x9="_translate_anchor",_9="_translate_delta",w9={defined:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const i=e.name,r=S8.defined(e),o=i+x9,{x:s,y:a}=e.project.hasChannel;let l=$Y(e.translate,"scope");return r||(l=l.map((t=>(t.between[0].markname=i+A8,t)))),n.push({name:o,value:{},on:[{events:l.map((t=>t.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==s?`, extent_x: ${r?M8(t,QQ):`slice(${s.signals.visual})`}`:"")+(void 0!==a?`, extent_y: ${r?M8(t,KQ):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+_9,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==s&&k9(t,e,s,"width",n),void 0!==a&&k9(t,e,a,"height",n),n}};function k9(t,e,n,i,r){const o=e.name,s=o+x9,a=o+_9,l=n.channel,c=S8.defined(e),u=r.filter((t=>t.name===n.signals[c?"data":"visual"]))[0],f=t.getSizeSignalRef(i).signal,h=t.getScaleComponent(l),d=h&&h.get("type"),p=h&&h.get("reverse"),g=`${s}.extent_${l}`,m=`${c&&h?"log"===d?"panLog":"symlog"===d?"panSymlog":"pow"===d?"panPow":"panLinear":"panLinear"}(${g}, ${`${c?l===QQ?p?"":"-":p?"-":"":""}${a}.${l} / ${c?`${f}`:`span(${g})`}`}${c?"pow"===d?`, ${h.get("exponent")??1}`:"symlog"===d?`, ${h.get("constant")??1}`:"":""})`;u.on.push({events:{signal:a},update:c?m:`clampRange(${m}, 0, ${f})`})}const $9="_zoom_anchor",C9="_zoom_delta",E9={defined:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const i=e.name,r=S8.defined(e),o=i+C9,{x:s,y:a}=e.project.hasChannel,l=hd(t.scaleName(QQ)),c=hd(t.scaleName(KQ));let u=$Y(e.zoom,"scope");return r||(u=u.map((t=>(t.markname=i+A8,t)))),n.push({name:i+$9,on:[{events:u,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter((t=>t)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==s&&S9(t,e,s,"width",n),void 0!==a&&S9(t,e,a,"height",n),n}};function S9(t,e,n,i,r){const o=e.name,s=n.channel,a=S8.defined(e),l=r.filter((t=>t.name===n.signals[a?"data":"visual"]))[0],c=t.getSizeSignalRef(i).signal,u=t.getScaleComponent(s),f=u&&u.get("type"),h=a?M8(t,s):l.name,d=o+C9,p=`${a&&u?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${o}${$9}.${s}`}, ${d}${a?"pow"===f?`, ${u.get("exponent")??1}`:"symlog"===f?`, ${u.get("constant")??1}`:"":""})`;l.on.push({events:{signal:d},update:a?p:`clampRange(${p}, 0, ${c})`})}const M9="_store",D9="_tuple",A9="_modify",F9="vlSelectionResolve",O9=[z8,N8,E8,y9,g9,S8,b9,v9,w9,E9,p9];function T9(t,{escape:e}={escape:!0}){let n=e?hd(t.name):t.name;const i=function(t){let e=t.parent;for(;e&&!xnt(e);)e=e.parent;return e}(t);if(i){const{facet:t}=i;for(const e of BK)t[e]&&(n+=` + '__facet_${e}_' + (facet[${hd(i.vgField(e))}])`)}return n}function N9(t){return CQ(t.component.selection??{}).reduce(((t,e)=>t||e.project.hasSelectionId),!1)}function z9(t,e){!rd(e.select)&&e.select.on||delete t.events,!rd(e.select)&&e.select.clear||delete t.clear,!rd(e.select)&&e.select.toggle||delete t.toggle}function L9(t){const e=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(e.push(...L9(t.object)),e.push(...L9(t.property))),e)}function R9(t){return"MemberExpression"===t.object.type?R9(t.object):"datum"===t.object.name}function P9(t){const e=XW(t),n=new Set;return e.visit((t=>{"MemberExpression"===t.type&&R9(t)&&n.add(L9(t).slice(1).join("."))})),n}class I9 extends p8{clone(){return new I9(null,this.model,aQ(this.filter))}constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=U9(this.model,this.filter,this),this._dependentFields=P9(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function B9(t,e,n,i="datum"){const r=rd(e)?e:e.param,o=MQ(r),s=hd(o+M9);let a;try{a=t.getSelectionComponent(o,r)}catch(t){return`!!${o}`}if(a.project.timeUnit){const e=n??t.component.data.raw,i=a.project.timeUnit.clone();e.parent?i.insertAsParentOf(e):e.parent=i}const l=`${a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${s}, ${i}${"global"===a.resolve?")":`, ${hd(a.resolve)})`}`,c=`length(data(${s}))`;return!1===e.empty?`${c} && ${l}`:`!${c} || ${l}`}function j9(t,e,n){const i=MQ(e),r=n.encoding;let o,s=n.field;try{o=t.getSelectionComponent(i,e)}catch(t){return i}if(r||s){if(r&&!s){const t=o.project.items.filter((t=>t.channel===r));!t.length||t.length>1?(s=o.project.items[0].field,y2((t.length?"Multiple ":"No ")+`matching ${hd(r)} encoding found for selection ${hd(n.param)}. `+`Using "field": ${hd(s)}.`)):s=t[0].field}}else s=o.project.items[0].field,o.project.items.length>1&&y2(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${hd(s)}.`);return`${o.name}[${hd(zQ(s))}]`}function U9(t,e,n){return DQ(e,(e=>rd(e)?e:function(t){return t?.param}(e)?B9(t,e,n):X2(e)))}function q9(t,e,n,i){var r,o;t.encode??(t.encode={}),(r=t.encode)[e]??(r[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=i}function W9(t,e,n,i={header:!1}){const{disable:r,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=t.combine();if(!r){for(const t in u){const n=k5[t],i=u[t];if(n&&n!==e&&"both"!==n)delete u[t];else if(_5(i)){const{condition:e,...n}=i,r=Oh(e),o=x5[t];if(o){const{vgProp:e,part:i}=o,s=[...r.map((t=>{const{test:e,...n}=t;return{test:U9(null,e),...n}})),n];q9(u,i,e,s),delete u[t]}else if(null===o){const e={signal:r.map((t=>{const{test:e,...n}=t;return`${U9(null,e)} ? ${E1(n)} : `})).join("")+E1(n)};u[t]=e}}else if(g1(i)){const e=x5[t];if(e){const{vgProp:n,part:r}=e;q9(u,r,n,i),delete u[t]}}dQ(["labelAlign","labelBaseline"],t)&&null===u[t]&&delete u[t]}if("grid"===e){if(!u.grid)return;if(u.encode){const{grid:t}=u.encode;u.encode={...t?{grid:t}:{}},kQ(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:IQ(c,0)}}{if(!i.header&&t.mainExtracted)return;if(void 0!==a){let t=a;u.encode?.labels?.update&&g1(u.encode.labels.update.text)&&(t=LQ(a,"datum.label",u.encode.labels.update.text.signal)),q9(u,"labels","text",{signal:t})}if(null===u.labelAlign&&delete u.labelAlign,u.encode){for(const e of w5)t.hasAxisPart(e)||delete u.encode[e];kQ(u.encode)&&delete u.encode}const e=function(t,e){if(t)return ah(t)&&!p1(t)?t.map((t=>a5(t,e))).join(", "):t}(l,n);return{scale:s,orient:o,grid:!1,...e?{title:e}:{},...u,...!1===n.aria?{aria:!1}:{},zindex:IQ(c,0)}}}}function H9(t){const{axes:e}=t.component,n=[];for(const i of C0)if(e[i])for(const r of e[i])if(!r.get("disable")&&!r.get("gridScale")){const e="x"===i?"height":"width",r=t.getSizeSignalRef(e).signal;e!==r&&n.push({name:e,update:r})}return n}function V9(t,e,n,i){return Object.assign.apply(null,[{},...t.map((t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",r=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},s=new Set([...$Q(r),...$Q(o)]),a={};for(const e of s.values())a[e]={signal:`${i.signal} === "${t}" ? ${S1(r[e])} : ${S1(o[e])}`};return a}return e[t]}))])}function Y9(t,e){const n=[{}];for(const i of t){let t=e[i]?.style;if(t){t=Oh(t);for(const i of t)n.push(e.style[i])}}return Object.assign.apply(null,n)}function G9(t,e,n,i={}){const r=T1(t,n,e);if(void 0!==r)return{configFrom:"style",configValue:r};for(const e of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==i[e]?.[t])return{configFrom:e,configValue:i[e][t]};return{}}const X9={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??function(t,e){return!m3(t)&&B7(e)&&!s1(e?.bin)&&!a1(e?.bin)}(n,t),gridScale:({model:t,channel:e})=>function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:i})=>t.labelAlign||Q9(e,n,i),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:i})=>t.labelBaseline||J9(e,n,i),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??function(t,e){if("x"===e&&dQ(["quantitative","temporal"],t))return!0;return}(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??function(t,e,n,i){if(n&&!lh(i)||"nominal"!==t&&"ordinal"!==t)return"log"!==e&&"symlog"!==e||"greedy";return}(e.type,n,B7(e)&&!!e.timeUnit,B7(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o="x"===t?"width":"y"===t?"height":void 0,s=o?e.getSizeSignalRef(o):void 0;return n.tickCount??function({fieldOrDatumDef:t,scaleType:e,size:n,values:i}){if(!i&&!m3(e)&&"log"!==e){if(B7(t)){if(s1(t.bin))return{signal:`ceil(${n.signal}/10)`};if(t.timeUnit&&dQ(["month","hours","day","quarter"],L2(t.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:function({format:t,fieldOrDatumDef:e}){if("d"===t)return 1;if(B7(e)){const{timeUnit:t}=e;if(t){const e=R2(t);if(e)return{signal:e}}}return},title:({axis:t,model:e,channel:n})=>{if(void 0!==t.title)return t.title;const i=K9(e,n);if(void 0!==i)return i;const r=e.typedFieldDef(n),o="x"===n?"x2":"y2",s=e.fieldDef(o);return z1(r?[F7(r)]:[],B7(s)?[F7(s)]:[])},values:({axis:t,fieldOrDatumDef:e})=>function(t,e){const n=t.values;if(ah(n))return v5(e,n);if(g1(n))return n;return}(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??function(t,e){if("rect"===t&&e5(e))return 1;return 0}(n,e)};function Z9(t){return`(((${t.signal} % 360) + 360) % 360)`}function J9(t,e,n,i){if(void 0!==t){if("x"===n){if(g1(t)){const n=Z9(t);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${g1(e)?`(${e.signal} === "top")`:"top"===e} ? "bottom" : "top"`}}if(45{if(X7(e)&&S7(e.sort)){const{field:i,timeUnit:r}=e,o=e.sort,s=o.map(((t,e)=>`${X2({field:i,timeUnit:r,equal:t})} ? ${e} : `)).join("")+o.length;t=new ttt(t,{calculate:s,as:ett(e,n,{forAs:!0})})}})),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${fQ(this.transform)}`}}function ett(t,e,n){return t5(t,{prefix:e,suffix:"sort_index",...n??{}})}function ntt(t,e){return dQ(["top","bottom"],e)?"column":dQ(["left","right"],e)||"row"===t?"row":"column"}function itt(t,e,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return IQ((e||{})[t],r[t],n.header[t])}function rtt(t,e,n,i){const r={};for(const o of t){const t=itt(o,e||{},n,i);void 0!==t&&(r[o]=t)}return r}const ott=["row","column"],stt=["header","footer"];function att(t,e){const n=t.component.layoutHeaders[e].title,i=t.config?t.config:void 0,r=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=rtt(["titleAnchor","titleAngle","titleOrient"],r.header,i,e),l=ntt(e,a),c=WQ(s);return{name:`${e}-title`,type:"group",role:`${l}-title`,title:{text:n,..."row"===e?{orient:"left"}:{},style:"guide-title",...ctt(c,l),...ltt(l,c,o),...mtt(i,r,e,f6,c6)}}}function ltt(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=Q9(e,"row"===t?"left":"top","row"===t?"y":"x");return i?{align:i}:{}}function ctt(t,e){const n=J9(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function utt(t,e){const n=t.component.layoutHeaders[e],i=[];for(const r of stt)if(n[r])for(const o of n[r]){const s=dtt(t,e,r,n,o);null!=s&&i.push(s)}return i}function ftt(t,e){const{sort:n}=t;return E7(n)?{field:t5(n,{expr:"datum"}),order:n.order??"ascending"}:ah(n)?{field:ett(t,e,{expr:"datum"}),order:"ascending"}:{field:t5(t,{expr:"datum"}),order:n??"ascending"}}function htt(t,e,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=rtt(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=d7({fieldOrDatumDef:t,format:i,formatType:r,expr:"parent",config:n}).signal,u=ntt(e,a);return{text:{signal:l?LQ(LQ(l,"datum.label",c),"datum.value",t5(t,{expr:"parent"})):c},..."row"===e?{orient:"left"}:{},style:"guide-label",frame:"group",...ctt(o,u),...ltt(u,o,s),...mtt(n,t,e,h6,u6)}}function dtt(t,e,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i,a=t.config?t.config:void 0;if(s&&r.labels){const{labelOrient:t}=rtt(["labelOrient"],s.header,a,e);("row"===e&&!dQ(["top","bottom"],t)||"column"===e&&!dQ(["left","right"],t))&&(o=htt(s,e,a))}const l=xnt(t)&&!M7(t.facet),c=r.axes,u=c?.length>0;if(o||u){const a="row"===e?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...i.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:ftt(s,e)}:{},...u&&l?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[a]:r.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const ptt={column:{start:0,end:1},row:{start:1,end:0}};function gtt(t,e){return ptt[e][t]}function mtt(t,e,n,i,r){const o={};for(const s of i){if(!r[s])continue;const i=itt(s,e?.header,t,n);void 0!==i&&(o[r[s]]=i)}return o}function ytt(t){return[...vtt(t,"width"),...vtt(t,"height"),...vtt(t,"childWidth"),...vtt(t,"childHeight")]}function vtt(t,e){const n="width"===e?"x":"y",i=t.component.layoutSize.get(e);if(!i||"merged"===i)return[];const r=t.getSizeSignalRef(e).signal;if("step"===i){const e=t.getScaleComponent(n);if(e){const i=e.get("type"),o=e.get("range");if(m3(i)&&m1(o)){const i=t.scaleName(n);if(xnt(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[btt(i,o)]}return[btt(i,o),{name:r,update:xtt(i,e,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const e=r.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${M6(t.config.view,e?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function btt(t,e){const n=`${t}_step`;return g1(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function xtt(t,e,n){const i=e.get("type"),r=e.get("padding"),o=IQ(e.get("paddingOuter"),r);let s=e.get("paddingInner");return s="band"===i?void 0!==s?s:r:1,`bandspace(${n}, ${S1(s)}, ${S1(o)}) * ${t}_step`}function _tt(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function wtt(t,e){return $Q(t).reduce(((n,i)=>{const r=t[i];return{...n,...L8(e,r,i,(t=>$1(t.value)))}}),{})}function ktt(t,e){if(xnt(e))return"theta"===t?"independent":"shared";if(wnt(e))return"shared";if(_nt(e))return E0(t)||"theta"===t||"radius"===t?"independent":"shared";throw new Error("invalid model type for resolve")}function $tt(t,e){const n=t.scale[e],i=E0(e)?"axis":"legend";return"independent"===n?("shared"===t[i][e]&&y2(function(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}(e)),"independent"):t[i][e]||"shared"}const Ctt=$Q({aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});class Ett extends Y4{}const Stt={symbols:function(t,{fieldOrDatumDef:e,model:n,channel:i,legendCmpt:r,legendType:o}){if("symbol"!==o)return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&"trail"!==c;let f={...M1({},n,Z3),...V8(n,{filled:u})};const h=r.get("symbolOpacity")??l.legend.symbolOpacity,d=r.get("symbolFillColor")??l.legend.symbolFillColor,p=r.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=void 0===h?Mtt(a.opacity)??s.opacity:void 0;if(f.fill)if("fill"===i||u&&i===hK)delete f.fill;else if(f.fill.field)d?delete f.fill:(f.fill=$1(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=$1(g??1));else if(ah(f.fill)){const t=Dtt(a.fill??a.color)??s.fill??(u&&s.color);t&&(f.fill=$1(t))}if(f.stroke)if("stroke"===i||!u&&i===hK)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(ah(f.stroke)){const t=IQ(Dtt(a.stroke||a.color),s.stroke,u?s.color:void 0);t&&(f.stroke={value:t})}if(i!==vK){const t=B7(e)&&Ftt(n,r,e);t?f.opacity=[{test:t,...$1(g??1)},$1(l.legend.unselectedOpacity)]:g&&(f.opacity=$1(g))}return f={...f,...t},kQ(f)?void 0:f},gradient:function(t,{model:e,legendType:n,legendCmpt:i}){if("gradient"!==n)return;const{config:r,markDef:o,encoding:s}=e;let a={};const l=i.get("gradientOpacity")??r.legend.gradientOpacity,c=void 0===l?Mtt(s.opacity)||o.opacity:void 0;c&&(a.opacity=$1(c));return a={...a,...t},kQ(a)?void 0:a},labels:function(t,{fieldOrDatumDef:e,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=B7(e)?Ftt(n,r,e):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;u7(u)?f=g7({fieldOrDatumDef:e,field:"datum.value",format:c,formatType:u,config:s}):void 0===c&&void 0===u&&s.customFormatTypes&&("quantitative"===e.type&&s.numberFormatType?f=g7({fieldOrDatumDef:e,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===e.type&&s.timeFormatType&&B7(e)&&void 0===e.timeUnit&&(f=g7({fieldOrDatumDef:e,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const h={...l?{opacity:l}:{},...f?{text:f}:{},...t};return kQ(h)?void 0:h},entries:function(t,{legendCmpt:e}){const n=e.get("selections");return n?.length?{...t,fill:{value:"transparent"}}:t}};function Mtt(t){return Att(t,((t,e)=>Math.max(t,e.value)))}function Dtt(t){return Att(t,((t,e)=>IQ(t,e.value)))}function Att(t,e){return function(t){const e=t?.condition;return!!e&&(ah(e)||G7(e))}(t)?Oh(t.condition).reduce(e,t.value):G7(t)?t.value:void 0}function Ftt(t,e,n){const i=e.get("selections");if(!i?.length)return;const r=hd(n.field);return i.map((t=>`(!length(data(${hd(MQ(t)+M9)})) || (${t}[${r}] && indexof(${t}[${r}], datum.value) >= 0))`)).join(" || ")}const Ott={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:i,formatType:r}=e;return m7(t,t.type,i,r,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:i}=t;return y7(i,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??function({legendConfig:t,model:e,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=t;if(v3(r))return"horizontal"===n?"top"===i||"bottom"===i?ztt(e,"width",s,o):s:ztt(e,"height",l,a);return}(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??function(t){if(dQ(["quantile","threshold","log","symlog"],t))return"greedy";return}(n),symbolType:({legend:t,markDef:e,channel:n,encoding:i})=>t.symbolType??function(t,e,n,i){if("shape"!==e){const t=Dtt(n)??i;if(t)return t}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(e.type,n,i.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>o5(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(PK(n)&&v3(e)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:({fieldOrDatumDef:t,legend:e})=>function(t,e){const n=t.values;if(ah(n))return v5(e,n);if(g1(n))return n;return}(e,t)};function Ttt(t){const{legend:e}=t;return IQ(e.type,function({channel:t,timeUnit:e,scaleType:n}){if(PK(t)){if(dQ(["quarter","month","day"],e))return"symbol";if(v3(n))return"gradient"}return"symbol"}(t))}function Ntt({legendConfig:t,legendType:e,orient:n,legend:i}){return i.direction??t[e?"gradientDirection":"symbolDirection"]??function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(n,e)}function ztt(t,e,n,i){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${i})`}}function Ltt(t){const e=bnt(t)?function(t){const{encoding:e}=t,n={};for(const i of[hK,...p6]){const r=u5(e[i]);r&&t.getScaleComponent(i)&&(i===gK&&B7(r)&&r.type===r3||(n[i]=Ptt(t,i)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const i of t.children){Ltt(i);for(const r of $Q(i.component.legends))n.legend[r]=$tt(t.component.resolve,r),"shared"===n.legend[r]&&(e[r]=Itt(e[r],i.component.legends[r]),e[r]||(n.legend[r]="independent",delete e[r]))}for(const i of $Q(e))for(const e of t.children)e.component.legends[i]&&"shared"===n.legend[i]&&delete e.component.legends[i];return e}(t);return t.component.legends=e,e}function Rtt(t,e,n,i){switch(e){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===e&&t===i?.title)return!0}return t===(n||{})[e]}function Ptt(t,e){let n=t.legend(e);const{markDef:i,encoding:r,config:o}=t,s=o.legend,a=new Ett({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){const i=t.fieldDef(e)?.field;for(const r of CQ(t.component.selection??{})){const t=r.project.hasField[i]??r.project.hasChannel[e];if(t&&b9.defined(r)){const e=n.get("selections")??[];e.push(r.name),n.set("selections",e,!1),t.hasLegend=!0}}}(t,e,a);const l=void 0!==n?!n:s.disable;if(a.set("disable",l,void 0!==n),l)return a;n=n||{};const c=t.getScaleComponent(e).get("type"),u=u5(r[e]),f=B7(u)?L2(u.timeUnit)?.unit:void 0,h=n.orient||o.legend.orient||"right",d=Ttt({legend:n,channel:e,timeUnit:f,scaleType:c}),p={legend:n,channel:e,model:t,markDef:i,encoding:r,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:h,legendType:d,direction:Ntt({legend:n,legendType:d,orient:h,legendConfig:s})};for(const i of Ctt){if("gradient"===d&&i.startsWith("symbol")||"symbol"===d&&i.startsWith("gradient"))continue;const r=i in Ott?Ott[i](p):n[i];if(void 0!==r){const s=Rtt(r,i,n,t.fieldDef(e));(s||void 0===o.legend[i])&&a.set(i,r,s)}}const g=n?.encoding??{},m=a.get("selections"),y={},v={fieldOrDatumDef:u,model:t,channel:e,legendCmpt:a,legendType:d};for(const e of["labels","legend","title","symbols","gradient","entries"]){const n=wtt(g[e]??{},t),i=e in Stt?Stt[e](n,v):n;void 0===i||kQ(i)||(y[e]={...m?.length&&B7(u)?{name:`${MQ(u.field)}_legend_${e}`}:{},...m?.length?{interactive:!!m}:{},update:i})}return kQ(y)||a.set("encode",y,!!n?.encoding),a}function Itt(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),i=e.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const n of Ctt){const i=Q4(t.getWithExplicit(n),e.getWithExplicit(n),n,"legend",((t,e)=>{switch(n){case"symbolType":return Btt(t,e);case"title":return R1(t,e);case"type":return r=!0,X4("symbol")}return J4(t,e,n,"legend")}));t.setWithExplicit(n,i)}return r&&(t.implicit?.encode?.gradient&&AQ(t.implicit,["encode","gradient"]),t.explicit?.encode?.gradient&&AQ(t.explicit,["encode","gradient"])),t}function Btt(t,e){return"circle"===e.value?e:t}function jtt(t){const e=t.component.legends,n={};for(const i of $Q(e)){const r=GQ(t.getScaleComponent(i).get("domains"));if(n[r])for(const t of n[r]){Itt(t,e[i])||n[r].push(e[i])}else n[r]=[e[i].clone()]}const i=CQ(n).flat().map((e=>function(t,e){const{disable:n,labelExpr:i,selections:r,...o}=t.combine();if(n)return;!1===e.aria&&null==o.aria&&(o.aria=!1);if(o.encode?.symbols){const t=o.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||o.stroke||(t.stroke={value:"transparent"});for(const e of p6)o[e]&&delete t[e]}o.title||delete o.title;if(void 0!==i){let t=i;o.encode?.labels?.update&&g1(o.encode.labels.update.text)&&(t=LQ(i,"datum.label",o.encode.labels.update.text.signal)),function(t,e,n,i){var r,o;t.encode??(t.encode={}),(r=t.encode)[e]??(r[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=i}(o,"labels","text",{signal:t})}return o}(e,t.config))).filter((t=>void 0!==t));return i}function Utt(t){return wnt(t)||_nt(t)?function(t){return t.children.reduce(((t,e)=>t.concat(e.assembleProjections())),qtt(t))}(t):qtt(t)}function qtt(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:i}=n;if(e.data){const r={signal:`[${e.size.map((t=>t.signal)).join(", ")}]`},o=e.data.reduce(((e,n)=>{const i=g1(n)?n.signal:`data('${t.lookupDataSource(n)}')`;return dQ(e,i)||e.push(i),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Wtt=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Htt extends Y4{constructor(t,e,n,i){super({...e},{name:t}),this.specifiedProjection=e,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Vtt(t){t.component.projection=bnt(t)?function(t){if(t.hasProjection){const e=h1(t.specifiedProjection),n=!(e&&(null!=e.scale||null!=e.translate)),i=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,r=n?function(t){const e=[],{encoding:n}=t;for(const i of[[cK,lK],[fK,uK]])(u5(n[i[0]])||u5(n[i[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});t.channelHasField(gK)&&t.typedFieldDef(gK).type===r3&&e.push({signal:t.getName(`geojson_${e.length}`)});0===e.length&&e.push(t.requestDataName(a8.Main));return e}(t):void 0,o=new Htt(t.projectionName(!0),{...h1(t.config.projection)??{},...e??{}},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}return}(t):function(t){if(0===t.children.length)return;let e;for(const e of t.children)Vtt(e);const n=gQ(t.children,(t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=gQ(Wtt,(n=>!Yh(t.explicit,n)&&!Yh(e.explicit,n)||!!(Yh(t.explicit,n)&&Yh(e.explicit,n)&&YQ(t.get(n),e.get(n))))),i=YQ(t.size,e.size);if(i){if(n)return t;if(YQ(t.explicit,{}))return e;if(YQ(e.explicit,{}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0}));if(e&&n){const n=t.projectionName(!0),i=new Htt(n,e.specifiedProjection,e.size,aQ(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&i.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return i}return}(t)}function Ytt(t,e,n,i){if(b5(e,n)){const r=bnt(t)?t.axis(n)??t.legend(n)??{}:{},o=t5(e,{expr:"datum"}),s=t5(e,{expr:"datum",binSuffix:"end"});return{formulaAs:t5(e,{binSuffix:"range",forAs:!0}),formula:_7(o,s,r.format,r.formatType,i)}}return{}}function Gtt(t,e){return`${o1(t)}_${e}`}function Xtt(t,e,n){const i=Gtt(p5(n,void 0)??{},e);return t.getName(`${i}_bins`)}function Ztt(t,e,n){let i,r;i=function(t){return"as"in t}(t)?rd(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:[t5(t,{forAs:!0}),t5(t,{binSuffix:"end",forAs:!0})];const o={...p5(e,void 0)},s=Gtt(o,t.field),{signal:a,extentSignal:l}=function(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}(n,s);if(c1(o.extent)){const t=o.extent;r=j9(n,t.param,t),delete o.extent}return{key:s,binComponent:{bin:o,field:t.field,as:[i],...a?{signal:a}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}}}}class Jtt extends p8{clone(){return new Jtt(null,aQ(this.bins))}constructor(t,e){super(t),this.bins=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,i)=>{if(Y7(n)&&s1(n.bin)){const{key:r,binComponent:o}=Ztt(n,n.bin,e);t[r]={...o,...t[r],...Ytt(e,n,i,e.config)}}return t}),{});return kQ(n)?null:new Jtt(t,n)}static makeFromTransform(t,e,n){const{key:i,binComponent:r}=Ztt(e,e.bin,n);return new Jtt(t,{[i]:r})}merge(t,e){for(const n of $Q(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=vQ([...this.bins[n].as,...t.bins[n].as],fQ)):this.bins[n]=t.bins[n];for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}producedFields(){return new Set(CQ(this.bins).map((t=>t.as)).flat(2))}dependentFields(){return new Set(CQ(this.bins).map((t=>t.field)))}hash(){return`Bin ${fQ(this.bins)}`}assemble(){return CQ(this.bins).flatMap((t=>{const e=[],[n,...i]=t.as,{extent:r,...o}=t.bin,s={type:"bin",field:zQ(t.field),as:n,signal:t.signal,...c1(r)?{extent:null}:{extent:r},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!r&&t.extentSignal&&(e.push({type:"extent",field:zQ(t.field),signal:t.extentSignal}),s.extent={signal:t.extentSignal}),e.push(s);for(const t of i)for(let i=0;i<2;i++)e.push({type:"formula",expr:t5({field:n[i]},{expr:"datum"}),as:t[i]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}function Qtt(t,e,n,i){const r=bnt(i)?i.encoding[n0(e)]:void 0;if(Y7(n)&&bnt(i)&&z7(n,r,i.markDef,i.config)){t.add(t5(n,{})),t.add(t5(n,{suffix:"end"}));const{mark:r,markDef:o,config:s}=i,a=T7({fieldDef:n,markDef:o,config:s});Y3(r)&&.5!==a&&E0(e)&&(t.add(t5(n,{suffix:b8})),t.add(t5(n,{suffix:x8}))),n.bin&&b5(n,e)&&t.add(t5(n,{binSuffix:"range"}))}else if(zK(e)){const n=NK(e);t.add(i.getName(n))}else t.add(t5(n));return X7(n)&&function(t){return lh(t)&&"field"in t}(n.scale?.range)&&t.add(n.scale.range.field),t}class Ktt extends p8{clone(){return new Ktt(null,new Set(this.dimensions),aQ(this.measures))}constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef((t=>{t.aggregate&&(n=!0)}));const i={},r=new Set;return n?(e.forEachFieldDef(((t,n)=>{const{aggregate:o,field:s}=t;if(o)if("count"===o)i["*"]??(i["*"]={}),i["*"].count=new Set([t5(t,{forAs:!0})]);else{if(Q0(o)||K0(o)){const t=Q0(o)?"argmin":"argmax",e=o[t];i[e]??(i[e]={}),i[e][t]=new Set([t5({op:t,field:e},{forAs:!0})])}else i[s]??(i[s]={}),i[s][o]=new Set([t5(t,{forAs:!0})]);W0(n)&&"unaggregated"===e.scaleDomain(n)&&(i[s]??(i[s]={}),i[s].min=new Set([t5({field:s,aggregate:"min"},{forAs:!0})]),i[s].max=new Set([t5({field:s,aggregate:"max"},{forAs:!0})]))}else Qtt(r,n,t,e)})),r.size+$Q(i).length===0?null:new Ktt(t,r,i)):null}static makeFromTransform(t,e){const n=new Set,i={};for(const t of e.aggregate){const{op:e,field:n,as:r}=t;e&&("count"===e?(i["*"]??(i["*"]={}),i["*"].count=new Set([r||t5(t,{forAs:!0})])):(i[n]??(i[n]={}),i[n][e]=new Set([r||t5(t,{forAs:!0})])))}for(const t of e.groupby??[])n.add(t);return n.size+$Q(i).length===0?null:new Ktt(t,n,i)}merge(t){return bQ(this.dimensions,t.dimensions)?(function(t,e){for(const n of $Q(e)){const i=e[n];for(const e of $Q(i))n in t?t[n][e]=new Set([...t[n][e]??[],...i[e]]):t[n]={[e]:i[e]}}}(this.measures,t.measures),!0):(function(...t){m2.debug(...t)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...$Q(this.measures)])}producedFields(){const t=new Set;for(const e of $Q(this.measures))for(const n of $Q(this.measures[e])){const i=this.measures[e][n];0===i.size?t.add(`${n}_${e}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${fQ({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],e=[],n=[];for(const i of $Q(this.measures))for(const r of $Q(this.measures[i]))for(const o of this.measures[i][r])n.push(o),t.push(r),e.push("*"===i?null:zQ(i));return{type:"aggregate",groupby:[...this.dimensions].map(zQ),ops:t,fields:e,as:n}}}class tet extends p8{constructor(t,e,n,i){super(t),this.model=e,this.name=n,this.data=i;for(const t of BK){const n=e.facet[t];if(n){const{bin:i,sort:r}=n;this[t]={name:e.getName(`${t}_domain`),fields:[t5(n),...s1(i)?[t5(n,{binSuffix:"end"})]:[]],...E7(r)?{sortField:r}:ah(r)?{sortIndexField:ett(n,t)}:{}}}}this.childModel=e.child}hash(){let t="Facet";for(const e of BK)this[e]&&(t+=` ${e.charAt(0)}:${fQ(this[e])}`);return t}get fields(){const t=[];for(const e of BK)this[e]?.fields&&t.push(...this[e].fields);return t}dependentFields(){const t=new Set(this.fields);for(const e of BK)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of C0){const n=this.childModel.component.scales[e];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(m3(i)&&m1(r)){const n=Xet(Zet(this.childModel,e));n?t[e]=n:y2(q1(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const i={row:"y",column:"x",facet:void 0}[t],r=[],o=[],s=[];i&&n&&n[i]&&(e?(r.push(`distinct_${n[i]}`),o.push("max")):(r.push(n[i]),o.push("distinct")),s.push(`distinct_${n[i]}`));const{sortField:a,sortIndexField:l}=this[t];if(a){const{op:t=w7,field:e}=a;r.push(e),o.push(t),s.push(t5(a,{forAs:!0}))}else l&&(r.push(l),o.push("max"),s.push(l));return{name:this[t].name,source:e??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...r.length?{fields:r,ops:o,as:s}:{}}]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],r={};for(const t of ott){for(const e of stt){const i=(n[t]&&n[t][e])??[];for(const e of i)if(e.axes?.length>0){r[t]=!0;break}}if(r[t]){const n=`length(data("${this.facet.name}"))`,r="row"===t?e?{signal:`ceil(${n} / ${e})`}:1:e?{signal:`min(${n}, ${e})`}:{signal:n};i.push({name:`${this.facet.name}_${t}`,transform:[{type:"sequence",start:0,stop:r}]})}}const{row:o,column:s}=r;return(o||s)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:r,facet:o}=this;if(i&&r&&(n.x||n.y)){e=`cross_${this.column.name}_${this.row.name}`;const i=[].concat(n.x??[],n.y??[]),r=i.map((()=>"distinct"));t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:r}]})}for(const i of[ZQ,XQ])this[i]&&t.push(this.assembleRowColumnHeaderData(i,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}function eet(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function net(t){const e={};return oQ(t.filter,(t=>{if(Y2(t)){let n=null;B2(t)?n=w1(t.equal):U2(t)?n=w1(t.lte):j2(t)?n=w1(t.lt):q2(t)?n=w1(t.gt):W2(t)?n=w1(t.gte):H2(t)?n=t.range[0]:V2(t)&&(n=(t.oneOf??t.in)[0]),n&&(v2(n)?e[t.field]="date":nd(n)?e[t.field]="number":rd(n)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function iet(t){const e={};function n(t){var n;m5(t)?e[t.field]="date":"quantitative"===t.type&&(rd(n=t.aggregate)&&dQ(["min","max"],n))?e[t.field]="number":PQ(t.field)>1?t.field in e||(e[t.field]="flatten"):X7(t)&&E7(t.sort)&&PQ(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((bnt(t)||xnt(t))&&t.forEachFieldDef(((e,i)=>{if(Y7(e))n(e);else{const r=t0(i),o=t.fieldDef(r);n({...e,type:o.type})}})),bnt(t)){const{mark:n,markDef:i,encoding:r}=t;if(V3(n)&&!t.encoding.order){const t=r["horizontal"===i.orient?"y":"x"];B7(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class ret extends p8{clone(){return new ret(null,aQ(this._parse))}constructor(t,e){super(t),this._parse=e}hash(){return`Parse ${fQ(this._parse)}`}static makeExplicit(t,e,n){let i={};const r=e.data;return!i8(r)&&r?.format?.parse&&(i=r.format.parse),this.makeWithAncestors(t,i,{},n)}static makeWithAncestors(t,e,n,i){for(const t of $Q(n)){const e=i.getWithExplicit(t);void 0!==e.value&&(e.explicit||e.value===n[t]||"derived"===e.value||"flatten"===n[t]?delete n[t]:y2(X1(t,n[t],e.value)))}for(const t of $Q(e)){const n=i.get(t);void 0!==n&&(n===e[t]?delete e[t]:y2(X1(t,e[t],n)))}const r=new Y4(e,n);i.copyAll(r);const o={};for(const t of $Q(r.combine())){const e=r.get(t);null!==e&&(o[t]=e)}return 0===$Q(o).length||i.parseNothing?null:new ret(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const e of $Q(this._parse)){const n=this._parse[e];1===PQ(e)&&(t[e]=n)}return t}producedFields(){return new Set($Q(this._parse))}dependentFields(){return new Set($Q(this._parse))}assembleTransforms(t=!1){return $Q(this._parse).filter((e=>!t||PQ(e)>1)).map((t=>{const e=function(t,e){const n=OQ(t);if("number"===e)return`toNumber(${n})`;if("boolean"===e)return`toBoolean(${n})`;if("string"===e)return`toString(${n})`;if("date"===e)return`toDate(${n})`;if("flatten"===e)return n;if(e.startsWith("date:"))return`timeParse(${n},'${eet(e.slice(5,e.length))}')`;if(e.startsWith("utc:"))return`utcParse(${n},'${eet(e.slice(4,e.length))}')`;return y2(`Unrecognized parse "${e}".`),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:RQ(t)}})).filter((t=>null!==t))}}class oet extends p8{clone(){return new oet(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([g6])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:g6}}}class set extends p8{clone(){return new set(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${fQ(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class aet extends p8{clone(){return new aet(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${fQ(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class cet extends p8{constructor(t){let e;if(super(null),t??(t={name:"source"}),i8(t)||(e=t.format?{...uQ(t.format,["parse"])}:{}),e8(t))this._data={values:t.values};else if(t8(t)){if(this._data={url:t.url},!e.type){let n=/(?:\.([^.]+))?$/.exec(t.url)[1];dQ(["json","csv","tsv","dsv","topojson"],n)||(n="json"),e.type=n}}else o8(t)?this._data={values:[{type:"Sphere"}]}:(n8(t)||i8(t))&&(this._data={});this._generator=i8(t),t.name&&(this._name=t.name),e&&!kQ(e)&&(this._data.format=e)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var uet,fet=function(t,e,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,n):r?r.value=n:e.set(t,n),n},het=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)};function det(t){return t instanceof cet||t instanceof set||t instanceof aet}class pet{constructor(){uet.set(this,void 0),fet(this,uet,!1,"f")}setModified(){fet(this,uet,!0,"f")}get modifiedFlag(){return het(this,uet,"f")}}uet=new WeakMap;class get extends pet{getNodeDepths(t,e,n){n.set(t,e);for(const i of t.children)this.getNodeDepths(i,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort(((t,e)=>e[1]-t[1]));for(const t of e)this.run(t[0]);return this.modifiedFlag}}class met extends pet{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class yet extends met{mergeNodes(t,e){const n=e.shift();for(const i of e)t.removeChild(i),i.parent=n,i.remove()}run(t){const e=t.children.map((t=>t.hash())),n={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(t,n[e]))}}class vet extends met{constructor(t){super(),this.requiresSelectionId=t&&N9(t)}run(t){t instanceof oet&&(this.requiresSelectionId&&(det(t.parent)||t.parent instanceof Ktt||t.parent instanceof ret)||(this.setModified(),t.remove()))}}class bet extends pet{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof v8&&(n=t.producedFields(),xQ(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const i of t.children)this.run(i,new Set([...e,...n]))}}class xet extends met{constructor(){super()}run(t){t instanceof g8&&!t.isRequired()&&(this.setModified(),t.remove())}}class _et extends get{run(t){if(!(det(t)||t.numChildren()>1))for(const e of t.children)if(e instanceof ret)if(t instanceof ret)this.setModified(),t.merge(e);else{if(wQ(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class wet extends get{run(t){const e=[...t.children],n=t.children.filter((t=>t instanceof ret));if(t.numChildren()>1&&n.length>=1){const i={},r=new Set;for(const t of n){const e=t.parse;for(const t of $Q(e))t in i?i[t]!==e[t]&&r.add(t):i[t]=e[t]}for(const t of r)delete i[t];if(!kQ(i)){this.setModified();const n=new ret(t,i);for(const r of e){if(r instanceof ret)for(const t of $Q(i))delete r.parse[t];t.removeChild(r),r.parent=n,r instanceof ret&&0===$Q(r.parse).length&&r.remove()}}}}}class ket extends get{run(t){t instanceof g8||t.numChildren()>0||t instanceof tet||t instanceof cet||(this.setModified(),t.remove())}}class $et extends get{run(t){const e=t.children.filter((t=>t instanceof v8)),n=e.pop();for(const t of e)this.setModified(),n.merge(t)}}class Cet extends get{run(t){const e=t.children.filter((t=>t instanceof Ktt)),n={};for(const t of e){const e=fQ(t.groupBy);e in n||(n[e]=[]),n[e].push(t)}for(const e of $Q(n)){const i=n[e];if(i.length>1){const e=i.pop();for(const n of i)e.merge(n)&&(t.removeChild(n),n.parent=e,n.remove(),this.setModified())}}}}class Eet extends get{constructor(t){super(),this.model=t}run(t){const e=!(det(t)||t instanceof I9||t instanceof ret||t instanceof oet),n=[],i=[];for(const r of t.children)r instanceof Jtt&&(e&&!wQ(t.producedFields(),r.dependentFields())?n.push(r):i.push(r));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Jtt?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(i.length>1){const t=i.pop();for(const e of i)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class Met extends get{run(t){const e=[...t.children];if(!pQ(e,(t=>t instanceof g8))||t.numChildren()<=1)return;const n=[];let i;for(const r of e)if(r instanceof g8){let e=r;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof g8))break;e=t}n.push(...e.children),i?(t.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=e,this.setModified()):i=e}else n.push(r);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=i}}}class Det extends p8{clone(){return new Det(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=vQ(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??t5(t)}hash(){return`JoinAggregateTransform ${fQ(this.transform)}`}assemble(){const t=[],e=[],n=[];for(const i of this.transform.joinaggregate)e.push(i.op),n.push(this.getDefaultName(i)),t.push(void 0===i.field?null:i.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==i?{groupby:i}:{}}}}class Aet extends p8{clone(){return new Aet(null,aQ(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:i,as:r,offset:o="zero"}=e,s=[],a=[];if(void 0!==e.sort)for(const t of e.sort)s.push(t.field),a.push(IQ(t.order,"ascending"));const l={field:s,order:a};let c;return c=function(t){return ah(t)&&t.every((t=>rd(t)))&&t.length>1}(r)?r:rd(r)?[r,`${r}_end`]:[`${e.stack}_start`,`${e.stack}_end`],new Aet(t,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,e){const n=e.stack,{encoding:i}=e;if(!n)return null;const{groupbyChannels:r,fieldChannel:o,offset:s,impute:a}=n,l=r.map((t=>c5(i[t]))).filter((t=>!!t)),c=function(t){return t.stack.stackBy.reduce(((t,e)=>{const n=t5(e.fieldDef);return n&&t.push(n),t}),[])}(e),u=e.encoding.order;let f;if(ah(u)||B7(u))f=N1(u);else{const t=L7(u)?u.sort:"y"===o?"descending":"ascending";f=c.reduce(((e,n)=>(e.field.push(n),e.order.push(t),e)),{field:[],order:[]})}return new Aet(t,{dimensionFieldDefs:l,stackField:e.vgField(o),facetby:[],stackby:c,sort:f,offset:s,impute:a,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${fQ(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:e,groupby:n}=this._stack;return t.length>0?t.map((t=>t.bin?e?[t5(t,{binSuffix:"mid"})]:[t5(t,{}),t5(t,{binSuffix:"end"})]:[t5(t)])).flat():n??[]}assemble(){const t=[],{facetby:e,dimensionFieldDefs:n,stackField:i,stackby:r,sort:o,offset:s,impute:a,as:l}=this._stack;if(a)for(const o of n){const{bandPosition:n=.5,bin:s}=o;if(s){const e=t5(o,{expr:"datum"}),i=t5(o,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${n}*${e}+${1-n}*${i}`,as:t5(o,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...r,...e],key:t5(o,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:i,sort:o,as:l,offset:s}),t}}class Fet extends p8{clone(){return new Fet(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=vQ(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach((e=>t.add(e.field))),this.transform.window.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??t5(t)}hash(){return`WindowTransform ${fQ(this.transform)}`}assemble(){const t=[],e=[],n=[],i=[];for(const r of this.transform.window)e.push(r.op),n.push(this.getDefaultName(r)),i.push(void 0===r.param?null:r.param),t.push(void 0===r.field?null:r.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&e.every((t=>t1(t))))return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==o?{groupby:o}:{}};const s=[],a=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),a.push(t.order??"ascending");const l={field:s,order:a},c=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:e,fields:t,sort:l,...void 0!==c?{ignorePeers:c}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function Oet(t){if(t instanceof tet)if(1!==t.numChildren()||t.children[0]instanceof g8){const n=t.model.component.data.main;Tet(n);const i=(e=t,function t(n){if(!(n instanceof tet)){const i=n.clone();if(i instanceof g8){const t=Net+i.getSource();i.setSource(t),e.model.component.data.outputNodes[t]=i}else(i instanceof Ktt||i instanceof Aet||i instanceof Fet||i instanceof Det)&&i.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=i;return[i]}return n.children.flatMap(t)}),r=t.children.map(i).flat();for(const t of r)t.parent=n}else{const e=t.children[0];(e instanceof Ktt||e instanceof Aet||e instanceof Fet||e instanceof Det)&&e.addDimensions(t.fields),e.swapWithParent(),Oet(t)}else t.children.map(Oet);var e}function Tet(t){if(t instanceof g8&&t.type===a8.Main&&1===t.numChildren()){const e=t.children[0];e instanceof tet||(e.swapWithParent(),Tet(t))}}const Net="scale_",zet=5;function Let(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!Let(e.children))return!1}return!0}function Ret(t,e){let n=!1;for(const i of e)n=t.optimize(i)||n;return n}function Pet(t,e,n){let i=t.sources,r=!1;return r=Ret(new xet,i)||r,r=Ret(new vet(e),i)||r,i=i.filter((t=>t.numChildren()>0)),r=Ret(new ket,i)||r,i=i.filter((t=>t.numChildren()>0)),n||(r=Ret(new _et,i)||r,r=Ret(new Eet(e),i)||r,r=Ret(new bet,i)||r,r=Ret(new wet,i)||r,r=Ret(new Cet,i)||r,r=Ret(new $et,i)||r,r=Ret(new yet,i)||r,r=Ret(new Met,i)||r),t.sources=i,r}class Iet{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new Iet((()=>t(e)))}}function Bet(t){bnt(t)?function(t){const e=t.component.scales;for(const n of $Q(e)){const i=jet(t,n);if(e[n].setWithExplicit("domains",i),Het(t,n),t.component.data.isFaceted){let e=t;for(;!xnt(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of i.value)y1(t)&&(t.data=Net+t.data.replace(Net,""))}}}(t):function(t){for(const e of t.children)Bet(e);const e=t.component.scales;for(const n of $Q(e)){let i,r=null;for(const e of t.children){const t=e.component.scales[n];if(t){i=void 0===i?t.getWithExplicit("domains"):Q4(i,t.getWithExplicit("domains"),"domains","scale",Yet);const e=t.get("selectionExtent");r&&e&&r.param!==e.param&&y2(Y1),r=e}}e[n].setWithExplicit("domains",i),r&&e[n].set("selectionExtent",r,!0)}}(t)}function jet(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:i}=t,r=function(t,e,n,i){if("unaggregated"===t){const{valid:t,reason:i}=Vet(e,n);if(!t)return void y2(i)}else if(void 0===t&&i.useUnaggregatedDomain){const{valid:t}=Vet(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return r!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:r}),"x"===e&&u5(i.x2)?u5(i.x)?Q4(qet(n,r,t,"x"),qet(n,r,t,"x2"),"domain","scale",Yet):qet(n,r,t,"x2"):"y"===e&&u5(i.y2)?u5(i.y)?Q4(qet(n,r,t,"y"),qet(n,r,t,"y2"),"domain","scale",Yet):qet(n,r,t,"y2"):qet(n,r,t,e)}function Uet(t,e,n){const i=L2(n)?.unit;return"temporal"===e||i?function(t,e,n){return t.map((t=>({signal:`{data: ${y5(t,{timeUnit:n,type:e})}}`})))}(t,e,i):[t]}function qet(t,e,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:l}=n,c=u5(r[i]),{type:u}=c,f=c.timeUnit;if(function(t){return t?.unionWith}(e)){const r=qet(t,void 0,n,i);return G4([...Uet(e.unionWith,u,f),...r.value])}if(g1(e))return G4([e]);if(e&&"unaggregated"!==e&&!x3(e))return G4(Uet(e,u,f));if(l&&i===l.fieldChannel){if("normalize"===l.offset)return X4([[0,1]]);const t=n.requestDataName(a8.Main);return X4([{data:t,field:n.vgField(i,{suffix:"start"})},{data:t,field:n.vgField(i,{suffix:"end"})}])}const h=W0(i)&&B7(c)?function(t,e,n){if(!m3(n))return;const i=t.fieldDef(e),r=i.sort;if(S7(r))return{op:"min",field:ett(i,e),order:"ascending"};const{stack:o}=t,s=o?new Set([...o.groupbyFields,...o.stackBy.map((t=>t.fieldDef.field))]):void 0;if(E7(r)){return Wet(r,o&&!s.has(r.field))}if(C7(r)){const{encoding:e,order:n}=r,i=t.fieldDef(e),{aggregate:a,field:l}=i,c=o&&!s.has(l);if(Q0(a)||K0(a))return Wet({field:t5(i),order:n},c);if(t1(a)||!a)return Wet({op:a,field:l,order:n},c)}else{if("descending"===r)return{op:"min",field:t.vgField(e),order:"descending"};if(dQ(["ascending",void 0],r))return!0}return}(n,i,t):void 0;if(U7(c)){return X4(Uet([c.datum],u,f))}const d=c;if("unaggregated"===e){const t=n.requestDataName(a8.Main),{field:e}=c;return X4([{data:t,field:t5({field:e,aggregate:"min"})},{data:t,field:t5({field:e,aggregate:"max"})}])}if(s1(d.bin)){if(m3(t))return X4("bin-ordinal"===t?[]:[{data:SQ(h)?n.requestDataName(a8.Main):n.requestDataName(a8.Raw),field:n.vgField(i,b5(d,i)?{binSuffix:"range"}:{}),sort:!0!==h&&lh(h)?h:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:t}=d;if(s1(t)){const e=Xtt(n,d.field,t);return X4([new Iet((()=>{const t=n.getSignalName(e);return`[${t}.start, ${t}.stop]`}))])}return X4([{data:n.requestDataName(a8.Main),field:n.vgField(i,{})}])}}if(d.timeUnit&&dQ(["time","utc"],t)){const t=r[n0(i)];if(z7(d,t,o,a)){const e=n.requestDataName(a8.Main),r=T7({fieldDef:d,fieldDef2:t,markDef:o,config:a}),l=Y3(s)&&.5!==r;return X4([{data:e,field:n.vgField(i,l?{suffix:b8}:{})},{data:e,field:n.vgField(i,{suffix:l?x8:"end"})}])}}return X4(h?[{data:SQ(h)?n.requestDataName(a8.Main):n.requestDataName(a8.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(a8.Main),field:n.vgField(i)}])}function Wet(t,e){const{op:n,field:i,order:r}=t;return{op:n??(e?"sum":w7),...i?{field:zQ(i)}:{},...r?{order:r}:{}}}function Het(t,e){const n=t.component.scales[e],i=t.specifiedScales[e].domain,r=t.fieldDef(e)?.bin,o=x3(i)&&i,s=l1(r)&&c1(r.extent)&&r.extent;(o||s)&&n.set("selectionExtent",o??s,!0)}function Vet(t,e){const{aggregate:n,type:i}=t;return n?rd(n)&&!r1.has(n)?{valid:!1,reason:a2(n)}:"quantitative"===i&&"log"===e?{valid:!1,reason:l2(t)}:{valid:!0}:{valid:!1,reason:s2(t)}}function Yet(t,e,n,i){return t.explicit&&e.explicit&&y2(function(t,e,n,i){return`Conflicting ${e.toString()} property "${t.toString()}" (${GQ(n)} and ${GQ(i)}). Using the union of the two domains.`}(n,i,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function Get(t){const e=vQ(t.map((t=>{if(y1(t)){const{sort:e,...n}=t;return n}return t})),fQ),n=vQ(t.map((t=>{if(y1(t)){const e=t.sort;return void 0===e||SQ(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}})).filter((t=>void 0!==t)),fQ);if(0===e.length)return;if(1===e.length){const e=t[0];if(y1(e)&&n.length>0){let t=n[0];if(n.length>1){y2(f2);const e=n.filter((t=>lh(t)&&"op"in t&&"min"!==t.op));t=!n.every((t=>lh(t)&&"op"in t))||1!==e.length||e[0]}else if(lh(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return{...e,sort:t}}return e}const i=vQ(n.map((t=>SQ(t)||!("op"in t)||rd(t.op)&&t.op in J0?t:(y2(function(t){return`Dropping sort property ${GQ(t)} as unioned domains only support boolean or op "count", "min", and "max".`}(t)),!0))),fQ);let r;1===i.length?r=i[0]:i.length>1&&(y2(f2),r=!0);const o=vQ(t.map((t=>y1(t)?t.data:null)),(t=>t));if(1===o.length&&null!==o[0]){return{data:o[0],fields:e.map((t=>t.field)),...r?{sort:r}:{}}}return{fields:e,...r?{sort:r}:{}}}function Xet(t){if(y1(t)&&rd(t.field))return t.field;if(function(t){return!ah(t)&&"fields"in t&&!("data"in t)}(t)){let e;for(const n of t.fields)if(y1(n)&&rd(n.field))if(e){if(e!==n.field)return y2("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),e}else e=n.field;return y2("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),e}if(function(t){return!ah(t)&&"fields"in t&&"data"in t}(t)){y2("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const e=t.fields[0];return rd(e)?e:void 0}}function Zet(t,e){const n=t.component.scales[e].get("domains").map((e=>(y1(e)&&(e.data=t.lookupDataSource(e.data)),e)));return Get(n)}function Jet(t){return wnt(t)||_nt(t)?t.children.reduce(((t,e)=>t.concat(Jet(e))),Qet(t)):Qet(t)}function Qet(t){return $Q(t.component.scales).reduce(((e,n)=>{const i=t.component.scales[n];if(i.merged)return e;const r=i.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=r,h=function(t,e,n,i){if(E0(n)){if(m1(t))return{step:{signal:`${e}_step`}}}else if(lh(t)&&y1(t))return{...t,data:i.lookupDataSource(t.data)};return t}(r.range,o,n,t),d=Zet(t,n),p=a?function(t,e,n,i){const r=j9(t,e.param,e);return{signal:y3(n.get("type"))&&ah(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}(t,a,i,d):null;return e.push({name:o,type:s,...d?{domain:d}:{},...p?{domainRaw:p}:{},range:h,...void 0!==u?{reverse:u}:{},...f}),e}),[])}class Ket extends Y4{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||pQ(this.get("domains"),(t=>ah(t)&&2===t.length&&nd(t[0])&&t[0]<=0&&nd(t[1])&&t[1]>=0))}}const tnt=["range","scheme"];function ent(t,e){const n=t.fieldDef(e);if(n?.bin){const{bin:i,field:r}=n,o=i0(e),s=t.getName(o);if(lh(i)&&i.binned&&void 0!==i.step)return new Iet((()=>{const n=t.scaleName(e),r=`(domain("${n}")[1] - domain("${n}")[0]) / ${i.step}`;return`${t.getSignalName(s)} / (${r})`}));if(s1(i)){const e=Xtt(t,r,i);return new Iet((()=>{const n=t.getSignalName(e),i=`(${n}.stop - ${n}.start) / ${n}.step`;return`${t.getSignalName(s)} / (${i})`}))}}}function nnt(t,e){const n=e.specifiedScales[t],{size:i}=e,r=e.getScaleComponent(t).get("type");for(const i of tnt)if(void 0!==n[i]){const o=D3(r,i),s=A3(t,i);if(o)if(s)y2(s);else switch(i){case"range":{const i=n.range;if(ah(i)){if(E0(t))return G4(i.map((t=>{if("width"===t||"height"===t){const n=e.getName(t),i=e.getSignalName.bind(e);return Iet.fromName(i,n)}return t})))}else if(lh(i))return G4({data:e.requestDataName(a8.Main),field:i.field,sort:{op:"min",field:e.vgField(t)}});return G4(i)}case"scheme":return G4(int(n[i]))}else y2(c2(r,i,t))}const o=t===QQ||"xOffset"===t?"width":"height",s=i[o];if(C6(s))if(E0(t))if(m3(r)){const n=ont(s,e,t);if(n)return G4({step:n})}else y2(u2(o));else if(F0(t)){const n=t===nK?"x":"y";if("band"===e.getScaleComponent(n).get("type")){const t=snt(s,r);if(t)return G4(t)}}const{rangeMin:a,rangeMax:l}=n,c=function(t,e){const{size:n,config:i,mark:r,encoding:o}=e,{type:s}=u5(o[t]),a=e.getScaleComponent(t),l=a.get("type"),{domain:c,domainMid:u}=e.specifiedScales[t];switch(t){case QQ:case KQ:if(dQ(["point","band"],l)){const r=ant(t,n,i.view);if(C6(r)){return{step:ont(r,e,t)}}}return rnt(t,e,l);case nK:case iK:return function(t,e,n){const i=t===nK?"x":"y",r=e.getScaleComponent(i);if(!r)return rnt(i,e,n,{center:!0});const o=r.get("type"),s=e.scaleName(i),{markDef:a,config:l}=e;if("band"===o){const t=ant(i,e.size,e.config.view);if(C6(t)){const e=snt(t,n);if(e)return e}return[0,{signal:`bandwidth('${s}')`}]}{const n=e.encoding[i];if(B7(n)&&n.timeUnit){const t=R2(n.timeUnit,(t=>`scale('${s}', ${t})`)),i=e.config.scale.bandWithNestedOffsetPaddingInner,r=T7({fieldDef:n,markDef:a,config:l})-.5,o=0!==r?` + ${r}`:"";if(i){return[{signal:`${g1(i)?`${i.signal}/2`+o:`${i/2+r}`} * (${t})`},{signal:`${g1(i)?`(1 - ${i.signal}/2)`+o:`${1-i/2+r}`} * (${t})`}]}return[0,{signal:t}]}return lQ(`Cannot use ${t} scale if ${i} scale is not discrete.`)}}(t,e,l);case mK:{const o=lnt(r,e.component.scales[t].get("zero"),i),s=function(t,e,n,i){const r={x:ent(n,"x"),y:ent(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const t=unt(e,r,i.view);return nd(t)?t-1:new Iet((()=>`${t.signal} - 1`))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const t=unt(e,r,i.view);return nd(t)?Math.pow(cnt*t,2):new Iet((()=>`pow(${cnt} * ${t.signal}, 2)`))}}throw new Error(n2("size",t))}(r,n,e,i);return b3(l)?function(t,e,n){const i=()=>{const i=S1(e),r=S1(t),o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};return g1(e)?new Iet(i):{signal:i()}}(o,s,function(t,e,n,i){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&ah(n)?n.length+1:(y2(function(t){return`Domain for ${t} is required for threshold scale.`}(i)),3)}}(l,i,c,t)):[o,s]}case sK:return[0,2*Math.PI];case yK:return[0,360];case rK:return[0,new Iet((()=>`min(${e.getSignalName("width")},${e.getSignalName("height")})/2`))];case _K:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case wK:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case gK:return"symbol";case hK:case dK:case pK:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==u?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case vK:case bK:case xK:return[i.scale.minOpacity,i.scale.maxOpacity]}}(t,e);return(void 0!==a||void 0!==l)&&D3(r,"rangeMin")&&ah(c)&&2===c.length?G4([a??c[0],l??c[1]]):X4(c)}function int(t){return function(t){return!rd(t)&&!!t.name}(t)?{scheme:t.name,...uQ(t,["name"])}:{scheme:t}}function rnt(t,e,n,{center:i}={}){const r=i0(t),o=e.getName(r),s=e.getSignalName.bind(e);return t===KQ&&y3(n)?i?[Iet.fromName((t=>`${s(t)}/2`),o),Iet.fromName((t=>`-${s(t)}/2`),o)]:[Iet.fromName(s,o),0]:i?[Iet.fromName((t=>`-${s(t)}/2`),o),Iet.fromName((t=>`${s(t)}/2`),o)]:[0,Iet.fromName(s,o)]}function ont(t,e,n){const{encoding:i}=e,r=e.getScaleComponent(n),o=o0(n),s=i[o];if("offset"===$6({step:t,offsetIsDiscrete:V7(s)&&K2(s.type)})&&F5(i,o)){const n=e.getScaleComponent(o);let i=`domain('${e.scaleName(o)}').length`;if("band"===n.get("type")){i=`bandspace(${i}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`}const s=r.get("paddingInner")??r.get("padding");return{signal:`${t.step} * ${i} / (1-${C1(s)})`}}return t.step}function snt(t,e){if("offset"===$6({step:t,offsetIsDiscrete:m3(e)}))return{step:t.step}}function ant(t,e,n){const i=t===QQ?"width":"height",r=e[i];return r||A6(n,i)}function lnt(t,e,n){if(e)return g1(e)?{signal:`${e.signal} ? 0 : ${lnt(t,!1,n)}`}:0;switch(t){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(n2("size",t))}const cnt=.95;function unt(t,e,n){const i=C6(t.width)?t.width.step:D6(n,"width"),r=C6(t.height)?t.height.step:D6(n,"height");return e.x||e.y?new Iet((()=>`min(${[e.x?e.x.signal:i,e.y?e.y.signal:r].join(", ")})`)):Math.min(i,r)}function fnt(t,e){bnt(t)?function(t,e){const n=t.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=t;for(const a of $Q(n)){const l=s[a],c=n[a],u=t.getScaleComponent(a),f=u5(r[a]),h=l[e],d=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=D3(d,e),y=A3(a,e);if(void 0!==h&&(m?y&&y2(y):y2(c2(d,e,a))),m&&void 0===y)if(void 0!==h){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":v2(l[e])||"temporal"===n||t?c.set(e,{signal:y5(l[e],{type:n,timeUnit:t})},!0):c.set(e,l[e],!0);break;default:c.copyKeyFromObject(e,l)}}else{const n=e in hnt?hnt[e]({model:t,channel:a,fieldOrDatumDef:f,scaleType:d,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:i,hasNestedOffsetScale:O5(r,a),hasSecondaryRangeChannel:!!r[n0(a)]}):i.scale[e];void 0!==n&&c.set(e,n,!1)}}}(t,e):pnt(t,e)}const hnt={bins:({model:t,fieldOrDatumDef:e})=>B7(e)?function(t,e){const n=e.bin;if(s1(n)){const i=Xtt(t,e.field,n);return new Iet((()=>t.getSignalName(i)))}if(a1(n)&&l1(n)&&void 0!==n.step)return{step:n.step};return}(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>function(t,e){if(dQ([hK,dK,pK],t)&&"nominal"!==e)return"hcl";return}(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>function(t,e,n,i,r,o){if(c5(o)?.bin||ah(n)||null!=r||null!=i||dQ([o3.TIME,o3.UTC],t))return;return!!E0(e)||void 0}(t,e,n,i,r,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:i,config:r})=>function(t,e,n,i,r,o){if(E0(t)){if(v3(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:s}=r;if("bar"===e&&(!B7(i)||!i.bin&&!i.timeUnit)&&("vertical"===s&&"x"===t||"horizontal"===s&&"y"===t))return o.continuousBandSize}if(e===o3.POINT)return n.pointPadding}return}(t,e,r.scale,n,i,r.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>function(t,e,n,i,r,o=!1){if(void 0!==t)return;if(E0(e)){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:s}=r;return o?s:IQ(t,"bar"===n?e:i)}if(F0(e)&&i===o3.BAND)return r.offsetBandPaddingInner;return}(t,e,n.type,i,r.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>function(t,e,n,i,r,o=!1){if(void 0!==t)return;if(E0(e)){const{bandPaddingOuter:t,bandWithNestedOffsetPaddingOuter:e}=r;if(o)return e;if(n===o3.BAND)return IQ(t,g1(i)?{signal:`${i.signal}/2`}:i/2)}else if(F0(e)){if(n===o3.POINT)return.5;if(n===o3.BAND)return r.offsetBandPaddingOuter}return}(t,e,n,i,r.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:i})=>function(t,e,n,i){if("x"===n&&void 0!==i.xReverse)return y3(t)&&"descending"===e?g1(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(y3(t)&&"descending"===e)return!0;return}(e,B7(t)?t.sort:void 0,n,i.scale),zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>function(t,e,n,i,r,o,s){if(n&&"unaggregated"!==n&&y3(r)){if(ah(n)){const t=n[0],e=n[n.length-1];if(nd(t)&&t<=0&&nd(e)&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!b3(r))return!0;if((!B7(e)||!e.bin)&&dQ([...C0,...M0],t)){const{orient:e,type:n}=i;return(!dQ(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t))&&(!(!dQ(["bar","area"],n)||s)||o?.zero)}return!1}(t,e,n,i,r,o.scale,s)};function dnt(t){bnt(t)?function(t){const e=t.component.scales;for(const n of q0){const i=e[n];if(!i)continue;const r=nnt(n,t);i.setWithExplicit("range",r)}}(t):pnt(t,"range")}function pnt(t,e){const n=t.component.scales;for(const n of t.children)"range"===e?dnt(n):fnt(n,e);for(const i of $Q(n)){let r;for(const n of t.children){const t=n.component.scales[i];if(t){r=Q4(r,t.getWithExplicit(e),e,"scale",Z4(((t,n)=>"range"===e&&t.step&&n.step?t.step-n.step:0)))}}n[i].setWithExplicit(e,r)}}function gnt(t,e,n,i,r=!1){const o=function(t,e,n,i){switch(e.type){case"nominal":case"ordinal":if(PK(t)||"discrete"===X0(t))return"shape"===t&&"ordinal"===e.type&&y2(o2(t,"ordinal")),"ordinal";if(E0(t)||F0(t)){if(dQ(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&t in S0)return"band";return K3(n[i0(t)])||Z7(e)&&e.axis?.tickBand?"band":"point";case"temporal":return PK(t)?"time":"discrete"===X0(t)?(y2(o2(t,"temporal")),"ordinal"):B7(e)&&e.timeUnit&&L2(e.timeUnit).utc?"utc":"time";case"quantitative":return PK(t)?B7(e)&&s1(e.bin)?"bin-ordinal":"linear":"discrete"===X0(t)?(y2(o2(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(K1(e.type))}(e,n,i,r),{type:s}=t;return W0(e)?void 0!==s?function(t,e,n=!1){if(!W0(t))return!1;switch(t){case QQ:case KQ:case nK:case iK:case sK:case rK:return!!v3(e)||"band"===e||"point"===e&&!n;case mK:case _K:case vK:case bK:case xK:case yK:return v3(e)||b3(e)||dQ(["band","point","ordinal"],e);case hK:case dK:case pK:return"band"!==e;case wK:case gK:return"ordinal"===e||b3(e)}}(e,s)?B7(n)&&(a=s,l=n.type,!(dQ([e3,i3],l)?void 0===a||m3(a):l===n3?dQ([o3.TIME,o3.UTC,void 0],a):l!==t3||h3(a)||b3(a)||void 0===a))?(y2(function(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}(s,o)),o):s:(y2(function(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}(e,s,o)),o):o:null;var a,l}function mnt(t){bnt(t)?t.component.scales=function(t){const{encoding:e,mark:n,markDef:i}=t,r={};for(const o of q0){const s=u5(e[o]);if(s&&n===H3&&o===gK&&s.type===r3)continue;let a=s&&s.scale;if(s&&null!==a&&!1!==a){a??(a={});const n=gnt(a,o,s,i,O5(e,o));r[o]=new Ket(t.scaleName(`${o}`,!0),{value:n,explicit:a.type===n})}}return r}(t):t.component.scales=function(t){var e;const n=t.component.scales={},i={},r=t.component.resolve;for(const n of t.children){mnt(n);for(const o of $Q(n.component.scales))if((e=r.scale)[o]??(e[o]=ktt(o,t)),"shared"===r.scale[o]){const t=i[o],e=n.component.scales[o].getWithExplicit("type");t?a3(t.value,e.value)?i[o]=Q4(t,e,"type","scale",ynt):(r.scale[o]="independent",delete i[o]):i[o]=e}}for(const e of $Q(i)){const r=t.scaleName(e,!0),o=i[e];n[e]=new Ket(r,o);for(const n of t.children){const t=n.component.scales[e];t&&(n.renameScale(t.get("name"),r),t.merged=!0)}}return n}(t)}const ynt=Z4(((t,e)=>c3(t)-c3(e)));class vnt{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function bnt(t){return"unit"===t?.type}function xnt(t){return"facet"===t?.type}function _nt(t){return"concat"===t?.type}function wnt(t){return"layer"===t?.type}class knt{constructor(t,e,n,i,r,o,s){this.type=e,this.parent=n,this.config=r,this.correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t),this.parent=n,this.config=r,this.view=h1(s),this.name=t.name??i,this.title=p1(t.title)?{text:t.title}:t.title?h1(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new vnt,this.projectionNameMap=n?n.projectionNameMap:new vnt,this.signalNameMap=n?n.signalNameMap:new vnt,this.data=t.data,this.description=t.description,this.transforms=function(t){return t.map((t=>p4(t)?{filter:sQ(t.filter,J2)}:t))}(t.transform??[]),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){const i=n[e],r={},{spacing:o,columns:s}=i;void 0!==o&&(r.spacing=o),void 0!==s&&(A7(t)&&!M7(t.facet)||_6(t))&&(r.columns=s),w6(t)&&(r.columns=1);for(const e of S6)if(void 0!==t[e])if("spacing"===e){const n=t[e];r[e]=nd(n)?n:{row:n.row??o,column:n.column??o}}else r[e]=t[e];return r}(t,e,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:A7(t)||n?.component.data.isFaceted&&void 0===t.data},layoutSize:new Y4,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?aQ(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(t,{ignoreRange:e}={}){mnt(t),Bet(t);for(const e of M3)fnt(t,e);e||dnt(t)}(this)}parseProjection(){Vtt(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Ltt(this)}assembleEncodeFromView(t){const{style:e,...n}=t,i={};for(const t of $Q(n)){const e=n[t];void 0!==e&&(i[t]=$1(e))}return i}assembleGroupEncodeEntry(t){let e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),t||(this.description&&(e.description=$1(this.description)),"unit"!==this.type&&"layer"!==this.type)?kQ(e)?void 0:e:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...e??{}}}assembleLayout(){if(!this.layout)return;const{spacing:t,...e}=this.layout,{component:n,config:i}=this,r=function(t,e){const n={};for(const i of BK){const r=t[i];if(r?.facetFieldDef){const{titleAnchor:t,titleOrient:o}=rtt(["titleAnchor","titleOrient"],r.facetFieldDef.header,e,i),s=ntt(i,o),a=gtt(t,s);void 0!==a&&(n[s]=a)}}return kQ(n)?void 0:n}(n.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...e,...r?{titleBand:r}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of BK)t[n].title&&e.push(att(this,n));for(const t of ott)e=e.concat(utt(this,t));return e}assembleAxes(){return function(t,e){const{x:n=[],y:i=[]}=t;return[...n.map((t=>W9(t,"grid",e))),...i.map((t=>W9(t,"grid",e))),...n.map((t=>W9(t,"main",e))),...i.map((t=>W9(t,"main",e)))].filter((t=>t))}(this.component.axes,this.config)}assembleLegends(){return jtt(this)}assembleProjections(){return Utt(this)}assembleTitle(){const{encoding:t,...e}=this.title??{},n={...d1(this.config.title).nonMarkTitleProperties,...e,...t?{encode:{update:t}}:{}};if(n.text)return dQ(["unit","layer"],this.type)?dQ(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),kQ(n)?void 0:n}assembleGroup(t=[]){const e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||xnt(this.parent)?Jet(this):[];i.length>0&&(e.scales=i);const r=this.assembleAxes();r.length>0&&(e.axes=r);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return MQ((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(a8[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(xnt(this.parent)){const e=D0(_tt(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),i=n.get("range");if(m3(t)&&m1(i)){const t=n.get("name"),i=Xet(Zet(this,e));if(i){return{signal:xtt(t,n,t5({aggregate:"distinct",field:i},{expr:"datum"}))}}return y2(q1(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):JK(t)&&W0(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(function(t){return`Cannot find a selection named "${t}".`}(e));return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((t=>t.hasOrientSignalRef()))||this.component.axes.y?.some((t=>t.hasOrientSignalRef()))}}class $nt extends knt{vgField(t,e={}){const n=this.fieldDef(t);if(n)return t5(n,e)}reduceFieldDef(t,e){return function(t,e,n,i){return t?$Q(t).reduce(((n,r)=>{const o=t[r];return ah(o)?o.reduce(((t,n)=>e.call(i,t,n,r)),n):e.call(i,n,o,r)}),n):n}(this.getMapping(),((e,n,i)=>{const r=c5(n);return r?t(e,r,i):e}),e)}forEachFieldDef(t,e){R5(this.getMapping(),((e,n)=>{const i=c5(e);i&&t(i,n)}),e)}}class Cnt extends p8{clone(){return new Cnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${fQ(this.transform)}`}assemble(){const{density:t,...e}=this.transform,n={type:"kde",field:t,...e};return this.transform.groupby&&(n.resolve="shared"),n}}class Ent extends p8{clone(){return new Ent(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${fQ(this.transform)}`}assemble(){const{extent:t,param:e}=this.transform;return{type:"extent",field:t,signal:e}}}class Snt extends p8{clone(){return new Snt(null,{...this.filter})}constructor(t,e){super(t),this.filter=e}static make(t,e){const{config:n,mark:i,markDef:r}=e;if("filter"!==A1("invalid",r,n))return null;const o=e.reduceFieldDef(((t,n,r)=>{const o=W0(r)&&e.getScaleComponent(r);if(o){y3(o.get("type"))&&"count"!==n.aggregate&&!V3(i)&&(t[n.field]=n)}return t}),{});return $Q(o).length?new Snt(t,o):null}dependentFields(){return new Set($Q(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${fQ(this.filter)}`}assemble(){const t=$Q(this.filter).reduce(((t,e)=>{const n=this.filter[e],i=t5(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`):"quantitative"===n.type&&(t.push(`isValid(${i})`),t.push(`isFinite(+${i})`))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class Mnt extends p8{clone(){return new Mnt(this.parent,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((t,e)=>i[e]??t))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${fQ(this.transform)}`}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class Dnt extends p8{clone(){return new Dnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"key",n[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${fQ(this.transform)}`}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class Ant extends p8{clone(){return new Ant(null,aQ(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const i of[[cK,lK],[fK,uK]]){const r=i.map((t=>{const n=u5(e.encoding[t]);return B7(n)?n.field:U7(n)?{expr:`${n.datum}`}:G7(n)?{expr:`${n.value}`}:void 0}));(r[0]||r[1])&&(t=new Ant(t,r,null,e.getName("geojson_"+n++)))}if(e.channelHasField(gK)){const i=e.typedFieldDef(gK);i.type===r3&&(t=new Ant(t,null,i.field,e.getName("geojson_"+n++)))}return t}constructor(t,e,n,i){super(t),this.fields=e,this.geojson=n,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(rd);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${fQ(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Fnt extends p8{clone(){return new Fnt(null,this.projection,aQ(this.fields),aQ(this.as))}constructor(t,e,n,i){super(t),this.projection=e,this.fields=n,this.as=i}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[[cK,lK],[fK,uK]]){const i=n.map((t=>{const n=u5(e.encoding[t]);return B7(n)?n.field:U7(n)?{expr:`${n.datum}`}:G7(n)?{expr:`${n.value}`}:void 0})),r=n[0]===fK?"2":"";(i[0]||i[1])&&(t=new Fnt(t,e.projectionName(),i,[e.getName(`x${r}`),e.getName(`y${r}`)]))}return t}dependentFields(){return new Set(this.fields.filter(rd))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${fQ(this.fields)} ${fQ(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Ont extends p8{clone(){return new Ont(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:i}=t;return{signal:`sequence(${[e,n,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,e){return new Ont(t,e)}static makeFromEncoding(t,e){const n=e.encoding,i=n.x,r=n.y;if(B7(i)&&B7(r)){const o=i.impute?i:r.impute?r:void 0;if(void 0===o)return;const s=i.impute?r:r.impute?i:void 0,{method:a,value:l,frame:c,keyvals:u}=o.impute,f=P5(e.mark,n);return new Ont(t,{impute:o.field,key:s.field,...a?{method:a}:{},...void 0!==l?{value:l}:{},...c?{frame:c}:{},...void 0!==u?{keyvals:u}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${fQ(this.transform)}`}assemble(){const{impute:t,key:e,keyvals:n,method:i,groupby:r,value:o,frame:s=[null,null]}=this.transform,a={type:"impute",field:t,key:e,...n?{keyvals:g4(n)?this.processSequence(n):n}:{},method:"value",...r?{groupby:r}:{},value:i&&"value"!==i?null:o};if(i&&"value"!==i){return[a,{type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:s,ignorePeers:!1,...r?{groupby:r}:{}},{type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t}]}return[a]}}class Tnt extends p8{clone(){return new Tnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??e.on,n[1]??e.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${fQ(this.transform)}`}assemble(){const{loess:t,on:e,...n}=this.transform;return{type:"loess",x:e,y:t,...n}}}class Nnt extends p8{clone(){return new Nnt(null,aQ(this.transform),this.secondary)}constructor(t,e,n){super(t),this.transform=e,this.secondary=n}static make(t,e,n,i){const r=e.component.data.sources,{from:o}=n;let s=null;if(function(t){return"data"in t}(o)){let t=Xnt(o.data,r);t||(t=new cet(o.data),r.push(t));const n=e.getName(`lookup_${i}`);s=new g8(t,n,a8.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=s}else if(function(t){return"param"in t}(o)){const t=o.param;let i;n={as:t,...n};try{i=e.getSelectionComponent(MQ(t),t)}catch(e){throw new Error(function(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}(t))}if(s=i.materialized,!s)throw new Error(function(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}(t))}return new Nnt(t,n,s.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Oh(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${fQ({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Oh(this.transform.as)}:{}};else{let e=this.transform.as;rd(e)||(y2('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),e="_lookup"),t={as:[e]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class znt extends p8{clone(){return new znt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"prob",n[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${fQ(this.transform)}`}assemble(){const{quantile:t,...e}=this.transform;return{type:"quantile",field:t,...e}}}class Lnt extends p8{clone(){return new Lnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=aQ(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??e.on,n[1]??e.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${fQ(this.transform)}`}assemble(){const{regression:t,on:e,...n}=this.transform;return{type:"regression",x:e,y:t,...n}}}class Rnt extends p8{clone(){return new Rnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=vQ((this.transform.groupby??[]).concat(t),(t=>t))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${fQ(this.transform)}`}assemble(){const{pivot:t,value:e,groupby:n,limit:i,op:r}=this.transform;return{type:"pivot",field:t,value:e,...void 0!==i?{limit:i}:{},...void 0!==r?{op:r}:{},...void 0!==n?{groupby:n}:{}}}}class Pnt extends p8{clone(){return new Pnt(null,aQ(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${fQ(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Int(t){let e=0;return function n(i,r){if(i instanceof cet&&!i.isGenerator&&!t8(i.data)){t.push(r);r={name:null,source:r.name,transform:[]}}if(i instanceof ret&&(i.parent instanceof cet&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof tet)return r.name||(r.name="data_"+e++),!r.source||r.transform.length>0?(t.push(r),i.data=r.name):i.data=r.source,void t.push(...i.assemble());if((i instanceof set||i instanceof aet||i instanceof Snt||i instanceof I9||i instanceof ttt||i instanceof Fnt||i instanceof Ktt||i instanceof Nnt||i instanceof Fet||i instanceof Det||i instanceof Dnt||i instanceof Mnt||i instanceof Cnt||i instanceof Tnt||i instanceof znt||i instanceof Lnt||i instanceof oet||i instanceof Pnt||i instanceof Rnt||i instanceof Ent)&&r.transform.push(i.assemble()),(i instanceof Jtt||i instanceof v8||i instanceof Ont||i instanceof Aet||i instanceof Ant)&&r.transform.push(...i.assemble()),i instanceof g8)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof g8)i.setSource(r.name);else if(r.name||(r.name="data_"+e++),i.setSource(r.name),1===i.numChildren()){t.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof g8&&(!r.source||r.transform.length>0)&&t.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_"+e++);let o=r.name;!r.source||r.transform.length>0?t.push(r):o=r.source;for(const t of i.children){n(t,{name:null,source:o,transform:[]})}break}}}}function Bnt(t){return"top"===t||"left"===t||g1(t)?"header":"footer"}function jnt(t,e){const{facet:n,config:i,child:r,component:o}=t;if(t.channelHasField(e)){const s=n[e],a=itt("title",null,i,e);let l=o5(s,i,{allowDisabling:!0,includeDefault:void 0===a||!!a});r.component.layoutHeaders[e].title&&(l=ah(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[e].title}`,r.component.layoutHeaders[e].title=null);const c=itt("labelOrient",s.header,i,e),u=null!==s.header&&IQ(s.header?.labels,i.header.labels,!0),f=dQ(["bottom","right"],c)?"footer":"header";o.layoutHeaders[e]={title:null!==s.header?l:null,facetFieldDef:s,[f]:"facet"===e?[]:[Unt(t,e,u)]}}}function Unt(t,e,n){const i="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(i)?t.child.getSizeSignalRef(i):void 0,axes:[]}}function qnt(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:i,resolve:r}=t.component;if(r.axis[e]=$tt(r,e),"shared"===r.axis[e]){const r="x"===e?"column":"row",o=i[r];for(const i of n.component.axes[e]){const e=Bnt(i.get("orient"));o[e]??(o[e]=[Unt(t,r,!1)]);const n=W9(i,"main",t.config,{header:!0});n&&o[e][0].axes.push(n),i.mainExtracted=!0}}}}function Wnt(t){for(const e of t.children)e.parseLayoutSize()}function Hnt(t,e){const n=_tt(e),i=D0(n),r=t.component.resolve,o=t.component.layoutSize;let s;for(const e of t.children){const o=e.component.layoutSize.getWithExplicit(n),a=r.scale[i]??ktt(i,t);if("independent"===a&&"step"===o.value){s=void 0;break}if(s){if("independent"===a&&s.value!==o.value){s=void 0;break}s=Q4(s,o,n,"")}else s=o}if(s){for(const i of t.children)t.renameSignal(i.getName(n),t.getName(e)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,s)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function Vnt(t,e){const n="width"===e?"x":"y",i=t.config,r=t.getScaleComponent(n);if(r){const t=r.get("type"),n=r.get("range");if(m3(t)){const t=A6(i.view,e);return m1(n)||C6(t)?"step":t}return M6(i.view,e)}if(t.hasProjection||"arc"===t.mark)return M6(i.view,e);{const t=A6(i.view,e);return C6(t)?t.step:t}}function Ynt(t,e,n){return t5(e,{suffix:`by_${t5(t)}`,...n??{}})}class Gnt extends $nt{constructor(t,e,n,i){super(t,"facet",e,n,i,t.resolve),this.child=wit(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!M7(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=$Q(t),n={};for(const i of e){if(![XQ,ZQ].includes(i)){y2(n2(i,"facet"));break}const e=t[i];if(void 0===e.field){y2(e2(e,i));break}n[i]=this.initFacetFieldDef(e,i)}return n}initFacetFieldDef(t,e){const n=d5(t,e);return n.header?n.header=h1(n.header):null===n.header&&(n.header=null),n}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Znt(this),this.child.parseData()}parseLayoutSize(){Wnt(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of BK)jnt(t,e);qnt(t,"x"),qnt(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const e of BK)for(const n of stt){const i=this.component.layoutHeaders[e],r=i[n],{facetFieldDef:o}=i;if(o){const n=itt("titleOrient",o.header,this.config,e);if(["right","bottom"].includes(n)){const i=ntt(e,n);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[i]="end"}}if(r?.[0]){const r="row"===e?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===e||this.child.component.layoutSize.get(r)||(t[o]??(t[o]={}),t[o][e]=.5),i.title&&(t.offset??(t.offset={}),t.offset["row"===e?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let i="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Gnt)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Gnt?{...this.channelHasField("column")?{encode:{update:{columns:{field:t5(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof Gnt){if(this.child.channelHasField("column")){const i=t5(this.child.facet.column);t.push(i),e.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of C0){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(m3(o)&&m1(s)){const r=Xet(Zet(this.child,i));r?(t.push(r),e.push("distinct"),n.push(`distinct_${r}`)):y2(q1(i))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:o,as:s}=this.getCardinalityAggregateForChild(),a=[];for(const t of BK){const e=this.facet[t];if(e){a.push(t5(e));const{bin:l,sort:c}=e;if(s1(l)&&a.push(t5(e,{binSuffix:"end"})),E7(c)){const{field:t,op:a=w7}=c,l=Ynt(e,c);n&&i?(r.push(l),o.push("max"),s.push(l)):(r.push(t),o.push(a),s.push(l))}else if(ah(c)){const n=ett(e,t);r.push(n),o.push("max"),s.push(n)}}}const l=!!n&&!!i;return{name:t,data:e,groupby:a,...l||r.length>0?{aggregate:{...l?{cross:l}:{},...r.length?{fields:r,ops:o,as:s}:{}}}:{}}}facetSortFields(t){const{facet:e}=this,n=e[t];return n?E7(n.sort)?[Ynt(n,n.sort,{expr:"datum"})]:ah(n.sort)?[ett(n,t,{expr:"datum"})]:[t5(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(E7(t)?t.order:!ah(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:e}=this;if(t.facet)return htt(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const i of ott)if(t[i]){const r=itt("labelOrient",t[i]?.header,e,i);if(n[i].includes(r))return htt(t[i],i,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=Int(e);for(const e of t.children)n(e,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||t.assembleTitle(),r=t.assembleGroupStyle(),o={name:this.getName("cell"),type:"group",...i?{title:i}:{},...r?{style:r}:{},from:{facet:this.assembleFacet()},sort:{field:BK.map((t=>this.facetSortFields(t))).flat(),order:BK.map((t=>this.facetSortOrder(t))).flat()},...e.length>0?{data:e}:{},...n?{encode:{update:n}}:{},...t.assembleGroup(f8(this,[]))};return[o]}getMapping(){return this.facet}}function Xnt(t,e){for(const n of e){const e=n.data;if(t.name&&n.hasName()&&t.name!==n.dataName)continue;const i=t.format?.mesh,r=e.format?.feature;if(i&&r)continue;const o=t.format?.feature;if((o||r)&&o!==r)continue;const s=e.format?.mesh;if(!i&&!s||i===s)if(e8(t)&&e8(e)){if(YQ(t.values,e.values))return n}else if(t8(t)&&t8(e)){if(t.url===e.url)return n}else if(n8(t)&&t.name===n.dataName)return n}return null}function Znt(t){let e=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new cet({values:[]});return e.push(t),t}const n=Xnt(t.data,e);if(n)return i8(t.data)||(n.data.format=mQ({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new cet(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=t.component.data,r=t.data,o=!(r&&(i8(r)||t8(r)||e8(r)))&&t.parent?t.parent.component.data.ancestorParse.clone():new K4;i8(r)?(r8(r)?e=new aet(e,r.sequence):s8(r)&&(e=new set(e,r.graticule)),o.parseNothing=!0):null===r?.format?.parse&&(o.parseNothing=!0),e=ret.makeExplicit(e,t,o)??e,e=new oet(e);const s=t.parent&&wnt(t.parent);(bnt(t)||xnt(t))&&s&&(e=Jtt.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=function(t,e,n){let i=0;for(const r of e.transforms){let o,s;if(E4(r))s=t=new ttt(t,r),o="derived";else if(p4(r)){const i=net(r);s=t=ret.makeWithAncestors(t,{},i,n)??t,t=new I9(t,e,r.filter)}else if(S4(r))s=t=Jtt.makeFromTransform(t,r,e),o="number";else if(D4(r))o="date",void 0===n.getWithExplicit(r.field).value&&(t=new ret(t,{[r.field]:o}),n.set(r.field,o,!1)),s=t=v8.makeFromTransform(t,r);else if(A4(r))s=t=Ktt.makeFromTransform(t,r),o="number",N9(e)&&(t=new oet(t));else if(m4(r))s=t=Nnt.make(t,e,r,i++),o="derived";else if(k4(r))s=t=new Fet(t,r),o="number";else if($4(r))s=t=new Det(t,r),o="number";else if(F4(r))s=t=Aet.makeFromTransform(t,r),o="derived";else if(O4(r))s=t=new Dnt(t,r),o="derived";else if(T4(r))s=t=new Ent(t,r),o="derived";else if(C4(r))s=t=new Mnt(t,r),o="derived";else if(y4(r))s=t=new Rnt(t,r),o="derived";else if(w4(r))t=new Pnt(t,r);else if(M4(r))s=t=Ont.makeFromTransform(t,r),o="derived";else if(v4(r))s=t=new Cnt(t,r),o="derived";else if(b4(r))s=t=new znt(t,r),o="derived";else if(x4(r))s=t=new Lnt(t,r),o="derived";else{if(!_4(r)){y2(Z1(r));continue}s=t=new Tnt(t,r),o="derived"}if(s&&void 0!==o)for(const t of s.producedFields()??[])n.set(t,o,!1)}return t}(e,t,o));const a=function(t){const e={};if(bnt(t)&&t.component.selection)for(const n of $Q(t.component.selection)){const i=t.component.selection[n];for(const t of i.project.items)!t.channel&&PQ(t.field)>1&&(e[t.field]="flatten")}return e}(t),l=iet(t);e=ret.makeWithAncestors(e,{},{...a,...l},o)??e,bnt(t)&&(e=Ant.parseAll(e,t),e=Fnt.parseAll(e,t)),(bnt(t)||xnt(t))&&(s||(e=Jtt.makeFromEncoding(e,t)??e),e=v8.makeFromEncoding(e,t)??e,e=ttt.parseAllForSortIndex(e,t));const c=t.getDataName(a8.Raw),u=new g8(e,c,a8.Raw,i);if(n[c]=u,e=u,bnt(t)){const n=Ktt.makeFromEncoding(e,t);n&&(e=n,N9(t)&&(e=new oet(e))),e=Ont.makeFromEncoding(e,t)??e,e=Aet.makeFromEncoding(e,t)??e}bnt(t)&&(e=Snt.make(e,t)??e);const f=t.getDataName(a8.Main),h=new g8(e,f,a8.Main,i);n[f]=h,e=h,bnt(t)&&function(t,e){for(const[n,i]of EQ(t.component.selection??{})){const r=t.getName(`lookup_${n}`);t.component.data.outputNodes[r]=i.materialized=new g8(new I9(e,t,{param:n}),r,a8.Lookup,t.component.data.outputNodeRefCounts)}}(t,h);let d=null;if(xnt(t)){const i=t.getName("facet");e=function(t,e){const{row:n,column:i}=e;if(n&&i){let e=null;for(const r of[n,i])if(E7(r.sort)){const{field:n,op:i=w7}=r.sort;t=e=new Det(t,{joinaggregate:[{op:i,field:n,as:Ynt(r,r.sort,{forAs:!0})}],groupby:[t5(r)]})}return e}return null}(e,t.facet)??e,d=new tet(e,t,i,h.getSource()),n[i]=d}return{...t.component.data,outputNodes:n,outputNodeRefCounts:i,raw:u,main:h,facetRoot:d,ancestorParse:o}}class Jnt extends knt{constructor(t,e,n,i){super(t,"concat",e,n,i,t.resolve),"shared"!==t.resolve?.axis?.x&&"shared"!==t.resolve?.axis?.y||y2("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map(((t,e)=>wit(t,this,this.getName(`concat_${e}`),void 0,i)))}parseData(){this.component.data=Znt(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of $Q(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return w6(t)?t.vconcat:k6(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){Wnt(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";Hnt(t,e),Hnt(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.forEach((t=>t.assembleSignals())),[]}assembleLayoutSignals(){const t=ytt(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleMarks(){return this.children.map((t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...e?{title:e}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...null!=t?{columns:t}:{},bounds:"full",align:"each"}}}const Qnt={disable:1,gridScale:1,scale:1,...$5,labelExpr:1,encode:1},Knt=$Q(Qnt);class tit extends Y4{constructor(t={},e={},n=!1){super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new tit(aQ(this.explicit),aQ(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return g1(this.explicit.orient)}}const eit={bottom:"top",top:"bottom",left:"right",right:"left"};function nit(t,e){if(!t)return e.map((t=>t.clone()));{if(t.length!==e.length)return;const n=t.length;for(let i=0;i{switch(n){case"title":return R1(t,e);case"gridScale":return{explicit:t.explicit,value:IQ(t.value,e.value)}}return J4(t,e,n,"axis")}));t.setWithExplicit(n,i)}return t}function rit(t,e,n,i,r){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(g1(n.labelAngle)?n.labelAngle:WQ(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===K9(i,r))return!0}return t===n[e]}const oit=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function sit(t,e){let n=e.axis(t);const i=new tit,r=u5(e.encoding[t]),{mark:o,config:s}=e,a=n?.orient||s["x"===t?"axisX":"axisY"]?.orient||s.axis?.orient||function(t){return"x"===t?"bottom":"left"}(t),l=e.getScaleComponent(t).get("type"),c=function(t,e,n,i){const r="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:h3(e)?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",s=g1(n)?"axisOrient":`axis${FQ(n)}`,a=[...r,...r.map((t=>o+t.substr(4)))],l=["axis",s,o];return{vlOnlyAxisConfig:V9(a,i,t,n),vgAxisConfig:V9(l,i,t,n),axisConfigStyle:Y9([...l,...a],i)}}(t,l,a,e.config),u=void 0!==n?!n:G9("disable",s.style,n?.style,c).configValue;if(i.set("disable",u,void 0!==n),u)return i;n=n||{};const f=function(t,e,n,i,r){const o=e?.labelAngle;if(void 0!==o)return g1(o)?o:WQ(o);{const{configValue:o}=G9("labelAngle",i,e?.style,r);return void 0!==o?WQ(o):n!==QQ||!dQ([i3,e3],t.type)||B7(t)&&t.timeUnit?void 0:270}}(r,n,t,s.style,c),h=y7(n.formatType,r,l),d=m7(r,r.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:r,axis:n,channel:t,model:e,scaleType:l,orient:a,labelAngle:f,format:d,formatType:h,mark:o,config:s};for(const r of Knt){const o=r in X9?X9[r](p):E5(r)?n[r]:void 0,a=void 0!==o,l=rit(o,r,n,e,t);if(a&&l)i.set(r,o,l);else{const{configValue:t,configFrom:e}=E5(r)&&"values"!==r?G9(r,s.style,n.style,c):{},u=void 0!==t;a&&!u?i.set(r,o,l):("vgAxisConfig"!==e||oit.has(r)&&u||_5(t)||g1(t))&&i.set(r,t,!1)}}const g=n.encoding??{},m=w5.reduce(((n,r)=>{if(!i.hasAxisPart(r))return n;const o=wtt(g[r]??{},e),s="labels"===r?function(t,e,n){const{encoding:i,config:r}=t,o=u5(i[e])??u5(i[n0(e)]),s=t.axis(e)||{},{format:a,formatType:l}=s;if(u7(l))return{text:g7({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:r}),...n};if(void 0===a&&void 0===l&&r.customFormatTypes){if("quantitative"===j7(o)){if(Z7(o)&&"normalize"===o.stack&&r.normalizedNumberFormatType)return{text:g7({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:g7({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if("temporal"===j7(o)&&r.timeFormatType&&B7(o)&&!o.timeUnit)return{text:g7({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}(e,t,o):o;return void 0===s||kQ(s)||(n[r]={update:s}),n}),{});return kQ(m)||i.set("encode",m,!!n.encoding||void 0!==n.labelAngle),i}function ait(t,e){const{config:n}=t;return{...l9(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...X8("x",t,{defaultPos:"mid"}),...X8("y",t,{defaultPos:"mid"}),...H8("size",t),...H8("angle",t),...lit(t,n,e)}}function lit(t,e,n){return n?{shape:{value:n}}:H8("shape",t)}const cit={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?{...l9(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...t9("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...t9("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...H8("size",t,{vgChannel:"strokeWidth"})}:{}}},uit={vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...l9(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...X8("x",t,{defaultPos:"mid"}),...X8("y",t,{defaultPos:"mid"}),...R8(t),...H8("size",t,{vgChannel:"fontSize"}),...H8("angle",t),...h9("align",fit(t.markDef,n,e)),...h9("baseline",hit(t.markDef,n,e)),...X8("radius",t,{defaultPos:null}),...X8("theta",t,{defaultPos:null})}}};function fit(t,e,n){if(void 0===A1("align",t,n))return"center"}function hit(t,e,n){if(void 0===A1("baseline",t,n))return"middle"}const dit={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return{...l9(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...X8("x",t,{defaultPos:"mid",vgChannel:"xc"}),...X8("y",t,{defaultPos:"mid",vgChannel:"yc"}),...H8("size",t,{defaultValue:pit(t),vgChannel:r}),[o]:$1(A1("thickness",n,e))}}};function pit(t){const{config:e,markDef:n}=t,{orient:i}=n,r="horizontal"===i?"width":"height",o=t.getScaleComponent("horizontal"===i?"x":"y"),s=A1("size",n,e,{vgChannel:r})??e.tick.bandSize;if(void 0!==s)return s;{const t=o?o.get("range"):void 0;if(t&&m1(t)&&nd(t.step))return 3*t.step/4;return 3*D6(e.view,r)/4}}const git={arc:{vgMark:"arc",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...X8("x",t,{defaultPos:"mid"}),...X8("y",t,{defaultPos:"mid"}),...i9(t,"radius"),...i9(t,"theta")})},area:{vgMark:"area",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...t9("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient}),...t9("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient}),...f9(t)})},bar:{vgMark:"rect",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...i9(t,"x"),...i9(t,"y")})},circle:{vgMark:"symbol",encodeEntry:t=>ait(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&B7(n)&&n.type===r3?{field:t5(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...i9(t,"x"),...i9(t,"y"),...R8(t,"url")})},line:{vgMark:"line",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...X8("x",t,{defaultPos:"mid"}),...X8("y",t,{defaultPos:"mid"}),...H8("size",t,{vgChannel:"strokeWidth"}),...f9(t)})},point:{vgMark:"symbol",encodeEntry:t=>ait(t)},rect:{vgMark:"rect",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...i9(t,"x"),...i9(t,"y")})},rule:cit,square:{vgMark:"symbol",encodeEntry:t=>ait(t,"square")},text:uit,tick:dit,trail:{vgMark:"trail",encodeEntry:t=>({...l9(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...X8("x",t,{defaultPos:"mid"}),...X8("y",t,{defaultPos:"mid"}),...H8("size",t),...f9(t)})}};function mit(t){if(dQ([L3,T3,U3],t.mark)){const e=P5(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:yit+t.requestDataName(a8.Main),data:t.requestDataName(a8.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:bit(t,{fromPrefix:yit})}]}(t,e)}else if(t.mark===N3){const e=x1.some((e=>A1(e,t.markDef,t.config)));if(t.stack&&!t.fieldDef("size")&&e)return function(t){const[e]=bit(t,{fromPrefix:vit}),n=t.scaleName(t.stack.fieldChannel),i=(e={})=>t.vgField(t.stack.fieldChannel,e),r=(t,e)=>`${t}(${[i({prefix:"min",suffix:"start",expr:e}),i({prefix:"max",suffix:"start",expr:e}),i({prefix:"min",suffix:"end",expr:e}),i({prefix:"max",suffix:"end",expr:e})].map((t=>`scale('${n}',${t})`)).join(",")})`;let o,s;"x"===t.stack.fieldChannel?(o={...cQ(e.encode.update,["y","yc","y2","height",...x1]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...uQ(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...cQ(e.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...uQ(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const n of x1){const i=F1(n,t.markDef,t.config);e.encode.update[n]?(o[n]=e.encode.update[n],delete e.encode.update[n]):i&&(o[n]=$1(i)),i&&(e.encode.update[n]={value:0})}const a=[];if(t.stack.groupbyChannels?.length>0)for(const e of t.stack.groupbyChannels){const n=t.fieldDef(e),i=t5(n);i&&a.push(i),(n?.bin||n?.timeUnit)&&a.push(t5(n,{binSuffix:"end"}))}o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,i)=>{if(e.encode.update[i])return{...n,[i]:e.encode.update[i]};{const e=F1(i,t.markDef,t.config);return void 0!==e?{...n,[i]:$1(e)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(a8.Main),name:vit+t.requestDataName(a8.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[e]}]}]}(t)}return bit(t)}const yit="faceted_path_";const vit="stack_group_";function bit(t,e={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=t,s=IQ(i.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!(!e?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),a=D1(i),l=r.key,c=function(t){const{encoding:e,stack:n,mark:i,markDef:r,config:o}=t,s=e.order;if(!(!ah(s)&&G7(s)&&hQ(s.value)||!s&&hQ(A1("order",r,o)))){if((ah(s)||B7(s))&&!n)return N1(s,{expr:"datum"});if(V3(i)){const n="horizontal"===r.orient?"y":"x",i=e[n];if(B7(i)){const e=i.sort;return ah(e)?{field:t5(i,{prefix:n,suffix:"sort_index",expr:"datum"})}:E7(e)?{field:t5({aggregate:T5(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})}:C7(e)?{field:t5(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order}:null===e?void 0:{field:t5(i,{binSuffix:t.stack?.impute?"mid":void 0,expr:"datum"})}}}}}(t),u=function(t){if(!t.component.selection)return null;const e=$Q(t.component.selection).length;let n=e,i=t.parent;for(;i&&0===n;)n=$Q(i.component.selection).length,i=i.parent;return n?{interactive:e>0||"geoshape"===t.mark||!!t.encoding.tooltip}:null}(t),f=A1("aria",i,o),h=git[n].postEncodingTransform?git[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:git[n].vgMark,...s?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...!1===f?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(a8.Main)},encode:{update:git[n].encodeEntry(t)},...h?{transform:h}:{}}]}class xit extends $nt{constructor(t,e,n,i={},r){super(t,"unit",e,n,r,void 0,E6(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=X3(t.mark)?{...t.mark}:{type:t.mark},s=o.type;void 0===o.filled&&(o.filled=function(t,e,{graticule:n}){if(n)return!1;const i=F1("filled",t,e),r=t.type;return IQ(i,r!==R3&&r!==L3&&r!==I3)}(o,r,{graticule:t.data&&s8(t.data)}));const a=this.encoding=function(t,e,n,i){const r={};for(const e of $Q(t))JK(e)||y2(`${o=e}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let o of a0){if(!t[o])continue;const s=t[o];if(F0(o)){const t=s0(o),e=r[t];if(B7(e)&&Q2(e.type)&&B7(s)&&!e.timeUnit){y2(Q1(t));continue}}if("angle"!==o||"arc"!==e||t.theta||(y2("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=sK),z5(t,o,e)){if(o===mK&&"line"===e){const e=c5(t[o]);if(e?.aggregate){y2("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(o===hK&&(n?"fill"in t:"stroke"in t))y2(t2("encoding",{fill:"fill"in t,stroke:"stroke"in t}));else if(o===CK||o===$K&&!ah(s)&&!G7(s)||o===SK&&ah(s)){if(s){if(o===$K){const e=t[o];if(L7(e)){r[o]=e;continue}}r[o]=Oh(s).reduce(((t,e)=>(B7(e)?t.push(d5(e,o)):y2(e2(e,o)),t)),[])}}else{if(o===SK&&null===s)r[o]=null;else if(!(B7(s)||U7(s)||G7(s)||R7(s)||g1(s))){y2(e2(s,o));continue}r[o]=f5(s,o,i)}}else y2(n2(o,e))}return r}(t.encoding||{},s,o.filled,r);this.markDef=Q6(o,a,r),this.size=function({encoding:t,size:e}){for(const n of C0){const i=i0(n);C6(e[i])&&q7(t[n])&&(delete e[i],y2(u2(i)))}return e}({encoding:a,size:E6(t)?{...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:i}),this.stack=J6(this.markDef,a),this.specifiedScales=this.initScales(s,a),this.specifiedAxes=this.initAxes(a),this.specifiedLegends=this.initLegends(a),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter((t=>b6(t)))}get hasProjection(){const{encoding:t}=this,e=this.mark===H3,n=t&&LK.some((e=>V7(t[e])));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return q0.reduce(((t,n)=>{const i=u5(e[n]);return i&&(t[n]=this.initScale(i.scale??{})),t}),{})}initScale(t){const{domain:e,range:n}=t,i=h1(t);return ah(e)&&(i.domain=e.map(w1)),ah(n)&&(i.range=n.map(w1)),i}initAxes(t){return C0.reduce(((e,n)=>{const i=t[n];if(V7(i)||n===QQ&&V7(t.x2)||n===KQ&&V7(t.y2)){const t=V7(i)?i.axis:void 0;e[n]=t?this.initAxis({...t}):t}return e}),{})}initAxis(t){const e=$Q(t),n={};for(const i of e){const e=t[i];n[i]=_5(e)?_1(e):w1(e)}return n}initLegends(t){return j0.reduce(((e,n)=>{const i=u5(t[n]);if(i&&function(t){switch(t){case hK:case dK:case pK:case mK:case gK:case vK:case _K:case wK:return!0;case bK:case xK:case yK:return!1}}(n)){const t=i.legend;e[n]=t?h1(t):t}return e}),{})}parseData(){this.component.data=Znt(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const i of C0){const r=i0(i);if(e[r]){const t=e[r];n.layoutSize.set(r,C6(t)?"step":t,!0)}else{const e=Vnt(t,r);n.layoutSize.set(r,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},i=t.config.selection;if(!e||!e.length)return n;for(const r of e){const e=MQ(r.name),o=r.select,s=rd(o)?o:o.type,a=lh(o)?aQ(o):{type:s},l=i[s];for(const t in l)"fields"!==t&&"encodings"!==t&&("mark"===t&&(a[t]={...l[t],...a[t]}),void 0!==a[t]&&!0!==a[t]||(a[t]=aQ(l[t]??a[t])));const c=n[e]={...a,name:e,type:s,init:r.value,bind:r.bind,events:rd(a.on)?$Y(a.on,"scope"):Oh(aQ(a.on))},u=aQ(r);for(const e of O9)e.defined(c)&&e.parse&&e.parse(t,c,u)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=mit(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,C0.reduce(((e,n)=>(t.component.scales[n]&&(e[n]=[sit(n,t)]),e)),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;for(const i of CQ(t.component.selection??{})){const r=i.name,o=hd(r+M9);if(0===e.filter((t=>t.name===r)).length){const t="global"===i.resolve?"union":i.resolve,n="point"===i.type?", true, true)":")";e.push({name:i.name,update:`${F9}(${o}, ${hd(t)}${n}`})}n=!0;for(const n of O9)n.defined(i)&&n.topLevelSignals&&(e=n.topLevelSignals(t,i,e))}n&&0===e.filter((t=>"unit"===t.name)).length&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]});return d8(e)}(this,t)}assembleSignals(){return[...H9(this),...u8(this,[])]}assembleSelectionData(t){return function(t,e){const n=[...e],i=T9(t,{escape:!1});for(const e of CQ(t.component.selection??{})){const t={name:e.name+M9};if(e.project.hasSelectionId&&(t.transform=[{type:"collect",sort:{field:g6}}]),e.init){const n=e.project.items.map(l8);t.values=e.project.hasSelectionId?e.init.map((t=>({unit:i,[g6]:c8(t,!1)[0]}))):e.init.map((t=>({unit:i,fields:n,values:c8(t,!1)})))}n.filter((t=>t.name===e.name+M9)).length||n.push(t)}return n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return ytt(this)}assembleMarks(){let t=this.component.mark??[];return this.parent&&wnt(this.parent)||(t=h8(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return void 0!==t?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return A5(this.encoding,t)}fieldDef(t){return c5(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return Y7(e)?e:null}}class _it extends knt{constructor(t,e,n,i,r){super(t,"layer",e,n,r,t.resolve,t.view);const o={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map(((t,e)=>{if(W6(t))return new _it(t,this,this.getName(`layer_${e}`),o,r);if(M5(t))return new xit(t,this,this.getName(`layer_${e}`),o,r);throw new Error(P1(t))}))}parseData(){this.component.data=Znt(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;Wnt(t=this),Hnt(t,"width"),Hnt(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of $Q(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){const{axes:e,resolve:n}=t.component,i={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const r of $Q(i.component.axes))n.axis[r]=$tt(t.component.resolve,r),"shared"===n.axis[r]&&(e[r]=nit(e[r],i.component.axes[r]),e[r]||(n.axis[r]="independent",delete e[r]))}for(const r of C0){for(const o of t.children)if(o.component.axes[r]){if("independent"===n.axis[r]){e[r]=(e[r]??[]).concat(o.component.axes[r]);for(const t of o.component.axes[r]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!g1(e)){if(i[e]>0&&!n){const n=eit[e];i[e]>i[n]&&t.set("orient",n,!1)}i[e]++}}}delete o.component.axes[r]}if("independent"===n.axis[r]&&e[r]&&e[r].length>1)for(const[t,n]of(e[r]||[]).entries())t>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleSignals())),H9(this))}assembleLayoutSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleLayoutSignals())),ytt(this))}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleGroupStyle(){const t=new Set;for(const e of this.children)for(const n of Oh(e.assembleGroupStyle()))t.add(n);const e=Array.from(t);return e.length>1?e:1===e.length?e[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)bnt(n)&&(e=h8(n,e));return e}(this,this.children.flatMap((t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce(((t,e)=>t.concat(e.assembleLegends())),jtt(this))}}function wit(t,e,n,i,r){if(A7(t))return new Gnt(t,e,n,r);if(W6(t))return new _it(t,e,n,i,r);if(M5(t))return new xit(t,e,n,i,r);if(function(t){return w6(t)||k6(t)||_6(t)}(t))return new Jnt(t,e,n,r);throw new Error(P1(t))}const kit=eQ;var $it=Object.freeze({__proto__:null,version:kit,compile:function(t,e={}){var n;e.logger&&(n=e.logger,m2=n),e.fieldTitle&&r5(e.fieldTitle);try{const n=P6(uh(e.config,t.config)),i=B4(t,n),r=wit(i,null,"",void 0,n);r.parse(),function(t,e){Let(t.sources);let n=0,i=0;for(let i=0;i"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)));const{params:f,...h}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...h,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...x6(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}(r,function(t,e,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===e?(e={type:"pad"},i.hasAxisOrientSignalRef()&&(e.resize=!0)):rd(e)&&(e={type:e});if(r&&o&&(s=e.type,"fit"===s||"fit-x"===s||"fit-y"===s))if("step"===r&&"step"===o)y2(U1()),e.type="pad";else if("step"===r||"step"===o){const t="step"===r?"width":"height";y2(U1(D0(t)));const n="width"===t?"height":"width";e.type=function(t){return t?`fit-${D0(t)}`:"fit"}(n)}var s;return{...1===$Q(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e},...V4(n,!1),...V4(t,!0)}}(t,i.autosize,n,r),t.datasets,t.usermeta);return{spec:o,normalized:i}}finally{e.logger&&(m2=g2),e.fieldTitle&&r5(n5)}},normalize:B4,duplicate:aQ,never:lQ,pick:cQ,omit:uQ,hash:fQ,isNullOrFalse:hQ,contains:dQ,some:pQ,every:gQ,mergeDeep:mQ,unique:vQ,isEqual:function(t,e){const n=$Q(t),i=$Q(e);if(n.length!==i.length)return!1;for(const i of n)if(t[i]!==e[i])return!1;return!0},setEqual:bQ,hasIntersection:xQ,prefixGenerator:_Q,fieldIntersection:wQ,isEmpty:kQ,keys:$Q,vals:CQ,entries:EQ,isBoolean:SQ,varName:MQ,logicalExpr:DQ,deleteNestedProperty:AQ,titleCase:FQ,accessPathWithDatum:OQ,flatAccessWithDatum:TQ,replacePathInField:zQ,replaceAll:LQ,removePathFromField:RQ,accessPathDepth:PQ,getFirstDefined:IQ,uniqueId:jQ,resetIdCounter:function(){BQ=42},internalField:UQ,isInternalField:qQ,normalizeAngle:WQ,isNumeric:HQ,deepEqual:YQ,stringify:GQ});function Cit(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}}var Eit="2.14.0";const Sit="#fff",Mit="#888",Dit={background:"#333",view:{stroke:Mit},title:{color:Sit,subtitleColor:Sit},style:{"guide-label":{fill:Sit},"guide-title":{fill:Sit}},axis:{domainColor:Sit,gridColor:Mit,tickColor:Sit}},Ait="#4572a7",Fit={background:"#fff",arc:{fill:Ait},area:{fill:Ait},line:{stroke:Ait,strokeWidth:2},path:{stroke:Ait},rect:{fill:Ait},shape:{stroke:Ait},symbol:{fill:Ait,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Oit="#30a2da",Tit="#cbcbcb",Nit="#f0f0f0",zit="#333",Lit={arc:{fill:Oit},area:{fill:Oit},axis:{domainColor:Tit,grid:!0,gridColor:Tit,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Tit,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Nit,group:{fill:Nit},legend:{labelColor:zit,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:zit,titleFontSize:14,titlePadding:10},line:{stroke:Oit,strokeWidth:2},path:{stroke:Oit,strokeWidth:.5},rect:{fill:Oit},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Oit},bar:{binSpacing:2,fill:Oit,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Rit="#000",Pit={group:{fill:"#e5e5e5"},arc:{fill:Rit},area:{fill:Rit},line:{stroke:Rit},path:{stroke:Rit},rect:{fill:Rit},shape:{stroke:Rit},symbol:{fill:Rit,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Iit="Benton Gothic, sans-serif",Bit="#82c6df",jit="Benton Gothic Bold, sans-serif",Uit="normal",qit={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Wit={background:"#ffffff",title:{anchor:"start",color:"#000000",font:jit,fontSize:22,fontWeight:"normal"},arc:{fill:Bit},area:{fill:Bit},line:{stroke:Bit,strokeWidth:2},path:{stroke:Bit},rect:{fill:Bit},shape:{stroke:Bit},symbol:{fill:Bit,size:30},axis:{labelFont:Iit,labelFontSize:11.5,labelFontWeight:"normal",titleFont:jit,titleFontSize:13,titleFontWeight:Uit},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Iit,labelFontSize:11.5,symbolType:"square",titleFont:jit,titleFontSize:13,titleFontWeight:Uit},range:{category:qit["category-6"],diverging:qit["fireandice-6"],heatmap:qit["fire-7"],ordinal:qit["fire-7"],ramp:qit["fire-7"]}},Hit="#ab5787",Vit="#979797",Yit={background:"#f9f9f9",arc:{fill:Hit},area:{fill:Hit},line:{stroke:Hit},path:{stroke:Hit},rect:{fill:Hit},shape:{stroke:Hit},symbol:{fill:Hit,size:30},axis:{domainColor:Vit,domainWidth:.5,gridWidth:.2,labelColor:Vit,tickColor:Vit,tickWidth:.2,titleColor:Vit},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Git="#3e5c69",Xit={background:"#fff",arc:{fill:Git},area:{fill:Git},line:{stroke:Git},path:{stroke:Git},rect:{fill:Git},shape:{stroke:Git},symbol:{fill:Git},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Zit="#1696d2",Jit="#000000",Qit="Lato",Kit="Lato",trt={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},ert={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Qit},axisX:{domain:!0,domainColor:Jit,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Kit,labelAngle:0,tickColor:Jit,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Qit},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:Kit,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Qit,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Kit,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Qit,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:trt["six-groups-cat-1"],diverging:trt["diverging-colors"],heatmap:trt["diverging-colors"],ordinal:trt["six-groups-seq"],ramp:trt["shades-blue"]},area:{fill:Zit},rect:{fill:Zit},line:{color:Zit,stroke:Zit,strokeWidth:5},trail:{color:Zit,stroke:Zit,strokeWidth:0,size:1},path:{stroke:Zit,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Zit,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Zit,stroke:null}},arc:{fill:Zit},shape:{stroke:Zit},symbol:{fill:Zit,size:30}},nrt="#3366CC",irt="#ccc",rrt="Arial, sans-serif",ort={arc:{fill:nrt},area:{fill:nrt},path:{stroke:nrt},rect:{fill:nrt},shape:{stroke:nrt},symbol:{stroke:nrt},circle:{fill:nrt},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:rrt,fontSize:12},"guide-title":{font:rrt,fontSize:12},"group-title":{font:rrt,fontSize:12}},title:{font:rrt,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:irt,tickColor:irt,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},srt=t=>t*(1/3+1),art=srt(9),lrt=srt(10),crt=srt(12),urt="Segoe UI",frt="wf_standard-font, helvetica, arial, sans-serif",hrt="#252423",drt="#605E5C",prt="transparent",grt="#118DFF",mrt="#DEEFFF",yrt=[mrt,grt],vrt={view:{stroke:prt},background:prt,font:urt,header:{titleFont:frt,titleFontSize:crt,titleColor:hrt,labelFont:urt,labelFontSize:lrt,labelColor:drt},axis:{ticks:!1,grid:!1,domain:!1,labelColor:drt,labelFontSize:art,titleFont:frt,titleColor:hrt,titleFontSize:crt,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:grt},line:{stroke:grt,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:urt,fontSize:art,fill:drt},arc:{fill:grt},area:{fill:grt,line:!0,opacity:.6},path:{stroke:grt},rect:{fill:grt},point:{fill:grt,filled:!0,size:75},shape:{stroke:grt},symbol:{fill:grt,strokeWidth:1.5,size:50},legend:{titleFont:urt,titleFontWeight:"bold",titleColor:drt,labelFont:urt,labelFontSize:lrt,labelColor:drt,symbolType:"circle",symbolSize:75},range:{category:[grt,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:yrt,heatmap:yrt,ordinal:[mrt,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",grt]}},brt='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',xrt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],_rt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function wrt({type:t,background:e}){const n="dark"===t?"#161616":"#ffffff",i="dark"===t?"#f4f4f4":"#161616",r="dark"===t?"#d4bbff":"#6929c4";return{background:e,arc:{fill:r},area:{fill:r},path:{stroke:r},rect:{fill:r},shape:{stroke:r},symbol:{stroke:r},circle:{fill:r},view:{fill:n,stroke:n},group:{fill:n},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:brt,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:brt,fill:i,fontWeight:400},"guide-title":{font:brt,fill:i,fontWeight:400}},range:{category:"dark"===t?xrt:_rt,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const krt=wrt({type:"light",background:"#ffffff"}),$rt=wrt({type:"light",background:"#f4f4f4"}),Crt=wrt({type:"dark",background:"#262626"}),Ert=wrt({type:"dark",background:"#161616"}),Srt=Eit;var Mrt=Object.freeze({__proto__:null,carbong10:$rt,carbong100:Ert,carbong90:Crt,carbonwhite:krt,dark:Dit,excel:Fit,fivethirtyeight:Lit,ggplot2:Pit,googlecharts:ort,latimes:Wit,powerbi:vrt,quartz:Yit,urbaninstitute:ert,version:Srt,vox:Xit});function Drt(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,i){if("object"!=typeof i||null===i)return i;const r=e.indexOf(this)+1;return e.length=r,e.length>t?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}(e))}var Art="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n";const Frt="vg-tooltip-element",Ort={offsetX:10,offsetY:10,id:Frt,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&").replace(/e(rd(t)?t:Drt(t,n)))).join(", ")}]`;if(lh(t)){let i="";const{title:r,image:o,...s}=t;r&&(i+=`

    ${e(r)}

    `),o&&(i+=``);const a=Object.keys(s);if(a.length>0){i+="";for(const t of a){let r=s[t];void 0!==r&&(lh(r)&&(r=Drt(r,n)),i+=``)}i+="
    ${e(t)}${e(r)}
    "}return i||"{}"}return e(t)}};class Trt{constructor(t){this.options={...Ort,...t};const e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return Art.toString().replace(Frt,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}}tooltipHandler(t,e,n,i){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==i||""===i)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:r,y:o}=function(t,e,n,i){let r=t.clientX+n;r+e.width>window.innerWidth&&(r=+t.clientX-n-e.width);let o=t.clientY+i;return o+e.height>window.innerHeight&&(o=+t.clientY-i-e.height),{x:r,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${r}px`}}function Nrt(t){return Nrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nrt(t)}function zrt(t){var e=function(t,e){if("object"!==Nrt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Nrt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Nrt(e)?e:String(e)}function Lrt(t,e,n){return(e=zrt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rrt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Prt,Irt;var Brt=jrt;function jrt(t){var e=this;if(e instanceof jrt||(e=new jrt),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=t(n,i.value,r),i=i.next;return n},jrt.prototype.reduceReverse=function(t,e){var n,i=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=t(n,i.value,r),i=i.prev;return n},jrt.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},jrt.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},jrt.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new jrt;if(ethis.length&&(e=this.length);for(var i=0,r=this.head;null!==r&&ithis.length&&(e=this.length);for(var i=this.length,r=this.tail;null!==r&&i>e;i--)r=r.prev;for(;null!==r&&i>t;i--,r=r.prev)n.push(r.value);return n},jrt.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i1;const rot=(t,e,n)=>{const i=t[eot].get(e);if(i){const e=i.value;if(oot(t,e)){if(aot(t,i),!t[Zrt])return}else n&&(t[not]&&(i.value.now=Date.now()),t[tot].unshiftNode(i));return e.value}},oot=(t,e)=>{if(!e||!e.maxAge&&!t[Jrt])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Jrt]&&n>t[Jrt]},sot=t=>{if(t[Grt]>t[Yrt])for(let e=t[tot].tail;t[Grt]>t[Yrt]&&null!==e;){const n=e.prev;aot(t,e),e=n}},aot=(t,e)=>{if(e){const n=e.value;t[Qrt]&&t[Qrt](n.key,n.value),t[Grt]-=n.length,t[eot].delete(n.key),t[tot].removeNode(e)}};class lot{constructor(t,e,n,i,r){this.key=t,this.value=e,this.length=n,this.now=i,this.maxAge=r||0}}const cot=(t,e,n,i)=>{let r=n.value;oot(t,r)&&(aot(t,n),t[Zrt]||(r=void 0)),r&&e.call(i,r.value,r.key,t)};var uot=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[Yrt]=t.max||1/0;const e=t.length||iot;if(this[Xrt]="function"!=typeof e?iot:e,this[Zrt]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[Jrt]=t.maxAge||0,this[Qrt]=t.dispose,this[Krt]=t.noDisposeOnSet||!1,this[not]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[Yrt]=t||1/0,sot(this)}get max(){return this[Yrt]}set allowStale(t){this[Zrt]=!!t}get allowStale(){return this[Zrt]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[Jrt]=t,sot(this)}get maxAge(){return this[Jrt]}set lengthCalculator(t){"function"!=typeof t&&(t=iot),t!==this[Xrt]&&(this[Xrt]=t,this[Grt]=0,this[tot].forEach((t=>{t.length=this[Xrt](t.value,t.key),this[Grt]+=t.length}))),sot(this)}get lengthCalculator(){return this[Xrt]}get length(){return this[Grt]}get itemCount(){return this[tot].length}rforEach(t,e){e=e||this;for(let n=this[tot].tail;null!==n;){const i=n.prev;cot(this,t,n,e),n=i}}forEach(t,e){e=e||this;for(let n=this[tot].head;null!==n;){const i=n.next;cot(this,t,n,e),n=i}}keys(){return this[tot].toArray().map((t=>t.key))}values(){return this[tot].toArray().map((t=>t.value))}reset(){this[Qrt]&&this[tot]&&this[tot].length&&this[tot].forEach((t=>this[Qrt](t.key,t.value))),this[eot]=new Map,this[tot]=new Vrt,this[Grt]=0}dump(){return this[tot].map((t=>!oot(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[tot]}set(t,e,n){if((n=n||this[Jrt])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,r=this[Xrt](e,t);if(this[eot].has(t)){if(r>this[Yrt])return aot(this,this[eot].get(t)),!1;const o=this[eot].get(t).value;return this[Qrt]&&(this[Krt]||this[Qrt](t,o.value)),o.now=i,o.maxAge=n,o.value=e,this[Grt]+=r-o.length,o.length=r,this.get(t),sot(this),!0}const o=new lot(t,e,r,i,n);return o.length>this[Yrt]?(this[Qrt]&&this[Qrt](t,e),!1):(this[Grt]+=o.length,this[tot].unshift(o),this[eot].set(t,this[tot].head),sot(this),!0)}has(t){if(!this[eot].has(t))return!1;const e=this[eot].get(t).value;return!oot(this,e)}get(t){return rot(this,t,!0)}peek(t){return rot(this,t,!1)}pop(){const t=this[tot].tail;return t?(aot(this,t),t.value):null}del(t){aot(this,this[eot].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const t=r-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[eot].forEach(((t,e)=>rot(this,e,!1)))}};const fot=Object.freeze({loose:!0}),hot=Object.freeze({});var dot=t=>t?"object"!=typeof t?fot:t:hot,pot={exports:{}};var got={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var mot="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=got,o=mot,s=(e=t.exports={}).re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[f,i]],d=(t,e,n)=>{const i=(t=>{for(const[e,n]of h)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t})(e),r=u++;o(t,r,e),c[t]=r,l[r]=e,s[r]=new RegExp(e,n?"g":void 0),a[r]=new RegExp(i,n?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),d("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${f}+`),d("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),d("FULL",`^${l[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),d("LOOSE",`^${l[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),d("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",l[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",d("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",d("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(pot,pot.exports);var yot=pot.exports;const vot=/^[0-9]+$/,bot=(t,e)=>{const n=vot.test(t),i=vot.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:tbot(e,t)};const _ot=mot,{MAX_LENGTH:wot,MAX_SAFE_INTEGER:kot}=got,{safeRe:$ot,t:Cot}=yot,Eot=dot,{compareIdentifiers:Sot}=xot;var Mot=class t{constructor(e,n){if(n=Eot(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>wot)throw new TypeError(`version is longer than ${wot} characters`);_ot("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=e.trim().match(n.loose?$ot[Cot.LOOSE]:$ot[Cot.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>kot||this.major<0)throw new TypeError("Invalid major version");if(this.minor>kot||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>kot||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let i=[e,t];!1===n&&(i=[e]),0===Sot(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const Dot=Mot;var Aot=(t,e,n)=>new Dot(t,n).compare(new Dot(e,n));const Fot=Aot;var Oot=(t,e,n)=>0===Fot(t,e,n);const Tot=Aot;var Not=(t,e,n)=>0!==Tot(t,e,n);const zot=Aot;var Lot=(t,e,n)=>zot(t,e,n)>0;const Rot=Aot;var Pot=(t,e,n)=>Rot(t,e,n)>=0;const Iot=Aot;var Bot=(t,e,n)=>Iot(t,e,n)<0;const jot=Aot;var Uot=(t,e,n)=>jot(t,e,n)<=0;const qot=Oot,Wot=Not,Hot=Lot,Vot=Pot,Yot=Bot,Got=Uot;var Xot,Zot,Jot,Qot,Kot=(t,e,n,i)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t===n;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return qot(t,n,i);case"!=":return Wot(t,n,i);case">":return Hot(t,n,i);case">=":return Vot(t,n,i);case"<":return Yot(t,n,i);case"<=":return Got(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};function tst(){if(Qot)return Jot;Qot=1;class t{constructor(e,r){if(r=n(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!d(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&p(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const n=((this.options.includePrerelease&&f)|(this.options.loose&&h))+":"+t,o=e.get(n);if(o)return o;const p=this.options.loose,g=p?s[a.HYPHENRANGELOOSE]:s[a.HYPHENRANGE];t=t.replace(g,E(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(s[a.COMPARATORTRIM],l),r("comparator trim",t),t=t.replace(s[a.TILDETRIM],c),r("tilde trim",t),t=t.replace(s[a.CARETTRIM],u),r("caret trim",t);let y=t.split(" ").map((t=>m(t,this.options))).join(" ").split(/\s+/).map((t=>C(t,this.options)));p&&(y=y.filter((t=>(r("loose invalid filter",t,this.options),!!t.match(s[a.COMPARATORLOOSE]))))),r("range list",y);const v=new Map,b=y.map((t=>new i(t,this.options)));for(const t of b){if(d(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return e.set(n,x),x}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>g(t,n)&&e.set.some((e=>g(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(let e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(o(this.semver,"<",t.semver,i)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(o(this.semver,">",t.semver,i)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}Xot=e;const n=dot,{safeRe:i,t:r}=yot,o=Kot,s=mot,a=Mot,l=tst();return Xot}(),r=mot,o=Mot,{safeRe:s,t:a,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:u}=yot,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:h}=got,d=t=>"<0.0.0-0"===t.value,p=t=>""===t.value,g=(t,e)=>{let n=!0;const i=t.slice();let r=i.pop();for(;n&&i.length;)n=i.every((t=>r.intersects(t,e))),r=i.pop();return n},m=(t,e)=>(r("comp",t,e),t=x(t,e),r("caret",t),t=v(t,e),r("tildes",t),t=w(t,e),r("xrange",t),t=$(t,e),r("stars",t),t),y=t=>!t||"x"===t.toLowerCase()||"*"===t,v=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const n=e.loose?s[a.TILDELOOSE]:s[a.TILDE];return t.replace(n,((e,n,i,o,s)=>{let a;return r("tilde",t,e,n,i,o,s),y(n)?a="":y(i)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?a=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:s?(r("replaceTilde pr",s),a=`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`):a=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,r("tilde return",a),a}))},x=(t,e)=>t.trim().split(/\s+/).map((t=>_(t,e))).join(" "),_=(t,e)=>{r("caret",t,e);const n=e.loose?s[a.CARETLOOSE]:s[a.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,((e,n,o,s,a)=>{let l;return r("caret",t,e,n,o,s,a),y(n)?l="":y(o)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:y(s)?l="0"===n?`>=${n}.${o}.0${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${i} <${+n+1}.0.0-0`:a?(r("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${s}-${a} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s}-${a} <${+n+1}.0.0-0`):(r("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${s}${i} <${n}.${o}.${+s+1}-0`:`>=${n}.${o}.${s}${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${s} <${+n+1}.0.0-0`),r("caret return",l),l}))},w=(t,e)=>(r("replaceXRanges",t,e),t.split(/\s+/).map((t=>k(t,e))).join(" ")),k=(t,e)=>{t=t.trim();const n=e.loose?s[a.XRANGELOOSE]:s[a.XRANGE];return t.replace(n,((n,i,o,s,a,l)=>{r("xRange",t,n,i,o,s,a,l);const c=y(o),u=c||y(s),f=u||y(a),h=f;return"="===i&&h&&(i=""),l=e.includePrerelease?"-0":"",c?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&h?(u&&(s=0),a=0,">"===i?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):"<="===i&&(i="<",u?o=+o+1:s=+s+1),"<"===i&&(l="-0"),n=`${i+o}.${s}.${a}${l}`):u?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${l} <${o}.${+s+1}.0-0`),r("xRange return",n),n}))},$=(t,e)=>(r("replaceStars",t,e),t.trim().replace(s[a.STAR],"")),C=(t,e)=>(r("replaceGTE0",t,e),t.trim().replace(s[e.includePrerelease?a.GTE0PRE:a.GTE0],"")),E=t=>(e,n,i,r,o,s,a,l,c,u,f,h,d)=>`${n=y(i)?"":y(r)?`>=${i}.0.0${t?"-0":""}`:y(o)?`>=${i}.${r}.0${t?"-0":""}`:s?`>=${n}`:`>=${n}${t?"-0":""}`} ${l=y(c)?"":y(u)?`<${+c+1}.0.0-0`:y(f)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${f}-${h}`:t?`<${c}.${u}.${+f+1}-0`:`<=${l}`}`.trim(),S=(t,e,n)=>{for(let n=0;n0){const i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0};return Jot}const est=tst();var nst=(t,e,n)=>{try{e=new est(e,n)}catch(t){return!1}return e.test(t)},ist=Rrt(nst);var rst='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function ost(t,...e){for(const n of e)sst(t,n);return t}function sst(t,e){for(const n of Object.keys(e))fh(t,n,e[n],!0)}function ast(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function lst(t){for(var e=1;et,"vega-lite":(t,e)=>ust.compile(t,{config:e}).spec},yst='\n\n \n \n \n',vst="chart-wrapper";function bst(t,e,n,i){const r=`${e}
    `,o=`
    ${n}`,s=window.open("");s.document.write(r+t+o),s.document.title=`${pst[i]} JSON Source`}function xst(t){return(e=t)&&"load"in e?t:cst.loader(t);var e}async function _st(t,e,n={}){let i,r;rd(e)?(r=xst(n.loader),i=JSON.parse(await r.load(e))):i=e;const o=function(t){const e=t.usermeta?.embedOptions??{};return rd(e.defaultStyle)&&(e.defaultStyle=!1),e}(i),s=o.loader;r&&!s||(r=xst(n.loader??s));const a=await wst(o,r),l=await wst(n,r),c=lst(lst({},ost(l,a)),{},{config:uh(l.config??{},a.config??{})});return await async function(t,e,n={},i){const r=n.theme?uh(Mrt[n.theme],n.config??{}):n.config,o=Kh(n.actions)?n.actions:ost({},hst,n.actions??{}),s=lst(lst({},dst),n.i18n),a=n.renderer??"canvas",l=n.logLevel??cst.Warn,c=n.downloadFileName??"visualization",u="string"==typeof t?document.querySelector(t):t;if(!u)throw new Error(`${t} does not exist`);if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:i}=function(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}(u);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?rst.toString():n.defaultStyle,i.appendChild(e)}}const f=function(t,e){if(t.$schema){const n=Cit(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${pst[n.library]}, but mode argument sets ${pst[e]??e}.`);const i=n.library;return ist(gst[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${pst[i]} ${n.version}, but the current version of ${pst[i]} is v${gst[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}(e,n.mode);let h=mst[f](e,r);if("vega-lite"===f&&h.$schema){const t=Cit(h.$schema);ist(gst.vega,`^${t.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${gst.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions");u.innerHTML="";let d=u;if(o){const t=document.createElement("div");t.classList.add(vst),u.appendChild(t),d=t}const p=n.patch;p&&(h=p instanceof Function?p(h):Ef(h,p,!0,!1).newDocument);n.formatLocale&&cst.formatLocale(n.formatLocale);n.timeFormatLocale&&cst.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const t in n.expressionFunctions){const e=n.expressionFunctions[t];"fn"in e?cst.expressionFunction(t,e.fn,e.visitor):e instanceof Function&&cst.expressionFunction(t,e)}const{ast:g}=n,m=cst.parse(h,"vega-lite"===f?{}:r,{ast:g}),y=new(n.viewClass||cst.View)(m,lst({loader:i,logLevel:l,renderer:a},g?{expr:cst.expressionInterpreter??n.expr??tQ}:{}));if(y.addSignalListener("autosize",((t,e)=>{const{type:n}=e;"fit-x"==n?(d.classList.add("fit-x"),d.classList.remove("fit-y")):"fit-y"==n?(d.classList.remove("fit-x"),d.classList.add("fit-y")):"fit"==n?d.classList.add("fit-x","fit-y"):d.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const t=function(t){return"function"==typeof t}(n.tooltip)?n.tooltip:new Trt(!0===n.tooltip?{}:n.tooltip).call;y.tooltip(t)}let v,{hover:b}=n;void 0===b&&(b="vega"===f);if(b){const{hoverSet:t,updateSet:e}="boolean"==typeof b?{}:b;y.hover(t,e)}n&&(null!=n.width&&y.width(n.width),null!=n.height&&y.height(n.height),null!=n.padding&&y.padding(n.padding));if(await y.initialize(d,n.bind).runAsync(),!1!==o){let t=u;if(!1!==n.defaultStyle||n.forceActionsMenu){const e=document.createElement("details");e.title=s.CLICK_TO_VIEW_ACTIONS,u.append(e),t=e;const n=document.createElement("summary");n.innerHTML=yst,e.append(n),v=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",v)}const i=document.createElement("div");if(t.append(i),i.classList.add("vega-actions"),!0===o||!1!==o.export)for(const t of["svg","png"])if(!0===o||!0===o.export||o.export[t]){const e=s[`${t.toUpperCase()}_ACTION`],r=document.createElement("a"),o=lh(n.scaleFactor)?n.scaleFactor[t]:n.scaleFactor;r.text=e,r.href="#",r.target="_blank",r.download=`${c}.${t}`,r.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await y.toImageURL(t,o);this.href=n})),i.append(r)}if(!0===o||!1!==o.source){const t=document.createElement("a");t.text=s.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){bst(Pf(e),n.sourceHeader??"",n.sourceFooter??"",f),t.preventDefault()})),i.append(t)}if("vega-lite"===f&&(!0===o||!1!==o.compiled)){const t=document.createElement("a");t.text=s.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){bst(Pf(h),n.sourceHeader??"",n.sourceFooter??"","vega"),t.preventDefault()})),i.append(t)}if(!0===o||!1!==o.editor){const t=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=s.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(t,e,n){const i=t.open(e),{origin:r}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===i&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(i.postMessage(n,r),setTimeout(t,250),o-=1)}),250)}(window,t,{config:r,mode:f,renderer:a,spec:Pf(e)}),n.preventDefault()})),i.append(o)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:e,vgSpec:h,finalize:x,embedOptions:n}}(t,i,c,r)}async function wst(t,e){const n=rd(t.config)?JSON.parse(await e.load(t.config)):t.config??{},i=rd(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return lst(lst(lst({},t),i?{patch:i}:{}),n?{config:n}:{})}const kst=new Set(["width","height"]);var $st=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if((i=e.length)!=n.length)return!1;for(r=i;0!=r--;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!=r--;){var s=o[r];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n};function Cst(t={},e={},n=new Set){const i=Object.keys(t),r=Object.keys(e);return t===e||i.length===r.length&&i.filter((t=>!n.has(t))).every((n=>t[n]===e[n]))}function Est(t,e){const n=Object.keys(e);for(const i of n)try{t.removeSignalListener(i,e[i])}catch(t){console.warn("Cannot remove invalid signal listener.",t)}return n.length>0}function Sst(t,e){const n=Object.keys(e);for(const i of n)try{t.addSignalListener(i,e[i])}catch(t){console.warn("Cannot add invalid signal listener.",t)}return n.length>0}function Mst(t,e){const{width:n,height:i}=e;return void 0!==n&&void 0!==i?{...t,width:n,height:i}:void 0!==n?{...t,width:n}:void 0!==i?{...t,height:i}:t}function Dst(e){let n;return{c(){n=w("div")},m(t,i){b(t,n,i),e[11](n)},p:t,i:t,o:t,d(t){t&&x(n),e[11](null)}}}function Ast(t,e,n){let{options:i}=e,{spec:r}=e,{view:o}=e,{signalListeners:s={}}=e,{data:a={}}=e;const l=B();let c,u,f={},h={},d={},p={};async function g(){m();try{n(6,c=await _st(u,r,i)),n(1,o=c.view),Sst(o,s)&&o.runAsync(),t=o,y(),l("onNewView",{view:t})}catch(t){!function(t){l("onError",{error:t}),console.warn(t)}(t)}var t}function m(){c&&(c.finalize(),n(6,c=void 0),n(1,o=void 0))}async function y(){a&&Object.keys(a).length>0&&void 0!==c&&(n(1,o=c.view),function(t,e){for(const[n,i]of Object.entries(e))i&&(i&&"[object Function]"==={}.toString.call(i)?i(t.data(n)):t.change(n,cst.changeset().remove((()=>!0)).insert(i)))}(o,a),await o.resize().runAsync())}return I((()=>{m()})),t.$$set=t=>{"options"in t&&n(2,i=t.options),"spec"in t&&n(3,r=t.spec),"view"in t&&n(1,o=t.view),"signalListeners"in t&&n(4,s=t.signalListeners),"data"in t&&n(5,a=t.data)},t.$$.update=()=>{if(1056&t.$$.dirty&&(Cst(a,p)||y(),n(10,p=a)),991&t.$$.dirty&&void 0!==u){if(Cst(i,f,kst)){const t=function(t,e){if(t===e)return!1;const n={width:!1,height:!1,isExpensive:!1},i="height"in t||"height"in e;var r;return!("width"in t||"width"in e)||"width"in t&&"width"in e&&t.width===e.width||("width"in t&&"number"==typeof t.width?n.width=t.width:n.isExpensive=!0),!i||"height"in t&&"height"in e&&t.height===e.height||("height"in t&&"number"==typeof t.height?n.height=t.height:n.isExpensive=!0),[...(r=[t,e],new Set(r.flatMap((t=>Object.keys(t)))))].filter((t=>"width"!==t&&"height"!==t)).some((n=>!(n in t)||!(n in e)||!$st(t[n],e[n])))&&(n.isExpensive=!0),!(!1===n.width&&!1===n.height&&!n.isExpensive)&&n}(Mst(r,i),Mst(d,f)),e=s,a=h;if(t){if(t.isExpensive)g();else if(void 0!==c){const i=!Cst(e,a);n(1,o=c.view),!1!==t.width&&o.width(t.width),!1!==t.height&&o.height(t.height),i&&(a&&Est(o,a),e&&Sst(o,e)),o.runAsync()}}else Cst(e,a)||void 0===c||(n(1,o=c.view),a&&Est(o,a),e&&Sst(o,e),o.runAsync())}else g();n(7,f=i),n(8,h=s),n(9,d=r)}},[u,o,i,r,s,a,c,f,h,d,p,function(t){H[t?"unshift":"push"]((()=>{u=t,n(0,u)}))}]}class Fst extends mt{constructor(t){super(),gt(this,t,Ast,Dst,s,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function Ost(t){let e,n,i;function r(e){t[6](e)}let o={spec:t[1],data:t[2],signalListeners:t[3],options:t[4]};return void 0!==t[0]&&(o.view=t[0]),e=new Fst({props:o}),H.push((()=>ut(e,"view",r))),e.$on("onNewView",t[7]),e.$on("onError",t[8]),{c(){ft(e.$$.fragment)},m(t,n){ht(e,t,n),i=!0},p(t,[i]){const r={};2&i&&(r.spec=t[1]),4&i&&(r.data=t[2]),8&i&&(r.signalListeners=t[3]),16&i&&(r.options=t[4]),!n&&1&i&&(n=!0,r.view=t[0],J((()=>n=!1))),e.$set(r)},i(t){i||(st(e.$$.fragment,t),i=!0)},o(t){at(e.$$.fragment,t),i=!1},d(t){dt(e,t)}}}function Tst(t,e,n){let i,{spec:r}=e,{options:o={}}=e,{data:s={}}=e,{signalListeners:a={}}=e,{view:l}=e;return t.$$set=t=>{"spec"in t&&n(1,r=t.spec),"options"in t&&n(5,o=t.options),"data"in t&&n(2,s=t.data),"signalListeners"in t&&n(3,a=t.signalListeners),"view"in t&&n(0,l=t.view)},t.$$.update=()=>{32&t.$$.dirty&&n(4,i={...o,mode:"vega"})},[l,r,s,a,i,o,function(t){l=t,n(0,l)},function(e){q.call(this,t,e)},function(e){q.call(this,t,e)}]}class Nst extends mt{constructor(t){super(),gt(this,t,Tst,Ost,s,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function zst(t){let e,n;return e=new Nst({props:{spec:t[0]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.spec=t[0]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Lst(t){let e,n;return e=new Nst({props:{data:t[1],spec:t[0]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.data=t[1]),1&n&&(i.spec=t[0]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function Rst(t){let e,n,i,r;const o=[Lst,zst],s=[];function a(t,e){return t[1]&&t[0]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,[r]){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Pst(t,e,n){let i,r,{componentData:o}=e;return t.$$set=t=>{"componentData"in t&&n(2,o=t.componentData)},t.$$.update=()=>{4&t.$$.dirty&&n(1,({data:i,spec:r}=o),i,(n(0,r),n(2,o)))},[r,i,o]}class Ist extends mt{constructor(t){super(),gt(this,t,Pst,Rst,s,{componentData:2})}}function Bst(e){let n,i,r=(e[0]?.text||"")+"";return{c(){n=w("p"),i=$(r),M(n,"data-component","text")},m(t,e){b(t,n,e),v(n,i)},p(t,[e]){1&e&&r!==(r=(t[0]?.text||"")+"")&&A(i,r)},i:t,o:t,d(t){t&&x(n)}}}function jst(t,e,n){let{componentData:i}=e;return t.$$set=t=>{"componentData"in t&&n(0,i=t.componentData)},[i]}class Ust extends mt{constructor(t){super(),gt(this,t,jst,Bst,s,{componentData:0})}}function qst(e){let n;return{c(){n=$(e[0])},m(t,e){b(t,n,e)},p(t,e){1&e&&A(n,t[0])},i:t,o:t,d(t){t&&x(n)}}}function Wst(t){let e,n,i;var r=t[1];function o(t){return{props:{componentData:t[0]}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(1&i&&(s.componentData=t[0]),2&i&&r!==(r=t[1])){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function Hst(t){let e,n,i,r;const o=[Wst,qst],s=[];function a(t,e){return t[1]?0:1}return e=a(t),n=s[e]=o[e](t),{c(){n.c(),i=E()},m(t,n){s[e].m(t,n),b(t,i,n),r=!0},p(t,[r]){let l=e;e=a(t),e===l?s[e].p(t,r):(rt(),at(s[l],1,1,(()=>{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}function Vst(t,e,n){let i,{componentData:r}=e;const o={artifacts:jt,barChart:xa,dag:Ja,heading:ll,image:dl,lineChart:ml,log:bl,markdown:Vu,progressBar:ef,text:Ust,vegaChart:Ist},s=null==r?void 0:r.type;return s&&(i=null==o?void 0:o[s],i||console.error("Unknown component type: ",s)),t.$$set=t=>{"componentData"in t&&n(0,r=t.componentData)},[r,i]}class Yst extends mt{constructor(t){super(),gt(this,t,Vst,Hst,s,{componentData:0})}}function Gst(t,e,n){const i=t.slice();return i[3]=e[n],i[5]=n,i}function Xst(t,e,n){const i=t.slice();return i[6]=e[n],i}function Zst(t){let e,n,i,r,o=t[1],s=[];for(let e=0;eat(s[t],1,1,(()=>{s[t]=null}));return{c(){e=w("div"),n=w("table"),i=w("tbody");for(let t=0;tat(c[t],1,1,(()=>{c[t]=null}));return{c(){e=w("tr"),n=w("td"),i=$(a),r=C();for(let t=0;t{i=null})),ot())},i(t){n||(st(i),n=!0)},o(t){at(i),n=!1},d(t){i&&i.d(t),t&&x(e)}}}function tat(t,e,n){let i,r,{componentData:o}=e;return t.$$set=t=>{"componentData"in t&&n(2,o=t.componentData)},t.$$.update=()=>{4&t.$$.dirty&&n(1,({columns:i,data:r}=o),i,(n(0,r),n(2,o)))},[r,i,o]}class eat extends mt{constructor(t){super(),gt(this,t,tat,Kst,s,{componentData:2})}}function nat(t,e,n){const i=t.slice();return i[3]=e[n],i}function iat(t,e,n){const i=t.slice();return i[6]=e[n],i}function rat(t,e,n){const i=t.slice();return i[9]=e[n],i}function oat(t){let e,n,i,r,o,s,a,l=t[1],c=[];for(let e=0;eat(f[t],1,1,(()=>{f[t]=null}));return{c(){e=w("div"),n=w("table"),i=w("thead"),r=w("tr");for(let t=0;tat(o[t],1,1,(()=>{o[t]=null}));return{c(){e=w("tr");for(let t=0;t{i=null})),ot())},i(t){n||(st(i),n=!0)},o(t){at(i),n=!1},d(t){i&&i.d(t),t&&x(e)}}}function uat(t,e,n){let i,r,{componentData:o}=e;return t.$$set=t=>{"componentData"in t&&n(2,o=t.componentData)},t.$$.update=()=>{4&t.$$.dirty&&n(1,({columns:i,data:r}=o),i,(n(0,r),n(2,o)))},[r,i,o]}class fat extends mt{constructor(t){super(),gt(this,t,uat,cat,s,{componentData:2})}}function hat(t){let e,n,i;var r=t[3];function o(t){return{props:{componentData:t[0]}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(1&i&&(s.componentData=t[0]),r!==(r=t[3])){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function dat(t){let e,n,i=t[2]&&t[1]&&hat(t);return{c(){i&&i.c(),e=E()},m(t,r){i&&i.m(t,r),b(t,e,r),n=!0},p(t,[n]){t[2]&&t[1]?i?(i.p(t,n),6&n&&st(i,1)):(i=hat(t),i.c(),st(i,1),i.m(e.parentNode,e)):i&&(rt(),at(i,1,1,(()=>{i=null})),ot())},i(t){n||(st(i),n=!0)},o(t){at(i),n=!1},d(t){i&&i.d(t),t&&x(e)}}}function pat(t,e,n){let i,r,o,{componentData:s}=e;const a=o?eat:fat;return t.$$set=t=>{"componentData"in t&&n(0,s=t.componentData)},t.$$.update=()=>{1&t.$$.dirty&&n(2,({columns:i,data:r,vertical:o}=s),i,(n(1,r),n(0,s)))},[s,r,i,a]}class gat extends mt{constructor(t){super(),gt(this,t,pat,dat,s,{componentData:0})}}function mat(t,e,n){const i=t.slice();return i[3]=e[n],i}function yat(t){let e,n,i;var r=t[1];function o(t){return{props:{componentData:t[0]}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(1&i&&(s.componentData=t[0]),r!==(r=t[1])){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function vat(t){let e,n,i;var r=t[1];function o(t){return{props:{componentData:t[0],$$slots:{default:[xat]},$$scope:{ctx:t}}}}return r&&(e=N(r,o(t))),{c(){e&&ft(e.$$.fragment),n=E()},m(t,r){e&&ht(e,t,r),b(t,n,r),i=!0},p(t,i){const s={};if(1&i&&(s.componentData=t[0]),65&i&&(s.$$scope={dirty:i,ctx:t}),r!==(r=t[1])){if(e){rt();const t=e;at(t.$$.fragment,1,0,(()=>{dt(t,1)})),ot()}r?(e=N(r,o(t)),ft(e.$$.fragment),st(e.$$.fragment,1),ht(e,n.parentNode,n)):e=null}else r&&e.$set(s)},i(t){i||(e&&st(e.$$.fragment,t),i=!0)},o(t){e&&at(e.$$.fragment,t),i=!1},d(t){t&&x(n),e&&dt(e,t)}}}function bat(t){let e,n;return e=new kat({props:{componentData:t[3]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.componentData=t[3]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function xat(t){let e,n,i=t[0].contents,r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{s[l]=null})),ot(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),st(n,1),n.m(i.parentNode,i))},i(t){r||(st(n),r=!0)},o(t){at(n),r=!1},d(t){s[e].d(t),t&&x(i)}}}(t);return{c(){i&&i.c(),e=E()},m(t,r){i&&i.m(t,r),b(t,e,r),n=!0},p(t,[e]){t[1]&&i.p(t,e)},i(t){n||(st(i),n=!0)},o(t){at(i),n=!1},d(t){i&&i.d(t),t&&x(e)}}}function wat(t,e,n){let{componentData:i}=e;const r={artifacts:jt,barChart:xa,dag:Ja,heading:ll,image:dl,lineChart:ml,log:bl,markdown:Vu,page:Xu,progressBar:ef,section:af,subtitle:il,table:gat,text:Ust,title:tl,vegaChart:Ist};let o=null==r?void 0:r[i.type];return o||console.error("Unknown component type: ",i.type),t.$$set=t=>{"componentData"in t&&n(0,i=t.componentData)},[i,o]}class kat extends mt{constructor(t){super(),gt(this,t,wat,_at,s,{componentData:0})}}function $at(t){let e,n,i;const r=t[1].default,o=u(r,t,t[0],null);return{c(){e=w("main"),n=w("div"),o&&o.c(),M(n,"class","mainContainer svelte-13ho8jo"),M(e,"class","svelte-13ho8jo")},m(t,r){b(t,e,r),v(e,n),o&&o.m(n,null),i=!0},p(t,[e]){o&&o.p&&(!i||1&e)&&d(o,r,t,t[0],i?h(r,t[0],e,null):p(t[0]),null)},i(t){i||(st(o,t),i=!0)},o(t){at(o,t),i=!1},d(t){t&&x(e),o&&o.d(t)}}}function Cat(t,e,n){let{$$slots:i={},$$scope:r}=e;return t.$$set=t=>{"$$scope"in t&&n(0,r=t.$$scope)},[r,i]}class Eat extends mt{constructor(t){super(),gt(this,t,Cat,$at,s,{})}}const Sat=/^[a-z0-9]+(-[a-z0-9]+)*$/,Mat=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function Dat(t){return{...Mat,...t}}const Aat=(t,e,n,i="")=>{const r=t.split(":");if("@"===t.slice(0,1)){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const t=r.pop(),n=r.pop(),o={provider:r.length>0?r[0]:i,prefix:n,name:t};return e&&!Fat(o)?null:o}const o=r[0],s=o.split("-");if(s.length>1){const t={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!Fat(t)?null:t}if(n&&""===i){const t={provider:i,prefix:"",name:o};return e&&!Fat(t,n)?null:t}return null},Fat=(t,e)=>!!t&&!(""!==t.provider&&!t.provider.match(Sat)||!(e&&""===t.prefix||t.prefix.match(Sat))||!t.name.match(Sat));function Oat(t,e,n=!1){const i=function e(n,i){if(void 0!==t.icons[n])return Object.assign({},t.icons[n]);if(i>5)return null;const r=t.aliases;if(r&&void 0!==r[n]){const t=r[n],o=e(t.parent,i+1);return o?function(t,e){const n={...t};for(const t in Mat){const i=t;if(void 0!==e[i]){const t=e[i];if(void 0===n[i]){n[i]=t;continue}switch(i){case"rotate":n[i]=(n[i]+t)%4;break;case"hFlip":case"vFlip":n[i]=t!==n[i];break;default:n[i]=t}}}return n}(o,t):o}const o=t.chars;return!i&&o&&void 0!==o[n]?e(o[n],i+1):null}(e,0);if(i)for(const e in Mat)void 0===i[e]&&void 0!==t[e]&&(i[e]=t[e]);return i&&n?Dat(i):i}function Tat(t,e,n){n=n||{};const i=[];if("object"!=typeof t||"object"!=typeof t.icons)return i;t.not_found instanceof Array&&t.not_found.forEach((t=>{e(t,null),i.push(t)}));const r=t.icons;Object.keys(r).forEach((n=>{const r=Oat(t,n,!0);r&&(e(n,r),i.push(n))}));const o=n.aliases||"all";if("none"!==o&&"object"==typeof t.aliases){const n=t.aliases;Object.keys(n).forEach((r=>{if("variations"===o&&function(t){for(const e in Mat)if(void 0!==t[e])return!0;return!1}(n[r]))return;const s=Oat(t,r,!0);s&&(e(r,s),i.push(r))}))}return i}const Nat={provider:"string",aliases:"object",not_found:"object"};for(const t in Mat)Nat[t]=typeof Mat[t];function zat(t){if("object"!=typeof t||null===t)return null;const e=t;if("string"!=typeof e.prefix||!t.icons||"object"!=typeof t.icons)return null;for(const e in Nat)if(void 0!==t[e]&&typeof t[e]!==Nat[e])return null;const n=e.icons;for(const t in n){const e=n[t];if(!t.match(Sat)||"string"!=typeof e.body)return null;for(const t in Mat)if(void 0!==e[t]&&typeof e[t]!=typeof Mat[t])return null}const i=e.aliases;if(i)for(const t in i){const e=i[t],r=e.parent;if(!t.match(Sat)||"string"!=typeof r||!n[r]&&!i[r])return null;for(const t in Mat)if(void 0!==e[t]&&typeof e[t]!=typeof Mat[t])return null}return e}let Lat=Object.create(null);try{const t=window||self;t&&1===t._iconifyStorage.version&&(Lat=t._iconifyStorage.storage)}catch(t){}function Rat(t,e){void 0===Lat[t]&&(Lat[t]=Object.create(null));const n=Lat[t];return void 0===n[e]&&(n[e]=function(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:Object.create(null)}}(t,e)),n[e]}function Pat(t,e){if(!zat(e))return[];const n=Date.now();return Tat(e,((e,i)=>{i?t.icons[e]=i:t.missing[e]=n}))}let Iat=!1;function Bat(t){return"boolean"==typeof t&&(Iat=t),Iat}function jat(t,e){const n=Aat(t,!0,Iat);if(!n)return!1;return function(t,e,n){try{if("string"==typeof n.body)return t.icons[e]=Object.freeze(Dat(n)),!0}catch(t){}return!1}(Rat(n.provider,n.prefix),n.name,e)}const Uat=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});const qat=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Wat=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Hat(t,e,n){if(1===e)return t;if(n=void 0===n?100:n,"number"==typeof t)return Math.ceil(t*e*n)/n;if("string"!=typeof t)return t;const i=t.split(qat);if(null===i||!i.length)return t;const r=[];let o=i.shift(),s=Wat.test(o);for(;;){if(s){const t=parseFloat(o);isNaN(t)?r.push(o):r.push(Math.ceil(t*e*n)/n)}else r.push(o);if(o=i.shift(),void 0===o)return r.join("");s=!s}}function Vat(t){let e="";switch(t.hAlign){case"left":e+="xMin";break;case"right":e+="xMax";break;default:e+="xMid"}switch(t.vAlign){case"top":e+="YMin";break;case"bottom":e+="YMax";break;default:e+="YMid"}return e+=t.slice?" slice":" meet",e}const Yat=/\sid="(\S+)"/g,Gat="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let Xat=0;function Zat(t,e=Gat){const n=[];let i;for(;i=Yat.exec(t);)n.push(i[1]);return n.length?(n.forEach((n=>{const i="function"==typeof e?e(n):e+(Xat++).toString(),r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+r+')([")]|\\.[a-z])',"g"),"$1"+i+"$3")})),t):t}const Jat=Object.create(null);function Qat(t){return Jat[t]||Jat[""]}function Kat(t){let e;if("string"==typeof t.resources)e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:void 0===t.path?"/":t.path,maxURL:t.maxURL?t.maxURL:500,rotate:t.rotate?t.rotate:750,timeout:t.timeout?t.timeout:5e3,random:!0===t.random,index:t.index?t.index:0,dataAfterTimeout:!1!==t.dataAfterTimeout}}const tlt=Object.create(null),elt=["https://api.simplesvg.com","https://api.unisvg.com"],nlt=[];for(;elt.length>0;)1===elt.length||Math.random()>.5?nlt.push(elt.shift()):nlt.push(elt.pop());function ilt(t,e){const n=Kat(e);return null!==n&&(tlt[t]=n,!0)}function rlt(t){return tlt[t]}tlt[""]=Kat({resources:["https://api.iconify.design"].concat(nlt)});const olt=(t,e)=>{let n=t,i=-1!==n.indexOf("?");return Object.keys(e).forEach((t=>{let r;try{r=function(t){switch(typeof t){case"boolean":return t?"true":"false";case"number":case"string":return encodeURIComponent(t);default:throw new Error("Invalid parameter")}}(e[t])}catch(t){return}n+=(i?"&":"?")+encodeURIComponent(t)+"="+r,i=!0})),n},slt={},alt={};let llt=(()=>{let t;try{if(t=fetch,"function"==typeof t)return t}catch(t){}return null})();const clt={prepare:(t,e,n)=>{const i=[];let r=slt[e];void 0===r&&(r=function(t,e){const n=rlt(t);if(!n)return 0;let i;if(n.maxURL){let t=0;n.resources.forEach((e=>{const n=e;t=Math.max(t,n.length)}));const r=olt(e+".json",{icons:""});i=n.maxURL-t-n.path.length-r.length}else i=0;const r=t+":"+e;return alt[t]=n.path,slt[r]=i,i}(t,e));const o="icons";let s={type:o,provider:t,prefix:e,icons:[]},a=0;return n.forEach(((n,l)=>{a+=n.length+1,a>=r&&l>0&&(i.push(s),s={type:o,provider:t,prefix:e,icons:[]},a=n.length),s.icons.push(n)})),i.push(s),i},send:(t,e,n)=>{if(!llt)return void n("abort",424);let i=function(t){if("string"==typeof t){if(void 0===alt[t]){const e=rlt(t);if(!e)return"/";alt[t]=e.path}return alt[t]}return"/"}(e.provider);switch(e.type){case"icons":{const t=e.prefix,n=e.icons.join(",");i+=olt(t+".json",{icons:n});break}case"custom":{const t=e.uri;i+="/"===t.slice(0,1)?t.slice(1):t;break}default:return void n("abort",400)}let r=503;llt(t+i).then((t=>{const e=t.status;if(200===e)return r=501,t.json();setTimeout((()=>{n(function(t){return 404===t}(e)?"abort":"next",e)}))})).then((t=>{"object"==typeof t&&null!==t?setTimeout((()=>{n("success",t)})):setTimeout((()=>{n("next",r)}))})).catch((()=>{n("next",r)}))}};const ult=Object.create(null),flt=Object.create(null);function hlt(t,e){t.forEach((t=>{const n=t.provider;if(void 0===ult[n])return;const i=ult[n],r=t.prefix,o=i[r];o&&(i[r]=o.filter((t=>t.id!==e)))}))}let dlt=0;var plt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function glt(t,e,n,i){const r=t.resources.length,o=t.random?Math.floor(Math.random()*r):t.index;let s;if(t.random){let e=t.resources.slice(0);for(s=[];e.length>1;){const t=Math.floor(Math.random()*e.length);s.push(e[t]),e=e.slice(0,t).concat(e.slice(t+1))}s=s.concat(e)}else s=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let l,c="pending",u=0,f=null,h=[],d=[];function p(){f&&(clearTimeout(f),f=null)}function g(){"pending"===c&&(c="aborted"),p(),h.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),h=[]}function m(t,e){e&&(d=[]),"function"==typeof t&&d.push(t)}function y(){c="failed",d.forEach((t=>{t(void 0,l)}))}function v(){h.forEach((t=>{"pending"===t.status&&(t.status="aborted")})),h=[]}function b(){if("pending"!==c)return;p();const i=s.shift();if(void 0===i)return h.length?void(f=setTimeout((()=>{p(),"pending"===c&&(v(),y())}),t.timeout)):void y();const r={status:"pending",resource:i,callback:(e,n)=>{!function(e,n,i){const r="success"!==n;switch(h=h.filter((t=>t!==e)),c){case"pending":break;case"failed":if(r||!t.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=i,void y();if(r)return l=i,void(h.length||(s.length?b():y()));if(p(),v(),!t.random){const n=t.resources.indexOf(e.resource);-1!==n&&n!==t.index&&(t.index=n)}c="completed",d.forEach((t=>{t(i)}))}(r,e,n)}};h.push(r),u++,f=setTimeout(b,t.rotate),n(i,e,r.callback)}return"function"==typeof i&&d.push(i),setTimeout(b),function(){return{startTime:a,payload:e,status:c,queriesSent:u,queriesPending:h.length,subscribe:m,abort:g}}}function mlt(t){const e=function(t){if(!("object"==typeof t&&"object"==typeof t.resources&&t.resources instanceof Array&&t.resources.length))throw new Error("Invalid Reduncancy configuration");const e=Object.create(null);let n;for(n in plt)void 0!==t[n]?e[n]=t[n]:e[n]=plt[n];return e}(t);let n=[];function i(){n=n.filter((t=>"pending"===t().status))}const r={query:function(t,r,o){const s=glt(e,t,r,((t,e)=>{i(),o&&o(t,e)}));return n.push(s),s},find:function(t){const e=n.find((e=>t(e)));return void 0!==e?e:null},setIndex:t=>{e.index=t},getIndex:()=>e.index,cleanup:i};return r}function ylt(){}const vlt=Object.create(null);function blt(t,e,n){let i,r;if("string"==typeof t){const e=Qat(t);if(!e)return n(void 0,424),ylt;r=e.send;const o=function(t){if(void 0===vlt[t]){const e=rlt(t);if(!e)return;const n={config:e,redundancy:mlt(e)};vlt[t]=n}return vlt[t]}(t);o&&(i=o.redundancy)}else{const e=Kat(t);if(e){i=mlt(e);const n=Qat(t.resources?t.resources[0]:"");n&&(r=n.send)}}return i&&r?i.query(e,r,n)().abort:(n(void 0,424),ylt)}const xlt={};function _lt(){}const wlt=Object.create(null),klt=Object.create(null),$lt=Object.create(null),Clt=Object.create(null);function Elt(t,e){void 0===$lt[t]&&($lt[t]=Object.create(null));const n=$lt[t];n[e]||(n[e]=!0,setTimeout((()=>{n[e]=!1,function(t,e){void 0===flt[t]&&(flt[t]=Object.create(null));const n=flt[t];n[e]||(n[e]=!0,setTimeout((()=>{if(n[e]=!1,void 0===ult[t]||void 0===ult[t][e])return;const i=ult[t][e].slice(0);if(!i.length)return;const r=Rat(t,e);let o=!1;i.forEach((n=>{const i=n.icons,s=i.pending.length;i.pending=i.pending.filter((n=>{if(n.prefix!==e)return!0;const s=n.name;if(void 0!==r.icons[s])i.loaded.push({provider:t,prefix:e,name:s});else{if(void 0===r.missing[s])return o=!0,!0;i.missing.push({provider:t,prefix:e,name:s})}return!1})),i.pending.length!==s&&(o||hlt([{provider:t,prefix:e}],n.id),n.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),n.abort))}))})))}(t,e)})))}const Slt=Object.create(null);function Mlt(t,e,n){void 0===klt[t]&&(klt[t]=Object.create(null));const i=klt[t];void 0===Clt[t]&&(Clt[t]=Object.create(null));const r=Clt[t];void 0===wlt[t]&&(wlt[t]=Object.create(null));const o=wlt[t];void 0===i[e]?i[e]=n:i[e]=i[e].concat(n).sort(),r[e]||(r[e]=!0,setTimeout((()=>{r[e]=!1;const n=i[e];delete i[e];const s=Qat(t);if(!s)return void function(){const n=(""===t?"":"@"+t+":")+e,i=Math.floor(Date.now()/6e4);Slt[n]{blt(t,n,((i,r)=>{const s=Rat(t,e);if("object"!=typeof i){if(404!==r)return;const t=Date.now();n.icons.forEach((e=>{s.missing[e]=t}))}else try{const n=Pat(s,i);if(!n.length)return;const r=o[e];n.forEach((t=>{delete r[t]})),xlt.store&&xlt.store(t,i)}catch(t){console.error(t)}Elt(t,e)}))}))})))}const Dlt=(t,e)=>{const n=function(t,e=!0,n=!1){const i=[];return t.forEach((t=>{const r="string"==typeof t?Aat(t,!1,n):t;e&&!Fat(r,n)||i.push({provider:r.provider,prefix:r.prefix,name:r.name})})),i}(t,!0,Bat()),i=function(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort(((t,e)=>t.provider!==e.provider?t.provider.localeCompare(e.provider):t.prefix!==e.prefix?t.prefix.localeCompare(e.prefix):t.name.localeCompare(e.name)));let i={provider:"",prefix:"",name:""};return t.forEach((t=>{if(i.name===t.name&&i.prefix===t.prefix&&i.provider===t.provider)return;i=t;const r=t.provider,o=t.prefix,s=t.name;void 0===n[r]&&(n[r]=Object.create(null));const a=n[r];void 0===a[o]&&(a[o]=Rat(r,o));const l=a[o];let c;c=void 0!==l.icons[s]?e.loaded:""===o||void 0!==l.missing[s]?e.missing:e.pending;const u={provider:r,prefix:o,name:s};c.push(u)})),e}(n);if(!i.pending.length){let t=!0;return e&&setTimeout((()=>{t&&e(i.loaded,i.missing,i.pending,_lt)})),()=>{t=!1}}const r=Object.create(null),o=[];let s,a;i.pending.forEach((t=>{const e=t.provider,n=t.prefix;if(n===a&&e===s)return;s=e,a=n,o.push({provider:e,prefix:n}),void 0===wlt[e]&&(wlt[e]=Object.create(null));const i=wlt[e];void 0===i[n]&&(i[n]=Object.create(null)),void 0===r[e]&&(r[e]=Object.create(null));const l=r[e];void 0===l[n]&&(l[n]=[])}));const l=Date.now();return i.pending.forEach((t=>{const e=t.provider,n=t.prefix,i=t.name,o=wlt[e][n];void 0===o[i]&&(o[i]=l,r[e][n].push(i))})),o.forEach((t=>{const e=t.provider,n=t.prefix;r[e][n].length&&Mlt(e,n,r[e][n])})),e?function(t,e,n){const i=dlt++,r=hlt.bind(null,n,i);if(!e.pending.length)return r;const o={id:i,icons:e,callback:t,abort:r};return n.forEach((t=>{const e=t.provider,n=t.prefix;void 0===ult[e]&&(ult[e]=Object.create(null));const i=ult[e];void 0===i[n]&&(i[n]=[]),i[n].push(o)})),r}(e,i,o):_lt},Alt="iconify2",Flt="iconify",Olt=Flt+"-count",Tlt=Flt+"-version",Nlt=36e5,zlt={local:!0,session:!0};let Llt=!1;const Rlt={local:0,session:0},Plt={local:[],session:[]};let Ilt="undefined"==typeof window?{}:window;function Blt(t){const e=t+"Storage";try{if(Ilt&&Ilt[e]&&"number"==typeof Ilt[e].length)return Ilt[e]}catch(t){}return zlt[t]=!1,null}function jlt(t,e,n){try{return t.setItem(Olt,n.toString()),Rlt[e]=n,!0}catch(t){return!1}}function Ult(t){const e=t.getItem(Olt);if(e){const t=parseInt(e);return t||0}return 0}const qlt=()=>{if(Llt)return;Llt=!0;const t=Math.floor(Date.now()/Nlt)-168;function e(e){const n=Blt(e);if(!n)return;const i=e=>{const i=Flt+e.toString(),r=n.getItem(i);if("string"!=typeof r)return!1;let o=!0;try{const e=JSON.parse(r);if("object"!=typeof e||"number"!=typeof e.cached||e.cached0}}catch(t){o=!1}return o||n.removeItem(i),o};try{const t=n.getItem(Tlt);if(t!==Alt)return t&&function(t){try{const e=Ult(t);for(let n=0;n=0;t--)i(t)||(t===r-1?r--:Plt[e].push(t));jlt(n,e,r)}catch(t){}}for(const t in zlt)e(t)},Wlt=(t,e)=>{function n(n){if(!zlt[n])return!1;const i=Blt(n);if(!i)return!1;let r=Plt[n].shift();if(void 0===r&&(r=Rlt[n],!jlt(i,n,r+1)))return!1;try{const n={cached:Math.floor(Date.now()/Nlt),provider:t,data:e};i.setItem(Flt+r.toString(),JSON.stringify(n))}catch(t){return!1}return!0}Llt||qlt(),Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))},Hlt=/[\s,]+/;function Vlt(t,e){e.split(Hlt).forEach((e=>{switch(e.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}}))}function Ylt(t,e){e.split(Hlt).forEach((e=>{const n=e.trim();switch(n){case"left":case"center":case"right":t.hAlign=n;break;case"top":case"middle":case"bottom":t.vAlign=n;break;case"slice":case"crop":t.slice=!0;break;case"meet":t.slice=!1}}))}function Glt(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(t){for(;t<0;)t+=4;return t%4}if(""===n){const e=parseInt(t);return isNaN(e)?0:i(e)}if(n!==t){let e=0;switch(n){case"%":e=25;break;case"deg":e=90}if(e){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r/=e,r%1==0?i(r):0)}}return e}const Xlt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"};function Zlt(t,e){const n=function(t,e){const n={};for(const i in t){const r=i;if(n[r]=t[r],void 0===e[r])continue;const o=e[r];switch(r){case"inline":case"slice":"boolean"==typeof o&&(n[r]=o);break;case"hFlip":case"vFlip":!0===o&&(n[r]=!n[r]);break;case"hAlign":case"vAlign":"string"==typeof o&&""!==o&&(n[r]=o);break;case"width":case"height":("string"==typeof o&&""!==o||"number"==typeof o&&o||null===o)&&(n[r]=o);break;case"rotate":"number"==typeof o&&(n[r]+=o)}}return n}(Uat,e),i={...Xlt};let r="string"==typeof e.style?e.style:"";for(let t in e){const o=e[t];if(void 0!==o)switch(t){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[t]=!0===o||"true"===o||1===o;break;case"flip":"string"==typeof o&&Vlt(n,o);break;case"align":"string"==typeof o&&Ylt(n,o);break;case"color":r=r+(r.length>0&&";"!==r.trim().slice(-1)?";":"")+"color: "+o+"; ";break;case"rotate":"string"==typeof o?n[t]=Glt(o):"number"==typeof o&&(n[t]=o);break;case"ariaHidden":case"aria-hidden":!0!==o&&"true"!==o&&delete i["aria-hidden"];break;default:if("on:"===t.slice(0,3))break;void 0===Uat[t]&&(i[t]=o)}}const o=function(t,e){const n={left:t.left,top:t.top,width:t.width,height:t.height};let i,r,o=t.body;[t,e].forEach((t=>{const e=[],i=t.hFlip,r=t.vFlip;let s,a=t.rotate;switch(i?r?a+=2:(e.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),e.push("scale(-1 1)"),n.top=n.left=0):r&&(e.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),e.push("scale(1 -1)"),n.top=n.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:s=n.height/2+n.top,e.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:e.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:s=n.width/2+n.left,e.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}a%2==1&&(0===n.left&&0===n.top||(s=n.left,n.left=n.top,n.top=s),n.width!==n.height&&(s=n.width,n.width=n.height,n.height=s)),e.length&&(o=''+o+"")})),null===e.width&&null===e.height?(r="1em",i=Hat(r,n.width/n.height)):null!==e.width&&null!==e.height?(i=e.width,r=e.height):null!==e.height?(r=e.height,i=Hat(r,n.width/n.height)):(i=e.width,r=Hat(i,n.height/n.width)),"auto"===i&&(i=n.width),"auto"===r&&(r=n.height),i="string"==typeof i?i:i.toString()+"",r="string"==typeof r?r:r.toString()+"";const s={attributes:{width:i,height:r,preserveAspectRatio:Vat(e),viewBox:n.left.toString()+" "+n.top.toString()+" "+n.width.toString()+" "+n.height.toString()},body:o};return e.inline&&(s.inline=!0),s}(t,n);for(let t in o.attributes)i[t]=o.attributes[t];o.inline&&(r="vertical-align: -0.125em; "+r),""!==r&&(i.style=r);let s=0,a=e.id;return"string"==typeof a&&(a=a.replace(/-/g,"_")),{attributes:i,body:Zat(o.body,a?()=>a+"ID"+s++:"iconifySvelte")}}var Jlt;if(Bat(!0),Jlt=clt,Jat[""]=Jlt,"undefined"!=typeof document&&"undefined"!=typeof window){xlt.store=Wlt,qlt();const t=window;if(void 0!==t.IconifyPreload){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof e&&null!==e&&(e instanceof Array?e:[e]).forEach((t=>{try{("object"!=typeof t||null===t||t instanceof Array||"object"!=typeof t.icons||"string"!=typeof t.prefix||!function(t,e){if("object"!=typeof t)return!1;if("string"!=typeof e&&(e="string"==typeof t.provider?t.provider:""),Iat&&""===e&&("string"!=typeof t.prefix||""===t.prefix)){let e=!1;return zat(t)&&(t.prefix="",Tat(t,((t,n)=>{n&&jat(t,n)&&(e=!0)}))),e}return!("string"!=typeof t.prefix||!Fat({provider:e,prefix:t.prefix,name:"a"}))&&!!Pat(Rat(e,t.prefix),t)}(t))&&console.error(n)}catch(t){console.error(n)}}))}if(void 0!==t.IconifyProviders){const e=t.IconifyProviders;if("object"==typeof e&&null!==e)for(let t in e){const n="IconifyProviders["+t+"] is invalid.";try{const i=e[t];if("object"!=typeof i||!i||void 0===i.resources)continue;ilt(t,i)||console.error(n)}catch(Cit){console.error(n)}}}}function Qlt(t,e,n,i,r){function o(){e.loading&&(e.loading.abort(),e.loading=null)}if("object"==typeof t&&null!==t&&"string"==typeof t.body)return e.name="",o(),{data:Dat(t)};let s;if("string"!=typeof t||null===(s=Aat(t,!1,!0)))return o(),null;const a=function(t){const e="string"==typeof t?Aat(t,!0,Iat):t;return e?function(t,e){const n=t.icons[e];return void 0===n?null:n}(Rat(e.provider,e.prefix),e.name):null}(s);if(null===a)return!n||e.loading&&e.loading.name===t||(o(),e.name="",e.loading={name:t,abort:Dlt([s],i)}),null;o(),e.name!==t&&(e.name=t,r&&!e.destroyed&&r(t));const l=["iconify"];return""!==s.prefix&&l.push("iconify--"+s.prefix),""!==s.provider&&l.push("iconify--"+s.provider),{data:a,classes:l}}function Klt(t){let n,i=t[0].body+"",r=[t[0].attributes],o={};for(let t=0;t{"function"==typeof n.onLoad&&n.onLoad(t);B()("load",{icon:t})};function c(){i(3,a++,a)}return P((()=>{i(2,s=!0)})),I((()=>{i(1,r.destroyed=!0,r),r.loading&&(r.loading.abort(),i(1,r.loading=null,r))})),t.$$set=t=>{i(6,n=e(e({},n),g(t)))},t.$$.update=()=>{{const a=Qlt(n.icon,r,s,c,l);i(0,o=a?(t=a.data,e=n,t?Zlt(t,e):null):null),o&&a.classes&&i(0,o.attributes.class=("string"==typeof n.class?n.class+" ":"")+a.classes.join(" "),o)}var t,e},n=g(n),[o,r,s,a]}class nct extends mt{constructor(t){super(),gt(this,t,ect,tct,s,{})}}function ict(t){let e,n,i,o,s,a,l,c,u;return i=new nct({props:{icon:"mdi:close"}}),a=new kat({props:{componentData:t[1]}}),{c(){e=w("div"),n=w("span"),ft(i.$$.fragment),o=C(),s=w("div"),ft(a.$$.fragment),M(n,"class","cancelButton svelte-1hhf5ym"),M(s,"class","modalContainer"),M(e,"class","modal svelte-1hhf5ym"),M(e,"data-component","modal")},m(r,f){b(r,e,f),v(e,n),ht(i,n,null),v(e,o),v(e,s),ht(a,s,null),l=!0,c||(u=[S(s,"click",oct),S(e,"click",t[3])],c=!0)},p(t,e){const n={};2&e&&(n.componentData=t[1]),a.$set(n)},i(t){l||(st(i.$$.fragment,t),st(a.$$.fragment,t),l=!0)},o(t){at(i.$$.fragment,t),at(a.$$.fragment,t),l=!1},d(t){t&&x(e),dt(i),dt(a),c=!1,r(u)}}}function rct(t){let e,n,i,r,o=t[0]&&t[1]&&ict(t);return{c(){o&&o.c(),e=E()},m(s,a){o&&o.m(s,a),b(s,e,a),n=!0,i||(r=S(window,"keyup",t[2]),i=!0)},p(t,[n]){t[0]&&t[1]?o?(o.p(t,n),3&n&&st(o,1)):(o=ict(t),o.c(),st(o,1),o.m(e.parentNode,e)):o&&(rt(),at(o,1,1,(()=>{o=null})),ot())},i(t){n||(st(o),n=!0)},o(t){at(o),n=!1},d(t){o&&o.d(t),t&&x(e),i=!1,r()}}}const oct=t=>{t?.stopImmediatePropagation()};function sct(t,e,n){let i;c(t,wt,(t=>n(1,i=t)));let{componentData:r}=e;return t.$$set=t=>{"componentData"in t&&n(0,r=t.componentData)},[r,i,function(t){"Escape"===t.code&&wt.set(void 0)},function(t){t.stopImmediatePropagation(),wt.set(void 0)}]}class act extends mt{constructor(t){super(),gt(this,t,sct,rct,s,{componentData:0})}}function lct(t,e,n){const i=t.slice();return i[2]=e[n][0],i[3]=e[n][1],i}function cct(t,e,n){const i=t.slice();return i[6]=e[n],i}function uct(t){let e,n,i=t[2]+"";return{c(){e=w("span"),n=$(i),M(e,"class","pageId svelte-1kdpgko")},m(t,i){b(t,e,i),v(e,n)},p(t,e){1&e&&i!==(i=t[2]+"")&&A(n,i)},d(t){t&&x(e)}}}function fct(t){let e,n,i,r,o,s,a=t[6]+"";function l(){return t[1](t[6])}return{c(){e=w("li"),n=w("button"),i=$(a),r=C(),M(n,"class","textButton"),M(e,"class","sectionLink svelte-1kdpgko")},m(t,a){b(t,e,a),v(e,n),v(n,i),v(e,r),o||(s=S(n,"click",l),o=!0)},p(e,n){t=e,1&n&&a!==(a=t[6]+"")&&A(i,a)},d(t){t&&x(e),o=!1,s()}}}function hct(t){let e,n,i,r,o=t[2]&&uct(t),s=t[3]||[],a=[];for(let e=0;e{"pageHierarchy"in t&&n(0,i=t.pageHierarchy)},[i,t=>function(t){const e=document.querySelector(`[data-section-id="${t}"]`);null==e||e.scrollIntoView({behavior:"smooth"})}(t)]}class gct extends mt{constructor(t){super(),gt(this,t,pct,dct,s,{pageHierarchy:0})}}const{Boolean:mct}=y;function yct(t,e,n){const i=t.slice();return i[5]=e[n],i}function vct(t){let e,n;return e=new gct({props:{pageHierarchy:kt(t[0]?.components)}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.pageHierarchy=kt(t[0]?.components)),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function bct(t){let e,n;return e=new kat({props:{componentData:t[5]}}),{c(){ft(e.$$.fragment)},m(t,i){ht(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.componentData=t[5]),e.$set(i)},i(t){n||(st(e.$$.fragment,t),n=!0)},o(t){at(e.$$.fragment,t),n=!1},d(t){dt(e,t)}}}function xct(t){let e,n,i=t[0]?.components||[],r=[];for(let e=0;eat(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{l=null})),ot())},i(t){a||(st(n.$$.fragment,t),st(r.$$.fragment,t),st(l),a=!0)},o(t){at(n.$$.fragment,t),at(r.$$.fragment,t),at(l),a=!1},d(t){t&&x(e),dt(n),dt(r),t&&x(o),l&&l.d(t),t&&x(s)}}}function kct(t,e,n){let i,r;c(t,xt,(t=>n(0,i=t))),c(t,wt,(t=>n(1,r=t)));let{cardDataId:o}=e;(t=>{try{const e=JSON.parse(atob(window.__MF_DATA__[t]));xt.set(e)}catch(t){fetch("/card-example.json").then((t=>t.json())).then((t=>{xt.set(t)})).catch(console.error)}})(o);const s=new URLSearchParams(null===window||void 0===window?void 0:window.location.search);let a=Boolean(s.get("embed"));return t.$$set=t=>{"cardDataId"in t&&n(3,o=t.cardDataId)},[i,r,a,o]}class $ct extends mt{constructor(t){super(),gt(this,t,kct,wct,s,{cardDataId:3})}}var Cct;let Ect;try{const t=window.mfCardDataId,e=window.mfContainerId,n=null===(Cct=document.querySelector(`[data-container="${e}"]`))||void 0===Cct?void 0:Cct.querySelector(".card_app");Ect=new $ct({target:null!=n?n:document.querySelector(".card_app"),props:{cardDataId:t}})}catch(t){throw new Error(t)}return Ect}(); + */function Qi(e,t){void 0===t&&(t=!1);var n=Xi.get(e.object);Ki(n.value,e.object,e.patches,"",t),e.patches.length&&Wi(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Ki(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=Mi(t),a=Mi(e),s=!1,l=a.length-1;l>=0;l--){var u=e[f=a[l]];if(!Si(t,f)||void 0===t[f]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+Ni(f),value:Fi(u)}),n.push({op:"remove",path:r+"/"+Ni(f)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var c=t[f];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?Ki(u,c,n,r+"/"+Ni(f),i):u!==c&&(i&&n.push({op:"test",path:r+"/"+Ni(f),value:Fi(u)}),n.push({op:"replace",path:r+"/"+Ni(f),value:Fi(c)}))}}if(s||o.length!=a.length)for(l=0;l0)return[g,n+u.join(",\n"+p),s].join("\n"+o)}return y}(e,"",0)};function ro(e,t,n){return e.fields=t||[],e.fname=n,e}function io(e){return null==e?null:e.fname}function oo(e){return null==e?null:e.fields}function ao(e){return 1===e.length?so(e[0]):lo(e)}const so=e=>function(t){return t[e]},lo=e=>{const t=e.length;return function(n){for(let r=0;rr&&u(),s=r=i+1):"]"===o&&(s||uo("Access path missing open bracket: "+e),s>0&&u(),s=0,r=i+1):i>r?u():r=i+1}return s&&uo("Access path missing closing bracket: "+e),a&&uo("Access path missing closing quote: "+e),i>r&&(i++,u()),t}function fo(e,t,n){const r=co(e);return e=1===r.length?r[0]:e,ro((n&&n.get||ao)(r),[e],t||e)}const ho=fo("id"),po=ro((e=>e),[],"identity"),mo=ro((()=>0),[],"zero"),go=ro((()=>1),[],"one"),yo=ro((()=>!0),[],"true"),vo=ro((()=>!1),[],"false");function bo(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const xo=0,wo=1,_o=2,$o=3,ko=4;function Co(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bo,r=e||xo;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=wo&&n(t||"error","ERROR",arguments),this},warn(){return r>=_o&&n(t||"warn","WARN",arguments),this},info(){return r>=$o&&n(t||"log","INFO",arguments),this},debug(){return r>=ko&&n(t||"log","DEBUG",arguments),this}}}var Eo=Array.isArray;function Ao(e){return e===Object(e)}const Do=e=>"__proto__"!==e;function So(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const n in t)if("signals"===n)e.signals=Fo(e.signals,t.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;Mo(e,n,t[n],r)}return e}),{})}function Mo(e,t,n,r){if(!Do(t))return;let i,o;if(Ao(n)&&!Eo(n))for(i in o=Ao(e[t])?e[t]:e[t]={},n)r&&(!0===r||r[i])?Mo(o,i,n[i]):Do(i)&&(o[i]=n[i]);else e[t]=n}function Fo(e,t){if(null==e)return t;const n={},r=[];function i(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(i),e.forEach(i),r}function Oo(e){return e[e.length-1]}function No(e){return null==e||""===e?null:+e}const To=e=>t=>e*Math.exp(t),zo=e=>t=>Math.log(e*t),Ro=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Lo=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Po=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function jo(e,t,n,r){const i=n(e[0]),o=n(Oo(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function Bo(e,t){return jo(e,t,No,po)}function Io(e,t){var n=Math.sign(e[0]);return jo(e,t,zo(n),To(n))}function Uo(e,t,n){return jo(e,t,Po(n),Po(1/n))}function qo(e,t,n){return jo(e,t,Ro(n),Lo(n))}function Wo(e,t,n,r,i){const o=r(e[0]),a=r(Oo(e)),s=null!=t?r(t):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ho(e,t,n){return Wo(e,t,n,No,po)}function Go(e,t,n){const r=Math.sign(e[0]);return Wo(e,t,n,zo(r),To(r))}function Vo(e,t,n,r){return Wo(e,t,n,Po(r),Po(1/r))}function Yo(e,t,n,r){return Wo(e,t,n,Ro(r),Lo(r))}function Xo(e){return 1+~~(new Date(e).getMonth()/3)}function Jo(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Zo(e){return null!=e?Eo(e)?e:[e]:[]}function Qo(e,t,n){let r,i=e[0],o=e[1];return o=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-r),i+r]}function Ko(e){return"function"==typeof e}const ea="descending";function ta(e,t,n){n=n||{},t=Zo(t)||[];const r=[],i=[],o={},a=n.comparator||ra;return Zo(e).forEach(((e,a)=>{null!=e&&(r.push(t[a]===ea?-1:1),i.push(e=Ko(e)?e:fo(e,null,n)),(oo(e)||[]).forEach((e=>o[e]=1)))})),0===i.length?null:ro(a(i,r),Object.keys(o))}const na=(e,t)=>(et||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),ra=(e,t)=>1===e.length?ia(e[0],t[0]):oa(e,t,e.length),ia=(e,t)=>function(n,r){return na(e(n),e(r))*t},oa=(e,t,n)=>(t.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++se}function sa(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(t(r),n=null)),e)}}function la(e){for(let t,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=t(e[a]);ao&&(o=r))}return[i,o]}function ca(e,t){const n=e.length;let r,i,o,a,s,l=-1;if(null==t){for(;++l=i){r=o=i;break}if(l===n)return[-1,-1];for(a=s=l;++li&&(r=i,a=l),o=i){r=o=i;break}if(l===n)return[-1,-1];for(a=s=l;++li&&(r=i,a=l),or(e)?n[e]:void 0,set(e,t){return r(e)||(++i.size,n[e]===ha&&--i.empty),n[e]=t,this},delete(e){return r(e)&&(--i.size,++i.empty,n[e]=ha),this},clear(){i.size=i.empty=0,i.object=n={}},test(e){return arguments.length?(t=e,i):t},clean(){const e={};let r=0;for(const i in n){const o=n[i];o===ha||t&&t(o)||(e[i]=o,++r)}i.size=r,i.empty=0,i.object=n=e}};return e&&Object.keys(e).forEach((t=>{i.set(t,e[t])})),i}function ma(e,t,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,l=e[0],u=Oo(e);ua&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=e:oe.replace(/\\(.)/g,"$1"))):Zo(e));const r=e&&e.length,i=n&&n.get||ao,o=e=>i(t?[e]:co(e));let a;if(r)if(1===r){const t=o(e[0]);a=function(e){return""+t(e)}}else{const t=e.map(o);a=function(e){let n=""+t[0](e),i=0;for(;++i{t={},n={},r=0},o=(i,o)=>(++r>e&&(n=t,t={},r=1),t[i]=o);return i(),{clear:i,has:e=>da(t,e)||da(n,e),get:e=>da(t,e)?t[e]:da(n,e)?o(e,n[e]):void 0,set:(e,n)=>da(t,e)?t[e]=n:o(e,n)}}function Aa(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,l=0,u=0;for(;s0?n[l++]:t[s++];for(;s=0;)n+=e;return n}function Sa(e,t,n,r){const i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?Da(i,a)+o:"center"===r?Da(i,~~(a/2))+o+Da(i,Math.ceil(a/2)):o+Da(i,a)}function Ma(e){return e&&Oo(e)-e[0]||0}function Fa(e){return Eo(e)?"["+e.map(Fa)+"]":Ao(e)||$a(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Oa(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Na=e=>wa(e)||ba(e)?e:Date.parse(e);function Ta(e,t){return t=t||Na,null==e||""===e?null:t(e)}function za(e){return null==e||""===e?null:e+""}function Ra(e){const t={},n=e.length;for(let r=0;r9999?"+"+Ga(t,6):Ga(t,4))+"-"+Ga(e.getUTCMonth()+1,2)+"-"+Ga(e.getUTCDate(),2)+(o?"T"+Ga(n,2)+":"+Ga(r,2)+":"+Ga(i,2)+"."+Ga(o,3)+"Z":i?"T"+Ga(n,2)+":"+Ga(r,2)+":"+Ga(i,2)+"Z":r||n?"T"+Ga(n,2)+":"+Ga(r,2)+"Z":"")}function Ya(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,i=[],o=e.length,a=0,s=0,l=o<=0,u=!1;function c(){if(l)return Ba;if(u)return u=!1,ja;var t,r,i=a;if(e.charCodeAt(i)===Ia){for(;a++=o?l=!0:(r=e.charCodeAt(a++))===Ua?u=!0:r===qa&&(u=!0,e.charCodeAt(a)===Ua&&++a),e.slice(i+1,t-1).replace(/""/g,'"')}for(;a1)r=function(e,t,n){var r,i=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}function c(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":u(e.arcs)}}return c(t),o.forEach(null==n?function(e){i.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,n);else for(i=0,r=new Array(o=e.arcs.length);it?1:e>=t?0:NaN}function rs(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function is(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<0?i=t+1:o=t}while(ins(e(t),n),r=(t,n)=>e(t)-n):(t=e===ns||e===rs?e:os,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i>>1;n(e[t],r)<=0?i=t+1:o=t}while(i0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}class ds extends Map{constructor(e,t=ys){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(ps(this,e))}has(e){return super.has(ps(this,e))}set(e,t){return super.set(ms(this,e),t)}delete(e){return super.delete(gs(this,e))}}class hs extends Set{constructor(e,t=ys){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const t of e)this.add(t)}has(e){return super.has(ps(this,e))}add(e){return super.add(ms(this,e))}delete(e){return super.delete(gs(this,e))}}function ps({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ms({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function gs({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ys(e){return null!==e&&"object"==typeof e?e.valueOf():e}function vs(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et?1:0)}const bs=Math.sqrt(50),xs=Math.sqrt(10),ws=Math.sqrt(2);function _s(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=bs?10:o>=xs?5:o>=ws?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if((e=+e)===(t=+t))return[e];const r=t=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n=i)&&(n=i)}return n}function As(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Ds(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=void 0===i?vs:function(e=ns){if(e===ns)return vs;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Ds(e,t,Math.max(n,Math.floor(t-a*l/o+u)),Math.min(r,Math.floor(t+(o-a)*l/o+u)),i)}const o=e[t];let a=n,s=r;for(Ss(e,n,t),i(e[r],o)>0&&Ss(e,n,r);a0;)--s}0===i(e[n],o)?Ss(e,n,s):(++s,Ss(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Ss(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ms(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return As(e);if(t>=1)return Es(e);var r,i=(r-1)*t,o=Math.floor(i),a=Es(Ds(e,o).subarray(0,o+1));return a+(As(e.subarray(o+1))-a)*(i-o)}}function Fs(e,t,n=as){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}}function Os(e,t){return Ms(e,.5,t)}function Ns(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function Ts(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ps(e){return(e=Ls(Math.abs(e)))?e[1]:NaN}var js,Bs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Is(e){if(!(t=Bs.exec(e)))throw new Error("invalid format: "+e);var t;return new Us({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Us(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function qs(e,t){var n=Ls(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Is.prototype=Us.prototype,Us.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ws={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qs(100*e,t),r:qs,s:function(e,t){var n=Ls(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(js=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ls(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Hs(e){return e}var Gs,Vs,Ys,Xs=Array.prototype.map,Js=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Zs(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?Hs:(t=Xs.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Hs:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Xs.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=Is(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):Ws[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=Ws[v],_=/[defgprs%]/.test(v);function $(e){var i,o,l,d=b,$=x;if("c"===v)$=w(e)+$,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0==+e&&"+"!==f&&(k=!1),d=(k?"("===f?f:u:"-"===f||"("===f?"":f)+d,$=("s"===v?Js[8+js/3]:"")+$+(k&&"("===f?")":""),_)for(i=-1,o=e.length;++i(l=e.charCodeAt(i))||l>57){$=(46===l?a+e.slice(i+1):e.slice(i))+$,e=e.slice(0,i);break}}m&&!h&&(e=r(e,1/0));var C=d.length+e.length+$.length,E=C>1)+d+e+$+E.slice(C);break;default:e=E+d+e+$}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),$.toString=function(){return e+""},$}return{format:f,formatPrefix:function(e,t){var n=f(((e=Is(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Ps(t)/3))),i=Math.pow(10,-r),o=Js[8+r/3];return function(e){return n(i*e)+o}}}}function Qs(e){return Math.max(0,-Ps(Math.abs(e)))}function Ks(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ps(t)/3)))-Ps(Math.abs(e)))}function el(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ps(t)-Ps(e))+1}!function(e){Gs=Zs(e),Vs=Gs.format,Ys=Gs.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const tl=new Date,nl=new Date;function rl(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(srl((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(i.count=(t,r)=>(tl.setTime(+t),nl.setTime(+r),e(tl),e(nl),Math.floor(n(tl,nl))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const il=rl((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));il.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?rl((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):il:null),il.range;const ol=1e3,al=6e4,sl=36e5,ll=864e5,ul=6048e5,cl=2592e6,fl=31536e6,dl=rl((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*ol)}),((e,t)=>(t-e)/ol),(e=>e.getUTCSeconds()));dl.range;const hl=rl((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol)}),((e,t)=>{e.setTime(+e+t*al)}),((e,t)=>(t-e)/al),(e=>e.getMinutes()));hl.range;const pl=rl((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*al)}),((e,t)=>(t-e)/al),(e=>e.getUTCMinutes()));pl.range;const ml=rl((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol-e.getMinutes()*al)}),((e,t)=>{e.setTime(+e+t*sl)}),((e,t)=>(t-e)/sl),(e=>e.getHours()));ml.range;const gl=rl((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*sl)}),((e,t)=>(t-e)/sl),(e=>e.getUTCHours()));gl.range;const yl=rl((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*al)/ll),(e=>e.getDate()-1));yl.range;const vl=rl((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/ll),(e=>e.getUTCDate()-1));vl.range;const bl=rl((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/ll),(e=>Math.floor(e/ll)));function xl(e){return rl((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*al)/ul))}bl.range;const wl=xl(0),_l=xl(1),$l=xl(2),kl=xl(3),Cl=xl(4),El=xl(5),Al=xl(6);function Dl(e){return rl((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/ul))}wl.range,_l.range,$l.range,kl.range,Cl.range,El.range,Al.range;const Sl=Dl(0),Ml=Dl(1),Fl=Dl(2),Ol=Dl(3),Nl=Dl(4),Tl=Dl(5),zl=Dl(6);Sl.range,Ml.range,Fl.range,Ol.range,Nl.range,Tl.range,zl.range;const Rl=rl((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()));Rl.range;const Ll=rl((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()));Ll.range;const Pl=rl((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Pl.every=e=>isFinite(e=Math.floor(e))&&e>0?rl((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Pl.range;const jl=rl((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function Bl(e,t,n,r,i,o){const a=[[dl,1,ol],[dl,5,5e3],[dl,15,15e3],[dl,30,3e4],[o,1,al],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,sl],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,ll],[r,2,1728e5],[n,1,ul],[t,1,cl],[t,3,7776e6],[e,1,fl]];function s(t,n,r){const i=Math.abs(n-t)/r,o=is((([,,e])=>e)).right(a,i);if(o===a.length)return e.every(Cs(t/fl,n/fl,r));if(0===o)return il.every(Math.max(Cs(t,n,r),1));const[s,l]=a[i/a[o-1][2]isFinite(e=Math.floor(e))&&e>0?rl((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,jl.range;const[Il,Ul]=Bl(jl,Ll,Sl,bl,gl,pl),[ql,Wl]=Bl(Pl,Rl,wl,yl,ml,hl),Hl="year",Gl="quarter",Vl="month",Yl="week",Xl="date",Jl="day",Zl="dayofyear",Ql="hours",Kl="minutes",eu="seconds",tu="milliseconds",nu=[Hl,Gl,Vl,Yl,Xl,Jl,Zl,Ql,Kl,eu,tu],ru=nu.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function iu(e){const t=Zo(e).slice(),n={};t.length||uo("Missing time unit."),t.forEach((e=>{da(ru,e)?n[e]=1:uo(`Invalid time unit: ${e}.`)}));return(n[Yl]||n[Jl]?1:0)+(n[Gl]||n[Vl]||n[Xl]?1:0)+(n[Zl]?1:0)>1&&uo(`Incompatible time units: ${e}`),t.sort(((e,t)=>ru[e]-ru[t])),t}const ou={[Hl]:"%Y ",[Gl]:"Q%q ",[Vl]:"%b ",[Xl]:"%d ",[Yl]:"W%U ",[Jl]:"%a ",[Zl]:"%j ",[Ql]:"%H:00",[Kl]:"00:%M",[eu]:":%S",[tu]:".%L",[`${Hl}-${Vl}`]:"%Y-%m ",[`${Hl}-${Vl}-${Xl}`]:"%Y-%m-%d ",[`${Ql}-${Kl}`]:"%H:%M"};function au(e,t){const n=la({},ou,t),r=iu(e),i=r.length;let o,a,s="",l=0;for(l=0;ll;--o)if(a=r.slice(l,o).join("-"),null!=n[a]){s+=n[a],l=o;break}return s.trim()}const su=new Date;function lu(e){return su.setFullYear(e),su.setMonth(0),su.setDate(1),su.setHours(0,0,0,0),su}function uu(e){return fu(new Date(e))}function cu(e){return du(new Date(e))}function fu(e){return yl.count(lu(e.getFullYear())-1,e)}function du(e){return wl.count(lu(e.getFullYear())-1,e)}function hu(e){return lu(e).getDay()}function pu(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function mu(e){return yu(new Date(e))}function gu(e){return vu(new Date(e))}function yu(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return vl.count(t-1,e)}function vu(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Sl.count(t-1,e)}function bu(e){return su.setTime(Date.UTC(e,0,1)),su.getUTCDay()}function xu(e,t,n,r,i,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,r,i,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,r,i,o,a))}function wu(e,t,n,r,i){const o=t||1,a=Oo(e),s=(e,t,i)=>function(e,t,n,r){const i=n<=1?e:r?(t,i)=>r+n*Math.floor((e(t,i)-r)/n):(t,r)=>n*Math.floor(e(t,r)/n);return t?(e,n)=>t(i(e,n),n):i}(n[i=i||e],r[i],e===a&&o,t),l=new Date,u=Ra(e),c=u[Hl]?s(Hl):aa(2012),f=u[Vl]?s(Vl):u[Gl]?s(Gl):mo,d=u[Yl]&&u[Jl]?s(Jl,1,Yl+Jl):u[Yl]?s(Yl,1):u[Jl]?s(Jl,1):u[Xl]?s(Xl,1):u[Zl]?s(Zl,1):go,h=u[Ql]?s(Ql):mo,p=u[Kl]?s(Kl):mo,m=u[eu]?s(eu):mo,g=u[tu]?s(tu):mo;return function(e){l.setTime(+e);const t=c(l);return i(t,f(l),d(l,t),h(l),p(l),m(l),g(l))}}function _u(e,t,n){return t+7*e-(n+6)%7}const $u={[Hl]:e=>e.getFullYear(),[Gl]:e=>Math.floor(e.getMonth()/3),[Vl]:e=>e.getMonth(),[Xl]:e=>e.getDate(),[Ql]:e=>e.getHours(),[Kl]:e=>e.getMinutes(),[eu]:e=>e.getSeconds(),[tu]:e=>e.getMilliseconds(),[Zl]:e=>fu(e),[Yl]:e=>du(e),[Yl+Jl]:(e,t)=>_u(du(e),e.getDay(),hu(t)),[Jl]:(e,t)=>_u(1,e.getDay(),hu(t))},ku={[Gl]:e=>3*e,[Yl]:(e,t)=>_u(e,0,hu(t))};function Cu(e,t){return wu(e,t||1,$u,ku,pu)}const Eu={[Hl]:e=>e.getUTCFullYear(),[Gl]:e=>Math.floor(e.getUTCMonth()/3),[Vl]:e=>e.getUTCMonth(),[Xl]:e=>e.getUTCDate(),[Ql]:e=>e.getUTCHours(),[Kl]:e=>e.getUTCMinutes(),[eu]:e=>e.getUTCSeconds(),[tu]:e=>e.getUTCMilliseconds(),[Zl]:e=>yu(e),[Yl]:e=>vu(e),[Jl]:(e,t)=>_u(1,e.getUTCDay(),bu(t)),[Yl+Jl]:(e,t)=>_u(vu(e),e.getUTCDay(),bu(t))},Au={[Gl]:e=>3*e,[Yl]:(e,t)=>_u(e,0,bu(t))};function Du(e,t){return wu(e,t||1,Eu,Au,xu)}const Su={[Hl]:Pl,[Gl]:Rl.every(3),[Vl]:Rl,[Yl]:wl,[Xl]:yl,[Jl]:yl,[Zl]:yl,[Ql]:ml,[Kl]:hl,[eu]:dl,[tu]:il},Mu={[Hl]:jl,[Gl]:Ll.every(3),[Vl]:Ll,[Yl]:Sl,[Xl]:vl,[Jl]:vl,[Zl]:vl,[Ql]:gl,[Kl]:pl,[eu]:dl,[tu]:il};function Fu(e){return Su[e]}function Ou(e){return Mu[e]}function Nu(e,t,n){return e?e.offset(t,n):void 0}function Tu(e,t,n){return Nu(Fu(e),t,n)}function zu(e,t,n){return Nu(Ou(e),t,n)}function Ru(e,t,n,r){return e?e.range(t,n,r):void 0}function Lu(e,t,n,r){return Ru(Fu(e),t,n,r)}function Pu(e,t,n,r){return Ru(Ou(e),t,n,r)}const ju=1e3,Bu=6e4,Iu=36e5,Uu=864e5,qu=2592e6,Wu=31536e6,Hu=[Hl,Vl,Xl,Ql,Kl,eu,tu],Gu=Hu.slice(0,-1),Vu=Gu.slice(0,-1),Yu=Vu.slice(0,-1),Xu=Yu.slice(0,-1),Ju=[Hl,Vl],Zu=[Hl],Qu=[[Gu,1,ju],[Gu,5,5e3],[Gu,15,15e3],[Gu,30,3e4],[Vu,1,Bu],[Vu,5,3e5],[Vu,15,9e5],[Vu,30,18e5],[Yu,1,Iu],[Yu,3,108e5],[Yu,6,216e5],[Yu,12,432e5],[Xu,1,Uu],[[Hl,Yl],1,6048e5],[Ju,1,qu],[Ju,3,7776e6],[Zu,1,Wu]];function Ku(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(Ma(t))/n;let i,o,a=is((e=>e[2])).right(Qu,r);return a===Qu.length?(i=Zu,o=Cs(t[0]/Wu,t[1]/Wu,n)):a?(a=Qu[r/Qu[a-1][2]=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Cf,s:Ef,S:Hc,u:Gc,U:Vc,V:Xc,w:Jc,W:Zc,x:null,X:null,y:Qc,Y:ef,Z:nf,"%":kf},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:rf,e:rf,f:uf,g:xf,G:_f,H:of,I:af,j:sf,L:lf,m:cf,M:ff,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Cf,s:Ef,S:df,u:hf,U:pf,V:gf,w:yf,W:vf,x:null,X:null,y:bf,Y:wf,Z:$f,"%":kf},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:Ac,e:Ac,f:Nc,g:$c,G:_c,H:Sc,I:Sc,j:Dc,L:Oc,m:Ec,M:Mc,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:Cc,Q:zc,s:Rc,S:Fc,u:vc,U:bc,V:xc,w:yc,W:wc,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:$c,Y:_c,Z:kc,"%":Tc};function _(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=tc(nc(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ml.ceil(r):Ml(r),r=vl.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=ec(nc(o.y,0,1))).getDay(),r=i>4||0===i?_l.ceil(r):_l(r),r=yl.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?tc(nc(o.y,0,1)).getUTCDay():ec(nc(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,tc(o)):ec(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in uc?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=_(n,b),b.X=_(r,b),b.c=_(t,b),x.x=_(n,x),x.X=_(r,x),x.c=_(t,x),{format:function(e){var t=_(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=$(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=$(e+="",!0);return t.toString=function(){return e},t}}}var ic,oc,ac,sc,lc,uc={"-":"",_:" ",0:"0"},cc=/^\s*\d+/,fc=/^%/,dc=/[\\^$*+?|[\]().{}]/g;function hc(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[e.toLowerCase(),t])))}function yc(e,t,n){var r=cc.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vc(e,t,n){var r=cc.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function bc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function xc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function wc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _c(e,t,n){var r=cc.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function $c(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kc(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Cc(e,t,n){var r=cc.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Ec(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Ac(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Dc(e,t,n){var r=cc.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Sc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Mc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Fc(e,t,n){var r=cc.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Oc(e,t,n){var r=cc.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Nc(e,t,n){var r=cc.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Tc(e,t,n){var r=fc.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zc(e,t,n){var r=cc.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Rc(e,t,n){var r=cc.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Lc(e,t){return hc(e.getDate(),t,2)}function Pc(e,t){return hc(e.getHours(),t,2)}function jc(e,t){return hc(e.getHours()%12||12,t,2)}function Bc(e,t){return hc(1+yl.count(Pl(e),e),t,3)}function Ic(e,t){return hc(e.getMilliseconds(),t,3)}function Uc(e,t){return Ic(e,t)+"000"}function qc(e,t){return hc(e.getMonth()+1,t,2)}function Wc(e,t){return hc(e.getMinutes(),t,2)}function Hc(e,t){return hc(e.getSeconds(),t,2)}function Gc(e){var t=e.getDay();return 0===t?7:t}function Vc(e,t){return hc(wl.count(Pl(e)-1,e),t,2)}function Yc(e){var t=e.getDay();return t>=4||0===t?Cl(e):Cl.ceil(e)}function Xc(e,t){return e=Yc(e),hc(Cl.count(Pl(e),e)+(4===Pl(e).getDay()),t,2)}function Jc(e){return e.getDay()}function Zc(e,t){return hc(_l.count(Pl(e)-1,e),t,2)}function Qc(e,t){return hc(e.getFullYear()%100,t,2)}function Kc(e,t){return hc((e=Yc(e)).getFullYear()%100,t,2)}function ef(e,t){return hc(e.getFullYear()%1e4,t,4)}function tf(e,t){var n=e.getDay();return hc((e=n>=4||0===n?Cl(e):Cl.ceil(e)).getFullYear()%1e4,t,4)}function nf(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+hc(t/60|0,"0",2)+hc(t%60,"0",2)}function rf(e,t){return hc(e.getUTCDate(),t,2)}function of(e,t){return hc(e.getUTCHours(),t,2)}function af(e,t){return hc(e.getUTCHours()%12||12,t,2)}function sf(e,t){return hc(1+vl.count(jl(e),e),t,3)}function lf(e,t){return hc(e.getUTCMilliseconds(),t,3)}function uf(e,t){return lf(e,t)+"000"}function cf(e,t){return hc(e.getUTCMonth()+1,t,2)}function ff(e,t){return hc(e.getUTCMinutes(),t,2)}function df(e,t){return hc(e.getUTCSeconds(),t,2)}function hf(e){var t=e.getUTCDay();return 0===t?7:t}function pf(e,t){return hc(Sl.count(jl(e)-1,e),t,2)}function mf(e){var t=e.getUTCDay();return t>=4||0===t?Nl(e):Nl.ceil(e)}function gf(e,t){return e=mf(e),hc(Nl.count(jl(e),e)+(4===jl(e).getUTCDay()),t,2)}function yf(e){return e.getUTCDay()}function vf(e,t){return hc(Ml.count(jl(e)-1,e),t,2)}function bf(e,t){return hc(e.getUTCFullYear()%100,t,2)}function xf(e,t){return hc((e=mf(e)).getUTCFullYear()%100,t,2)}function wf(e,t){return hc(e.getUTCFullYear()%1e4,t,4)}function _f(e,t){var n=e.getUTCDay();return hc((e=n>=4||0===n?Nl(e):Nl.ceil(e)).getUTCFullYear()%1e4,t,4)}function $f(){return"+0000"}function kf(){return"%"}function Cf(e){return+e}function Ef(e){return Math.floor(+e/1e3)}function Af(e){const t={};return n=>t[n]||(t[n]=e(n))}function Df(e){const t=Af(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=Is(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=function(e,t){let n,r=e.lastIndexOf("e");if(r>0)return r;for(r=e.length;--r>t;)if(n=e.charCodeAt(r),n>=48&&n<=57)return r+1}(r,i);const a=oi;)if("0"!==r[o]){++o;break}return r.slice(0,o)+a}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,r,i,o){o=Is(null==o?",f":o);const a=Cs(e,r,i),s=Math.max(Math.abs(e),Math.abs(r));let l;if(null==o.precision)switch(o.type){case"s":return isNaN(l=Ks(a,s))||(o.precision=l),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(l=el(a,s))||(o.precision=l-("e"===o.type));break;case"f":case"%":isNaN(l=Qs(a))||(o.precision=l-2*("%"===o.type))}return t(o)}}}let Sf,Mf;function Ff(){return Sf=Df({format:Vs,formatPrefix:Ys})}function Of(e){return Df(Zs(e))}function Nf(e){return arguments.length?Sf=Of(e):Sf}function Tf(e,t,n){Ao(n=n||{})||uo(`Invalid time multi-format specifier: ${n}`);const r=t(eu),i=t(Kl),o=t(Ql),a=t(Xl),s=t(Yl),l=t(Vl),u=t(Gl),c=t(Hl),f=e(n[tu]||".%L"),d=e(n[eu]||":%S"),h=e(n[Kl]||"%I:%M"),p=e(n[Ql]||"%I %p"),m=e(n[Xl]||n[Jl]||"%a %d"),g=e(n[Yl]||"%b %d"),y=e(n[Vl]||"%B"),v=e(n[Gl]||"%B"),b=e(n[Hl]||"%Y");return e=>(r(e)$a(e)?t(e):Tf(t,Fu,e),utcFormat:e=>$a(e)?n(e):Tf(n,Ou,e),timeParse:Af(e.parse),utcParse:Af(e.utcParse)}}function Rf(){return Mf=zf({format:oc,parse:ac,utcFormat:sc,utcParse:lc})}function Lf(e){return zf(rc(e))}function Pf(e){return arguments.length?Mf=Lf(e):Mf}!function(e){ic=rc(e),oc=ic.format,ac=ic.parse,sc=ic.utcFormat,lc=ic.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Ff(),Rf();const jf=(e,t)=>la({},e,t);function Bf(e,t){const n=e?Of(e):Nf(),r=t?Lf(t):Pf();return jf(n,r)}function If(e,t){const n=arguments.length;return n&&2!==n&&uo("defaultLocale expects either zero or two arguments."),n?jf(Nf(e),Pf(t)):jf(Nf(),Pf())}const Uf=/^(data:|([A-Za-z]+:)?\/\/)/,qf=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Wf=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Hf="file://";async function Gf(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function Vf(e,t){t=la({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;const s=qf.test(e.replace(Wf,""));null!=e&&"string"==typeof e&&s||uo("Sanitize failure, invalid URI: "+Fa(e));const l=Uf.test(e);return(a=t.baseURL)&&!l&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(i=e.startsWith(Hf))||"file"===t.mode||"http"!==t.mode&&!l&&n,i?e=e.slice(Hf.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function Yf(e){return e?t=>new Promise(((n,r)=>{e.readFile(t,((e,t)=>{e?r(e):n(t)}))})):Xf}async function Xf(){uo("No file system access.")}function Jf(e){return e?async function(t,n){const r=la({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?Ko(o[i])?o[i]():o.text():uo(o.status+""+o.statusText)}:Zf}async function Zf(){uo("No HTTP fetch method available.")}const Qf=e=>null!=e&&e==e,Kf=e=>!(Number.isNaN(+e)||e instanceof Date),ed={boolean:Oa,integer:No,number:No,date:Ta,string:za,unknown:po},td=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Kf(e)&&Number.isInteger(+e),Kf,e=>!Number.isNaN(Date.parse(e))],nd=["boolean","integer","number","date"];function rd(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=td.length,i=td.map(((e,t)=>t+1));for(let o,a,s=0,l=0;s0===e?t:e),0)-1]}function id(e,t){return t.reduce(((t,n)=>(t[n]=rd(e,n),t)),{})}function od(e){const t=function(t,n){const r={delimiter:e};return ad(t,n?la(n,r):r)};return t.responseType="text",t}function ad(e,t){return t.header&&(e=t.header.map(Fa).join(t.delimiter)+"\n"+e),Ya(t.delimiter).parse(e+"")}function sd(e,t){const n=t&&t.property?fo(t.property):po;return!Ao(e)||(r=e,"function"==typeof Buffer&&Ko(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(e)):function(e,t){!Eo(e)&&xa(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var r}ad.responseType="text",sd.responseType="json";const ld={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function ud(e,t){let n,r,i,o;return e=sd(e,t),t&&t.feature?(n=Ja,i=t.feature):t&&t.mesh?(n=es,i=t.mesh,o=ld[t.filter]):uo("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):uo("Invalid TopoJSON object: "+i),r&&r.features||[r]}ud.responseType="json";const cd={dsv:ad,csv:od(","),tsv:od("\t"),json:sd,topojson:ud};function fd(e,t){return arguments.length>1?(cd[e]=t,this):da(cd,e)?cd[e]:null}function dd(e){const t=fd(e);return t&&t.responseType||"text"}function hd(e,t,n,r){const i=fd((t=t||{}).type||"json");return i||uo("Unknown data format type: "+t.type),e=i(e,t),t.parse&&function(e,t,n,r){if(!e.length)return;const i=Pf();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,l,u,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=id(e,f));f=Object.keys(t);const d=f.map((e=>{const i=t[e];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?r:n)(a)}if(!ed[i])throw Error("Illegal format pattern: "+e+":"+i);return ed[i]}));for(s=0,u=e.length,c=f.length;s({options:n||{},sanitize:Vf,load:Gf,fileAccess:!!t,file:Yf(t),http:Jf(e)})}("undefined"!=typeof fetch&&fetch,null);function md(e){const t=e||po,n=[],r={};return n.add=e=>{const i=t(e);return r[i]||(r[i]=1,n.push(e)),n},n.remove=e=>{const i=t(e);if(r[i]){r[i]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function gd(e,t){try{await t(e)}catch(t){e.error(t)}}const yd=Symbol("vega_id");let vd=1;function bd(e){return!(!e||!xd(e))}function xd(e){return e[yd]}function wd(e,t){return e[yd]=t,e}function _d(e){const t=e===Object(e)?e:{data:e};return xd(t)?t:wd(t,vd++)}function $d(e){return kd(e,_d({}))}function kd(e,t){for(const n in e)t[n]=e[n];return t}function Cd(e,t){return wd(t,xd(e))}function Ed(e,t){return e?t?(n,r)=>e(n,r)||xd(t(n))-xd(t(r)):(t,n)=>e(t,n)||xd(t)-xd(n):null}function Ad(e){return e&&e.constructor===Dd}function Dd(){const e=[],t=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Dd,insert(t){const n=Zo(t),r=n.length;for(let t=0;t{p(e)&&(u[xd(e)]=-1)}));for(f=0,d=e.length;f0&&(y(m,p,h.value),s.modifies(p));for(f=0,d=i.length;f{p(e)&&u[xd(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||r.length?l.filter((e=>u[xd(e)]>0)):l.slice();else for(g in c)s.mod.push(c[g]);return(o||null==o&&(t.length||r.length))&&s.clean(!0),s}}}const Sd="_:mod:_";function Md(){Object.defineProperty(this,Sd,{writable:!0,value:{}})}Md.prototype={set(e,t,n,r){const i=this,o=i[e],a=i[Sd];return null!=t&&t>=0?(o[t]!==n||r)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||r)&&(i[e]=n,a[e]=Eo(n)?1+n.length:-1),i},modified(e,t){const n=this[Sd];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(Eo(e)){for(let t=0;t=0?t+1{a instanceof Nd?(a!==this&&(t&&a.targets().add(this),o.push(a)),i.push({op:a,name:e,index:n})):r.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)Zo(s).forEach((e=>{e instanceof Nd?e!==this&&(e.targets().add(this),o.push(e)):uo("Pulse parameters must be operator instances.")})),this.source=s;else if(Eo(s))for(r.set(a,-1,Array(l=s.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=Ld();return this.targets().add(Ld(null,null,sa(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(Ld(null,null,(()=>n=!0))),t.targets().add(Ld(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=yo,this._targets=null}};const Pd={skip:!0};function jd(e,t,n,r,i,o){const a=la({},o,Pd);let s,l;Ko(n)||(n=aa(n)),void 0===r?s=t=>e.touch(n(t)):Ko(r)?(l=new Nd(null,r,i,!1),s=t=>{l.evaluate(t);const r=n(t),i=l.value;Ad(i)?e.pulse(r,i,o):e.update(r,i,a)}):s=t=>e.update(n(t),r,a),t.apply(s)}function Bd(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new Nd(null,function(e,t){return t=Ko(t)?t:aa(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const Id={};function Ud(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function qd(e,t){const n=[];return Pa(e,t,(e=>n.push(e))),n}function Wd(e,t){const n={};return e.visit(t,(e=>{n[xd(e)]=1})),e=>n[xd(e)]?null:e}function Hd(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}function Gd(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=i.fields||(i.fields={});for(const n in e.fields)t[n]=1}e.changed(i.ADD)&&(o|=i.ADD),e.changed(i.REM)&&(o|=i.REM),e.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function Vd(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}Ud.prototype={StopPropagation:Id,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new Ud(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ud(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,Wd(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return Eo(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?Eo(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Hd(n.addF,t)),2&e&&(n.remF=Hd(n.remF,t)),4&e&&(n.modF=Hd(n.modF,t)),16&e&&(n.srcF=Hd(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=qd(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=qd(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=qd(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(16&e)return Pa(n.source,n.srcF,r),n;1&e&&Pa(n.add,n.addF,r),2&e&&Pa(n.rem,n.remF,r),4&e&&Pa(n.mod,n.modF,r);const i=n.source;if(8&e&&i){const e=n.add.length+n.mod.length;e===i.length||Pa(i,e?Wd(n,5):n.srcF,r)}return n}},ga(Gd,Ud,{fork(e){const t=new Ud(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?Eo(e)?e.some((e=>n[e])):n[e]:0},filter(){uo("MultiPulse does not support filtering.")},materialize(){uo("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;ot=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Jd(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,function(e,t,n){const r=t,i=e.length,o=e[t];let a,s=1+(t<<1);for(;s=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,Jd(e,r,t,n)}(t,0,e)):r=n,r}}}function Jd(e,t,n,r){let i,o;const a=e[n];for(;n>t&&(o=n-1>>1,i=e[o],r(a,i)<0);)e[n]=i,n=o;return e[n]=a}function Zd(){this.logger(Co()),this.logLevel(wo),this._clock=0,this._rank=0,this._locale=If();try{this._loader=pd()}catch(e){}this._touched=md(ho),this._input={},this._pulse=null,this._heap=Xd(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function Qd(e){return function(){return this._log[e].apply(this,arguments)}}function Kd(e,t){Nd.call(this,e,null,t)}Zd.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Qd("error"),warn:Qd("warn"),info:Qd("info"),debug:Qd("debug"),logLevel:Qd("level"),cleanThreshold:1e4,add:function(e,t,n,r){let i,o=1;return e instanceof Nd?i=e:e&&e.prototype instanceof Nd?i=new e:Ko(e)?i=new Nd(null,e):(o=0,i=new Nd(e,t)),this.rank(i),o&&(r=n,n=t),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(e,t){const n=e.rank,r=t.length;for(let i=0;i=0;)t.push(n=r[i]),n===e&&uo("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Yd);const r=new Ud(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this},touch:function(e,t){const n=t||Yd;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const r=n||Yd;return(e.set(t)||r.force)&&this.touch(e,r),this},changeset:Dd,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return hd(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const r=this,i=r._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(yo).insert(o.data||[])),i.done(),o},request:async function(e,t){const n=this;let r,i=0;try{r=await n.loader().load(e,{context:"dataflow",response:dd(t&&t.type)});try{r=n.parse(r,t)}catch(t){i=-2,n.warn("Data ingestion failed",e,t)}}catch(t){i=-1,n.warn("Loading failed",e,t)}return{data:r,status:i}},events:function(e,t,n,r){const i=this,o=Ld(n,r),a=function(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Zo(e);const l=s.length;for(let e=0;er._enqueue(e,!0))),r._touched=md(ho);let a,s,l,u=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,e)),s.then?s=await s:s.async&&(i.push(s.async),s=Id),s!==Id&&a._targets&&a._targets.forEach((e=>r._enqueue(e))),++u):r._enqueue(a,!0)}catch(e){r._heap.clear(),l=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${u} operators`),l&&(r._postrun=[],r.error(l)),r._postrun.length){const e=r._postrun.sort(((e,t)=>t.priority-e.priority));r._postrun=[];for(let t=0;tr.runAsync(null,(()=>{e.forEach((e=>{try{e(r)}catch(e){r.error(e)}}))})))),r},run:function(e,t,n){return this._pulse?Vd(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stampe.pulse)),t):this._input[e.id]||function(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Id&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},ga(Kd,Nd,{run(e){if(e.stampthis.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const eh={};function th(e){const t=nh(e);return t&&t.Definition||null}function nh(e){return e=e&&e.toLowerCase(),da(eh,e)?eh[e]:null}function*rh(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)r=t(r,++n,e),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function ih(e,t,n){const r=Float64Array.from(rh(e,n));return r.sort(ns),t.map((e=>Fs(r,e)))}function oh(e,t){return ih(e,[.25,.5,.75],t)}function ah(e,t){const n=e.length,r=function(e,t){const n=function(e,t){let n,r=0,i=0,o=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-i,i+=n/++r,o+=n*(t-i));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(e,t);return n?Math.sqrt(n):n}(e,t),i=oh(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function sh(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o,a,s,l,u,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(l=h/t,u=0,c=e.steps.length;ut;)o*=n;for(u=0,c=i.length;u=s&&h/l<=t&&(o=l)}l=Math.log(o);const p=l>=0?0:1+~~(-l/r),m=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(f/o+m)*o,f=fe);const i=e.length,o=new Float64Array(i);let a,s=0,l=1,u=r(e[0]),c=u,f=u+t;for(;l=f){for(c=(u+c)/2;s>1);ia;)e[i--]=e[o]}o=a,a=r}return e}(o,t+t/4):o}const fh=Math.sqrt(2*Math.PI),dh=Math.SQRT2;let hh=NaN;function ph(e,t){e=e||0,t=null==t?1:t;let n,r,i=0,o=0;if(hh==hh)i=hh,hh=NaN;else{do{i=2*lh()-1,o=2*lh()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,hh=o*r}return e+i*t}function mh(e,t,n){const r=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*fh)}function gh(e,t,n){const r=(e-(t=t||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const e=Math.exp(-i*i/2);let t;i<7.07106781186547?(t=.0352624965998911*i+.700383064443688,t=t*i+6.37396220353165,t=t*i+33.912866078383,t=t*i+112.079291497871,t=t*i+221.213596169931,t=t*i+220.206867912376,o=e*t,t=.0883883476483184*i+1.75566716318264,t=t*i+16.064177579207,t=t*i+86.7807322029461,t=t*i+296.564248779674,t=t*i+637.333633378831,t=t*i+793.826512519948,t=t*i+440.413735824752,o/=t):(t=i+.65,t=i+4/t,t=i+3/t,t=i+2/t,t=i+1/t,o=e/t/2.506628274631)}return r>0?1-o:o}function yh(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*dh*function(e){let t,n=-Math.log((1-e)*(1+e));n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0;return t*e}(2*e-1)}function vh(e,t){let n,r;const i={mean(e){return arguments.length?(n=e||0,i):n},stdev(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>ph(n,r),pdf:e=>mh(e,n,r),cdf:e=>gh(e,n,r),icdf:e=>yh(e,n,r)};return i.mean(e).stdev(t)}function bh(e,t){const n=vh();let r=0;const i={data(n){return arguments.length?(e=n,r=n?n.length:0,i.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=ah(e)),i):t},sample:()=>e[~~(lh()*r)]+t*n.sample(),pdf(i){let o=0,a=0;for(;axh(n,r),pdf:e=>wh(e,n,r),cdf:e=>_h(e,n,r),icdf:e=>$h(e,n,r)};return i.mean(e).stdev(t)}function Ch(e,t){let n,r=0;const i={weights(e){return arguments.length?(n=function(e){const t=[];let n,i=0;for(n=0;n=t&&e<=n?1/(n-t):0}function Dh(e,t,n){return null==n&&(n=null==t?1:t,t=0),en?1:(e-t)/(n-t)}function Sh(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Mh(e,t){let n,r;const i={min(e){return arguments.length?(n=e||0,i):n},max(e){return arguments.length?(r=null==e?1:e,i):r},sample:()=>Eh(n,r),pdf:e=>Ah(e,n,r),cdf:e=>Dh(e,n,r),icdf:e=>Sh(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function Fh(e,t,n){let r=0,i=0;for(const o of e){const e=n(o);null==t(o)||null==e||isNaN(e)||(r+=(e-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function Oh(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function Nh(e,t,n,r){e=e.filter((e=>{let r=t(e),i=n(e);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&e.sort(((e,n)=>t(e)-t(n)));const i=e.length,o=new Float64Array(i),a=new Float64Array(i);let s,l,u,c=0,f=0,d=0;for(u of e)o[c]=s=+t(u),a[c]=l=+n(u),++c,f+=(s-f)/c,d+=(l-d)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function zh(e,t,n,r,i){let o=0,a=0;return Th(e,t,n,((e,t)=>{const n=t-i(e),s=t-r;o+=n*n,a+=s*s})),1-o/a}function Rh(e,t,n){let r=0,i=0,o=0,a=0,s=0;Th(e,t,n,((e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Oh(r,i,o,a),u=e=>l[0]+l[1]*e;return{coef:l,predict:u,rSquared:zh(e,t,n,i,u)}}function Lh(e,t,n){let r=0,i=0,o=0,a=0,s=0;Th(e,t,n,((e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Oh(r,i,o,a),u=e=>l[0]+l[1]*Math.log(e);return{coef:l,predict:u,rSquared:zh(e,t,n,i,u)}}function Ph(e,t,n){const[r,i,o,a]=Nh(e,t,n);let s,l,u,c=0,f=0,d=0,h=0,p=0;Th(e,t,n,((e,t)=>{s=r[p++],l=Math.log(t),u=s*t,c+=(t*l-c)/p,f+=(u-f)/p,d+=(u*l-d)/p,h+=(s*u-h)/p}));const[m,g]=Oh(f/a,c/a,d/a,h/a),y=e=>Math.exp(m+g*(e-o));return{coef:[Math.exp(m-g*o),g],predict:y,rSquared:zh(e,t,n,a,y)}}function jh(e,t,n){let r=0,i=0,o=0,a=0,s=0,l=0;Th(e,t,n,((e,t)=>{const n=Math.log(e),u=Math.log(t);++l,r+=(n-r)/l,i+=(u-i)/l,o+=(n*u-o)/l,a+=(n*n-a)/l,s+=(t-s)/l}));const u=Oh(r,i,o,a),c=e=>u[0]*Math.pow(e,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:zh(e,t,n,s,c)}}function Bh(e,t,n){const[r,i,o,a]=Nh(e,t,n),s=r.length;let l,u,c,f,d=0,h=0,p=0,m=0,g=0;for(l=0;lb*(e-=o)*e+x*e+w+a;return{coef:[w-x*o+b*o*o+a,x-2*b*o,b],predict:_,rSquared:zh(e,t,n,a,_)}}function Ih(e,t,n,r){if(0===r)return Fh(e,t,n);if(1===r)return Rh(e,t,n);if(2===r)return Bh(e,t,n);const[i,o,a,s]=Nh(e,t,n),l=i.length,u=[],c=[],f=r+1;let d,h,p,m,g;for(d=0;dMath.abs(e[r][a])&&(a=i);for(o=r;o=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(s=0,o=i+1;o{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d=0;--o)for(s=t[o],l=1,i[o]+=s,a=1;a<=o;++a)l*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*l;return i[0]+=r,i}function qh(e,t,n,r){const[i,o,a,s]=Nh(e,t,n,!0),l=i.length,u=Math.max(2,~~(r*l)),c=new Float64Array(l),f=new Float64Array(l),d=new Float64Array(l).fill(1);for(let e=-1;++e<=2;){const t=[0,u-1];for(let e=0;ei[a]-n?r:a;let l=0,u=0,h=0,p=0,m=0;const g=1/Math.abs(i[s]-n||1);for(let e=r;e<=a;++e){const t=i[e],r=o[e],a=Wh(Math.abs(n-t)*g)*d[e],s=t*a;l+=a,u+=s,h+=r*a,p+=r*s,m+=t*s}const[y,v]=Oh(u/l,h/l,p/l,m/l);c[e]=y+v*n,f[e]=Math.abs(o[e]-c[e]),Hh(i,e+1,t)}if(2===e)break;const n=Os(f);if(Math.abs(n)<1e-12)break;for(let e,t,r=0;r=1?1e-12:(t=1-e*e)*t}return function(e,t,n,r){const i=e.length,o=[];let a,s=0,l=0,u=[];for(;s=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}const Gh=.5*Math.PI/180;function Vh(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,l=s/r,u=[i(o)],c=[];if(n===r){for(let e=1;e0;)c.push(i(o+e/n*s));let f=u[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,r=e;const i=t.length;for(let e=0;er&&(r=i)}return 1/(r-n)}(f[1],c);for(;d;){const e=i((f[0]+d[0])/2);e[0]-f[0]>=l&&Yh(f,e,d,h,p)>Gh?c.push(e):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function Yh(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),a=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-a)}function Xh(e){return e&&e.length?1===e.length?e[0]:(t=e,e=>{const n=t.length;let r=1,i=String(t[0](e));for(;r{},Qh={init:Zh,add:Zh,rem:Zh,idx:0},Kh={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},ep=Object.keys(Kh).filter((e=>"__count__"!==e));function tp(e,t,n){return Kh[e](n,t)}function np(e,t){return e.idx-t.idx}function rp(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function ip(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function op(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function ap(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function sp(e,t){const n=t||po,r=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=Kh[e]())}))};return e.forEach(n),Object.values(t).sort(np)}(e),i=e.slice().sort(np);function o(e){this._ops=r,this._out=i,this.cell=e,this.init()}return o.prototype.init=rp,o.prototype.add=ip,o.prototype.rem=op,o.prototype.set=ap,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function lp(e){this._key=e?fo(e):xd,this.reset()}[...ep,"__count__"].forEach((e=>{Kh[e]=function(e,t){return(n,r)=>la({name:e,aggregate_param:r,out:n||e},Qh,t)}(e,Kh[e])}));const up=lp.prototype;function cp(e){Kd.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}up.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},up.add=function(e){this._add.push(e)},up.rem=function(e){this._rem.push(e)},up.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,l,u;for(s=0;s=0;)r=e(t[i])+"",da(n,r)||(n[r]=1,++o);return o},up.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=ca(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},up.argmin=function(e){return this.extent(e)[0]||{}},up.argmax=function(e){return this.extent(e)[1]||{}},up.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},up.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},up.quartile=function(e){return this._get===e&&this._q||(this._q=oh(this.values(),e),this._get=e),this._q},up.q1=function(e){return this.quartile(e)[0]},up.q2=function(e){return this.quartile(e)[1]},up.q3=function(e){return this.quartile(e)[2]},up.ci=function(e){return this._get===e&&this._ci||(this._ci=uh(this.values(),1e3,.05,e),this._get=e),this._ci},up.ci0=function(e){return this.ci(e)[0]},up.ci1=function(e){return this.ci(e)[1]},cp.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ep},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},ga(cp,Kd,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map((()=>({}))),i=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o{const t=io(e);return i(e),n.push(t),t})),this.cellkey=e.key?e.key:Xh(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],l=e.as||[],u=o.length,c={};let f,d,h,p,m,g,y;for(u!==a.length&&uo("Unmatched number of fields and aggregate ops."),y=0;ysp(e,e.field))),Object.create(null)},cellkey:Xh(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stampo.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter((e=>!a[r(e)])),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Aa(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function hp(e){Kd.call(this,[],e)}function pp(e){Nd.call(this,null,mp,e)}function mp(e){return this.value&&!e.modified()?this.value:ta(e.fields,e.orders)}function gp(e){Kd.call(this,null,e)}function yp(e){Kd.call(this,null,e)}fp.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},ga(fp,Kd,{transform(e,t){const n=!1!==e.interval,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],s=a[0],l=a[1];let u;return u=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(oo(e.field))?t.ADD_MOD:t.ADD,t.visit(u,n?e=>{const t=r(e);e[s]=t,e[l]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=sh(e),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=e.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const l=function(e){let n=No(t(e));return null==n?null:ns?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return l.start=a,l.stop=n.stop,l.step=r,this.value=ro(l,oo(t),e.name||"bin_"+io(t))}}),hp.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},ga(hp,Kd,{transform(e,t){const n=t.fork(t.ALL),r=dp(xd,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(Ed(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),ga(pp,Nd),gp.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},ga(gp,Kd,{transform(e,t){const n=t=>n=>{for(var r,i=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],l=0,u=i.length;li[e]=1+(i[e]||0))),c=n((e=>i[e]-=1));return r?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,l,u;for(s in n)l=r[s],u=n[s]||0,!l&&u?(r[s]=l=_d({}),l[i]=s,l[o]=u,a.add.push(l)):0===u?(l&&a.rem.push(l),n[s]=null,r[s]=null):l[o]!==u&&(l[o]=u,a.mod.push(l));return a.modifies(t)}}),yp.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},ga(yp,Kd,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,r){for(var i,o,a=[],s={},l=e.length,u=0;uxp(e,t)))):typeof r[n]===bp&&r[n](e[n]);return r}function wp(e){Kd.call(this,null,e)}const _p=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],$p={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:_p},{name:"weights",type:"number",array:!0}]};function kp(e,t){return e?e.map(((e,n)=>t[n]||io(e))):null}function Cp(e,t,n){const r=[],i=e=>e(l);let o,a,s,l,u,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;ae.materialize(e.SOURCE).source}(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&uo("Invalid density method: "+a),e.extent||r.data||uo("Missing density extent parameter."),a=r[a];const s=e.as||["value","density"],l=Vh(a,e.extent||ua(r.data()),i,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],_d(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Ep(e){Kd.call(this,null,e)}Ep.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Ap(e){Nd.call(this,null,Dp,e),this.modified(!0)}function Dp(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ro((n=>t(n,e)),oo(t),io(t))}function Sp(e){Kd.call(this,[void 0,void 0],e)}function Mp(e,t){Nd.call(this,e),this.parent=t,this.count=0}function Fp(e){Kd.call(this,{},e),this._keys=pa();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,r=t.active;nfo(e))):fo(e.name,e.as)}function Tp(e){Kd.call(this,pa(),e)}function zp(e){Kd.call(this,[],e)}function Rp(e){Kd.call(this,[],e)}function Lp(e){Kd.call(this,null,e)}function Pp(e){Kd.call(this,[],e)}ga(Ep,Kd,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=Cp(t.source,e.groupby,po),i=e.smooth||!1,o=e.field,a=e.step||((e,t)=>Ma(ua(e,t))/30)(n,o),s=Ed(((e,t)=>o(e)-o(t))),l=e.as||"bin",u=r.length;let c,f=1/0,d=-1/0,h=0;for(;hd&&(d=t),e[++c][l]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(l)}}),ga(Ap,Nd),Sp.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},ga(Sp,Kd,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,(e=>{const t=No(r(e));null!=t&&(ta&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=io(r);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),ga(Mp,Nd,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),ga(Fp,Kd,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o,a,s=da(i,e)&&i[e];return s?s.value.stampe&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;ithis.subflow(e,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=xd(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=r(e);o.set(xd(e),t),s(t).add(e)})),a||t.modified(r.fields)?t.visit(t.MOD,(e=>{const t=xd(e),n=o.get(t),i=r(e);n===i?s(i).mod(e):(o.set(t,i),s(n).rem(e),s(i).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(xd(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=xd(e),n=o.get(t),i=r(e);n!==i&&(o.set(t,i),s(n).rem(e),s(i).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),ga(Op,Nd),Tp.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},ga(Tp,Kd,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,a=i.rem,s=i.mod,l=e.expr;let u=!0;function c(t){const n=xd(t),i=l(t,e),c=r.get(n);i&&c?(r.delete(n),o.push(t)):i||c?u&&i&&!c&&s.push(t):(r.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=xd(e);r.has(t)?r.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{l(t,e)?o.push(t):r.set(xd(t),1)})),t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),zp.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},ga(zp,Kd,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=kp(r,e.as||[]),o=e.index||null,a=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=r.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let l,u,c,f=0;for(;f{for(let t,o=0;ot[r]=n(t,e)))}}),ga(Pp,Kd,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i,o,a,s=this.value,l=e.size-s.length;if(l>0){for(i=[];--l>=0;)i.push(a=_d(r(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-l),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-l);return n.source=this.value=s,n}});const jp={value:"value",median:Os,mean:function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:As,max:Es},Bp=[];function Ip(e){Kd.call(this,[],e)}function Up(e){cp.call(this,e)}function qp(e){Kd.call(this,null,e)}function Wp(e){Nd.call(this,null,Hp,e)}function Hp(e){return this.value&&!e.modified()?this.value:ka(e.fields,e.flat)}function Gp(e){Kd.call(this,[],e),this._pending=null}function Vp(e,t,n){n.forEach(_d);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Yp(e){Kd.call(this,{},e)}function Xp(e){Nd.call(this,null,Jp,e)}function Jp(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Zp(e){Nd.call(this,null,Qp,e)}function Qp(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function Kp(e){Kd.call(this,null,e)}function em(e){cp.call(this,e)}function tm(e){Fp.call(this,e)}function nm(e){Kd.call(this,null,e)}function rm(e){Kd.call(this,null,e)}function im(e){Kd.call(this,null,e)}Ip.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},ga(Ip,Kd,{transform(e,t){var n,r,i,o,a,s,l,u,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||jp.value;if(null!=jp[n])return n===jp.value?(t=void 0!==e.value?e.value:0,()=>t):jp[n];uo("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),m=io(e.field),g=io(e.key),y=(e.groupby||[]).map(io),v=function(e,t,n,r){var i,o,a,s,l,u,c,f,d=e=>e(f),h=[],p=r?r.slice():[],m={},g={};for(p.forEach(((e,t)=>m[e]=t+1)),s=0,c=e.length;sn.add(e)))):(i=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{la(e,i[n.cellkey(e)].tuple)})),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const n=bh(t,a)[s],r=e.counts?t.length:1;Vh(n,c||ua(t),f,d).forEach((e=>{const n={};for(let e=0;e(this._pending=Zo(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>Vp(this,t,Zo(e.data))))}}),Yp.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},ga(Yp,Kd,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let l,u,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return i?(u=i.length,s>1&&!h&&uo('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*u&&uo('The "as" parameter has too few output field names.'),h=h||i.map(io),l=function(e){for(var t,a,l=0,c=0;lt.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,l),d.modifies(h)}}),ga(Xp,Nd),ga(Zp,Nd),ga(Kp,Kd,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),em.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:ep,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},ga(em,cp,{_transform:cp.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=oo(n).concat(oo(r)),a=function(e,t,n){const r={},i=[];return n.visit(n.SOURCE,(t=>{const n=e(t);r[n]||(r[n]=1,i.push(n))})),i.sort(na),t?i.slice(0,t):i}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map((()=>i)),fields:a.map((e=>function(e,t,n,r){return ro((r=>t(r)===e?n(r):NaN),r,e+"")}(e,n,r,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),ga(tm,Fp,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(xd(e),n,t,e);return(e.modified("field")||r&&t.modified(oo(r)))&&uo("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,(e=>{const t=i(e);r(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=i(e);r(e).forEach((e=>t.add(_d(e))))})),t.visit(t.REM,(e=>{const t=i(e);r(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>i(e).mod(e))),t.visit(t.ADD,(e=>i(e).add(e))),t.visit(t.REM,(e=>i(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),nm.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},ga(nm,Kd,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=kp(e.fields,e.as||[]),o=r?(e,t)=>function(e,t,n,r){for(let i=0,o=n.length;i{const t=xd(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,_d({}));a[xd(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[xd(e)]))})),n}}),ga(rm,Kd,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),im.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function om(e){Kd.call(this,null,e)}function am(e){Kd.call(this,[],e),this.count=0}function sm(e){Kd.call(this,null,e)}function lm(e){Kd.call(this,null,e),this.modified(!0)}function um(e){Kd.call(this,null,e)}ga(im,Kd,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=Cp(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(io),a=[],s=e.step||.01,l=e.probs||Ts(s/2,1-1e-14,s),u=l.length;return i.forEach((e=>{const t=ih(e,l);for(let n=0;n{const t=xd(e);n.rem.push(r[t]),r[t]=null})),t.visit(t.ADD,(e=>{const t=$d(e);r[xd(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=r[xd(e)];for(const r in e)t[r]=e[r],n.modifies(r);n.mod.push(t)}))),n}}),am.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},ga(am,Kd,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce(((e,t)=>(e[xd(t)]=1,e)),{});let a=this.value,s=this.count,l=0;function u(e){let t,r;a.length=l&&(t=a[r],o[xd(t)]&&n.rem.push(t),a[r]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=xd(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[xd(e)]))),(t.rem.length||r)&&a.length{o[xd(e)]||u(e)})),l=-1),r&&a.length>i){const e=a.length-i;for(let t=0;t{o[xd(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=a.filter((e=>!o[xd(e)]))),this.count=s,this.value=n.source=a,n}}),sm.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},ga(sm,Kd,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ts(e.start,e.stop,e.step||1).map((e=>{const t={};return t[r]=e,_d(t)})),n.add=t.add.concat(this.value),n}}),ga(lm,Kd,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const cm=["unit0","unit1"];function fm(e){Kd.call(this,pa(),e)}function dm(e){Kd.call(this,null,e)}um.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:nu,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:cm}]},ga(um,Kd,{transform(e,t){const n=e.field,r=!1!==e.interval,i="utc"===e.timezone,o=this._floor(e,t),a=(i?Ou:Fu)(o.unit).offset,s=e.as||cm,l=s[0],u=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(oo(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let i,s;null==t?(e[l]=null,r&&(e[u]=null)):(e[l]=i=s=o(t),r&&(e[u]=s=a(i,c)),id&&(d=s))})),o.start=f,o.stop=d,t.modifies(r?s:l)},_floor(e,t){const n="utc"===e.timezone,{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:Ku({extent:e.extent||ua(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=iu(r),a=this.value||{},s=(n?Du:Cu)(o,i);return s.unit=Oo(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),ga(fm,Kd,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>i.delete(r(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),ga(dm,Kd,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ed(e.sort)):t.source).map(e.field))}});const hm={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=hm.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e0||uo("ntile num must be greater than zero.");const n=hm.cume_dist(),r=n.next;return{init:n.init,next:e=>Math.ceil(t*r(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return re(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||uo("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return rt=null,next:n=>{const r=e(n.data[n.index]);return null!=r?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=function(e,t,n){for(let r=t.length;nl[e]=1))}h(e.sort),t.forEach(((e,t)=>{const l=n[t],p=r[t],m=i[t]||null,g=io(l),y=Jh(e,g,o[t]);if(h(l),a.push(y),da(hm,e))s.push(function(e,t,n,r){const i=hm[e](t,n);return{init:i.init||mo,update:function(e,t){t[r]=i.next(e)}}}(e,l,p,y));else{if(null==l&&"count"!==e&&uo("Null aggregate field specified."),"count"===e)return void c.push(y);d=!1;let t=u[g];t||(t=u[g]=[],t.field=l,f.push(t)),t.push(tp(e,m,y))}})),(c.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>sp(e,e.field)));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),re.init())),this.cell&&this.cell.init()},gm.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!n||(a=this.state=new mm(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let t=0,n=this._mlen;t=1?Om:e<=-1?-Om:Math.asin(e)}const zm=Math.PI,Rm=2*zm,Lm=1e-6,Pm=Rm-Lm;function jm(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return jm;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tLm)if(Math.abs(c*s-l*u)>Lm&&i){let d=n-o,h=r-a,p=s*s+l*l,m=d*d+h*h,g=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((zm-Math.acos((p+f-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>Lm&&this._append`L${e+b*u},${t+b*c}`,this._append`A${i},${i},0,0,${+(c*d>u*h)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,u=t+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Lm||Math.abs(this._y1-u)>Lm)&&this._append`L${l},${u}`,n&&(f<0&&(f=f%Rm+Rm),f>Pm?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:f>Lm&&this._append`A${n},${n},0,${+(f>=zm)},${c},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Im(){return new Bm}function Um(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Bm(t)}function qm(e){return e.innerRadius}function Wm(e){return e.outerRadius}function Hm(e){return e.startAngle}function Gm(e){return e.endAngle}function Vm(e){return e&&e.padAngle}function Ym(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/Sm(s*s+l*l),c=u*l,f=-u*s,d=e+c,h=t+f,p=n+c,m=r+f,g=(d+p)/2,y=(h+m)/2,v=p-d,b=m-h,x=v*v+b*b,w=i-o,_=d*m-p*h,$=(b<0?-1:1)*Sm(Em(0,w*w*x-_*_)),k=(_*b-v*$)/x,C=(-_*v-b*$)/x,E=(_*b+v*$)/x,A=(-_*v+b*$)/x,D=k-g,S=C-y,M=E-g,F=A-y;return D*D+S*S>M*M+F*F&&(k=E,C=A),{cx:k,cy:C,x01:-c,y01:-f,x11:k*(i/w-1),y11:C*(i/w-1)}}function Xm(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Jm(e){this._context=e}function Zm(e){return new Jm(e)}function Qm(e){return e[0]}function Km(e){return e[1]}function eg(e,t){var n=_m(!0),r=null,i=Zm,o=null,a=Um(s);function s(s){var l,u,c,f=(s=Xm(s)).length,d=!1;for(null==r&&(o=i(c=a())),l=0;l<=f;++l)!(l=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}g&&(y[c]=+e(h,c,u),v[c]=+t(h,c,u),s.point(r?+r(h,c,u):y[c],n?+n(h,c,u):v[c]))}if(p)return s=null,p+""||null}function c(){return eg().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?Qm:_m(+e),t="function"==typeof t?t:_m(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?Km:_m(+n),u.x=function(t){return arguments.length?(e="function"==typeof t?t:_m(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:_m(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:_m(+e),u):r},u.y=function(e){return arguments.length?(t="function"==typeof e?e:_m(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:_m(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:_m(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:_m(!!e),u):i},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u}Im.prototype=Bm.prototype,Jm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var ng={draw(e,t){const n=Sm(t/Fm);e.moveTo(n,0),e.arc(0,0,n,0,Nm)}};function rg(){}function ig(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function og(e){this._context=e}function ag(e){this._context=e}function sg(e){this._context=e}function lg(e,t){this._basis=new og(e),this._beta=t}og.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ig(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ig(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ag.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ig(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},sg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ig(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},lg.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,l=-1;++l<=n;)r=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+r*a),this._beta*t[l]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var ug=function e(t){function n(e){return 1===t?new og(e):new lg(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function cg(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function fg(e,t){this._context=e,this._k=(1-t)/6}fg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cg(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:cg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var dg=function e(t){function n(e){return new fg(e,t)}return n.tension=function(t){return e(+t)},n}(0);function hg(e,t){this._context=e,this._k=(1-t)/6}hg.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:cg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var pg=function e(t){function n(e){return new hg(e,t)}return n.tension=function(t){return e(+t)},n}(0);function mg(e,t){this._context=e,this._k=(1-t)/6}mg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cg(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var gg=function e(t){function n(e){return new mg(e,t)}return n.tension=function(t){return e(+t)},n}(0);function yg(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Mm){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Mm){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function vg(e,t){this._context=e,this._alpha=t}vg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:yg(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var bg=function e(t){function n(e){return t?new vg(e,t):new fg(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function xg(e,t){this._context=e,this._alpha=t}xg.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:yg(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var wg=function e(t){function n(e){return t?new xg(e,t):new hg(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function _g(e,t){this._context=e,this._alpha=t}_g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yg(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $g=function e(t){function n(e){return t?new _g(e,t):new mg(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function kg(e){this._context=e}function Cg(e){return e<0?-1:1}function Eg(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Cg(o)+Cg(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ag(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Dg(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Sg(e){this._context=e}function Mg(e){this._context=new Fg(e)}function Fg(e){this._context=e}function Og(e){this._context=e}function Ng(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const Rg=()=>"undefined"!=typeof Image?Image:null;function Lg(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Pg(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const jg=Symbol("implicit");function Bg(){var e=new ds,t=[],n=[],r=jg;function i(i){let o=e.get(i);if(void 0===o){if(r!==jg)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new ds;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Bg(t,n).unknown(r)},Lg.apply(i,arguments),i}function Ig(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ug(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qg(){}var Wg=.7,Hg=1/Wg,Gg="\\s*([+-]?\\d+)\\s*",Vg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xg=/^#([0-9a-f]{3,8})$/,Jg=new RegExp(`^rgb\\(${Gg},${Gg},${Gg}\\)$`),Zg=new RegExp(`^rgb\\(${Yg},${Yg},${Yg}\\)$`),Qg=new RegExp(`^rgba\\(${Gg},${Gg},${Gg},${Vg}\\)$`),Kg=new RegExp(`^rgba\\(${Yg},${Yg},${Yg},${Vg}\\)$`),ey=new RegExp(`^hsl\\(${Vg},${Yg},${Yg}\\)$`),ty=new RegExp(`^hsla\\(${Vg},${Yg},${Yg},${Vg}\\)$`),ny={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ry(){return this.rgb().formatHex()}function iy(){return this.rgb().formatRgb()}function oy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xg.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ay(t):3===n?new cy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?sy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?sy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Jg.exec(e))?new cy(t[1],t[2],t[3],1):(t=Zg.exec(e))?new cy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qg.exec(e))?sy(t[1],t[2],t[3],t[4]):(t=Kg.exec(e))?sy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ey.exec(e))?gy(t[1],t[2]/100,t[3]/100,1):(t=ty.exec(e))?gy(t[1],t[2]/100,t[3]/100,t[4]):ny.hasOwnProperty(e)?ay(ny[e]):"transparent"===e?new cy(NaN,NaN,NaN,0):null}function ay(e){return new cy(e>>16&255,e>>8&255,255&e,1)}function sy(e,t,n,r){return r<=0&&(e=t=n=NaN),new cy(e,t,n,r)}function ly(e){return e instanceof qg||(e=oy(e)),e?new cy((e=e.rgb()).r,e.g,e.b,e.opacity):new cy}function uy(e,t,n,r){return 1===arguments.length?ly(e):new cy(e,t,n,null==r?1:r)}function cy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function fy(){return`#${my(this.r)}${my(this.g)}${my(this.b)}`}function dy(){const e=hy(this.opacity);return`${1===e?"rgb(":"rgba("}${py(this.r)}, ${py(this.g)}, ${py(this.b)}${1===e?")":`, ${e})`}`}function hy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function py(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function my(e){return((e=py(e))<16?"0":"")+e.toString(16)}function gy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new by(e,t,n,r)}function yy(e){if(e instanceof by)return new by(e.h,e.s,e.l,e.opacity);if(e instanceof qg||(e=oy(e)),!e)return new by;if(e instanceof by)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&l<1?0:a,new by(a,s,l,e.opacity)}function vy(e,t,n,r){return 1===arguments.length?yy(e):new by(e,t,n,null==r?1:r)}function by(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function xy(e){return(e=(e||0)%360)<0?e+360:e}function wy(e){return Math.max(0,Math.min(1,e||0))}function _y(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ig(qg,oy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ry,formatHex:ry,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yy(this).formatHsl()},formatRgb:iy,toString:iy}),Ig(cy,uy,Ug(qg,{brighter(e){return e=null==e?Hg:Math.pow(Hg,e),new cy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Wg:Math.pow(Wg,e),new cy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cy(py(this.r),py(this.g),py(this.b),hy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fy,formatHex:fy,formatHex8:function(){return`#${my(this.r)}${my(this.g)}${my(this.b)}${my(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:dy,toString:dy})),Ig(by,vy,Ug(qg,{brighter(e){return e=null==e?Hg:Math.pow(Hg,e),new by(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Wg:Math.pow(Wg,e),new by(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new cy(_y(e>=240?e-240:e+120,i,r),_y(e,i,r),_y(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new by(xy(this.h),wy(this.s),wy(this.l),hy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=hy(this.opacity);return`${1===e?"hsl(":"hsla("}${xy(this.h)}, ${100*wy(this.s)}%, ${100*wy(this.l)}%${1===e?")":`, ${e})`}`}}));const $y=Math.PI/180,ky=180/Math.PI,Cy=.96422,Ey=1,Ay=.82521,Dy=4/29,Sy=6/29,My=3*Sy*Sy,Fy=Sy*Sy*Sy;function Oy(e){if(e instanceof Ty)return new Ty(e.l,e.a,e.b,e.opacity);if(e instanceof By)return Iy(e);e instanceof cy||(e=ly(e));var t,n,r=Py(e.r),i=Py(e.g),o=Py(e.b),a=zy((.2225045*r+.7168786*i+.0606169*o)/Ey);return r===i&&i===o?t=n=a:(t=zy((.4360747*r+.3850649*i+.1430804*o)/Cy),n=zy((.0139322*r+.0971045*i+.7141733*o)/Ay)),new Ty(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ny(e,t,n,r){return 1===arguments.length?Oy(e):new Ty(e,t,n,null==r?1:r)}function Ty(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function zy(e){return e>Fy?Math.pow(e,1/3):e/My+Dy}function Ry(e){return e>Sy?e*e*e:My*(e-Dy)}function Ly(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Py(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function jy(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof By)return new By(e.h,e.c,e.l,e.opacity);if(e instanceof Ty||(e=Oy(e)),0===e.a&&0===e.b)return new By(NaN,0=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r()=>e;function nv(e,t){return function(n){return e+n*t}}function rv(e,t){var n=t-e;return n?nv(e,n>180||n<-180?n-360*Math.round(n/360):n):tv(isNaN(e)?t:e)}function iv(e){return 1==(e=+e)?ov:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):tv(isNaN(t)?n:t)}}function ov(e,t){var n=t-e;return n?nv(e,n):tv(isNaN(e)?t:e)}var av=function e(t){var n=iv(t);function r(e,t){var r=n((e=uy(e)).r,(t=uy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=ov(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function sv(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:pv(n,r)})),o=yv.lastIndex;return o180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:pv(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,l),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:pv(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,l),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:pv(e,n)},{i:s-2,x:pv(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,l),o=a=null,function(e){for(var t,n=-1,r=l.length;++nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Gv:Hv,i=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return f.invert=function(n){return u(t((o||(o=r(s,a.map(e),pv)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Iv),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),l=xv,c()},f.clamp=function(e){return arguments.length?(u=!!e||qv,c()):u!==qv},f.interpolate=function(e){return arguments.length?(l=e,c()):l},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function Xv(){return Yv()(qv,qv)}function Jv(e,t,n,r){var i,o=Cs(e,t,n);switch((r=Is(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=Ks(o,a))||(r.precision=i),Ys(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=el(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Qs(o))||(r.precision=i-2*("%"===r.type))}return Vs(r)}function Zv(e){var t=e.domain;return e.ticks=function(e){var n=t();return $s(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Jv(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],u=o[s],c=10;for(u0;){if((i=ks(l,u,n))===r)return o[a]=l,o[s]=u,t(o);if(i>0)l=Math.floor(l/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,u=Math.floor(u*i)/i}r=i}return e},e}function Qv(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a-e(-t,n)}function ob(e){const t=e(Kv,eb),n=t.domain;let r,i,o=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),i=function(e){return 10===e?rb:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=ib(r),i=ib(i),e(tb,nb)):e(Kv,eb),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const l=s0){for(;f<=d;++f)for(u=1;us)break;p.push(c)}}else for(;f<=d;++f)for(u=o-1;u>=1;--u)if(c=f>0?u/i(-f):u*i(f),!(cs)break;p.push(c)}2*p.length{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=Is(n)).precision||(n.trim=!0),n=Vs(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/i(Math.round(r(e)));return t*on(Qv(n(),{floor:e=>i(Math.floor(r(e))),ceil:e=>i(Math.ceil(r(e)))})),t}function ab(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function sb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function lb(e){var t=1,n=e(ab(t),sb(t));return n.constant=function(n){return arguments.length?e(ab(t=+n),sb(t)):t},Zv(n)}function ub(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function cb(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function fb(e){return e<0?-e*e:e*e}function db(e){var t=e(qv,qv),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(qv,qv):.5===n?e(cb,fb):e(ub(n),ub(1/n)):n},Zv(t)}function hb(){var e=db(Yv());return e.copy=function(){return Vv(e,hb()).exponent(e.exponent())},Lg.apply(e,arguments),e}function pb(e){return new Date(e)}function mb(e){return e instanceof Date?+e:+new Date(+e)}function gb(e,t,n,r,i,o,a,s,l,u){var c=Xv(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),x=u("%Y");function w(e){return(l(e)0?r:1:0}const kb="linear",Cb="log",Eb="pow",Ab="sqrt",Db="symlog",Sb="time",Mb="utc",Fb="sequential",Ob="diverging",Nb="quantile",Tb="quantize",zb="threshold",Rb="ordinal",Lb="point",Pb="band",jb="bin-ordinal",Bb="continuous",Ib="discrete",Ub="discretizing",qb="interpolating",Wb="temporal";function Hb(){const e=Bg().unknown(void 0),t=e.domain,n=e.range;let r,i,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){const e=t().length,c=o[1]h+r*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return i},e.step=function(){return r},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const r=o[1]o[1-r])?void 0:(l=Math.max(0,ls(a,f)-1),u=f===d?l:ls(a,d)-1,f-a[l]>i+1e-10&&++l,r&&(c=l,l=s-u,u=s-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Hb().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(u)},c()}function Gb(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Gb(t())},e}var Vb=Array.prototype.map;const Yb=Array.prototype.slice;const Xb=new Map,Jb=Symbol("vega_scale");function Zb(e){return e[Jb]=!0,e}function Qb(e,t,n){return arguments.length>1?(Xb.set(e,function(e,t,n){const r=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,r=t[0],i=t[1];return i=s&&n[o]<=l&&(u<0&&(u=o),r=o);if(!(u<0))return s=e.invertExtent(n[u]),l=e.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,Zb(n)};return r.metadata=Ra(Zo(n)),r}(e,t,n)),this):Kb(e)?Xb.get(e):void 0}function Kb(e){return Xb.has(e)}function ex(e,t){const n=Xb.get(e);return n&&n.metadata[t]}function tx(e){return ex(e,Bb)}function nx(e){return ex(e,Ib)}function rx(e){return ex(e,Ub)}function ix(e){return ex(e,Cb)}function ox(e){return ex(e,qb)}function ax(e){return ex(e,Nb)}Qb("identity",(function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,Iv),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Iv):[0,1],Zv(r)})),Qb(kb,(function e(){var t=Xv();return t.copy=function(){return Vv(t,e())},Lg.apply(t,arguments),Zv(t)}),Bb),Qb(Cb,(function e(){const t=ob(Yv()).domain([1,10]);return t.copy=()=>Vv(t,e()).base(t.base()),Lg.apply(t,arguments),t}),[Bb,Cb]),Qb(Eb,hb,Bb),Qb(Ab,(function(){return hb.apply(null,arguments).exponent(.5)}),Bb),Qb(Db,(function e(){var t=lb(Yv());return t.copy=function(){return Vv(t,e()).constant(t.constant())},Lg.apply(t,arguments)}),Bb),Qb(Sb,(function(){return Lg.apply(gb(ql,Wl,Pl,Rl,wl,yl,ml,hl,dl,oc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Bb,Wb]),Qb(Mb,(function(){return Lg.apply(gb(Il,Ul,jl,Ll,Sl,vl,gl,pl,dl,sc).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Bb,Wb]),Qb(Fb,bb,[Bb,qb]),Qb(`${Fb}-${kb}`,bb,[Bb,qb]),Qb(`${Fb}-${Cb}`,(function e(){var t=ob(yb()).domain([1,10]);return t.copy=function(){return vb(t,e()).base(t.base())},Pg.apply(t,arguments)}),[Bb,qb,Cb]),Qb(`${Fb}-${Eb}`,xb,[Bb,qb]),Qb(`${Fb}-${Ab}`,(function(){return xb.apply(null,arguments).exponent(.5)}),[Bb,qb]),Qb(`${Fb}-${Db}`,(function e(){var t=lb(yb());return t.copy=function(){return vb(t,e()).constant(t.constant())},Pg.apply(t,arguments)}),[Bb,qb]),Qb(`${Ob}-${kb}`,(function e(){var t=Zv(wb()(qv));return t.copy=function(){return vb(t,e())},Pg.apply(t,arguments)}),[Bb,qb]),Qb(`${Ob}-${Cb}`,(function e(){var t=ob(wb()).domain([.1,1,10]);return t.copy=function(){return vb(t,e()).base(t.base())},Pg.apply(t,arguments)}),[Bb,qb,Cb]),Qb(`${Ob}-${Eb}`,_b,[Bb,qb]),Qb(`${Ob}-${Ab}`,(function(){return _b.apply(null,arguments).exponent(.5)}),[Bb,qb]),Qb(`${Ob}-${Db}`,(function e(){var t=lb(wb());return t.copy=function(){return vb(t,e()).constant(t.constant())},Pg.apply(t,arguments)}),[Bb,qb]),Qb(Nb,(function e(){var t,n=[],r=[],i=[];function o(){var e=0,t=Math.max(1,r.length);for(i=new Array(t-1);++e0?i[t-1]:n[0],t=i?[o[i-1],r]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,r]).range(a).unknown(t)},Lg.apply(Zv(s),arguments)}),Ub),Qb(zb,(function e(){var t,n=[.5],r=[0,1],i=1;function o(e){return null!=e&&e<=e?r[cs(n,e,0,i)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(r).unknown(t)},Lg.apply(o,arguments)}),Ub),Qb(jb,(function e(){let t=[],n=[];function r(e){return null==e||e!=e?void 0:n[(cs(t,e)-1)%n.length]}return r.domain=function(e){return arguments.length?(t=function(e){return Vb.call(e,No)}(e),r):t.slice()},r.range=function(e){return arguments.length?(n=Yb.call(e),r):n.slice()},r.tickFormat=function(e,n){return Jv(t[0],Oo(t),null==e?10:e,n)},r.copy=function(){return e().domain(r.domain()).range(r.range())},r}),[Ib,Ub]),Qb(Rb,Bg,Ib),Qb(Pb,Hb,Ib),Qb(Lb,(function(){return Gb(Hb().paddingInner(1))}),Ib);const sx=["clamp","base","constant","exponent"];function lx(e,t){const n=t[0],r=Oo(t)-n;return function(t){return e(n+t*r)}}function ux(e,t,n){return jv(dx(t||"rgb",n),e)}function cx(e,t){const n=new Array(t),r=t+1;for(let i=0;ie[t]?a[t](e[t]()):0)),a):aa(.5)}function dx(e,t){const n=Bv[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function hx(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r1?(mx[e]=t,this):mx[e]}px({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},hx),px({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>ux(hx(e))));const yx="symbol",vx="discrete",bx=e=>Eo(e)?e.map((e=>String(e))):String(e),xx=(e,t)=>e[1]-t[1],wx=(e,t)=>t[1]-e[1];function _x(e,t,n){let r;return wa(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ma(e.domain())/n||1)+1))),Ao(t)&&(r=t.step,t=t.interval),$a(t)&&(t=e.type===Sb?Fu(t):e.type==Mb?Ou(t):uo("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function $x(e,t,n){let r=e.range(),i=r[0],o=Oo(r),a=xx;if(i>o&&(r=o,o=i,i=r,a=wx),i=Math.floor(i),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>i<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],Oo(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function kx(e,t){return e.bins?$x(e,e.bins):e.ticks?e.ticks(t):e.domain()}function Cx(e,t,n,r,i,o){const a=t.type;let s=bx;if(a===Sb||i===Sb)s=e.timeFormat(r);else if(a===Mb||i===Mb)s=e.utcFormat(r);else if(ix(a)){const i=e.formatFloat(r);if(o||t.bins)s=i;else{const e=Ex(t,n,!1);s=t=>e(t)?i(t):""}}else if(t.tickFormat){const i=t.domain();s=e.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=e.format(r));return s}function Ex(e,t,n){const r=kx(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length),s=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*iAx[e.type]||e.bins;function Fx(e,t,n,r,i,o,a){const s=Dx[t.type]&&o!==Sb&&o!==Mb?function(e,t,n){const r=t[Dx[t.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o(t,n,r)=>{const i=Nx(r[n+1],Nx(r.max,1/0)),o=Rx(t,e),a=Rx(i,e);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Nx=(e,t)=>null!=e?e:t,Tx=e=>(t,n)=>n?e(t):null,zx=e=>t=>e(t),Rx=(e,t)=>Number.isFinite(e)?t(e):null;function Lx(e,t,n,r){const i=r||t.type;return $a(n)&&function(e){return ex(e,Wb)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Sb?n||i!==Mb?Fx(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function Px(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Lx(e,t,n.format,n.formatType);if(rx(t.type)){const e=Sx(t).slice(1).map(i),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(nx(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>r?e.slice(0,r-2).map(i).join(", ")+", ending with "+e.slice(-1).map(i):e.map(i).join(", ")}`}{const e=t.domain();return`values from ${i(e[0])} to ${i(Oo(e))}`}}let jx=0;const Bx="p_";function Ix(e){return e&&e.gradient}function Ux(e,t,n){const r=e.gradient;let i=e.id,o="radial"===r?Bx:"";return i||(i=e.id="gradient_"+jx++,"radial"===r?(e.x1=qx(e.x1,.5),e.y1=qx(e.y1,.5),e.r1=qx(e.r1,0),e.x2=qx(e.x2,.5),e.y2=qx(e.y2,.5),e.r2=qx(e.r2,.5),o=Bx):(e.x1=qx(e.x1,0),e.y1=qx(e.y1,0),e.x2=qx(e.x2,1),e.y2=qx(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function qx(e,t){return null!=e?e:t}function Wx(e,t){var n,r=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:r,stop:function(e,t){return r.push({offset:e,color:t}),n}}}const Hx={basis:{curve:function(e){return new og(e)}},"basis-closed":{curve:function(e){return new ag(e)}},"basis-open":{curve:function(e){return new sg(e)}},bundle:{curve:ug,tension:"beta",value:.85},cardinal:{curve:dg,tension:"tension",value:0},"cardinal-open":{curve:gg,tension:"tension",value:0},"cardinal-closed":{curve:pg,tension:"tension",value:0},"catmull-rom":{curve:bg,tension:"alpha",value:.5},"catmull-rom-closed":{curve:wg,tension:"alpha",value:.5},"catmull-rom-open":{curve:$g,tension:"alpha",value:.5},linear:{curve:Zm},"linear-closed":{curve:function(e){return new kg(e)}},monotone:{horizontal:function(e){return new Mg(e)},vertical:function(e){return new Sg(e)}},natural:{curve:function(e){return new Og(e)}},step:{curve:function(e){return new Tg(e,.5)}},"step-after":{curve:function(e){return new Tg(e,1)}},"step-before":{curve:function(e){return new Tg(e,0)}}};function Gx(e,t,n){var r=da(Hx,e)&&Hx[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Vx={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Yx=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Xx=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Jx=/^((\s+,?\s*)|(,\s*))/,Zx=/^[01]/;function Qx(e){const t=[];return(e.match(Yx)||[]).forEach((e=>{let n=e[0];const r=n.toLowerCase(),i=Vx[r],o=function(e,t,n){const r=[];for(let i=0;t&&i1&&(m=Math.sqrt(m),n*=m,r*=m);const g=d/n,y=f/n,v=-f/r,b=d/r,x=g*s+y*l,w=v*s+b*l,_=g*e+y*t,$=v*e+b*t;let k=1/((_-x)*(_-x)+($-w)*($-w))-.25;k<0&&(k=0);let C=Math.sqrt(k);o==i&&(C=-C);const E=.5*(x+_)-C*($-w),A=.5*(w+$)+C*(_-x),D=Math.atan2(w-A,x-E);let S=Math.atan2($-A,_-E)-D;S<0&&1===o?S+=tw:S>0&&0===o&&(S-=tw);const M=Math.ceil(Math.abs(S/(ew+.001))),F=[];for(let e=0;e+e}function ww(e,t,n){return Math.max(t,Math.min(e,n))}function _w(){var e=gw,t=yw,n=vw,r=bw,i=xw(0),o=i,a=i,s=i,l=null;function u(u,c,f){var d,h=null!=c?c:+e.call(this,u),p=null!=f?f:+t.call(this,u),m=+n.call(this,u),g=+r.call(this,u),y=Math.min(m,g)/2,v=ww(+i.call(this,u),0,y),b=ww(+o.call(this,u),0,y),x=ww(+a.call(this,u),0,y),w=ww(+s.call(this,u),0,y);if(l||(l=d=Im()),v<=0&&b<=0&&x<=0&&w<=0)l.rect(h,p,m,g);else{var _=h+m,$=p+g;l.moveTo(h+v,p),l.lineTo(_-b,p),l.bezierCurveTo(_-mw*b,p,_,p+mw*b,_,p+b),l.lineTo(_,$-w),l.bezierCurveTo(_,$-mw*w,_-mw*w,$,_-w,$),l.lineTo(h+x,$),l.bezierCurveTo(h+mw*x,$,h,$-mw*x,h,$-x),l.lineTo(h,p+v),l.bezierCurveTo(h,p+mw*v,h+mw*v,p,h+v,p),l.closePath()}if(d)return l=null,d+""||null}return u.x=function(t){return arguments.length?(e=xw(t),u):e},u.y=function(e){return arguments.length?(t=xw(e),u):t},u.width=function(e){return arguments.length?(n=xw(e),u):n},u.height=function(e){return arguments.length?(r=xw(e),u):r},u.cornerRadius=function(e,t,n,r){return arguments.length?(i=xw(e),o=null!=t?xw(t):i,s=null!=n?xw(n):i,a=null!=r?xw(r):o,u):i},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}function $w(){var e,t,n,r,i,o,a,s,l=null;function u(e,t,n){const r=n/2;if(i){var u=a-t,c=e-o;if(u||c){var f=Math.hypot(u,c),d=(u/=f)*s,h=(c/=f)*s,p=Math.atan2(c,u);l.moveTo(o-d,a-h),l.lineTo(e-u*r,t-c*r),l.arc(e,t,r,p-Math.PI,p),l.lineTo(o+d,a+h),l.arc(o,a,s,p,p+Math.PI)}else l.arc(e,t,r,0,tw);l.closePath()}else i=1;o=e,a=t,s=r}function c(o){var a,s,c,f=o.length,d=!1;for(null==l&&(l=c=Im()),a=0;a<=f;++a)!(ae.x||0,Ew=e=>e.y||0,Aw=e=>!(!1===e.defined),Dw=function(){var e=qm,t=Wm,n=_m(0),r=null,i=Hm,o=Gm,a=Vm,s=null,l=Um(u);function u(){var u,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-Om,p=o.apply(this,arguments)-Om,m=$m(p-h),g=p>h;if(s||(s=u=l()),dMm)if(m>Nm-Mm)s.moveTo(d*Cm(h),d*Dm(h)),s.arc(0,0,d,h,p,!g),f>Mm&&(s.moveTo(f*Cm(p),f*Dm(p)),s.arc(0,0,f,p,h,g));else{var y,v,b=h,x=p,w=h,_=p,$=m,k=m,C=a.apply(this,arguments)/2,E=C>Mm&&(r?+r.apply(this,arguments):Sm(f*f+d*d)),A=Am($m(d-f)/2,+n.apply(this,arguments)),D=A,S=A;if(E>Mm){var M=Tm(E/f*Dm(C)),F=Tm(E/d*Dm(C));($-=2*M)>Mm?(w+=M*=g?1:-1,_-=M):($=0,w=_=(h+p)/2),(k-=2*F)>Mm?(b+=F*=g?1:-1,x-=F):(k=0,b=x=(h+p)/2)}var O=d*Cm(b),N=d*Dm(b),T=f*Cm(_),z=f*Dm(_);if(A>Mm){var R,L=d*Cm(x),P=d*Dm(x),j=f*Cm(w),B=f*Dm(w);if(m1?0:e<-1?Fm:Math.acos(e)}((I*q+U*W)/(Sm(I*I+U*U)*Sm(q*q+W*W)))/2),G=Sm(R[0]*R[0]+R[1]*R[1]);D=Am(A,(f-G)/(H-1)),S=Am(A,(d-G)/(H+1))}else D=S=0}k>Mm?S>Mm?(y=Ym(j,B,O,N,d,S,g),v=Ym(L,P,T,z,d,S,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),SMm&&$>Mm?D>Mm?(y=Ym(T,z,L,P,f,-D,g),v=Ym(O,N,j,B,f,-D,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),De.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),Sw=tg().x(Cw).y1(Ew).y0((e=>(e.y||0)+(e.height||0))).defined(Aw),Mw=tg().y(Ew).x1(Cw).x0((e=>(e.x||0)+(e.width||0))).defined(Aw),Fw=eg().x(Cw).y(Ew).defined(Aw),Ow=_w().x(Cw).y(Ew).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>kw(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>kw(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>kw(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>kw(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Nw=function(e,t){let n=null,r=Um(i);function i(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:_m(e||ng),t="function"==typeof t?t:_m(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:_m(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:_m(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type((e=>hw(e.shape||"circle"))).size((e=>kw(e.size,64))),Tw=$w().x(Cw).y(Ew).defined(Aw).size((e=>e.size||1));function zw(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Rw(e,t,n,r){return Ow.context(e)(t,n,r)}var Lw=1;function Pw(){Lw=1}function jw(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+Lw++),a=i.clipping[o]||(i.clipping[o]={id:o});return Ko(r)?a.path=r(null):zw(n)?a.path=Rw(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Bw(e){this.clear(),e&&this.union(e)}function Iw(e){this.mark=e,this.bounds=this.bounds||new Bw}function Uw(e){Iw.call(this,e),this.items=this.items||[]}function qw(e){this._pending=0,this._loader=e||pd()}function Ww(e){e._pending+=1}function Hw(e){e._pending-=1}function Gw(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const r=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(r+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,r):0))}return e}Bw.prototype={clone(){return new Bw(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),l=Math.sin(e),u=t-t*s+n*l,c=n-t*l-n*s;return[s*r-l*i+u,l*r+s*i+c,s*r-l*a+u,l*r+s*a+c,s*o-l*i+u,l*o+s*i+c,s*o-l*a+u,l*o+s*a+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ga(Uw,Iw),qw.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return Ww(t),t._loader.sanitize(e,{context:"href"}).then((e=>(Hw(t),e))).catch((()=>(Hw(t),null)))},loadImage(e){const t=this,n=Rg();return Ww(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const r=e.href;if(!r||!n)throw{url:r};const i=new n,o=da(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Hw(t),i.onerror=()=>Hw(t),i.src=r,i})).catch((e=>(Hw(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))},ready(){const e=this;return new Promise((t=>{!function n(r){e.pending()?setTimeout((()=>{n(!0)}),10):t(r)}(!1)}))}};const Vw=tw-1e-8;let Yw,Xw,Jw,Zw,Qw,Kw,e_,t_;const n_=(e,t)=>Yw.add(e,t),r_=(e,t)=>n_(Xw=e,Jw=t),i_=e=>n_(e,Yw.y1),o_=e=>n_(Yw.x1,e),a_=(e,t)=>Qw*e+e_*t,s_=(e,t)=>Kw*e+t_*t,l_=(e,t)=>n_(a_(e,t),s_(e,t)),u_=(e,t)=>r_(a_(e,t),s_(e,t));function c_(e,t){return Yw=e,t?(Zw=t*Kx,Qw=t_=Math.cos(Zw),Kw=Math.sin(Zw),e_=-Kw):(Qw=t_=1,Zw=Kw=e_=0),f_}const f_={beginPath(){},closePath(){},moveTo:u_,lineTo:u_,rect(e,t,n,r){Zw?(l_(e+n,t),l_(e+n,t+r),l_(e,t+r),u_(e,t)):(n_(e+n,t+r),r_(e,t))},quadraticCurveTo(e,t,n,r){const i=a_(e,t),o=s_(e,t),a=a_(n,r),s=s_(n,r);d_(Xw,i,a,i_),d_(Jw,o,s,o_),r_(a,s)},bezierCurveTo(e,t,n,r,i,o){const a=a_(e,t),s=s_(e,t),l=a_(n,r),u=s_(n,r),c=a_(i,o),f=s_(i,o);h_(Xw,a,l,c,i_),h_(Jw,s,u,f,o_),r_(c,f)},arc(e,t,n,r,i,o){if(r+=Zw,i+=Zw,Xw=n*Math.cos(i)+e,Jw=n*Math.sin(i)+t,Math.abs(i-r)>Vw)n_(e-n,t-n),n_(e+n,t+n);else{const a=r=>n_(n*Math.cos(r)+e,n*Math.sin(r)+t);let s,l;if(a(r),a(i),i!==r)if((r%=tw)<0&&(r+=tw),(i%=tw)<0&&(i+=tw),ii;++l,s-=ew)a(s);else for(s=r-r%ew+ew,l=0;l<4&&s1e-14?(l=a*a+s*o,l>=0&&(l=Math.sqrt(l),u=(-a+l)/o,c=(-a-l)/o)):u=.5*s/a,0g)return!1;h>m&&(m=h)}else if(f>0){if(h0&&(e.globalAlpha=n,e.fillStyle=C_(e,t,t.fill),!0)}var A_=[];function D_(e,t,n){var r=null!=(r=t.strokeWidth)?r:1;return!(r<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=C_(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||A_),e.lineDashOffset=t.strokeDashOffset||0),!0))}function S_(e,t){return e.zindex-t.zindex||e.index-t.index}function M_(e){if(!e.zdirty)return e.zitems;var t,n,r,i=e.items,o=[];for(n=0,r=i.length;n=0;)if(n=t(i[r]))return n;if(i===o)for(r=(i=e.items).length;--r>=0;)if(!i[r].zindex&&(n=t(i[r])))return n;return null}function N_(e){return function(t,n,r){F_(n,(n=>{r&&!r.intersects(n.bounds)||z_(e,t,n,n)}))}}function T_(e){return function(t,n,r){!n.items.length||r&&!r.intersects(n.bounds)||z_(e,t,n.items[0],n.items)}}function z_(e,t,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(e(t,r)||(__(t,n),n.fill&&E_(t,n,i)&&t.fill(),n.stroke&&D_(t,n,i)&&t.stroke()))}function R_(e){return e=e||yo,function(t,n,r,i,o,a){return r*=t.pixelRatio,i*=t.pixelRatio,O_(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,r,i,o,a)?n:void 0}))}}function L_(e,t){return function(n,r,i,o){var a,s,l=Array.isArray(r)?r[0]:r,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(a=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,r)&&(u&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function P_(e){return R_(L_(e))}function j_(e,t){return"translate("+e+","+t+")"}function B_(e){return"rotate("+e+")"}function I_(e){return j_(e.x||0,e.y||0)}function U_(e,t,n){function r(e,n){var r=n.x||0,i=n.y||0,o=n.angle||0;e.translate(r,i),o&&e.rotate(o*=Kx),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-r,-i)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return j_(e.x||0,e.y||0)+(e.angle?" "+B_(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(c_(e,n.angle),n),Gw(e,n).translate(n.x||0,n.y||0)},draw:N_(r),pick:P_(r),isect:n||y_(r)}}var q_=U_("arc",(function(e,t){return Dw.context(e)(t)}));function W_(e,t,n){function r(e,n){e.beginPath(),t(e,n)}const i=L_(r);return{type:e,tag:"path",nested:!0,attr:function(e,n){var r=n.mark.items;r.length&&e("d",t(null,r))},bound:function(e,n){var r=n.items;return 0===r.length?e:(t(c_(e),r),Gw(e,r[0]))},draw:T_(r),pick:function(e,t,n,r,o,a){var s=t.items,l=t.bounds;return!s||!s.length||l&&!l.contains(o,a)?null:(n*=e.pixelRatio,r*=e.pixelRatio,i(e,s,n,r)?s[0]:null)},isect:v_,tip:n}}var H_=W_("area",(function(e,t){const n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Mw:Sw).curve(Gx(r,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)).5&&t<1.5?.5-Math.abs(t-1):0}function Y_(e,t){const n=V_(t);e("d",Rw(null,t,n,n))}function X_(e,t,n,r){const i=V_(t);e.beginPath(),Rw(e,t,(n||0)+i,(r||0)+i)}const J_=L_(X_),Z_=L_(X_,!1),Q_=L_(X_,!0);var K_={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",I_(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let t=0;t{const i=t.x||0,o=t.y||0,a=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(X_(e,t,i,o),__(e,t),t.fill&&E_(e,t,s)&&e.fill(),t.stroke&&!a&&D_(e,t,s)&&e.stroke()),e.save(),e.translate(i,o),t.clip&&G_(e,t),n&&n.translate(-i,-o),F_(t,(t=>{("group"===t.marktype||null==r||r.includes(t.marktype))&&this.draw(e,t,n,r)})),n&&n.translate(i,o),e.restore(),a&&t.stroke&&s&&(X_(e,t,i,o),__(e,t),D_(e,t,s)&&e.stroke())}))},pick:function(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const a=n*e.pixelRatio,s=r*e.pixelRatio;return O_(t,(l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(i,o))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),m=l.clip;if(m&&(ih||op))return;if(e.save(),e.translate(c,f),c=i-c,f=o-f,m&&zw(l)&&!Q_(e,l,a,s))return e.restore(),null;const g=l.strokeForeground,y=!1!==t.interactive;return y&&g&&l.stroke&&Z_(e,l,a,s)?(e.restore(),l):(u=O_(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,r,c,f):null)),!u&&y&&(l.fill||!g&&l.stroke)&&J_(e,l,a,s)&&(u=l),e.restore(),u||null)}))},isect:b_,content:function(e,t,n){e("clip-path",t.clip?jw(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),Y_(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?Y_(e,t):e("d","")}},e$={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function t$(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function n$(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function r$(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function i$(e,t){return"center"===e?t/2:"right"===e?t:0}function o$(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var a$={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const r=t$(t,n),i=n$(t,r),o=r$(t,r),a=(t.x||0)-i$(t.align,i),s=(t.y||0)-o$(t.baseline,o);e("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",e$["xmlns:xlink"],"xlink:href"),e("transform",j_(a,s)),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,r=n$(t,n),i=r$(t,n),o=(t.x||0)-i$(t.align,r),a=(t.y||0)-o$(t.baseline,i);return e.set(o,a,o+r,a+i)},draw:function(e,t,n){F_(t,(t=>{if(n&&!n.intersects(t.bounds))return;const r=t$(t,this);let i=n$(t,r),o=r$(t,r);if(0===i||0===o)return;let a,s,l,u,c=(t.x||0)-i$(t.align,i),f=(t.y||0)-o$(t.baseline,o);!1!==t.aspect&&(s=r.width/r.height,l=t.width/t.height,s==s&&l==l&&s!==l&&(l=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(r=e[o].y-t[1])*r{if(!n||n.intersects(t.bounds)){var r=null==t.opacity?1:t.opacity;r&&d$(e,t,r)&&(__(e,t),e.stroke())}}))},pick:R_((function(e,t,n,r){return!!e.isPointInStroke&&(d$(e,t,1)&&e.isPointInStroke(n,r))})),isect:x_},p$=U_("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),m$=U_("symbol",(function(e,t){return Nw.context(e)(t)}),v_);const g$=Ea();var y$={height:$$,measureWidth:w$,estimateWidth:b$,width:b$,canvas:v$};function v$(e){y$.width=e&&m_?w$:b$}function b$(e,t){return x$(A$(e,t),$$(e))}function x$(e,t){return~~(.8*e.length*t)}function w$(e,t){return $$(e)<=0||!(t=A$(e,t))?0:_$(t,S$(e))}function _$(e,t){const n=`(${t}) ${e}`;let r=g$.get(n);return void 0===r&&(m_.font=t,r=m_.measureText(e).width,g$.set(n,r)),r}function $$(e){return null!=e.fontSize?+e.fontSize||0:11}function k$(e){return null!=e.lineHeight?e.lineHeight:$$(e)+2}function C$(e){return t=e.lineBreak&&e.text&&!Eo(e.text)?e.text.split(e.lineBreak):e.text,Eo(t)?t.length>1?t:t[0]:t;var t}function E$(e){const t=C$(e);return(Eo(t)?t.length-1:0)*k$(e)}function A$(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,r=function(e){if(y$.width===w$){const t=S$(e);return e=>_$(e,t)}if(y$.width===b$){const t=$$(e);return e=>x$(e,t)}return t=>y$.width(e,t)}(e);if(r(t)>>1,r(t.slice(i))>n?s=i+1:l=i;return o+t.slice(s)}for(;s>>1),r(t.slice(0,i))Math.max(e,y$.width(t,n))),0)):r=y$.width(t,f),"center"===o?u-=r/2:"right"===o&&(u-=r),e.set(u+=s,c+=l,u+r,c+i),t.angle&&!n)e.rotate(t.angle*Kx,s,l);else if(2===n)return e.rotatedPoints(t.angle*Kx,s,l);return e}var z$={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,r=t.dx||0,i=(t.dy||0)+M$(t),o=N$(t),a=o.x1,s=o.y1,l=t.angle||0;e("text-anchor",F$[t.align]||"start"),l?(n=j_(a,s)+" "+B_(l),(r||i)&&(n+=" "+j_(r,i))):n=j_(a+r,s+i),e("transform",n)},bound:T$,draw:function(e,t,n){F_(t,(t=>{var r,i,o,a,s,l,u,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=S$(t),e.textAlign=t.align||"left",i=(r=N$(t)).x1,o=r.y1,t.angle&&(e.save(),e.translate(i,o),e.rotate(t.angle*Kx),i=o=0),i+=t.dx||0,o+=(t.dy||0)+M$(t),l=C$(t),__(e,t),Eo(l))for(s=k$(t),a=0;a=0;)if(!1!==e[i].defined&&(n=e[i].x-t[0])*n+(r=e[i].y-t[1])*r<(n=e[i].size||1)*n)return e[i];return null})),L$={arc:q_,area:H_,group:K_,image:a$,line:s$,path:u$,rect:f$,rule:h$,shape:p$,symbol:m$,text:z$,trail:R$};function P$(e,t,n){var r=L$[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Bw),e,n)}var j$={mark:null};function B$(e,t,n){var r,i,o,a,s=L$[e.marktype],l=s.bound,u=e.items,c=u&&u.length;if(s.nested)return c?o=u[0]:(j$.mark=e,o=j$),a=P$(o,l,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new Bw,c)for(r=0,i=u.length;rt;)e.removeChild(n[--r]);return e}function Z$(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Q$(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function K$(e,t){this._active=null,this._handlers={},this._loader=e||pd(),this._tooltip=t||ek}function ek(e,t,n,r){e.element().setAttribute("title",r||"")}function tk(e){this._el=null,this._bgcolor=null,this._loader=new qw(e)}H$.prototype={toJSON(e){return U$(this.root,e||0)},mark(e,t,n){const r=G$(e,t=t||this.root.items[0]);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},K$.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),r=V$(null,"a");for(const e in t)r.setAttribute(e,t[e]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=L$[a.marktype]).tip){for((o=Q$(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,l=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,l+=e.y||0;return{x:s,y:l,width:o,height:a,left:s,top:l,right:s+o,bottom:l+a}}},tk.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n},_render(){},renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const nk="dragenter",rk="dragleave",ik="dragover",ok="pointerdown",ak="pointermove",sk="pointerout",lk="pointerover",uk="mousedown",ck="mousemove",fk="mouseout",dk="mouseover",hk="click",pk="mousewheel",mk="touchstart",gk="touchmove",yk="touchend",vk=ak,bk=sk,xk=hk;function wk(e,t){K$.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function _k(e,t){(e=>e===mk||e===gk||e===yk?[mk,gk,yk]:[e])(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function $k(e,t,n){t.forEach((t=>e.fire(t,n)))}function kk(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||$k(this,n,r),this._active=o,$k(this,t,r)),$k(this,e,r)}}function Ck(e){return function(t){$k(this,e,t),this._active=null}}ga(wk,K$,{initialize(e,t,n){return this._canvas=e&&Y$(e,"canvas"),[hk,uk,ok,ak,sk,rk].forEach((e=>_k(this,e))),K$.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",nk,rk,ik,ok,"pointerup",ak,sk,lk,uk,"mouseup",ck,fk,dk,hk,"dblclick","wheel",pk,mk,gk,yk],DOMMouseScroll(e){this.fire(pk,e)},pointermove:kk([ak,ck],[lk,dk],[sk,fk]),dragover:kk([ik],[nk],[rk]),pointerout:Ck([sk,fk]),dragleave:Ck([rk]),pointerdown(e){this._down=this._active,this.fire(ok,e)},mousedown(e){this._down=this._active,this.fire(uk,e)},click(e){this._down===this._active&&(this.fire(hk,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(mk,e,!0)},touchmove(e){this.fire(gk,e,!0)},touchend(e){this.fire(yk,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===xk&&r&&r.href?this.handleHref(t,r,r.href):e!==vk&&e!==bk||this.handleTooltip(t,r,e!==bk),i)for(let e=0,n=i.length;e=0&&r.splice(i,1),this},pickEvent(e){const t=Q$(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return L$[e.marktype].pick.call(this,o,e,t,n,r,i)}});var Ek="undefined"!=typeof window&&window.devicePixelRatio||1;function Ak(e){tk.call(this,e),this._options={},this._redraw=!1,this._dirty=new Bw,this._tempb=new Bw}const Dk=tk.prototype;function Sk(e,t){K$.call(this,e,t);const n=this;n._hrefHandler=Mk(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=Mk(n,((e,t)=>{n.handleTooltip(e,t,e.type!==bk)}))}ga(Ak,tk,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:zg(1,1,this._options.type),e&&this._canvas&&(J$(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Dk.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(Dk.resize.call(this,e,t,n,r),this._canvas)!function(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),l=a?Ek:i;e.width=t*l,e.height=n*l;for(const e in o)s[e]=o[e];a&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=l,s.setTransform(l,0,0,l,l*r[0],l*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||uo("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e,t){const n=this.context(),r=this._origin,i=this._width,o=this._height,a=this._dirty,s=((e,t,n)=>(new Bw).set(0,0,t,n).translate(-e[0],-e[1]))(r,i,o);n.save();const l=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,s.intersect(a),r);return this.clear(-r[0],-r[1],i,o),this.draw(n,e,l,t),n.restore(),a.clear(),this},draw(e,t,n,r){if("group"!==t.marktype&&null!=r&&!r.includes(t.marktype))return;const i=L$[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Ko(n)?(e.beginPath(),n(e),e.clip()):G_(e,t.group)}(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const Mk=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};ga(Sk,K$,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(xk,this._hrefHandler),r.removeEventListener(vk,this._tooltipHandler),r.removeEventListener(bk,this._tooltipHandler)),this._svg=r=e&&Y$(e,"svg"),r&&(r.addEventListener(xk,this._hrefHandler),r.addEventListener(vk,this._tooltipHandler),r.addEventListener(bk,this._tooltipHandler)),K$.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const i={type:e,handler:t,listener:Mk(this,t)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const Fk="aria-hidden",Ok="aria-label",Nk="role",Tk="aria-roledescription",zk="graphics-object",Rk="graphics-symbol",Lk=(e,t,n)=>({[Nk]:e,[Tk]:t,[Ok]:n||void 0}),Pk=Ra(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),jk={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,r=t.title?Wk(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type,l="left"===n||"right"===n?"Y":"X";return`${l}-axis`+(r?` titled '${r}'`:"")+` for a ${nx(s)?"discrete":s} scale`+` with ${Px(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Wk(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,l=a.dataflow.locale();return u=r,(u.length?u[0].toUpperCase()+u.slice(1):u)+(n?` titled '${n}'`:"")+` for ${function(e){return e=e.map((e=>e+("fill"===e||"stroke"===e?" color":""))),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Oo(e)}(o)}`+` with ${Px(l,s,e)}`;var u}},"title-text":{desc:"title",caption:e=>`Title text '${qk(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${qk(e)}'`}},Bk={ariaRole:Nk,ariaRoleDescription:Tk,description:Ok};function Ik(e,t){const n=!1===t.aria;if(e(Fk,n||void 0),n||null==t.description)for(const t in Bk)e(Bk[t],void 0);else{const n=t.mark.marktype;e(Ok,t.description),e(Nk,t.ariaRole||("group"===n?zk:Rk)),e(Tk,t.ariaRoleDescription||`${n} mark`)}}function Uk(e){return!1===e.aria?{[Fk]:!0}:Pk[e.role]?null:jk[e.role]?function(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return Lk(t.role||Rk,t.desc,n.description||r(n))}catch(e){return null}}(e,jk[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return Lk(n?zk:Rk,`${t} mark container`,e.description)}(e)}function qk(e){return Zo(e.text).join(" ")}function Wk(e){try{return Zo(Oo(e.items).items[0].text).join(" ")}catch(e){return null}}const Hk=e=>(e+"").replace(/&/g,"&").replace(//g,">");function Gk(){let e="",t="",n="";const r=[],i=()=>t=n="",o=(e,n)=>{var r;return null!=n&&(t+=` ${e}="${r=n,Hk(r).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ")}"`),a},a={open(s){(o=>{t&&(e+=`${t}>${n}`,i()),r.push(o)})(s),t="<"+s;for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c${n}`:"/>"):``,i(),a},attr:o,text:e=>(n+=Hk(e),a),toString:()=>e};return a}const Vk=e=>Yk(Gk(),e)+"";function Yk(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let t=0;t1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}ga(eC,tk,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=X$(e,0,"svg",Kk),this._svg.setAttributeNS(Qk,"xmlns",Kk),this._svg.setAttributeNS(Qk,"xmlns:xlink",e$["xmlns:xlink"]),this._svg.setAttribute("version",e$.version),this._svg.setAttribute("class","marks"),J$(e,1),this._root=X$(this._svg,0,"g",Kk),fC(this._root,Zk),J$(this._svg,1)),this.background(this._bgcolor),tC.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),tC.background.apply(this,arguments)},resize(e,t,n,r){return tC.resize.call(this,e,t,n,r),this._svg&&(fC(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=X$(e,0,"rect",Kk),fC(n,{width:this._width,height:this._height,fill:t}));const r=Vk(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),r},_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),J$(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,r,i,o,a,s,l;for(a=0,s=e.length;a{e.dirty=t}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,nC(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n,r){if(!this.isDirty(t))return t._svg;const i=this._svg,o=t.marktype,a=L$[o],s=!1===t.interactive?"none":null,l="g"===a.tag,u=oC(t,e,n,"g",i);if("group"!==o&&null!=r&&!r.includes(o))return J$(u,0),t._svg;u.setAttribute("class",Z$(t));const c=Uk(t);for(const e in c)dC(u,e,c[e]);l||dC(u,"pointer-events",s),dC(u,"clip-path",t.clip?jw(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=oC(e,u,f,a.tag,i);t&&(this._update(a,n,e),l&&function(e,t,n,r){t=t.lastChild.previousSibling;let i,o=0;F_(n,(n=>{i=e.mark(t,n,i,r),++o})),J$(t,1+o)}(this,n,e,r)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):F_(t,h),J$(u,d),u},_update(e,t,n){aC=t,sC=t.__values__,Ik(uC,n),e.attr(uC,n,this);const r=lC[e.type];r&&r.call(this,e,t,n),aC&&this.style(aC,n)},style(e,t){if(null!=t){for(const n in Xk){let r="font"===n?D$(t):t[n];if(r===sC[n])continue;const i=Xk[n];null==r?e.removeAttribute(i):(Ix(r)&&(r=Ux(r,this._defs.gradient,hC())),e.setAttribute(i,r+"")),sC[n]=r}for(const n in Jk)cC(e,Jk[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=X$(e,1,"defs",Kk)),r=rC(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=X$(e,1,"defs",Kk)),r=iC(n,t.clipping[i],r);n&&(0===r?(e.removeChild(n),t.el=null):J$(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let aC=null,sC=null;const lC={group(e,t,n){const r=aC=t.childNodes[2];sC=r.__values__,e.foreground(uC,n,this),sC=t.__values__,aC=t.childNodes[1],e.content(uC,n,this);const i=aC=t.childNodes[0];e.background(uC,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==sC.events&&(dC(r,"pointer-events",o),dC(i,"pointer-events",o),sC.events=o),n.strokeForeground&&n.stroke){const e=n.fill;dC(r,"display",null),this.style(i,n),dC(i,"stroke",null),e&&(n.fill=null),sC=r.__values__,this.style(r,n),e&&(n.fill=e),aC=null}else dC(r,"display","none")},image(e,t,n){!1===n.smooth?(cC(t,"image-rendering","optimizeSpeed"),cC(t,"image-rendering","pixelated")):cC(t,"image-rendering",null)},text(e,t,n){const r=C$(n);let i,o,a,s;Eo(r)?(o=r.map((e=>A$(n,e))),i=o.join("\n"),i!==sC.text&&(J$(t,0),a=t.ownerDocument,s=k$(n),o.forEach(((e,r)=>{const i=V$(a,"tspan",Kk);i.__data__=n,i.textContent=e,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),t.appendChild(i)})),sC.text=i)):(o=A$(n,r),o!==sC.text&&(t.textContent=o,sC.text=o)),dC(t,"font-family",D$(n)),dC(t,"font-size",$$(n)+"px"),dC(t,"font-style",n.fontStyle),dC(t,"font-variant",n.fontVariant),dC(t,"font-weight",n.fontWeight)}};function uC(e,t,n){t!==sC[e]&&(n?function(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(aC,e,t,n):dC(aC,e,t),sC[e]=t)}function cC(e,t,n){n!==sC[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),sC[t]=n)}function fC(e,t){for(const n in t)dC(e,n,t[n])}function dC(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function hC(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function pC(e){tk.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}ga(pC,tk,{svg(){return this._text},_render(e){const t=Gk();t.open("svg",la({},e$,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",Zk,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=L$[t.marktype],r=n.tag,i=[Ik,n.attr];e.open("g",{class:Z$(t),"clip-path":t.clip?jw(this,t,t.group):null},Uk(t),{"pointer-events":"g"!==r&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(r,this.attr(t,o,i,"g"!==r?r:null)),"text"===r){const t=C$(o);if(Eo(t)){const n={x:0,dy:k$(o)};for(let r=0;rthis.mark(e,t))),e.close(),r&&a?(i&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):F_(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),r&&function(e,t,n,r,i){let o;if(null==t)return e;"bgrect"===r&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===r&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===r&&(e["font-family"]=D$(t),e["font-size"]=$$(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in Xk){let r=t[n];const o=Xk[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(Ix(r)&&(r=Ux(r,i.gradient,"")),e[o]=r)}for(const e in Jk){const n=t[e];null!=n&&(o=o||[],o.push(`${Jk[e]}: ${n};`))}o&&(e.style=o.join(" "))}(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const r=t[n],i=r.stops;"radial"===r.gradient?(e.open("pattern",{id:Bx+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):e.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let t=0;t!mC.svgMarkTypes.includes(e)));this._svgRenderer.render(e,mC.svgMarkTypes),this._canvasRenderer.render(e,n)},resize(e,t,n,r){return yC.resize.call(this,e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this},background(e){return mC.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}),ga(vC,wk,{initialize(e,t,n){const r=X$(X$(e,0,"div"),mC.svgOnTop?0:1,"div");return wk.prototype.initialize.call(this,r,t,n)}});const bC="canvas",xC="hybrid",wC="none",_C={Canvas:bC,PNG:"png",SVG:"svg",Hybrid:xC,None:wC},$C={};function kC(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?($C[e]=t,this):$C[e]}function CC(e,t,n){const r=[],i=(new Bw).union(t),o=e.marktype;return o?EC(e,i,n,r):"group"===o?AC(e,i,n,r):uo("Intersect scene must be mark node or group item.")}function EC(e,t,n,r){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const i=e.items,o=e.marktype,a=i.length;let s=0;if("group"===o)for(;s=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!OC(e[n=i[r]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function NC(e,t){return OC(Qx(e),Qx(t))}const TC="top",zC="left",RC="right",LC="bottom",PC="top-left",jC="top-right",BC="bottom-left",IC="bottom-right",UC="start",qC="middle",WC="end",HC="x",GC="y",VC="group",YC="axis",XC="title",JC="frame",ZC="scope",QC="legend",KC="row-header",eE="row-footer",tE="row-title",nE="column-header",rE="column-footer",iE="column-title",oE="padding",aE="symbol",sE="fit",lE="fit-x",uE="fit-y",cE="pad",fE="none",dE="all",hE="each",pE="flush",mE="column",gE="row";function yE(e){Kd.call(this,null,e)}function vE(e,t,n){return t(e.bounds.clear(),e,n)}ga(yE,Kd,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=L$[i],a=o.bound;let s,l=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),l=vE(r,a),r.items.forEach((e=>{e.bounds.clear().union(l)}));else if(i===VC||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),l.clear(),r.items.forEach((e=>l.union(vE(e,a)))),r.role){case YC:case QC:case XC:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{l.union(vE(e,a))})),t.visit(t.MOD,(e=>{s=s||l.alignsWith(e.bounds),n.dirty(e),l.union(vE(e,a))})),s&&(l.clear(),r.items.forEach((e=>l.union(e.bounds))));return MC(r),t.modifies("bounds")}});const bE=":vega_identifier:";function xE(e){Kd.call(this,0,e)}function wE(e){Kd.call(this,null,e)}function _E(e){Kd.call(this,null,e)}xE.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ga(xE,Kd,{transform(e,t){const n=(i=t.dataflow)._signals[bE]||(i._signals[bE]=i.add(0)),r=e.as;var i;let o=n.value;return t.visit(t.ADD,(e=>e[r]=e[r]||++o)),n.set(this.value=o),t}}),ga(wE,Kd,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===VC?Uw:Iw;return t.visit(t.ADD,(e=>r.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const $E={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,r)=>r&&kE(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},kE=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),CE=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return t.width()>1&&t.height()>1},AE=e=>(e.forEach((e=>e.opacity=1)),e),DE=(e,t)=>e.reflow(t.modified()).modifies("opacity");function SE(e){Kd.call(this,null,e)}ga(_E,Kd,{transform(e,t){const n=$E[e.method]||$E.parity,r=e.separation||0;let i,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(AE(a),t=DE(t,e)),t;if(a=a.filter(EE),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),i=AE(a),t=DE(t,e),i.length>=3&&CE(i,r)){do{i=n(i,r)}while(i.length>=3&&CE(i,r));i.length<3&&!Oo(a).opacity&&(i.length>1&&(Oo(i).opacity=0),Oo(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var r=e.range(),i=new Bw;return t===TC||t===LC?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),e=>i.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),ga(SE,Kd,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const ME=new Bw;function FE(e,t,n){return e[t]===n?0:(e[t]=n,1)}function OE(e){var t=e.items[0].orient;return t===zC||t===RC}function NE(e,t,n,r){var i,o,a=t.items[0],s=a.datum,l=null!=a.translate?a.translate:.5,u=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=g&&E$(g),x=0,w=0;switch(ME.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),u){case TC:x=h||0,w=-d,o=Math.max(p,Math.min(m,-v.y1)),v.add(0,-o).add(f,0),g&&TE(e,g,o,y,b,0,-1,v);break;case zC:x=-d,w=h||0,o=Math.max(p,Math.min(m,-v.x1)),v.add(-o,0).add(0,f),g&&TE(e,g,o,y,b,1,-1,v);break;case RC:x=n+d,w=h||0,o=Math.max(p,Math.min(m,v.x2)),v.add(0,0).add(o,f),g&&TE(e,g,o,y,b,1,1,v);break;case LC:x=h||0,w=r+d,o=Math.max(p,Math.min(m,v.y2)),v.add(0,0).add(f,o),g&&TE(e,g,o,y,0,0,1,v);break;default:x=a.x,w=a.y}return Gw(v.translate(x,w),a),FE(a,"x",x+l)|FE(a,"y",w+l)&&(a.bounds=ME,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function TE(e,t,n,r,i,o,a,s){const l=t.bounds;if(t.auto){const s=a*(n+i+r);let u=0,c=0;e.dirty(t),o?u=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(l.translate(-u,-c)),e.dirty(t)}s.union(l)}const zE=(e,t)=>Math.floor(Math.min(e,t)),RE=(e,t)=>Math.ceil(Math.max(e,t));function LE(e){return(new Bw).set(0,0,e.width||0,e.height||0)}function PE(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function jE(e,t,n){const r=Ao(e)?e[t]:e;return null!=r?r:void 0!==n?n:0}function BE(e){return e<0?Math.ceil(-e):0}function IE(e,t,n){var r,i,o,a,s,l,u,c,f,d,h,p=!n.nodirty,m=n.bounds===pE?LE:PE,g=ME.set(0,0,0,0),y=jE(n.align,mE),v=jE(n.align,gE),b=jE(n.padding,mE),x=jE(n.padding,gE),w=n.columns||t.length,_=w<=0?1:Math.ceil(t.length/w),$=t.length,k=Array($),C=Array(w),E=0,A=Array($),D=Array(_),S=0,M=Array($),F=Array($),O=Array($);for(i=0;i1)for(i=0;i<$;++i)(f=(s=y===dE?E:C[i%w])-O[i].x2-t[i].x-M[i])>0&&(M[i]+=f/2);if(v&&jE(n.center,gE)&&1!==w)for(i=0;i<$;++i)(d=(s=v===dE?S:D[~~(i/w)])-O[i].y2-t[i].y-F[i])>0&&(F[i]+=d/2);for(i=0;i<$;++i)g.union(O[i].translate(M[i],F[i]));switch(f=jE(n.anchor,HC),d=jE(n.anchor,GC),jE(n.anchor,mE)){case WC:f-=g.width();break;case qC:f-=g.width()/2}switch(jE(n.anchor,gE)){case WC:d-=g.height();break;case qC:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),i=0;i<$;++i)t[i].mark.bounds.clear();for(i=0;i<$;++i)(l=t[i]).x+=M[i]+=f,l.y+=F[i]+=d,g.union(l.mark.bounds.union(l.bounds.translate(M[i],F[i]))),p&&e.dirty(l);return g}function UE(e,t,n){var r,i,o,a,s,l,u,c=function(e){var t,n,r=e.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;oi&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),k+=o,m=0,y=t.length;m=0&&null==(x=n[g]);g-=d);s?(w=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),_=k):(w=k,_=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(w-(b.x||0),_-(b.y||0))),b.x=w,b.y=_,e.dirty(b),C=a(C,v[u])}return C}function GE(e,t,n,r,i,o){if(t){e.dirty(t);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function VE(e,t,n,r,i,o,a){const s=function(e,t){const n=e[t]||{};return(t,r)=>null!=n[t]?n[t]:null!=e[t]?e[t]:r}(n,t),l=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),u=s("anchor",UC),c=u===WC?1:u===qC?.5:0,f={align:hE,bounds:s("bounds",pE),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case zC:f.anchor={x:Math.floor(r.x1)-l,column:WC,y:c*(a||r.height()+2*r.y1),row:u};break;case RC:f.anchor={x:Math.ceil(r.x2)+l,y:c*(a||r.height()+2*r.y1),row:u};break;case TC:f.anchor={y:Math.floor(i.y1)-l,row:WC,x:c*(o||i.width()+2*i.x1),column:u};break;case LC:f.anchor={y:Math.ceil(i.y2)+l,x:c*(o||i.width()+2*i.x1),column:u};break;case PC:f.anchor={x:l,y:l};break;case jC:f.anchor={x:o-l,y:l,column:WC};break;case BC:f.anchor={x:l,y:a-l,row:WC};break;case IC:f.anchor={x:o-l,y:a-l,column:WC,row:WC}}return f}function YE(e,t){var n,r,i=t.items[0],o=i.datum,a=i.orient,s=i.bounds,l=i.x,u=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,l=t.titlePadding||0,u=r-a.x,c=r-a.y;switch(a.orient){case zC:i+=Math.ceil(a.bounds.width())+l;break;case RC:case LC:break;default:o+=a.bounds.height()+l}switch((i||o)&&JE(e,n,i,o),a.orient){case zC:c+=XE(t,n,a,s,1,1);break;case RC:u+=XE(t,n,a,WC,0,0)+l,c+=XE(t,n,a,s,1,1);break;case LC:u+=XE(t,n,a,s,0,0),c+=XE(t,n,a,WC,-1,0,1)+l;break;default:u+=XE(t,n,a,s,0,0)}(u||c)&&JE(e,a,u,c),(u=Math.round(a.bounds.x1-r))<0&&(JE(e,n,-u,0),JE(e,a,-u,0))}else(i||o)&&JE(e,n,i,o)}(e,i,i.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),o.type===aE&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),a!==fE&&(i.x=l=0,i.y=u=0),i.width=n,i.height=r,Gw(s.set(l,u,l+n,u+r),i),i.mark.bounds.clear().union(s),i}function XE(e,t,n,r,i,o,a){const s="symbol"!==e.datum.type,l=n.datum.vgrad,u=(!s||!o&&l||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,c=l&&o?u:0,f=l&&o?0:u,d=i<=0?0:E$(n);return Math.round(r===UC?c:r===WC?f-d:.5*(u-d))}function JE(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function ZE(e){Kd.call(this,null,e)}ga(ZE,Kd,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&UE(n,t,e.layout),function(e,t,n){var r,i,o,a,s,l=t.items,u=Math.max(0,t.width||0),c=Math.max(0,t.height||0),f=(new Bw).set(0,0,u,c),d=f.clone(),h=f.clone(),p=[];for(a=0,s=l.length;a{(o=e.orient||RC)!==fE&&(t[o]||(t[o]=[])).push(e)}));for(const r in t){const i=t[r];IE(e,i,VE(i,r,n.legends,d,h,u,c))}p.forEach((t=>{const r=t.bounds;if(r.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=r,e.dirty(t)),!n.autosize||n.autosize.type!==sE&&n.autosize.type!==lE&&n.autosize.type!==uE)f.union(r);else switch(t.orient){case zC:case RC:f.add(r.x1,0).add(r.x2,0);break;case TC:case LC:f.add(0,r.y1).add(0,r.y2)}}))}f.union(d).union(h),r&&f.union(function(e,t,n,r,i){var o,a=t.items[0],s=a.frame,l=a.orient,u=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=l===zC||l===RC?r:n,m=0,g=0,y=0,v=0,b=0;if(s!==VC?l===zC?(m=i.y2,p=i.y1):l===RC?(m=i.y1,p=i.y2):(m=i.x1,p=i.x2):l===zC&&(m=r,p=0),o=u===UC?m:u===WC?p:(m+p)/2,h&&h.text){switch(l){case TC:case LC:b=d.bounds.height()+f;break;case zC:v=d.bounds.width()+f;break;case RC:v=-d.bounds.width()-f}ME.clear().union(h.bounds),ME.translate(v-(h.x||0),b-(h.y||0)),FE(h,"x",v)|FE(h,"y",b)&&(e.dirty(h),h.bounds.clear().union(ME),h.mark.bounds.clear().union(ME),e.dirty(h)),ME.clear().union(h.bounds)}else ME.clear();switch(ME.union(d.bounds),l){case TC:g=o,y=i.y1-ME.height()-c;break;case zC:g=i.x1-ME.width()-c,y=o;break;case RC:g=i.x2+ME.width()+c,y=o;break;case LC:g=o,y=i.y2+c;break;default:g=a.x,y=a.y}return FE(a,"x",g)|FE(a,"y",y)&&(ME.translate(g,y),e.dirty(a),a.bounds.clear().union(ME),t.bounds.clear().union(ME),e.dirty(a)),a.bounds}(e,r,u,c,f));t.clip&&f.set(0,0,t.width||0,t.height||0);!function(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(i.contains===oE){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===fE?(u=0,f=0,l=a,c=s):o===sE?(l=Math.max(0,a-u-d),c=Math.max(0,s-f-h)):o===lE?(l=Math.max(0,a-u-d),s=c+f+h):o===uE?(a=l+u+d,c=Math.max(0,s-f-h)):o===cE&&(a=l+u+d,s=c+f+h);e._resizeView(a,s,l,c,[u,f],i.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}});var QE=Object.freeze({__proto__:null,bound:yE,identifier:xE,mark:wE,overlap:_E,render:SE,viewlayout:ZE});function KE(e){Kd.call(this,null,e)}function eA(e){Kd.call(this,null,e)}function tA(){return _d({})}function nA(e){Kd.call(this,null,e)}function rA(e){Kd.call(this,[],e)}ga(KE,Kd,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,a=_x(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||Cx(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$x(o,e.values,a):kx(o,a);return i&&(r.rem=i),i=l.map(((e,t)=>_d({index:t/(l.length-1||1),value:e,label:s(e)}))),e.extra&&i.length&&i.push(_d({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),ga(eA,Kd,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||tA,o=e.key||xd,a=this.value;return Eo(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&uo("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=pa().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),ga(nA,Kd,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(Eo(o)){if(!n.changed()&&!o.every((e=>i[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||vo,l=i.enter||vo,u=i.exit||vo,c=(o&&!a?i[o]:s)||vo;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{l(t,e),s(t,e)})),n.modifies(l.output),n.modifies(s.output),c!==vo&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&u!==vo&&(t.visit(t.REM,(t=>{u(t,e)})),n.modifies(u.output)),a||c!==vo){const i=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(i,(t=>{const i=l(t,e)||r;(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(l.output)):t.visit(i,(t=>{(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),ga(rA,Kd,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,r,i,o,a,s=t.dataflow.locale(),l=t.fork(t.NO_SOURCE|t.NO_FIELDS),u=this.value,c=e.type||yx,f=e.scale,d=+e.limit,h=_x(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===yx,m=e.format||Fx(s,f,h,c,e.formatSpecifier,e.formatType,p),g=e.values||Sx(f,h);return u&&(l.rem=u),c===yx?(d&&g.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),u=g.slice(0,d-1),a=!0):u=g,Ko(i=e.size)?(e.values||0!==f(u[0])||(u=u.slice(1)),o=u.reduce(((t,n)=>Math.max(t,i(n,e))),0)):i=aa(o=i||8),u=u.map(((t,n)=>_d({index:n,label:m(t,n,u),value:t,offset:o,size:i(t,e)}))),a&&(a=g[u.length],u.push(_d({index:u.length,label:`…${g.length-u.length} entries`,value:a,offset:o,size:i(a,e)})))):"gradient"===c?(n=f.domain(),r=fx(f,n[0],Oo(n)),g.length<3&&!e.values&&n[0]!==Oo(n)&&(g=[n[0],Oo(n)]),u=g.map(((e,t)=>_d({index:t,label:m(e,t,g),value:e,perc:r(e)})))):(i=g.length-1,r=function(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+Oo(t),o=i-r;if(e.type===zb){const e=n?o/n:.1;r-=e,i+=e,o=i-r}return e=>(e-r)/o}(f),u=g.map(((e,t)=>_d({index:t,label:m(e,t,g),value:e,perc:t?r(e):0,perc2:t===i?1:r(g[t+1])})))),l.source=u,l.add=u,this.value=u,l}});const iA=e=>e.source.x,oA=e=>e.source.y,aA=e=>e.target.x,sA=e=>e.target.y;function lA(e){Kd.call(this,{},e)}lA.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},ga(lA,Kd,{transform(e,t){var n=e.sourceX||iA,r=e.sourceY||oA,i=e.targetX||aA,o=e.targetY||sA,a=e.as||"path",s=e.orient||"vertical",l=e.shape||"line",u=dA.get(l+"-"+s)||dA.get(l);return u||uo("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=u(n(e),r(e),i(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const uA=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,cA=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.hypot(i,o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},fA=(e,t,n,r)=>{const i=n-e,o=r-t,a=.2*(i+o),s=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},dA=pa({line:uA,"line-radial":(e,t,n,r)=>uA(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:cA,"arc-radial":(e,t,n,r)=>cA(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:fA,"curve-radial":(e,t,n,r)=>fA(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+r*a+","+r*s},"diagonal-horizontal":(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*a+","+l*s+" "+r*a+","+r*s}});function hA(e){Kd.call(this,null,e)}hA.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},ga(hA,Kd,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],l=e.field||go,u=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(l),h=d.length,p=u,m=(c-u)/zs(d),g=Ts(h);for(e.sort&&g.sort(((e,t)=>d[e]-d[t])),n=0;ne+(t<0?-1:t>0?1:0)),0))!==t.length&&n.warn("Log scale domain includes zero: "+Fa(t)));return t}function bA(e,t,n){return Ko(e)&&(t||n)?lx(e,xA(t||[0,1],n)):e}function xA(e,t){return t?e.slice().reverse():e}function wA(e){Kd.call(this,null,e)}ga(yA,Kd,{transform(e,t){var n=t.dataflow,r=this.value,i=function(e){var t,n=e.type,r="";if(n===Fb)return Fb+"-"+kb;(function(e){const t=e.type;return tx(t)&&t!==Sb&&t!==Mb&&(e.scheme||e.range&&e.range.length&&e.range.every($a))})(e)&&(r=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?Fb+"-":3===t?Ob+"-":"");return(r+n||kb).toLowerCase()}(e);for(i in r&&i===r.type||(this.value=r=Qb(i)()),e)if(!gA[i]){if("padding"===i&&mA(r.type))continue;Ko(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return function(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==Pb&&e!==Lb&&uo("Only band and point scales support rangeStep.");var r=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===Lb?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*$b(n,i,r)]}(r,t,n);else if(t.scheme&&(o=function(e,t,n){var r,i=t.schemeExtent;Eo(t.scheme)?r=ux(t.scheme,t.interpolate,t.interpolateGamma):(r=gx(t.scheme.toLowerCase()))||uo(`Unrecognized scheme name: ${t.scheme}`);return n=e===zb?n+1:e===jb?n-1:e===Nb||e===Tb?+t.schemeCount||pA:n,ox(e)?bA(r,i,t.reverse):Ko(r)?cx(bA(r,i),n):e===Rb?r:r.slice(0,n)}(r,t,n),Ko(o))){if(e.interpolator)return e.interpolator(o);uo(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&ox(r))return e.interpolator(ux(xA(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(dx(t.interpolate,t.interpolateGamma)):Ko(e.round)?e.round(i):Ko(e.rangeRound)&&e.interpolate(i?xv:bv);o&&e.range(xA(o,t.reverse))}(r,e,function(e,t,n){let r=t.bins;if(r&&!Eo(r)){const t=e.domain(),n=t[0],i=Oo(t),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||uo("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=Ts(a,s+o/2,o)}r?e.bins=r:e.bins&&delete e.bins;e.type===jb&&(r?t.domain||t.domainRaw||(e.domain(r),n=r.length):e.bins=e.domain());return n}(r,e,function(e,t,n){const r=function(e,t,n){return t?(e.domain(vA(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(r>-1)return r;var i,o,a=t.domain,s=e.type,l=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===kb||t===Eb||t===Ab)}(e);if(!a)return 0;mA(s)&&t.padding&&a[0]!==Oo(a)&&(a=function(e,t,n,r,i,o){var a=Math.abs(Oo(n)-n[0]),s=a/(a-2*r),l=e===Cb?Go(t,null,s):e===Ab?Vo(t,null,s,.5):e===Eb?Vo(t,null,s,i||1):e===Db?Yo(t,null,s,o||1):Ho(t,null,s);return t=t.slice(),t[0]=l[0],t[t.length-1]=l[1],t}(s,a,t.range,t.padding,t.exponent,t.constant));if((l||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(a=a.slice()).length-1||1,l&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[i]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[i]?i+1:oe(l);if(null==t)h.push(e.slice());else for(i={},o=0,a=e.length;od&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,u,c),r=0,i=n.length,o=n.max;r0?1:e<0?-1:0},JA=Math.sqrt,ZA=Math.tan;function QA(e){return e>1?0:e<-1?NA:Math.acos(e)}function KA(e){return e>1?TA:e<-1?-TA:Math.asin(e)}function eD(){}function tD(e,t){e&&rD.hasOwnProperty(e.type)&&rD[e.type](e,t)}var nD={Feature:function(e,t){tD(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=UA(t=(t*=PA)/2+zA),a=YA(t),s=fD*a,l=cD*o+s*UA(i),u=s*r*YA(i);$D.add(IA(u,l)),uD=e,cD=o,fD=a}function MD(e){return[IA(e[1],e[0]),KA(e[2])]}function FD(e){var t=e[0],n=e[1],r=UA(n);return[r*UA(t),r*YA(t),YA(n)]}function OD(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ND(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function TD(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function zD(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function RD(e){var t=JA(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var LD,PD,jD,BD,ID,UD,qD,WD,HD,GD,VD,YD,XD,JD,ZD,QD,KD={point:eS,lineStart:nS,lineEnd:rS,polygonStart:function(){KD.point=iS,KD.lineStart=oS,KD.lineEnd=aS,xD=new fs,CD.polygonStart()},polygonEnd:function(){CD.polygonEnd(),KD.point=eS,KD.lineStart=nS,KD.lineEnd=rS,$D<0?(dD=-(pD=180),hD=-(mD=90)):xD>FA?mD=90:xD<-FA&&(hD=-90),_D[0]=dD,_D[1]=pD},sphere:function(){dD=-(pD=180),hD=-(mD=90)}};function eS(e,t){wD.push(_D=[dD=e,pD=e]),tmD&&(mD=t)}function tS(e,t){var n=FD([e*PA,t*PA]);if(bD){var r=ND(bD,n),i=ND([r[1],-r[0],0],r);RD(i),i=MD(i);var o,a=e-gD,s=a>0?1:-1,l=i[0]*LA*s,u=jA(a)>180;u^(s*gDmD&&(mD=o):u^(s*gD<(l=(l+360)%360-180)&&lmD&&(mD=t)),u?esS(dD,pD)&&(pD=e):sS(e,pD)>sS(dD,pD)&&(dD=e):pD>=dD?(epD&&(pD=e)):e>gD?sS(dD,e)>sS(dD,pD)&&(pD=e):sS(e,pD)>sS(dD,pD)&&(dD=e)}else wD.push(_D=[dD=e,pD=e]);tmD&&(mD=t),bD=n,gD=e}function nS(){KD.point=tS}function rS(){_D[0]=dD,_D[1]=pD,KD.point=eS,bD=null}function iS(e,t){if(bD){var n=e-gD;xD.add(jA(n)>180?n+(n>0?360:-360):n)}else yD=e,vD=t;CD.point(e,t),tS(e,t)}function oS(){CD.lineStart()}function aS(){iS(yD,vD),CD.lineEnd(),jA(xD)>FA&&(dD=-(pD=180)),_D[0]=dD,_D[1]=pD,bD=null}function sS(e,t){return(t-=e)<0?t+360:t}function lS(e,t){return e[0]-t[0]}function uS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tNA&&(e-=Math.round(e/RA)*RA),[e,t]}function $S(e,t,n){return(e%=RA)?t||n?wS(CS(e),ES(t,n)):CS(e):t||n?ES(t,n):_S}function kS(e){return function(t,n){return jA(t+=e)>NA&&(t-=Math.round(t/RA)*RA),[t,n]}}function CS(e){var t=kS(e);return t.invert=kS(-e),t}function ES(e,t){var n=UA(e),r=YA(e),i=UA(t),o=YA(t);function a(e,t){var a=UA(t),s=UA(e)*a,l=YA(e)*a,u=YA(t),c=u*n+s*r;return[IA(l*i-c*o,s*n-u*r),KA(c*i+l*o)]}return a.invert=function(e,t){var a=UA(t),s=UA(e)*a,l=YA(e)*a,u=YA(t),c=u*i-l*o;return[IA(l*i+u*o,s*n+c*r),KA(c*n-s*r)]},a}function AS(e,t){(t=FD(t))[0]-=e,RD(t);var n=QA(-t[1]);return((-t[2]<0?-n:n)+RA-FA)%RA}function DS(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:eD,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function SS(e,t){return jA(e[0]-t[0])=0;--o)i.point((c=u[o])[0],c[1]);else r(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function OS(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,E=C*k,A=E>NA,D=g*_;if(l.add(IA(D*C*YA(E),y*$+D*UA(E))),a+=A?k+C*RA:k,A^p>=n^x>=n){var S=ND(FD(h),FD(b));RD(S);var M=ND(o,S);RD(M);var F=(A^k>=0?-1:1)*KA(M[2]);(r>F||r===F&&(S[0]||S[1]))&&(s+=A^k>=0?1:-1)}}return(a<-FA||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e1&&2&l&&d.push(d.pop().concat(d.shift())),a.push(d.filter(zS))}return d}}function zS(e){return e.length>1}function RS(e,t){return((e=e.x)[0]<0?e[1]-TA-FA:TA-e[1])-((t=t.x)[0]<0?t[1]-TA-FA:TA-t[1])}_S.invert=_S;var LS=TS((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?NA:-NA,l=jA(o-n);jA(l-NA)0?TA:-TA),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=NA&&(jA(n-i)FA?BA((YA(t)*(o=UA(r))*YA(n)-YA(r)*(i=UA(t))*YA(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*TA,r.point(-NA,i),r.point(0,i),r.point(NA,i),r.point(NA,0),r.point(NA,-i),r.point(0,-i),r.point(-NA,-i),r.point(-NA,0),r.point(-NA,i);else if(jA(e[0]-t[0])>FA){var o=e[0]0,i=jA(t)>FA;function o(e,n){return UA(e)*UA(n)>t}function a(e,n,r){var i=[1,0,0],o=ND(FD(e),FD(n)),a=OD(o,o),s=o[0],l=a-s*s;if(!l)return!r&&e;var u=t*a/l,c=-t*s/l,f=ND(i,o),d=zD(i,u);TD(d,zD(o,c));var h=f,p=OD(d,h),m=OD(h,h),g=p*p-m*(OD(d,d)-1);if(!(g<0)){var y=JA(g),v=zD(h,(-p-y)/m);if(TD(v,d),v=MD(v),!r)return v;var b,x=e[0],w=n[0],_=e[1],$=n[1];w0^v[1]<(jA(v[0]-x)NA^(x<=v[0]&&v[0]<=w)){var E=zD(h,(-p+y)/m);return TD(E,d),[v,MD(E)]}}}function s(t,n){var i=r?e:NA-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return TS(o,(function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=r?m?0:s(f,d):m?s(f+(f<0?NA:-NA),d):0;if(!t&&(u=l=m)&&e.lineStart(),m!==l&&(!(h=a(t,p))||SS(t,h)||SS(p,h))&&(p[2]=1),m!==l)c=0,m?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(i&&t&&r^m){var y;g&n||!(y=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||t&&SS(t,p)||e.point(p[0],p[1]),t=p,l=m,n=g},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=UA(t),s=YA(t),l=r*n;null==i?(i=t+r*RA,o=t-l/2):(i=AS(a,i),o=AS(a,o),(r>0?io)&&(i+=r*RA));for(var u,c=i;r>0?c>o:c0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==f);else u.point(o[0],o[1])}function a(r,i){return jA(r[0]-e)0?0:3:jA(r[0]-n)0?2:1:jA(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,f,d,h,p,m,g,y,v,b=a,x=DS(),w={point:_,lineStart:function(){w.point=$,u&&u.push(c=[]);y=!0,g=!1,p=m=NaN},lineEnd:function(){l&&($(f,d),h&&g&&x.rejoin(),l.push(x.result()));w.point=_,g&&b.lineEnd()},polygonStart:function(){b=x,l=[],u=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=u.length;nr&&(d-o)*(r-a)>(h-a)*(e-o)&&++t:h<=r&&(d-o)*(r-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,i=(l=Ns(l)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&FS(l,s,t,o,a),a.polygonEnd());b=a,l=u=c=null}};function _(e,t){i(e,t)&&b.point(e,t)}function $(o,a){var s=i(o,a);if(u&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&g)b.point(o,a);else{var l=[p=Math.max(BS,Math.min(jS,p)),m=Math.max(BS,Math.min(jS,m))],x=[o=Math.max(BS,Math.min(jS,o)),a=Math.max(BS,Math.min(jS,a))];!function(e,t,n,r,i,o){var a,s=e[0],l=e[1],u=0,c=1,f=t[0]-s,d=t[1]-l;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>u&&(u=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>u&&(u=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>u&&(u=a)}if(a=o-l,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>u&&(u=a)}else if(d>0){if(a0&&(e[0]=s+u*f,e[1]=l+u*d),c<1&&(t[0]=s+c*f,t[1]=l+c*d),!0}}}}}(l,x,e,t,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(g||(b.lineStart(),b.point(l[0],l[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,m=a,g=s}return w}}function US(e,t,n){var r=Ts(e,t-FA,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function qS(e,t,n){var r=Ts(e,t-FA,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}var WS,HS,GS,VS,YS=e=>e,XS=new fs,JS=new fs,ZS={point:eD,lineStart:eD,lineEnd:eD,polygonStart:function(){ZS.lineStart=QS,ZS.lineEnd=tM},polygonEnd:function(){ZS.lineStart=ZS.lineEnd=ZS.point=eD,XS.add(jA(JS)),JS=new fs},result:function(){var e=XS/2;return XS=new fs,e}};function QS(){ZS.point=KS}function KS(e,t){ZS.point=eM,WS=GS=e,HS=VS=t}function eM(e,t){JS.add(VS*e-GS*t),GS=e,VS=t}function tM(){eM(WS,HS)}var nM=ZS,rM=1/0,iM=rM,oM=-rM,aM=oM,sM={point:function(e,t){eoM&&(oM=e);taM&&(aM=t)},lineStart:eD,lineEnd:eD,polygonStart:eD,polygonEnd:eD,result:function(){var e=[[rM,iM],[oM,aM]];return oM=aM=-(iM=rM=1/0),e}};var lM,uM,cM,fM,dM=sM,hM=0,pM=0,mM=0,gM=0,yM=0,vM=0,bM=0,xM=0,wM=0,_M={point:$M,lineStart:kM,lineEnd:AM,polygonStart:function(){_M.lineStart=DM,_M.lineEnd=SM},polygonEnd:function(){_M.point=$M,_M.lineStart=kM,_M.lineEnd=AM},result:function(){var e=wM?[bM/wM,xM/wM]:vM?[gM/vM,yM/vM]:mM?[hM/mM,pM/mM]:[NaN,NaN];return hM=pM=mM=gM=yM=vM=bM=xM=wM=0,e}};function $M(e,t){hM+=e,pM+=t,++mM}function kM(){_M.point=CM}function CM(e,t){_M.point=EM,$M(cM=e,fM=t)}function EM(e,t){var n=e-cM,r=t-fM,i=JA(n*n+r*r);gM+=i*(cM+e)/2,yM+=i*(fM+t)/2,vM+=i,$M(cM=e,fM=t)}function AM(){_M.point=$M}function DM(){_M.point=MM}function SM(){FM(lM,uM)}function MM(e,t){_M.point=FM,$M(lM=cM=e,uM=fM=t)}function FM(e,t){var n=e-cM,r=t-fM,i=JA(n*n+r*r);gM+=i*(cM+e)/2,yM+=i*(fM+t)/2,vM+=i,bM+=(i=fM*e-cM*t)*(cM+e),xM+=i*(fM+t),wM+=3*i,$M(cM=e,fM=t)}var OM=_M;function NM(e){this._context=e}NM.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,RA)}},result:eD};var TM,zM,RM,LM,PM,jM=new fs,BM={point:eD,lineStart:function(){BM.point=IM},lineEnd:function(){TM&&UM(zM,RM),BM.point=eD},polygonStart:function(){TM=!0},polygonEnd:function(){TM=null},result:function(){var e=+jM;return jM=new fs,e}};function IM(e,t){BM.point=UM,zM=LM=e,RM=PM=t}function UM(e,t){LM-=e,PM-=t,jM.add(JA(LM*LM+PM*PM)),LM=e,PM=t}var qM=BM;let WM,HM,GM,VM;class YM{constructor(e){this._append=null==e?XM:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return XM;if(t!==WM){const e=10**t;WM=t,HM=function(t){let n=1;this._+=t[0];for(const r=t.length;n=0))throw new RangeError(`invalid digits: ${e}`);i=t}return null===t&&(r=new YM(i)),a},a.projection(e).digits(i).context(t)}function ZM(e){return function(t){var n=new QM;for(var r in e)n[r]=e[r];return n.stream=t,n}}function QM(){}function KM(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),aD(n,e.stream(dM)),t(dM.result()),null!=r&&e.clipExtent(r),e}function eF(e,t,n){return KM(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function tF(e,t,n){return eF(e,[[0,0],t],n)}function nF(e,t,n){return KM(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}function rF(e,t,n){return KM(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}QM.prototype={constructor:QM,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var iF=16,oF=UA(30*PA);function aF(e,t){return+t?function(e,t){function n(r,i,o,a,s,l,u,c,f,d,h,p,m,g){var y=u-r,v=c-i,b=y*y+v*v;if(b>4*t&&m--){var x=a+d,w=s+h,_=l+p,$=JA(x*x+w*w+_*_),k=KA(_/=$),C=jA(jA(_)-1)t||jA((y*S+v*M)/b-.5)>.3||a*d+s*h+l*p2?e[2]%360*PA:0,S()):[g*LA,y*LA,v*LA]},A.angle=function(e){return arguments.length?(b=e%360*PA,S()):b*LA},A.reflectX=function(e){return arguments.length?(x=e?-1:1,S()):x<0},A.reflectY=function(e){return arguments.length?(w=e?-1:1,S()):w<0},A.precision=function(e){return arguments.length?(a=aF(s,E=e*e),M()):JA(E)},A.fitExtent=function(e,t){return eF(A,e,t)},A.fitSize=function(e,t){return tF(A,e,t)},A.fitWidth=function(e,t){return nF(A,e,t)},A.fitHeight=function(e,t){return rF(A,e,t)},function(){return t=e.apply(this,arguments),A.invert=t.invert&&D,S()}}function fF(e){var t=0,n=NA/3,r=cF(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*PA,n=e[1]*PA):[t*LA,n*LA]},i}function dF(e,t){var n=YA(e),r=(n+YA(t))/2;if(jA(r)2?e[2]*PA:0),t.invert=function(t){return(t=e.invert(t[0]*PA,t[1]*PA))[0]*=LA,t[1]*=LA,t},t}(i.rotate()).invert([0,0]));return l(null==u?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===bF?[[Math.max(s[0]-o,u),t],[Math.min(s[0]+o,n),r]]:[[u,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(e){return arguments.length?(a(e),c()):a()},i.translate=function(e){return arguments.length?(s(e),c()):s()},i.center=function(e){return arguments.length?(o(e),c()):o()},i.clipExtent=function(e){return arguments.length?(null==e?u=t=n=r=null:(u=+e[0][0],t=+e[0][1],n=+e[1][0],r=+e[1][1]),c()):null==u?null:[[u,t],[n,r]]},c()}function wF(e){return ZA((TA+e)/2)}function _F(e,t){var n=UA(e),r=e===t?YA(e):GA(n/UA(t))/GA(wF(t)/wF(e)),i=n*VA(wF(e),r)/r;if(!r)return bF;function o(e,t){i>0?t<-TA+FA&&(t=-TA+FA):t>TA-FA&&(t=TA-FA);var n=i/VA(wF(t),r);return[n*YA(r*e),i-n*UA(r*e)]}return o.invert=function(e,t){var n=i-t,o=XA(r)*JA(e*e+n*n),a=IA(e,jA(n))*XA(n);return n*r<0&&(a-=NA*XA(e)*XA(n)),[a/r,2*BA(VA(i/o,1/r))-TA]},o}function $F(e,t){return[e,t]}function kF(e,t){var n=UA(e),r=e===t?YA(e):(n-UA(t))/(t-e),i=n/r+e;if(jA(r)FA&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},NF.invert=gF(KA),TF.invert=gF((function(e){return 2*BA(e)})),zF.invert=function(e,t){return[-t,2*BA(WA(e))-TA]};var RF=Math.abs,LF=Math.cos,PF=Math.sin,jF=1e-6,BF=Math.PI,IF=BF/2,UF=function(e){return e>0?Math.sqrt(e):0}(2);function qF(e){return e>1?IF:e<-1?-IF:Math.asin(e)}function WF(e,t){var n,r=e*PF(t),i=30;do{t-=n=(t+PF(t)-r)/(1+LF(t))}while(RF(n)>jF&&--i>0);return t/2}var HF=function(e,t,n){function r(r,i){return[e*r*LF(i=WF(n,i)),t*PF(i)]}return r.invert=function(r,i){return i=qF(i/t),[r/(e*LF(i)),qF((2*i+PF(2*i))/n)]},r}(UF/IF,UF,BF);const GF=JM(),VF=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function YF(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(JF[e]=function(e,t){return function n(){const r=t();return r.type=e,r.path=JM().projection(r),r.copy=r.copy||function(){const e=n();return VF.forEach((t=>{r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},Zb(r)}}(e,t),this):JF[e]||null}function XF(e){return e&&e.path||GF}const JF={albers:pF,albersusa:function(){var e,t,n,r,i,o,a=pF(),s=hF().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=hF().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(r.point(t,a),o)||(i.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?l:a).invert(e)},c.stream=function(n){return e&&t===n?e:(r=[a.stream(t=n),s.stream(n),l.stream(n)],i=r.length,e={point:function(e,t){for(var n=-1;++n2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in JF)YF(e,JF[e]);function ZF(){}const QF=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function KF(){var e=1,t=1,n=a;function r(e,t){return t.map((t=>i(e,t)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,l,u,c,f,d=new Array,h=new Array;a=s=-1,u=n[0]>=r,QF[u<<1].forEach(p);for(;++a=r,QF[l|u<<1].forEach(p);QF[u<<0].forEach(p);for(;++s=r,c=n[s*e]>=r,QF[u<<1|c<<2].forEach(p);++a=r,f=c,c=n[s*e+a+1]>=r,QF[l|u<<1|c<<2|f<<3].forEach(p);QF[u|c<<3].forEach(p)}a=-1,c=n[s*e]>=r,QF[c<<2].forEach(p);for(;++a=r,QF[c<<2|f<<3].forEach(p);function p(e){var t,n,r=[e[0][0]+a,e[0][1]+s],l=[e[1][0]+a,e[1][1]+s],u=o(r),c=o(l);(t=h[u])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(l),i(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(l),h[t.end=c]=t):(t=d[c])?(n=h[u])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(l),i(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(r),d[t.start=u]=t):d[u]=h[c]={start:u,end:c,ring:[r,l]}}QF[c<<3].forEach(p)}(r,i,(e=>{n(e,r,i),function(e){var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];for(;++t0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,r=a.length;n{var o,a=n[0],s=n[1],l=0|a,u=0|s,c=r[u*e+l];a>0&&a0&&s=0&&o>=0||uo("invalid size"),e=i,t=o,r},r.smooth=function(e){return arguments.length?(n=e?a:ZF,r):n===a},r}function eO(e,t){for(var n,r=-1,i=t.length;++rr!=h>r&&n<(d-u)*(r-c)/(h-c)+u&&(i=-i)}return i}function nO(e,t,n){var r,i,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])==(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(i=e[r=+(e[0]===t[0])],o=n[r],a=t[r],i<=o&&o<=a||a<=o&&o<=i)}function rO(e,t,n){return function(r){var i=ua(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,l=t?Cs(o,a,e):s/(e+1);return Ts(o+l,a,l)}}function iO(e){Kd.call(this,null,e)}function oO(e,t,n,r,i){const o=e.x1||0,a=e.y1||0,s=t*n<0;function l(e){e.forEach(u)}function u(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+r,e[1]=(e[1]-a)*n+i}return function(e){return e.coordinates.forEach(l),e}}function aO(e,t,n){const r=e>=0?e:ah(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function sO(e){return Ko(e)?e:aa(+e)}function lO(){var e=e=>e[0],t=e=>e[1],n=go,r=[-1,-1],i=960,o=500,a=2;function s(s,l){const u=aO(r[0],s,e)>>a,c=aO(r[1],s,t)>>a,f=u?u+2:0,d=c?c+2:0,h=2*f+(i>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let y=m;s.forEach((r=>{const i=f+(+e(r)>>a),o=d+(+t(r)>>a);i>=0&&i=0&&o0&&c>0?(uO(h,p,m,g,u),cO(h,p,g,m,c),uO(h,p,m,g,u),cO(h,p,g,m,c),uO(h,p,m,g,u),cO(h,p,g,m,c)):u>0?(uO(h,p,m,g,u),uO(h,p,g,m,u),uO(h,p,m,g,u),y=g):c>0&&(cO(h,p,m,g,c),cO(h,p,g,m,c),cO(h,p,m,g,c),y=g);const v=l?Math.pow(2,-2*a):1/zs(y);for(let e=0,t=h*p;e>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=sO(t),s):e},s.y=function(e){return arguments.length?(t=sO(e),s):t},s.weight=function(e){return arguments.length?(n=sO(e),s):n},s.size=function(e){if(!arguments.length)return[i,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||uo("invalid size"),i=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||uo("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<=i&&(t>=o&&(s-=n[t-o+a*e]),r[t-i+a*e]=s/Math.min(t+1,e-1+o-t,o))}function cO(e,t,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(s>=o&&(l-=n[a+(s-o)*e]),r[a+(s-i)*e]=l/Math.min(s+1,t-1+o-s,o))}function fO(e){Kd.call(this,null,e)}iO.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},ga(iO,Kd,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||po,o=KF().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const r=rO(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map((e=>Es(t(e).values))))}(r,i,e),s=null===e.as?null:e.as||"contour",l=[];return r.forEach((t=>{const n=i(t),r=o.size([n.width,n.height])(n.values,Eo(a)?a:a(n.values));!function(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;Ko(i)&&(i=i(n,r));Ko(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(wa(i)?i:i[0])||1,s=(wa(i)?i:i[1])||1,l=o&&o[0]||0,u=o&&o[1]||0;e.forEach(oO(t,a,s,l,u))}(r,n,t,e),r.forEach((e=>{l.push(kd(t,_d(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),fO.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const dO=["x","y","weight","size","cellSize","bandwidth"];function hO(e,t){return dO.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function pO(e){Kd.call(this,null,e)}ga(fO,Kd,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=function(e,t){var n,r,i,o,a,s,l=[],u=e=>e(o);if(null==t)l.push(e);else for(n={},r=0,i=e.length;r_d(function(e,t){for(let n=0;nFA})).map(l)).concat(Ts(qA(o/h)*h,i,h).filter((function(e){return jA(e%m)>FA})).map(u))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),y.precision(g)):[[t,o],[e,i]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],m=+e[1],y):[p,m]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(g=+d,l=US(o,i,90),u=qS(t,e,g),c=US(s,a,90),f=qS(r,n,g),y):g},y.extentMajor([[-180,-90+FA],[180,90-FA]]).extentMinor([[-180,-80-FA],[180,80+FA]])}()}function _O(e){Kd.call(this,null,e)}function $O(e){if(!Ko(e))return!1;const t=Ra(oo(e));return t.$x||t.$y||t.$value||t.$max}function kO(e){Kd.call(this,null,e),this.modified(!0)}function CO(e,t,n){Ko(e[t])&&e[t](n)}yO.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},ga(yO,Kd,{transform(e,t){var n,r=this._features,i=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],l=e.geojson||!o&&po,u=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(oo(l))||a&&t.modified(oo(a))||s&&t.modified(oo(s)),this.value&&!n||(u=t.SOURCE,this._features=r=[],this._points=i=[]),l&&t.visit(u,(e=>r.push(l(e)))),a&&s&&(t.visit(u,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&i.push([t,n])})),r=r.concat({type:mO,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:gO,features:r}}}),vO.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},ga(vO,Kd,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||po,o=e.as||"path",a=n.SOURCE;!r||e.modified()?(this.value=r=XF(e.projection),n.materialize().reflow()):a=i===po||t.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(r,e.pointRadius);return n.visit(a,(e=>e[o]=r(i(e)))),r.pointRadius(s),n.modifies(o)}}),bO.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},ga(bO,Kd,{transform(e,t){var n,r=e.projection,i=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],l=a[1];function u(e){const t=r([i(e),o(e)]);t?(e[s]=t[0],e[l]=t[1]):(e[s]=void 0,e[l]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(n=t.modified(i.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,u)),t.modifies(a)}}),xO.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},ga(xO,Kd,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return r&&!e.modified()||(this.value=r=function(e,t,n){const r=null==n?n=>e(t(n)):r=>{var i=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(i),o};return r.context=t=>(e.context(t),r),r}(XF(e.projection),e.field||fo("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[i]=r)),n.modifies(i)}}),wO.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},ga(wO,Kd,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const t in e)Ko(i[t])&&i[t](e[t]);return n=i(),r.length?t.mod.push(Cd(r[0],n)):t.add.push(_d(n)),r[0]=n,t}}),_O.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},ga(_O,Kd,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||po,o=function(e,t){let n;Ko(e)?(n=n=>e(n,t),n.dep=$O(e)):e?n=aa(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;Ko(e)?(n=n=>uy(e(n,t)),n.dep=$O(e)):n=aa(uy(e||"#888"));return n}(e.color,e),s=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?Es(n.map((e=>Es(i(e).values)))):0};return n.forEach((e=>{const t=i(e),n=la({},e,l);r||(n.$max=Es(t.values||[])),e[s]=function(e,t,n,r){const i=e.width,o=e.height,a=e.x1||0,s=e.y1||0,l=e.x2||i,u=e.y2||o,c=e.values,f=c?e=>c[e]:mo,d=zg(l-a,u-s),h=d.getContext("2d"),p=h.getImageData(0,0,l-a,u-s),m=p.data;for(let e=s,o=0;e{null!=e[t]&&CO(n,t,e[t])}))):VF.forEach((t=>{e.modified(t)&&CO(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return e=Zo(e),1===e.length?e[0]:{type:gO,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===gO?e.features:Zo(e).filter((e=>null!=e)).map((e=>e.type===mO?e:{type:mO,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var EO=Object.freeze({__proto__:null,contour:pO,geojson:yO,geopath:vO,geopoint:bO,geoshape:xO,graticule:wO,heatmap:_O,isocontour:iO,kde2d:fO,projection:kO});function AO(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o,a,s,l,u,c,f,d,h=e._root,p={data:r},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a,i=h,!(h=h[f=c<<1|u]))return i[f]=p,e;if(s=+e._x.call(null,h.data),l=+e._y.call(null,h.data),t===s&&n===l)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a}while((f=c<<1|u)==(d=(l>=a)<<1|s>=o));return i[d]=h,i[f]=p,e}function DO(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function SO(e){return e[0]}function MO(e){return e[1]}function FO(e,t,n){var r=new OO(null==t?SO:t,null==n?MO:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function OO(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function NO(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var TO=FO.prototype=OO.prototype;function zO(e){return function(){return e}}function RO(e){return 1e-6*(e()-.5)}function LO(e){return e.x+e.vx}function PO(e){return e.y+e.vy}function jO(e){return e.index}function BO(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}TO.copy=function(){var e,t,n=new OO(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=NO(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var i=0;i<4;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(4)}):r.target[i]=NO(t));return n},TO.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return AO(this.cover(t,n),t,n,e)},TO.addAll=function(e){var t,n,r,i,o=e.length,a=new Array(o),s=new Array(o),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(s=(td||(o=l.y0)>h||(a=l.x1)=y)<<1|e>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),x=v*v+b*b;if(x=(s=(p+g)/2))?p=s:g=s,(c=a>=(l=(m+y)/2))?m=l:y=l,t=h,!(h=h[f=c<<1|u]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},TO.removeAll=function(e){for(var t=0,n=e.length;t{}};function UO(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var n,r,i=new Array(n),o=0;o=0&&t._call.call(void 0,e),t=t._next;--YO}()}finally{YO=0,function(){var e,t,n=GO,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:GO=t);VO=e,uN(r)}(),KO=0}}function lN(){var e=tN.now(),t=e-QO;t>ZO&&(eN-=t,QO=e)}function uN(e){YO||(XO&&(XO=clearTimeout(XO)),e-KO>24?(e<1/0&&(XO=setTimeout(sN,e-tN.now()-eN)),JO&&(JO=clearInterval(JO))):(JO||(QO=tN.now(),JO=setInterval(lN,ZO)),YO=1,nN(sN)))}oN.prototype=aN.prototype={constructor:oN,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?rN():+n)+(null==t?0:+t),this._next||VO===this||(VO?VO._next=this:GO=this,VO=this),this._call=e,this._time=n,uN()},stop:function(){this._call&&(this._call=null,this._time=1/0,uN())}};const cN=1664525,fN=1013904223,dN=4294967296;function hN(e){return e.x}function pN(e){return e.y}var mN=10,gN=Math.PI*(3-Math.sqrt(5));function yN(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=aN(f),u=UO("tick","end"),c=function(){let e=1;return()=>(e=(cN*e+fN)%dN)/dN}();function f(){d(),u.call("tick",t),n1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,r){var i,o,a,s,l,u=0,c=e.length;for(null==r?r=1/0:r*=r,u=0;u1?(u.on(e,n),t):u.on(e)}}}const vN={center:function(e,t){var n,r=1;function i(){var i,o,a=n.length,s=0,l=0;for(i=0;iu+p||oc+p||al.index){var m=u-s.x-s.vx,g=c-s.y-s.vy,y=m*m+g*g;ye.r&&(e.r=e[t].r)}function l(){if(t){var r,i,o=t.length;for(n=new Array(o),r=0;r=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=RO(n))*f),0===d&&(p+=(d=RO(n))*d),p[s(e,t,r),e])));for(a=0,i=new Array(u);at(e,n):t)}$N.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:_N}]},ga($N,Kd,{transform(e,t){var n,r,i=this.value,o=t.changed(t.ADD_REM),a=e.modified(xN),s=e.iterations||300;if(i?(o&&(t.modifies("index"),i.nodes(t.source)),(a||t.changed(t.MOD))&&kN(i,e,0,t)):(this.value=i=function(e,t){const n=yN(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),kN(n,t,!0).on("end",(()=>o=!0))}(t.source,e),i.on("tick",(n=t.dataflow,r=this,()=>n.touch(r).run())),e.static||(o=!0,i.tick()),t.modifies("index")),a||o||e.modified(wN)||t.changed()&&e.restart)if(i.alpha(Math.max(i.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),e.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,s=0,l=t.length;s=0;)t+=n[r].value;else t=1;e.value=t}function NN(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=zN)):void 0===t&&(t=TN);for(var n,r,i,o,a,s=new PN(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new PN(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(LN)}function TN(e){return e.children}function zN(e){return Array.isArray(e)?e[1]:null}function RN(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function LN(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function PN(e){this.data=e,this.depth=this.height=0,this.parent=null}function jN(e){return null==e?null:BN(e)}function BN(e){if("function"!=typeof e)throw new Error;return e}function IN(){return 0}function UN(e){return function(){return e}}PN.prototype=NN.prototype={constructor:PN,count:function(){return this.eachAfter(ON)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return NN(this).eachBefore(RN)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n0&&n*n>r*r+i*i}function XN(e,t){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*D))/(2*E):D/A);return{x:r+_+$*S,y:i+k+C*S,r:S}}function KN(e,t,n){var r,i,o,a,s=e.x-t.x,l=e.y-t.y,u=s*s+l*l;u?(i=t.r+n.r,i*=i,a=e.r+n.r,i>(a*=a)?(r=(u+a-i)/(2*u),o=Math.sqrt(Math.max(0,a/u-r*r)),n.x=e.x-r*s-o*l,n.y=e.y-r*l+o*s):(r=(u+i-a)/(2*u),o=Math.sqrt(Math.max(0,i/u-r*r)),n.x=t.x+r*s-o*l,n.y=t.y+r*l+o*s)):(n.x=t.x+n.r,n.y=t.y)}function eT(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function tT(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function nT(e){this._=e,this.next=null,this.previous=null}function rT(e,t){if(!(o=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,r,i,o,a,s,l,u,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;KN(r,n,i=e[2]),n=new nT(n),r=new nT(r),i=new nT(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lfunction(e){e=`${e}`;let t=e.length;yT(e,t-1)&&!yT(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(gT),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(gT(e)),d.push(dT));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=d.length;a=0&&(u=d[e]).data===dT;--e)u.data=null}if(s.parent=cT,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(LN),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=jN(e),r):t},r.parentId=function(e){return arguments.length?(n=jN(e),r):n},r.path=function(t){return arguments.length?(e=jN(t),r):e},r}function gT(e){let t=e.length;if(t<2)return"";for(;--t>1&&!yT(e,t););return e.slice(0,t)}function yT(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function vT(e,t){return e.parent===t.parent?1:2}function bT(e){var t=e.children;return t?t[0]:e.t}function xT(e){var t=e.children;return t?t[t.length-1]:e.t}function wT(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function _T(e,t,n){return e.a.parent===t.parent?e.a:n}function $T(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function kT(e,t,n,r,i){for(var o,a=e.children,s=-1,l=a.length,u=e.value&&(i-n)/e.value;++sd&&(d=s),g=c*c*m,(h=Math.max(d/g,g/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:l1?t:1)},n}(CT);var DT=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,l,u,c,f=-1,d=a.length,h=e.value;++f1?t:1)},n}(CT);function ST(e,t,n){const r={};return e.each((e=>{const i=e.data;n(i)&&(r[t(i)]=e)})),e.lookup=r,e}function MT(e){Kd.call(this,null,e)}MT.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const FT=e=>e.values;function OT(){const e=[],t={entries:e=>r(n(e,0),0),key:n=>(e.push(n),t)};function n(t,r){if(r>=e.length)return t;const i=t.length,o=e[r++],a={},s={};let l,u,c,f=-1;for(;++fe.length)return t;const i=[];for(const e in t)i.push({key:e,values:r(t[e],n)});return i}return t}function NT(e){Kd.call(this,null,e)}ga(MT,Kd,{transform(e,t){t.source||uo("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each((e=>{e.children&&bd(e.data)&&i.rem.push(e.data)})),this.value=o=NN({values:Zo(e.keys).reduce(((e,t)=>(e.key(t),e)),OT()).entries(i.source)},FT),n&&o.each((e=>{e.children&&(e=_d(e.data),i.add.push(e),i.source.push(e))})),ST(o,xd,xd)),i.source.root=o,i}});const TT=(e,t)=>e.parent===t.parent?1:2;ga(NT,Kd,{transform(e,t){t.source&&t.source.root||uo(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(Ed(e.sort,(e=>e.data))),function(e,t,n){for(let r,i=0,o=t.length;ifunction(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o(e=(qN*e+WN)%HN)/HN}();return i.x=t/2,i.y=n/2,e?i.eachBefore(oT(e)).eachAfter(aT(r,.5,o)).eachBefore(sT(1)):i.eachBefore(oT(iT)).eachAfter(aT(IN,1,o)).eachAfter(aT(r,i.r/Math.min(t,n),o)).eachBefore(sT(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=jN(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r="function"==typeof e?e:UN(+e),i):r},i},params:["radius","size","padding"],fields:zT});const LT=["x0","y0","x1","y1","depth","children"];function PT(e){NT.call(this,e)}function jT(e){Kd.call(this,null,e)}PT.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:LT.length,default:LT}]},ga(PT,NT,{layout:function(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(function(e,t){return function(r){r.children&&uT(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a=0;--i)s.push(n=t.children[i]=new $T(r[i],i)),n.parent=t;return(a.parent=new $T(null,0)).children=[a],a}(i);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),r)i.eachBefore(s);else{var u=i,c=i,f=i;i.eachBefore((function(e){e.xc.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=u===c?1:e(u,c)/2,h=d-u.x,p=t/(c.x+d+h),m=n/(f.depth||1);i.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*m}))}return i}function o(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,n,r){if(n){for(var i,o=t,a=t,s=n,l=o.parent.children[0],u=o.m,c=a.m,f=s.m,d=l.m;s=xT(s),o=bT(o),s&&o;)l=bT(l),(a=xT(a)).a=t,(i=s.z+f-o.z-u+e(s._,o._))>0&&(wT(_T(s,t,r),t,i),u+=i,c+=i),f+=s.m,u+=o.m,d+=l.m,c+=a.m;s&&!xT(a)&&(a.t=s,a.m+=f-c),o&&!bT(l)&&(l.t=o,l.m+=u-d,r=t)}return r}(t,i,t.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i},cluster:function(){var e=SN,t=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(MN,0)/e.length}(n),t.y=function(e){return 1+e.reduce(FN,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(i),l=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),u=s.x-e(s,l)/2,c=l.x+e(l,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-u)/(c-u)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}},IT=["x","y","depth","children"];function UT(e){NT.call(this,e)}function qT(e){Kd.call(this,[],e)}UT.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:IT.length,default:IT}]},ga(UT,NT,{layout(e){const t=e||"tidy";if(da(BT,t))return BT[t]();uo("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:IT}),qT.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ga(qT,Kd,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||uo("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,(e=>o[xd(e)]=1)),r.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[xd(t)]&&o[xd(n)]&&i.add.push(_d({source:n,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[xd(e)]=1)),n.forEach((e=>{(o[xd(e.source)]||o[xd(e.target)])&&i.mod.push(e)}))),i}});const WT={binary:function(e,t,n,r,i){var o,a,s=e.children,l=s.length,u=new Array(l+1);for(u[0]=a=o=0;o=n-1){var c=s[t];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=l)}var f=u[t],d=r/2+f,h=t+1,p=n-1;for(;h>>1;u[m]l-o){var v=r?(i*y+a*g)/r:a;e(t,h,g,i,o,v,l),e(h,n,y,v,o,a,l)}else{var b=r?(o*y+l*g)/r:l;e(t,h,g,i,o,a,b),e(h,n,y,i,b,a,l)}}(0,l,e.value,t,n,r,i)},dice:uT,slice:kT,slicedice:function(e,t,n,r,i){(1&e.depth?kT:uT)(e,t,n,r,i)},squarify:AT,resquarify:DT},HT=["x0","y0","x1","y1","depth","children"];function GT(e){NT.call(this,e)}GT.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:HT.length,default:HT}]},ga(GT,NT,{layout(){const e=function(){var e=AT,t=!1,n=1,r=1,i=[0],o=IN,a=IN,s=IN,l=IN,u=IN;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(lT),e}function f(t){var n=i[t.depth],r=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{da(WT,t)?e.tile(WT[t]):uo("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:HT});var VT=Object.freeze({__proto__:null,nest:MT,pack:RT,partition:PT,stratify:jT,tree:UT,treelinks:qT,treemap:GT});const YT=4278190080;function XT(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function JT(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;"group"===r?t.forEach((t=>{t.items.forEach((t=>JT(e,t.items,n)))})):L$[r].draw(e,{items:n?t.map(ZT):t})}function ZT(e){const t=kd(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const QT=5,KT=31,ez=32,tz=new Uint32Array(ez+1),nz=new Uint32Array(ez+1);nz[0]=0,tz[0]=~nz[0];for(let e=1;e<=ez;++e)nz[e]=nz[e-1]<<1|1,tz[e]=~nz[e];function rz(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),a=e=>~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+ez)/ez));function r(e,t){n[e]|=t}function i(e,t){n[e]&=t}return{array:n,get:(t,r)=>{const i=r*e+t;return n[i>>>QT]&1<<(i&KT)},set:(t,n)=>{const i=n*e+t;r(i>>>QT,1<<(i&KT))},clear:(t,n)=>{const r=n*e+t;i(r>>>QT,~(1<<(r&KT)))},getRange:(t,r,i,o)=>{let a,s,l,u,c=o;for(;c>=r;--c)if(a=c*e+t,s=c*e+i,l=a>>>QT,u=s>>>QT,l===u){if(n[l]&tz[a&KT]&nz[1+(s&KT)])return!0}else{if(n[l]&tz[a&KT])return!0;if(n[u]&nz[1+(s&KT)])return!0;for(let e=l+1;e{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,l=a>>>QT,u=s>>>QT,l===u)r(l,tz[a&KT]&nz[1+(s&KT)]);else for(r(l,tz[a&KT]),r(u,nz[1+(s&KT)]),c=l+1;c{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,l=a>>>QT,u=s>>>QT,l===u)i(l,nz[a&KT]|tz[1+(s&KT)]);else for(i(l,nz[a&KT]),i(u,tz[1+(s&KT)]),c=l+1;cn<0||r<0||o>=t||i>=e}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}function iz(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function oz(e,t,n,r,i,o,a,s){const l=i*o/(2*r),u=e(t-l),c=e(t+l),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(u,f,c,d)||a.getRange(u,f,c,d)||s&&s.getRange(u,f,c,d)}const az=[-1,-1,1,1],sz=[-1,1,-1,1];const lz=["right","center","left"],uz=["bottom","middle","top"];function cz(e,t,n,r,i,o,a,s,l,u,c,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const fz={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},dz={naive:function(e,t,n,r){const i=e.width,o=e.height;return function(e){const t=e.datum.datum.items[r].items,n=t.length,a=e.datum.fontSize,s=y$.width(e.datum,e.datum.text);let l,u,c,f,d,h,p,m=0;for(let r=0;r=m&&(m=p,e.x=d,e.y=h);return d=s/2,h=a/2,l=e.x-d,u=e.x+d,c=e.y-h,f=e.y+h,e.align="center",l<0&&u<=i?e.align="left":0<=l&&i=1;)d=(h+p)/2,oz(e,c,f,u,l,d,a,s)?p=d:h=d;if(h>r)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[r].items,u=s.length,c=t.datum.fontSize,f=y$.width(t.datum,t.datum.text);let d,h,p,m,g,y,v,b,x,w,_,$,k,C,E,A,D,S=n?c:0,M=!1,F=!1,O=0;for(let r=0;rh&&(D=d,d=h,h=D),p>m&&(D=p,p=m,m=D),x=e(d),_=e(h),w=~~((x+_)/2),$=e(p),C=e(m),k=~~(($+C)/2),v=w;v>=x;--v)for(b=k;b>=$;--b)A=l(v,b,S,f,c),A&&([t.x,t.y,S,M]=A);for(v=w;v<=_;++v)for(b=k;b<=C;++b)A=l(v,b,S,f,c),A&&([t.x,t.y,S,M]=A);M||n||(E=Math.abs(h-d+m-p),g=(d+h)/2,y=(p+m)/2,E>=O&&!iz(g,y,f,c,i,o)&&!oz(e,g,y,c,f,c,a,null)&&(O=E,t.x=g,t.y=y,F=!0))}return!(!M&&!F)&&(g=f/2,y=c/2,a.setRange(e(t.x-g),e(t.y-y),e(t.x+g),e(t.y+y)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],l=e.bitmap();return function(t){const u=t.datum.datum.items[r].items,c=u.length,f=t.datum.fontSize,d=y$.width(t.datum,t.datum.text),h=[];let p,m,g,y,v,b,x,w,_,$,k,C,E=n?f:0,A=!1,D=!1,S=0;for(let r=0;r=1;)k=(_+$)/2,oz(e,v,b,f,d,k,a,s)?$=k:_=k;_>E&&(t.x=v,t.y=b,E=_,A=!0)}}A||n||(C=Math.abs(m-p+y-g),v=(p+m)/2,b=(g+y)/2,C>=S&&!iz(v,b,d,f,i,o)&&!oz(e,v,b,f,d,f,a,null)&&(S=C,t.x=v,t.y=b,D=!0))}return!(!A&&!D)&&(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",!0)}}};function hz(e,t,n,r,i,o,a,s,l,u,c){if(!e.length)return e;const f=Math.max(r.length,i.length),d=function(e,t){const n=new Float64Array(t),r=e.length;for(let t=0;t[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{const t=e.datum.items[r].items;return i(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:i}(p,m,s,l),v=null===u||u===1/0,b=g&&"naive"===c;var x;let w=-1,_=-1;const $=e.map((e=>{const t=v?y$.width(e,e.text):void 0;return w=Math.max(w,t),_=Math.max(_,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));u=null===u||u===1/0?Math.max(w,_)+Math.max(...r):u;const k=rz(t[0],t[1],u);let C;if(!b){n&&$.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;ee.datum));C=o.length||r?function(e,t,n,r,i){const o=e.width,a=e.height,s=r||i,l=zg(o,a).getContext("2d"),u=zg(o,a).getContext("2d"),c=s&&zg(o,a).getContext("2d");n.forEach((e=>JT(l,e,!1))),JT(u,t,!1),s&&JT(c,t,!0);const f=XT(l,o,a),d=XT(u,o,a),h=s&&XT(c,o,a),p=e.bitmap(),m=s&&e.bitmap();let g,y,v,b,x,w,_,$;for(y=0;yn.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(k,a&&$)}const E=g?dz[c](k,C,a,l):function(e,t,n,r){const i=e.width,o=e.height,a=t[0],s=t[1],l=r.length;return function(t){const u=t.boundary,c=t.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let f,d,h,p,m,g,y,v,b,x,w,_,$,k,C,E=t.textWidth??0;for(let i=0;i>>2&3)-1,h=0===f&&0===d||r[i]<0,p=f&&d?Math.SQRT1_2:1,m=r[i]<0?-1:1,g=u[1+f]+r[i]*f*p,w=u[4+d]+m*c*d/2+r[i]*d*p,v=w-c/2,b=w+c/2,_=e(g),k=e(v),C=e(b),!E){if(!cz(_,_,k,C,a,s,0,0,0,0,0,h))continue;E=y$.width(t.datum,t.datum.text)}if(x=g+m*E*f/2,g=x-E/2,y=x+E/2,_=e(g),$=e(y),cz(_,$,k,C,a,s,0,0,0,0,0,h))return t.x=f?f*m<0?y:g:x,t.y=d?d*m<0?b:v:w,t.align=lz[f*m+1],t.baseline=uz[d*m+1],a.setRange(_,k,$,C),!0}return!1}}(k,C,h,d);return $.forEach((e=>e.opacity=+E(e))),$}const pz=["x","y","opacity","align","baseline"],mz=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function gz(e){Kd.call(this,null,e)}gz.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:mz},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:pz.length,default:pz}]},ga(gz,Kd,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(n){const r=e[n];return Ko(r)&&t.modified(r.fields)}("sort")))return;e.size&&2===e.size.length||uo("Size parameter should be specified as a [width, height] array.");const r=e.as||pz;return hz(t.materialize(t.SOURCE).source||[],e.size,e.sort,Zo(null==e.offset?1:e.offset),Zo(e.anchor||mz),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,void 0===e.padding?0:e.padding,e.method||"naive").forEach((e=>{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline})),t.reflow(n).modifies(r)}});var yz=Object.freeze({__proto__:null,label:gz});function vz(e,t){var n,r,i,o,a,s,l=[],u=function(e){return e(o)};if(null==t)l.push(e);else for(n={},r=0,i=e.length;r{qh(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let e=0;e"poly"===e?t:"quad"===e?2:1)(o,a),l=e.as||[io(e.x),io(e.y)],u=xz[o],c=[];let f=e.extent;da(xz,o)||uo("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const r=u(n,e.x,e.y,a);if(e.params)return void c.push(_d({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const d=f||ua(n,e.x),h=e=>{const t={};for(let e=0;eh([e,r.predict(e)]))):Vh(r.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});var _z=Object.freeze({__proto__:null,loess:bz,regression:wz});const $z=134217729,kz=33306690738754706e-32;function Cz(e,t,n,r,i){let o,a,s,l,u=t[0],c=r[0],f=0,d=0;c>u==c>-u?(o=u,u=t[++f]):(o=c,c=r[++d]);let h=0;if(fu==c>-u?(a=u+o,s=o-(a-u),u=t[++f]):(a=c+o,s=o-(a-c),c=r[++d]),o=a,0!==s&&(i[h++]=s);fu==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++d]),o=a,0!==s&&(i[h++]=s);for(;f=33306690738754716e-32*u?l:-function(e,t,n,r,i,o,a){let s,l,u,c,f,d,h,p,m,g,y,v,b,x,w,_,$,k;const C=e-i,E=n-i,A=t-o,D=r-o;x=C*D,d=$z*C,h=d-(d-C),p=C-h,d=$z*D,m=d-(d-D),g=D-m,w=p*g-(x-h*m-p*m-h*g),_=A*E,d=$z*A,h=d-(d-A),p=A-h,d=$z*E,m=d-(d-E),g=E-m,$=p*g-(_-h*m-p*m-h*g),y=w-$,f=w-y,Sz[0]=w-(y+f)+(f-$),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-_,f=b-y,Sz[1]=b-(y+f)+(f-_),k=v+y,f=k-v,Sz[2]=v-(k-f)+(y-f),Sz[3]=k;let S=function(e,t){let n=t[0];for(let r=1;r=M||-S>=M)return S;if(f=e-C,s=e-(C+f)+(f-i),f=n-E,u=n-(E+f)+(f-i),f=t-A,l=t-(A+f)+(f-o),f=r-D,c=r-(D+f)+(f-o),0===s&&0===l&&0===u&&0===c)return S;if(M=Dz*a+kz*Math.abs(S),S+=C*c+D*s-(A*u+E*l),S>=M||-S>=M)return S;x=s*D,d=$z*s,h=d-(d-s),p=s-h,d=$z*D,m=d-(d-D),g=D-m,w=p*g-(x-h*m-p*m-h*g),_=l*E,d=$z*l,h=d-(d-l),p=l-h,d=$z*E,m=d-(d-E),g=E-m,$=p*g-(_-h*m-p*m-h*g),y=w-$,f=w-y,Nz[0]=w-(y+f)+(f-$),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-_,f=b-y,Nz[1]=b-(y+f)+(f-_),k=v+y,f=k-v,Nz[2]=v-(k-f)+(y-f),Nz[3]=k;const F=Cz(4,Sz,4,Nz,Mz);x=C*c,d=$z*C,h=d-(d-C),p=C-h,d=$z*c,m=d-(d-c),g=c-m,w=p*g-(x-h*m-p*m-h*g),_=A*u,d=$z*A,h=d-(d-A),p=A-h,d=$z*u,m=d-(d-u),g=u-m,$=p*g-(_-h*m-p*m-h*g),y=w-$,f=w-y,Nz[0]=w-(y+f)+(f-$),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-_,f=b-y,Nz[1]=b-(y+f)+(f-_),k=v+y,f=k-v,Nz[2]=v-(k-f)+(y-f),Nz[3]=k;const O=Cz(F,Mz,4,Nz,Fz);x=s*c,d=$z*s,h=d-(d-s),p=s-h,d=$z*c,m=d-(d-c),g=c-m,w=p*g-(x-h*m-p*m-h*g),_=l*u,d=$z*l,h=d-(d-l),p=l-h,d=$z*u,m=d-(d-u),g=u-m,$=p*g-(_-h*m-p*m-h*g),y=w-$,f=w-y,Nz[0]=w-(y+f)+(f-$),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-_,f=b-y,Nz[1]=b-(y+f)+(f-_),k=v+y,f=k-v,Nz[2]=v-(k-f)+(y-f),Nz[3]=k;const N=Cz(O,Fz,4,Nz,Oz);return Oz[N-1]}(e,t,n,r,i,o,u)}const zz=Math.pow(2,-52),Rz=new Uint32Array(512);class Lz{static from(e,t=qz,n=Wz){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,l=-1/0,u=-1/0;for(let t=0;tl&&(l=n),r>u&&(u=r),this._ids[t]=t}const c=(a+l)/2,f=(s+u)/2;let d,h,p,m=1/0;for(let t=0;t0&&(h=t,m=n)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Tz(g,y,v,b,w,_)<0){const e=h,t=v,n=b;h=p,v=w,b=_,p=e,w=t,_=n}const $=function(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,f=l*l+u*u,d=.5/(a*u-s*l),h=e+(u*c-s*f)*d,p=t+(a*f-l*c)*d;return{x:h,y:p}}(g,y,v,b,w,_);this._cx=$.x,this._cy=$.y;for(let t=0;t0&&Math.abs(u-o)<=zz&&Math.abs(c-a)<=zz)continue;if(o=u,a=c,l===d||l===h||l===p)continue;let f=0;for(let e=0,t=this._hashKey(u,c);e=0;)if(g=m,g===f){g=-1;break}if(-1===g)continue;let y=this._addTriangle(g,l,n[g],-1,-1,r[g]);r[l]=this._legalize(y+2),r[g]=y,k++;let v=n[g];for(;m=n[v],Tz(u,c,e[2*v],e[2*v+1],e[2*m],e[2*m+1])<0;)y=this._addTriangle(v,l,m,r[l],-1,r[v]),r[l]=this._legalize(y+2),n[v]=v,k--,v=m;if(g===f)for(;m=t[g],Tz(u,c,e[2*m],e[2*m+1],e[2*g],e[2*g+1])<0;)y=this._addTriangle(m,l,g,-1,r[g],r[m]),this._legalize(y+2),r[m]=y,n[g]=g,k--,g=m;this._hullStart=t[l]=g,n[g]=t[v]=l,n[l]=v,i[this._hashKey(u,c)]=l,i[this._hashKey(e[2*g],e[2*g+1])]=g}this.hull=new Uint32Array(k);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=Rz[--i];continue}const l=a-a%3,u=s+(e+1)%3,c=l+(a+2)%3,f=t[o],d=t[e],h=t[u],p=t[c];if(jz(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=f;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=l+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;Uz(e,n+r>>1,i),t[e[n]]>t[e[r]]&&Uz(e,n,r),t[e[i]]>t[e[r]]&&Uz(e,i,r),t[e[n]]>t[e[i]]&&Uz(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(Iz(e,t,i,r),Iz(e,t,n,o-1)):(Iz(e,t,n,o-1),Iz(e,t,i,r))}}function Uz(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function qz(e){return e[0]}function Wz(e){return e[1]}const Hz=1e-6;class Gz{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Hz||Math.abs(this._y1-i)>Hz)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Vz{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class Yz{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,l=0,u=0,c=n.length;l1;)i-=2;for(let e=2;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new Yz(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(-1===r[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=Jz(t-l[2*e],2)+Jz(n-l[2*e+1],2);const f=r[e];let d=f;do{let r=s[d];const f=Jz(t-l[2*r],2)+Jz(n-l[2*r+1],2);if(f=f));)if(t.x=a+i,t.y=u+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!cR(t,e,s[0]))&&(!n||dR(t,n))){for(var m,g=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,w=32-x,_=t.y1-t.y0,$=(t.y+t.y0)*v+(b>>5),k=0;k<_;k++){m=0;for(var C=0;C<=y;C++)e[$+C]|=m<>>x:0);$+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var l=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(aR<<5)/t,e.height=sR/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(zg()),f=function(e){var t=[],n=-1;for(;++n>5)*s[1]),h=null,p=u.length,m=-1,g=[],y=u.map((s=>({text:e(s),font:t(s),style:r(s),weight:i(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++m>1,v.y=s[1]*(c()+.5)>>1,uR(l,v,y,m),v.hasText&&d(f,v,h)&&(g.push(v),h?fR(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return g},f.words=function(e){return arguments.length?(u=e,f):u},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=pR(e),f):t},f.fontStyle=function(e){return arguments.length?(r=pR(e),f):r},f.fontWeight=function(e){return arguments.length?(i=pR(e),f):i},f.rotate=function(e){return arguments.length?(o=pR(e),f):o},f.text=function(t){return arguments.length?(e=pR(t),f):e},f.spiral=function(e){return arguments.length?(l=mR[e]||e,f):l},f.fontSize=function(e){return arguments.length?(n=pR(e),f):n},f.padding=function(e){return arguments.length?(a=pR(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function uR(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(aR<<5)/o,sR/o);var a,s,l,u,c,f=0,d=0,h=0,p=n.length;for(--r;++r>5<<5,l=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(l>h&&(h=l),f+a>=aR<<5&&(f=0,d+=h,h=0),d+l>=sR)break;i.translate((f+(a>>1))/o,(d+(l>>1))/o),t.rotate&&i.rotate(t.rotate*oR),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=a,t.height=l,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var w=i.getImageData(0,0,(aR<<5)/o,sR/o).data,_=[];--r>=0;)if((t=n[r]).hasText){for(s=(a=t.width)>>5,l=t.y1-t.y0,u=0;u>5),E=w[(d+c)*(aR<<5)+(f+u)<<2]?1<<31-u%32:0;_[C]|=E,$|=E}$?k=c:(t.y0++,l--,c--,d++)}t.y1=t.y0+k,t.sprite=_.slice(0,(t.y1-t.y0)*s)}}}function cR(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,l=32-s,u=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f>>s:0))&t[c+d])return!0;c+=n}return!1}function fR(e,t){var n=e[0],r=e[1];t.x+t.x0r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function dR(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0t(e(n))}r.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const l=i.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(lh).layout(),u=i.size(),c=u[0]>>1,f=u[1]>>1,d=l.length;for(let e,t,n=0;nnew Uint8Array(e),wR=e=>new Uint16Array(e),_R=e=>new Uint32Array(e);function $R(e,t,n){const r=(t<257?xR:t<65537?wR:_R)(e);return n&&r.set(n),r}function kR(e,t,n){const r=1<{const r=e[t],i=e[n];return ri?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,l),a)u=t,c=e,t=Array(a+s),e=_R(a+s),function(e,t,n,r,i,o,a,s,l){let u,c=0,f=0;for(u=0;c0)for(f=0;fe,size:()=>n}}function ER(e){Kd.call(this,function(){let e=8,t=[],n=_R(0),r=$R(0,e),i=$R(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,r=0,i=t.length,o=e.length;rt.length,curr:()=>r,prev:()=>i,reset:e=>i[e]=r[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){r[e]|=t},clear(e,t){r[e]&=~t},resize(t,n){(t>r.length||n>e)&&(e=Math.max(n,e),r=$R(t,e,r),i=$R(t,e))}}}(),e),this._indices=null,this._dims=null}function AR(e){Kd.call(this,null,e)}ER.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},ga(ER,Kd,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s,l,u=0;for(;u{const e=i.remove(t,n);for(const t in r)r[t].reindex(e)}))},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,a=r.length;let s,l,u=0;for(n.filters=0,l=0;lh)for(g=h,y=Math.min(f,p);gp)for(g=Math.max(f,p),y=d;gc)for(h=c,p=Math.min(l,f);hf)for(h=Math.max(l,f),p=u;hs[e]&n?null:a[e];return o.filter(o.MOD,u),i&i-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^l[e]&n?a[e]:null})),o.filter(o.REM,(e=>{const t=s[e]&n;return t&&!(t^t^l[e]&n)?a[e]:null}))):(o.filter(o.ADD,u),o.filter(o.REM,(e=>(s[e]&n)===i?a[e]:null))),o.filter(o.SOURCE,(e=>u(e._index)))}});var DR=Object.freeze({__proto__:null,crossfilter:ER,resolvefilter:AR});const SR="Literal",MR="Property",FR="ArrayExpression",OR="BinaryExpression",NR="CallExpression",TR="ConditionalExpression",zR="LogicalExpression",RR="MemberExpression",LR="ObjectExpression",PR="UnaryExpression";function jR(e){this.type=e}var BR,IR,UR,qR,WR;jR.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function(e){switch(e.type){case FR:return e.elements;case OR:case zR:return[e.left,e.right];case NR:return[e.callee].concat(e.arguments);case TR:return[e.test,e.consequent,e.alternate];case RR:return[e.object,e.property];case LR:return e.properties;case MR:return[e.key,e.value];case PR:return[e.argument];default:return[]}}(this),n=0,r=t.length;n",BR[VR]="Identifier",BR[YR]="Keyword",BR[XR]="Null",BR[JR]="Numeric",BR[ZR]="Punctuator",BR[QR]="String",BR[9]="RegularExpression";var KR="ArrayExpression",eL="BinaryExpression",tL="CallExpression",nL="ConditionalExpression",rL="Identifier",iL="Literal",oL="LogicalExpression",aL="MemberExpression",sL="ObjectExpression",lL="Property",uL="UnaryExpression",cL="Unexpected token %0",fL="Unexpected number",dL="Unexpected string",hL="Unexpected identifier",pL="Unexpected reserved word",mL="Unexpected end of input",gL="Invalid regular expression",yL="Invalid regular expression: missing /",vL="Octal literals are not allowed in strict mode.",bL="Duplicate data property in object literal not allowed in strict mode",xL="ILLEGAL",wL="Disabled.",_L=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$L=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function kL(e,t){if(!e)throw new Error("ASSERT: "+t)}function CL(e){return e>=48&&e<=57}function EL(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function AL(e){return"01234567".indexOf(e)>=0}function DL(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function SL(e){return 10===e||13===e||8232===e||8233===e}function ML(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&_L.test(String.fromCharCode(e))}function FL(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&$L.test(String.fromCharCode(e))}const OL={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function NL(){for(;UR1114111||"}"!==e)&&JL({},cL,xL),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),r=56320+(t-65536&1023),String.fromCharCode(n,r))}function RL(){var e,t;for(e=IR.charCodeAt(UR++),t=String.fromCharCode(e),92===e&&(117!==IR.charCodeAt(UR)&&JL({},cL,xL),++UR,(e=TL("u"))&&"\\"!==e&&ML(e.charCodeAt(0))||JL({},cL,xL),t=e);UR>>="===(r=IR.substr(UR,4))?{type:ZR,value:r,start:i,end:UR+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:ZR,value:n,start:i,end:UR+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:ZR,value:t,start:i,end:UR+=2}:("//"===t&&JL({},cL,xL),"<>=!+-*%&|^/".indexOf(a)>=0?(++UR,{type:ZR,value:a,start:i,end:UR}):void JL({},cL,xL))}function jL(){var e,t,n;if(kL(CL((n=IR[UR]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=UR,e="","."!==n){if(e=IR[UR++],n=IR[UR],"0"===e){if("x"===n||"X"===n)return++UR,function(e){let t="";for(;UR=0&&JL({},gL,n),{value:n,literal:t}}(),r=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";JL({},gL)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){JL({},gL)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:UR}}function IL(){if(NL(),UR>=qR)return{type:GR,start:UR,end:UR};const e=IR.charCodeAt(UR);return ML(e)?LL():40===e||41===e||59===e?PL():39===e||34===e?function(){var e,t,n,r,i="",o=!1;for(kL("'"===(e=IR[UR])||'"'===e,"String literal must starts with a quote"),t=UR,++UR;UR=0&&UR(kL(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function hP(){var e,t;return e=function(){var e,t,n,r,i,o,a,s,l,u;if(e=WR,l=fP(),0===(i=dP(r=WR)))return l;for(r.prec=i,UL(),t=[e,WR],o=[l,r,a=fP()];(i=dP(WR))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,l=o.pop(),t.pop(),n=WL(s,l,a),o.push(n);(r=UL()).prec=i,o.push(r),t.push(WR),n=fP(),o.push(n)}for(n=o[u=o.length-1],t.pop();u>1;)t.pop(),n=WL(o[u-1].value,o[u-2],n),u-=2;return n}(),KL("?")&&(UL(),t=hP(),QL(":"),e=function(e,t,n){const r=new jR(nL);return r.test=e,r.consequent=t,r.alternate=n,r}(e,t,hP())),e}function pP(){const e=hP();if(KL(","))throw new Error(wL);return e}function mP(e){UR=0,qR=(IR=e).length,WR=null,qL();const t=pP();if(WR.type!==GR)throw new Error("Unexpect token after expression.");return t}var gP={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function yP(e){function t(t,n,r){return i=>function(t,n,r,i){let o=e(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(i<0?"":0===i?"()":"("+n.slice(1).map(e).join(",")+")")}(t,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&uo("Missing arguments to clamp function."),t.length>3&&uo("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:i,test:t("test",i),if:function(t){t.length<3&&uo("Missing arguments to if function."),t.length>3&&uo("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function vP(e){const t=(e=e||{}).allowed?Ra(e.allowed):{},n=e.forbidden?Ra(e.forbidden):{},r=e.constants||gP,i=(e.functions||yP)(f),o=e.globalvar,a=e.fieldvar,s=Ko(o)?o:e=>`${o}["${e}"]`;let l={},u={},c=0;function f(e){if($a(e))return e;const t=d[e.type];return null==t&&uo("Unsupported type: "+e.type),t(e)}const d={Literal:e=>e.raw,Identifier:e=>{const i=e.name;return c>0?i:da(n,i)?uo("Illegal identifier: "+i):da(r,i)?r[i]:da(t,i)?i:(l[i]=1,s(i))},MemberExpression:e=>{const t=!e.computed,n=f(e.object);t&&(c+=1);const r=f(e.property);return n===a&&(u[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(r)]=1),t&&(c-=1),n+(t?"."+r:"["+r+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&uo("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=da(i,t)&&i[t];return r||uo("Unrecognized function: "+t),Ko(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(f).join(",")+"]",BinaryExpression:e=>"("+f(e.left)+" "+e.operator+" "+f(e.right)+")",UnaryExpression:e=>"("+e.operator+f(e.argument)+")",ConditionalExpression:e=>"("+f(e.test)+"?"+f(e.consequent)+":"+f(e.alternate)+")",LogicalExpression:e=>"("+f(e.left)+e.operator+f(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(f).join(",")+"}",Property:e=>{c+=1;const t=f(e.key);return c-=1,t+":"+f(e.value)}};function h(e){const t={code:f(e),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},t}return h.functions=i,h.constants=r,h}const bP=Symbol("vega_selection_getter");function xP(e){return e.getter&&e.getter[bP]||(e.getter=fo(e.field),e.getter[bP]=!0),e.getter}const wP="intersect",_P="union",$P="_vgsid_",kP=fo($P),CP="E",EP="R",AP="R-E",DP="R-LE",SP="R-RE",MP="index:unit";function FP(e,t){for(var n,r,i=t.fields,o=t.values,a=i.length,s=0;st.indexOf(e)>=0)):t},R_union:function(e,t){var n=No(t[0]),r=No(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]r&&(n=t[1],r=t[0]),e.length?rr&&(e[1]=r),e):[n,r]}};function RP(e,t,n,r){t[0].type!==SR&&uo("First argument to selection functions must be a string literal.");const i=t[0].value,o="unit",a="@"+o,s=":"+i;(t.length>=2&&Oo(t).value)!==wP||da(r,a)||(r[a]=n.getData(i).indataRef(n,o)),da(r,s)||(r[s]=n.getData(i).tuplesRef())}function LP(e){const t=this.context.data[e];return t?t.values.value:[]}const PP=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},jP=PP("format"),BP=PP("timeFormat"),IP=PP("utcFormat"),UP=PP("timeParse"),qP=PP("utcParse"),WP=new Date(2e3,0,1);function HP(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(WP.setYear(2e3),WP.setMonth(e),WP.setDate(t),BP.call(this,WP,n)):""}const GP="%",VP="$";function YP(e,t,n,r){t[0].type!==SR&&uo("First argument to data functions must be a string literal.");const i=t[0].value,o=":"+i;if(!da(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(e){}}function XP(e,t,n,r){if(t[0].type===SR)JP(n,r,t[0].value);else for(e in n.scales)JP(n,r,e)}function JP(e,t,n){const r=GP+n;if(!da(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function ZP(e,t){if(Ko(e))return e;if($a(e)){const n=t.scales[e];return n&&function(e){return e&&!0===e[Jb]}(n.value)?n.value:void 0}}function QP(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=XP,n._range=XP,n._scale=XP;const r=t=>"_["+(t.type===SR?Fa(GP+t.value):Fa(GP)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>`${r(e[0])}.range()`,_scale:t=>`${r(t[0])}(${e(t[1])})`}}function KP(e,t){return function(n,r,i){if(n){const t=ZP(n,(i||this).context);return t&&t.path[e](r)}return t(r)}}const ej=KP("area",(function(e){return kD=new fs,aD(e,CD),2*kD})),tj=KP("bounds",(function(e){var t,n,r,i,o,a,s;if(mD=pD=-(dD=hD=1/0),wD=[],aD(e,KD),n=wD.length){for(wD.sort(lS),t=1,o=[r=wD[0]];tsS(r[0],r[1])&&(r[1]=i[1]),sS(i[0],r[1])>sS(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=sS(r[1],i[0]))>a&&(a=s,dD=i[0],pD=r[1])}return wD=_D=null,dD===1/0||hD===1/0?[[NaN,NaN],[NaN,NaN]]:[[dD,hD],[pD,mD]]})),nj=KP("centroid",(function(e){LD=PD=jD=BD=ID=UD=qD=WD=0,HD=new fs,GD=new fs,VD=new fs,aD(e,cS);var t=+HD,n=+GD,r=+VD,i=HA(t,n,r);return isj(e,t)}const uj={};function cj(e){return Eo(e)||ArrayBuffer.isView(e)?e:null}function fj(e){return cj(e)||($a(e)?e:null)}const dj=e=>e.data;function hj(e,t){const n=LP.call(t,e);return n.root&&n.root.lookup||{}}const pj=()=>"undefined"!=typeof window&&window||null;function mj(e,t,n){if(!e)return[];const[r,i]=e,o=(new Bw).set(r[0],r[1],i[0],i[1]);return CC(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=Zo(e.marktype),r=Zo(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!r.length||r.some((t=>e.name===t)))}return t}(t))}const gj={random:()=>lh(),cumulativeNormal:gh,cumulativeLogNormal:_h,cumulativeUniform:Dh,densityNormal:mh,densityLogNormal:wh,densityUniform:Ah,quantileNormal:yh,quantileLogNormal:$h,quantileUniform:Sh,sampleNormal:ph,sampleLogNormal:xh,sampleUniform:Eh,isArray:Eo,isBoolean:va,isDate:ba,isDefined:e=>void 0!==e,isNumber:wa,isObject:Ao,isRegExp:_a,isString:$a,isTuple:bd,isValid:e=>null!=e&&e==e,toBoolean:Oa,toDate:e=>Ta(e),toNumber:No,toString:za,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rua(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:mj,clampRange:Qo,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=pj();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=pj();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return $b(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,r=this.context.data[e].input;return n.pulse(r,n.changeset().remove(yo).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?uw(n,t=t||Qx(e)):e}},panLinear:Bo,panLog:Io,panPow:Uo,panSymlog:qo,zoomLinear:Ho,zoomLog:Go,zoomPow:Vo,zoomSymlog:Yo,encode:function(e,t,n){if(e){const n=this.context.dataflow,r=e.mark.source;n.pulse(r,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],l=s.input,u=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(l.value.length||t||r))return 0;if((!d||d.stamp{s.modified=!0,a.pulse(l,d).run()}),!0,1)),n&&(c=!0===n?yo:Eo(n)||bd(n)?n:lj(n),d.remove(c)),t&&d.insert(t),r&&(c=lj(r),l.value.some(c)?d.remove(c):d.insert(r)),i)for(f in o)d.modify(i,f,o[f]);return 1},lassoAppend:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(e=Zo(e))[e.length-1];return void 0===i||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e},lassoPath:function(e){return Zo(e).reduce(((t,n,r)=>{let[i,o]=n;return t+(0==r?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:r,y:i,mark:o}=n,a=(new Bw).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[e,n]of t)ea.x2&&(a.x2=e),na.y2&&(a.y2=n);return a.translate(r,i),mj([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let r=0;for(let i=0,o=n.length-1;it!=s>t&&e<(a-l)*(t-u)/(s-u)+l&&r++}return 1&r}(e.x,e.y,t)))}},yj=["view","item","group","xy","x","y"],vj="this.",bj={},xj={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Fa(VP+e)}]`,functions:function(e){const t=yP(e);yj.forEach((e=>t[e]="event.vega."+e));for(const e in gj)t[e]=vj+e;return la(t,QP(e,gj,bj)),t},constants:gP,visitors:bj},wj=vP(xj);function _j(e,t,n){return 1===arguments.length?gj[e]:(gj[e]=t,n&&(bj[e]=n),wj&&(wj.functions[e]=vj+e),this)}function $j(e,t){const n={};let r;try{r=mP(e=$a(e)?e:Fa(e)+"")}catch(t){uo("Expression parse error: "+e)}r.visit((e=>{if(e.type!==NR)return;const r=e.callee.name,i=xj.visitors[r];i&&i(r,e.arguments,t,n)}));const i=wj(r);return i.globals.forEach((e=>{const r=VP+e;!da(n,r)&&t.getSignal(e)&&(n[r]=t.signalRef(e))})),{$expr:la({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}_j("bandwidth",(function(e,t){const n=ZP(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),XP),_j("copy",(function(e,t){const n=ZP(e,(t||this).context);return n?n.copy():void 0}),XP),_j("domain",(function(e,t){const n=ZP(e,(t||this).context);return n?n.domain():[]}),XP),_j("range",(function(e,t){const n=ZP(e,(t||this).context);return n&&n.range?n.range():[]}),XP),_j("invert",(function(e,t,n){const r=ZP(e,(n||this).context);return r?Eo(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}),XP),_j("scale",(function(e,t,n){const r=ZP(e,(n||this).context);return r?r(t):void 0}),XP),_j("gradient",(function(e,t,n,r,i){e=ZP(e,(i||this).context);const o=Wx(t,n);let a=e.domain(),s=a[0],l=Oo(a),u=po;return l-s?u=fx(e,s,l):e=(e.interpolator?Qb("sequential")().interpolator(e.interpolator()):Qb("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,l=1]),e.ticks&&(a=e.ticks(+r||15),s!==a[0]&&a.unshift(s),l!==Oo(a)&&a.push(l)),a.forEach((t=>o.stop(u(t),e(t)))),o}),XP),_j("geoArea",ej,XP),_j("geoBounds",tj,XP),_j("geoCentroid",nj,XP),_j("geoShape",(function(e,t,n){const r=ZP(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}}),XP),_j("geoScale",(function(e,t){const n=ZP(e,(t||this).context);return n&&n.scale()}),XP),_j("indata",(function(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(e,t,n,r){t[0].type!==SR&&uo("First argument to indata must be a string literal."),t[1].type!==SR&&uo("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,a="@"+o;da(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),_j("data",LP,YP),_j("treePath",(function(e,t,n){const r=hj(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(dj):void 0}),YP),_j("treeAncestors",(function(e,t){const n=hj(e,this)[t];return n?n.ancestors().map(dj):void 0}),YP),_j("vlSelectionTest",(function(e,t,n){for(var r,i,o,a,s,l=this.context.data[e],u=l?l.values.value:[],c=l?l[MP]&&l[MP].value:void 0,f=n===wP,d=u.length,h=0;h(e[o[n].field]=t,e)),{}))}else l=$P,u=kP(i),(f=(c=v[l]||(v[l]={}))[s]||(c[s]=[])).push(u),n&&(f=b[s]||(b[s]=[])).push({[$P]:u});if(t=t||_P,v[$P]?v[$P]=zP[`${$P}_${t}`](...Object.values(v[$P])):Object.keys(v).forEach((e=>{v[e]=Object.keys(v[e]).map((t=>v[e][t])).reduce(((n,r)=>void 0===n?r:zP[`${x[e]}_${t}`](n,r)))})),y=Object.keys(b),n&&y.length){v[r?"vlPoint":"vlMulti"]=t===_P?{or:y.reduce(((e,t)=>(e.push(...b[t]),e)),[])}:{and:y.map((e=>({or:b[e]})))}}return v}),RP),_j("vlSelectionTuples",(function(e,t){return e.map((e=>la(t.fields?{values:t.fields.map((t=>xP(t)(e.datum)))}:{[$P]:kP(e.datum)},t)))}));const kj=Ra(["rule"]),Cj=Ra(["group","image","rect"]);function Ej(e){return(e+"").toLowerCase()}function Aj(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var Dj={operator:(e,t)=>Aj(e,["_"],t.code),parameter:(e,t)=>Aj(e,["datum","_"],t.code),event:(e,t)=>Aj(e,["event"],t.code),handler:(e,t)=>Aj(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const e in r){const t="o["+Fa(e)+"]";i+=`$=${r[e].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(e,t){let n="";return kj[t]||(e.x2&&(e.x?(Cj[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Cj[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",Aj(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Fa).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=Function("a","b","var u, v; return "+e.map(((e,r)=>{const i=t[r];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+r]=e,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function Sj(e,t,n){if(!e||!Ao(e))return e;for(let r,i=0,o=Mj.length;ie&&e.$tupleid?xd:e));return t.fn[n]||(t.fn[n]=ta(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,r,i){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return xd}}];const Fj={skip:!0};function Oj(e,t,n,r){return new Nj(e,t,n,r)}function Nj(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||Dj,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Tj(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function zj(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}Nj.prototype=Tj.prototype={fork(){const e=new Tj(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),function(e){return"collect"===Ej(e)}(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let i=n.get(e.parent.$ref);i?(r.connect(i,[t]),t.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(e.parent.$ref),r.connect(i,[t]),t.targets().add(i)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const r in e.data){const i=n.data[r]||(n.data[r]={});e.data[r].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[Ej(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;!function(e){return"operator"===Ej(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||uo("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=Eo(i)?i.map((e=>Sj(e,n,t))):Sj(i,n,t)}return t},parseStream:function(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&uo("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function(e){var t,n=this,r=Ao(r=e.source)?r.$ref:r,i=n.get(r),o=e.update,a=void 0;i||uo("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,i,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach((n=>{const i=t.signals[n];e.signals(n,i)&&(r[n]=i.value)}))}if(e.data){var i=n.data={};Object.keys(t.data).forEach((n=>{const r=t.data[n];e.data(n,r)&&(i[n]=r.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach((e=>{n.update(t.signals[e],i[e],Fj)})),Object.keys(r||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(yo).insert(r[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const r=t.subcontext[n];r&&r.setState(e)}))}};const Rj="default";function Lj(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function Pj(e,t){var n=e._runtime.data;return da(n,t)||uo("Unrecognized data set: "+t),n[t]}function jj(e,t){Ad(t)||uo("Second argument to changes must be a changeset.");const n=Pj(this,e);return n.modified=!0,this.pulse(n.input,t)}function Bj(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function Ij(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Uj(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function qj(e,t,n){var r,i,o=e._renderer,a=o&&o.canvas();return a&&(i=Uj(e),(r=Q$(t.changedTouches?t.changedTouches[0]:t,a))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const r=t?"group"===t.mark.marktype?t:t.mark.group:null;function i(e){var n,i=r;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(e){if(!e)return n;$a(e)&&(e=i(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:aa(e),item:aa(t||{}),group:i,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,r),t}const Wj="view",Hj={trap:!1};function Gj(e,t,n,r){e._eventListeners.push({type:n,sources:Zo(t),handler:r})}function Vj(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return!(!1===r||Ao(r)&&!r[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function Yj(e){return e.item}function Xj(e){return e.item.mark.source}function Jj(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function Zj(e,t,n){const r=document.createElement(e);for(const e in t)r.setAttribute(e,t[e]);return null!=n&&(r.textContent=n),r}const Qj="vega-bind",Kj="vega-bind-name",eB="vega-bind-radio";function tB(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),Gj(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function nB(e,t,n,r){const i=r.signal(n.signal),o=Zj("div",{class:Qj}),a="radio"===n.input?o:o.appendChild(Zj("label"));a.appendChild(Zj("span",{class:Kj},n.name||n.signal)),t.appendChild(o);let s=rB;switch(n.input){case"checkbox":s=iB;break;case"select":s=oB;break;case"radio":s=aB;break;case"range":s=sB}s(e,a,n,i)}function rB(e,t,n,r){const i=Zj("input");for(const e in n)"signal"!==e&&"element"!==e&&i.setAttribute("input"===e?"type":e,n[e]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",(()=>e.update(i.value))),e.elements=[i],e.set=e=>i.value=e}function iB(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=Zj("input",i);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function oB(e,t,n,r){const i=Zj("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};lB(e,r)&&(n.selected=!0),i.appendChild(Zj("option",n,(o[t]||e)+""))})),t.appendChild(i),i.addEventListener("change",(()=>{e.update(n.options[i.selectedIndex])})),e.elements=[i],e.set=e=>{for(let t=0,r=n.options.length;t{const s={type:"radio",name:n.signal,value:t};lB(t,r)&&(s.checked=!0);const l=Zj("input",s);l.addEventListener("change",(()=>e.update(t)));const u=Zj("label",{},(o[a]||t)+"");return u.prepend(l),i.appendChild(u),l})),e.set=t=>{const n=e.elements,r=n.length;for(let e=0;e{l.textContent=s.value,e.update(+s.value)};s.addEventListener("input",u),s.addEventListener("change",u),e.elements=[s],e.set=e=>{s.value=e,l.textContent=e}}function lB(e,t){return e===t||e+""==t+""}function uB(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,Bj(e),Ij(e),Uj(e),i,o).background(e.background())}function cB(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function fB(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(n){t=null,e.error(n)}return t}const dB=e=>+e||0;function hB(e){return Ao(e)?{top:dB(e.top),bottom:dB(e.bottom),left:dB(e.left),right:dB(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(dB(e))}async function pB(e,t,n,r){const i=kC(t),o=i&&i.headless;return o||uo("Unrecognized renderer type: "+t),await e.runAsync(),uB(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}var mB="width",gB="height",yB="padding",vB={skip:!0};function bB(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===yB?r.left+r.right:0)}function xB(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===yB?r.top+r.bottom:0)}function wB(e,t){return t.modified&&Eo(t.input.value)&&e.indexOf("_:vega:_")}function _B(e,t){return!("parent"===e||t instanceof eh.proxy)}function $B(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function(e){return null==e?"":Eo(e)?kB(e):Ao(e)&&!ba(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+(Eo(n)?kB(n):CB(n))})).join("\n")):e+"";var t}(r))}function kB(e){return"["+e.map(CB).join(", ")+"]"}function CB(e){return Eo(e)?"[…]":Ao(e)&&!ba(e)?"{…}":e}function EB(e,t){const n=this;if(t=t||{},Zd.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const r=la({},e.locale,t.locale);n.locale(Bf(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||_C.Canvas,n._scenegraph=new H$;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||$B,n._redraw=!0,n._handler=(new wk).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=la({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{Eo(e[t])&&(e[t]=Ra(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(e,t,n){return Oj(e,eh,gj,n).parse(t)}(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:la({},e)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=bB(n,n._width),n._viewHeight=xB(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[mB],r=t[gB],i=t[yB];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=bB(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=xB(e,t.size),o()}),{size:r});const a=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Rj,item:null}));e.on(e.events("view","mousemove"),t,((e,n)=>{const r=t.value,i=r?$a(r)?r:r.user:Rj,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),e.add(null,(function(t){let n=t.cursor,r=this.value;return $a(n)||(r=n.item,n=n.user),Lj(e,n&&n!==Rj?n:r||n),r}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function AB(e,t){return da(e._signals,t)?e._signals[t]:uo("Unrecognized signal name: "+Fa(t))}function DB(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function SB(e,t,n,r){let i=DB(n,r);return i||(i=cB(e,(()=>r(t,n.value))),i.handler=r,e.on(n,null,i)),e}function MB(e,t,n){const r=DB(t,n);return r&&t._targets.remove(r),e}ga(EB,Zd,{async evaluate(e,t,n){if(await Zd.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(e){var t=Uj(e),n=Bj(e),r=Ij(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach((t=>{try{t(n,r)}catch(t){e.error(t)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&gd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&zj(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=AB(this,e);return 1===arguments.length?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",hB(e)):hB(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(kC(e)||uo("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Zd.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(AB(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(mB,n,vB),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(gB,r,vB),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||(r=cB(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return SB(this,e,AB(this,e),t)},removeSignalListener(e,t){return MB(this,AB(this,e),t)},addDataListener(e,t){return SB(this,e,Pj(this,e).values,t)},removeDataListener(e,t){return MB(this,Pj(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=Lj(this,null);this._globalCursor=!!e,t&&Lj(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var r=new oN,i=t;return null==t?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(e,t,n){t=+t,n=null==n?rN():+n,r._restart((function o(a){a+=i,r._restart(o,i+=t,n),e(a)}),t,n)},r.restart(e,t,n),r)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var r,i=this,o=new Rd(n),a=function(n,r){i.runAsync(null,(()=>{e===Wj&&function(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[t]:i?!i[t]:e.preventDefault()))}(i,t)&&n.preventDefault(),o.receive(qj(i,n,r))}))};if("timer"===e)Vj(i,"timer",t)&&i.timer(a,t);else if(e===Wj)Vj(i,"view",t)&&i.addEventListener(t,a,Hj);else if("window"===e?Vj(i,"window",t)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&Vj(i,"selector",t)&&(r=Array.from(document.querySelectorAll(e))),r){for(var s=0,l=r.length;s=0;)i[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",Yj),Xj,Jj(e)),this.on(this.events("view","mouseout",Yj),Xj,Jj(t)),this},data:function(e,t){return arguments.length<2?Pj(this,e).values.value:jj.call(this,e,Dd().remove(yo).insert(t))},change:jj,insert:function(e,t){return jj.call(this,e,Dd().insert(t))},remove:function(e,t){return jj.call(this,e,Dd().remove(t))},scale:function(e){var t=this._runtime.scales;return da(t,e)||uo("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=kC(r);e=n._el=e?fB(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),zj(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||wk,s=e?o.renderer:o.headless;return n._renderer=s?uB(n,n._renderer,e,s):null,n._handler=function(e,t,n,r){const i=new r(e.loader(),cB(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Uj(e),e);return t&&t.handlers().forEach((e=>{i.on(e.type,e.handler)})),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=fB(n,t,!0):e.appendChild(Zj("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==i&&(e.element=fB(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(r.signal)&&e.runAsync(null,(()=>{i.source=!0,e.signal(r.signal,t)}))}},r.debounce&&(i.update=sa(r.debounce,i.update))),(null==r.input&&r.element?tB:nB)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(e.signal(r.signal))})),i.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==_C.Canvas&&e!==_C.SVG&&e!==_C.PNG&&uo("Unrecognized image type: "+e);const n=await pB(this,e,t);return e===_C.SVG?function(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await pB(this,_C.Canvas,e,t)).canvas()},toSVG:async function(e){return(await pB(this,_C.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:wB,signals:_B,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this}});const FB="view",OB="[",NB="]",TB="{",zB="}",RB=":",LB=",",PB="@",jB=">",BB=/[[\]{}]/,IB={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let UB,qB;function WB(e,t,n){return UB=t||FB,qB=n||IB,GB(e.trim()).map(VB)}function HB(e,t,n,r,i){const o=e.length;let a,s=0;for(;t=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function GB(e){const t=[],n=e.length;let r=0,i=0;for(;i' after between selector: "+e;n=n.map(VB);const i=VB(e.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(e):function(e){const t={source:UB},n=[];let r,i,o=[0,0],a=0,s=0,l=e.length,u=0;if(e[l-1]===zB){if(u=e.lastIndexOf(TB),!(u>=0))throw"Unmatched right brace: "+e;try{o=function(e){const t=e.split(LB);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(u+1,l-1))}catch(t){throw"Invalid throttle specification: "+e}l=(e=e.slice(0,u).trim()).length,u=0}if(!l)throw e;e[0]===PB&&(a=++u);r=HB(e,u,RB),r1?(t.type=n[1],a?t.markname=n[0].slice(1):!function(e){return qB[e]}(n[0])?t.source=n[0]:t.marktype=n[0]):t.type=n[0];"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=i&&(t.filter=i);o[0]&&(t.throttle=o[0]);o[1]&&(t.debounce=o[1]);return t}(e)}function YB(e){return Ao(e)?e:{type:e||"pad"}}const XB=e=>+e||0,JB=e=>({top:e,bottom:e,left:e,right:e});function ZB(e){return Ao(e)?e.signal?e:{top:XB(e.top),bottom:XB(e.bottom),left:XB(e.left),right:XB(e.right)}:JB(XB(e))}const QB=e=>Ao(e)&&!Eo(e)?la({},e):{value:e};function KB(e,t,n,r){if(null!=n){return Ao(n)&&!Eo(n)||Eo(n)&&n.length&&Ao(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1}return 0}function eI(e,t,n){for(const n in t)KB(e,n,t[n]);for(const t in n)KB(e,t,n[t],"update")}function tI(e,t,n){for(const r in t)n&&da(n,r)||(e[r]=la(e[r]||{},t[r]));return e}function nI(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const rI="mark",iI="frame",oI="scope",aI="axis",sI="axis-domain",lI="axis-grid",uI="axis-label",cI="axis-tick",fI="axis-title",dI="legend",hI="legend-band",pI="legend-entry",mI="legend-gradient",gI="legend-label",yI="legend-symbol",vI="legend-title",bI="title",xI="title-text",wI="title-subtitle";function _I(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const $I=e=>$a(e)?Fa(e):e.signal?`(${e.signal})`:AI(e);function kI(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:Fa(e)));for(;t.length&&null==Oo(t);)t.pop();return t.unshift($I(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?CI("hcl",e.h,e.c,e.l):e.h||e.s?CI("hsl",e.h,e.s,e.l):e.l||e.a?CI("lab",e.l,e.a,e.b):e.r||e.g||e.b?CI("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?AI(e.field):void 0!==e.value?Fa(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=$I(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+EI(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${EI(e.exponent)})`),null!=e.mult&&(t+=`*${EI(e.mult)}`),null!=e.offset&&(t+=`+${EI(e.offset)}`),e.round&&(t=`round(${t})`),t}const CI=(e,t,n,r)=>`(${e}(${[t,n,r].map(kI).join(",")})+'')`;function EI(e){return Ao(e)?"("+kI(e)+")":e}function AI(e){return DI(Ao(e)?e:{datum:e})}function DI(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):uo("Invalid field reference: "+Fa(e));return e.signal||(r=$a(r)?co(r).map(Fa).join("]["):DI(r)),t+"["+r+"]"}function SI(e,t,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,r,i){const o={},a={};let s,l,u,c;for(l in l="lineBreak","text"!==t||null==i[l]||nI(l,e)||_I(o,l,i[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===iI?i.group:n===rI?la({},i.mark,i[t]):null,c)u=nI(l,e)||("fill"===l||"stroke"===l)&&(nI("fill",e)||nI("stroke",e)),u||_I(o,l,c[l]);for(l in Zo(r).forEach((t=>{const n=i.style&&i.style[t];for(const t in n)nI(t,e)||_I(o,t,n[t])})),e=la({},e),o)c=o[l],c.signal?(s=s||{})[l]=c:a[l]=c;return e.enter=la(a,e.enter),s&&(e.update=la(s,e.update)),e}(e,t,n,r,i.config);for(const n in e)a[n]=MI(e[n],t,o,i);return o}function MI(e,t,n,r){const i={},o={};for(const t in e)null!=e[t]&&(i[t]=FI((a=e[t],Eo(a)?function(e){let t="";return e.forEach((e=>{const n=kI(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===Oo(t)&&(t+="null"),t}(a):kI(a)),r,n,o));var a;return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function FI(e,t,n,r){const i=$j(e,t);return i.$fields.forEach((e=>r[e]=1)),la(n,i.$params),i.$expr}const OI="outer",NI=["value","update","init","react","bind"];function TI(e,t){uo(e+' for "outer" push: '+Fa(t))}function zI(e,t){const n=e.name;if(e.push===OI)t.signals[n]||TI("No prior signal definition",n),NI.forEach((t=>{void 0!==e[t]&&TI("Invalid property ",t)}));else{const r=t.addSignal(n,e.value);!1===e.react&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function RI(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function LI(e,t,n,r){return new RI(e,t,n,r)}function PI(e,t){return LI("operator",e,t)}function jI(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function BI(e,t){return t?{$field:e,$name:t}:{$field:e}}const II=BI("key");function UI(e,t){return{$compare:e,$order:t}}const qI="descending";function WI(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const HI="scope",GI="view";function VI(e){return e&&e.signal}function YI(e){if(VI(e))return!0;if(Ao(e))for(const t in e)if(YI(e[t]))return!0;return!1}function XI(e,t){return null!=e?e:t}function JI(e){return e&&e.signal||e}const ZI="timer";function QI(e,t){return(e.merge?KI:e.stream?eU:e.type?tU:uo("Invalid stream specification: "+Fa(e)))(e,t)}function KI(e,t){const n=nU({merge:e.merge.map((e=>QI(e,t)))},e,t);return t.addStream(n).id}function eU(e,t){const n=nU({stream:QI(e.stream,t)},e,t);return t.addStream(n).id}function tU(e,t){let n;e.type===ZI?(n=t.event(ZI,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===HI?GI:e||GI}(e.source),e.type);const r=nU({stream:n},e,t);return 1===Object.keys(r).length?n:t.addStream(r).id}function nU(e,t,n){let r=t.between;return r&&(2!==r.length&&uo('Stream "between" parameter must have 2 entries: '+Fa(t)),e.between=[QI(r[0],n),QI(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function(e,t,n){const r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===HI&&r.push("inScope(event.item)"),r.length&&(e.filter=$j("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const rU={code:"_.$value",ast:{type:"Identifier",value:"value"}};function iU(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||uo("Signal update missing events specification."),$a(o)&&(o=WB(o,t.isSubscope()?HI:GI)),o=Zo(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[oU(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&uo("Signal encode and update are mutually exclusive."),a="encode(item(),"+Fa(r)+")"),i.update=$a(a)?$j(a,t):null!=a.expr?$j(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:rU,$params:{$value:t.signalRef(a.signal)}}:uo("Invalid signal update specification."),e.force&&(i.options={force:!0}),s.forEach((e=>t.addUpdate(la(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):QI(e,t)}}(e,t),i))))}function oU(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const aU=e=>(t,n,r)=>LI(e,n,t||void 0,r),sU=aU("aggregate"),lU=aU("axisticks"),uU=aU("bound"),cU=aU("collect"),fU=aU("compare"),dU=aU("datajoin"),hU=aU("encode"),pU=aU("expression"),mU=aU("facet"),gU=aU("field"),yU=aU("key"),vU=aU("legendentries"),bU=aU("load"),xU=aU("mark"),wU=aU("multiextent"),_U=aU("multivalues"),$U=aU("overlap"),kU=aU("params"),CU=aU("prefacet"),EU=aU("projection"),AU=aU("proxy"),DU=aU("relay"),SU=aU("render"),MU=aU("scale"),FU=aU("sieve"),OU=aU("sortitems"),NU=aU("viewlayout"),TU=aU("values");let zU=0;const RU={min:"min",max:"max",count:"sum"};function LU(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=IU(e.domain,e,t),null!=e.range&&(n.range=XU(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=PU(e.type||e),null!=e.gamma&&(t.interpolateGamma=PU(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e){return Ao(e)?{interval:PU(e.interval),step:PU(e.step)}:PU(e)}(e.nice)),null!=e.bins&&(n.bins=function(e,t){return e.signal||Eo(e)?jU(e,t):t.objectProperty(e)}(e.bins,t)),e)da(n,r)||"name"===r||(n[r]=PU(e[r],t))}function PU(e,t){return Ao(e)?e.signal?t.signalRef(e.signal):uo("Unsupported object: "+Fa(e)):e}function jU(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>PU(e,t)))}function BU(e){uo("Can not find data set: "+Fa(e))}function IU(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Eo(e)?UU:e.fields?WU:qU)(e,t,n);null==t.domainMin&&null==t.domainMax||uo("No scale domain defined for domainMin/domainMax to override.")}function UU(e,t,n){return e.map((e=>PU(e,n)))}function qU(e,t,n){const r=n.getData(e.data);return r||BU(e.data),nx(t.type)?r.valuesRef(n,e.field,GU(e.sort,!1)):ax(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function WU(e,t,n){const r=e.data,i=e.fields.reduce(((e,t)=>(t=$a(t)?{data:r,field:t}:Eo(t)||t.signal?function(e,t){const n="_:vega:_"+zU++,r=cU({});if(Eo(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Fa(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,FU({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(nx(t.type)?HU:ax(t.type)?VU:YU)(e,n,i)}function HU(e,t,n){const r=GU(e.sort,!0);let i,o;const a=n.map((e=>{const n=t.getData(e.data);return n||BU(e.data),n.countsRef(t,e.field,r)})),s={groupby:II,pulse:a};r&&(i=r.op||"count",o=r.field?WI(i,r.field):"count",s.ops=[RU[i]],s.fields=[t.fieldRef(o)],s.as=[o]),i=t.add(sU(s));const l=t.add(cU({pulse:jI(i)}));return o=t.add(TU({field:II,sort:t.sortRef(r),pulse:jI(l)})),jI(o)}function GU(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!RU[e.op]&&uo("Multiple domain scales can not be sorted using "+e.op):uo("No field provided for sort aggregate op: "+e.op):Ao(e)?e.field="key":e={field:"key"}),e}function VU(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||BU(e.data),n.domainRef(t,e.field)}));return jI(t.add(_U({values:r})))}function YU(e,t,n){const r=n.map((e=>{const n=t.getData(e.data);return n||BU(e.data),n.extentRef(t,e.field)}));return jI(t.add(wU({extents:r})))}function XU(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if($a(i)){if(r&&da(r,i))return XU(e=la({},e,{range:r[i]}),t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=nx(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:uo("Unrecognized scale range value: "+Fa(i))}else{if(i.scheme)return n.scheme=Eo(i.scheme)?jU(i.scheme,t):PU(i.scheme,t),i.extent&&(n.schemeExtent=jU(i.extent,t)),void(i.count&&(n.schemeCount=PU(i.count,t)));if(i.step)return void(n.rangeStep=PU(i.step,t));if(nx(e.type)&&!Eo(i))return IU(i,e,t);Eo(i)||uo("Unsupported range type: "+Fa(i))}return i.map((e=>(Eo(e)?jU:PU)(e,t)))}function JU(e,t,n){return Eo(e)?e.map((e=>JU(e,t,n))):Ao(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:uo("Unsupported parameter object: "+Fa(e)):e}const ZU="top",QU="left",KU="right",eq="bottom",tq="center",nq="vertical",rq="start",iq="end",oq="index",aq="label",sq="offset",lq="perc",uq="perc2",cq="value",fq="guide-label",dq="guide-title",hq="group-title",pq="group-subtitle",mq="symbol",gq="gradient",yq="discrete",vq="size",bq=[vq,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],xq={name:1,style:1,interactive:1},wq={value:0},_q={value:1},$q="group",kq="rect",Cq="rule",Eq="symbol",Aq="text";function Dq(e){return e.type=$q,e.interactive=e.interactive||!1,e}function Sq(e,t){const n=(n,r)=>XI(e[n],XI(t[n],r));return n.isVertical=n=>nq===XI(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>XI(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>XI(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>XI(e.columns,XI(t.columns,+n.isVertical(!0))),n}function Mq(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Fq(e,t,n){return`item.anchor === '${rq}' ? ${e} : item.anchor === '${iq}' ? ${t} : ${n}`}const Oq=Fq(Fa(QU),Fa(KU),Fa(tq));function Nq(e,t){return t?e?Ao(e)?Object.assign({},e,{offset:Nq(e.offset,t)}):{value:e,offset:t}:t:e}function Tq(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=tI(e.encode,t,xq)):e.interactive=!1,e}function zq(e,t,n,r){const i=Sq(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let l,u,c,f,d;o?(u=[0,1],c=[0,0],f=a,d=s):(u=[0,0],c=[1,0],f=s,d=a);const h={enter:l={opacity:wq,x:wq,y:wq,width:QB(f),height:QB(d)},update:la({},l,{opacity:_q,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:wq}};return eI(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Tq({type:kq,role:mI,encode:h},r)}function Rq(e,t,n,r,i){const o=Sq(e,n),a=o.isVertical(),s=o.gradientThickness(),l=o.gradientLength();let u,c,f,d,h="";a?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:wq,fill:{scale:t,field:cq}};p[u]={signal:h+"datum."+lq,mult:l},p[c]=wq,p[f]={signal:h+"datum."+uq,mult:l},p[d]=QB(s);const m={enter:p,update:la({},p,{opacity:_q}),exit:{opacity:wq}};return eI(m,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Tq({type:kq,role:hI,key:cq,from:i,encode:m},r)}const Lq=`datum.${lq}<=0?"${QU}":datum.${lq}>=1?"${KU}":"${tq}"`,Pq=`datum.${lq}<=0?"${eq}":datum.${lq}>=1?"${ZU}":"middle"`;function jq(e,t,n,r){const i=Sq(e,t),o=i.isVertical(),a=QB(i.gradientThickness()),s=i.gradientLength();let l,u,c,f,d=i("labelOverlap"),h="";const p={enter:l={opacity:wq},update:u={opacity:_q,text:{field:aq}},exit:{opacity:wq}};return eI(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:XI(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=u.baseline={signal:Pq},c="y",f="x",h="1-"):(l.align=u.align={signal:Lq},l.baseline={value:"top"},c="x",f="y"),l[c]=u[c]={signal:h+"datum."+lq,mult:s},l[f]=u[f]=a,a.offset=XI(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:i("labelSeparation"),method:d,order:"datum."+oq}:void 0,Tq({type:Aq,role:gI,style:fq,key:cq,from:r,encode:p,overlap:d},n)}function Bq(e,t,n,r,i){const o=Sq(e,t),a=n.entries,s=!(!a||!a.interactive),l=a?a.name:void 0,u=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${sq} : datum.${vq}`,h=u?QB(u):{field:vq},p=`datum.${oq}`,m=`max(1, ${i})`;let g,y,v,b,x;h.mult=.5,g={enter:y={opacity:wq,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:_q,x:y.x,y:y.y},exit:{opacity:wq}};let w=null,_=null;e.fill||(w=t.symbolBaseFillColor,_=t.symbolBaseStrokeColor),eI(g,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),bq.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:cq})}));const $=Tq({type:Eq,role:yI,key:cq,from:f,clip:!!u||void 0,encode:g},n.symbols),k=QB(c);k.offset=o("labelOffset"),g={enter:y={opacity:wq,x:{signal:d,offset:k},y:h},update:v={opacity:_q,text:{field:aq},x:y.x,y:y.y},exit:{opacity:wq}},eI(g,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const C=Tq({type:Aq,role:gI,style:fq,key:cq,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!u},width:wq,height:u?QB(u):wq,opacity:wq},exit:{opacity:wq},update:v={opacity:_q,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${m})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${m})`,v.column.signal=`${p} % ${m}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,Dq({role:oI,from:r={facet:{data:r,name:"value",groupby:oq}},encode:tI(g,a,xq),marks:[$,C],name:l,interactive:s,sort:x})}const Iq='item.orient === "left"',Uq='item.orient === "right"',qq=`(${Iq} || ${Uq})`,Wq=`datum.vgrad && ${qq}`,Hq=Fq('"top"','"bottom"','"middle"'),Gq=`datum.vgrad && ${Uq} ? (${Fq('"right"','"left"','"center"')}) : (${qq} && !(datum.vgrad && ${Iq})) ? "left" : ${Oq}`,Vq=`item._anchor || (${qq} ? "middle" : "start")`,Yq=`${Wq} ? (${Iq} ? -90 : 90) : 0`,Xq=`${qq} ? (datum.vgrad ? (${Uq} ? "bottom" : "top") : ${Hq}) : "top"`;function Jq(e,t){let n;return Ao(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Zq(e.path)+")":e.sphere&&(n="geoShape("+Zq(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Zq(e){return Ao(e)&&e.signal?e.signal:Fa(e)}function Qq(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===$q?oI:t||rI:t}function Kq(e){return{marktype:e.type,name:e.name||void 0,role:e.role||Qq(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function eW(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function tW(e,t){const n=th(e.type);n||uo("Unrecognized transform type: "+Fa(e.type));const r=LI(n.type.toLowerCase(),null,nW(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function nW(e,t,n){const r={},i=e.params.length;for(let o=0;ooW(e,t,n)))):oW(e,r,n)}(e,t,n):"projection"===r?n.projectionRef(t[e.name]):e.array&&!VI(i)?i.map((t=>iW(e,t,n))):iW(e,i,n):void(e.required&&uo("Missing required "+Fa(t.type)+" parameter: "+Fa(e.name)))}function iW(e,t,n){const r=e.type;if(VI(t))return uW(r)?uo("Expression references can not be signals."):cW(r)?n.fieldRef(t):fW(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||cW(r);return i&&aW(t)?n.exprRef(t.expr,t.as):i&&sW(t)?BI(t.field,t.as):uW(r)?$j(t,n):lW(r)?jI(n.getData(t).values):cW(r)?BI(t):fW(r)?n.compareRef(t):t}}function oW(e,t,n){const r=e.params.length;let i;for(let n=0;ne&&e.expr,sW=e=>e&&e.field,lW=e=>"data"===e,uW=e=>"expr"===e,cW=e=>"field"===e,fW=e=>"compare"===e;function dW(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:jI(t.getData(e.data).output)}function hW(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function pW(e){return $a(e)?e:null}function mW(e,t,n){const r=WI(n.op,n.field);let i;if(t.ops){for(let e=0,n=t.as.length;enull==e?"null":e)).join(",")+"),0)",t);l.update=u.$expr,l.params=u.$params}function vW(e,t){const n=Qq(e),r=e.type===$q,i=e.from&&e.from.facet,o=e.overlap;let a,s,l,u,c,f,d,h=e.layout||n===oI||n===iI;const p=n===rI||h||i,m=function(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||uo("Only group marks can be faceted."),null!=r.field?a=s=dW(r,n):(e.data?s=jI(n.getData(e.data).aggregate):(o=tW(la({type:"aggregate",groupby:Zo(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=dW(r,n),a=s=jI(n.add(o))),i=n.keyRef(r.groupby,!0))):a=jI(n.add(cU(null,[{}]))),a||(a=dW(e,n)),{key:i,pulse:a,parent:s}}(e.from,r,t);s=t.add(dU({key:m.key||(e.key?BI(e.key):void 0),pulse:m.pulse,clean:!r}));const g=jI(s);s=l=t.add(cU({pulse:g})),s=t.add(xU({markdef:Kq(e),interactive:eW(e.interactive,t),clip:Jq(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:jI(s)}));const y=jI(s);s=u=t.add(hU(SI(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=tW(e,t),r=n.metadata;(r.generates||r.changes)&&uo("Mark transforms should not generate new data."),r.nomod||(u.params.mod=!0),n.params.pulse=jI(s),t.add(s=n)})),e.sort&&(s=t.add(OU({sort:t.compareRef(e.sort),pulse:jI(s)})));const v=jI(s);(i||h)&&(h=t.add(NU({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:v})),f=jI(h));const b=t.add(uU({mark:y,pulse:f||v}));d=jI(b),r&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(v,f||d,g),i?function(e,t,n){const r=e.from.facet,i=r.name,o=dW(r,t);let a;r.name||uo("Facet must have a name: "+Fa(r)),r.data||uo("Facet must reference a data set: "+Fa(r)),r.field?a=t.add(CU({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(mU({key:t.keyRef(r.groupby),group:jI(t.proxy(n.parent)),pulse:o})):uo("Facet must specify groupby or field: "+Fa(r));const s=t.fork(),l=s.add(cU()),u=s.add(FU({pulse:jI(l)}));s.addData(i,new hW(s,l,l,u)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,m):p?function(e,t,n){const r=t.add(CU({pulse:n.pulse})),i=t.fork();i.add(FU()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(b))),o&&(d=function(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:VI(o)?n.signalRef(o.signal):o,method:VI(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));if(i){const e=i.tolerance;a.boundTolerance=VI(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return jI(n.add($U(a)))}(o,d,t));const x=t.add(SU({pulse:d})),w=t.add(FU({pulse:jI(x)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new hW(t,l,x,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&uo("Marks only support modify triggers."),yW(e,t,c)})))}function bW(e,t){const n=t.config.legend,r=e.encode||{},i=Sq(e,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,u={};let c,f,d,h=0;bq.forEach((t=>e[t]?(u[t]=e[t],h=h||e[t]):0)),h||uo("Missing valid scale for legend.");const p=function(e,t){let n=e.type||mq;e.type||1!==function(e){return bq.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=tx(t)?gq:rx(t)?yq:mq);return n!==gq?n:rx(t)?yq:gq}(e,t.scaleType(h)),m={title:null!=e.title,scales:u,type:p,vgrad:"symbol"!==p&&i.isVertical()},g=jI(t.add(cU(null,[m]))),y=jI(t.add(vU(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===gq?(d=[zq(e,h,n,r.gradient),jq(e,n,r.labels,y)],f.count=f.count||t.signalRef(`max(2,2*floor((${JI(i.gradientLength())})/100))`)):p===yq?d=[Rq(e,h,n,r.gradient,y),jq(e,n,r.labels,y)]:(c=function(e,t){const n=Sq(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[Bq(e,n,r,y,JI(c.columns))],f.size=function(e,t,n){const r=JI(wW("size",e,n)),i=JI(wW("strokeWidth",e,n)),o=JI(function(e,t,n){return Mq("fontSize",e)||function(e,t,n){const r=t.config.style[n];return r&&r[e]}("fontSize",t,n)}(n[1].encode,t,fq));return $j(`max(ceil(sqrt(${r})+${i}),${o})`,t)}(e,t,d[0].marks)),d=[Dq({role:pI,from:g,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],m.title&&d.push(function(e,t,n,r){const i=Sq(e,t),o={enter:{opacity:wq},update:{opacity:_q,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:wq}};return eI(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Vq},angle:{signal:Yq},align:{signal:Gq},baseline:{signal:Xq},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Tq({type:Aq,role:vI,style:dq,from:r,encode:o},n)}(e,n,r.title,g)),vW(Dq({role:dI,from:g,encode:tI(xW(i,e,n),o,xq),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:l}),t)}function xW(e,t,n){const r={enter:{},update:{}};return eI(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function wW(e,t,n){return t[e]?`scale("${t[e]}",datum)`:Mq(e,n[0].encode)}hW.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s{n.push(tW(e,t))})),e.on&&e.on.forEach((n=>{yW(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const r=[];let i,o,a,s,l,u=null,c=!1,f=!1;e.values?VI(e.values)||YI(e.format)?(r.push(AW(t,e)),r.push(u=EW())):r.push(u=EW({$ingest:e.values,$format:e.format})):e.url?YI(e.url)||YI(e.format)?(r.push(AW(t,e)),r.push(u=EW())):r.push(u=EW({$request:e.url,$format:e.format})):e.source&&(u=i=Zo(e.source).map((e=>jI(t.getData(e).output))),r.push(null));for(o=0,a=n.length;oe===eq||e===ZU,SW=(e,t,n)=>VI(e)?RW(e.signal,t,n):e===QU||e===ZU?t:n,MW=(e,t,n)=>VI(e)?TW(e.signal,t,n):DW(e)?t:n,FW=(e,t,n)=>VI(e)?zW(e.signal,t,n):DW(e)?n:t,OW=(e,t,n)=>VI(e)?LW(e.signal,t,n):e===ZU?{value:t}:{value:n},NW=(e,t,n)=>VI(e)?PW(e.signal,t,n):e===KU?{value:t}:{value:n},TW=(e,t,n)=>jW(`${e} === '${ZU}' || ${e} === '${eq}'`,t,n),zW=(e,t,n)=>jW(`${e} !== '${ZU}' && ${e} !== '${eq}'`,t,n),RW=(e,t,n)=>IW(`${e} === '${QU}' || ${e} === '${ZU}'`,t,n),LW=(e,t,n)=>IW(`${e} === '${ZU}'`,t,n),PW=(e,t,n)=>IW(`${e} === '${KU}'`,t,n),jW=(e,t,n)=>(t=null!=t?QB(t):t,n=null!=n?QB(n):n,BW(t)&&BW(n)?{signal:`${e} ? (${t=t?t.signal||Fa(t.value):null}) : (${n=n?n.signal||Fa(n.value):null})`}:[la({test:e},t)].concat(n||[])),BW=e=>null==e||1===Object.keys(e).length,IW=(e,t,n)=>({signal:`${e} ? (${qW(t)}) : (${qW(n)})`}),UW=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${QU}' ? (${qW(r)}) : `:"")+(null!=n?`${e} === '${eq}' ? (${qW(n)}) : `:"")+(null!=i?`${e} === '${KU}' ? (${qW(i)}) : `:"")+(null!=t?`${e} === '${ZU}' ? (${qW(t)}) : `:"")+"(null)"}),qW=e=>VI(e)?e.signal:null==e?null:Fa(e),WW=(e,t)=>0===t?0:VI(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},HW=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function GW(e,t,n,r){let i;if(t&&da(t,e))return t[e];if(da(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[dq][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[fq][i]}return null}function VW(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function YW(e,t){return{scale:e.scale,range:t}}function XW(e,t,n,r,i){const o=Sq(e,t),a=e.orient,s=e.gridScale,l=SW(a,1,-1),u=function(e,t){if(1===t);else if(Ao(e)){let n=e=la({},e);for(;null!=n.mult;){if(!Ao(n.mult))return n.mult=VI(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=la({},n.mult)}n.mult=t}else e=VI(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,l);let c,f,d;const h={enter:c={opacity:wq},update:d={opacity:_q},exit:f={opacity:wq}};eI(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:cq,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},m=MW(a,{signal:"height"},{signal:"width"}),g=s?{scale:s,range:0,mult:l,offset:u}:{value:0,offset:u},y=s?{scale:s,range:1,mult:l,offset:u}:la(m,{mult:l,offset:u});return c.x=d.x=MW(a,p,g),c.y=d.y=FW(a,p,g),c.x2=d.x2=FW(a,y),c.y2=d.y2=MW(a,y),f.x=MW(a,p),f.y=FW(a,p),Tq({type:Cq,role:lI,key:cq,from:r,encode:h},n)}function JW(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function ZW(e,t,n,r){const i=Sq(e,t),o=e.orient,a=SW(o,-1,1);let s,l;const u={enter:s={opacity:wq,anchor:QB(i("titleAnchor",null)),align:{signal:Oq}},update:l=la({},s,{opacity:_q,text:QB(e.title)}),exit:{opacity:wq}},c={signal:`lerp(range("${e.scale}"), ${Fq(0,1,.5)})`};return l.x=MW(o,c),l.y=FW(o,c),s.angle=MW(o,wq,WW(a,90)),s.baseline=MW(o,OW(o,eq,ZU),{value:eq}),l.angle=s.angle,l.baseline=s.baseline,eI(u,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(e,t,n,r){const i=(e,t)=>null!=e?(n.update[t]=HW(QB(e),n.update[t]),!1):!nI(t,r),o=i(e("titleX"),"x"),a=i(e("titleY"),"y");n.enter.auto=a===o?QB(a):MW(t,QB(a),QB(o))}(i,o,u,n),u.update.align=HW(u.update.align,s.align),u.update.angle=HW(u.update.angle,s.angle),u.update.baseline=HW(u.update.baseline,s.baseline),Tq({type:Aq,role:fI,style:dq,from:r,encode:u},n)}function QW(e,t){const n=function(e,t){var n,r,i,o=t.config,a=o.style,s=o.axis,l="band"===t.scaleType(e.scale)&&o.axisBand,u=e.orient;if(VI(u)){const e=VW([o.axisX,o.axisY]),t=VW([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},e))n[i]=MW(u,GW(i,o.axisX,s,a),GW(i,o.axisY,s,a));for(i of(r={},t))r[i]=UW(u.signal,GW(i,o.axisTop,s,a),GW(i,o.axisBottom,s,a),GW(i,o.axisLeft,s,a),GW(i,o.axisRight,s,a))}else n=u===ZU||u===eq?o.axisX:o.axisY,r=o["axis"+u[0].toUpperCase()+u.slice(1)];return n||r||l?la({},s,n,r,l):s}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,l=Sq(e,n),u=function(e){const t=e("tickBand");let n,r,i=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},Ao(i)||(i={signal:`(${t.signal}) === 'extent' ? 0 : ${i}`})):"extent"===t?(n=1,r=!0,i=0):(n=.5,r=!1):(n=e("bandPosition"),r=e("tickExtra")),{extra:r,band:n,offset:i}}(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=e.title},f=jI(t.add(cU({},[c]))),d=jI(t.add(lU({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(XW(e,n,r.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(function(e,t,n,r,i,o){const a=Sq(e,t),s=e.orient,l=SW(s,-1,1);let u,c,f;const d={enter:u={opacity:wq},update:f={opacity:_q},exit:c={opacity:wq}};eI(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=QB(i);h.mult=l;const p={scale:e.scale,field:cq,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=u.y=MW(s,wq,p),f.y2=u.y2=MW(s,h),c.x=MW(s,p),f.x=u.x=FW(s,wq,p),f.x2=u.x2=FW(s,h),c.y=FW(s,p),Tq({type:Cq,role:cI,key:cq,from:r,encode:d},n)}(e,n,r.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,r,i,o){const a=Sq(e,t),s=e.orient,l=e.scale,u=SW(s,-1,1),c=JI(a("labelFlush")),f=JI(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===c||!!c;const g=QB(i);g.mult=u,g.offset=QB(a("labelPadding")||0),g.offset.mult=u;const y={scale:l,field:cq,band:.5,offset:Nq(o.offset,a("labelOffset"))},v=MW(s,m?JW(l,c,'"left"','"right"','"center"'):{value:"center"},NW(s,"left","right")),b=MW(s,OW(s,"bottom","top"),m?JW(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=JW(l,c,`-(${f})`,f,0);m=m&&f;const w={opacity:wq,x:MW(s,y,g),y:FW(s,y,g)},_={enter:w,update:p={opacity:_q,text:{field:aq},x:w.x,y:w.y,align:v,baseline:b},exit:{opacity:wq,x:w.x,y:w.y}};eI(_,{dx:!d&&m?MW(s,x):null,dy:!h&&m?FW(s,x):null}),eI(_,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const $=a("labelBound");let k=a("labelOverlap");return k=k||$?{separation:a("labelSeparation"),method:k,order:"datum.index",bound:$?{scale:l,orient:s,tolerance:$}:null}:void 0,p.align!==v&&(p.align=HW(p.align,v)),p.baseline!==b&&(p.baseline=HW(p.baseline,b)),Tq({type:Aq,role:uI,style:fq,key:cq,from:r,encode:_,overlap:k},n)}(e,n,r.labels,d,p,u))),c.domain&&h.push(function(e,t,n,r){const i=Sq(e,t),o=e.orient;let a,s;const l={enter:a={opacity:wq},update:s={opacity:_q},exit:{opacity:wq}};eI(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const u=YW(e,0),c=YW(e,1);return a.x=s.x=MW(o,u,wq),a.x2=s.x2=MW(o,c),a.y=s.y=FW(o,u,wq),a.y2=s.y2=FW(o,c),Tq({type:Cq,role:sI,from:r,encode:l},n)}(e,n,r.domain,f)),c.title&&h.push(ZW(e,n,r.title,f)),vW(Dq({role:aI,from:f,encode:tI(KW(l,e),i,xq),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:a,style:s}),t)}function KW(e,t){const n={enter:{},update:{}};return eI(n,{orient:e("orient"),offset:e("offset")||0,position:XI(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function eH(e,t,n){const r=Zo(e.signals),i=Zo(e.scales);return n||r.forEach((e=>zI(e,t))),Zo(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},r={};for(const n in e)"name"!==n&&(r[n]=JU(e[n],n,t));for(const e in n)null==r[e]&&(r[e]=JU(n[e],e,t));t.addProjection(e.name,r)}(e,t))),i.forEach((e=>function(e,t){const n=e.type||"linear";Kb(n)||uo("Unrecognized scale type: "+Fa(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),Zo(e.data).forEach((e=>CW(e,t))),i.forEach((e=>LU(e,t))),(n||r).forEach((e=>function(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?uo("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=$j(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach((e=>iU(e,t,n.id)))}(e,t))),Zo(e.axes).forEach((e=>QW(e,t))),Zo(e.marks).forEach((e=>vW(e,t))),Zo(e.legends).forEach((e=>bW(e,t))),e.title&&$W(e.title,t),t.parseLambdas(),t}const tH=e=>tI({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function nH(e,t){const n=t.config,r=jI(t.root=t.add(PI())),i=function(e,t){const n=n=>XI(e[n],t[n]),r=[rH("background",n("background")),rH("autosize",YB(n("autosize"))),rH("padding",ZB(n("padding"))),rH("width",n("width")||0),rH("height",n("height")||0)],i=r.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return Zo(e.signals).forEach((e=>{da(i,e.name)?e=la(i[e.name],e):r.push(e),o[e.name]=e})),Zo(t.signals).forEach((e=>{da(o,e.name)||da(i,e.name)||r.push(e)})),r}(e,n);i.forEach((e=>zI(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(cU()),a=t.add(hU(SI(tH(e.encode),$q,iI,e.style,t,{pulse:jI(o)}))),s=t.add(NU({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:jI(a)}));t.operators.pop(),t.pushState(jI(a),jI(s),null),eH(e,t,i),t.operators.push(s);let l=t.add(uU({mark:r,pulse:jI(s)}));return l=t.add(SU({pulse:jI(l)})),l=t.add(FU({pulse:jI(l)})),t.addData("root",new hW(t,o,o,l)),t}function rH(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function iH(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function oH(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function aH(e){return(Eo(e)?sH:lH)(e)}function sH(e){const t=e.length;let n="[";for(let r=0;r0?",":"")+(Ao(t)?t.signal||aH(t):Fa(t))}return n+"]"}function lH(e){let t,n,r="{",i=0;for(t in e)n=e[t],r+=(++i>1?",":"")+Fa(t)+":"+(Ao(n)?n.signal||aH(n):Fa(n));return r+"}"}iH.prototype=oH.prototype={parse(e){return eH(e,this)},fork(){return new oH(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof RI?jI(e):e;return this.add(AU({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let r,i;e&&(r=e.data||(e.data={}),i=r[t]||(r[t]=[]),i.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(jI(this.add(FU({pulse:e})))),this._parent.push(t),this._lookup.push(n?jI(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Oo(this._parent)},encode(){return Oo(this._encode)},lookup(){return Oo(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if($a(e))return BI(e,t);e.signal||uo("Unsupported field reference: "+Fa(e));const n=e.signal;let r=this.field[n];if(!r){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=r=jI(this.add(gU(e)))}return r},compareRef(e){let t=!1;const n=e=>VI(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Zo(e.field).map(n),i=Zo(e.order).map(n);return t?jI(this.add(fU({fields:r,orders:i}))):UI(r,i)},keyRef(e,t){let n=!1;const r=this.signals;return e=Zo(e).map((e=>VI(e)?(n=!0,jI(r[e.signal])):e)),n?jI(this.add(yU({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=WI(e.op,e.field),n=e.order||"ascending";return n.signal?jI(this.add(fU({fields:t,orders:this.signalRef(n.signal)}))):UI(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return da(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&uo("Duplicate signal name: "+Fa(e));const n=t instanceof RI?t:this.add(PI(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||uo("Unrecognized signal name: "+Fa(e)),this.signals[e]},signalRef(e){return this.signals[e]?jI(this.signals[e]):(da(this.lambdas,e)||(this.lambdas[e]=this.add(PI(null))),jI(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;tn+Math.floor(i*lh()),pdf:e=>e===Math.floor(e)&&e>=n&&e=r?1:(t-n+1)/i},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*i):NaN};return o.min(e).max(t)},randomKDE:bh,randomLCG:function(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}},randomLogNormal:kh,randomMixture:Ch,randomNormal:vh,randomUniform:Mh,regressionConstant:Fh,regressionExp:Ph,regressionLinear:Rh,regressionLoess:qh,regressionLog:Lh,regressionPoly:Ih,regressionPow:jh,regressionQuad:Bh,sampleCurve:Vh,sampleLogNormal:xh,sampleNormal:ph,sampleUniform:Eh,setRandom:function(e){lh=e},DATE:Xl,DAY:Jl,DAYOFYEAR:Zl,HOURS:Ql,MILLISECONDS:tu,MINUTES:Kl,MONTH:Vl,QUARTER:Gl,SECONDS:eu,TIME_UNITS:nu,WEEK:Yl,YEAR:Hl,dayofyear:uu,timeBin:Ku,timeFloor:Cu,timeInterval:Fu,timeOffset:Tu,timeSequence:Lu,timeUnitSpecifier:au,timeUnits:iu,utcFloor:Du,utcInterval:Ou,utcOffset:zu,utcSequence:Pu,utcdayofyear:mu,utcweek:gu,week:cu,format:cd,formats:fd,inferType:rd,inferTypes:id,loader:pd,read:hd,responseType:dd,typeParsers:ed,path:Im,Bounds:Bw,CanvasHandler:wk,CanvasRenderer:Ak,Gradient:Wx,GroupItem:Uw,Handler:K$,HybridHandler:vC,HybridRenderer:gC,Item:Iw,Marks:L$,RenderType:_C,Renderer:tk,ResourceLoader:qw,SVGHandler:Sk,SVGRenderer:eC,SVGStringRenderer:pC,Scenegraph:H$,boundClip:MC,boundContext:c_,boundItem:P$,boundMark:B$,boundStroke:Gw,domChild:X$,domClear:J$,domCreate:V$,domFind:Y$,font:S$,fontFamily:D$,fontSize:$$,intersect:CC,intersectBoxLine:w_,intersectPath:y_,intersectPoint:v_,intersectRule:x_,lineHeight:k$,markup:Gk,multiLineOffset:E$,pathCurves:Gx,pathEqual:NC,pathParse:Qx,pathRectangle:_w,pathRender:uw,pathSymbols:hw,pathTrail:$w,point:Q$,renderModule:kC,resetSVGClipId:Pw,resetSVGDefIds:function(){Pw(),jx=0},sceneEqual:OC,sceneFromJSON:q$,scenePickVisit:O_,sceneToJSON:U$,sceneVisit:F_,sceneZOrder:M_,serializeXML:Vk,setHybridRendererOptions:function(e){mC.svgMarkTypes=e.svgMarkTypes??["text"],mC.svgOnTop=e.svgOnTop??!0,mC.debug=e.debug??!1},textMetrics:y$});var cH={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},fH={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},dH={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const hH=Array.prototype.slice,pH=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,hH.call(t,1))};var mH={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return pH("join",arguments)},indexof:function(){return pH("indexOf",arguments)},lastindexof:function(){return pH("lastIndexOf",arguments)},slice:function(){return pH("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return pH("substring",arguments,String)},split:function(){return pH("split",arguments,String)},replace:function(){return pH("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const gH=["view","item","group","xy","x","y"],yH=new Set([Function,eval,setTimeout,setInterval]);"function"==typeof setImmediate&&yH.add(setImmediate);const vH={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:cH[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),!yH.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||mH[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>fH[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>dH[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const r=e(n.key);return e.memberDepth-=1,yH.has(e(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):t[r]=e(n.value),t}),{})};function bH(e,t,n,r,i,o){const a=e=>vH[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,gH.forEach((e=>a.fn[e]=function(){return i.vega[e](...arguments)})),a(e)}var xH={operator(e,t){const n=t.ast,r=e.functions;return e=>bH(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>bH(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>bH(n,r,void 0,void 0,e)},handler(e,t){const n=t.ast,r=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return bH(n,r,e,i,t)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,l=0;for(const n in r)s=bH(r[n].ast,i,t,a,void 0,e),e[n]!==s&&(e[n]=s,l=1);return"rule"!==n&&function(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,r,o),l}}},wH="5.16.1";function _H(e){return!!e.or}function $H(e){return!!e.and}function kH(e){return!!e.not}function CH(e,t){if(kH(e))CH(e.not,t);else if($H(e))for(const n of e.and)CH(n,t);else if(_H(e))for(const n of e.or)CH(n,t);else t(e)}function EH(e,t){return kH(e)?{not:EH(e.not,t)}:$H(e)?{and:e.and.map((e=>EH(e,t)))}:_H(e)?{or:e.or.map((e=>EH(e,t)))}:t(e)}const AH=structuredClone;function DH(e){throw new Error(e)}function SH(e,t){const n={};for(const r of t)da(e,r)&&(n[r]=e[r]);return n}function MH(e,t){const n={...e};for(const e of t)delete n[e];return n}function FH(e){if(wa(e))return e;const t=$a(e)?e:pG(e);if(t.length<250)return t;let n=0;for(let e=0;e0===t?e:`[${e}]`)),r=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of r)t.add(e)}return t}function UH(e,t){return void 0===e||void 0===t||BH(IH(e),IH(t))}function qH(e){return 0===WH(e).length}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>pG(e))).join(",")})`};const WH=Object.keys,HH=Object.values,GH=Object.entries;function VH(e){return!0===e||!1===e}function YH(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function XH(e,t){return kH(e)?`!(${XH(e.not,t)})`:$H(e)?`(${e.and.map((e=>XH(e,t))).join(") && (")})`:_H(e)?`(${e.or.map((e=>XH(e,t))).join(") || (")})`:t(e)}function JH(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&JH(e[n],t)&&delete e[n],qH(e)}function ZH(e){return e.charAt(0).toUpperCase()+e.substr(1)}function QH(e,t="datum"){const n=co(e),r=[];for(let e=1;e<=n.length;e++){const i=`[${n.slice(0,e).map(Fa).join("][")}]`;r.push(`${t}${i}`)}return r.join(" && ")}function KH(e,t="datum"){return`${t}[${Fa(co(e).join("."))}]`}function eG(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function tG(e){return`${co(e).map(eG).join("\\.")}`}function nG(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function rG(e){return`${co(e).join(".")}`}function iG(e){return e?co(e).length:0}function oG(...e){for(const t of e)if(void 0!==t)return t}let aG=42;function sG(e){const t=++aG;return e?String(e)+t:t}function lG(e){return uG(e)?e:`__${e}`}function uG(e){return e.startsWith("__")}function cG(e){if(void 0!==e)return(e%360+360)%360}function fG(e){return!!wa(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const dG=Object.getPrototypeOf(structuredClone({}));function hG(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!hG(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!hG(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==dG.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==dG.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(!hG(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function pG(e){const t=[];return function e(n){if(n&&n.toJSON&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!=typeof n)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i="[",r=0;rSY(e[t])?YH(`_${t}_${GH(e[t])}`):YH(`_${t}_${e[t]}`))).join("")}function EY(e){return!0===e||DY(e)&&!e.binned}function AY(e){return"binned"===e||DY(e)&&!0===e.binned}function DY(e){return Ao(e)}function SY(e){return e?.param}function MY(e){switch(e){case mG:case gG:case RG:case OG:case NG:case TG:case IG:case PG:case jG:case BG:case zG:return 6;case UG:return 4;default:return 10}}function FY(e){return!!e?.expr}function OY(e){const t=WH(e||{}),n={};for(const r of t)n[r]=UY(e[r]);return n}function NY(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:a,color:s,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=e,g={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},y={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...m,...s?{fill:s}:{}},subtitleMarkConfig:SH(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:g,subtitle:y}}function TY(e){return $a(e)||Eo(e)&&$a(e[0])}function zY(e){return!!e?.signal}function RY(e){return!!e.step}function LY(e){return!Eo(e)&&("field"in e&&"data"in e)}const PY=WH({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),jY={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},BY=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function IY(e){const t=Eo(e.condition)?e.condition.map(qY):qY(e.condition);return{...UY(e),condition:t}}function UY(e){if(FY(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function qY(e){if(FY(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function WY(e){if(FY(e)){const{expr:t,...n}=e;return{signal:t,...n}}return zY(e)?e:void 0!==e?{value:e}:void 0}function HY(e){return zY(e)?e.signal:Fa(e)}function GY(e){return zY(e)?e.signal:Fa(e.value)}function VY(e){return zY(e)?e.signal:null==e?null:Fa(e)}function YY(e,t,n){for(const r of n){const n=ZY(r,t.markDef,t.config);void 0!==n&&(e[r]=WY(n))}return e}function XY(e){return[].concat(e.type,e.style??[])}function JY(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==t[i]?t[i]:void 0!==t[e]?t[e]:!o||i&&i!==e?ZY(e,t,n,r):void 0}function ZY(e,t,n,{vgChannel:r}={}){return oG(r?QY(e,t,n.style):void 0,QY(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function QY(e,t,n){return KY(e,XY(t),n)}function KY(e,t,n){let r;t=Zo(t);for(const i of t){const t=n[i];t&&void 0!==t[e]&&(r=t[e])}return r}function eX(e,t){return Zo(e).reduce(((e,n)=>(e.field.push(xQ(n,t)),e.order.push(n.sort??"ascending"),e)),{field:[],order:[]})}function tX(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(hG(t,e))return;n.push(e)})),n}function nX(e,t){return hG(e,t)||!t?e:e?[...Zo(e),...Zo(t)].join(", "):t}function rX(e,t){const n=e.value,r=t.value;if(null==n||null===r)return{explicit:e.explicit,value:null};if((TY(n)||zY(n))&&(TY(r)||zY(r)))return{explicit:e.explicit,value:nX(n,r)};if(TY(n)||zY(n))return{explicit:e.explicit,value:n};if(TY(r)||zY(r))return{explicit:e.explicit,value:r};if(!(TY(n)||zY(n)||TY(r)||zY(r)))return{explicit:e.explicit,value:tX(n,r)};throw new Error("It should never reach here")}function iX(e){return`Invalid specification ${pG(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const oX='Autosize "fit" only works for single views and layered views.';function aX(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`}function sX(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function lX(e){return e?`Dropping "fit-${e}" because spec has discrete ${$V(e)}.`:'Dropping "fit" because spec has discrete size.'}function uX(e){return`Unknown field for ${e}. Cannot calculate view size.`}function cX(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function fX(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function dX(e){return`Selection not supported for ${e} yet.`}const hX="The same selection must be used to override scale domains in a layered view.";function pX(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function mX(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function gX(e){return`Ignoring an invalid transform: ${pG(e)}.`}function yX(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function vX(e){return`${e}Offset dropped because ${e} is continuous`}function bX(e){return`Invalid field type "${e}".`}function xX(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function wX(e,t){return`Dropping ${pG(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function _X(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function $X(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function kX(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function CX(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function EX(e){return`Using unaggregated domain with raw field has no effect (${pG(e)}).`}function AX(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function DX(e){return`Unaggregated domain is currently unsupported for log scale (${pG(e)}).`}function SX(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function MX(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const FX="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function OX(e,t){return`Invalid ${e}: ${pG(t)}.`}function NX(e){return`1D error band does not support ${e}.`}function TX(e){return`Channel ${e} is required for "binned" bin.`}const zX=Co(_o);let RX=zX;function LX(...e){RX.warn(...e)}function PX(e){if(e&&Ao(e))for(const t of GX)if(t in e)return!0;return!1}const jX=["january","february","march","april","may","june","july","august","september","october","november","december"],BX=jX.map((e=>e.substr(0,3))),IX=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],UX=IX.map((e=>e.substr(0,3)));function qX(e,t){const n=[];if(t&&void 0!==e.day&&WH(e).length>1&&(LX(function(e){return`Dropping day from datetime ${pG(e)} as day cannot be combined with other units.`}(e)),delete(e=AH(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const r=t?function(e){if(fG(e)&&(e=+e),wa(e))return e-1;{const t=e.toLowerCase(),n=jX.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=BX.indexOf(r);if(-1!==i)return i;throw new Error(OX("month",e))}}(e.month):e.month;n.push(r)}else if(void 0!==e.quarter){const r=t?function(e){if(fG(e)&&(e=+e),wa(e))return e>4&&LX(OX("quarter",e)),e-1;throw new Error(OX("quarter",e))}(e.quarter):e.quarter;n.push(wa(r)?3*r:`${r}*3`)}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const r=t?function(e){if(fG(e)&&(e=+e),wa(e))return e%7;{const t=e.toLowerCase(),n=IX.indexOf(t);if(-1!==n)return n;const r=t.substr(0,3),i=UX.indexOf(r);if(-1!==i)return i;throw new Error(OX("day",e))}}(e.day):e.day;n.push(wa(r)?r+1:`${r}+1`)}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const r=e[t];n.push(void 0===r?0:r)}return n}function WX(e){const t=qX(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const HX={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},GX=WH(HX);function VX(e){return Ao(e)?e.binned:YX(e)}function YX(e){return e&&e.startsWith("binned")}function XX(e){return e.startsWith("utc")}const JX={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function ZX(e){return GX.filter((t=>KX(e,t)))}function QX(e){const t=ZX(e);return t[t.length-1]}function KX(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function eJ(e,t,{end:n}={end:!1}){const r=QH(t),i=XX(e)?"utc":"";let o;const a={};for(const t of GX)KX(e,t)&&(a[t]="quarter"===(s=t)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=t);var s;return n&&(a[o]+="+1"),function(e){const t=qX(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function tJ(e){if(!e)return;return`timeUnitSpecifier(${pG(ZX(e))}, ${pG(JX)})`}function nJ(e){if(!e)return;let t;return $a(e)?t=YX(e)?{unit:e.substring(6),binned:!0}:{unit:e}:Ao(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),XX(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substring(3)}(t.unit)),t}function rJ(e,t=(e=>e)){const n=nJ(e),r=QX(n.unit);if(r&&"day"!==r){const e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:i,part:o}=oJ(r,n.step);return`${t(WX({...e,[o]:+e[o]+i}))} - ${t(WX(e))}`}}const iJ={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function oJ(e,t=1){if(function(e){return!!iJ[e]}(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:3*t};case"week":return{part:"date",step:7*t}}}function aJ(e){return!!e?.field&&void 0!==e.equal}function sJ(e){return!!e?.field&&void 0!==e.lt}function lJ(e){return!!e?.field&&void 0!==e.lte}function uJ(e){return!!e?.field&&void 0!==e.gt}function cJ(e){return!!e?.field&&void 0!==e.gte}function fJ(e){if(e?.field){if(Eo(e.range)&&2===e.range.length)return!0;if(zY(e.range))return!0}return!1}function dJ(e){return!!e?.field&&(Eo(e.oneOf)||Eo(e.in))}function hJ(e){return dJ(e)||aJ(e)||fJ(e)||sJ(e)||uJ(e)||lJ(e)||cJ(e)}function pJ(e,t){return LQ(e,{timeUnit:t,wrapTime:!0})}function mJ(e,t=!0){const{field:n}=e,r=nJ(e.timeUnit),{unit:i,binned:o}=r||{},a=xQ(e,{expr:"datum"}),s=i?`time(${o?a:eJ(i,n)})`:a;if(aJ(e))return`${s}===${pJ(e.equal,i)}`;if(sJ(e)){return`${s}<${pJ(e.lt,i)}`}if(uJ(e)){return`${s}>${pJ(e.gt,i)}`}if(lJ(e)){return`${s}<=${pJ(e.lte,i)}`}if(cJ(e)){return`${s}>=${pJ(e.gte,i)}`}if(dJ(e))return`indexof([${function(e,t){return e.map((e=>pJ(e,t)))}(e.oneOf,i).join(",")}], ${s}) !== -1`;if(function(e){return!!e?.field&&void 0!==e.valid}(e))return gJ(s,e.valid);if(fJ(e)){const{range:n}=e,r=zY(n)?{signal:`${n.signal}[0]`}:n[0],o=zY(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==r&&null!==o&&t)return"inrange("+s+", ["+pJ(r,i)+", "+pJ(o,i)+"])";const a=[];return null!==r&&a.push(`${s} >= ${pJ(r,i)}`),null!==o&&a.push(`${s} <= ${pJ(o,i)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${pG(e)}`)}function gJ(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function yJ(e){return hJ(e)&&e.timeUnit?{...e,timeUnit:nJ(e.timeUnit)}:e}function vJ(e){return"quantitative"===e||"temporal"===e}function bJ(e){return"ordinal"===e||"nominal"===e}const xJ="quantitative",wJ="ordinal",_J="temporal",$J="nominal",kJ="geojson";const CJ={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},EJ={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function AJ(e,t){const n=EJ[e],r=EJ[t];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const DJ={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function SJ(e){return DJ[e]}const MJ=new Set(["linear","log","pow","sqrt","symlog"]),FJ=new Set([...MJ,"time","utc"]);function OJ(e){return MJ.has(e)}const NJ=new Set(["quantile","quantize","threshold"]),TJ=new Set([...FJ,...NJ,"sequential","identity"]),zJ=new Set(["ordinal","bin-ordinal","point","band"]);function RJ(e){return zJ.has(e)}function LJ(e){return TJ.has(e)}function PJ(e){return FJ.has(e)}function jJ(e){return NJ.has(e)}function BJ(e){return e?.param}const{type:IJ,domain:UJ,range:qJ,rangeMax:WJ,rangeMin:HJ,scheme:GJ,...VJ}={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},YJ=WH(VJ);function XJ(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return PJ(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return PJ(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return PJ(e);case"nice":return PJ(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return LJ(e)&&!NH(["log","time","utc","threshold","quantile"],e)}}function JJ(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return iV(e)?void 0:`Cannot use the scale property "${t}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const ZJ={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},QJ=ZJ.arc,KJ=ZJ.area,eZ=ZJ.bar,tZ=ZJ.image,nZ=ZJ.line,rZ=ZJ.point,iZ=ZJ.rect,oZ=ZJ.rule,aZ=ZJ.text,sZ=ZJ.tick,lZ=ZJ.trail,uZ=ZJ.circle,cZ=ZJ.square,fZ=ZJ.geoshape;function dZ(e){return["line","area","trail"].includes(e)}function hZ(e){return["rect","bar","image","arc"].includes(e)}const pZ=new Set(WH(ZJ));function mZ(e){return e.type}const gZ=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],yZ=WH({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),vZ=WH({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function bZ(e){return e&&null!=e.band}const xZ={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},wZ={binSpacing:1,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},_Z={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5};function $Z(e){const{channel:t,channelDef:n,markDef:r,scale:i,config:o}=e,a=DZ(e);return aQ(n)&&!_Y(n.aggregate)&&i&&PJ(i.get("type"))?function({fieldDef:e,channel:t,markDef:n,ref:r,config:i}){if(dZ(n.type))return r;const o=JY("invalid",n,i);if(null===o)return[kZ(e,t),r];return r}({fieldDef:n,channel:t,markDef:r,ref:a,config:o}):a}function kZ(e,t){return{test:CZ(e,!0),..."y"===xV(t)?{field:{group:"height"}}:{value:0}}}function CZ(e,t=!0){return gJ($a(e)?e:xQ(e,{expr:"datum"}),!t)}function EZ(e,t,n,r){const i={};if(t&&(i.scale=t),lQ(e)){const{datum:t}=e;PX(t)?i.signal=WX(t):zY(t)?i.signal=t.signal:FY(t)?i.signal=t.expr:i.value=t}else i.field=xQ(e,n);if(r){const{offset:e,band:t}=r;e&&(i.offset=e),t&&(i.band=t)}return i}function AZ({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:a=.5}){const s=!zY(a)&&0YH(`${"unit"===e?"":`_${e}_`}${n[e]}`))).join(""):(t?"utc":"")+"timeunit"+WH(n).map((e=>YH(`_${e}_${n[e]}`))).join("")}(l),i=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}r&&(n=n?`${r}_${n}`:r)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),t.forAs?rG(n):t.expr?KH(n,t.expr)+o:tG(n)+o}function wQ(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return aQ(e)&&!!e.bin;case"temporal":return!1}throw new Error(bX(e.type))}const _Q=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(bY(t))return`${i} for argmax(${t.argmax})`;if(vY(t))return`${i} for argmin(${t.argmin})`;const o=r&&!VX(r)?nJ(r):void 0,a=t||o?.unit||o?.maxbins&&"timeunit"||EY(n)&&"bin";return a?`${a.toUpperCase()}(${i})`:i}(e);default:return function(e,t){const{field:n,bin:r,timeUnit:i,aggregate:o}=e;if("count"===o)return t.countTitle;if(EY(r))return`${n} (binned)`;if(i&&!VX(i)){const e=nJ(i)?.unit;if(e)return`${n} (${ZX(e).join("-")})`}else if(o)return bY(o)?`${n} for max ${o.argmax}`:vY(o)?`${n} for min ${o.argmin}`:`${ZH(o)} of ${n}`;return n}(e,t)}};let $Q=_Q;function kQ(e){$Q=e}function CQ(e,t,{allowDisabling:n,includeDefault:r=!0}){const i=EQ(e)?.title;if(!aQ(e))return i??e.title;const o=e,a=r?AQ(o,t):void 0;return n?oG(i,o.title,a):i??o.title??a}function EQ(e){return gQ(e)&&e.axis?e.axis:yQ(e)&&e.legend?e.legend:XZ(e)&&e.header?e.header:void 0}function AQ(e,t){return $Q(e,t)}function DQ(e){if(vQ(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const t=EQ(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function SQ(e){return aQ(e)?e:iQ(e)?e.condition:void 0}function MQ(e){return dQ(e)?e:oQ(e)?e.condition:void 0}function FQ(e,t,n,r={}){if($a(e)||wa(e)||va(e)){return LX(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${pG(n)}}.`}(t,$a(e)?"string":wa(e)?"number":"boolean",e)),{value:e}}return dQ(e)?OQ(e,t,n,r):oQ(e)?{...e,condition:OQ(e.condition,t,n,r)}:e}function OQ(e,t,n,r){if(vQ(e)){const{format:i,formatType:o,...a}=e;if(MZ(o)&&!n.customFormatTypes)return LX(yX(t)),OQ(a,t,n,r)}else{const i=gQ(e)?"axis":yQ(e)?"legend":XZ(e)?"header":null;if(i&&e[i]){const{format:o,formatType:a,...s}=e[i];if(MZ(a)&&!n.customFormatTypes)return LX(yX(t)),OQ({...e,[i]:s},t,n,r)}}return aQ(e)?NQ(e,t,r):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=wa(n)?"quantitative":$a(n)?"nominal":PX(n)?"temporal":void 0,{...e,type:t}}(e)}function NQ(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=e,s={...e};if(n||!r||xY(r)||bY(r)||vY(r)||(LX(function(e){return`Invalid aggregation operator "${e}".`}(r)),delete s.aggregate),i&&(s.timeUnit=nJ(i)),a&&(s.field=`${a}`),EY(o)&&(s.bin=TQ(o,t)),AY(o)&&!GV(t)&&LX(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),hQ(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case xJ:return"quantitative";case"t":case _J:return"temporal";case"o":case wJ:return"ordinal";case"n":case $J:return"nominal";case kJ:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&_Y(r)&&(LX(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,r)),s.type="quantitative")}else if(!bV(t)){const e=function(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(QZ(e)&&Eo(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!bY(n)&&!vY(n))return"quantitative";if(mQ(e)&&e.scale?.type)switch(EJ[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(hQ(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case mG:case gG:case yG:return wQ(e)?zQ:{compatible:!1,warning:$X(t)};case vG:case bG:case _G:case $G:case OG:case NG:case TG:case qG:case HG:case GG:case VG:case YG:case XG:case LG:case EG:case kG:case JG:return zQ;case SG:case FG:case DG:case MG:return n!==xJ?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:zQ;case PG:case jG:case BG:case IG:case RG:case AG:case CG:case xG:case wG:return"nominal"!==n||e.sort?zQ:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case zG:case UG:return wQ(e)||function(e){return mQ(e)&&jJ(e.scale?.type)}(e)?zQ:{compatible:!1,warning:kX(t)};case WG:return"nominal"!==e.type||"sort"in e?zQ:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&LX(n)}if(QZ(s)&&$a(s.sort)){const{sort:e}=s;if(WZ(e))return{...s,sort:{encoding:e}};const t=e.substr(1);if("-"===e.charAt(0)&&WZ(t))return{...s,sort:{encoding:t,order:"descending"}}}if(XZ(s)){const{header:e}=s;if(e){const{orient:t,...n}=e;if(t)return{...s,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}}return s}function TQ(e,t){return va(e)?{maxbins:MY(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:MY(t)}}const zQ={compatible:!0};function RQ(e){const{formatType:t}=DQ(e);return"time"===t||!t&&function(e){return e&&("temporal"===e.type||aQ(e)&&!!e.timeUnit)}(e)}function LQ(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){const o=t&&nJ(t)?.unit;let a,s=o||"temporal"===n;return FY(e)?a=e.expr:zY(e)?a=e.signal:PX(e)?(s=!0,a=WX(e)):($a(e)||wa(e))&&s&&(a=`datetime(${pG(e)})`,function(e){return!!HX[e]}(o)&&(wa(e)&&e<1e4||$a(e)&&isNaN(Date.parse(e)))&&(a=WX({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:pG(e)}function PQ(e,t){const{type:n}=e;return t.map((t=>{const r=LQ(t,{timeUnit:aQ(e)&&!VX(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:t}))}function jQ(e,t){return EY(e.bin)?cY(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const BQ={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function IQ(e){return e?.condition}const UQ=["domain","grid","labels","ticks","title"],qQ={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},WQ={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},HQ={...WQ,style:1,labelExpr:1,encoding:1};function GQ(e){return!!HQ[e]}const VQ=WH({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function YQ(e){return"mark"in e}class XQ{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!YQ(e)&&function(e){return mZ(e)?e.type:e}(e.mark)===this.name}}function JQ(e,t){const n=e&&e[t];return!!n&&(Eo(n)?TH(n,(e=>!!e.field)):aQ(n)||iQ(n))}function ZQ(e,t){const n=e&&e[t];return!!n&&(Eo(n)?TH(n,(e=>!!e.field)):aQ(n)||lQ(n)||oQ(n))}function QQ(e,t){if(GV(t)){const n=e[t];if((aQ(n)||lQ(n))&&(bJ(n.type)||aQ(n)&&n.timeUnit)){return ZQ(e,CV(t))}}return!1}function KQ(e){return TH(lV,(t=>{if(JQ(e,t)){const n=e[t];if(Eo(n))return TH(n,(e=>!!e.aggregate));{const e=SQ(n);return e&&!!e.aggregate}}return!1}))}function eK(e,t){const n=[],r=[],i=[],o=[],a={};return rK(e,((s,l)=>{if(aQ(s)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=s;if(c||d||f){const e=EQ(s),p=e?.title;let m=xQ(s,{forAs:!0});const g={...p?[]:{title:CQ(s,t,{allowDisabling:!0})},...h,field:m};if(c){let e;if(bY(c)?(e="argmax",m=xQ({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${u}`):vY(c)?(e="argmin",m=xQ({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${u}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};u&&(t.field=u),o.push(t)}}else if(n.push(m),hQ(s)&&EY(f)){if(r.push({bin:f,field:u,as:m}),n.push(xQ(s,{binSuffix:"end"})),jQ(s,l)&&n.push(xQ(s,{binSuffix:"range"})),GV(l)){const e={field:`${m}_end`};a[`${l}2`]=e}g.bin="binned",bV(l)||(g.type=xJ)}else if(d&&!VX(d)){i.push({timeUnit:d,field:u,as:m});const e=hQ(s)&&s.type!==_J&&"time";e&&(l===qG||l===VG?g.formatType=e:!function(e){return!!UV[e]}(l)?GV(l)&&(g.axis={formatType:e,...g.axis}):g.legend={formatType:e,...g.legend})}a[l]=g}else n.push(u),a[l]=e[l]}else a[l]=e[l]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function tK(e,t,n){const r=fY(t,n);if(!r)return!1;if("binned"===r){const n=e[t===xG?vG:bG];return!!(aQ(n)&&aQ(e[t])&&AY(n.bin))}return!0}function nK(e,t){const n={};for(const r of WH(e)){const i=FQ(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function rK(e,t,n){if(e)for(const r of WH(e)){const i=e[r];if(Eo(i))for(const e of i)t.call(n,e,r);else t.call(n,i,r)}}function iK(e,t){return WH(t).reduce(((n,r)=>{switch(r){case vG:case bG:case YG:case JG:case XG:case xG:case wG:case _G:case $G:case EG:case AG:case kG:case CG:case DG:case SG:case MG:case FG:case qG:case zG:case LG:case VG:return n;case WG:if("line"===e||"trail"===e)return n;case HG:case GG:{const e=t[r];if(Eo(e)||aQ(e))for(const t of Zo(e))t.aggregate||n.push(xQ(t,{}));return n}case RG:if("trail"===e)return n;case OG:case NG:case TG:case PG:case jG:case BG:case UG:case IG:{const e=SQ(t[r]);return e&&!e.aggregate&&n.push(xQ(e,{})),n}}}),[])}function oK(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map((({fieldPrefix:e,titlePrefix:n})=>{const i=r?` of ${aK(t)}`:"";return{field:e+t.field,type:t.type,title:zY(n)?{signal:`${n}"${escape(i)}"`}:n+i}})),o=function(e){const t=[];for(const n of WH(e))if(JQ(e,n)){const r=Zo(e[n]);for(const e of r)aQ(e)?t.push(e):iQ(e)&&t.push(e.condition)}return t}(n).map(bQ);return{tooltip:[...i,...PH(o,FH)]}}function aK(e){const{title:t,field:n}=e;return oG(t,n)}function sK(e,t,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:l,positionPrefix:u,endPositionPrefix:c,extraEncoding:f={}})=>{const d=aK(n);return lK(e,s,i,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...void 0!==d?{title:d}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...$a(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...r,...f}})}}function lK(e,t,n,r){const{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...a?{opacity:a}:{},...mZ(r.mark)?r.mark:{type:r.mark},style:`${s}-${String(t)}`,...va(e[t])?{}:e[t]}}]:[]}function uK(e,t,n){const{encoding:r}=e,i="vertical"===t?"y":"x",o=r[i],a=r[`${i}2`],s=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:cK(o,n),continuousAxisChannelDef2:cK(a,n),continuousAxisChannelDefError:cK(s,n),continuousAxisChannelDefError2:cK(l,n),continuousAxis:i}}function cK(e,t){if(e?.aggregate){const{aggregate:n,...r}=e;return n!==t&&LX(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),r}return e}function fK(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(mZ(n)&&n.orient)return n.orient;if(uQ(i)){if(uQ(o)){const e=aQ(i)&&i.aggregate,n=aQ(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return RQ(o)&&!RQ(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(uQ(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}const dK="boxplot",hK=new XQ(dK,mK);function pK(e){return wa(e)?"tukey":e}function mK(e,{config:t}){e={...e,encoding:nK(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...a}=e,s=mZ(n)?n:{type:n};i&&LX(dX("boxplot"));const l=s.extent??t.boxplot.extent,u=JY("size",s,t),c=s.invalid,f=pK(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:m,continuousAxis:g,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:_}=function(e,t,n){const r=fK(e,dK),{continuousAxisChannelDef:i,continuousAxis:o}=uK(e,r,dK),a=i.field,s=pK(t),l=[...gK(a),{op:"median",field:a,as:`mid_box_${a}`},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],u="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(Eo(t)){for(const e of t)e.aggregate?(r||(r=[]),r.push(e)):(i||(i=[]),i.push(e));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return Eo(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(f),{bins:p,timeUnits:m,aggregate:g,groupby:y,encoding:v}=eK(h,n),b="vertical"===r?"horizontal":"vertical",x=r,w=[...p,...m,{aggregate:[...g,...l],groupby:y},...u];return{bins:p,timeUnits:m,transform:w,groupby:y,aggregate:g,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(e,l,t),{color:$,size:k,...C}=b,E=e=>sK(s,g,m,e,t.boxplot),A=E(C),D=E(b),S=E({...C,...k?{size:k}:{}}),M=oK([{fieldPrefix:"min-max"===f?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===f?"lower_whisker_":"min_",titlePrefix:"Min"}],m,b),F={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},O="min-max"===f?M:oK([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,b),N=[...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O}),...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O}),...A({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:O}),...A({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:O})],T=[..."tukey"!==f?N:[],...D({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:w,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...S({partName:"median",mark:{type:"tick",invalid:c,...Ao(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if("min-max"===f)return{...a,transform:(a.transform??[]).concat(p),layer:T};const z=`datum["lower_box_${m.field}"]`,R=`datum["upper_box_${m.field}"]`,L=`(${R} - ${z})`,P=`${z} - ${l} * ${L}`,j=`${R} + ${l} * ${L}`,B=`datum["${m.field}"]`,I={joinaggregate:gK(m.field),groupby:y},U={transform:[{filter:`(${P} <= ${B}) && (${B} <= ${j})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${m.field}`},{op:"max",field:m.field,as:`upper_whisker_${m.field}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${m.field}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${m.field}`},...v],groupby:y}],layer:N},{tooltip:q,...W}=C,{scale:H,axis:G}=m,V=aK(m),Y=MH(G,["title"]),X=lK(s,"outliers",t.boxplot,{transform:[{filter:`(${B} < ${P}) || (${B} > ${j})`}],mark:"point",encoding:{[g]:{field:m.field,type:m.type,...void 0!==V?{title:V}:{},...void 0!==H?{scale:H}:{},...qH(Y)?{}:{axis:Y}},...W,...$?{color:$}:{},..._?{tooltip:_}:{}}})[0];let J;const Z=[...d,...h,I];return X?J={transform:Z,layer:[X,U]}:(J=U,J.transform.unshift(...Z)),{...a,layer:[J,{transform:p,layer:T}]}}function gK(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}const yK="errorbar",vK=new XQ(yK,bK);function bK(e,{config:t}){e={...e,encoding:nK(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:l,tooltipEncoding:u}=wK(e,yK,t);delete o.size;const c=sK(s,i,r,o,t.errorbar),f=s.thickness,d=s.size,h={type:"tick",orient:a,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==d?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function xK(e,t){const{encoding:n}=e;if(function(e){return(dQ(e.x)||dQ(e.y))&&!dQ(e.x2)&&!dQ(e.y2)&&!dQ(e.xError)&&!dQ(e.xError2)&&!dQ(e.yError)&&!dQ(e.yError2)}(n))return{orient:fK(e,t),inputType:"raw"};const r=function(e){return dQ(e.x2)||dQ(e.y2)}(n),i=function(e){return dQ(e.xError)||dQ(e.xError2)||dQ(e.yError)||dQ(e.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,r=n.y2;if(dQ(e)&&dQ(r))throw new Error(`${t} cannot have both x2 and y2`);if(dQ(e)){if(uQ(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(dQ(r)){if(uQ(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(dQ(r)&&!dQ(e))throw new Error(`${t} cannot have xError2 without xError`);if(dQ(s)&&!dQ(i))throw new Error(`${t} cannot have yError2 without yError`);if(dQ(e)&&dQ(i))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(dQ(e)){if(uQ(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(dQ(i)){if(uQ(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function wK(e,t,n){const{mark:r,encoding:i,params:o,projection:a,...s}=e,l=mZ(r)?r:{type:r};o&&LX(dX(t));const{orient:u,inputType:c}=xK(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:m}=uK(e,u,t),{errorBarSpecificAggregate:g,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(e,t,n,r,i,o,a,s){let l=[],u=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&LX(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)l=[{op:n,field:c,as:`extent_${c}`},{op:t,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:ZH(t)},{fieldPrefix:"upper_",titlePrefix:_K(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:_K(t,n,"-")}],d=!0;else{let e,t,r;"ci"===n?(e="mean",t="ci0",r="ci1"):(e="median",t="q1",r="q3"),l=[{op:t,field:c,as:`lower_${c}`},{op:r,field:c,as:`upper_${c}`},{op:e,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:CQ({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:CQ({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:CQ({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&LX(function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}(e.center,e.extent)),"aggregated-upper-lower"===o?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:`upper_${c}`}],i?u.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:`lower_${c}`}));for(const e of u)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:nG(nG(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,f,d,h,p,c,t,n),{[m]:x,["x"===m?"x2":"y2"]:w,["x"===m?"xError":"yError"]:_,["x"===m?"xError2":"yError2"]:$,...k}=i,{bins:C,timeUnits:E,aggregate:A,groupby:D,encoding:S}=eK(k,n),M=[...A,...g],F="raw"!==c?[]:D,O=oK(v,f,S,b);return{transform:[...s.transform??[],...C,...E,...0===M.length?[]:[{aggregate:M,groupby:F}],...y],groupby:F,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:S,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:s,tooltipEncoding:O}}function _K(e,t,n){return`${ZH(e)} ${n} ${t}`}const $K="errorband",kK=new XQ($K,CK);function CK(e,{config:t}){e={...e,encoding:nK(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:l}=wK(e,$K,t),u=a,c=sK(u,i,r,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?LX(NX("interpolate")):u.tension&&LX(NX("tension")),{...s,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const EK={};function AK(e,t,n){const r=new XQ(e,t);EK[e]={normalizer:r,parts:n}}AK(dK,mK,["box","median","outliers","rule","ticks"]),AK(yK,bK,["ticks","rule"]),AK($K,CK,["band","borders"]);const DK=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],SK={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},MK={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},FK=WH(SK),OK=WH(MK),NK=WH({header:1,headerRow:1,headerColumn:1,headerFacet:1}),TK=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],zK="_vgsid_",RK={point:{on:"click",fields:[zK],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function LK(e){return"legend"===e||!!e?.legend}function PK(e){return LK(e)&&Ao(e)}function jK(e){return!!e?.select}function BK(e){const t=[];for(const n of e||[]){if(jK(n))continue;const{expr:e,bind:r,...i}=n;if(r&&e){const n={...i,bind:r,init:e};t.push(n)}else{const n={...i,...e?{update:e}:{},...r?{bind:r}:{}};t.push(n)}}return t}function IK(e){return"concat"in e}function UK(e){return"vconcat"in e}function qK(e){return"hconcat"in e}function WK({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function HK(e){return Ao(e)&&void 0!==e.step}function GK(e){return e.view||e.width||e.height}const VK=WH({align:1,bounds:1,center:1,columns:1,spacing:1});function YK(e,t){return e[t]??e["width"===t?"continuousWidth":"continuousHeight"]}function XK(e,t){const n=JK(e,t);return HK(n)?n.step:ZK}function JK(e,t){return oG(e[t]??e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const ZK=20,QK={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:ZK},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:wZ,circle:{},geoshape:{},image:{},line:{},point:{},rect:_Z,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:RK,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},KK=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],e0={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},t0={blue:KK[0],orange:KK[1],red:KK[2],teal:KK[3],green:KK[4],yellow:KK[5],purple:KK[6],pink:KK[7],brown:KK[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function n0(e){const t=WH(e||{}),n={};for(const r of t){const t=e[r];n[r]=IQ(t)?IY(t):UY(t)}return n}const r0=[...vZ,...VQ,...NK,"background","padding","legend","lineBreak","scale","style","title","view"];function i0(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,a=So({},AH(QK),n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:Ao(e)?{...t0,...e}:t0}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},r?function(e){return{signals:[{name:"fontSize",value:Ao(e)?{...e0,...e}:e0}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(r):{},o||{});i&&Mo(a,"selection",i,!0);const s=MH(a,r0);for(const e of["background","lineBreak","padding"])a[e]&&(s[e]=UY(a[e]));for(const e of vZ)a[e]&&(s[e]=OY(a[e]));for(const e of VQ)a[e]&&(s[e]=n0(a[e]));for(const e of NK)a[e]&&(s[e]=OY(a[e]));return a.legend&&(s.legend=OY(a.legend)),a.scale&&(s.scale=OY(a.scale)),a.style&&(s.style=function(e){const t=WH(e),n={};for(const r of t)n[r]=n0(e[r]);return n}(a.style)),a.title&&(s.title=OY(a.title)),a.view&&(s.view=OY(a.view)),s}const o0=new Set(["view",...pZ]),a0=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],s0={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]};function l0(e){e=AH(e);for(const t of a0)delete e[t];if(e.axis)for(const t in e.axis)IQ(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of DK)delete e.legend[t];if(e.mark){for(const t of yZ)delete e.mark[t];e.mark.tooltip&&Ao(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(BK(e.params)),delete e.params);for(const t of o0){for(const n of yZ)delete e[t][n];const n=s0[t];if(n)for(const r of n)delete e[t][r];u0(e,t)}for(const t of WH(EK))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=NY(e.title);qH(t)||(e.style["group-title"]={...e.style["group-title"],...t});qH(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n});qH(r)?delete e.title:e.title=r}(e);for(const t in e)Ao(e[t])&&qH(e[t])&&delete e[t];return qH(e)?void 0:e}function u0(e,t,n,r){"view"===t&&(n="cell");const i={...r?e[t][r]:e[t],...e.style[n??t]};qH(i)||(e.style[n??t]=i),r||delete e[t]}function c0(e){return"layer"in e}class f0{map(e,t){return JZ(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):qK(e)?this.mapHConcat(e,t):UK(e)?this.mapVConcat(e,t):IK(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(c0(e))return this.mapLayer(e,t);if(YQ(e))return this.mapUnit(e,t);throw new Error(iX(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...r}=e;return{...r,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}const d0={zero:1,center:1,normalize:1};const h0=new Set([QJ,eZ,KJ,oZ,rZ,uZ,cZ,nZ,aZ,sZ]),p0=new Set([eZ,KJ,QJ]);function m0(e){return aQ(e)&&"quantitative"===sQ(e)&&!e.bin}function g0(e,t,{orient:n,type:r}){const i="x"===t?"y":"radius",o="x"===t,a=e[t],s=e[i];if(aQ(a)&&aQ(s))if(m0(a)&&m0(s)){if(a.stack)return t;if(s.stack)return i;const e=aQ(a)&&!!a.aggregate;if(e!==(aQ(s)&&!!s.aggregate))return e?t:i;if(o&&["bar","area"].includes(r)){if("vertical"===n)return i;if("horizontal"===n)return t}}else{if(m0(a))return t;if(m0(s))return i}else{if(m0(a))return t;if(m0(s))return i}}function y0(e,t){const n=mZ(e)?e:{type:e},r=n.type;if(!h0.has(r))return null;const i=g0(t,"x",n)||g0(t,"theta",n);if(!i)return null;const o=t[i],a=aQ(o)?xQ(o,{}):void 0,s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),l=[],u=new Set;if(t[s]){const e=t[s],n=aQ(e)?xQ(e,{}):void 0;n&&n!==a&&(l.push(s),u.add(n))}const c="x"===s?"xOffset":"yOffset",f=t[c],d=aQ(f)?xQ(f,{}):void 0;d&&d!==a&&(l.push(c),u.add(d));const h=qV.reduce(((e,n)=>{if("tooltip"!==n&&JQ(t,n)){const r=t[n];for(const t of Zo(r)){const r=SQ(t);if(r.aggregate)continue;const i=xQ(r,{});i&&u.has(i)||e.push({channel:n,fieldDef:r})}}return e}),[]);let p;return void 0!==o.stack?p=va(o.stack)?o.stack?"zero":null:o.stack:p0.has(r)&&(p="zero"),p&&p in d0?KQ(t)&&0===h.length?null:o?.scale?.type&&o?.scale?.type!==CJ.LINEAR?(o?.stack&&LX(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type)),null):dQ(t[_V(i)])?(void 0!==o.stack&&LX(`Cannot stack "${m=i}" if there is already "${m}2".`),null):(aQ(o)&&o.aggregate&&!$Y.has(o.aggregate)&&LX(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:l,groupbyFields:u,fieldChannel:i,impute:null!==o.impute&&dZ(r),stackBy:h,offset:p}):null;var m}function v0(e,t,n){const r=OY(e),i=JY("orient",r,n);if(r.orient=function(e,t,n){switch(e){case rZ:case uZ:case cZ:case aZ:case iZ:case tZ:return}const{x:r,y:i,x2:o,y2:a}=t;switch(e){case eZ:if(aQ(r)&&(AY(r.bin)||aQ(i)&&i.aggregate&&!r.aggregate))return"vertical";if(aQ(i)&&(AY(i.bin)||aQ(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(aQ(r)&&r.type===xJ&&!EY(r.bin)||fQ(r))&&aQ(i)&&AY(i.bin)?"horizontal":"vertical";if(!a)return(aQ(i)&&i.type===xJ&&!EY(i.bin)||fQ(i))&&aQ(r)&&AY(r.bin)?"vertical":"horizontal"}case oZ:if(o&&(!aQ(r)||!AY(r.bin))&&a&&(!aQ(i)||!AY(i.bin)))return;case KJ:if(a)return aQ(i)&&AY(i.bin)?"horizontal":"vertical";if(o)return aQ(r)&&AY(r.bin)?"vertical":"horizontal";if(e===oZ){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case nZ:case sZ:{const t=cQ(r),o=cQ(i);if(n)return n;if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o)return"vertical";{const e=hQ(r)&&r.type===_J,t=hQ(i)&&i.type===_J;if(e&&!t)return"vertical";if(!e&&t)return"horizontal"}return}}return"vertical"}(r.type,t,i),void 0!==i&&i!==r.orient&&LX(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const e=JY("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:xZ[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===JY("opacity",r,n)&&(r.opacity=function(e,t){if(NH([rZ,sZ,uZ,cZ],e)&&!KQ(t))return.7;return}(r.type,t));return void 0===JY("cursor",r,n)&&(r.cursor=function(e,t,n){if(t.href||e.href||JY("href",e,n))return"pointer";return e.cursor}(r,t,n)),r}function b0(e){const{point:t,line:n,...r}=e;return WH(r).length>1?r:r.type}function x0(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:MH(e[t],["point","line"])});return e}function w0(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?Ao(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?Ao(t.point)?t.point:{}:void 0}function _0(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class $0{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(YQ(e)){const{mark:n,encoding:r}=e,i=mZ(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!w0(i,t[i.type],r);case"area":return!!w0(i,t[i.type],r)||!!_0(i,t[i.type])}}return!1}run(e,t,n){const{config:r}=t,{params:i,projection:o,mark:a,name:s,encoding:l,...u}=e,c=nK(l,r),f=mZ(a)?a:{type:a},d=w0(f,r[f.type],c),h="area"===f.type&&_0(f,r[f.type]),p=[{name:s,...i?{params:i}:{},mark:b0({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:MH(c,["shape"])}],m=y0(v0(f,c,r),c);let g=c;if(m){const{fieldChannel:e,offset:t}=m;g={...c,[e]:{...c[e],...t?{stack:t}:{}}}}return g=MH(g,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...SH(f,["clip","interpolate","tension","tooltip"]),...h},encoding:g}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...SH(f,["clip","tooltip"]),...d},encoding:g}),n({...u,layer:p},{...t,config:x0(r)})}}function k0(e,t){return t?YZ(e)?M0(e,t):A0(e,t):e}function C0(e,t){return t?M0(e,t):e}function E0(e,t,n){const r=t[e];return function(e){return e&&!$a(e)&&"repeat"in e}(r)?r.repeat in n?{...t,[e]:n[r.repeat]}:void LX(function(e){return`Unknown repeated value "${e}".`}(r.repeat)):t}function A0(e,t){if(void 0!==(e=E0("field",e,t))){if(null===e)return null;if(QZ(e)&&GZ(e.sort)){const n=E0("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function D0(e,t){if(aQ(e))return A0(e,t);{const n=E0("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function S0(e,t){if(!dQ(e)){if(oQ(e)){const n=D0(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=D0(e,t);if(n)return n;if(rQ(e))return{condition:e.condition}}}function M0(e,t){const n={};for(const r in e)if(da(e,r)){const i=e[r];if(Eo(i))n[r]=i.map((e=>S0(e,t))).filter((e=>e));else{const e=S0(i,t);void 0!==e&&(n[r]=e)}}return n}class F0{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(YQ(e)){const{encoding:t,mark:n}=e;if("line"===n||mZ(n)&&"line"===n.type)for(const e of vV){const n=t[xV(e)];if(t[e]&&(aQ(n)&&!AY(n.bin)||lQ(n)))return!0}}return!1}run(e,t,n){const{encoding:r,mark:i}=e;var o,a;return LX((o=!!r.x2,a=!!r.y2,`Line mark is for continuous lines and thus cannot be used with ${o&&a?"x2 and y2":o?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n({...e,mark:Ao(i)?{...i,type:"rule"}:"rule"},t)}}function O0({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...WH(e),...WH(t)]);for(const o of i){const i=t[o],a=e[o];if(dQ(i)){const e={...a,...i};r[o]=e}else oQ(i)?r[o]={...i,condition:{...a,...i.condition}}:i||null===i?r[o]=i:(n||pQ(a)||zY(a)||dQ(a)||Eo(a))&&(r[o]=a)}}else r=t;return!r||qH(r)?void 0:r}function N0(e){const{parentProjection:t,projection:n}=e;return t&&n&&LX(function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${pG(t)} is overridden by a child projection ${pG(n)}.`}({parentProjection:t,projection:n})),n??t}function T0(e){return"filter"in e}function z0(e){return void 0!==e?.stop}function R0(e){return"lookup"in e}function L0(e){return"pivot"in e}function P0(e){return"density"in e}function j0(e){return"quantile"in e}function B0(e){return"regression"in e}function I0(e){return"loess"in e}function U0(e){return"sample"in e}function q0(e){return"window"in e}function W0(e){return"joinaggregate"in e}function H0(e){return"flatten"in e}function G0(e){return"calculate"in e}function V0(e){return"bin"in e}function Y0(e){return"impute"in e}function X0(e){return"timeUnit"in e}function J0(e){return"aggregate"in e}function Z0(e){return"stack"in e}function Q0(e){return"fold"in e}function K0(e){return"extent"in e&&!("density"in e)}function e1(e,t){const{transform:n,...r}=e;if(n){const e=n.map((e=>{if(T0(e))return{filter:r1(e,t)};if(V0(e)&&DY(e.bin))return{...e,bin:n1(e.bin)};if(R0(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}));return{...r,transform:e}}return e}function t1(e,t){const n=AH(e);if(aQ(n)&&DY(n.bin)&&(n.bin=n1(n.bin)),mQ(n)&&n.scale?.domain?.selection){const{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(rQ(n))if(Eo(n.condition))n.condition=n.condition.map((e=>{const{selection:n,param:r,test:i,...o}=e;return r?e:{...o,test:r1(e,t)}}));else{const{selection:e,param:r,test:i,...o}=t1(n.condition,t);n.condition=r?n.condition:{...o,test:r1(n.condition,t)}}return n}function n1(e){const t=e.extent;if(t?.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function r1(e,t){const n=e=>EH(e,(e=>{var n;const r={param:e,empty:t.emptySelections[e]??!0};return(n=t.selectionPredicates)[e]??(n[e]=[]),t.selectionPredicates[e].push(r),r}));return e.selection?n(e.selection):EH(e.test||e.filter,(e=>e.selection?n(e.selection):e))}class i1 extends f0{map(e,t){const n=t.selections??[];if(e.params&&!YQ(e)){const t=[];for(const r of e.params)jK(r)?n.push(r):t.push(r);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){const n=t.selections;if(!n||!n.length)return e;const r=(t.path??[]).concat(e.name),i=[];for(const t of n)if(t.views&&t.views.length)for(const n of t.views)($a(n)&&(n===e.name||r.includes(n))||Eo(n)&&n.map((e=>r.indexOf(e))).every(((e,t,n)=>-1!==e&&(0===t||e>n[t-1]))))&&i.push(t);else i.push(t);return i.length&&(e.params=i),e}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=i1.prototype[e];i1.prototype[e]=function(e,n){return t.call(this,e,o1(e,n))}}function o1(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function a1(e,t){void 0===t&&(t=i0(e.config));const n=function(e,t={}){const n={config:t};return u1.map(s1.map(l1.map(e,n),n),n)}(e,t),{width:r,height:i}=e,o=function(e,t,n){let{width:r,height:i}=t;const o=YQ(e)||c0(e),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(LX(aX("width")),r=void 0),"container"==i&&(LX(aX("height")),i=void 0));const s={type:"pad",...a,...n?c1(n.autosize):{},...c1(e.autosize)};"fit"!==s.type||o||(LX(oX),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&LX(sX("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&LX(sX("height"));if(hG(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const s1=new class extends f0{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[hK,vK,kK,new $0,new F0]}map(e,t){if(YQ(e)){const n=JQ(e.encoding,mG),r=JQ(e.encoding,gG),i=JQ(e.encoding,yG);if(n||r||i)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:r}=t,i=C0(e.encoding,t.repeater),o={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{},...i?{encoding:i}:{}};if(n||r)return this.mapUnitWithParentEncodingOrProjection(o,t);const a=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(o,t.config))return e.run(o,t,a);return o}mapRepeat(e,t){return function(e){return!Eo(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:r,...i}=e,{row:o,column:a,layer:s}=n,{repeater:l={},repeaterPrefix:u=""}=t;return o||a?this.mapRepeat({...e,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:r}},t):{...i,layer:s.map((e=>{const n={...l,layer:e},i=`${(r.name?`${r.name}_`:"")+u}child__layer_${YH(e)}`,o=this.mapLayerOrUnit(r,{...t,repeater:n,repeaterPrefix:i});return o.name=i,o}))}}mapNonLayerRepeat(e,t){const{repeat:n,spec:r,data:i,...o}=e;!Eo(n)&&e.columns&&(e=MH(e,["columns"]),LX(pX("repeat")));const a=[],{repeater:s={},repeaterPrefix:l=""}=t,u=!Eo(n)&&n.row||[s?s.row:null],c=!Eo(n)&&n.column||[s?s.column:null],f=Eo(n)&&n||[s?s.repeat:null];for(const e of f)for(const i of u)for(const o of c){const u={repeat:e,row:i,column:o,layer:s.layer},c=(r.name?`${r.name}_`:"")+l+"child__"+(Eo(n)?`${YH(e)}`:(n.row?`row_${YH(i)}`:"")+(n.column?`column_${YH(o)}`:"")),f=this.map(r,{...t,repeater:u,repeaterPrefix:c});f.name=c,a.push(MH(f,["data"]))}const d=Eo(n)?e.columns:n.column?n.column.length:1;return{data:r.data??i,align:"all",...o,columns:d,concat:a}}mapFacet(e,t){const{facet:n}=e;return YZ(n)&&e.columns&&(e=MH(e,["columns"]),LX(pX("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,s=N0({parentProjection:o,projection:r}),l=O0({parentEncoding:i,encoding:C0(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(e,t){const{row:n,column:r,facet:i,...o}=e.encoding,{mark:a,width:s,projection:l,height:u,view:c,params:f,encoding:d,...h}=e,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},t),g=C0(o,t.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...u?{height:u}:{},...c?{view:c}:{},...l?{projection:l}:{},mark:a,encoding:g,...f?{params:f}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:r,facet:i}=e;if(n||r){i&&LX(`Facet encoding dropped as ${(o=[...n?[mG]:[],...r?[gG]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const t={},a={};for(const n of[mG,gG]){const r=e[n];if(r){const{align:e,center:i,spacing:o,columns:s,...l}=r;t[n]=l;for(const e of["align","center","spacing"])void 0!==r[e]&&(a[e]??(a[e]={}),a[e][n]=r[e])}}return{facetMapping:t,layout:a}}{const{align:e,center:n,spacing:r,columns:o,...a}=i;return{facetMapping:k0(a,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...r?{spacing:r}:{},...o?{columns:o}:{}}}}var o}mapLayer(e,{parentEncoding:t,parentProjection:n,...r}){const{encoding:i,projection:o,...a}=e,s={...r,parentEncoding:O0({parentEncoding:t,encoding:i,layer:!0}),parentProjection:N0({parentProjection:n,projection:o})};return super.mapLayer({...a,...e.name?{name:[s.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{}},s)}},l1=new class extends f0{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=e1(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=e1(e,t)).encoding){const n={};for(const[r,i]of GH(e.encoding))n[r]=t1(i,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...r}=e;return n?{...r,params:GH(n).map((([e,n])=>{const{init:r,bind:i,empty:o,...a}=n;"single"===a.type?(a.type="point",a.toggle=!1):"multi"===a.type&&(a.type="point"),t.emptySelections[e]="none"!==o;for(const n of HH(t.selectionPredicates[e]??{}))n.empty="none"!==o;return{name:e,value:r,select:a,bind:i}}))}:e}},u1=new i1;function c1(e){return $a(e)?{type:e}:e??{}}const f1=["background","padding"];function d1(e,t){const n={};for(const t of f1)e&&void 0!==e[t]&&(n[t]=UY(e[t]));return t&&(n.params=e.params),n}class h1{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new h1(AH(this.explicit),AH(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return oG(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:t,explicit:n}){void 0!==t&&this.set(e,t,n)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:n}){void 0!==t[e]?this.set(e,t[e],!0):void 0!==n[e]&&this.set(e,n[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of WH(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function p1(e){return{explicit:!0,value:e}}function m1(e){return{explicit:!1,value:e}}function g1(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:y1(t,n,r,i)}}function y1(e,t,n,r){return e.explicit&&t.explicit&&LX(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${pG(n)} and ${pG(r)}). Using ${pG(n)}.`}(n,r,e.value,t.value)),e}function v1(e,t,n,r,i=y1){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:hG(e.value,t.value)?e:i(e,t,n,r)}class b1 extends h1{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function x1(e){return"url"in e}function w1(e){return"values"in e}function _1(e){return"name"in e&&!x1(e)&&!w1(e)&&!$1(e)}function $1(e){return e&&(k1(e)||C1(e)||E1(e))}function k1(e){return"sequence"in e}function C1(e){return"sphere"in e}function E1(e){return"graticule"in e}var A1;function D1(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=tG(i.field),i}function S1(e,t=!0,n=po){if(Eo(e)){const r=e.map((e=>S1(e,t,n)));return t?`[${r.join(", ")}]`:r}return PX(e)?n(t?WX(e):function(e){const t=qX(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(pG(e)):e}function M1(e,t){for(const n of HH(e.component.selection??{})){const r=n.name;let i=`${r}${X2}, ${"global"===n.resolve?"true":`{unit: ${K2(e)}}`}`;for(const r of Q2)r.defined(n)&&(r.signals&&(t=r.signals(e,n,t)),r.modifyExpr&&(i=r.modifyExpr(e,n,i)));t.push({name:r+J2,on:[{events:{signal:n.name+X2},update:`modify(${Fa(n.name+Y2)}, ${i})`}]})}return N1(t)}function F1(e,t){if(e.component.selection&&WH(e.component.selection).length){const n=Fa(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:WB("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return N1(t)}function O1(e,t){for(const n of HH(e.component.selection??{}))for(const r of Q2)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function N1(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(A1||(A1={}));class T1{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.includes(e)?LX("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this);const n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}}class z1 extends T1{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,r){super(e,t),this.type=n,this.refCounts=r,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${sG()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function R1(e){return void 0!==e.as}function L1(e){return`${e}_end`}class P1 extends T1{clone(){return new P1(null,AH(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{const{field:i,timeUnit:o}=n;if(o){let a;if(VX(o)){if(L5(t)){const{mark:e,markDef:r,config:s}=t,l=KZ({fieldDef:n,markDef:r,config:s});(hZ(e)||l)&&(a={timeUnit:nJ(o),field:i})}}else a={as:xQ(n,{forAs:!0}),field:i,timeUnit:o};if(L5(t)){const{mark:e,markDef:i,config:o}=t,s=KZ({fieldDef:n,markDef:i,config:o});hZ(e)&&GV(r)&&.5!==s&&(a.rectBandPosition=s)}a&&(e[FH(a)]=a)}return e}),{});return qH(n)?null:new P1(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...r}={...t},i={...r,timeUnit:nJ(n)};return new P1(e,{[FH(i)]:i})}merge(e){this.timeUnits={...this.timeUnits};for(const t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,r]of GH(this.timeUnits)){const i=R1(r)?r.as:`${r.field}_end`;e.has(i)||(t[n]=r)}this.timeUnits=t}producedFields(){return new Set(HH(this.timeUnits).map((e=>R1(e)?e.as:L1(e.field))))}dependentFields(){return new Set(HH(this.timeUnits).map((e=>e.field)))}hash(){return`TimeUnit ${FH(this.timeUnits)}`}assemble(){const e=[];for(const t of HH(this.timeUnits)){const{rectBandPosition:n}=t,r=nJ(t.timeUnit);if(R1(t)){const{field:i,as:o}=t,{unit:a,utc:s,...l}=r,u=[o,`${o}_end`];e.push({field:tG(i),type:"timeunit",...a?{units:ZX(a)}:{},...s?{timezone:"utc"}:{},...l,as:u}),e.push(...U1(u,n,r))}else if(t){const{field:i}=t,o=i.replaceAll("\\.","."),a=I1({timeUnit:r,field:o}),s=L1(o);e.push({type:"formula",expr:a,as:s}),e.push(...U1([o,s],n,r))}}return e}}const j1="offsetted_rect_start",B1="offsetted_rect_end";function I1({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=QX(r),{part:a,step:s}=oJ(o,e.step);return`${i?"utcOffset":"timeOffset"}('${a}', datum['${t}'], ${n?-s:s})`}function U1([e,t],n,r){if(void 0!==n&&.5!==n){const i=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:q1([I1({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${j1}`},{type:"formula",expr:q1([i,o],n+.5),as:`${e}_${B1}`}]}return[]}function q1([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const W1="_tuple_fields";class H1{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const G1={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??(t.project=new H1),o={},a={},s=new Set,l=(e,t)=>{const n="visual"===t?e.channel:e.field;let i=YH(`${r}_${n}`);for(let e=1;s.has(i);e++)i=YH(`${r}_${n}_${e}`);return s.add(i),{[t]:i}},u=t.type,c=e.config.selection[u],f=void 0!==n.value?Zo(n.value):null;let{fields:d,encodings:h}=Ao(n.select)?n.select:{};if(!d&&!h&&f)for(const e of f)if(Ao(e))for(const t of WH(e))gV[t]?(h||(h=[])).push(t):"interval"===u?(LX('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),h=c.encodings):(d??(d=[])).push(t);d||h||(h=c.encodings,"fields"in c&&(d=c.fields));for(const t of h??[]){const n=e.fieldDef(t);if(n){let r=n.field;if(n.aggregate){LX(fX(t,n.aggregate));continue}if(!r){LX(cX(t));continue}if(n.timeUnit&&!VX(n.timeUnit)){r=e.vgField(t);const i={timeUnit:n.timeUnit,as:r,field:n.field};a[FH(i)]=i}if(!o[r]){const a={field:r,channel:t,type:"interval"===u&&cY(t)&&LJ(e.getScaleComponent(t).get("type"))?"R":n.bin?"R-RE":"E",index:i.items.length};a.signals={...l(a,"data"),...l(a,"visual")},i.items.push(o[r]=a),i.hasField[r]=o[r],i.hasSelectionId=i.hasSelectionId||r===zK,tV(t)?(a.geoChannel=t,a.channel=eV(t),i.hasChannel[a.channel]=o[r]):i.hasChannel[t]=o[r]}}else LX(cX(t))}for(const e of d??[]){if(i.hasField[e])continue;const t={type:"E",field:e,index:i.items.length};t.signals={...l(t,"data")},i.items.push(t),i.hasField[e]=t,i.hasSelectionId=i.hasSelectionId||e===zK}f&&(t.init=f.map((e=>i.items.map((t=>Ao(e)?void 0!==e[t.geoChannel||t.channel]?e[t.geoChannel||t.channel]:e[t.field]:e))))),qH(a)||(i.timeUnit=new P1(null,a))},signals:(e,t,n)=>{const r=t.name+W1;return n.filter((e=>e.name===r)).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(D1)})}},V1={defined:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!cY(i))continue;const o=e.getScaleComponent(i),a=o?o.get("type"):void 0;o&&LJ(a)?(o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)):LX("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||X1(e)||0===r.length)return n;const i=n.filter((e=>e.name===t.name))[0];let o=i.update;if(o.indexOf(Z2)>=0)i.update=`{${r.map((e=>`${Fa(tG(e.field))}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of r){const t=`${Fa(tG(e.field))}: ${e.signals.data}`;o.includes(t)||(o=`${o.substring(0,o.length-1)}, ${t}}`)}i.update=o}return n.concat(r.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!X1(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}};function Y1(e,t){return`domain(${Fa(e.scaleName(t))})`}function X1(e){return e.parent&&B5(e.parent)&&(!e.parent.parent??X1(e.parent.parent))}const J1="_brush",Z1="_scale_trigger",Q1="geo_interval_init_tick",K1="_init",e2={defined:e=>"interval"===e.type,parse:(e,t,n)=>{var r;if(e.hasProjection){const e={...Ao(n.select)?n.select:{}};e.fields=[zK],e.encodings||(e.encodings=n.value?WH(n.value):[SG,DG]),n.select={type:"interval",...e}}if(t.translate&&!V1.defined(t)){const e=`!event.item || event.item.mark.name !== ${Fa(t.name+J1)}`;for(const n of t.events){if(!n.between){LX(`${n} is not an ordered event stream for interval selections.`);continue}const t=Zo((r=n.between[0]).filter??(r.filter=[]));t.indexOf(e)<0&&t.push(e)}}},signals:(e,t,n)=>{const r=t.name,i=r+X2,o=HH(t.project.hasChannel).filter((e=>e.channel===vG||e.channel===bG)),a=t.init?t.init[0]:null;if(n.push(...o.reduce(((n,r)=>n.concat(function(e,t,n,r){const i=!e.hasProjection,o=n.channel,a=n.signals.visual,s=Fa(i?e.scaleName(o):e.projectionName()),l=e=>`scale(${s}, ${e})`,u=e.getSizeSignalRef(o===vG?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce(((e,t)=>[...e,{events:t.between[0],update:`[${c}, ${c}]`},{events:t,update:`[${a}[0], clamp(${c}, 0, ${u})]`}]),[]);if(i){const i=n.signals.data,u=V1.defined(t),c=e.getScaleComponent(o),d=c?c.get("type"):void 0,h=r?{init:S1(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+Z1},update:LJ(d)?`[${l(`${i}[0]`)}, ${l(`${i}[1]`)}]`:"[0, 0]"}),u?[{name:i,on:[]}]:[{name:a,...h,on:f},{name:i,...r?{init:S1(r)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}{const e=o===vG?0:1,n=t.name+K1;return[{name:a,...r?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:f}]}}(e,t,r,a&&a[r.index]))),[])),e.hasProjection){const s=Fa(e.projectionName()),l=e.projectionName()+"_center",{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?a&&a[u.index]:`${l}[0]`,p=c?a&&a[c.index]:`${l}[1]`,m=t=>e.getSizeSignalRef(t).signal,g=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":m("width")}, ${d?d+"[1]":m("height")}]]`;if(a&&(n.unshift({name:r+K1,init:`[scale(${s}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${s}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),!u||!c)){n.find((e=>e.name===l))||n.unshift({name:l,update:`invert(${s}, [${m("width")}/2, ${m("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${g}, {markname: ${Fa(e.getName("marks"))}}, unit.mark)`}, ${`{unit: ${K2(e)}}`})`,v=o.map((e=>e.signals.visual));return n.concat({name:i,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...a?[{signal:Q1}]:[]],update:y}]})}{if(!V1.defined(t)){const t=r+Z1,i=o.map((t=>{const n=t.channel,{data:r,visual:i}=t.signals,o=Fa(e.scaleName(n)),a=LJ(e.getScaleComponent(n).get("type"))?"+":"";return`(!isArray(${r}) || (${a}invert(${o}, ${i})[0] === ${a}${r}[0] && ${a}invert(${o}, ${i})[1] === ${a}${r}[1]))`}));i.length&&n.push({name:t,value:{},on:[{events:o.map((t=>({scale:e.scaleName(t.channel)}))),update:i.join(" && ")+` ? ${t} : {}`}]})}const s=o.map((e=>e.signals.data)),l=`unit: ${K2(e)}, fields: ${r+W1}, values`;return n.concat({name:i,...a?{init:`{${l}: ${S1(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${l}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(L5(e)&&e.hasProjection&&t.init){n.filter((e=>e.name===Q1)).length||n.unshift({name:Q1,value:null,on:[{events:"timer{1}",update:`${Q1} === null ? {} : ${Q1}`}]})}return n},marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,a=i?.signals.visual,s=o?.signals.visual,l=`data(${Fa(t.name+Y2)})`;if(V1.defined(t)||!i&&!o)return n;const u={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of WH(u))u[t]=[{test:`${l}.length && ${l}[0].unit === ${K2(e)}`,...u[t]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=WH(h).reduce(((e,t)=>(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:h[t]},{value:null}],e)),{});return[{name:`${r+J1}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:r+J1,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};const t2={defined:e=>"point"===e.type,signals:(e,t,n)=>{const r=t.name,i=r+W1,o=t.project,a="(item().isVoronoi ? datum.datum : datum)",s=HH(e.component.selection??{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+J1):e),[]).map((e=>`indexof(item().mark.name, '${e}') < 0`)).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(s?` && ${s}`:"");let u=`unit: ${K2(e)}, `;if(t.project.hasSelectionId)u+=`${zK}: ${a}[${Fa(zK)}]`;else{u+=`fields: ${i}, values: [${o.items.map((t=>{const n=e.fieldDef(t.channel);return n?.bin?`[${a}[${Fa(e.vgField(t.channel,{}))}], ${a}[${Fa(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${a}[${Fa(t.field)}]`})).join(", ")}]`}const c=t.events;return n.concat([{name:r+X2,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}};function n2(e,t,n,r){const i=rQ(t)&&t.condition,o=r(t);if(i){const t=Zo(i).map((t=>{const n=r(t);if(function(e){return e.param}(t)){const{param:r,empty:i}=t;return{test:a3(e,{param:r,empty:i}),...n}}return{test:l3(e,t.test),...n}}));return{[n]:[...t,...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function r2(e,t="text"){const n=e.encoding[t];return n2(e,n,t,(t=>i2(t,e.config)))}function i2(e,t,n="datum"){if(e){if(pQ(e))return WY(e.value);if(dQ(e)){const{format:r,formatType:i}=DQ(e);return NZ({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function o2(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,a=n.tooltip;if(Eo(a))return{tooltip:s2({tooltip:a},o,i,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return n2(e,a,"tooltip",(e=>{const a=i2(e,i,s);if(a)return a;if(null===e)return;let l=JY("tooltip",r,i);return!0===l&&(l={content:"encoding"}),$a(l)?{value:l}:Ao(l)?zY(l)?l:"encoding"===l.content?s2(n,o,i,t):{signal:s}:void 0}))}}function a2(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o={},a=r?"datum.datum":"datum",s=[];function l(n,r){const l=xV(r),u=hQ(n)?n:{...n,type:e[l].type},c=Zo(u.title||AQ(u,i)).join(", ").replaceAll(/"/g,'\\"');let f;if(GV(r)){const t="x"===r?"x2":"y2",n=SQ(e[t]);if(AY(u.bin)&&n){const e=xQ(u,{expr:a}),r=xQ(n,{expr:a}),{format:s,formatType:l}=DQ(u);f=IZ(e,r,s,l,i),o[t]=!0}}if((GV(r)||r===EG||r===kG)&&t&&t.fieldChannel===r&&"normalize"===t.offset){const{format:e,formatType:t}=DQ(u);f=NZ({fieldOrDatumDef:u,format:e,formatType:t,expr:a,config:i,normalizeStack:!0}).signal}f??(f=i2(u,i,a).signal),s.push({channel:r,key:c,value:f})}rK(e,((e,t)=>{aQ(e)?l(e,t):iQ(e)&&l(e.condition,t)}));const u={};for(const{channel:e,key:t,value:n}of s)o[e]||u[t]||(u[t]=n);return u}function s2(e,t,n,{reactiveGeom:r}={}){const i=a2(e,t,n,{reactiveGeom:r}),o=GH(i).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function l2(e){const{markDef:t,config:n}=e,r=JY("aria",t,n);return!1===r?{}:{...r?{aria:r}:{},...u2(e),...c2(e)}}function u2(e){const{mark:t,markDef:n,config:r}=e;if(!1===r.aria)return{};const i=JY("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:t in jY?{}:{ariaRoleDescription:{value:t}}}function c2(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return n2(e,o,"description",(t=>i2(t,e.config)));const a=JY("description",n,r);if(null!=a)return{description:WY(a)};if(!1===r.aria)return{};const s=a2(t,i,r);return qH(s)?void 0:{description:{signal:GH(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}function f2(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:l}=n;void 0===s&&(l??(l=JY(e,r,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==l&&(s=WY(l)));const u=i[e];return n2(t,u,a??e,(n=>DZ({channel:e,channelDef:n,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function d2(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,a=t.filled??JY("filled",n,i),s=NH(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=JY(!0===a?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[!0===a&&"color"]??s,u=JY(!1===a?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[!1===a&&"color"],c=a?"fill":"stroke",f={...l?{fill:WY(l)}:{},...u?{stroke:WY(u)}:{}};return n.color&&(a?n.fill:n.stroke)&&LX(xX("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...f2("color",e,{vgChannel:c,defaultValue:a?l:u}),...f2("fill",e,{defaultValue:r.fill?l:void 0}),...f2("stroke",e,{defaultValue:r.stroke?u:void 0})}}function h2(e){const{encoding:t,mark:n}=e,r=t.order;return!dZ(n)&&pQ(r)?n2(e,r,"zindex",(e=>WY(e.value))):{}}function p2({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,a=t[o],s=n[o];if(("xOffset"===o||"yOffset"===o)&&s){return{offsetType:"encoding",offset:DZ({channel:o,channelDef:s,markDef:t,config:r?.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:WY(a),bandPosition:i})}}const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function m2(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:a,stack:s}=t,l=i[e],u=i[_V(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=p2({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=g2({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),m=!l&&GV(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:a}=e;if(dQ(n)&&i&&t===i.fieldChannel){if(aQ(n)){let e=n.bandPosition;if(void 0!==e||"text"!==a.type||"radius"!==t&&"theta"!==t||(e=.5),void 0!==e)return AZ({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:e,offset:o})}return EZ(n,r,{suffix:"end"},{offset:o})}return $Z(e)}({channel:e,channelDef:l,channel2Def:u,markDef:o,config:a,scaleName:c,scale:f,stack:s,offset:d,defaultRef:p,bandPosition:"encoding"===h?0:void 0});return m?{[r||e]:m}:void 0}function g2({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=e;return()=>{const s=xV(n),l=wV(n),u=JY(n,o,a,{vgChannel:l});if(void 0!==u)return SZ(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const e=i.get("type");if(NH([CJ.LOG,CJ.TIME,CJ.UTC],e));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[$V(n)],mult:.5}}}}const y2={left:"x",center:"xc",right:"x2"},v2={top:"y",middle:"yc",bottom:"y2"};function b2(e,t,n,r="middle"){if("radius"===e||"theta"===e)return wV(e);const i="x"===e?"align":"baseline",o=JY(i,t,n);let a;return zY(o)?(LX(function(e){return`The ${e} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===e?y2[a||("top"===r?"left":"center")]:v2[a||r]}function x2(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?w2(e,t,{defaultPos:n,defaultPos2:r}):m2(e,t,{defaultPos:n})}function w2(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,a=_V(e),s=$V(e),l=function(e,t,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,l=xV(n),u=$V(n),c=wV(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=p2(n in r||n in o?{channel:n,markDef:o,encoding:r,model:e}:{channel:l,markDef:o,encoding:r,model:e});if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude)){const t=$V(n),r=e.markDef[t];return null!=r?{[t]:{value:r}}:{[c]:{field:e.getName(n)}}}const m=function({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:l,defaultRef:u}){if(dQ(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return EZ(t,o,{suffix:"start"},{offset:l});return $Z({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:l,defaultRef:u})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==m)return{[c]:m};return _2(n,o)||_2(n,{[n]:QY(n,o,s.style),[u]:QY(u,o,s.style)})||_2(n,s[i])||_2(n,s.mark)||{[c]:g2({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,r,a);return{...m2(e,t,{defaultPos:n,vgChannel:l[s]?b2(e,i,o):wV(e)}),...l}}function _2(e,t){const n=$V(e),r=wV(e);if(void 0!==t[r])return{[r]:SZ(e,t[r])};if(void 0!==t[e])return{[r]:SZ(e,t[e])};if(t[n]){const r=t[n];if(!bZ(r))return{[n]:SZ(e,r)};LX(function(e){return`Position range does not support relative band size for ${e}.`}(n))}}function $2(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,a=_V(t),s=$V(t),l=r[t],u=r[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=i.orient,h=r[s]??r.size??JY("size",i,n,{vgChannel:s}),p=kV(t),m="bar"===o&&("x"===t?"vertical"===d:"horizontal"===d);return!aQ(l)||!(EY(l.bin)||AY(l.bin)||l.timeUnit&&!u)||h&&!bZ(h)||r[p]||RJ(f)?(dQ(l)&&RJ(f)||m)&&!u?function(e,t,n){const{markDef:r,encoding:i,config:o,stack:a}=n,s=r.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=$V(t),f=_V(t),d=kV(t),h=n.scaleName(d),p=n.getScaleComponent(CV(t)),m="horizontal"===s&&"y"===t||"vertical"===s&&"x"===t;let g;(i.size||r.size)&&(m?g=f2("size",n,{vgChannel:c,defaultRef:WY(r.size)}):LX(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(r.type)));const y=!!g,v=eQ({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(u||p)?.get("type"),useVlSizeChannel:m});g=g||{[c]:k2(c,h||l,p||u,o,v,!!e,r.type)};const b="band"===(u||p)?.get("type")&&bZ(v)&&!y?"top":"middle",x=b2(t,r,o,b),w="xc"===x||"yc"===x,{offset:_,offsetType:$}=p2({channel:t,markDef:r,encoding:i,model:n,bandPosition:w?.5:0}),k=$Z({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:u,stack:a,offset:_,defaultRef:g2({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:w?"encoding"===$?0:.5:zY(v)?{signal:`(1-${v})/2`}:bZ(v)?(1-v.band)/2:0});if(c)return{[x]:k,...g};{const e=wV(f),t=g[c],n=_?{...t,offset:_}:t;return{[x]:k,[e]:Eo(k)?[k[0],{...k[1],offset:n}]:{...k,offset:n}}}}(l,t,e):w2(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function({fieldDef:e,fieldDef2:t,channel:n,model:r}){const{config:i,markDef:o,encoding:a}=r,s=r.getScaleComponent(n),l=r.scaleName(n),u=s?s.get("type"):void 0,c=s.get("reverse"),f=eQ({channel:n,fieldDef:e,markDef:o,config:i,scaleType:u}),d=r.component.axes[n]?.[0],h=d?.get("translate")??.5,p=GV(n)?JY("binSpacing",o,i)??0:0,m=_V(n),g=wV(n),y=wV(m),v=ZY("minBandSize",o,i),{offset:b}=p2({channel:n,markDef:o,encoding:a,model:r,bandPosition:0}),{offset:x}=p2({channel:m,markDef:o,encoding:a,model:r,bandPosition:0}),w=function({scaleName:e,fieldDef:t}){const n=xQ(t,{expr:"datum"});return`abs(scale("${e}", ${xQ(t,{expr:"datum",suffix:"end"})}) - scale("${e}", ${n}))`}({fieldDef:e,scaleName:l}),_=C2(n,p,c,h,b,v,w),$=C2(m,p,c,h,x??b,v,w),k=zY(f)?{signal:`(1-${f.signal})/2`}:bZ(f)?(1-f.band)/2:.5,C=KZ({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(EY(e.bin)||e.timeUnit){const t=e.timeUnit&&.5!==C;return{[y]:E2({fieldDef:e,scaleName:l,bandPosition:k,offset:$,useRectOffsetField:t}),[g]:E2({fieldDef:e,scaleName:l,bandPosition:zY(k)?{signal:`1-${k.signal}`}:1-k,offset:_,useRectOffsetField:t})}}if(AY(e.bin)){const n=EZ(e,l,{},{offset:$});if(aQ(t))return{[y]:n,[g]:EZ(t,l,{},{offset:_})};if(DY(e.bin)&&e.bin.step)return{[y]:n,[g]:{signal:`scale("${l}", ${xQ(e,{expr:"datum"})} + ${e.bin.step})`,offset:_}}}return void LX(TX(m))}({fieldDef:l,fieldDef2:u,channel:t,model:e})}function k2(e,t,n,r,i,o,a){if(bZ(i)){if(!n)return{mult:i.band,field:{group:e}};{const e=n.get("type");if("band"===e){let e=`bandwidth('${t}')`;1!==i.band&&(e=`${i.band} * ${e}`);const n=ZY("minBandSize",{type:a},r);return{signal:n?`max(${VY(n)}, ${e})`:e}}1!==i.band&&(LX(function(e){return`Cannot use the relative band size with ${e} scale.`}(e)),i=void 0)}}else{if(zY(i))return i;if(i)return{value:i}}if(n){const e=n.get("range");if(RY(e)&&wa(e.step))return{value:e.step-2}}if(!o){const{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:i}=r.scale,o=oG(t,"bar"===a?n:i);if(zY(o))return{signal:`(1 - (${o.signal})) * ${e}`};if(wa(o))return{signal:`${1-o} * ${e}`}}return{value:XK(r.view,e)-2}}function C2(e,t,n,r,i,o,a){if(QG(e))return 0;const s="x"===e||"y2"===e,l=s?-t/2:t/2;if(zY(n)||zY(i)||zY(r)||o){const e=VY(n),t=VY(i),u=VY(r),c=VY(o),f=o?`(${a} < ${c} ? ${s?"":"-"}0.5 * (${c} - (${a})) : ${l})`:l;return{signal:(u?`${u} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${f})`:f)}}return i=i||0,r+(n?-i-l:+i+l)}function E2({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return AZ({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:j1,endSuffix:B1}:{}})}const A2=new Set(["aria","width","height"]);function D2(e,t){const{fill:n,stroke:r}="include"===t.color?d2(e):{};return{...M2(e.markDef,t),...S2(e,"fill",n),...S2(e,"stroke",r),...f2("opacity",e),...f2("fillOpacity",e),...f2("strokeOpacity",e),...f2("strokeWidth",e),...f2("strokeDash",e),...h2(e),...o2(e),...r2(e,"href"),...l2(e)}}function S2(e,t,n){const{config:r,mark:i,markDef:o}=e;if("hide"===JY("invalid",o,r)&&n&&!dZ(i)){const r=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum"});o&&LJ(i)&&(t[o]=!0)}return t}),{}),i=WH(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>CZ(e,t))).join(` ${e} `)}return}(e,{invalid:!0,channels:uY});if(r)return{[t]:[{test:r,value:null},...Zo(n)]}}return n?{[t]:n}:{}}function M2(e,t){return PY.reduce(((n,r)=>(A2.has(r)||void 0===e[r]||"ignore"===t[r]||(n[r]=WY(e[r])),n)),{})}function F2(e){const{config:t,markDef:n}=e;if(JY("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const r=n.reduce(((t,n)=>{const r=e.getScaleComponent(n);if(r){const i=r.get("type"),o=e.vgField(n,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});o&&LJ(i)&&(t[o]=!0)}return t}),{}),i=WH(r);if(i.length>0){const e=t?"||":"&&";return i.map((e=>CZ(e,t))).join(` ${e} `)}return}(e,{channels:HV});if(t)return{defined:{signal:t}}}return{}}function O2(e,t){if(void 0!==t)return{[e]:WY(t)}}const N2="voronoi",T2={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(N2)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(dZ(o))return LX(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(N2),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...o2(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,l=!1;return n.forEach(((t,n)=>{const r=t.name??"";r===e.component.mark[0].name?s=n:r.indexOf(N2)>=0&&(l=!0)})),l||n.splice(s+1,0,a),n}},z2={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!LK(e.bind),parse:(e,t,n)=>t3(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,a=t.init&&t.init[0],s=T2.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((e,i)=>{const l=YH(`${r}_${e.field}`);n.filter((e=>e.name===l)).length||n.unshift({name:l,...a?{init:S1(a[i])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${Fa(e.field)}] : null`}]:[],bind:o[e.field]??o[e.channel]??o})})),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter((e=>e.name===r+X2))[0],a=r+W1,s=i.items.map((e=>YH(`${r}_${e.field}`))),l=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${l} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},R2="_toggle",L2={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+R2,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+X2,r=t.name+R2;return`${r} ? null : ${n}, `+("global"===t.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${K2(e)}}, `)+`${r} ? ${n} : null`}},P2={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t)=>{t.clear&&(t.clear=$a(t.clear)?WB(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(z2.defined(t))for(const e of t.project.items){const r=n.findIndex((n=>n.name===YH(`${t.name}_${e.field}`)));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(e,r){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:r})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));if(r(t,"[0, 0]"),-1===t){r(n.findIndex((t=>t.name===e.signals.data)),"null")}}else{let e=n.findIndex((e=>e.name===t.name+X2));r(e,"null"),L2.defined(t)&&(e=n.findIndex((e=>e.name===t.name+R2)),r(e,"false"))}return n}},j2={defined:e=>{const t="global"===e.resolve&&e.bind&&LK(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==zK;return t&&!n&&LX("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n)=>{const r=AH(n);if(r.select=$a(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},t3(t,r),Ao(n.select)&&(n.select.on||n.select.clear)){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=Zo(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}const i=PK(t.bind)?t.bind.legend:"click",o=$a(i)?WB(i,"view"):Zo(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=PK(t.bind)&&t.bind.legend,o=e=>t=>{const n=AH(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${YH(e.field)}_legend`,s=`${r}_${a}`;if(0===n.filter((e=>e.name===s)).length){const e=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find((e=>e.name===r+X2)),a=r+W1,s=i.items.filter((e=>e.hasLegend)).map((e=>YH(`${r}_${YH(e.field)}_legend`))),l=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);const u=n.find((e=>e.name===r+R2)),c=PK(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:c}):u.on[0].events=c),n}};const B2="_translate_anchor",I2="_translate_delta",U2={defined:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name,i=V1.defined(t),o=r+B2,{x:a,y:s}=t.project.hasChannel;let l=WB(t.translate,"scope");return i||(l=l.map((e=>(e.between[0].markname=r+J1,e)))),n.push({name:o,value:{},on:[{events:l.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?`, extent_x: ${i?Y1(e,vG):`slice(${a.signals.visual})`}`:"")+(void 0!==s?`, extent_y: ${i?Y1(e,bG):`slice(${s.signals.visual})`}`:"")+"}"}]},{name:r+I2,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&q2(e,t,a,"width",n),void 0!==s&&q2(e,t,s,"height",n),n}};function q2(e,t,n,r,i){const o=t.name,a=o+B2,s=o+I2,l=n.channel,u=V1.defined(t),c=i.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),m=`${a}.extent_${l}`,g=`${u&&d?"log"===h?"panLog":"symlog"===h?"panSymlog":"pow"===h?"panPow":"panLinear":"panLinear"}(${m}, ${`${u?l===vG?p?"":"-":p?"-":"":""}${s}.${l} / ${u?`${f}`:`span(${m})`}`}${u?"pow"===h?`, ${d.get("exponent")??1}`:"symlog"===h?`, ${d.get("constant")??1}`:"":""})`;c.on.push({events:{signal:s},update:u?g:`clampRange(${g}, 0, ${f})`})}const W2="_zoom_anchor",H2="_zoom_delta",G2={defined:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=V1.defined(t),o=r+H2,{x:a,y:s}=t.project.hasChannel,l=Fa(e.scaleName(vG)),u=Fa(e.scaleName(bG));let c=WB(t.zoom,"scope");return i||(c=c.map((e=>(e.markname=r+J1,e)))),n.push({name:r+W2,on:[{events:c,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter((e=>e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&V2(e,t,a,"width",n),void 0!==s&&V2(e,t,s,"height",n),n}};function V2(e,t,n,r,i){const o=t.name,a=n.channel,s=V1.defined(t),l=i.filter((e=>e.name===n.signals[s?"data":"visual"]))[0],u=e.getSizeSignalRef(r).signal,c=e.getScaleComponent(a),f=c&&c.get("type"),d=s?Y1(e,a):l.name,h=o+H2,p=`${s&&c?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${d}, ${`${o}${W2}.${a}`}, ${h}${s?"pow"===f?`, ${c.get("exponent")??1}`:"symlog"===f?`, ${c.get("constant")??1}`:"":""})`;l.on.push({events:{signal:h},update:s?p:`clampRange(${p}, 0, ${u})`})}const Y2="_store",X2="_tuple",J2="_modify",Z2="vlSelectionResolve",Q2=[t2,e2,G1,L2,z2,V1,j2,P2,U2,G2,T2];function K2(e,{escape:t}={escape:!0}){let n=t?Fa(e.name):e.name;const r=function(e){let t=e.parent;for(;t&&!P5(t);)t=t.parent;return t}(e);if(r){const{facet:e}=r;for(const t of aV)e[t]&&(n+=` + '__facet_${t}_' + (facet[${Fa(r.vgField(t))}])`)}return n}function e3(e){return HH(e.component.selection??{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function t3(e,t){!$a(t.select)&&t.select.on||delete e.events,!$a(t.select)&&t.select.clear||delete e.clear,!$a(t.select)&&t.select.toggle||delete e.toggle}function n3(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...n3(e.object)),t.push(...n3(e.property))),t)}function r3(e){return"MemberExpression"===e.object.type?r3(e.object):"datum"===e.object.name}function i3(e){const t=mP(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&r3(e)&&n.add(n3(e).slice(1).join("."))})),n}class o3 extends T1{clone(){return new o3(null,this.model,AH(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=l3(this.model,this.filter,this),this._dependentFields=i3(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function a3(e,t,n,r="datum"){const i=$a(t)?t:t.param,o=YH(i),a=Fa(o+Y2);let s;try{s=e.getSelectionComponent(o,i)}catch(e){return`!!${o}`}if(s.project.timeUnit){const t=n??e.component.data.raw,r=s.project.timeUnit.clone();t.parent?r.insertAsParentOf(t):t.parent=r}const l=`${s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${a}, ${r}${"global"===s.resolve?")":`, ${Fa(s.resolve)})`}`,u=`length(data(${a}))`;return!1===t.empty?`${u} && ${l}`:`!${u} || ${l}`}function s3(e,t,n){const r=YH(t),i=n.encoding;let o,a=n.field;try{o=e.getSelectionComponent(r,t)}catch(e){return r}if(i||a){if(i&&!a){const e=o.project.items.filter((e=>e.channel===i));!e.length||e.length>1?(a=o.project.items[0].field,LX((e.length?"Multiple ":"No ")+`matching ${Fa(i)} encoding found for selection ${Fa(n.param)}. `+`Using "field": ${Fa(a)}.`)):a=e[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&LX(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Fa(a)}.`);return`${o.name}[${Fa(tG(a))}]`}function l3(e,t,n){return XH(t,(t=>$a(t)?t:function(e){return e?.param}(t)?a3(e,t,n):mJ(t)))}function u3(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function c3(e,t,n,r={header:!1}){const{disable:i,orient:o,scale:a,labelExpr:s,title:l,zindex:u,...c}=e.combine();if(!i){for(const e in c){const n=qQ[e],r=c[e];if(n&&n!==t&&"both"!==n)delete c[e];else if(IQ(r)){const{condition:t,...n}=r,i=Zo(t),o=BQ[e];if(o){const{vgProp:t,part:r}=o,a=[...i.map((e=>{const{test:t,...n}=e;return{test:l3(null,t),...n}})),n];u3(c,r,t,a),delete c[e]}else if(null===o){const t={signal:i.map((e=>{const{test:t,...n}=e;return`${l3(null,t)} ? ${GY(n)} : `})).join("")+GY(n)};c[e]=t}}else if(zY(r)){const t=BQ[e];if(t){const{vgProp:n,part:i}=t;u3(c,i,n,r),delete c[e]}}NH(["labelAlign","labelBaseline"],e)&&null===c[e]&&delete c[e]}if("grid"===t){if(!c.grid)return;if(c.encode){const{grid:e}=c.encode;c.encode={...e?{grid:e}:{}},qH(c.encode)&&delete c.encode}return{scale:a,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:oG(u,0)}}{if(!r.header&&e.mainExtracted)return;if(void 0!==s){let e=s;c.encode?.labels?.update&&zY(c.encode.labels.update.text)&&(e=nG(s,"datum.label",c.encode.labels.update.text.signal)),u3(c,"labels","text",{signal:e})}if(null===c.labelAlign&&delete c.labelAlign,c.encode){for(const t of UQ)e.hasAxisPart(t)||delete c.encode[t];qH(c.encode)&&delete c.encode}const t=function(e,t){if(e)return Eo(e)&&!TY(e)?e.map((e=>AQ(e,t))).join(", "):e}(l,n);return{scale:a,orient:o,grid:!1,...t?{title:t}:{},...c,...!1===n.aria?{aria:!1}:{},zindex:oG(u,0)}}}}function f3(e){const{axes:t}=e.component,n=[];for(const r of HV)if(t[r])for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const t="x"===r?"height":"width",i=e.getSizeSignalRef(t).signal;t!==i&&n.push({name:t,update:i})}return n}function d3(e,t,n,r){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",i=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...WH(i),...WH(o)]),s={};for(const t of a.values())s[t]={signal:`${r.signal} === "${e}" ? ${VY(i[t])} : ${VY(o[t])}`};return s}return t[e]}))])}function h3(e,t){const n=[{}];for(const r of e){let e=t[r]?.style;if(e){e=Zo(e);for(const r of e)n.push(t.style[r])}}return Object.assign.apply(null,n)}function p3(e,t,n,r={}){const i=KY(e,n,t);if(void 0!==i)return{configFrom:"style",configValue:i};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==r[t]?.[e])return{configFrom:t,configValue:r[t][e]};return{}}const m3={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??function(e,t){return!RJ(e)&&aQ(t)&&!EY(t?.bin)&&!AY(t?.bin)}(n,e),gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||v3(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||y3(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??function(e,t){if("x"===t&&NH(["quantitative","temporal"],e))return!0;return}(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??function(e,t,n,r){if(n&&!Ao(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,aQ(t)&&!!t.timeUnit,aQ(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o="x"===e?"width":"y"===e?"height":void 0,a=o?t.getSizeSignalRef(o):void 0;return n.tickCount??function({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){if(!r&&!RJ(t)&&"log"!==t){if(aQ(e)){if(EY(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&NH(["month","hours","day","quarter"],nJ(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:i,size:a,values:n.values})},tickMinStep:function({format:e,fieldOrDatumDef:t}){if("d"===e)return 1;if(aQ(t)){const{timeUnit:e}=t;if(e){const t=rJ(e);if(t)return{signal:t}}}return},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const r=b3(t,n);if(void 0!==r)return r;const i=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return tX(i?[ZZ(i)]:[],aQ(a)?[ZZ(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if(Eo(n))return PQ(t,n);if(zY(n))return n;return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??function(e,t){if("rect"===e&&wQ(t))return 1;return 0}(n,t)};function g3(e){return`(((${e.signal} % 360) + 360) % 360)`}function y3(e,t,n,r){if(void 0!==e){if("x"===n){if(zY(e)){const n=g3(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${zY(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45{if(mQ(t)&&VZ(t.sort)){const{field:r,timeUnit:i}=t,o=t.sort,a=o.map(((e,t)=>`${mJ({field:r,timeUnit:i,equal:e})} ? ${t} : `)).join("")+o.length;e=new x3(e,{calculate:a,as:w3(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${FH(this.transform)}`}}function w3(e,t,n){return xQ(e,{prefix:t,suffix:"sort_index",...n??{}})}function _3(e,t){return NH(["top","bottom"],t)?"column":NH(["left","right"],t)||"row"===e?"row":"column"}function $3(e,t,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return oG((t||{})[e],i[e],n.header[e])}function k3(e,t,n,r){const i={};for(const o of e){const e=$3(o,t||{},n,r);void 0!==e&&(i[o]=e)}return i}const C3=["row","column"],E3=["header","footer"];function A3(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=k3(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=_3(t,s),u=cG(a);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...S3(u,l),...D3(l,u,o),...R3(r,i,t,FK,SK)}}}function D3(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=v3(t,"row"===e?"left":"top","row"===e?"y":"x");return r?{align:r}:{}}function S3(e,t){const n=y3(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function M3(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of E3)if(n[i])for(const o of n[i]){const a=N3(e,t,i,n,o);null!=a&&r.push(a)}return r}function F3(e,t){const{sort:n}=e;return GZ(n)?{field:xQ(n,{expr:"datum"}),order:n.order??"ascending"}:Eo(n)?{field:w3(e,t,{expr:"datum"}),order:"ascending"}:{field:xQ(e,{expr:"datum"}),order:n??"ascending"}}function O3(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:l}=k3(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=NZ({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,c=_3(t,s);return{text:{signal:l?nG(nG(l,"datum.label",u),"datum.value",xQ(e,{expr:"parent"})):u},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...S3(o,c),...D3(c,o,a),...R3(n,e,t,OK,MK)}}function N3(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=e.config?e.config:void 0;if(a&&i.labels){const{labelOrient:e}=k3(["labelOrient"],a.header,s,t);("row"===t&&!NH(["top","bottom"],e)||"column"===t&&!NH(["left","right"],e))&&(o=O3(a,t,s))}const l=P5(e)&&!YZ(e.facet),u=i.axes,c=u?.length>0;if(o||c){const s="row"===t?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:F3(a,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const T3={column:{start:0,end:1},row:{start:1,end:0}};function z3(e,t){return T3[t][e]}function R3(e,t,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=$3(a,t?.header,e,n);void 0!==r&&(o[i[a]]=r)}return o}function L3(e){return[...P3(e,"width"),...P3(e,"height"),...P3(e,"childWidth"),...P3(e,"childHeight")]}function P3(e,t){const n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"===r){const t=e.getScaleComponent(n);if(t){const r=t.get("type"),o=t.get("range");if(RJ(r)&&RY(o)){const r=e.scaleName(n);if(P5(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[j3(r,o)]}return[j3(r,o),{name:i,update:B3(r,t,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const t=i.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${YK(e.config.view,t?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function j3(e,t){const n=`${e}_step`;return zY(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function B3(e,t,n){const r=t.get("type"),i=t.get("padding"),o=oG(t.get("paddingOuter"),i);let a=t.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${VY(a)}, ${VY(o)}) * ${e}_step`}function I3(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function U3(e,t){return WH(e).reduce(((n,r)=>{const i=e[r];return{...n,...n2(t,i,r,(e=>WY(e.value)))}}),{})}function q3(e,t){if(P5(t))return"theta"===e?"independent":"shared";if(B5(t))return"shared";if(j5(t))return GV(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function W3(e,t){const n=e.scale[t],r=GV(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&LX(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[r][t]||"shared"}const H3=WH({aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});class G3 extends h1{}const V3={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if("symbol"!==o)return;const{markDef:a,encoding:s,config:l,mark:u}=n,c=a.filled&&"trail"!==u;let f={...YY({},n,gZ),...d2(n,{filled:c})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,m=void 0===d?Y3(s.opacity)??a.opacity:void 0;if(f.fill)if("fill"===r||c&&r===OG)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=WY(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=WY(m??1));else if(Eo(f.fill)){const e=X3(s.fill??s.color)??a.fill??(c&&a.color);e&&(f.fill=WY(e))}if(f.stroke)if("stroke"===r||!c&&r===OG)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(Eo(f.stroke)){const e=oG(X3(s.stroke||s.color),a.stroke,c?a.color:void 0);e&&(f.stroke={value:e})}if(r!==PG){const e=aQ(t)&&Z3(n,i,t);e?f.opacity=[{test:e,...WY(m??1)},WY(l.legend.unselectedOpacity)]:m&&(f.opacity=WY(m))}return f={...f,...e},qH(f)?void 0:f},gradient:function(e,{model:t,legendType:n,legendCmpt:r}){if("gradient"!==n)return;const{config:i,markDef:o,encoding:a}=t;let s={};const l=r.get("gradientOpacity")??i.legend.gradientOpacity,u=void 0===l?Y3(a.opacity)||o.opacity:void 0;u&&(s.opacity=WY(u));return s={...s,...e},qH(s)?void 0:s},labels:function(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=aQ(t)?Z3(n,i,t):void 0,l=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=o;let f;MZ(c)?f=zZ({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:a}):void 0===u&&void 0===c&&a.customFormatTypes&&("quantitative"===t.type&&a.numberFormatType?f=zZ({fieldOrDatumDef:t,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):"temporal"===t.type&&a.timeFormatType&&aQ(t)&&void 0===t.timeUnit&&(f=zZ({fieldOrDatumDef:t,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return qH(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}};function Y3(e){return J3(e,((e,t)=>Math.max(e,t.value)))}function X3(e){return J3(e,((e,t)=>oG(e,t.value)))}function J3(e,t){return function(e){const t=e?.condition;return!!t&&(Eo(t)||pQ(t))}(e)?Zo(e.condition).reduce(t,e.value):pQ(e)?e.value:void 0}function Z3(e,t,n){const r=t.get("selections");if(!r?.length)return;const i=Fa(n.field);return r.map((e=>`(!length(data(${Fa(YH(e)+Y2)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`)).join(" || ")}const Q3={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return RZ(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return LZ(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??function({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:l}=e;if(PJ(i))return"horizontal"===n?"top"===r||"bottom"===r?t7(t,"width",a,o):a:t7(t,"height",l,s);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??function(e){if(NH(["quantile","threshold","log","symlog"],e))return"greedy";return}(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??function(e,t,n,r){if("shape"!==t){const e=X3(n)??r;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>CQ(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(iV(n)&&PJ(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;if(Eo(n))return PQ(t,n);if(zY(n))return n;return}(t,e)};function K3(e){const{legend:t}=e;return oG(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(iV(e)){if(NH(["quarter","month","day"],t))return"symbol";if(PJ(n))return"gradient"}return"symbol"}(e))}function e7({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function t7(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function n7(e){const t=L5(e)?function(e){const{encoding:t}=e,n={};for(const r of[OG,...TK]){const i=MQ(t[r]);i&&e.getScaleComponent(r)&&(r===zG&&aQ(i)&&i.type===kJ||(n[r]=i7(e,r)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){n7(r);for(const i of WH(r.component.legends))n.legend[i]=W3(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=o7(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of WH(t))for(const t of e.children)t.component.legends[r]&&"shared"===n.legend[r]&&delete t.component.legends[r];return t}(e);return e.component.legends=t,t}function r7(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===t&&e===r?.title)return!0}return e===(n||{})[t]}function i7(e,t){let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,a=o.legend,s=new G3({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){const r=e.fieldDef(t)?.field;for(const i of HH(e.component.selection??{})){const e=i.project.hasField[r]??i.project.hasChannel[t];if(e&&j2.defined(i)){const t=n.get("selections")??[];t.push(i.name),n.set("selections",t,!1),e.hasLegend=!0}}}(e,t,s);const l=void 0!==n?!n:a.disable;if(s.set("disable",l,void 0!==n),l)return s;n=n||{};const u=e.getScaleComponent(t).get("type"),c=MQ(i[t]),f=aQ(c)?nJ(c.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=K3({legend:n,channel:t,timeUnit:f,scaleType:u}),p={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:u,orient:d,legendType:h,direction:e7({legend:n,legendType:h,orient:d,legendConfig:a})};for(const r of H3){if("gradient"===h&&r.startsWith("symbol")||"symbol"===h&&r.startsWith("gradient"))continue;const i=r in Q3?Q3[r](p):n[r];if(void 0!==i){const a=r7(i,r,n,e.fieldDef(t));(a||void 0===o.legend[r])&&s.set(r,i,a)}}const m=n?.encoding??{},g=s.get("selections"),y={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:h};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=U3(m[t]??{},e),r=t in V3?V3[t](n,v):n;void 0===r||qH(r)||(y[t]={...g?.length&&aQ(c)?{name:`${YH(c.field)}_legend_${t}`}:{},...g?.length?{interactive:!!g}:{},update:r})}return qH(y)||s.set("encode",y,!!n?.encoding),s}function o7(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const n of H3){const r=v1(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return a7(e,t);case"title":return rX(e,t);case"type":return i=!0,m1("symbol")}return y1(e,t,n,"legend")}));e.setWithExplicit(n,r)}return i&&(e.implicit?.encode?.gradient&&JH(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&JH(e.explicit,["encode","gradient"])),e}function a7(e,t){return"circle"===t.value?t:e}function s7(e){const t=e.component.legends,n={};for(const r of WH(t)){const i=pG(e.getScaleComponent(r).get("domains"));if(n[i])for(const e of n[i]){o7(e,t[r])||n[i].push(t[r])}else n[i]=[t[r].clone()]}const r=HH(n).flat().map((t=>function(e,t){const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(n)return;!1===t.aria&&null==o.aria&&(o.aria=!1);if(o.encode?.symbols){const e=o.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||o.stroke||(e.stroke={value:"transparent"});for(const t of TK)o[t]&&delete e[t]}o.title||delete o.title;if(void 0!==r){let e=r;o.encode?.labels?.update&&zY(o.encode.labels.update.text)&&(e=nG(r,"datum.label",o.encode.labels.update.text.signal)),function(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}(o,"labels","text",{signal:e})}return o}(t,e.config))).filter((e=>void 0!==e));return r}function l7(e){return B5(e)||j5(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),u7(e))}(e):u7(e)}function u7(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const r=zY(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return NH(t,r)||t.push(r),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const c7=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class f7 extends h1{constructor(e,t,n,r){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function d7(e){e.component.projection=L5(e)?function(e){if(e.hasProjection){const t=OY(e.specifiedProjection),n=!(t&&(null!=t.scale||null!=t.translate)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?function(e){const t=[],{encoding:n}=e;for(const r of[[SG,DG],[FG,MG]])(MQ(n[r[0]])||MQ(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(zG)&&e.typedFieldDef(zG).type===kJ&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(A1.Main));return t}(e):void 0,o=new f7(e.projectionName(!0),{...OY(e.config.projection)??{},...t??{}},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}return}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)d7(t);const n=zH(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=zH(c7,(n=>!da(e.explicit,n)&&!da(t.explicit,n)||!!(da(e.explicit,n)&&da(t.explicit,n)&&hG(e.get(n),t.get(n))))),r=hG(e.size,t.size);if(r){if(n)return e;if(hG(e.explicit,{}))return t;if(hG(t.explicit,{}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),r=new f7(n,t.specifiedProjection,t.size,AH(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&r.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return r}return}(e)}function h7(e,t,n,r){if(jQ(t,n)){const i=L5(e)?e.axis(n)??e.legend(n)??{}:{},o=xQ(t,{expr:"datum"}),a=xQ(t,{expr:"datum",binSuffix:"end"});return{formulaAs:xQ(t,{binSuffix:"range",forAs:!0}),formula:IZ(o,a,i.format,i.formatType,r)}}return{}}function p7(e,t){return`${CY(e)}_${t}`}function m7(e,t,n){const r=p7(TQ(n,void 0)??{},t);return e.getName(`${r}_bins`)}function g7(e,t,n){let r,i;r=function(e){return"as"in e}(e)?$a(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[xQ(e,{forAs:!0}),xQ(e,{binSuffix:"end",forAs:!0})];const o={...TQ(t,void 0)},a=p7(o,e.field),{signal:s,extentSignal:l}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(SY(o.extent)){const e=o.extent;i=s3(n,e.param,e),delete o.extent}return{key:a,binComponent:{bin:o,field:e.field,as:[r],...s?{signal:s}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}}}}class y7 extends T1{clone(){return new y7(null,AH(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,r)=>{if(hQ(n)&&EY(n.bin)){const{key:i,binComponent:o}=g7(n,n.bin,t);e[i]={...o,...e[i],...h7(t,n,r,t.config)}}return e}),{});return qH(n)?null:new y7(e,n)}static makeFromTransform(e,t,n){const{key:r,binComponent:i}=g7(t,t.bin,n);return new y7(e,{[r]:i})}merge(e,t){for(const n of WH(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=PH([...this.bins[n].as,...e.bins[n].as],FH)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(HH(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(HH(this.bins).map((e=>e.field)))}hash(){return`Bin ${FH(this.bins)}`}assemble(){return HH(this.bins).flatMap((e=>{const t=[],[n,...r]=e.as,{extent:i,...o}=e.bin,a={type:"bin",field:tG(e.field),as:n,signal:e.signal,...SY(i)?{extent:null}:{extent:i},...e.span?{span:{signal:`span(${e.span})`}}:{},...o};!i&&e.extentSignal&&(t.push({type:"extent",field:tG(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const e of r)for(let r=0;r<2;r++)t.push({type:"formula",expr:xQ({field:n[r]},{expr:"datum"}),as:e[r]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function v7(e,t,n,r){const i=L5(r)?r.encoding[_V(t)]:void 0;if(hQ(n)&&L5(r)&&tQ(n,i,r.markDef,r.config)){e.add(xQ(n,{})),e.add(xQ(n,{suffix:"end"}));const{mark:i,markDef:o,config:a}=r,s=KZ({fieldDef:n,markDef:o,config:a});hZ(i)&&.5!==s&&GV(t)&&(e.add(xQ(n,{suffix:j1})),e.add(xQ(n,{suffix:B1}))),n.bin&&jQ(n,t)&&e.add(xQ(n,{binSuffix:"range"}))}else if(tV(t)){const n=eV(t);e.add(r.getName(n))}else e.add(xQ(n));return mQ(n)&&function(e){return Ao(e)&&"field"in e}(n.scale?.range)&&e.add(n.scale.range.field),e}class b7 extends T1{clone(){return new b7(null,new Set(this.dimensions),AH(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const r={},i=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:o,field:a}=e;if(o)if("count"===o)r["*"]??(r["*"]={}),r["*"].count=new Set([xQ(e,{forAs:!0})]);else{if(vY(o)||bY(o)){const e=vY(o)?"argmin":"argmax",t=o[e];r[t]??(r[t]={}),r[t][e]=new Set([xQ({op:e,field:t},{forAs:!0})])}else r[a]??(r[a]={}),r[a][o]=new Set([xQ(e,{forAs:!0})]);cY(n)&&"unaggregated"===t.scaleDomain(n)&&(r[a]??(r[a]={}),r[a].min=new Set([xQ({field:a,aggregate:"min"},{forAs:!0})]),r[a].max=new Set([xQ({field:a,aggregate:"max"},{forAs:!0})]))}else v7(i,n,e,t)})),i.size+WH(r).length===0?null:new b7(e,i,r)):null}static makeFromTransform(e,t){const n=new Set,r={};for(const e of t.aggregate){const{op:t,field:n,as:i}=e;t&&("count"===t?(r["*"]??(r["*"]={}),r["*"].count=new Set([i||xQ(e,{forAs:!0})])):(r[n]??(r[n]={}),r[n][t]=new Set([i||xQ(e,{forAs:!0})])))}for(const e of t.groupby??[])n.add(e);return n.size+WH(r).length===0?null:new b7(e,n,r)}merge(e){return jH(this.dimensions,e.dimensions)?(function(e,t){for(const n of WH(t)){const r=t[n];for(const t of WH(r))n in e?e[n][t]=new Set([...e[n][t]??[],...r[t]]):e[n]={[t]:r[t]}}}(this.measures,e.measures),!0):(function(...e){RX.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...WH(this.measures)])}producedFields(){const e=new Set;for(const t of WH(this.measures))for(const n of WH(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(`${n}_${t}`):r.forEach(e.add,e)}return e}hash(){return`Aggregate ${FH({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const r of WH(this.measures))for(const i of WH(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:tG(r));return{type:"aggregate",groupby:[...this.dimensions].map(tG),ops:e,fields:t,as:n}}}class x7 extends T1{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const e of aV){const n=t.facet[e];if(n){const{bin:r,sort:i}=n;this[e]={name:t.getName(`${e}_domain`),fields:[xQ(n),...EY(r)?[xQ(n,{binSuffix:"end"})]:[]],...GZ(i)?{sortField:i}:Eo(i)?{sortIndexField:w3(n,e)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of aV)this[t]&&(e+=` ${t.charAt(0)}:${FH(this[t])}`);return e}get fields(){const e=[];for(const t of aV)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){const e=new Set(this.fields);for(const t of aV)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of HV){const n=this.childModel.component.scales[t];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(RJ(r)&&RY(i)){const n=h5(p5(this.childModel,t));n?e[t]=n:LX(uX(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const r={row:"y",column:"x",facet:void 0}[e],i=[],o=[],a=[];r&&n&&n[r]&&(t?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:l}=this[e];if(s){const{op:e=UZ,field:t}=s;i.push(t),o.push(e),a.push(xQ(s,{forAs:!0}))}else l&&(i.push(l),o.push("max"),a.push(l));return{name:this[e].name,source:t??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...i.length?{fields:i,ops:o,as:a}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(const e of C3){for(const t of E3){const r=(n[e]&&n[e][t])??[];for(const t of r)if(t.axes?.length>0){i[e]=!0;break}}if(i[e]){const n=`length(data("${this.facet.name}"))`,i="row"===e?t?{signal:`ceil(${n} / ${t})`}:1:t?{signal:`min(${n}, ${t})`}:{signal:n};r.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:i}]})}}const{row:o,column:a}=i;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,e)),r}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;const r=[].concat(n.x??[],n.y??[]),i=r.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:r,ops:i}]})}for(const r of[gG,mG])this[r]&&e.push(this.assembleRowColumnHeaderData(r,t,n));if(o){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function w7(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function _7(e){const t={};return CH(e.filter,(e=>{if(hJ(e)){let n=null;aJ(e)?n=UY(e.equal):lJ(e)?n=UY(e.lte):sJ(e)?n=UY(e.lt):uJ(e)?n=UY(e.gt):cJ(e)?n=UY(e.gte):fJ(e)?n=e.range[0]:dJ(e)&&(n=(e.oneOf??e.in)[0]),n&&(PX(n)?t[e.field]="date":wa(n)?t[e.field]="number":$a(n)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function $7(e){const t={};function n(e){var n;RQ(e)?t[e.field]="date":"quantitative"===e.type&&($a(n=e.aggregate)&&NH(["min","max"],n))?t[e.field]="number":iG(e.field)>1?e.field in t||(t[e.field]="flatten"):mQ(e)&&GZ(e.sort)&&iG(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((L5(e)||P5(e))&&e.forEachFieldDef(((t,r)=>{if(hQ(t))n(t);else{const i=xV(r),o=e.fieldDef(i);n({...t,type:o.type})}})),L5(e)){const{mark:n,markDef:r,encoding:i}=e;if(dZ(n)&&!e.encoding.order){const e=i["horizontal"===r.orient?"y":"x"];aQ(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class k7 extends T1{clone(){return new k7(null,AH(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${FH(this._parse)}`}static makeExplicit(e,t,n){let r={};const i=t.data;return!$1(i)&&i?.format?.parse&&(r=i.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const e of WH(n)){const t=r.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:LX(mX(e,n[e],t.value)))}for(const e of WH(t)){const n=r.get(e);void 0!==n&&(n===t[e]?delete t[e]:LX(mX(e,t[e],n)))}const i=new h1(t,n);r.copyAll(i);const o={};for(const e of WH(i.combine())){const t=i.get(e);null!==t&&(o[e]=t)}return 0===WH(o).length||r.parseNothing?null:new k7(e,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of WH(this._parse)){const n=this._parse[t];1===iG(t)&&(e[t]=n)}return e}producedFields(){return new Set(WH(this._parse))}dependentFields(){return new Set(WH(this._parse))}assembleTransforms(e=!1){return WH(this._parse).filter((t=>!e||iG(t)>1)).map((e=>{const t=function(e,t){const n=QH(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(t.startsWith("date:"))return`timeParse(${n},'${w7(t.slice(5,t.length))}')`;if(t.startsWith("utc:"))return`utcParse(${n},'${w7(t.slice(4,t.length))}')`;return LX(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:rG(e)}})).filter((e=>null!==e))}}class C7 extends T1{clone(){return new C7(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([zK])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:zK}}}class E7 extends T1{clone(){return new E7(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${FH(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class A7 extends T1{clone(){return new A7(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${FH(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class D7 extends T1{constructor(e){let t;if(super(null),e??(e={name:"source"}),$1(e)||(t=e.format?{...MH(e.format,["parse"])}:{}),w1(e))this._data={values:e.values};else if(x1(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];NH(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else C1(e)?this._data={values:[{type:"Sphere"}]}:(_1(e)||$1(e))&&(this._data={});this._generator=$1(e),e.name&&(this._name=e.name),t&&!qH(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var S7,M7=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n},F7=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};function O7(e){return e instanceof D7||e instanceof E7||e instanceof A7}class N7{constructor(){S7.set(this,void 0),M7(this,S7,!1,"f")}setModified(){M7(this,S7,!0,"f")}get modifiedFlag(){return F7(this,S7,"f")}}S7=new WeakMap;class T7 extends N7{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class z7 extends N7{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class R7 extends z7{mergeNodes(e,t){const n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class L7 extends z7{constructor(e){super(),this.requiresSelectionId=e&&e3(e)}run(e){e instanceof C7&&(this.requiresSelectionId&&(O7(e.parent)||e.parent instanceof b7||e.parent instanceof k7)||(this.setModified(),e.remove()))}}class P7 extends N7{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof P1&&(n=e.producedFields(),BH(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const r of e.children)this.run(r,new Set([...t,...n]))}}class j7 extends z7{constructor(){super()}run(e){e instanceof z1&&!e.isRequired()&&(this.setModified(),e.remove())}}class B7 extends T7{run(e){if(!(O7(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof k7)if(e instanceof k7)this.setModified(),e.merge(t);else{if(UH(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class I7 extends T7{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof k7));if(e.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const e of n){const t=e.parse;for(const e of WH(t))e in r?r[e]!==t[e]&&i.add(e):r[e]=t[e]}for(const e of i)delete r[e];if(!qH(r)){this.setModified();const n=new k7(e,r);for(const i of t){if(i instanceof k7)for(const e of WH(r))delete i.parse[e];e.removeChild(i),i.parent=n,i instanceof k7&&0===WH(i.parse).length&&i.remove()}}}}}class U7 extends T7{run(e){e instanceof z1||e.numChildren()>0||e instanceof x7||e instanceof D7||(this.setModified(),e.remove())}}class q7 extends T7{run(e){const t=e.children.filter((e=>e instanceof P1)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class W7 extends T7{run(e){const t=e.children.filter((e=>e instanceof b7)),n={};for(const e of t){const t=FH(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of WH(n)){const r=n[t];if(r.length>1){const t=r.pop();for(const n of r)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class H7 extends T7{constructor(e){super(),this.model=e}run(e){const t=!(O7(e)||e instanceof o3||e instanceof k7||e instanceof C7),n=[],r=[];for(const i of e.children)i instanceof y7&&(t&&!UH(e.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof y7?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class G7 extends T7{run(e){const t=[...e.children];if(!TH(t,(e=>e instanceof z1))||e.numChildren()<=1)return;const n=[];let r;for(const i of t)if(i instanceof z1){let t=i;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof z1))break;t=e}n.push(...t.children),r?(e.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=t,this.setModified()):r=t}else n.push(i);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=r}}}class V7 extends T1{clone(){return new V7(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=PH(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??xQ(e)}hash(){return`JoinAggregateTransform ${FH(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const r=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==r?{groupby:r}:{}}}}class Y7 extends T1{clone(){return new Y7(null,AH(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(e,t){const{stack:n,groupby:r,as:i,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(oG(e.order,"ascending"));const l={field:a,order:s};let u;return u=function(e){return Eo(e)&&e.every((e=>$a(e)))&&e.length>1}(i)?i:$a(i)?[i,`${i}_end`]:[`${t.stack}_start`,`${t.stack}_end`],new Y7(e,{dimensionFieldDefs:[],stackField:n,groupby:r,offset:o,sort:l,facetby:[],as:u})}static makeFromEncoding(e,t){const n=t.stack,{encoding:r}=t;if(!n)return null;const{groupbyChannels:i,fieldChannel:o,offset:a,impute:s}=n,l=i.map((e=>SQ(r[e]))).filter((e=>!!e)),u=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=xQ(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;if(Eo(c)||aQ(c))f=eX(c);else{const e=nQ(c)?c.sort:"y"===o?"descending":"ascending";f=u.reduce(((t,n)=>(t.field.push(n),t.order.push(e),t)),{field:[],order:[]})}return new Y7(e,{dimensionFieldDefs:l,stackField:t.vgField(o),facetby:[],stackby:u,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${FH(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[xQ(e,{binSuffix:"mid"})]:[xQ(e,{}),xQ(e,{binSuffix:"end"})]:[xQ(e)])).flat():n??[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:l}=this._stack;if(s)for(const o of n){const{bandPosition:n=.5,bin:a}=o;if(a){const t=xQ(o,{expr:"datum"}),r=xQ(o,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${n}*${t}+${1-n}*${r}`,as:xQ(o,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:r,groupby:[...i,...t],key:xQ(o,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:r,sort:o,as:l,offset:a}),e}}class X7 extends T1{clone(){return new X7(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=PH(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach((t=>e.add(t.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??xQ(e)}hash(){return`WindowTransform ${FH(this.transform)}`}assemble(){const e=[],t=[],n=[],r=[];for(const i of this.transform.window)t.push(i.op),n.push(this.getDefaultName(i)),r.push(void 0===i.param?null:i.param),e.push(void 0===i.field?null:i.field);const i=this.transform.frame,o=this.transform.groupby;if(i&&null===i[0]&&null===i[1]&&t.every((e=>xY(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==o?{groupby:o}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort)a.push(e.field),s.push(e.order??"ascending");const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:r,as:n,ops:t,fields:e,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==o?{groupby:o}:{},...void 0!==i?{frame:i}:{}}}}function J7(e){if(e instanceof x7)if(1!==e.numChildren()||e.children[0]instanceof z1){const n=e.model.component.data.main;Z7(n);const r=(t=e,function e(n){if(!(n instanceof x7)){const r=n.clone();if(r instanceof z1){const e=Q7+r.getSource();r.setSource(e),t.model.component.data.outputNodes[e]=r}else(r instanceof b7||r instanceof Y7||r instanceof X7||r instanceof V7)&&r.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=r;return[r]}return n.children.flatMap(e)}),i=e.children.map(r).flat();for(const e of i)e.parent=n}else{const t=e.children[0];(t instanceof b7||t instanceof Y7||t instanceof X7||t instanceof V7)&&t.addDimensions(e.fields),t.swapWithParent(),J7(e)}else e.children.map(J7);var t}function Z7(e){if(e instanceof z1&&e.type===A1.Main&&1===e.numChildren()){const t=e.children[0];t instanceof x7||(t.swapWithParent(),Z7(e))}}const Q7="scale_",K7=5;function e5(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!e5(t.children))return!1}return!0}function t5(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function n5(e,t,n){let r=e.sources,i=!1;return i=t5(new j7,r)||i,i=t5(new L7(t),r)||i,r=r.filter((e=>e.numChildren()>0)),i=t5(new U7,r)||i,r=r.filter((e=>e.numChildren()>0)),n||(i=t5(new B7,r)||i,i=t5(new H7(t),r)||i,i=t5(new P7,r)||i,i=t5(new I7,r)||i,i=t5(new W7,r)||i,i=t5(new q7,r)||i,i=t5(new R7,r)||i,i=t5(new G7,r)||i),e.sources=r,i}class r5{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new r5((()=>e(t)))}}function i5(e){L5(e)?function(e){const t=e.component.scales;for(const n of WH(t)){const r=o5(e,n);if(t[n].setWithExplicit("domains",r),u5(e,n),e.component.data.isFaceted){let t=e;for(;!P5(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of r.value)LY(e)&&(e.data=Q7+e.data.replace(Q7,""))}}}(e):function(e){for(const t of e.children)i5(t);const t=e.component.scales;for(const n of WH(t)){let r,i=null;for(const t of e.children){const e=t.component.scales[n];if(e){r=void 0===r?e.getWithExplicit("domains"):v1(r,e.getWithExplicit("domains"),"domains","scale",f5);const t=e.get("selectionExtent");i&&t&&i.param!==t.param&&LX(hX),i=t}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}(e)}function o5(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=function(e,t,n,r){if("unaggregated"===e){const{valid:e,reason:r}=c5(t,n);if(!e)return void LX(r)}else if(void 0===e&&r.useUnaggregatedDomain){const{valid:e}=c5(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),"x"===t&&MQ(r.x2)?MQ(r.x)?v1(s5(n,i,e,"x"),s5(n,i,e,"x2"),"domain","scale",f5):s5(n,i,e,"x2"):"y"===t&&MQ(r.y2)?MQ(r.y)?v1(s5(n,i,e,"y"),s5(n,i,e,"y2"),"domain","scale",f5):s5(n,i,e,"y2"):s5(n,i,e,t)}function a5(e,t,n){const r=nJ(n)?.unit;return"temporal"===t||r?function(e,t,n){return e.map((e=>({signal:`{data: ${LQ(e,{timeUnit:n,type:t})}}`})))}(e,t,r):[e]}function s5(e,t,n,r){const{encoding:i,markDef:o,mark:a,config:s,stack:l}=n,u=MQ(i[r]),{type:c}=u,f=u.timeUnit;if(function(e){return e?.unionWith}(t)){const i=s5(e,void 0,n,r);return p1([...a5(t.unionWith,c,f),...i.value])}if(zY(t))return p1([t]);if(t&&"unaggregated"!==t&&!BJ(t))return p1(a5(t,c,f));if(l&&r===l.fieldChannel){if("normalize"===l.offset)return m1([[0,1]]);const e=n.requestDataName(A1.Main);return m1([{data:e,field:n.vgField(r,{suffix:"start"})},{data:e,field:n.vgField(r,{suffix:"end"})}])}const d=cY(r)&&aQ(u)?function(e,t,n){if(!RJ(n))return;const r=e.fieldDef(t),i=r.sort;if(VZ(i))return{op:"min",field:w3(r,t),order:"ascending"};const{stack:o}=e,a=o?new Set([...o.groupbyFields,...o.stackBy.map((e=>e.fieldDef.field))]):void 0;if(GZ(i)){return l5(i,o&&!a.has(i.field))}if(HZ(i)){const{encoding:t,order:n}=i,r=e.fieldDef(t),{aggregate:s,field:l}=r,u=o&&!a.has(l);if(vY(s)||bY(s))return l5({field:xQ(r),order:n},u);if(xY(s)||!s)return l5({op:s,field:l,order:n},u)}else{if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(NH(["ascending",void 0],i))return!0}return}(n,r,e):void 0;if(lQ(u)){return m1(a5([u.datum],c,f))}const h=u;if("unaggregated"===t){const e=n.requestDataName(A1.Main),{field:t}=u;return m1([{data:e,field:xQ({field:t,aggregate:"min"})},{data:e,field:xQ({field:t,aggregate:"max"})}])}if(EY(h.bin)){if(RJ(e))return m1("bin-ordinal"===e?[]:[{data:VH(d)?n.requestDataName(A1.Main):n.requestDataName(A1.Raw),field:n.vgField(r,jQ(h,r)?{binSuffix:"range"}:{}),sort:!0!==d&&Ao(d)?d:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:e}=h;if(EY(e)){const t=m7(n,h.field,e);return m1([new r5((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return m1([{data:n.requestDataName(A1.Main),field:n.vgField(r,{})}])}}if(h.timeUnit&&NH(["time","utc"],e)){const e=i[_V(r)];if(tQ(h,e,o,s)){const t=n.requestDataName(A1.Main),i=KZ({fieldDef:h,fieldDef2:e,markDef:o,config:s}),l=hZ(a)&&.5!==i;return m1([{data:t,field:n.vgField(r,l?{suffix:j1}:{})},{data:t,field:n.vgField(r,{suffix:l?B1:"end"})}])}}return m1(d?[{data:VH(d)?n.requestDataName(A1.Main):n.requestDataName(A1.Raw),field:n.vgField(r),sort:d}]:[{data:n.requestDataName(A1.Main),field:n.vgField(r)}])}function l5(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":UZ),...r?{field:tG(r)}:{},...i?{order:i}:{}}}function u5(e,t){const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=e.fieldDef(t)?.bin,o=BJ(r)&&r,a=DY(i)&&SY(i.extent)&&i.extent;(o||a)&&n.set("selectionExtent",o??a,!0)}function c5(e,t){const{aggregate:n,type:r}=e;return n?$a(n)&&!kY.has(n)?{valid:!1,reason:AX(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:DX(e)}:{valid:!0}:{valid:!1,reason:EX(e)}}function f5(e,t,n,r){return e.explicit&&t.explicit&&LX(function(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${pG(n)} and ${pG(r)}). Using the union of the two domains.`}(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function d5(e){const t=PH(e.map((e=>{if(LY(e)){const{sort:t,...n}=e;return n}return e})),FH),n=PH(e.map((e=>{if(LY(e)){const t=e.sort;return void 0===t||VH(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),FH);if(0===t.length)return;if(1===t.length){const t=e[0];if(LY(t)&&n.length>0){let e=n[0];if(n.length>1){LX(FX);const t=n.filter((e=>Ao(e)&&"op"in e&&"min"!==e.op));e=!n.every((e=>Ao(e)&&"op"in e))||1!==t.length||t[0]}else if(Ao(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}const r=PH(n.map((e=>VH(e)||!("op"in e)||$a(e.op)&&e.op in yY?e:(LX(function(e){return`Dropping sort property ${pG(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),FH);let i;1===r.length?i=r[0]:r.length>1&&(LX(FX),i=!0);const o=PH(e.map((e=>LY(e)?e.data:null)),(e=>e));if(1===o.length&&null!==o[0]){return{data:o[0],fields:t.map((e=>e.field)),...i?{sort:i}:{}}}return{fields:t,...i?{sort:i}:{}}}function h5(e){if(LY(e)&&$a(e.field))return e.field;if(function(e){return!Eo(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(LY(n)&&$a(n.field))if(t){if(t!==n.field)return LX("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return LX("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!Eo(e)&&"fields"in e&&"data"in e}(e)){LX("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return $a(t)?t:void 0}}function p5(e,t){const n=e.component.scales[t].get("domains").map((t=>(LY(t)&&(t.data=e.lookupDataSource(t.data)),t)));return d5(n)}function m5(e){return B5(e)||j5(e)?e.children.reduce(((e,t)=>e.concat(m5(t))),g5(e)):g5(e)}function g5(e){return WH(e.component.scales).reduce(((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:l,range:u,reverse:c,...f}=i,d=function(e,t,n,r){if(GV(n)){if(RY(e))return{step:{signal:`${t}_step`}}}else if(Ao(e)&&LY(e))return{...e,data:r.lookupDataSource(e.data)};return e}(i.range,o,n,e),h=p5(e,n),p=s?function(e,t,n,r){const i=s3(e,t.param,t);return{signal:LJ(n.get("type"))&&Eo(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}(e,s,r,h):null;return t.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==c?{reverse:c}:{},...f}),t}),[])}class y5 extends h1{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||TH(this.get("domains"),(e=>Eo(e)&&2===e.length&&wa(e[0])&&e[0]<=0&&wa(e[1])&&e[1]>=0))}}const v5=["range","scheme"];function b5(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:r,field:i}=n,o=$V(t),a=e.getName(o);if(Ao(r)&&r.binned&&void 0!==r.step)return new r5((()=>{const n=e.scaleName(t),i=`(domain("${n}")[1] - domain("${n}")[0]) / ${r.step}`;return`${e.getSignalName(a)} / (${i})`}));if(EY(r)){const t=m7(e,i,r);return new r5((()=>{const n=e.getSignalName(t),r=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(a)} / (${r})`}))}}}function x5(e,t){const n=t.specifiedScales[e],{size:r}=t,i=t.getScaleComponent(e).get("type");for(const r of v5)if(void 0!==n[r]){const o=XJ(i,r),a=JJ(e,r);if(o)if(a)LX(a);else switch(r){case"range":{const r=n.range;if(Eo(r)){if(GV(e))return p1(r.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),r=t.getSignalName.bind(t);return r5.fromName(r,n)}return e})))}else if(Ao(r))return p1({data:t.requestDataName(A1.Main),field:r.field,sort:{op:"min",field:t.vgField(e)}});return p1(r)}case"scheme":return p1(w5(n[r]))}else LX(SX(i,r,e))}const o=e===vG||"xOffset"===e?"width":"height",a=r[o];if(HK(a))if(GV(e))if(RJ(i)){const n=$5(a,t,e);if(n)return p1({step:n})}else LX(MX(o));else if(ZV(e)){const n=e===_G?"x":"y";if("band"===t.getScaleComponent(n).get("type")){const e=k5(a,i);if(e)return p1(e)}}const{rangeMin:s,rangeMax:l}=n,u=function(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:a}=MQ(o[e]),s=t.getScaleComponent(e),l=s.get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case vG:case bG:if(NH(["point","band"],l)){const i=C5(e,n,r.view);if(HK(i)){return{step:$5(i,t,e)}}}return _5(e,t,l);case _G:case $G:return function(e,t,n){const r=e===_G?"x":"y",i=t.getScaleComponent(r);if(!i)return _5(r,t,n,{center:!0});const o=i.get("type"),a=t.scaleName(r),{markDef:s,config:l}=t;if("band"===o){const e=C5(r,t.size,t.config.view);if(HK(e)){const t=k5(e,n);if(t)return t}return[0,{signal:`bandwidth('${a}')`}]}{const n=t.encoding[r];if(aQ(n)&&n.timeUnit){const e=rJ(n.timeUnit,(e=>`scale('${a}', ${e})`)),r=t.config.scale.bandWithNestedOffsetPaddingInner,i=KZ({fieldDef:n,markDef:s,config:l})-.5,o=0!==i?` + ${i}`:"";if(r){return[{signal:`${zY(r)?`${r.signal}/2`+o:`${r/2+i}`} * (${e})`},{signal:`${zY(r)?`(1 - ${r.signal}/2)`+o:`${1-r/2+i}`} * (${e})`}]}return[0,{signal:e}]}return DH(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}(e,t,l);case RG:{const o=E5(i,t.component.scales[e].get("zero"),r),a=function(e,t,n,r){const i={x:b5(n,"x"),y:b5(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const e=D5(t,i,r.view);return wa(e)?e-1:new r5((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const e=D5(t,i,r.view);return wa(e)?Math.pow(A5*e,2):new r5((()=>`pow(${A5} * ${e.signal}, 2)`))}}throw new Error(_X("size",e))}(i,n,t,r);return jJ(l)?function(e,t,n){const r=()=>{const r=VY(t),i=VY(e),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return zY(t)?new r5(r):{signal:r()}}(o,a,function(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&Eo(n)?n.length+1:(LX(function(e){return`Domain for ${e} is required for threshold scale.`}(r)),3)}}(l,r,u,e)):[o,a]}case EG:return[0,2*Math.PI];case LG:return[0,360];case kG:return[0,new r5((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case IG:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case UG:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case zG:return"symbol";case OG:case NG:case TG:return"ordinal"===l?"nominal"===a?"category":"ordinal":void 0!==c?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case PG:case jG:case BG:return[r.scale.minOpacity,r.scale.maxOpacity]}}(e,t);return(void 0!==s||void 0!==l)&&XJ(i,"rangeMin")&&Eo(u)&&2===u.length?p1([s??u[0],l??u[1]]):m1(u)}function w5(e){return function(e){return!$a(e)&&!!e.name}(e)?{scheme:e.name,...MH(e,["name"])}:{scheme:e}}function _5(e,t,n,{center:r}={}){const i=$V(e),o=t.getName(i),a=t.getSignalName.bind(t);return e===bG&&LJ(n)?r?[r5.fromName((e=>`${a(e)}/2`),o),r5.fromName((e=>`-${a(e)}/2`),o)]:[r5.fromName(a,o),0]:r?[r5.fromName((e=>`-${a(e)}/2`),o),r5.fromName((e=>`${a(e)}/2`),o)]:[0,r5.fromName(a,o)]}function $5(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=CV(n),a=r[o];if("offset"===WK({step:e,offsetIsDiscrete:dQ(a)&&bJ(a.type)})&&ZQ(r,o)){const n=t.getScaleComponent(o);let r=`domain('${t.scaleName(o)}').length`;if("band"===n.get("type")){r=`bandspace(${r}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`}const a=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${r} / (1-${HY(a)})`}}return e.step}function k5(e,t){if("offset"===WK({step:e,offsetIsDiscrete:RJ(t)}))return{step:e.step}}function C5(e,t,n){const r=e===vG?"width":"height",i=t[r];return i||JK(n,r)}function E5(e,t,n){if(t)return zY(t)?{signal:`${t.signal} ? 0 : ${E5(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(_X("size",e))}const A5=.95;function D5(e,t,n){const r=HK(e.width)?e.width.step:XK(n,"width"),i=HK(e.height)?e.height.step:XK(n,"height");return t.x||t.y?new r5((()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`)):Math.min(r,i)}function S5(e,t){L5(e)?function(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const s of WH(n)){const l=a[s],u=n[s],c=e.getScaleComponent(s),f=MQ(i[s]),d=l[t],h=c.get("type"),p=c.get("padding"),m=c.get("paddingInner"),g=XJ(h,t),y=JJ(s,t);if(void 0!==d&&(g?y&&LX(y):LX(SX(h,t,s))),g&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":PX(l[t])||"temporal"===n||e?u.set(t,{signal:LQ(l[t],{type:n,timeUnit:e})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const n=t in M5?M5[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:QQ(i,s),hasSecondaryRangeChannel:!!i[_V(s)]}):r.scale[t];void 0!==n&&u.set(t,n,!1)}}}(e,t):O5(e,t)}const M5={bins:({model:e,fieldOrDatumDef:t})=>aQ(t)?function(e,t){const n=t.bin;if(EY(n)){const r=m7(e,t.field,n);return new r5((()=>e.getSignalName(r)))}if(AY(n)&&DY(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(NH([OG,NG,TG],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>function(e,t,n,r,i,o){if(SQ(o)?.bin||Eo(n)||null!=i||null!=r||NH([CJ.TIME,CJ.UTC],e))return;return!!GV(t)||void 0}(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function(e,t,n,r,i,o){if(GV(e)){if(PJ(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=i;if("bar"===t&&(!aQ(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===CJ.POINT)return n.pointPadding}return}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>function(e,t,n,r,i,o=!1){if(void 0!==e)return;if(GV(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r,bandWithNestedOffsetPaddingInner:a}=i;return o?a:oG(e,"bar"===n?t:r)}if(ZV(t)&&r===CJ.BAND)return i.offsetBandPaddingInner;return}(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>function(e,t,n,r,i,o=!1){if(void 0!==e)return;if(GV(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=i;if(o)return t;if(n===CJ.BAND)return oG(e,zY(r)?{signal:`${r.signal}/2`}:r/2)}else if(ZV(t)){if(n===CJ.POINT)return.5;if(n===CJ.BAND)return i.offsetBandPaddingOuter}return}(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>function(e,t,n,r){if("x"===n&&void 0!==r.xReverse)return LJ(e)&&"descending"===t?zY(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(LJ(e)&&"descending"===t)return!0;return}(t,aQ(e)?e.sort:void 0,n,r.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:a})=>function(e,t,n,r,i,o,a){if(n&&"unaggregated"!==n&&LJ(i)){if(Eo(n)){const e=n[0],t=n[n.length-1];if(wa(e)&&e<=0&&wa(t)&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!jJ(i))return!0;if((!aQ(t)||!t.bin)&&NH([...HV,...YV],e)){const{orient:t,type:n}=r;return(!NH(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e))&&(!(!NH(["bar","area"],n)||a)||o?.zero)}return!1}(e,t,n,r,i,o.scale,a)};function F5(e){L5(e)?function(e){const t=e.component.scales;for(const n of uY){const r=t[n];if(!r)continue;const i=x5(n,e);r.setWithExplicit("range",i)}}(e):O5(e,"range")}function O5(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?F5(n):S5(n,t);for(const r of WH(n)){let i;for(const n of e.children){const e=n.component.scales[r];if(e){i=v1(i,e.getWithExplicit(t),t,"scale",g1(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0)))}}n[r].setWithExplicit(t,i)}}function N5(e,t,n,r,i=!1){const o=function(e,t,n,r){switch(t.type){case"nominal":case"ordinal":if(iV(e)||"discrete"===mY(e))return"shape"===e&&"ordinal"===t.type&&LX(CX(e,"ordinal")),"ordinal";if(GV(e)||ZV(e)){if(NH(["rect","bar","image","rule"],n.type))return"band";if(r)return"band"}else if("arc"===n.type&&e in VV)return"band";return bZ(n[$V(e)])||gQ(t)&&t.axis?.tickBand?"band":"point";case"temporal":return iV(e)?"time":"discrete"===mY(e)?(LX(CX(e,"temporal")),"ordinal"):aQ(t)&&t.timeUnit&&nJ(t.timeUnit).utc?"utc":"time";case"quantitative":return iV(e)?aQ(t)&&EY(t.bin)?"bin-ordinal":"linear":"discrete"===mY(e)?(LX(CX(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(bX(t.type))}(t,n,r,i),{type:a}=e;return cY(t)?void 0!==a?function(e,t,n=!1){if(!cY(e))return!1;switch(e){case vG:case bG:case _G:case $G:case EG:case kG:return!!PJ(t)||"band"===t||"point"===t&&!n;case RG:case IG:case PG:case jG:case BG:case LG:return PJ(t)||jJ(t)||NH(["band","point","ordinal"],t);case OG:case NG:case TG:return"band"!==t;case UG:case zG:return"ordinal"===t||jJ(t)}}(t,a)?aQ(n)&&(s=a,l=n.type,!(NH([wJ,$J],l)?void 0===s||RJ(s):l===_J?NH([CJ.TIME,CJ.UTC,void 0],s):l!==xJ||OJ(s)||jJ(s)||void 0===s))?(LX(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(a,o)),o):a:(LX(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,a,o)),o):o:null;var s,l}function T5(e){L5(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of uY){const a=MQ(t[o]);if(a&&n===fZ&&o===zG&&a.type===kJ)continue;let s=a&&a.scale;if(a&&null!==s&&!1!==s){s??(s={});const n=N5(s,o,a,r,QQ(t,o));i[o]=new y5(e.scaleName(`${o}`,!0),{value:n,explicit:s.type===n})}}return i}(e):e.component.scales=function(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const n of e.children){T5(n);for(const o of WH(n.component.scales))if((t=i.scale)[o]??(t[o]=q3(o,e)),"shared"===i.scale[o]){const e=r[o],t=n.component.scales[o].getWithExplicit("type");e?AJ(e.value,t.value)?r[o]=v1(e,t,"type","scale",z5):(i.scale[o]="independent",delete r[o]):r[o]=t}}for(const t of WH(r)){const i=e.scaleName(t,!0),o=r[t];n[t]=new y5(i,o);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),i),e.merged=!0)}}return n}(e)}const z5=g1(((e,t)=>SJ(e)-SJ(t)));class R5{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function L5(e){return"unit"===e?.type}function P5(e){return"facet"===e?.type}function j5(e){return"concat"===e?.type}function B5(e){return"layer"===e?.type}class I5{constructor(e,t,n,r,i,o,a){this.type=t,this.parent=n,this.config=i,this.correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=OY(a),this.name=e.name??r,this.title=TY(e.title)?{text:e.title}:e.title?OY(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new R5,this.projectionNameMap=n?n.projectionNameMap:new R5,this.signalNameMap=n?n.signalNameMap:new R5,this.data=e.data,this.description=e.description,this.transforms=function(e){return e.map((e=>T0(e)?{filter:EH(e.filter,yJ)}:e))}(e.transform??[]),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){const r=n[t],i={},{spacing:o,columns:a}=r;void 0!==o&&(i.spacing=o),void 0!==a&&(JZ(e)&&!YZ(e.facet)||IK(e))&&(i.columns=a),UK(e)&&(i.columns=1);for(const t of VK)if(void 0!==e[t])if("spacing"===t){const n=e[t];i[t]=wa(n)?n:{row:n.row??o,column:n.column??o}}else i[t]=e[t];return i}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:JZ(e)||n?.component.data.isFaceted&&void 0===e.data},layoutSize:new h1,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?AH(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){T5(e),i5(e);for(const t of YJ)S5(e,t);t||F5(e)}(this)}parseProjection(){d7(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){n7(this)}assembleEncodeFromView(e){const{style:t,...n}=e,r={};for(const e of WH(n)){const t=n[e];void 0!==t&&(r[e]=WY(t))}return r}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=WY(this.description)),"unit"!==this.type&&"layer"!==this.type)?qH(t)?void 0:t:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...t??{}}}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:r}=this,i=function(e,t){const n={};for(const r of aV){const i=e[r];if(i?.facetFieldDef){const{titleAnchor:e,titleOrient:o}=k3(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=_3(r,o),s=z3(e,a);void 0!==s&&(n[a]=s)}}return qH(n)?void 0:n}(n.layoutHeaders,r);return{padding:e,...this.assembleDefaultLayout(),...t,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of aV)e[n].title&&t.push(A3(this,n));for(const e of C3)t=t.concat(M3(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:r=[]}=e;return[...n.map((e=>c3(e,"grid",t))),...r.map((e=>c3(e,"grid",t))),...n.map((e=>c3(e,"main",t))),...r.map((e=>c3(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return s7(this)}assembleProjections(){return l7(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},n={...NY(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return NH(["unit","layer"],this.type)?NH(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),qH(n)?void 0:n}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||P5(this.parent)?m5(this):[];r.length>0&&(t.scales=r);const i=this.assembleAxes();i.length>0&&(t.axes=i);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return YH((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(A1[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(P5(this.parent)){const t=XV(I3(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),r=n.get("range");if(RJ(e)&&RY(r)){const e=n.get("name"),r=h5(p5(this,t));if(r){return{signal:B3(e,n,xQ({aggregate:"distinct",field:r},{expr:"datum"}))}}return LX(uX(t)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):yV(e)&&cY(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(function(e){return`Cannot find a selection named "${e}".`}(t));return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((e=>e.hasOrientSignalRef()))||this.component.axes.y?.some((e=>e.hasOrientSignalRef()))}}class U5 extends I5{vgField(e,t={}){const n=this.fieldDef(e);if(n)return xQ(n,t)}reduceFieldDef(e,t){return function(e,t,n,r){return e?WH(e).reduce(((n,i)=>{const o=e[i];return Eo(o)?o.reduce(((e,n)=>t.call(r,e,n,i)),n):t.call(r,n,o,i)}),n):n}(this.getMapping(),((t,n,r)=>{const i=SQ(n);return i?e(t,i,r):t}),t)}forEachFieldDef(e,t){rK(this.getMapping(),((t,n)=>{const r=SQ(t);r&&e(r,n)}),t)}}class q5 extends T1{clone(){return new q5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${FH(this.transform)}`}assemble(){const{density:e,...t}=this.transform,n={type:"kde",field:e,...t};return this.transform.groupby&&(n.resolve="shared"),n}}class W5 extends T1{clone(){return new W5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${FH(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}class H5 extends T1{clone(){return new H5(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:n,mark:r,markDef:i}=t;if("filter"!==JY("invalid",i,n))return null;const o=t.reduceFieldDef(((e,n,i)=>{const o=cY(i)&&t.getScaleComponent(i);if(o){LJ(o.get("type"))&&"count"!==n.aggregate&&!dZ(r)&&(e[n.field]=n)}return e}),{});return WH(o).length?new H5(e,o):null}dependentFields(){return new Set(WH(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${FH(this.filter)}`}assemble(){const e=WH(this.filter).reduce(((e,t)=>{const n=this.filter[t],r=xQ(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(e.push(`isValid(${r})`),e.push(`isFinite(+${r})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class G5 extends T1{clone(){return new G5(this.parent,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((e,t)=>r[t]??e))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${FH(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class V5 extends T1{clone(){return new V5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"key",n[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${FH(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Y5 extends T1{clone(){return new Y5(null,AH(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const r of[[SG,DG],[FG,MG]]){const i=r.map((e=>{const n=MQ(t.encoding[e]);return aQ(n)?n.field:lQ(n)?{expr:`${n.datum}`}:pQ(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(e=new Y5(e,i,null,t.getName("geojson_"+n++)))}if(t.channelHasField(zG)){const r=t.typedFieldDef(zG);r.type===kJ&&(e=new Y5(e,null,r.field,t.getName("geojson_"+n++)))}return e}constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}dependentFields(){const e=(this.fields??[]).filter($a);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${FH(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class X5 extends T1{clone(){return new X5(null,this.projection,AH(this.fields),AH(this.as))}constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[SG,DG],[FG,MG]]){const r=n.map((e=>{const n=MQ(t.encoding[e]);return aQ(n)?n.field:lQ(n)?{expr:`${n.datum}`}:pQ(n)?{expr:`${n.value}`}:void 0})),i=n[0]===FG?"2":"";(r[0]||r[1])&&(e=new X5(e,t.projectionName(),r,[t.getName(`x${i}`),t.getName(`y${i}`)]))}return e}dependentFields(){return new Set(this.fields.filter($a))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${FH(this.fields)} ${FH(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class J5 extends T1{clone(){return new J5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new J5(e,t)}static makeFromEncoding(e,t){const n=t.encoding,r=n.x,i=n.y;if(aQ(r)&&aQ(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:l,frame:u,keyvals:c}=o.impute,f=iK(t.mark,n);return new J5(e,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==l?{value:l}:{},...u?{frame:u}:{},...void 0!==c?{keyvals:c}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${FH(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...n?{keyvals:z0(n)?this.processSequence(n):n}:{},method:"value",...i?{groupby:i}:{},value:r&&"value"!==r?null:o};if(r&&"value"!==r){return[s,{type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1,...i?{groupby:i}:{}},{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[s]}}class Z5 extends T1{clone(){return new Z5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${FH(this.transform)}`}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class Q5 extends T1{clone(){return new Q5(null,AH(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,r){const i=t.component.data.sources,{from:o}=n;let a=null;if(function(e){return"data"in e}(o)){let e=h6(o.data,i);e||(e=new D7(o.data),i.push(e));const n=t.getName(`lookup_${r}`);a=new z1(e,n,A1.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"param"in e}(o)){const e=o.param;let r;n={as:e,...n};try{r=t.getSelectionComponent(YH(e),e)}catch(t){throw new Error(function(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}(e))}if(a=r.materialized,!a)throw new Error(function(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}(e))}return new Q5(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Zo(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${FH({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:Zo(this.transform.as)}:{}};else{let t=this.transform.as;$a(t)||(LX('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class K5 extends T1{clone(){return new K5(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"prob",n[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${FH(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class e6 extends T1{clone(){return new e6(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=AH(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${FH(this.transform)}`}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class t6 extends T1{clone(){return new t6(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=PH((this.transform.groupby??[]).concat(e),(e=>e))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${FH(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==r?{limit:r}:{},...void 0!==i?{op:i}:{},...void 0!==n?{groupby:n}:{}}}}class n6 extends T1{clone(){return new n6(null,AH(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${FH(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function r6(e){let t=0;return function n(r,i){if(r instanceof D7&&!r.isGenerator&&!x1(r.data)){e.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof k7&&(r.parent instanceof D7&&!i.source?(i.format={...i.format??{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof x7)return i.name||(i.name="data_"+t++),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,void e.push(...r.assemble());if((r instanceof E7||r instanceof A7||r instanceof H5||r instanceof o3||r instanceof x3||r instanceof X5||r instanceof b7||r instanceof Q5||r instanceof X7||r instanceof V7||r instanceof V5||r instanceof G5||r instanceof q5||r instanceof Z5||r instanceof K5||r instanceof e6||r instanceof C7||r instanceof n6||r instanceof t6||r instanceof W5)&&i.transform.push(r.assemble()),(r instanceof y7||r instanceof P1||r instanceof J5||r instanceof Y7||r instanceof Y5)&&i.transform.push(...r.assemble()),r instanceof z1)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof z1)r.setSource(i.name);else if(i.name||(i.name="data_"+t++),r.setSource(i.name),1===r.numChildren()){e.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof z1&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+t++);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const e of r.children){n(e,{name:null,source:o,transform:[]})}break}}}}function i6(e){return"top"===e||"left"===e||zY(e)?"header":"footer"}function o6(e,t){const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const a=n[t],s=$3("title",null,r,t);let l=CQ(a,r,{allowDisabling:!0,includeDefault:void 0===s||!!s});i.component.layoutHeaders[t].title&&(l=Eo(l)?l.join(", "):l,l+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const u=$3("labelOrient",a.header,r,t),c=null!==a.header&&oG(a.header?.labels,r.header.labels,!0),f=NH(["bottom","right"],u)?"footer":"header";o.layoutHeaders[t]={title:null!==a.header?l:null,facetFieldDef:a,[f]:"facet"===t?[]:[a6(e,t,c)]}}}function a6(e,t,n){const r="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function s6(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=W3(i,t),"shared"===i.axis[t]){const i="x"===t?"column":"row",o=r[i];for(const r of n.component.axes[t]){const t=i6(r.get("orient"));o[t]??(o[t]=[a6(e,i,!1)]);const n=c3(r,"main",e.config,{header:!0});n&&o[t][0].axes.push(n),r.mainExtracted=!0}}}}function l6(e){for(const t of e.children)t.parseLayoutSize()}function u6(e,t){const n=I3(t),r=XV(n),i=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const o=t.component.layoutSize.getWithExplicit(n),s=i.scale[r]??q3(r,e);if("independent"===s&&"step"===o.value){a=void 0;break}if(a){if("independent"===s&&a.value!==o.value){a=void 0;break}a=v1(a,o,n,"")}else a=o}if(a){for(const r of e.children)e.renameSignal(r.getName(n),e.getName(t)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function c6(e,t){const n="width"===t?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const e=i.get("type"),n=i.get("range");if(RJ(e)){const e=JK(r.view,t);return RY(n)||HK(e)?"step":e}return YK(r.view,t)}if(e.hasProjection||"arc"===e.mark)return YK(r.view,t);{const e=JK(r.view,t);return HK(e)?e.step:e}}function f6(e,t,n){return xQ(t,{suffix:`by_${xQ(e)}`,...n??{}})}class d6 extends U5{constructor(e,t,n,r){super(e,"facet",t,n,r,e.resolve),this.child=B6(e.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!YZ(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=WH(e),n={};for(const r of t){if(![mG,gG].includes(r)){LX(_X(r,"facet"));break}const t=e[r];if(void 0===t.field){LX(wX(t,r));break}n[r]=this.initFacetFieldDef(t,r)}return n}initFacetFieldDef(e,t){const n=NQ(e,t);return n.header?n.header=OY(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=p6(this),this.child.parseData()}parseLayoutSize(){l6(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of aV)o6(e,t);s6(e,"x"),s6(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const t of aV)for(const n of E3){const r=this.component.layoutHeaders[t],i=r[n],{facetFieldDef:o}=r;if(o){const n=$3("titleOrient",o.header,this.config,t);if(["right","bottom"].includes(n)){const r=_3(t,n);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[r]="end"}}if(i?.[0]){const i="row"===t?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===t||this.child.component.layoutSize.get(i)||(e[o]??(e[o]={}),e[o][t]=.5),r.title&&(e.offset??(e.offset={}),e.offset["row"===t?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let r="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(r="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof d6)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof d6?{...this.channelHasField("column")?{encode:{update:{columns:{field:xQ(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof d6){if(this.child.channelHasField("column")){const r=xQ(this.child.facet.column);e.push(r),t.push("distinct"),n.push(`distinct_${r}`)}}else for(const r of HV){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(RJ(o)&&RY(a)){const i=h5(p5(this.child,r));i?(e.push(i),t.push("distinct"),n.push(`distinct_${i}`)):LX(uX(r))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const e of aV){const t=this.facet[e];if(t){s.push(xQ(t));const{bin:l,sort:u}=t;if(EY(l)&&s.push(xQ(t,{binSuffix:"end"})),GZ(u)){const{field:e,op:s=UZ}=u,l=f6(t,u);n&&r?(i.push(l),o.push("max"),a.push(l)):(i.push(e),o.push(s),a.push(l))}else if(Eo(u)){const n=w3(t,e);i.push(n),o.push("max"),a.push(n)}}}const l=!!n&&!!r;return{name:e,data:t,groupby:s,...l||i.length>0?{aggregate:{...l?{cross:l}:{},...i.length?{fields:i,ops:o,as:a}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,n=t[e];return n?GZ(n.sort)?[f6(n,n.sort,{expr:"datum"})]:Eo(n.sort)?[w3(n,e,{expr:"datum"})]:[xQ(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(GZ(e)?e.order:!Eo(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return O3(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const r of C3)if(e[r]){const i=$3("labelOrient",e[r]?.header,t,r);if(n[r].includes(i))return O3(e[r],r,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=r6(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||e.assembleTitle(),i=e.assembleGroupStyle(),o={name:this.getName("cell"),type:"group",...r?{title:r}:{},...i?{style:i}:{},from:{facet:this.assembleFacet()},sort:{field:aV.map((e=>this.facetSortFields(e))).flat(),order:aV.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(F1(this,[]))};return[o]}getMapping(){return this.facet}}function h6(e,t){for(const n of t){const t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const r=e.format?.mesh,i=t.format?.feature;if(r&&i)continue;const o=e.format?.feature;if((o||i)&&o!==i)continue;const a=t.format?.mesh;if(!r&&!a||r===a)if(w1(e)&&w1(t)){if(hG(e.values,t.values))return n}else if(x1(e)&&x1(t)){if(e.url===t.url)return n}else if(_1(e)&&e.name===n.dataName)return n}return null}function p6(e){let t=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new D7({values:[]});return t.push(e),e}const n=h6(e.data,t);if(n)return $1(e.data)||(n.data.format=RH({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new D7(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,o=!(i&&($1(i)||x1(i)||w1(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new b1;$1(i)?(k1(i)?t=new A7(t,i.sequence):E1(i)&&(t=new E7(t,i.graticule)),o.parseNothing=!0):null===i?.format?.parse&&(o.parseNothing=!0),t=k7.makeExplicit(t,e,o)??t,t=new C7(t);const a=e.parent&&B5(e.parent);(L5(e)||P5(e))&&a&&(t=y7.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=function(e,t,n){let r=0;for(const i of t.transforms){let o,a;if(G0(i))a=e=new x3(e,i),o="derived";else if(T0(i)){const r=_7(i);a=e=k7.makeWithAncestors(e,{},r,n)??e,e=new o3(e,t,i.filter)}else if(V0(i))a=e=y7.makeFromTransform(e,i,t),o="number";else if(X0(i))o="date",void 0===n.getWithExplicit(i.field).value&&(e=new k7(e,{[i.field]:o}),n.set(i.field,o,!1)),a=e=P1.makeFromTransform(e,i);else if(J0(i))a=e=b7.makeFromTransform(e,i),o="number",e3(t)&&(e=new C7(e));else if(R0(i))a=e=Q5.make(e,t,i,r++),o="derived";else if(q0(i))a=e=new X7(e,i),o="number";else if(W0(i))a=e=new V7(e,i),o="number";else if(Z0(i))a=e=Y7.makeFromTransform(e,i),o="derived";else if(Q0(i))a=e=new V5(e,i),o="derived";else if(K0(i))a=e=new W5(e,i),o="derived";else if(H0(i))a=e=new G5(e,i),o="derived";else if(L0(i))a=e=new t6(e,i),o="derived";else if(U0(i))e=new n6(e,i);else if(Y0(i))a=e=J5.makeFromTransform(e,i),o="derived";else if(P0(i))a=e=new q5(e,i),o="derived";else if(j0(i))a=e=new K5(e,i),o="derived";else if(B0(i))a=e=new e6(e,i),o="derived";else{if(!I0(i)){LX(gX(i));continue}a=e=new Z5(e,i),o="derived"}if(a&&void 0!==o)for(const e of a.producedFields()??[])n.set(e,o,!1)}return e}(t,e,o));const s=function(e){const t={};if(L5(e)&&e.component.selection)for(const n of WH(e.component.selection)){const r=e.component.selection[n];for(const e of r.project.items)!e.channel&&iG(e.field)>1&&(t[e.field]="flatten")}return t}(e),l=$7(e);t=k7.makeWithAncestors(t,{},{...s,...l},o)??t,L5(e)&&(t=Y5.parseAll(t,e),t=X5.parseAll(t,e)),(L5(e)||P5(e))&&(a||(t=y7.makeFromEncoding(t,e)??t),t=P1.makeFromEncoding(t,e)??t,t=x3.parseAllForSortIndex(t,e));const u=e.getDataName(A1.Raw),c=new z1(t,u,A1.Raw,r);if(n[u]=c,t=c,L5(e)){const n=b7.makeFromEncoding(t,e);n&&(t=n,e3(e)&&(t=new C7(t))),t=J5.makeFromEncoding(t,e)??t,t=Y7.makeFromEncoding(t,e)??t}L5(e)&&(t=H5.make(t,e)??t);const f=e.getDataName(A1.Main),d=new z1(t,f,A1.Main,r);n[f]=d,t=d,L5(e)&&function(e,t){for(const[n,r]of GH(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new z1(new o3(t,e,{param:n}),i,A1.Lookup,e.component.data.outputNodeRefCounts)}}(e,d);let h=null;if(P5(e)){const r=e.getName("facet");t=function(e,t){const{row:n,column:r}=t;if(n&&r){let t=null;for(const i of[n,r])if(GZ(i.sort)){const{field:n,op:r=UZ}=i.sort;e=t=new V7(e,{joinaggregate:[{op:r,field:n,as:f6(i,i.sort,{forAs:!0})}],groupby:[xQ(i)]})}return t}return null}(t,e.facet)??t,h=new x7(t,e,r,d.getSource()),n[r]=h}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:c,main:d,facetRoot:h,ancestorParse:o}}class m6 extends I5{constructor(e,t,n,r){super(e,"concat",t,n,r,e.resolve),"shared"!==e.resolve?.axis?.x&&"shared"!==e.resolve?.axis?.y||LX("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>B6(e,this,this.getName(`concat_${t}`),void 0,r)))}parseData(){this.component.data=p6(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WH(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return UK(e)?e.vconcat:qK(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){l6(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";u6(e,t),u6(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=L3(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...e.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}const g6={disable:1,gridScale:1,scale:1,...WQ,labelExpr:1,encode:1},y6=WH(g6);class v6 extends h1{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new v6(AH(this.explicit),AH(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return zY(this.explicit.orient)}}const b6={bottom:"top",top:"bottom",left:"right",right:"left"};function x6(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let r=0;r{switch(n){case"title":return rX(e,t);case"gridScale":return{explicit:e.explicit,value:oG(e.value,t.value)}}return y1(e,t,n,"axis")}));e.setWithExplicit(n,r)}return e}function _6(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(zY(n.labelAngle)?n.labelAngle:cG(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===b3(r,i))return!0}return e===n[t]}const $6=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function k6(e,t){let n=t.axis(e);const r=new v6,i=MQ(t.encoding[e]),{mark:o,config:a}=t,s=n?.orient||a["x"===e?"axisX":"axisY"]?.orient||a.axis?.orient||function(e){return"x"===e?"bottom":"left"}(e),l=t.getScaleComponent(e).get("type"),u=function(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:OJ(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=zY(n)?"axisOrient":`axis${ZH(n)}`,s=[...i,...i.map((e=>o+e.substr(4)))],l=["axis",a,o];return{vlOnlyAxisConfig:d3(s,r,e,n),vgAxisConfig:d3(l,r,e,n),axisConfigStyle:h3([...l,...s],r)}}(e,l,s,t.config),c=void 0!==n?!n:p3("disable",a.style,n?.style,u).configValue;if(r.set("disable",c,void 0!==n),c)return r;n=n||{};const f=function(e,t,n,r,i){const o=t?.labelAngle;if(void 0!==o)return zY(o)?o:cG(o);{const{configValue:o}=p3("labelAngle",r,t?.style,i);return void 0!==o?cG(o):n!==vG||!NH([$J,wJ],e.type)||aQ(e)&&e.timeUnit?void 0:270}}(i,n,e,a.style,u),d=LZ(n.formatType,i,l),h=RZ(i,i.type,n.format,n.formatType,a,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:s,labelAngle:f,format:h,formatType:d,mark:o,config:a};for(const i of y6){const o=i in m3?m3[i](p):GQ(i)?n[i]:void 0,s=void 0!==o,l=_6(o,i,n,t,e);if(s&&l)r.set(i,o,l);else{const{configValue:e,configFrom:t}=GQ(i)&&"values"!==i?p3(i,a.style,n.style,u):{},c=void 0!==e;s&&!c?r.set(i,o,l):("vgAxisConfig"!==t||$6.has(i)&&c||IQ(e)||zY(e))&&r.set(i,e,!1)}}const m=n.encoding??{},g=UQ.reduce(((n,i)=>{if(!r.hasAxisPart(i))return n;const o=U3(m[i]??{},t),a="labels"===i?function(e,t,n){const{encoding:r,config:i}=e,o=MQ(r[t])??MQ(r[_V(t)]),a=e.axis(t)||{},{format:s,formatType:l}=a;if(MZ(l))return{text:zZ({fieldOrDatumDef:o,field:"datum.value",format:s,formatType:l,config:i}),...n};if(void 0===s&&void 0===l&&i.customFormatTypes){if("quantitative"===sQ(o)){if(gQ(o)&&"normalize"===o.stack&&i.normalizedNumberFormatType)return{text:zZ({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:zZ({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if("temporal"===sQ(o)&&i.timeFormatType&&aQ(o)&&!o.timeUnit)return{text:zZ({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}(t,e,o):o;return void 0===a||qH(a)||(n[i]={update:a}),n}),{});return qH(g)||r.set("encode",g,!!n.encoding||void 0!==n.labelAngle),r}function C6(e,t){const{config:n}=e;return{...D2(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...m2("x",e,{defaultPos:"mid"}),...m2("y",e,{defaultPos:"mid"}),...f2("size",e),...f2("angle",e),...E6(e,n,t)}}function E6(e,t,n){return n?{shape:{value:n}}:f2("shape",e)}const A6={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...D2(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...x2("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...x2("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...f2("size",e,{vgChannel:"strokeWidth"})}:{}}},D6={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...D2(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...m2("x",e,{defaultPos:"mid"}),...m2("y",e,{defaultPos:"mid"}),...r2(e),...f2("size",e,{vgChannel:"fontSize"}),...f2("angle",e),...O2("align",S6(e.markDef,n,t)),...O2("baseline",M6(e.markDef,n,t)),...m2("radius",e,{defaultPos:null}),...m2("theta",e,{defaultPos:null})}}};function S6(e,t,n){if(void 0===JY("align",e,n))return"center"}function M6(e,t,n){if(void 0===JY("baseline",e,n))return"middle"}const F6={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return{...D2(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...m2("x",e,{defaultPos:"mid",vgChannel:"xc"}),...m2("y",e,{defaultPos:"mid",vgChannel:"yc"}),...f2("size",e,{defaultValue:O6(e),vgChannel:i}),[o]:WY(JY("thickness",n,t))}}};function O6(e){const{config:t,markDef:n}=e,{orient:r}=n,i="horizontal"===r?"width":"height",o=e.getScaleComponent("horizontal"===r?"x":"y"),a=JY("size",n,t,{vgChannel:i})??t.tick.bandSize;if(void 0!==a)return a;{const e=o?o.get("range"):void 0;if(e&&RY(e)&&wa(e.step))return 3*e.step/4;return 3*XK(t.view,i)/4}}const N6={arc:{vgMark:"arc",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...m2("x",e,{defaultPos:"mid"}),...m2("y",e,{defaultPos:"mid"}),...$2(e,"radius"),...$2(e,"theta")})},area:{vgMark:"area",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...x2("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...x2("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...F2(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$2(e,"x"),...$2(e,"y")})},circle:{vgMark:"symbol",encodeEntry:e=>C6(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&aQ(n)&&n.type===kJ?{field:xQ(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...$2(e,"x"),...$2(e,"y"),...r2(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...m2("x",e,{defaultPos:"mid"}),...m2("y",e,{defaultPos:"mid"}),...f2("size",e,{vgChannel:"strokeWidth"}),...F2(e)})},point:{vgMark:"symbol",encodeEntry:e=>C6(e)},rect:{vgMark:"rect",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$2(e,"x"),...$2(e,"y")})},rule:A6,square:{vgMark:"symbol",encodeEntry:e=>C6(e,"square")},text:D6,tick:F6,trail:{vgMark:"trail",encodeEntry:e=>({...D2(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...m2("x",e,{defaultPos:"mid"}),...m2("y",e,{defaultPos:"mid"}),...f2("size",e),...F2(e)})}};function T6(e){if(NH([nZ,KJ,lZ],e.mark)){const t=iK(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:z6+e.requestDataName(A1.Main),data:e.requestDataName(A1.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:L6(e,{fromPrefix:z6})}]}(e,t)}else if(e.mark===eZ){const t=BY.some((t=>JY(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=L6(e,{fromPrefix:R6}),n=e.scaleName(e.stack.fieldChannel),r=(t={})=>e.vgField(e.stack.fieldChannel,t),i=(e,t)=>`${e}(${[r({prefix:"min",suffix:"start",expr:t}),r({prefix:"max",suffix:"start",expr:t}),r({prefix:"min",suffix:"end",expr:t}),r({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o={...SH(t.encode.update,["y","yc","y2","height",...BY]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...MH(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...SH(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...MH(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const n of BY){const r=ZY(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):r&&(o[n]=WY(r)),r&&(t.encode.update[n]={value:0})}const s=[];if(e.stack.groupbyChannels?.length>0)for(const t of e.stack.groupbyChannels){const n=e.fieldDef(t),r=xQ(n);r&&s.push(r),(n?.bin||n?.timeUnit)&&s.push(xQ(n,{binSuffix:"end"}))}o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(t.encode.update[r])return{...n,[r]:t.encode.update[r]};{const t=ZY(r,e.markDef,e.config);return void 0!==t?{...n,[r]:WY(t)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(A1.Main),name:R6+e.requestDataName(A1.Main),groupby:s,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return L6(e)}const z6="faceted_path_";const R6="stack_group_";function L6(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,a=oG(r.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!(!t?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=XY(r),l=i.key,u=function(e){const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!Eo(a)&&pQ(a)&&OH(a.value)||!a&&OH(JY("order",i,o)))){if((Eo(a)||aQ(a))&&!n)return eX(a,{expr:"datum"});if(dZ(r)){const n="horizontal"===i.orient?"y":"x",r=t[n];if(aQ(r)){const t=r.sort;return Eo(t)?{field:xQ(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:GZ(t)?{field:xQ({aggregate:KQ(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:HZ(t)?{field:xQ(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:xQ(r,{binSuffix:e.stack?.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=WH(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=WH(r.component.selection).length,r=r.parent;return n?{interactive:t>0||"geoshape"===e.mark||!!e.encoding.tooltip}:null}(e),f=JY("aria",r,o),d=N6[n].postEncodingTransform?N6[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:N6[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...!1===f?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(A1.Main)},encode:{update:N6[n].encodeEntry(e)},...d?{transform:d}:{}}]}class P6 extends U5{constructor(e,t,n,r={},i){super(e,"unit",t,n,i,void 0,GK(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=mZ(e.mark)?{...e.mark}:{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const r=ZY("filled",e,t),i=e.type;return oG(r,i!==rZ&&i!==nZ&&i!==oZ)}(o,i,{graticule:e.data&&E1(e.data)}));const s=this.encoding=function(e,t,n,r){const i={};for(const t of WH(e))yV(t)||LX(`${o=t}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let o of AV){if(!e[o])continue;const a=e[o];if(ZV(o)){const e=EV(o),t=i[e];if(aQ(t)&&vJ(t.type)&&aQ(a)&&!t.timeUnit){LX(vX(e));continue}}if("angle"!==o||"arc"!==t||e.theta||(LX("Arc marks uses theta channel rather than angle, replacing angle with theta."),o=EG),tK(e,o,t)){if(o===RG&&"line"===t){const t=SQ(e[o]);if(t?.aggregate){LX("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(o===OG&&(n?"fill"in e:"stroke"in e))LX(xX("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(o===HG||o===WG&&!Eo(a)&&!pQ(a)||o===VG&&Eo(a)){if(a){if(o===WG){const t=e[o];if(nQ(t)){i[o]=t;continue}}i[o]=Zo(a).reduce(((e,t)=>(aQ(t)?e.push(NQ(t,o)):LX(wX(t,o)),e)),[])}}else{if(o===VG&&null===a)i[o]=null;else if(!(aQ(a)||lQ(a)||pQ(a)||rQ(a)||zY(a))){LX(wX(a,o));continue}i[o]=FQ(a,o,r)}}else LX(_X(o,t))}return i}(e.encoding||{},a,o.filled,i);this.markDef=v0(o,s,i),this.size=function({encoding:e,size:t}){for(const n of HV){const r=$V(n);HK(t[r])&&uQ(e[n])&&(delete t[r],LX(MX(r)))}return t}({encoding:s,size:GK(e)?{...r,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:r}),this.stack=y0(this.markDef,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter((e=>jK(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===fZ,n=e&&nV.some((t=>dQ(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return uY.reduce(((e,n)=>{const r=MQ(t[n]);return r&&(e[n]=this.initScale(r.scale??{})),e}),{})}initScale(e){const{domain:t,range:n}=e,r=OY(e);return Eo(t)&&(r.domain=t.map(UY)),Eo(n)&&(r.range=n.map(UY)),r}initAxes(e){return HV.reduce(((t,n)=>{const r=e[n];if(dQ(r)||n===vG&&dQ(e.x2)||n===bG&&dQ(e.y2)){const e=dQ(r)?r.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=WH(e),n={};for(const r of t){const t=e[r];n[r]=IQ(t)?IY(t):UY(t)}return n}initLegends(e){return sY.reduce(((t,n)=>{const r=MQ(e[n]);if(r&&function(e){switch(e){case OG:case NG:case TG:case RG:case zG:case PG:case IG:case UG:return!0;case jG:case BG:case LG:return!1}}(n)){const e=r.legend;t[n]=e?OY(e):e}return t}),{})}parseData(){this.component.data=p6(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const r of HV){const i=$V(r);if(t[i]){const e=t[i];n.layoutSize.set(i,HK(e)?"step":e,!0)}else{const t=c6(e,i);n.layoutSize.set(i,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;for(const i of t){const t=YH(i.name),o=i.select,a=$a(o)?o:o.type,s=Ao(o)?AH(o):{type:a},l=r[a];for(const e in l)"fields"!==e&&"encodings"!==e&&("mark"===e&&(s[e]={...l[e],...s[e]}),void 0!==s[e]&&!0!==s[e]||(s[e]=AH(l[e]??s[e])));const u=n[t]={...s,name:t,type:a,init:i.value,bind:i.bind,events:$a(s.on)?WB(s.on,"scope"):Zo(AH(s.on))},c=AH(i);for(const t of Q2)t.defined(u)&&t.parse&&t.parse(e,u,c)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=T6(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,HV.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[k6(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;for(const r of HH(e.component.selection??{})){const i=r.name,o=Fa(i+Y2);if(0===t.filter((e=>e.name===i)).length){const e="global"===r.resolve?"union":r.resolve,n="point"===r.type?", true, true)":")";t.push({name:r.name,update:`${Z2}(${o}, ${Fa(e)}${n}`})}n=!0;for(const n of Q2)n.defined(r)&&n.topLevelSignals&&(t=n.topLevelSignals(e,r,t))}n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]});return N1(t)}(this,e)}assembleSignals(){return[...f3(this),...M1(this,[])]}assembleSelectionData(e){return function(e,t){const n=[...t],r=K2(e,{escape:!1});for(const t of HH(e.component.selection??{})){const e={name:t.name+Y2};if(t.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:zK}}]),t.init){const n=t.project.items.map(D1);e.values=t.project.hasSelectionId?t.init.map((e=>({unit:r,[zK]:S1(e,!1)[0]}))):t.init.map((e=>({unit:r,fields:n,values:S1(e,!1)})))}n.filter((e=>e.name===t.name+Y2)).length||n.push(e)}return n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return L3(this)}assembleMarks(){let e=this.component.mark??[];return this.parent&&B5(this.parent)||(e=O1(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return void 0!==e?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return JQ(this.encoding,e)}fieldDef(e){return SQ(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return hQ(t)?t:null}}class j6 extends I5{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o={...r,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if(c0(e))return new j6(e,this,this.getName(`layer_${t}`),o,i);if(YQ(e))return new P6(e,this,this.getName(`layer_${t}`),o,i);throw new Error(iX(e))}))}parseData(){this.component.data=p6(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;l6(e=this),u6(e,"width"),u6(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of WH(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const i of WH(r.component.axes))n.axis[i]=W3(e.component.resolve,i),"shared"===n.axis[i]&&(t[i]=x6(t[i],r.component.axes[i]),t[i]||(n.axis[i]="independent",delete t[i]))}for(const i of HV){for(const o of e.children)if(o.component.axes[i]){if("independent"===n.axis[i]){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const e of o.component.axes[i]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!zY(t)){if(r[t]>0&&!n){const n=b6[t];r[t]>r[n]&&e.set("orient",n,!1)}r[t]++}}}delete o.component.axes[i]}if("independent"===n.axis[i]&&t[i]&&t[i].length>1)for(const[e,n]of(t[i]||[]).entries())e>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),f3(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),L3(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleGroupStyle(){const e=new Set;for(const t of this.children)for(const n of Zo(t.assembleGroupStyle()))e.add(n);const t=Array.from(e);return t.length>1?t:1===t.length?t[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)L5(n)&&(t=O1(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),s7(this))}}function B6(e,t,n,r,i){if(JZ(e))return new d6(e,t,n,i);if(c0(e))return new j6(e,t,n,r,i);if(YQ(e))return new P6(e,t,n,r,i);if(function(e){return UK(e)||qK(e)||IK(e)}(e))return new m6(e,t,n,i);throw new Error(iX(e))}const I6=wH;var U6=Object.freeze({__proto__:null,version:I6,compile:function(e,t={}){var n;t.logger&&(n=t.logger,RX=n),t.fieldTitle&&kQ(t.fieldTitle);try{const n=i0(So(t.config,e.config)),r=a1(e,n),i=B6(r,null,"",void 0,n);i.parse(),function(e,t){e5(e.sources);let n=0,r=0;for(let r=0;r"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...s?{title:s}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...BK(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}(i,function(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===t?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):$a(t)&&(t={type:t});if(i&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)LX(lX()),t.type="pad";else if("step"===i||"step"===o){const e="step"===i?"width":"height";LX(lX(XV(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${XV(e)}`:"fit"}(n)}var a;return{...1===WH(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...d1(n,!1),...d1(e,!0)}}(e,r.autosize,n,i),e.datasets,e.usermeta);return{spec:o,normalized:r}}finally{t.logger&&(RX=zX),t.fieldTitle&&kQ(_Q)}},normalize:a1,duplicate:AH,never:DH,pick:SH,omit:MH,hash:FH,isNullOrFalse:OH,contains:NH,some:TH,every:zH,mergeDeep:RH,unique:PH,isEqual:function(e,t){const n=WH(e),r=WH(t);if(n.length!==r.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0},setEqual:jH,hasIntersection:BH,prefixGenerator:IH,fieldIntersection:UH,isEmpty:qH,keys:WH,vals:HH,entries:GH,isBoolean:VH,varName:YH,logicalExpr:XH,deleteNestedProperty:JH,titleCase:ZH,accessPathWithDatum:QH,flatAccessWithDatum:KH,replacePathInField:tG,replaceAll:nG,removePathFromField:rG,accessPathDepth:iG,getFirstDefined:oG,uniqueId:sG,resetIdCounter:function(){aG=42},internalField:lG,isInternalField:uG,normalizeAngle:cG,isNumeric:fG,deepEqual:hG,stringify:pG});function q6(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var W6="2.14.0";const H6="#fff",G6="#888",V6={background:"#333",view:{stroke:G6},title:{color:H6,subtitleColor:H6},style:{"guide-label":{fill:H6},"guide-title":{fill:H6}},axis:{domainColor:H6,gridColor:G6,tickColor:H6}},Y6="#4572a7",X6={background:"#fff",arc:{fill:Y6},area:{fill:Y6},line:{stroke:Y6,strokeWidth:2},path:{stroke:Y6},rect:{fill:Y6},shape:{stroke:Y6},symbol:{fill:Y6,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},J6="#30a2da",Z6="#cbcbcb",Q6="#f0f0f0",K6="#333",e4={arc:{fill:J6},area:{fill:J6},axis:{domainColor:Z6,grid:!0,gridColor:Z6,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Z6,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Q6,group:{fill:Q6},legend:{labelColor:K6,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:K6,titleFontSize:14,titlePadding:10},line:{stroke:J6,strokeWidth:2},path:{stroke:J6,strokeWidth:.5},rect:{fill:J6},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:J6},bar:{binSpacing:2,fill:J6,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},t4="#000",n4={group:{fill:"#e5e5e5"},arc:{fill:t4},area:{fill:t4},line:{stroke:t4},path:{stroke:t4},rect:{fill:t4},shape:{stroke:t4},symbol:{fill:t4,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},r4="Benton Gothic, sans-serif",i4="#82c6df",o4="Benton Gothic Bold, sans-serif",a4="normal",s4={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},l4={background:"#ffffff",title:{anchor:"start",color:"#000000",font:o4,fontSize:22,fontWeight:"normal"},arc:{fill:i4},area:{fill:i4},line:{stroke:i4,strokeWidth:2},path:{stroke:i4},rect:{fill:i4},shape:{stroke:i4},symbol:{fill:i4,size:30},axis:{labelFont:r4,labelFontSize:11.5,labelFontWeight:"normal",titleFont:o4,titleFontSize:13,titleFontWeight:a4},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:r4,labelFontSize:11.5,symbolType:"square",titleFont:o4,titleFontSize:13,titleFontWeight:a4},range:{category:s4["category-6"],diverging:s4["fireandice-6"],heatmap:s4["fire-7"],ordinal:s4["fire-7"],ramp:s4["fire-7"]}},u4="#ab5787",c4="#979797",f4={background:"#f9f9f9",arc:{fill:u4},area:{fill:u4},line:{stroke:u4},path:{stroke:u4},rect:{fill:u4},shape:{stroke:u4},symbol:{fill:u4,size:30},axis:{domainColor:c4,domainWidth:.5,gridWidth:.2,labelColor:c4,tickColor:c4,tickWidth:.2,titleColor:c4},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},d4="#3e5c69",h4={background:"#fff",arc:{fill:d4},area:{fill:d4},line:{stroke:d4},path:{stroke:d4},rect:{fill:d4},shape:{stroke:d4},symbol:{fill:d4},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},p4="#1696d2",m4="#000000",g4="Lato",y4="Lato",v4={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},b4={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:g4},axisX:{domain:!0,domainColor:m4,domainWidth:1,grid:!1,labelFontSize:12,labelFont:y4,labelAngle:0,tickColor:m4,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:g4},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:y4,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:g4,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:y4,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:g4,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:v4["six-groups-cat-1"],diverging:v4["diverging-colors"],heatmap:v4["diverging-colors"],ordinal:v4["six-groups-seq"],ramp:v4["shades-blue"]},area:{fill:p4},rect:{fill:p4},line:{color:p4,stroke:p4,strokeWidth:5},trail:{color:p4,stroke:p4,strokeWidth:0,size:1},path:{stroke:p4,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:p4,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:p4,stroke:null}},arc:{fill:p4},shape:{stroke:p4},symbol:{fill:p4,size:30}},x4="#3366CC",w4="#ccc",_4="Arial, sans-serif",$4={arc:{fill:x4},area:{fill:x4},path:{stroke:x4},rect:{fill:x4},shape:{stroke:x4},symbol:{stroke:x4},circle:{fill:x4},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:_4,fontSize:12},"guide-title":{font:_4,fontSize:12},"group-title":{font:_4,fontSize:12}},title:{font:_4,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:w4,tickColor:w4,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},k4=e=>e*(1/3+1),C4=k4(9),E4=k4(10),A4=k4(12),D4="Segoe UI",S4="wf_standard-font, helvetica, arial, sans-serif",M4="#252423",F4="#605E5C",O4="transparent",N4="#118DFF",T4="#DEEFFF",z4=[T4,N4],R4={view:{stroke:O4},background:O4,font:D4,header:{titleFont:S4,titleFontSize:A4,titleColor:M4,labelFont:D4,labelFontSize:E4,labelColor:F4},axis:{ticks:!1,grid:!1,domain:!1,labelColor:F4,labelFontSize:C4,titleFont:S4,titleColor:M4,titleFontSize:A4,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:N4},line:{stroke:N4,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:D4,fontSize:C4,fill:F4},arc:{fill:N4},area:{fill:N4,line:!0,opacity:.6},path:{stroke:N4},rect:{fill:N4},point:{fill:N4,filled:!0,size:75},shape:{stroke:N4},symbol:{fill:N4,strokeWidth:1.5,size:50},legend:{titleFont:D4,titleFontWeight:"bold",titleColor:F4,labelFont:D4,labelFontSize:E4,labelColor:F4,symbolType:"circle",symbolSize:75},range:{category:[N4,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:z4,heatmap:z4,ordinal:[T4,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",N4]}},L4='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',P4=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],j4=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function B4({type:e,background:t}){const n="dark"===e?"#161616":"#ffffff",r="dark"===e?"#f4f4f4":"#161616",i="dark"===e?"#d4bbff":"#6929c4";return{background:t,arc:{fill:i},area:{fill:i},path:{stroke:i},rect:{fill:i},shape:{stroke:i},symbol:{stroke:i},circle:{fill:i},view:{fill:n,stroke:n},group:{fill:n},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:L4,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:L4,fill:r,fontWeight:400},"guide-title":{font:L4,fill:r,fontWeight:400}},range:{category:"dark"===e?P4:j4,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const I4=B4({type:"light",background:"#ffffff"}),U4=B4({type:"light",background:"#f4f4f4"}),q4=B4({type:"dark",background:"#262626"}),W4=B4({type:"dark",background:"#161616"}),H4=W6;var G4=Object.freeze({__proto__:null,carbong10:U4,carbong100:W4,carbong90:q4,carbonwhite:I4,dark:V6,excel:X6,fivethirtyeight:e4,ggplot2:n4,googlecharts:$4,latimes:l4,powerbi:R4,quartz:f4,urbaninstitute:b4,version:H4,vox:h4});function V4(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,r){if("object"!=typeof r||null===r)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}(t))}var Y4="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n";const X4="vg-tooltip-element",J4={offsetX:10,offsetY:10,id:X4,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&").replace(/t($a(e)?e:V4(e,n)))).join(", ")}]`;if(Ao(e)){let r="";const{title:i,image:o,...a}=e;i&&(r+=`

    ${t(i)}

    `),o&&(r+=``);const s=Object.keys(a);if(s.length>0){r+="";for(const e of s){let i=a[e];void 0!==i&&(Ao(i)&&(i=V4(i,n)),r+=``)}r+="
    ${t(e)}${t(i)}
    "}return r||"{}"}return t(e)}};class Z4{constructor(e){this.options={...J4,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Y4.toString().replace(X4,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,r){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${i}px`}}function Q4(e){return Q4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q4(e)}function K4(e){var t=function(e,t){if("object"!==Q4(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Q4(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Q4(t)?t:String(t)}function e8(e,t,n){return(t=K4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n8,r8;var i8=o8;function o8(e){var t=this;if(t instanceof o8||(t=new o8),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},o8.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},o8.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o8.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o8.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o8;if(tthis.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&r>t;r--)i=i.prev;for(;null!==i&&r>e;r--,i=i.prev)n.push(i.value);return n},o8.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;null!==i&&r1;const _8=(e,t,n)=>{const r=e[b8].get(t);if(r){const t=r.value;if($8(e,t)){if(C8(e,r),!e[p8])return}else n&&(e[x8]&&(r.value.now=Date.now()),e[v8].unshiftNode(r));return t.value}},$8=(e,t)=>{if(!t||!t.maxAge&&!e[m8])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[m8]&&n>e[m8]},k8=e=>{if(e[d8]>e[f8])for(let t=e[v8].tail;e[d8]>e[f8]&&null!==t;){const n=t.prev;C8(e,t),t=n}},C8=(e,t)=>{if(t){const n=t.value;e[g8]&&e[g8](n.key,n.value),e[d8]-=n.length,e[b8].delete(n.key),e[v8].removeNode(t)}};class E8{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const A8=(e,t,n,r)=>{let i=n.value;$8(e,i)&&(C8(e,n),e[p8]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var D8=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[f8]=e.max||1/0;const t=e.length||w8;if(this[h8]="function"!=typeof t?w8:t,this[p8]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[m8]=e.maxAge||0,this[g8]=e.dispose,this[y8]=e.noDisposeOnSet||!1,this[x8]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[f8]=e||1/0,k8(this)}get max(){return this[f8]}set allowStale(e){this[p8]=!!e}get allowStale(){return this[p8]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[m8]=e,k8(this)}get maxAge(){return this[m8]}set lengthCalculator(e){"function"!=typeof e&&(e=w8),e!==this[h8]&&(this[h8]=e,this[d8]=0,this[v8].forEach((e=>{e.length=this[h8](e.value,e.key),this[d8]+=e.length}))),k8(this)}get lengthCalculator(){return this[h8]}get length(){return this[d8]}get itemCount(){return this[v8].length}rforEach(e,t){t=t||this;for(let n=this[v8].tail;null!==n;){const r=n.prev;A8(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[v8].head;null!==n;){const r=n.next;A8(this,e,n,t),n=r}}keys(){return this[v8].toArray().map((e=>e.key))}values(){return this[v8].toArray().map((e=>e.value))}reset(){this[g8]&&this[v8]&&this[v8].length&&this[v8].forEach((e=>this[g8](e.key,e.value))),this[b8]=new Map,this[v8]=new c8,this[d8]=0}dump(){return this[v8].map((e=>!$8(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[v8]}set(e,t,n){if((n=n||this[m8])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[h8](t,e);if(this[b8].has(e)){if(i>this[f8])return C8(this,this[b8].get(e)),!1;const o=this[b8].get(e).value;return this[g8]&&(this[y8]||this[g8](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[d8]+=i-o.length,o.length=i,this.get(e),k8(this),!0}const o=new E8(e,t,i,r,n);return o.length>this[f8]?(this[g8]&&this[g8](e,t),!1):(this[d8]+=o.length,this[v8].unshift(o),this[b8].set(e,this[v8].head),k8(this),!0)}has(e){if(!this[b8].has(e))return!1;const t=this[b8].get(e).value;return!$8(this,t)}get(e){return _8(this,e,!0)}peek(e){return _8(this,e,!1)}pop(){const e=this[v8].tail;return e?(C8(this,e),e.value):null}del(e){C8(this,this[b8].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[b8].forEach(((e,t)=>_8(this,t,!1)))}};const S8=Object.freeze({loose:!0}),M8=Object.freeze({});var F8=e=>e?"object"!=typeof e?S8:e:M8,O8={exports:{}};var N8={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var T8="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=N8,o=T8,a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=c++;o(e,i,t),u[e]=i,l[i]=t,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),h("FULL",`^${l[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),h("LOOSE",`^${l[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),h("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),h("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),h("COERCERTL",l[u.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(O8,O8.exports);var z8=O8.exports;const R8=/^[0-9]+$/,L8=(e,t)=>{const n=R8.test(e),r=R8.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:eL8(t,e)};const j8=T8,{MAX_LENGTH:B8,MAX_SAFE_INTEGER:I8}=N8,{safeRe:U8,t:q8}=z8,W8=F8,{compareIdentifiers:H8}=P8;var G8=class e{constructor(t,n){if(n=W8(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>B8)throw new TypeError(`version is longer than ${B8} characters`);j8("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?U8[q8.LOOSE]:U8[q8.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>I8||this.major<0)throw new TypeError("Invalid major version");if(this.minor>I8||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>I8||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===H8(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const V8=G8;var Y8=(e,t,n)=>new V8(e,n).compare(new V8(t,n));const X8=Y8;var J8=(e,t,n)=>0===X8(e,t,n);const Z8=Y8;var Q8=(e,t,n)=>0!==Z8(e,t,n);const K8=Y8;var e9=(e,t,n)=>K8(e,t,n)>0;const t9=Y8;var n9=(e,t,n)=>t9(e,t,n)>=0;const r9=Y8;var i9=(e,t,n)=>r9(e,t,n)<0;const o9=Y8;var a9=(e,t,n)=>o9(e,t,n)<=0;const s9=J8,l9=Q8,u9=e9,c9=n9,f9=i9,d9=a9;var h9,p9,m9,g9,y9=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return s9(e,n,r);case"!=":return l9(e,n,r);case">":return u9(e,n,r);case">=":return c9(e,n,r);case"<":return f9(e,n,r);case"<=":return d9(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};function v9(){if(g9)return m9;g9=1;class e{constructor(t,i){if(i=n(i),t instanceof e)return t.loose===!!i.loose&&t.includePrerelease===!!i.includePrerelease?t:new e(t.raw,i);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,o=t.get(n);if(o)return o;const p=this.options.loose,m=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(m,E(this.options.includePrerelease)),i("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],l),i("comparator trim",e),e=e.replace(a[s.TILDETRIM],u),i("tilde trim",e),e=e.replace(a[s.CARETTRIM],c),i("caret trim",e);let y=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));p&&(y=y.filter((e=>(i("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),i("range list",y);const v=new Map,b=y.map((e=>new r(e,this.options)));for(const e of b){if(h(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return t.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>m(e,n)&&t.set.some((t=>m(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new o(e,this.options)}catch(e){return!1}for(let t=0;t")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}h9=t;const n=F8,{safeRe:r,t:i}=z8,o=y9,a=T8,s=G8,l=v9();return h9}(),i=T8,o=G8,{safeRe:a,t:s,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:c}=z8,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=N8,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(i("comp",e,t),e=x(e,t),i("caret",e),e=v(e,t),i("tildes",e),e=_(e,t),i("xrange",e),e=k(e,t),i("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,r,o,a)=>{let s;return i("tilde",e,t,n,r,o,a),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(i("replaceTilde pr",a),s=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,i("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{i("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let l;return i("caret",e,t,n,o,a,s),y(n)?l="":y(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:s?(i("replaceCaret pr",s),l="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(i("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),i("caret return",l),l}))},_=(e,t)=>(i("replaceXRanges",e,t),e.split(/\s+/).map((e=>$(e,t))).join(" ")),$=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,r,o,a,s,l)=>{i("xRange",e,n,r,o,a,s,l);const u=y(o),c=u||y(a),f=c||y(s),d=f;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(a=0),s=0,">"===r?(r=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?o=+o+1:a=+a+1),"<"===r&&(l="-0"),n=`${r+o}.${a}.${s}${l}`):c?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${l} <${o}.${+a+1}.0-0`),i("xRange return",n),n}))},k=(e,t)=>(i("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),C=(e,t)=>(i("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),E=e=>(t,n,r,i,o,a,s,l,u,c,f,d,h)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=y(u)?"":y(c)?`<${+u+1}.0.0-0`:y(f)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${f}-${d}`:e?`<${u}.${c}.${+f+1}-0`:`<=${l}`}`.trim(),A=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return m9}const b9=v9();var x9=(e,t,n)=>{try{t=new b9(t,n)}catch(e){return!1}return t.test(e)},w9=t8(x9);var _9='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function $9(e,...t){for(const n of t)k9(e,n);return e}function k9(e,t){for(const n of Object.keys(t))Mo(e,n,t[n],!0)}function C9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E9(e){for(var t=1;te,"vega-lite":(e,t)=>D9.compile(e,{config:t}).spec},z9='\n\n \n \n \n',R9="chart-wrapper";function L9(e,t,n,r){const i=`${t}
    `,o=`
    ${n}`,a=window.open("");a.document.write(i+e+o),a.document.title=`${O9[r]} JSON Source`}function P9(e){return(t=e)&&"load"in t?e:A9.loader(e);var t}async function j9(e,t,n={}){let r,i;$a(t)?(i=P9(n.loader),r=JSON.parse(await i.load(t))):r=t;const o=function(e){const t=e.usermeta?.embedOptions??{};return $a(t.defaultStyle)&&(t.defaultStyle=!1),t}(r),a=o.loader;i&&!a||(i=P9(n.loader??a));const s=await B9(o,i),l=await B9(n,i),u=E9(E9({},$9(l,s)),{},{config:So(l.config??{},s.config??{})});return await async function(e,t,n={},r){const i=n.theme?So(G4[n.theme],n.config??{}):n.config,o=va(n.actions)?n.actions:$9({},M9,n.actions??{}),a=E9(E9({},F9),n.i18n),s=n.renderer??"canvas",l=n.logLevel??A9.Warn,u=n.downloadFileName??"visualization",c="string"==typeof e?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:r}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(c);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?_9.toString():n.defaultStyle,r.appendChild(t)}}const f=function(e,t){if(e.$schema){const n=q6(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${O9[n.library]}, but mode argument sets ${O9[t]??t}.`);const r=n.library;return w9(N9[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${O9[r]} ${n.version}, but the current version of ${O9[r]} is v${N9[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(t,n.mode);let d=T9[f](t,i);if("vega-lite"===f&&d.$schema){const e=q6(d.$schema);w9(N9.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${N9.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions");c.innerHTML="";let h=c;if(o){const e=document.createElement("div");e.classList.add(R9),c.appendChild(e),h=e}const p=n.patch;p&&(d=p instanceof Function?p(d):Wi(d,p,!0,!1).newDocument);n.formatLocale&&A9.formatLocale(n.formatLocale);n.timeFormatLocale&&A9.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const e in n.expressionFunctions){const t=n.expressionFunctions[e];"fn"in t?A9.expressionFunction(e,t.fn,t.visitor):t instanceof Function&&A9.expressionFunction(e,t)}const{ast:m}=n,g=A9.parse(d,"vega-lite"===f?{}:i,{ast:m}),y=new(n.viewClass||A9.View)(g,E9({loader:r,logLevel:l,renderer:s},m?{expr:A9.expressionInterpreter??n.expr??xH}:{}));if(y.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(h.classList.add("fit-x"),h.classList.remove("fit-y")):"fit-y"==n?(h.classList.remove("fit-x"),h.classList.add("fit-y")):"fit"==n?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const e=function(e){return"function"==typeof e}(n.tooltip)?n.tooltip:new Z4(!0===n.tooltip?{}:n.tooltip).call;y.tooltip(e)}let v,{hover:b}=n;void 0===b&&(b="vega"===f);if(b){const{hoverSet:e,updateSet:t}="boolean"==typeof b?{}:b;y.hover(e,t)}n&&(null!=n.width&&y.width(n.width),null!=n.height&&y.height(n.height),null!=n.padding&&y.padding(n.padding));if(await y.initialize(h,n.bind).runAsync(),!1!==o){let e=c;if(!1!==n.defaultStyle||n.forceActionsMenu){const t=document.createElement("details");t.title=a.CLICK_TO_VIEW_ACTIONS,c.append(t),e=t;const n=document.createElement("summary");n.innerHTML=z9,t.append(n),v=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",v)}const r=document.createElement("div");if(e.append(r),r.classList.add("vega-actions"),!0===o||!1!==o.export)for(const e of["svg","png"])if(!0===o||!0===o.export||o.export[e]){const t=a[`${e.toUpperCase()}_ACTION`],i=document.createElement("a"),o=Ao(n.scaleFactor)?n.scaleFactor[e]:n.scaleFactor;i.text=t,i.href="#",i.target="_blank",i.download=`${u}.${e}`,i.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await y.toImageURL(e,o);this.href=n})),r.append(i)}if(!0===o||!1!==o.source){const e=document.createElement("a");e.text=a.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){L9(no(t),n.sourceHeader??"",n.sourceFooter??"",f),e.preventDefault()})),r.append(e)}if("vega-lite"===f&&(!0===o||!1!==o.compiled)){const e=document.createElement("a");e.text=a.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){L9(no(d),n.sourceHeader??"",n.sourceFooter??"","vega"),e.preventDefault()})),r.append(e)}if(!0===o||!1!==o.editor){const e=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=a.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(e,t,n){const r=e.open(t),{origin:i}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===r&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(r.postMessage(n,i),setTimeout(e,250),o-=1)}),250)}(window,e,{config:i,mode:f,renderer:s,spec:no(t)}),n.preventDefault()})),r.append(o)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}(e,r,u,i)}async function B9(e,t){const n=$a(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=$a(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return E9(E9(E9({},e),r?{patch:r}:{}),n?{config:n}:{})}const I9=new Set(["width","height"]);var U9=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n};function q9(e={},t={},n=new Set){const r=Object.keys(e),i=Object.keys(t);return e===t||r.length===i.length&&r.filter((e=>!n.has(e))).every((n=>e[n]===t[n]))}function W9(e,t){const n=Object.keys(t);for(const r of n)try{e.removeSignalListener(r,t[r])}catch(e){console.warn("Cannot remove invalid signal listener.",e)}return n.length>0}function H9(e,t){const n=Object.keys(t);for(const r of n)try{e.addSignalListener(r,t[r])}catch(e){console.warn("Cannot add invalid signal listener.",e)}return n.length>0}function G9(e,t){const{width:n,height:r}=t;return void 0!==n&&void 0!==r?{...e,width:n,height:r}:void 0!==n?{...e,width:n}:void 0!==r?{...e,height:r}:e}function V9(t){let n;return{c(){n=_("div")},m(e,r){b(e,n,r),t[11](n)},p:e,i:e,o:e,d(e){e&&x(n),t[11](null)}}}function Y9(e,t,n){let{options:r}=t,{spec:i}=t,{view:o}=t,{signalListeners:a={}}=t,{data:s={}}=t;const l=B();let u,c,f={},d={},h={},p={};async function m(){g();try{n(6,u=await j9(c,i,r)),n(1,o=u.view),H9(o,a)&&o.runAsync(),e=o,y(),l("onNewView",{view:e})}catch(e){!function(e){l("onError",{error:e}),console.warn(e)}(e)}var e}function g(){u&&(u.finalize(),n(6,u=void 0),n(1,o=void 0))}async function y(){s&&Object.keys(s).length>0&&void 0!==u&&(n(1,o=u.view),function(e,t){for(const[n,r]of Object.entries(t))r&&(r&&"[object Function]"==={}.toString.call(r)?r(e.data(n)):e.change(n,A9.changeset().remove((()=>!0)).insert(r)))}(o,s),await o.resize().runAsync())}return j((()=>{g()})),e.$$set=e=>{"options"in e&&n(2,r=e.options),"spec"in e&&n(3,i=e.spec),"view"in e&&n(1,o=e.view),"signalListeners"in e&&n(4,a=e.signalListeners),"data"in e&&n(5,s=e.data)},e.$$.update=()=>{if(1056&e.$$.dirty&&(q9(s,p)||y(),n(10,p=s)),991&e.$$.dirty&&void 0!==c){if(q9(r,f,I9)){const e=function(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},r="height"in e||"height"in t;var i;return!("width"in e||"width"in t)||"width"in e&&"width"in t&&e.width===t.width||("width"in e&&"number"==typeof e.width?n.width=e.width:n.isExpensive=!0),!r||"height"in e&&"height"in t&&e.height===t.height||("height"in e&&"number"==typeof e.height?n.height=e.height:n.isExpensive=!0),[...(i=[e,t],new Set(i.flatMap((e=>Object.keys(e)))))].filter((e=>"width"!==e&&"height"!==e)).some((n=>!(n in e)||!(n in t)||!U9(e[n],t[n])))&&(n.isExpensive=!0),!(!1===n.width&&!1===n.height&&!n.isExpensive)&&n}(G9(i,r),G9(h,f)),t=a,s=d;if(e){if(e.isExpensive)m();else if(void 0!==u){const r=!q9(t,s);n(1,o=u.view),!1!==e.width&&o.width(e.width),!1!==e.height&&o.height(e.height),r&&(s&&W9(o,s),t&&H9(o,t)),o.runAsync()}}else q9(t,s)||void 0===u||(n(1,o=u.view),s&&W9(o,s),t&&H9(o,t),o.runAsync())}else m();n(7,f=r),n(8,d=a),n(9,h=i)}},[c,o,r,i,a,s,u,f,d,h,p,function(e){H[e?"unshift":"push"]((()=>{c=e,n(0,c)}))}]}class X9 extends ge{constructor(e){super(),me(this,e,Y9,V9,a,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function J9(e){let t,n,r;function i(t){e[6](t)}let o={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return void 0!==e[0]&&(o.view=e[0]),t=new X9({props:o}),H.push((()=>ce(t,"view",i))),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){fe(t.$$.fragment)},m(e,n){de(t,e,n),r=!0},p(e,[r]){const i={};2&r&&(i.spec=e[1]),4&r&&(i.data=e[2]),8&r&&(i.signalListeners=e[3]),16&r&&(i.options=e[4]),!n&&1&r&&(n=!0,i.view=e[0],Z((()=>n=!1))),t.$set(i)},i(e){r||(ae(t.$$.fragment,e),r=!0)},o(e){se(t.$$.fragment,e),r=!1},d(e){he(t,e)}}}function Z9(e,t,n){let r,{spec:i}=t,{options:o={}}=t,{data:a={}}=t,{signalListeners:s={}}=t,{view:l}=t;return e.$$set=e=>{"spec"in e&&n(1,i=e.spec),"options"in e&&n(5,o=e.options),"data"in e&&n(2,a=e.data),"signalListeners"in e&&n(3,s=e.signalListeners),"view"in e&&n(0,l=e.view)},e.$$.update=()=>{32&e.$$.dirty&&n(4,r={...o,mode:"vega"})},[l,i,a,s,r,o,function(e){l=e,n(0,l)},function(t){q.call(this,e,t)},function(t){q.call(this,e,t)}]}class Q9 extends ge{constructor(e){super(),me(this,e,Z9,J9,a,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function K9(e){let t,n;return t=new Q9({props:{spec:e[0]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.spec=e[0]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function eee(e){let t,n;return t=new Q9({props:{data:e[1],spec:e[0]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.data=e[1]),1&n&&(r.spec=e[0]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function tee(e){let t,n,r,i;const o=[eee,K9],a=[];function s(e,t){return e[1]&&e[0]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,[i]){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function nee(e,t,n){let r,i,{componentData:o}=t;return e.$$set=e=>{"componentData"in e&&n(2,o=e.componentData)},e.$$.update=()=>{4&e.$$.dirty&&n(1,({data:r,spec:i}=o),r,(n(0,i),n(2,o)))},[i,r,o]}class ree extends ge{constructor(e){super(),me(this,e,nee,tee,a,{componentData:2})}}function iee(t){let n,r,i=(t[0]?.text||"")+"";return{c(){n=_("p"),r=k(i),D(n,"data-component","text")},m(e,t){b(e,n,t),v(n,r)},p(e,[t]){1&t&&i!==(i=(e[0]?.text||"")+"")&&M(r,i)},i:e,o:e,d(e){e&&x(n)}}}function oee(e,t,n){let{componentData:r}=t;return e.$$set=e=>{"componentData"in e&&n(0,r=e.componentData)},[r]}class aee extends ge{constructor(e){super(),me(this,e,oee,iee,a,{componentData:0})}}function see(t){let n;return{c(){n=k(t[0])},m(e,t){b(e,n,t)},p(e,t){1&t&&M(n,e[0])},i:e,o:e,d(e){e&&x(n)}}}function lee(e){let t,n,r;var i=e[1];function o(e){return{props:{componentData:e[0]}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(1&r&&(a.componentData=e[0]),2&r&&i!==(i=e[1])){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function uee(e){let t,n,r,i;const o=[lee,see],a=[];function s(e,t){return e[1]?0:1}return t=s(e),n=a[t]=o[t](e),{c(){n.c(),r=E()},m(e,n){a[t].m(e,n),b(e,r,n),i=!0},p(e,[i]){let l=t;t=s(e),t===l?a[t].p(e,i):(ie(),se(a[l],1,1,(()=>{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}function cee(e,t,n){let r,{componentData:i}=t;const o={artifacts:Ie,dag:vt,heading:St,image:Tt,log:Lt,markdown:fi,progressBar:xi,text:aee,vegaChart:ree},a=null==i?void 0:i.type;return a&&(r=null==o?void 0:o[a],r||console.error("Unknown component type: ",a)),e.$$set=e=>{"componentData"in e&&n(0,i=e.componentData)},[i,r]}class fee extends ge{constructor(e){super(),me(this,e,cee,uee,a,{componentData:0})}}function dee(e,t,n){const r=e.slice();return r[3]=t[n],r[5]=n,r}function hee(e,t,n){const r=e.slice();return r[6]=t[n],r}function pee(e){let t,n,r,i,o=e[1],a=[];for(let t=0;tse(a[e],1,1,(()=>{a[e]=null}));return{c(){t=_("div"),n=_("table"),r=_("tbody");for(let e=0;ese(u[e],1,1,(()=>{u[e]=null}));return{c(){t=_("tr"),n=_("td"),r=k(s),i=C();for(let e=0;e{r=null})),oe())},i(e){n||(ae(r),n=!0)},o(e){se(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function vee(e,t,n){let r,i,{componentData:o}=t;return e.$$set=e=>{"componentData"in e&&n(2,o=e.componentData)},e.$$.update=()=>{4&e.$$.dirty&&n(1,({columns:r,data:i}=o),r,(n(0,i),n(2,o)))},[i,r,o]}class bee extends ge{constructor(e){super(),me(this,e,vee,yee,a,{componentData:2})}}function xee(e,t,n){const r=e.slice();return r[3]=t[n],r}function wee(e,t,n){const r=e.slice();return r[6]=t[n],r}function _ee(e,t,n){const r=e.slice();return r[9]=t[n],r}function $ee(e){let t,n,r,i,o,a,s,l=e[1],u=[];for(let t=0;tse(f[e],1,1,(()=>{f[e]=null}));return{c(){t=_("div"),n=_("table"),r=_("thead"),i=_("tr");for(let e=0;ese(o[e],1,1,(()=>{o[e]=null}));return{c(){t=_("tr");for(let e=0;e{r=null})),oe())},i(e){n||(ae(r),n=!0)},o(e){se(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Dee(e,t,n){let r,i,{componentData:o}=t;return e.$$set=e=>{"componentData"in e&&n(2,o=e.componentData)},e.$$.update=()=>{4&e.$$.dirty&&n(1,({columns:r,data:i}=o),r,(n(0,i),n(2,o)))},[i,r,o]}class See extends ge{constructor(e){super(),me(this,e,Dee,Aee,a,{componentData:2})}}function Mee(e){let t,n,r;var i=e[3];function o(e){return{props:{componentData:e[0]}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(1&r&&(a.componentData=e[0]),i!==(i=e[3])){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function Fee(e){let t,n,r=e[2]&&e[1]&&Mee(e);return{c(){r&&r.c(),t=E()},m(e,i){r&&r.m(e,i),b(e,t,i),n=!0},p(e,[n]){e[2]&&e[1]?r?(r.p(e,n),6&n&&ae(r,1)):(r=Mee(e),r.c(),ae(r,1),r.m(t.parentNode,t)):r&&(ie(),se(r,1,1,(()=>{r=null})),oe())},i(e){n||(ae(r),n=!0)},o(e){se(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Oee(e,t,n){let r,i,o,{componentData:a}=t;const s=o?bee:See;return e.$$set=e=>{"componentData"in e&&n(0,a=e.componentData)},e.$$.update=()=>{1&e.$$.dirty&&n(2,({columns:r,data:i,vertical:o}=a),r,(n(1,i),n(0,a)))},[a,i,r,s]}class Nee extends ge{constructor(e){super(),me(this,e,Oee,Fee,a,{componentData:0})}}function Tee(e,t,n){const r=e.slice();return r[3]=t[n],r}function zee(e){let t,n,r;var i=e[1];function o(e){return{props:{componentData:e[0]}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(1&r&&(a.componentData=e[0]),i!==(i=e[1])){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function Ree(e){let t,n,r;var i=e[1];function o(e){return{props:{componentData:e[0],$$slots:{default:[Pee]},$$scope:{ctx:e}}}}return i&&(t=T(i,o(e))),{c(){t&&fe(t.$$.fragment),n=E()},m(e,i){t&&de(t,e,i),b(e,n,i),r=!0},p(e,r){const a={};if(1&r&&(a.componentData=e[0]),65&r&&(a.$$scope={dirty:r,ctx:e}),i!==(i=e[1])){if(t){ie();const e=t;se(e.$$.fragment,1,0,(()=>{he(e,1)})),oe()}i?(t=T(i,o(e)),fe(t.$$.fragment),ae(t.$$.fragment,1),de(t,n.parentNode,n)):t=null}else i&&t.$set(a)},i(e){r||(t&&ae(t.$$.fragment,e),r=!0)},o(e){t&&se(t.$$.fragment,e),r=!1},d(e){e&&x(n),t&&he(t,e)}}}function Lee(e){let t,n;return t=new Iee({props:{componentData:e[3]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.componentData=e[3]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Pee(e){let t,n,r=e[0].contents,i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{a[l]=null})),oe(),n=a[t],n?n.p(e,i):(n=a[t]=o[t](e),n.c()),ae(n,1),n.m(r.parentNode,r))},i(e){i||(ae(n),i=!0)},o(e){se(n),i=!1},d(e){a[t].d(e),e&&x(r)}}}(e);return{c(){r&&r.c(),t=E()},m(e,i){r&&r.m(e,i),b(e,t,i),n=!0},p(e,[t]){e[1]&&r.p(e,t)},i(e){n||(ae(r),n=!0)},o(e){se(r),n=!1},d(e){r&&r.d(e),e&&x(t)}}}function Bee(e,t,n){let{componentData:r}=t;const i={artifacts:Ie,dag:vt,heading:St,image:Tt,log:Lt,markdown:fi,page:pi,progressBar:xi,section:Ci,subtitle:kt,table:Nee,text:aee,title:wt,vegaChart:ree};let o=null==i?void 0:i[r.type];return o||console.error("Unknown component type: ",r.type),e.$$set=e=>{"componentData"in e&&n(0,r=e.componentData)},[r,o]}class Iee extends ge{constructor(e){super(),me(this,e,Bee,jee,a,{componentData:0})}}function Uee(e){let t,n,r;const i=e[1].default,o=c(i,e,e[0],null);return{c(){t=_("main"),n=_("div"),o&&o.c(),D(n,"class","mainContainer svelte-13ho8jo"),D(t,"class","svelte-13ho8jo")},m(e,i){b(e,t,i),v(t,n),o&&o.m(n,null),r=!0},p(e,[t]){o&&o.p&&(!r||1&t)&&h(o,i,e,e[0],r?d(i,e[0],t,null):p(e[0]),null)},i(e){r||(ae(o,e),r=!0)},o(e){se(o,e),r=!1},d(e){e&&x(t),o&&o.d(e)}}}function qee(e,t,n){let{$$slots:r={},$$scope:i}=t;return e.$$set=e=>{"$$scope"in e&&n(0,i=e.$$scope)},[i,r]}class Wee extends ge{constructor(e){super(),me(this,e,qee,Uee,a,{})}}const Hee=/^[a-z0-9]+(-[a-z0-9]+)*$/,Gee=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function Vee(e){return{...Gee,...e}}const Yee=(e,t,n,r="")=>{const i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const e=i.pop(),n=i.pop(),o={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!Xee(o)?null:o}const o=i[0],a=o.split("-");if(a.length>1){const e={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Xee(e)?null:e}if(n&&""===r){const e={provider:r,prefix:"",name:o};return t&&!Xee(e,n)?null:e}return null},Xee=(e,t)=>!!e&&!(""!==e.provider&&!e.provider.match(Hee)||!(t&&""===e.prefix||e.prefix.match(Hee))||!e.name.match(Hee));function Jee(e,t,n=!1){const r=function t(n,r){if(void 0!==e.icons[n])return Object.assign({},e.icons[n]);if(r>5)return null;const i=e.aliases;if(i&&void 0!==i[n]){const e=i[n],o=t(e.parent,r+1);return o?function(e,t){const n={...e};for(const e in Gee){const r=e;if(void 0!==t[r]){const e=t[r];if(void 0===n[r]){n[r]=e;continue}switch(r){case"rotate":n[r]=(n[r]+e)%4;break;case"hFlip":case"vFlip":n[r]=e!==n[r];break;default:n[r]=e}}}return n}(o,e):o}const o=e.chars;return!r&&o&&void 0!==o[n]?t(o[n],r+1):null}(t,0);if(r)for(const t in Gee)void 0===r[t]&&void 0!==e[t]&&(r[t]=e[t]);return r&&n?Vee(r):r}function Zee(e,t,n){n=n||{};const r=[];if("object"!=typeof e||"object"!=typeof e.icons)return r;e.not_found instanceof Array&&e.not_found.forEach((e=>{t(e,null),r.push(e)}));const i=e.icons;Object.keys(i).forEach((n=>{const i=Jee(e,n,!0);i&&(t(n,i),r.push(n))}));const o=n.aliases||"all";if("none"!==o&&"object"==typeof e.aliases){const n=e.aliases;Object.keys(n).forEach((i=>{if("variations"===o&&function(e){for(const t in Gee)if(void 0!==e[t])return!0;return!1}(n[i]))return;const a=Jee(e,i,!0);a&&(t(i,a),r.push(i))}))}return r}const Qee={provider:"string",aliases:"object",not_found:"object"};for(const e in Gee)Qee[e]=typeof Gee[e];function Kee(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;for(const t in Qee)if(void 0!==e[t]&&typeof e[t]!==Qee[t])return null;const n=t.icons;for(const e in n){const t=n[e];if(!e.match(Hee)||"string"!=typeof t.body)return null;for(const e in Gee)if(void 0!==t[e]&&typeof t[e]!=typeof Gee[e])return null}const r=t.aliases;if(r)for(const e in r){const t=r[e],i=t.parent;if(!e.match(Hee)||"string"!=typeof i||!n[i]&&!r[i])return null;for(const e in Gee)if(void 0!==t[e]&&typeof t[e]!=typeof Gee[e])return null}return t}let ete=Object.create(null);try{const e=window||self;e&&1===e._iconifyStorage.version&&(ete=e._iconifyStorage.storage)}catch(e){}function tte(e,t){void 0===ete[e]&&(ete[e]=Object.create(null));const n=ete[e];return void 0===n[t]&&(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}(e,t)),n[t]}function nte(e,t){if(!Kee(t))return[];const n=Date.now();return Zee(t,((t,r)=>{r?e.icons[t]=r:e.missing[t]=n}))}let rte=!1;function ite(e){return"boolean"==typeof e&&(rte=e),rte}function ote(e,t){const n=Yee(e,!0,rte);if(!n)return!1;return function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=Object.freeze(Vee(n)),!0}catch(e){}return!1}(tte(n.provider,n.prefix),n.name,t)}const ate=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});const ste=/(-?[0-9.]*[0-9]+[0-9.]*)/g,lte=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ute(e,t,n){if(1===t)return e;if(n=void 0===n?100:n,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const r=e.split(ste);if(null===r||!r.length)return e;const i=[];let o=r.shift(),a=lte.test(o);for(;;){if(a){const e=parseFloat(o);isNaN(e)?i.push(o):i.push(Math.ceil(e*t*n)/n)}else i.push(o);if(o=r.shift(),void 0===o)return i.join("");a=!a}}function cte(e){let t="";switch(e.hAlign){case"left":t+="xMin";break;case"right":t+="xMax";break;default:t+="xMid"}switch(e.vAlign){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet",t}const fte=/\sid="(\S+)"/g,dte="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let hte=0;function pte(e,t=dte){const n=[];let r;for(;r=fte.exec(e);)n.push(r[1]);return n.length?(n.forEach((n=>{const r="function"==typeof t?t(n):t+(hte++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+r+"$3")})),e):e}const mte=Object.create(null);function gte(e){return mte[e]||mte[""]}function yte(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:void 0===e.path?"/":e.path,maxURL:e.maxURL?e.maxURL:500,rotate:e.rotate?e.rotate:750,timeout:e.timeout?e.timeout:5e3,random:!0===e.random,index:e.index?e.index:0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const vte=Object.create(null),bte=["https://api.simplesvg.com","https://api.unisvg.com"],xte=[];for(;bte.length>0;)1===bte.length||Math.random()>.5?xte.push(bte.shift()):xte.push(bte.pop());function wte(e,t){const n=yte(t);return null!==n&&(vte[e]=n,!0)}function _te(e){return vte[e]}vte[""]=yte({resources:["https://api.iconify.design"].concat(xte)});const $te=(e,t)=>{let n=e,r=-1!==n.indexOf("?");return Object.keys(t).forEach((e=>{let i;try{i=function(e){switch(typeof e){case"boolean":return e?"true":"false";case"number":case"string":return encodeURIComponent(e);default:throw new Error("Invalid parameter")}}(t[e])}catch(e){return}n+=(r?"&":"?")+encodeURIComponent(e)+"="+i,r=!0})),n},kte={},Cte={};let Ete=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}return null})();const Ate={prepare:(e,t,n)=>{const r=[];let i=kte[t];void 0===i&&(i=function(e,t){const n=_te(e);if(!n)return 0;let r;if(n.maxURL){let e=0;n.resources.forEach((t=>{const n=t;e=Math.max(e,n.length)}));const i=$te(t+".json",{icons:""});r=n.maxURL-e-n.path.length-i.length}else r=0;const i=e+":"+t;return Cte[e]=n.path,kte[i]=r,r}(e,t));const o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach(((n,l)=>{s+=n.length+1,s>=i&&l>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=n.length),a.icons.push(n)})),r.push(a),r},send:(e,t,n)=>{if(!Ete)return void n("abort",424);let r=function(e){if("string"==typeof e){if(void 0===Cte[e]){const t=_te(e);if(!t)return"/";Cte[e]=t.path}return Cte[e]}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");r+=$te(e+".json",{icons:n});break}case"custom":{const e=t.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let i=503;Ete(e+r).then((e=>{const t=e.status;if(200===t)return i=501,e.json();setTimeout((()=>{n(function(e){return 404===e}(t)?"abort":"next",t)}))})).then((e=>{"object"==typeof e&&null!==e?setTimeout((()=>{n("success",e)})):setTimeout((()=>{n("next",i)}))})).catch((()=>{n("next",i)}))}};const Dte=Object.create(null),Ste=Object.create(null);function Mte(e,t){e.forEach((e=>{const n=e.provider;if(void 0===Dte[n])return;const r=Dte[n],i=e.prefix,o=r[i];o&&(r[i]=o.filter((e=>e.id!==t)))}))}let Fte=0;var Ote={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Nte(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let t=e.resources.slice(0);for(a=[];t.length>1;){const e=Math.floor(Math.random()*t.length);a.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}a=a.concat(t)}else a=e.resources.slice(o).concat(e.resources.slice(0,o));const s=Date.now();let l,u="pending",c=0,f=null,d=[],h=[];function p(){f&&(clearTimeout(f),f=null)}function m(){"pending"===u&&(u="aborted"),p(),d.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),d=[]}function g(e,t){t&&(h=[]),"function"==typeof e&&h.push(e)}function y(){u="failed",h.forEach((e=>{e(void 0,l)}))}function v(){d.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),d=[]}function b(){if("pending"!==u)return;p();const r=a.shift();if(void 0===r)return d.length?void(f=setTimeout((()=>{p(),"pending"===u&&(v(),y())}),e.timeout)):void y();const i={status:"pending",resource:r,callback:(t,n)=>{!function(t,n,r){const i="success"!==n;switch(d=d.filter((e=>e!==t)),u){case"pending":break;case"failed":if(i||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=r,void y();if(i)return l=r,void(d.length||(a.length?b():y()));if(p(),v(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}u="completed",h.forEach((e=>{e(r)}))}(i,t,n)}};d.push(i),c++,f=setTimeout(b,e.rotate),n(r,t,i.callback)}return"function"==typeof r&&h.push(r),setTimeout(b),function(){return{startTime:s,payload:t,status:u,queriesSent:c,queriesPending:d.length,subscribe:g,abort:m}}}function Tte(e){const t=function(e){if(!("object"==typeof e&&"object"==typeof e.resources&&e.resources instanceof Array&&e.resources.length))throw new Error("Invalid Reduncancy configuration");const t=Object.create(null);let n;for(n in Ote)void 0!==e[n]?t[n]=e[n]:t[n]=Ote[n];return t}(e);let n=[];function r(){n=n.filter((e=>"pending"===e().status))}const i={query:function(e,i,o){const a=Nte(t,e,i,((e,t)=>{r(),o&&o(e,t)}));return n.push(a),a},find:function(e){const t=n.find((t=>e(t)));return void 0!==t?t:null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r};return i}function zte(){}const Rte=Object.create(null);function Lte(e,t,n){let r,i;if("string"==typeof e){const t=gte(e);if(!t)return n(void 0,424),zte;i=t.send;const o=function(e){if(void 0===Rte[e]){const t=_te(e);if(!t)return;const n={config:t,redundancy:Tte(t)};Rte[e]=n}return Rte[e]}(e);o&&(r=o.redundancy)}else{const t=yte(e);if(t){r=Tte(t);const n=gte(e.resources?e.resources[0]:"");n&&(i=n.send)}}return r&&i?r.query(t,i,n)().abort:(n(void 0,424),zte)}const Pte={};function jte(){}const Bte=Object.create(null),Ite=Object.create(null),Ute=Object.create(null),qte=Object.create(null);function Wte(e,t){void 0===Ute[e]&&(Ute[e]=Object.create(null));const n=Ute[e];n[t]||(n[t]=!0,setTimeout((()=>{n[t]=!1,function(e,t){void 0===Ste[e]&&(Ste[e]=Object.create(null));const n=Ste[e];n[t]||(n[t]=!0,setTimeout((()=>{if(n[t]=!1,void 0===Dte[e]||void 0===Dte[e][t])return;const r=Dte[e][t].slice(0);if(!r.length)return;const i=tte(e,t);let o=!1;r.forEach((n=>{const r=n.icons,a=r.pending.length;r.pending=r.pending.filter((n=>{if(n.prefix!==t)return!0;const a=n.name;if(void 0!==i.icons[a])r.loaded.push({provider:e,prefix:t,name:a});else{if(void 0===i.missing[a])return o=!0,!0;r.missing.push({provider:e,prefix:t,name:a})}return!1})),r.pending.length!==a&&(o||Mte([{provider:e,prefix:t}],n.id),n.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),n.abort))}))})))}(e,t)})))}const Hte=Object.create(null);function Gte(e,t,n){void 0===Ite[e]&&(Ite[e]=Object.create(null));const r=Ite[e];void 0===qte[e]&&(qte[e]=Object.create(null));const i=qte[e];void 0===Bte[e]&&(Bte[e]=Object.create(null));const o=Bte[e];void 0===r[t]?r[t]=n:r[t]=r[t].concat(n).sort(),i[t]||(i[t]=!0,setTimeout((()=>{i[t]=!1;const n=r[t];delete r[t];const a=gte(e);if(!a)return void function(){const n=(""===e?"":"@"+e+":")+t,r=Math.floor(Date.now()/6e4);Hte[n]{Lte(e,n,((r,i)=>{const a=tte(e,t);if("object"!=typeof r){if(404!==i)return;const e=Date.now();n.icons.forEach((t=>{a.missing[t]=e}))}else try{const n=nte(a,r);if(!n.length)return;const i=o[t];n.forEach((e=>{delete i[e]})),Pte.store&&Pte.store(e,r)}catch(e){console.error(e)}Wte(e,t)}))}))})))}const Vte=(e,t)=>{const n=function(e,t=!0,n=!1){const r=[];return e.forEach((e=>{const i="string"==typeof e?Yee(e,!1,n):e;t&&!Xee(i,n)||r.push({provider:i.provider,prefix:i.prefix,name:i.name})})),r}(e,!0,ite()),r=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort(((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)));let r={provider:"",prefix:"",name:""};return e.forEach((e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;const i=e.provider,o=e.prefix,a=e.name;void 0===n[i]&&(n[i]=Object.create(null));const s=n[i];void 0===s[o]&&(s[o]=tte(i,o));const l=s[o];let u;u=void 0!==l.icons[a]?t.loaded:""===o||void 0!==l.missing[a]?t.missing:t.pending;const c={provider:i,prefix:o,name:a};u.push(c)})),t}(n);if(!r.pending.length){let e=!0;return t&&setTimeout((()=>{e&&t(r.loaded,r.missing,r.pending,jte)})),()=>{e=!1}}const i=Object.create(null),o=[];let a,s;r.pending.forEach((e=>{const t=e.provider,n=e.prefix;if(n===s&&t===a)return;a=t,s=n,o.push({provider:t,prefix:n}),void 0===Bte[t]&&(Bte[t]=Object.create(null));const r=Bte[t];void 0===r[n]&&(r[n]=Object.create(null)),void 0===i[t]&&(i[t]=Object.create(null));const l=i[t];void 0===l[n]&&(l[n]=[])}));const l=Date.now();return r.pending.forEach((e=>{const t=e.provider,n=e.prefix,r=e.name,o=Bte[t][n];void 0===o[r]&&(o[r]=l,i[t][n].push(r))})),o.forEach((e=>{const t=e.provider,n=e.prefix;i[t][n].length&&Gte(t,n,i[t][n])})),t?function(e,t,n){const r=Fte++,i=Mte.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach((e=>{const t=e.provider,n=e.prefix;void 0===Dte[t]&&(Dte[t]=Object.create(null));const r=Dte[t];void 0===r[n]&&(r[n]=[]),r[n].push(o)})),i}(t,r,o):jte},Yte="iconify2",Xte="iconify",Jte=Xte+"-count",Zte=Xte+"-version",Qte=36e5,Kte={local:!0,session:!0};let ene=!1;const tne={local:0,session:0},nne={local:[],session:[]};let rne="undefined"==typeof window?{}:window;function ine(e){const t=e+"Storage";try{if(rne&&rne[t]&&"number"==typeof rne[t].length)return rne[t]}catch(e){}return Kte[e]=!1,null}function one(e,t,n){try{return e.setItem(Jte,n.toString()),tne[t]=n,!0}catch(e){return!1}}function ane(e){const t=e.getItem(Jte);if(t){const e=parseInt(t);return e||0}return 0}const sne=()=>{if(ene)return;ene=!0;const e=Math.floor(Date.now()/Qte)-168;function t(t){const n=ine(t);if(!n)return;const r=t=>{const r=Xte+t.toString(),i=n.getItem(r);if("string"!=typeof i)return!1;let o=!0;try{const t=JSON.parse(i);if("object"!=typeof t||"number"!=typeof t.cached||t.cached0}}catch(e){o=!1}return o||n.removeItem(r),o};try{const e=n.getItem(Zte);if(e!==Yte)return e&&function(e){try{const t=ane(e);for(let n=0;n=0;e--)r(e)||(e===i-1?i--:nne[t].push(e));one(n,t,i)}catch(e){}}for(const e in Kte)t(e)},lne=(e,t)=>{function n(n){if(!Kte[n])return!1;const r=ine(n);if(!r)return!1;let i=nne[n].shift();if(void 0===i&&(i=tne[n],!one(r,n,i+1)))return!1;try{const n={cached:Math.floor(Date.now()/Qte),provider:e,data:t};r.setItem(Xte+i.toString(),JSON.stringify(n))}catch(e){return!1}return!0}ene||sne(),Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))},une=/[\s,]+/;function cne(e,t){t.split(une).forEach((t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}}))}function fne(e,t){t.split(une).forEach((t=>{const n=t.trim();switch(n){case"left":case"center":case"right":e.hAlign=n;break;case"top":case"middle":case"bottom":e.vAlign=n;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}}))}function dne(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}const hne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"};function pne(e,t){const n=function(e,t){const n={};for(const r in e){const i=r;if(n[i]=e[i],void 0===t[i])continue;const o=t[i];switch(i){case"inline":case"slice":"boolean"==typeof o&&(n[i]=o);break;case"hFlip":case"vFlip":!0===o&&(n[i]=!n[i]);break;case"hAlign":case"vAlign":"string"==typeof o&&""!==o&&(n[i]=o);break;case"width":case"height":("string"==typeof o&&""!==o||"number"==typeof o&&o||null===o)&&(n[i]=o);break;case"rotate":"number"==typeof o&&(n[i]+=o)}}return n}(ate,t),r={...hne};let i="string"==typeof t.style?t.style:"";for(let e in t){const o=t[e];if(void 0!==o)switch(e){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[e]=!0===o||"true"===o||1===o;break;case"flip":"string"==typeof o&&cne(n,o);break;case"align":"string"==typeof o&&fne(n,o);break;case"color":i=i+(i.length>0&&";"!==i.trim().slice(-1)?";":"")+"color: "+o+"; ";break;case"rotate":"string"==typeof o?n[e]=dne(o):"number"==typeof o&&(n[e]=o);break;case"ariaHidden":case"aria-hidden":!0!==o&&"true"!==o&&delete r["aria-hidden"];break;default:if("on:"===e.slice(0,3))break;void 0===ate[e]&&(r[e]=o)}}const o=function(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let r,i,o=e.body;[e,t].forEach((e=>{const t=[],r=e.hFlip,i=e.vFlip;let a,s=e.rotate;switch(r?i?s+=2:(t.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),t.push("scale(-1 1)"),n.top=n.left=0):i&&(t.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),t.push("scale(1 -1)"),n.top=n.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:a=n.height/2+n.top,t.unshift("rotate(90 "+a.toString()+" "+a.toString()+")");break;case 2:t.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:a=n.width/2+n.left,t.unshift("rotate(-90 "+a.toString()+" "+a.toString()+")")}s%2==1&&(0===n.left&&0===n.top||(a=n.left,n.left=n.top,n.top=a),n.width!==n.height&&(a=n.width,n.width=n.height,n.height=a)),t.length&&(o=''+o+"")})),null===t.width&&null===t.height?(i="1em",r=ute(i,n.width/n.height)):null!==t.width&&null!==t.height?(r=t.width,i=t.height):null!==t.height?(i=t.height,r=ute(i,n.width/n.height)):(r=t.width,i=ute(r,n.height/n.width)),"auto"===r&&(r=n.width),"auto"===i&&(i=n.height),r="string"==typeof r?r:r.toString()+"",i="string"==typeof i?i:i.toString()+"";const a={attributes:{width:r,height:i,preserveAspectRatio:cte(t),viewBox:n.left.toString()+" "+n.top.toString()+" "+n.width.toString()+" "+n.height.toString()},body:o};return t.inline&&(a.inline=!0),a}(e,n);for(let e in o.attributes)r[e]=o.attributes[e];o.inline&&(i="vertical-align: -0.125em; "+i),""!==i&&(r.style=i);let a=0,s=t.id;return"string"==typeof s&&(s=s.replace(/-/g,"_")),{attributes:r,body:pte(o.body,s?()=>s+"ID"+a++:"iconifySvelte")}}var mne;if(ite(!0),mne=Ate,mte[""]=mne,"undefined"!=typeof document&&"undefined"!=typeof window){Pte.store=lne,sne();const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach((e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t="string"==typeof e.provider?e.provider:""),rte&&""===t&&("string"!=typeof e.prefix||""===e.prefix)){let t=!1;return Kee(e)&&(e.prefix="",Zee(e,((e,n)=>{n&&ote(e,n)&&(t=!0)}))),t}return!("string"!=typeof e.prefix||!Xee({provider:t,prefix:e.prefix,name:"a"}))&&!!nte(tte(t,e.prefix),e)}(e))&&console.error(n)}catch(e){console.error(n)}}))}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const r=t[e];if("object"!=typeof r||!r||void 0===r.resources)continue;wte(e,r)||console.error(n)}catch(q6){console.error(n)}}}}function gne(e,t,n,r,i){function o(){t.loading&&(t.loading.abort(),t.loading=null)}if("object"==typeof e&&null!==e&&"string"==typeof e.body)return t.name="",o(),{data:Vee(e)};let a;if("string"!=typeof e||null===(a=Yee(e,!1,!0)))return o(),null;const s=function(e){const t="string"==typeof e?Yee(e,!0,rte):e;return t?function(e,t){const n=e.icons[t];return void 0===n?null:n}(tte(t.provider,t.prefix),t.name):null}(a);if(null===s)return!n||t.loading&&t.loading.name===e||(o(),t.name="",t.loading={name:e,abort:Vte([a],r)}),null;o(),t.name!==e&&(t.name=e,i&&!t.destroyed&&i(e));const l=["iconify"];return""!==a.prefix&&l.push("iconify--"+a.prefix),""!==a.provider&&l.push("iconify--"+a.provider),{data:s,classes:l}}function yne(e){let n,r=e[0].body+"",i=[e[0].attributes],o={};for(let e=0;e{"function"==typeof n.onLoad&&n.onLoad(e);B()("load",{icon:e})};function u(){r(3,s++,s)}return P((()=>{r(2,a=!0)})),j((()=>{r(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),r(1,i.loading=null,i))})),e.$$set=e=>{r(6,n=t(t({},n),m(e)))},e.$$.update=()=>{{const s=gne(n.icon,i,a,u,l);r(0,o=s?(e=s.data,t=n,e?pne(e,t):null):null),o&&s.classes&&r(0,o.attributes.class=("string"==typeof n.class?n.class+" ":"")+s.classes.join(" "),o)}var e,t},n=m(n),[o,i,a,s]}class xne extends ge{constructor(e){super(),me(this,e,bne,vne,a,{})}}function wne(e){let t,n,r,o,a,s,l,u,c;return r=new xne({props:{icon:"mdi:close"}}),s=new Iee({props:{componentData:e[1]}}),{c(){t=_("div"),n=_("span"),fe(r.$$.fragment),o=C(),a=_("div"),fe(s.$$.fragment),D(n,"class","cancelButton svelte-1hhf5ym"),D(a,"class","modalContainer"),D(t,"class","modal svelte-1hhf5ym"),D(t,"data-component","modal")},m(i,f){b(i,t,f),v(t,n),de(r,n,null),v(t,o),v(t,a),de(s,a,null),l=!0,u||(c=[A(a,"click",$ne),A(t,"click",e[3])],u=!0)},p(e,t){const n={};2&t&&(n.componentData=e[1]),s.$set(n)},i(e){l||(ae(r.$$.fragment,e),ae(s.$$.fragment,e),l=!0)},o(e){se(r.$$.fragment,e),se(s.$$.fragment,e),l=!1},d(e){e&&x(t),he(r),he(s),u=!1,i(c)}}}function _ne(e){let t,n,r,i,o=e[0]&&e[1]&&wne(e);return{c(){o&&o.c(),t=E()},m(a,s){o&&o.m(a,s),b(a,t,s),n=!0,r||(i=A(window,"keyup",e[2]),r=!0)},p(e,[n]){e[0]&&e[1]?o?(o.p(e,n),3&n&&ae(o,1)):(o=wne(e),o.c(),ae(o,1),o.m(t.parentNode,t)):o&&(ie(),se(o,1,1,(()=>{o=null})),oe())},i(e){n||(ae(o),n=!0)},o(e){se(o),n=!1},d(e){o&&o.d(e),e&&x(t),r=!1,i()}}}const $ne=e=>{e?.stopImmediatePropagation()};function kne(e,t,n){let r;u(e,_e,(e=>n(1,r=e)));let{componentData:i}=t;return e.$$set=e=>{"componentData"in e&&n(0,i=e.componentData)},[i,r,function(e){"Escape"===e.code&&_e.set(void 0)},function(e){e.stopImmediatePropagation(),_e.set(void 0)}]}class Cne extends ge{constructor(e){super(),me(this,e,kne,_ne,a,{componentData:0})}}function Ene(e,t,n){const r=e.slice();return r[2]=t[n][0],r[3]=t[n][1],r}function Ane(e,t,n){const r=e.slice();return r[6]=t[n],r}function Dne(e){let t,n,r=e[2]+"";return{c(){t=_("span"),n=k(r),D(t,"class","pageId svelte-1kdpgko")},m(e,r){b(e,t,r),v(t,n)},p(e,t){1&t&&r!==(r=e[2]+"")&&M(n,r)},d(e){e&&x(t)}}}function Sne(e){let t,n,r,i,o,a,s=e[6]+"";function l(){return e[1](e[6])}return{c(){t=_("li"),n=_("button"),r=k(s),i=C(),D(n,"class","textButton"),D(t,"class","sectionLink svelte-1kdpgko")},m(e,s){b(e,t,s),v(t,n),v(n,r),v(t,i),o||(a=A(n,"click",l),o=!0)},p(t,n){e=t,1&n&&s!==(s=e[6]+"")&&M(r,s)},d(e){e&&x(t),o=!1,a()}}}function Mne(e){let t,n,r,i,o=e[2]&&Dne(e),a=e[3]||[],s=[];for(let t=0;t{"pageHierarchy"in e&&n(0,r=e.pageHierarchy)},[r,e=>function(e){const t=document.querySelector(`[data-section-id="${e}"]`);null==t||t.scrollIntoView({behavior:"smooth"})}(e)]}class Nne extends ge{constructor(e){super(),me(this,e,One,Fne,a,{pageHierarchy:0})}}const{Boolean:Tne}=y;function zne(e,t,n){const r=e.slice();return r[5]=t[n],r}function Rne(e){let t,n;return t=new Nne({props:{pageHierarchy:$e(e[0]?.components)}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.pageHierarchy=$e(e[0]?.components)),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Lne(e){let t,n;return t=new Iee({props:{componentData:e[5]}}),{c(){fe(t.$$.fragment)},m(e,r){de(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.componentData=e[5]),t.$set(r)},i(e){n||(ae(t.$$.fragment,e),n=!0)},o(e){se(t.$$.fragment,e),n=!1},d(e){he(t,e)}}}function Pne(e){let t,n,r=e[0]?.components||[],i=[];for(let t=0;tse(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e{l=null})),oe())},i(e){s||(ae(n.$$.fragment,e),ae(i.$$.fragment,e),ae(l),s=!0)},o(e){se(n.$$.fragment,e),se(i.$$.fragment,e),se(l),s=!1},d(e){e&&x(t),he(n),he(i),e&&x(o),l&&l.d(e),e&&x(a)}}}function Ine(e,t,n){let r,i;u(e,xe,(e=>n(0,r=e))),u(e,_e,(e=>n(1,i=e)));let{cardDataId:o}=t;(e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));xe.set(t)}catch(e){fetch("/card-example.json").then((e=>e.json())).then((e=>{xe.set(e)})).catch(console.error)}})(o);const a=new URLSearchParams(null===window||void 0===window?void 0:window.location.search);let s=Boolean(a.get("embed"));return e.$$set=e=>{"cardDataId"in e&&n(3,o=e.cardDataId)},[r,i,s,o]}class Une extends ge{constructor(e){super(),me(this,e,Ine,Bne,a,{cardDataId:3})}}var qne;let Wne;try{const e=window.mfCardDataId,t=window.mfContainerId,n=null===(qne=document.querySelector(`[data-container="${t}"]`))||void 0===qne?void 0:qne.querySelector(".card_app");Wne=new Une({target:null!=n?n:document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return Wne}(); diff --git a/metaflow/plugins/cards/ui/package.json b/metaflow/plugins/cards/ui/package.json index 941cd01026d..915fca7a880 100644 --- a/metaflow/plugins/cards/ui/package.json +++ b/metaflow/plugins/cards/ui/package.json @@ -47,7 +47,6 @@ "dependencies": { "@iconify/svelte": "^2.1.1", "@rollup/plugin-json": "^6.0.1", - "chart.js": "^3.7.0", "svelte-markdown": "^0.2.1", "svelte-vega": "^2.1.0", "vega": "^5.26.1", diff --git a/metaflow/plugins/cards/ui/src/components/bar-chart.svelte b/metaflow/plugins/cards/ui/src/components/bar-chart.svelte deleted file mode 100644 index 0d88591fcff..00000000000 --- a/metaflow/plugins/cards/ui/src/components/bar-chart.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - - -
    - -
    - - diff --git a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte index b7fd2cf6175..edc4f9ed442 100644 --- a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte @@ -2,11 +2,9 @@ import type { SvelteComponentDev } from "svelte/internal"; import type * as types from "../types"; import Artifacts from "./artifacts.svelte"; - import BarChart from "./bar-chart.svelte"; import Dag from "./dag/dag.svelte"; import Heading from "./heading.svelte"; import Image from "./image.svelte"; - import LineChart from "./line-chart.svelte"; import Log from "./log.svelte"; import Markdown from "./markdown.svelte"; import Page from "./page.svelte"; @@ -23,11 +21,9 @@ const typesMap: Record = { artifacts: Artifacts, - barChart: BarChart, dag: Dag, heading: Heading, image: Image, - lineChart: LineChart, log: Log, markdown: Markdown, page: Page, diff --git a/metaflow/plugins/cards/ui/src/components/line-chart.svelte b/metaflow/plugins/cards/ui/src/components/line-chart.svelte deleted file mode 100644 index 1f5173309b9..00000000000 --- a/metaflow/plugins/cards/ui/src/components/line-chart.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - - -
    - -
    - - diff --git a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte index 13f6d7c3691..bca6525ec69 100644 --- a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte @@ -1,13 +1,11 @@